[ Mini Kiebo ]
Server: Windows NT DESKTOP-5B8S0D4 6.2 build 9200 (Windows 8 Professional Edition) i586
Path:
D:
/
Download
/
Senam Line Dance Sidoarjo_files
/
[
Home
]
File: y3qu_JJ_D0x.js.download
;/*FB_PKG_DELIM*/ __d("WAWamPrivateStatsToken",["WACryptoEd25519","WACryptoPrimitives"],(function(a,b,c,d,e,f,g){"use strict";function a(a,b){return d("WACryptoEd25519").runInAllocationScope(function(){var c,e=(c=d("WACryptoEd25519")).p3Element(),f=c.allocate(Uint8Array,32);f.set(b);h(f);d("WACryptoPrimitives").lowlevel.scalarbase(e,f);f=c.hashToPoint(a);var g=d("WACryptoPrimitives").lowlevel.add;g(f,e);g=new Uint8Array(32);c.pack(g,f);return g})}function b(a,b,c){return d("WACryptoEd25519").runInAllocationScope(function(){var e=d("WACryptoEd25519").p3Element();if(d("WACryptoEd25519").unpack(e,a))return null;var f=d("WACryptoEd25519").p3Element();if(d("WACryptoEd25519").unpackneg(f,c)!==0)return null;var g=d("WACryptoEd25519").allocate(Uint8Array,32);g.set(b);h(g);var i=d("WACryptoEd25519").p3Element();d("WACryptoPrimitives").lowlevel.scalarmult(i,f,g);f=d("WACryptoPrimitives").lowlevel.add;f(e,i);g=new Uint8Array(32);d("WACryptoEd25519").pack(g,e);return g})}function h(a){a[0]&=248,a[31]&=127,a[31]|=64}g.blindToken=a;g.unblindToken=b}),98); __d("WAACSTokenUtils",["WABinary","WACryptoDependencies","WACryptoPrimitives","WAWamPrivateStatsToken"],(function(a,b,c,d,e,f,g){"use strict";function a(){var a=new Uint8Array(32);d("WACryptoDependencies").getCrypto().getRandomValues(a);var b=new Uint8Array(32);d("WACryptoDependencies").getCrypto().getRandomValues(b);var c=d("WAWamPrivateStatsToken").blindToken(a,b);return{blindedToken:c,blindingFactor:b,token:a}}function b(a){var b=a.token;a=a.unblindedSignedToken;b=d("WABinary").Binary.build(b,a);return d("WACryptoPrimitives").hash(b.readByteArray())}g.getBlindedToken=a;g.getSharedSecret=b}),98); __d("WAArrayBuffersConcat",[],(function(a,b,c,d,e,f){"use strict";function a(){for(var a=arguments.length,b=new Array(a),c=0;c<a;c++)b[c]=arguments[c];var d=b.reduce(function(a,b){return a+b.byteLength},0),e=new Uint8Array(d),f=0;b.forEach(function(a){e.set(new Uint8Array(a),f),f+=a.byteLength});return e.buffer}f.concatArrayBuffers=a}),66); __d("WAArrayMove",[],(function(a,b,c,d,e,f){"use strict";var g=function(a,b,c){c=c<0?a.length+c:c;b=a.splice(b,1)[0];a.splice(c,0,b)};a=function(a,b,c){a=a.slice();g(a,b,c);return a};f.arrayMoveMutate=g;f.arrayMove=a}),66); __d("WAArrayMoveToFirst",[],(function(a,b,c,d,e,f){"use strict";function a(a,b){var c,d=!1;for(c=0;c<a.length;c++)if(a[c]===b){d=!0;break}if(d){b=a[c];a.splice(c,1);a.unshift(b)}}f["default"]=a}),66); __d("WAArraysShallowEqual",[],(function(a,b,c,d,e,f){"use strict";function g(a,b){return a===b}function a(a,b,c){c===void 0&&(c=g);if(a===b)return!0;return a.length!==b.length?!1:a.every(function(a,d){return c(a,b[d])})}f["default"]=a}),66); __d("WAAsyncCache",["WAAbortError","WAMemoizeConcurrent","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";function a(a,e,f){return c("WAMemoizeConcurrent")(a,function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){if(b==null?void 0:b.signal.aborted)throw new(d("WAAbortError").AbortError)();var c=a(b),g=(yield e.get(c,b));if(b==null?void 0:b.signal.aborted)throw new(d("WAAbortError").AbortError)();if(g!=null)return g;g=(yield f(b));if(b==null?void 0:b.signal.aborted)throw new(d("WAAbortError").AbortError)();yield e.set(c,g,b);return g});function g(a){return c.apply(this,arguments)}return g}())}g["default"]=a}),98); __d("WABackendHandleError",["Promise","WADeprecatedWapParser","WALogger"],(function(a,b,c,d,e,f,g){"use strict";var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Unknown error code: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Invalid stanza sent (smax-invalid)"]);j=function(){return a};return a}var k={SMAX_INVALID:479},l=new(c("WADeprecatedWapParser"))("errorParser",function(a){a.assertTag("error");a=a.attrInt("code");switch(a){case k.SMAX_INVALID:return m();default:return n(a)}});function a(a){l.parse(a);return(h||(h=b("Promise"))).resolve("NO_ACK")}function m(){d("WALogger").ERROR(j()).devConsole("check tracelogs for more info").sendLogs("smax-invalid")}function n(a){d("WALogger").ERROR(i(),a).sendLogs("unknown-error-code")}g.backendErrorParser=l;g.handleError=a}),98); __d("WABackoffDelay",["Promise","WAPromiseDelays","WARetryableError","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){"use strict";var h,i={retries:Infinity};function a(a,b){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){a=babelHelpers["extends"]({},i,a);var f=a.delay,g=a.signal;a=a.retries;var j=0,k=Date.now(),l=null,m=function(a){return(h||(h=b("Promise"))).reject(new(c("WARetryableError"))(a))};try{k=Date.now();return yield e(m,j,g)}catch(a){j++;if(!(a instanceof c("WARetryableError")))throw a;l=a}while(j<=a){var n=Date.now()-k;n=f({iterationCount:j,taskDuration:n});yield d("WAPromiseDelays").delayMs(n,g);try{k=Date.now();return yield e(m,j,g)}catch(a){j++;if(!(a instanceof c("WARetryableError")))throw a;l=a}}if(!l)throw c("err")("assert: backoff completed without error or result");n=l.source;throw n});return j.apply(this,arguments)}g.backoff=a}),98); __d("WABase64Equal",[],(function(a,b,c,d,e,f){"use strict";function a(a,b){var c=a.length,d=b.length;switch(c-d){case-2:return b.charCodeAt(c)===61&&b.charCodeAt(c+1)===61&&b.substr(0,c)===a;case-1:return b.charCodeAt(c)===61&&b.substr(0,c)===a;case 0:return a===b;case 1:return a.charCodeAt(d)===61&&a.substr(0,d)===b;case 2:return a.charCodeAt(d)===61&&a.charCodeAt(d+1)===61&&a.substr(0,d)===b;default:return!1}}f.b64Equal=a}),66); __d("WABase64Modulo",[],(function(a,b,c,d,e,f){"use strict";function a(a,b){a=atob(a);var c=0;for(var d=0;d<a.length;d++){var e=a.charCodeAt(d),f=e>>4;e=e&15;c=((c<<4)+f)%b;c=((c<<4)+e)%b}return c}f["default"]=a}),66); __d("WABase64UrlSafe",[],(function(a,b,c,d,e,f){"use strict";function a(a){return a.replace(/\//g,"_").replace(/\+/g,"-")}f["default"]=a}),66); __d("WABidiRangeData",[],(function(a,b,c,d,e,f){"use strict";a=[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];f.DATA=a}),66); __d("WABidi",["WABidiRangeData"],(function(a,b,c,d,e,f){"use strict";var g,h;function i(){if(g)return;var a=b("WABidiRangeData").DATA,c=a.length/2;g=new Int32Array(c);h=new Int32Array(c);for(var d=0,e=0;d<c;d++,e+=2)g[d]=a[e]+(d===0?0:g[d-1]),h[d]=a[e+1]}function a(a){i();for(var b=0;b<a.length;b++){var c=a.charCodeAt(b)|0;if(55296<=c&&c<56320){if(++b===a.length)break;var d=a.charCodeAt(b);if(56320<=d&&d<57344)c=65536+((c&1023)<<10|d&1023);else continue}else if(56320<=c&&c<57344)continue;if(c<g[0])continue;d=g.length|0;var e=0;d=d-1|0;while(e<d){var f=d+e>>1;if(g[f]>c)d=f-1|0;else if(g[f+1]>c){d=f;break}else e=f+1|0}f=h[d];e=g[d]+Math.abs(f)|0;if(c<e)return f<0?"rtl":"ltr"}return void 0}f.dir=a}),66); __d("WACcToIso",[],(function(a,b,c,d,e,f){a=[];a[34]="ES";a[49]="DE";a[52]="MX";a[44]="GB";a[966]="SA";a[39]="IT";a[93]="AF";a[355]="AL";a[213]="DZ";a[376]="AD";a[244]="AO";a[54]="AR";a[374]="AM";a[297]="AW";a[61]="AU";a[43]="AT";a[994]="AZ";a[973]="BH";a[880]="BD";a[375]="BY";a[32]="BE";a[501]="BZ";a[229]="BJ";a[975]="BT";a[591]="BO";a[387]="BA";a[267]="BW";a[55]="BR";a[246]="IO";a[673]="BN";a[359]="BG";a[226]="BF";a[257]="BI";a[225]="CI";a[855]="KH";a[237]="CM";a[238]="CV";a[236]="CF";a[235]="TD";a[56]="CL";a[86]="CN";a[57]="CO";a[269]="KM";a[242]="CG";a[243]="CD";a[682]="CK";a[506]="CR";a[385]="HR";a[53]="CU";a[599]="CW";a[357]="CY";a[420]="CZ";a[45]="DK";a[253]="DJ";a[593]="EC";a[20]="EG";a[503]="SV";a[240]="GQ";a[291]="ER";a[372]="EE";a[251]="ET";a[298]="FO";a[679]="FJ";a[358]="FI";a[33]="FR";a[594]="GF";a[689]="PF";a[241]="GA";a[220]="GM";a[995]="GE";a[233]="GH";a[350]="GI";a[30]="GR";a[299]="GL";a[590]="GP";a[502]="GT";a[224]="GN";a[245]="GW";a[592]="GY";a[509]="HT";a[504]="HN";a[852]="HK";a[36]="HU";a[354]="IS";a[91]="IN";a[62]="ID";a[98]="IR";a[964]="IQ";a[353]="IE";a[972]="IL";a[81]="JP";a[962]="JO";a[254]="KE";a[965]="KW";a[996]="KG";a[856]="LA";a[371]="LV";a[961]="LB";a[266]="LS";a[231]="LR";a[218]="LY";a[423]="LI";a[370]="LT";a[352]="LU";a[853]="MO";a[389]="MK";a[261]="MG";a[265]="MW";a[60]="MY";a[960]="MV";a[223]="ML";a[356]="MT";a[692]="MH";a[596]="MQ";a[222]="MR";a[230]="MU";a[691]="FM";a[373]="MD";a[377]="MC";a[976]="MN";a[382]="ME";a[212]="MA";a[258]="MZ";a[95]="MM";a[264]="NA";a[674]="NR";a[977]="NP";a[31]="NL";a[687]="NC";a[64]="NZ";a[505]="NI";a[227]="NE";a[234]="NG";a[683]="NU";a[672]="NF";a[850]="KP";a[47]="NO";a[968]="OM";a[92]="PK";a[680]="PW";a[970]="PS";a[507]="PA";a[675]="PG";a[595]="PY";a[51]="PE";a[63]="PH";a[48]="PL";a[351]="PT";a[974]="QA";a[40]="RO";a[7]="RU";a[250]="RW";a[262]="RE";a[508]="PM";a[685]="WS";a[378]="SM";a[221]="SN";a[381]="RS";a[248]="SC";a[232]="SL";a[65]="SG";a[421]="SK";a[386]="SI";a[677]="SB";a[252]="SO";a[27]="ZA";a[82]="KR";a[211]="SS";a[94]="LK";a[249]="SD";a[597]="SR";a[268]="SZ";a[46]="SE";a[41]="CH";a[963]="SY";a[239]="ST";a[886]="TW";a[992]="TJ";a[255]="TZ";a[66]="TH";a[670]="TL";a[228]="TG";a[676]="TO";a[216]="TN";a[90]="TR";a[993]="TM";a[256]="UG";a[380]="UA";a[971]="AE";a[1]="US";a[598]="UY";a[998]="UZ";a[678]="VU";a[58]="VE";a[84]="VN";a[681]="WF";a[967]="YE";a[260]="ZM";a[263]="ZW";a[383]="XK";b=a;f["default"]=b}),66); __d("WAConcurrentPriorityPromiseQueue",["Promise","WANullthrows","WAPriorityQueue","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";var h;a=function(){function a(a,b){this.$1=a,this.$2=b,this.$3=new Map(),this.$4=new Map()}var d=a.prototype;d.clearQueue=function(){this.$4.clear(),this.$3.clear()};d.enqueue=function(a,c){var d,e,f=new(h||(h=b("Promise")))(function(a,b){d=a,e=b});this.$5(babelHelpers["extends"]({},c,{run:function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){try{var b=(yield a());d(b)}catch(a){e(a)}});function f(){return c.apply(this,arguments)}return f}()}));this.$6();return f};d.$5=function(a){var b=this.$7(a.group);b.push(a)};d.$8=function(){return this.$9()};d.$6=function(){while(this.$10()<this.$1){var a=this.$8();if(a==null)break;this.$11(a)}};d.$11=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=this,c=a.run,d=a.signal,e=a.group;e=this.$12(e);if(d==null?void 0:d.aborted){setTimeout(function(){return b.$6()},0);return}e.add(a);try{yield c()}finally{e["delete"](a),setTimeout(function(){return b.$6()},0)}});function c(b){return a.apply(this,arguments)}return c}();d.$9=function(){for(var a of this.$4.values()){var b=a.peek();if(!b)continue;if(this.$13(b.group))continue;return a.pull()}return null};d.$10=function(){var a=0;for(var b of this.$3.values())a+=b.size;return a};d.getEnqueuedTasksCount=function(){var a=0;for(var b of this.$4.values())a+=b.size();return a};d.$12=function(a){if(!this.$3.has(a)){var b=new Set();this.$3.set(a,b);return b}return c("WANullthrows")(this.$3.get(a))};d.$13=function(a){var b=this.$3.get(a);return b==null?!1:b.size>=this.$14(a)};d.$7=function(a){if(!this.$4.has(a)){var b=new(c("WAPriorityQueue"))(function(a){return a.priority});this.$4.set(a,b)}return c("WANullthrows")(this.$4.get(a))};d.$14=function(a){a=this.$2[a];return a==null?Infinity:a};return a}();g["default"]=a}),98); __d("WACrypto",["Promise","WAArrayBufferUtils","WABase64","WABinary","WACryptoAesCbc","WACryptoHmac","WALogger","err"],(function(a,b,c,d,e,f,g){"use strict";var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["crypto:macAndDecrypt HMAC don't match "," vs. ",""]);i=function(){return a};return a}function a(a,b,c){return d("WACryptoAesCbc").aesCbcEncrypt(a,new Uint8Array(c)).then(function(a){return d("WACryptoHmac").hmacSha256(b,a).then(function(b){return d("WABinary").Binary.build(b,a).readBuffer()})})}function e(a,e,f){return(h||(h=b("Promise"))).resolve(new Uint8Array(f)).then(function(b){var f=d("WABase64").encodeB64(b.subarray(0,32)),g=b.subarray(32);return d("WACryptoHmac").hmacSha256(e,g).then(function(b){b=d("WABase64").encodeB64(b);if(f!==b){d("WALogger").WARN(i(),f,b);throw c("err")("macAndDecrypt HMAC mismatch")}return d("WACryptoAesCbc").aesCbcDecryptSplit(a,g)})})}function f(a,b){var c=a.slice(-b.byteLength);return d("WAArrayBufferUtils").arrayBuffersEqualUNSAFE(c,b)?a.slice(0,a.byteLength-b.byteLength):a}g.encryptAndMac=a;g.macAndDecrypt=e;g.removeEncryptedPadding=f}),98); __d("WACryptoLtHash",["Promise","WACryptoHkdf","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";var h,i=2,j=128;a=new ArrayBuffer(j);c=function(){function a(a){this.salt=a}var c=a.prototype;c.add=function(a,c){var d=this;return c.reduce(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){return d.$1(yield a,b)});return function(b,c){return a.apply(this,arguments)}}(),(h||(h=b("Promise"))).resolve(a))};c.subtract=function(a,c){var d=this;return c.reduce(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){return d.$2(yield a,b)});return function(b,c){return a.apply(this,arguments)}}(),(h||(h=b("Promise"))).resolve(a))};c.subtractThenAdd=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){a=(yield this.subtract(a,c));c=(yield this.add(a,b));return{ltHash:c,subtractResult:a}});function c(b,c,d){return a.apply(this,arguments)}return c}();c.$1=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=(yield d("WACryptoHkdf").extractAndExpand(b,this.salt,j));return this.performPointwiseWithOverflow(a,b,function(a,b){return a+b})});function c(b,c){return a.apply(this,arguments)}return c}();c.$2=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=(yield d("WACryptoHkdf").extractAndExpand(b,this.salt,j));return this.performPointwiseWithOverflow(a,b,function(a,b){return a-b})});function c(b,c){return a.apply(this,arguments)}return c}();c.performPointwiseWithOverflow=function(a,b,c){a=new DataView(a);b=new DataView(b);var d=new ArrayBuffer(a.byteLength),e=new DataView(d);for(var f=0;f<a.byteLength;f+=i)e.setUint16(f,c(a.getUint16(f,!0),b.getUint16(f,!0)),!0);return d};return a}();e=new c("WhatsApp Patch Integrity");g.KEY_LENGTH_BYTES=j;g.EMPTY_LT_HASH=a;g.LtHash16=c;g.LT_HASH_ANTI_TAMPERING=e}),98); __d("WADepthFirstTraversal",[],(function(a,b,c,d,e,f){"use strict";function g(a,b,c){var d=b(a);d.forEach(function(a){return g(a,b,c)});c(a)}f["default"]=g}),66); __d("WAInOrderPromiseQueue",["Promise","WAAbortError","WAPromiseRaceAbort"],(function(a,b,c,d,e,f,g){"use strict";var h;a=function(){function a(){this.$1=(h||(h=b("Promise"))).resolve(),this.$3=new AbortController(),this.$2=[]}var e=a.prototype;e.enqueue=function(a){var b=this;a["catch"](function(){});var e=function(){return a},f=this.$3.signal;this.$1=this.$1.then(e,e);var g=c("WAPromiseRaceAbort")(this.$1,f)["catch"](d("WAAbortError").catchAbort(function(a){var c;throw(c=b.$4)!=null?c:a}));this.$2.push(g);return g["finally"](function(){b.$2.length>0&&b.$2[0]===g&&b.$2.shift()})};e.cancelAll=function(a){this.$4=a,this.$2=[],this.$3.abort(),this.$3=new AbortController()};return a}();g["default"]=a}),98); __d("WAIsoToCc",[],(function(a,b,c,d,e,f){a={ES:34,DE:49,MX:52,GB:44,SA:966,IT:39,AF:93,AX:358,AL:355,DZ:213,AS:1,AD:376,AO:244,AI:1,AG:1,AR:54,AM:374,AW:297,AC:247,AU:61,AT:43,AZ:994,BS:1,BH:973,BD:880,BB:1,BY:375,BE:32,BZ:501,BJ:229,BM:1,BT:975,BO:591,BQ:599,BA:387,BW:267,BR:55,IO:246,VG:1,BN:673,BG:359,BF:226,BI:257,CI:225,KH:855,CM:237,CA:1,CV:238,KY:1,CF:236,TD:235,CL:56,CN:86,CX:61,CC:61,CO:57,KM:269,CG:242,CD:243,CK:682,CR:506,HR:385,CU:53,CW:599,CY:357,CZ:420,DK:45,DJ:253,DM:1,DO:1,EC:593,EG:20,SV:503,GQ:240,ER:291,EE:372,ET:251,FK:500,FO:298,FJ:679,FI:358,FR:33,GF:594,PF:689,GA:241,GM:220,GE:995,GH:233,GI:350,GR:30,GL:299,GD:1,GP:590,GU:1,GT:502,GG:44,GN:224,GW:245,GY:592,HT:509,HN:504,HK:852,HU:36,IS:354,IN:91,ID:62,IR:98,IQ:964,IE:353,IM:44,IL:972,JM:1,JP:81,JE:44,JO:962,KZ:7,KE:254,KI:686,KW:965,KG:996,LA:856,LV:371,LB:961,LS:266,LR:231,LY:218,LI:423,LT:370,LU:352,MO:853,MK:389,MG:261,MW:265,MY:60,MV:960,ML:223,MT:356,MH:692,MQ:596,MR:222,MU:230,YT:262,FM:691,MD:373,MC:377,MN:976,ME:382,MS:1,MA:212,MZ:258,MM:95,NA:264,NR:674,NP:977,NL:31,NC:687,NZ:64,NI:505,NE:227,NG:234,NU:683,NF:672,KP:850,MP:1,NO:47,OM:968,PK:92,PW:680,PS:970,PA:507,PG:675,PY:595,PE:51,PH:63,PL:48,PT:351,PR:1,QA:974,RO:40,RU:7,RW:250,RE:262,BL:590,SH:290,KN:1,LC:1,MF:590,PM:508,VC:1,WS:685,SM:378,SN:221,RS:381,SC:248,SL:232,SG:65,SX:1,SK:421,SI:386,SB:677,SO:252,ZA:27,KR:82,SS:211,LK:94,SD:249,SR:597,SJ:47,SZ:268,SE:46,CH:41,SY:963,ST:239,TW:886,TJ:992,TZ:255,TH:66,TL:670,TG:228,TK:690,TO:676,TT:1,TN:216,TR:90,TM:993,TC:1,TV:688,VI:1,UG:256,UA:380,AE:971,US:1,UY:598,UZ:998,VU:678,VA:379,VE:58,VN:84,WF:681,YE:967,ZM:260,ZW:263,XK:383};b=a;f["default"]=b}),66); __d("WAMediaCalculateFilehash",["WACryptoDependencies","WACryptoSha256"],(function(a,b,c,d,e,f,g){"use strict";function a(a){return d("WACryptoSha256").sha256Base64(a)}function b(){var a=d("WACryptoDependencies").getCrypto().getRandomValues(new Uint8Array(20));a=a.buffer;return d("WACryptoSha256").sha256Base64(a)}g.calculateFilehash=a;g.getRandomFilehash=b}),98); __d("WAPromiseProps",["Promise"],(function(a,b,c,d,e,f){"use strict";var g;function a(a){var c=Object.keys(a),d=(g||(g=b("Promise"))).all(c.map(function(b){return a[b]}));function e(a){var b={};for(var d=0;d<a.length;d++)b[c[d]]=a[d];return b}return d.then(e)}f.promiseProps=a}),66); __d("WARaceSignal",["asyncToGeneratorRuntime"],(function(a,b,c,d,e,f){"use strict";function a(a,b){return g.apply(this,arguments)}function g(){g=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c,d=new AbortController();if(a.some(function(a){return a.aborted}))d.abort();else{c=function(){for(var b of a)b.removeEventListener("abort",e);c=null};var e=function(){c==null?void 0:c(),d.abort()};for(var f of a)f.addEventListener("abort",e)}try{return yield b(d.signal)}finally{c==null?void 0:c()}});return g.apply(this,arguments)}f["default"]=a}),66); __d("WAReplaceRepeatingWhitespace",[],(function(a,b,c,d,e,f){"use strict";var g="\xa0";function a(a,b){var c=function(a){var c="";for(var d=0;d<a.length;d++){var e=b===!0&&a[d]==="\n";c+=e?"\n":g}return c};return/\s\s+/.test(a)?a.replace(/\s\s+/g,c):a}f["default"]=a}),66); __d("WASmaxInBizCtwaActionEnums",[],(function(a,b,c,d,e,f){a={"false":"false","true":"true"};b={info:"info",warning:"warning"};f.ENUM_FALSE_TRUE=a;f.ENUM_INFO_WARNING=b}),66); __d("WASmaxInBizCtwaActionLocalisationMetadataMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function h(a){var b=d("WASmaxParseUtils").assertTag(a,"parameter");if(!b.success)return b;b=d("WASmaxParseUtils").attrString(a,"name");if(!b.success)return b;a=d("WASmaxParseUtils").attrString(a,"value");return!a.success?a:d("WAResultOrError").makeResult({name:b.value,value:a.value})}function a(a){var b=d("WASmaxParseUtils").assertTag(a,"localisation_metadata");if(!b.success)return b;b=d("WASmaxParseUtils").attrString(a,"uid");if(!b.success)return b;var c=d("WASmaxParseUtils").attrString(a,"translation_project");if(!c.success)return c;a=d("WASmaxParseUtils").mapChildrenWithTag(a,"parameter",0,20,h);return!a.success?a:d("WAResultOrError").makeResult({uid:b.value,translationProject:c.value,parameter:a.value})}g.parseLocalisationMetadataParameter=h;g.parseLocalisationMetadataMixin=a}),98); __d("WASmaxInBizCtwaActionNativeActionsMixinMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function h(a){var b=d("WASmaxParseUtils").assertTag(a,"native_action");if(!b.success)return b;b=d("WASmaxParseUtils").attrString(a,"platform");if(!b.success)return b;var c=d("WASmaxParseUtils").attrString(a,"min_app_version");if(!c.success)return c;var e=d("WASmaxParseUtils").attrString(a,"local_link");if(!e.success)return e;a=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrString,a,"universal_link");return!a.success?a:d("WAResultOrError").makeResult({platform:b.value,minAppVersion:c.value,localLink:e.value,universalLink:a.value})}function a(a){a=d("WASmaxParseUtils").mapChildrenWithTag(a,"native_action",0,50,h);return!a.success?a:d("WAResultOrError").makeResult({nativeAction:a.value})}g.parseNativeActionsMixinNativeAction=h;g.parseNativeActionsMixinMixin=a}),98); __d("WASmaxInBizCtwaActionServerNotificationMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"notification");if(!b.success)return b;b=d("WASmaxParseUtils").attrIntRange(a,"t",0,void 0);if(!b.success)return b;var c=d("WASmaxParseUtils").attrStanzaId(a,"id");if(!c.success)return c;a=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrIntRange,a,"offline",0,1024);return!a.success?a:d("WAResultOrError").makeResult({t:b.value,id:c.value,offline:a.value})}g.parseServerNotificationMixin=a}),98); __d("WASmaxInBizCtwaActionBannerSuggestionRequest",["WAResultOrError","WASmaxInBizCtwaActionEnums","WASmaxInBizCtwaActionLocalisationMetadataMixin","WASmaxInBizCtwaActionNativeActionsMixinMixin","WASmaxInBizCtwaActionServerNotificationMixin","WASmaxParseJid","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function h(a){var b=d("WASmaxParseUtils").assertTag(a,"action");if(!b.success)return b;b=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrString,a,"deep_link");if(!b.success)return b;var c=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrString,a,"local_link");if(!c.success)return c;a=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrString,a,"local_android_link");return!a.success?a:d("WAResultOrError").makeResult({deepLink:b.value,localLink:c.value,localAndroidLink:a.value})}function i(a){var b=d("WASmaxParseUtils").assertTag(a,"localised_heading");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"localisation_metadata");if(!b.success)return b;a=d("WASmaxParseUtils").attrString(a,"value");if(!a.success)return a;b=d("WASmaxInBizCtwaActionLocalisationMetadataMixin").parseLocalisationMetadataMixin(b.value);return!b.success?b:d("WAResultOrError").makeResult({value:a.value,localisationMetadataLocalisationMetadataMixin:b.value})}function j(a){var b=d("WASmaxParseUtils").assertTag(a,"localised_body");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"localisation_metadata");if(!b.success)return b;a=d("WASmaxParseUtils").attrString(a,"value");if(!a.success)return a;b=d("WASmaxInBizCtwaActionLocalisationMetadataMixin").parseLocalisationMetadataMixin(b.value);return!b.success?b:d("WAResultOrError").makeResult({value:a.value,localisationMetadataLocalisationMetadataMixin:b.value})}function k(a){var b=d("WASmaxParseUtils").assertTag(a,"localised_highlight");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"localisation_metadata");if(!b.success)return b;a=d("WASmaxParseUtils").attrString(a,"value");if(!a.success)return a;b=d("WASmaxInBizCtwaActionLocalisationMetadataMixin").parseLocalisationMetadataMixin(b.value);return!b.success?b:d("WAResultOrError").makeResult({value:a.value,localisationMetadataLocalisationMetadataMixin:b.value})}function l(a){var b=d("WASmaxParseUtils").assertTag(a,"banner");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"config");if(!b.success)return b;var c=d("WASmaxParseUtils").flattenedChildWithTag(a,"content");if(!c.success)return c;var e=d("WASmaxParseUtils").flattenedChildWithTag(c.value,"heading");if(!e.success)return e;var f=d("WASmaxParseUtils").flattenedChildWithTag(c.value,"body");if(!f.success)return f;var g=d("WASmaxParseUtils").flattenedChildWithTag(c.value,"highlight");if(!g.success)return g;var l=d("WASmaxParseUtils").optionalChildWithTag(a,"action",h);if(!l.success)return l;var m=d("WASmaxParseUtils").optionalChildWithTag(c.value,"localised_heading",i);if(!m.success)return m;var n=d("WASmaxParseUtils").optionalChildWithTag(c.value,"localised_body",j);if(!n.success)return n;var o=d("WASmaxParseUtils").optionalChildWithTag(c.value,"localised_highlight",k);if(!o.success)return o;var p=d("WASmaxParseUtils").attrIntRange(b.value,"expires_at",1,void 0);if(!p.success)return p;var q=d("WASmaxParseUtils").attrStringEnum(b.value,"display",d("WASmaxInBizCtwaActionEnums").ENUM_INFO_WARNING);if(!q.success)return q;b=d("WASmaxParseUtils").attrStringEnum(b.value,"revoked",d("WASmaxInBizCtwaActionEnums").ENUM_FALSE_TRUE);if(!b.success)return b;c=d("WASmaxParseUtils").attrString(c.value,"locale");if(!c.success)return c;e=d("WASmaxParseUtils").contentString(e.value);if(!e.success)return e;f=d("WASmaxParseUtils").contentString(f.value);if(!f.success)return f;g=d("WASmaxParseUtils").contentString(g.value);if(!g.success)return g;a=d("WASmaxInBizCtwaActionNativeActionsMixinMixin").parseNativeActionsMixinMixin(a);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({configExpiresAt:p.value,configDisplay:q.value,configRevoked:b.value,contentLocale:c.value,contentHeadingElementValue:e.value,contentBodyElementValue:f.value,contentHighlightElementValue:g.value},a.value,{action:l.value,contentLocalisedHeading:m.value,contentLocalisedBody:n.value,contentLocalisedHighlight:o.value}))}function a(a){var b=d("WASmaxParseUtils").assertTag(a,"notification");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"ctwa_suggestion");if(!b.success)return b;var c=d("WASmaxParseUtils").optionalChildWithTag(b.value,"banner",l);if(!c.success)return c;var e=d("WASmaxParseJid").literalJid(d("WASmaxParseJid").attrDomainJid,a,"from","s.whatsapp.net");if(!e.success)return e;var f=d("WASmaxParseUtils").optional(d("WASmaxParseJid").attrUserJid,a,"to");if(!f.success)return f;var g=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","business");if(!g.success)return g;b=d("WASmaxParseUtils").attrString(b.value,"target_entity_id");if(!b.success)return b;a=d("WASmaxInBizCtwaActionServerNotificationMixin").parseServerNotificationMixin(a);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({from:e.value,to:f.value,type:g.value,ctwaSuggestionTargetEntityId:b.value},a.value,{ctwaSuggestionBanner:c.value}))}g.parseBannerSuggestionRequestCtwaSuggestionBannerAction=h;g.parseBannerSuggestionRequestCtwaSuggestionBannerContentLocalisedHeading=i;g.parseBannerSuggestionRequestCtwaSuggestionBannerContentLocalisedBody=j;g.parseBannerSuggestionRequestCtwaSuggestionBannerContentLocalisedHighlight=k;g.parseBannerSuggestionRequestCtwaSuggestionBanner=l;g.parseBannerSuggestionRequest=a}),98); __d("WASmaxBizCtwaActionBannerSuggestionRPC",["WASmaxInBizCtwaActionBannerSuggestionRequest","WASmaxParsingFailure","WASmaxRpcUtils"],(function(a,b,c,d,e,f,g){function a(a){a=d("WASmaxInBizCtwaActionBannerSuggestionRequest").parseBannerSuggestionRequest(a);if(!a.success)throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(d("WASmaxRpcUtils").errorMessageRpcParsing("BannerSuggestion",{Request:a}));return{parsedRequest:a.value}}g.receiveBannerSuggestionRPC=a}),98); __d("WASmaxInBizCtwaAdAccountServerNotificationMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"notification");if(!b.success)return b;b=d("WASmaxParseUtils").attrIntRange(a,"t",0,void 0);if(!b.success)return b;var c=d("WASmaxParseUtils").attrStanzaId(a,"id");if(!c.success)return c;a=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrIntRange,a,"offline",0,1024);return!a.success?a:d("WAResultOrError").makeResult({t:b.value,id:c.value,offline:a.value})}g.parseServerNotificationMixin=a}),98); __d("WASmaxInBizCtwaAdAccountNonceNotificationRequest",["WAResultOrError","WASmaxInBizCtwaAdAccountServerNotificationMixin","WASmaxParseJid","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"notification");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"wa_ad_account_nonce");if(!b.success)return b;var c=d("WASmaxParseJid").literalJid(d("WASmaxParseJid").attrDomainJid,a,"from","s.whatsapp.net");if(!c.success)return c;var e=d("WASmaxParseUtils").optional(d("WASmaxParseJid").attrUserJid,a,"to");if(!e.success)return e;var f=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","business");if(!f.success)return f;b=d("WASmaxParseUtils").contentString(b.value);if(!b.success)return b;a=d("WASmaxInBizCtwaAdAccountServerNotificationMixin").parseServerNotificationMixin(a);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({from:c.value,to:e.value,type:f.value,waAdAccountNonceElementValue:b.value},a.value))}g.parseNonceNotificationRequest=a}),98); __d("WASmaxBizCtwaAdAccountNonceNotificationRPC",["WASmaxInBizCtwaAdAccountNonceNotificationRequest","WASmaxParsingFailure","WASmaxRpcUtils"],(function(a,b,c,d,e,f,g){function a(a){a=d("WASmaxInBizCtwaAdAccountNonceNotificationRequest").parseNonceNotificationRequest(a);if(!a.success)throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(d("WASmaxRpcUtils").errorMessageRpcParsing("NonceNotification",{Request:a}));return{parsedRequest:a.value}}g.receiveNonceNotificationRPC=a}),98); __d("WASmaxInBizSettingsIQErrorResponseMixin",["WAResultOrError","WASmaxParseReference","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["id"]);if(!c.success)return c;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"id",c.value);if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["to"]);if(!c.success)return c;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"from",c.value);if(!b.success)return b;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","error");return!c.success?c:d("WAResultOrError").makeResult({type:c.value})}g.parseIQErrorResponseMixin=a}),98); __d("WASmaxInBizSettingsIQErrorBadRequestMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","bad-request");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",400);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorBadRequestMixin=a}),98); __d("WASmaxInBizSettingsIQErrorFeatureNotImplementedMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","feature-not-implemented");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",501);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorFeatureNotImplementedMixin=a}),98); __d("WASmaxInBizSettingsIQErrorInternalServerErrorMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","internal-server-error");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",500);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorInternalServerErrorMixin=a}),98); __d("WASmaxInBizSettingsIQErrorServiceUnavailableMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","service-unavailable");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",503);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorServiceUnavailableMixin=a}),98); __d("WASmaxInBizSettingsPrivacySettingErrors",["WAResultOrError","WASmaxInBizSettingsIQErrorBadRequestMixin","WASmaxInBizSettingsIQErrorFeatureNotImplementedMixin","WASmaxInBizSettingsIQErrorInternalServerErrorMixin","WASmaxInBizSettingsIQErrorServiceUnavailableMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxInBizSettingsIQErrorBadRequestMixin").parseIQErrorBadRequestMixin(a);if(b.success)return d("WAResultOrError").makeResult({name:"IQErrorBadRequest",value:b.value});var c=d("WASmaxInBizSettingsIQErrorFeatureNotImplementedMixin").parseIQErrorFeatureNotImplementedMixin(a);if(c.success)return d("WAResultOrError").makeResult({name:"IQErrorFeatureNotImplemented",value:c.value});var e=d("WASmaxInBizSettingsIQErrorServiceUnavailableMixin").parseIQErrorServiceUnavailableMixin(a);if(e.success)return d("WAResultOrError").makeResult({name:"IQErrorServiceUnavailable",value:e.value});var f=d("WASmaxInBizSettingsIQErrorInternalServerErrorMixin").parseIQErrorInternalServerErrorMixin(a);return f.success?d("WAResultOrError").makeResult({name:"IQErrorInternalServerError",value:f.value}):d("WASmaxParseUtils").errorMixinDisjunction(a,["IQErrorBadRequest","IQErrorFeatureNotImplemented","IQErrorServiceUnavailable","IQErrorInternalServerError"],[b,c,e,f])}g.parsePrivacySettingErrors=a}),98); __d("WASmaxInBizSettingsGetPrivacySettingResponseError",["WAResultOrError","WASmaxInBizSettingsIQErrorResponseMixin","WASmaxInBizSettingsPrivacySettingErrors","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"error");if(!c.success)return c;a=d("WASmaxInBizSettingsIQErrorResponseMixin").parseIQErrorResponseMixin(a,b);if(!a.success)return a;b=d("WASmaxInBizSettingsPrivacySettingErrors").parsePrivacySettingErrors(c.value);return!b.success?b:d("WAResultOrError").makeResult(babelHelpers["extends"]({},a.value,{errorPrivacySettingErrors:b.value}))}g.parseGetPrivacySettingResponseError=a}),98); __d("WASmaxInBizSettingsIQResultResponseMixin",["WAResultOrError","WASmaxParseReference","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["id"]);if(!c.success)return c;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"id",c.value);if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["to"]);if(!c.success)return c;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"from",c.value);if(!b.success)return b;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","result");return!c.success?c:d("WAResultOrError").makeResult({type:c.value})}g.parseIQResultResponseMixin=a}),98); __d("WASmaxInBizSettingsEnums",[],(function(a,b,c,d,e,f){a={DISCOVERABLE:"DISCOVERABLE",HIDDEN:"HIDDEN",UNDEFINED:"UNDEFINED"};b={"false":"false",notset:"notset","true":"true"};c={"false":"false","true":"true"};f.ENUM_DISCOVERABLE_HIDDEN_UNDEFINED=a;f.ENUM_FALSE_NOTSET_TRUE=b;f.ENUM_FALSE_TRUE=c}),66); __d("WASmaxInBizSettingsSmbDataSharingSettingValueMixin",["WAResultOrError","WASmaxInBizSettingsEnums","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){a=d("WASmaxParseUtils").attrStringEnum(a,"value",d("WASmaxInBizSettingsEnums").ENUM_FALSE_NOTSET_TRUE);return!a.success?a:d("WAResultOrError").makeResult({value:a.value})}g.parseSmbDataSharingSettingValueMixin=a}),98); __d("WASmaxInBizSettingsSmbDataSharingSettingMixin",["WASmaxInBizSettingsSmbDataSharingSettingValueMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"privacy");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"smb_data_sharing_with_meta_consent");if(!b.success)return b;a=d("WASmaxInBizSettingsSmbDataSharingSettingValueMixin").parseSmbDataSharingSettingValueMixin(b.value);return!a.success?a:a}g.parseSmbDataSharingSettingMixin=a}),98); __d("WASmaxInBizSettingsGetPrivacySettingResponseSuccess",["WAResultOrError","WASmaxInBizSettingsIQResultResponseMixin","WASmaxInBizSettingsSmbDataSharingSettingMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"privacy");if(!c.success)return c;c=d("WASmaxInBizSettingsSmbDataSharingSettingMixin").parseSmbDataSharingSettingMixin(c.value);if(!c.success)return c;a=d("WASmaxInBizSettingsIQResultResponseMixin").parseIQResultResponseMixin(a,b);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({privacySmbDataSharingSettingMixin:c.value},a.value))}g.parseGetPrivacySettingResponseSuccess=a}),98); __d("WASmaxOutBizSettingsBaseIQGetRequestMixin",["WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxJsx").smax("iq",{id:d("WAWap").generateId(),type:"get"});return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeBaseIQGetRequestMixin=a}),98); __d("WASmaxOutBizSettingsGetPrivacySettingRequest",["WASmaxJsx","WASmaxOutBizSettingsBaseIQGetRequestMixin","WAWap"],(function(a,b,c,d,e,f,g){function a(){var a=d("WASmaxOutBizSettingsBaseIQGetRequestMixin").mergeBaseIQGetRequestMixin(d("WASmaxJsx").smax("iq",{xmlns:"w:biz",to:d("WAWap").S_WHATSAPP_NET,smax_id:d("WAWap").INT(109)},d("WASmaxJsx").smax("privacy",null)));return a}g.makeGetPrivacySettingRequest=a}),98); __d("WASmaxBizSettingsGetPrivacySettingRPC",["WAComms","WASmaxInBizSettingsGetPrivacySettingResponseError","WASmaxInBizSettingsGetPrivacySettingResponseSuccess","WASmaxOutBizSettingsGetPrivacySettingRequest","WASmaxParsingFailure","WASmaxRpcUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=d("WASmaxOutBizSettingsGetPrivacySettingRequest").makeGetPrivacySettingRequest();a=(yield d("WAComms").sendSmaxStanza(b,a));var c=d("WASmaxInBizSettingsGetPrivacySettingResponseSuccess").parseGetPrivacySettingResponseSuccess(a,b);if(c.success)return{name:"GetPrivacySettingResponseSuccess",value:c.value};a=d("WASmaxInBizSettingsGetPrivacySettingResponseError").parseGetPrivacySettingResponseError(a,b);if(a.success)return{name:"GetPrivacySettingResponseError",value:a.value};throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(d("WASmaxRpcUtils").errorMessageRpcParsing("GetPrivacySetting",{Success:c,Error:a}))});return h.apply(this,arguments)}g.sendGetPrivacySettingRPC=a}),98); __d("WASmaxInBizSettingsSetPrivacySettingResponseError",["WAResultOrError","WASmaxInBizSettingsIQErrorResponseMixin","WASmaxInBizSettingsPrivacySettingErrors","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"error");if(!c.success)return c;a=d("WASmaxInBizSettingsIQErrorResponseMixin").parseIQErrorResponseMixin(a,b);if(!a.success)return a;b=d("WASmaxInBizSettingsPrivacySettingErrors").parsePrivacySettingErrors(c.value);return!b.success?b:d("WAResultOrError").makeResult(babelHelpers["extends"]({},a.value,{errorPrivacySettingErrors:b.value}))}g.parseSetPrivacySettingResponseError=a}),98); __d("WASmaxInBizSettingsSetPrivacySettingResponseSuccess",["WAResultOrError","WASmaxInBizSettingsIQResultResponseMixin","WASmaxInBizSettingsSmbDataSharingSettingMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"privacy");if(!c.success)return c;c=d("WASmaxInBizSettingsSmbDataSharingSettingMixin").parseSmbDataSharingSettingMixin(c.value);a=d("WASmaxInBizSettingsIQResultResponseMixin").parseIQResultResponseMixin(a,b);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({privacySmbDataSharingSettingMixin:c.success?c.value:null},a.value))}g.parseSetPrivacySettingResponseSuccess=a}),98); __d("WASmaxOutBizSettingsBaseIQSetRequestMixin",["WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxJsx").smax("iq",{id:d("WAWap").generateId(),type:"set"});return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeBaseIQSetRequestMixin=a}),98); __d("WASmaxOutBizSettingsSmbDataSharingSettingValueMixin",["WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(a){a=a.anyValue;a=d("WASmaxJsx").smax("smax$any",{value:d("WAWap").CUSTOM_STRING(a)});return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeSmbDataSharingSettingValueMixin=a}),98); __d("WASmaxOutBizSettingsSmbDataSharingSettingMixin",["WASmaxJsx","WASmaxMixins","WASmaxOutBizSettingsSmbDataSharingSettingValueMixin"],(function(a,b,c,d,e,f,g){function h(a){a=d("WASmaxJsx").smax("privacy",null,d("WASmaxOutBizSettingsSmbDataSharingSettingValueMixin").mergeSmbDataSharingSettingValueMixin(d("WASmaxJsx").smax("smb_data_sharing_with_meta_consent",null),a));return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeSmbDataSharingSettingMixin=a}),98); __d("WASmaxOutBizSettingsSetPrivacySettingRequest",["WASmaxJsx","WASmaxMixins","WASmaxOutBizSettingsBaseIQSetRequestMixin","WASmaxOutBizSettingsSmbDataSharingSettingMixin","WAWap"],(function(a,b,c,d,e,f,g){function a(a){a=a.smbDataSharingSettingMixinArgs;a=d("WASmaxOutBizSettingsBaseIQSetRequestMixin").mergeBaseIQSetRequestMixin(d("WASmaxJsx").smax("iq",{xmlns:"w:biz",to:d("WAWap").S_WHATSAPP_NET,smax_id:d("WAWap").INT(110)},d("WASmaxMixins").optionalMerge(d("WASmaxOutBizSettingsSmbDataSharingSettingMixin").mergeSmbDataSharingSettingMixin,d("WASmaxJsx").smax("privacy",null),a)));return a}g.makeSetPrivacySettingRequest=a}),98); __d("WASmaxBizSettingsSetPrivacySettingRPC",["WAComms","WASmaxInBizSettingsSetPrivacySettingResponseError","WASmaxInBizSettingsSetPrivacySettingResponseSuccess","WASmaxOutBizSettingsSetPrivacySettingRequest","WASmaxParsingFailure","WASmaxRpcUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=d("WASmaxOutBizSettingsSetPrivacySettingRequest").makeSetPrivacySettingRequest(a);b=(yield d("WAComms").sendSmaxStanza(a,b));var c=d("WASmaxInBizSettingsSetPrivacySettingResponseSuccess").parseSetPrivacySettingResponseSuccess(b,a);if(c.success)return{name:"SetPrivacySettingResponseSuccess",value:c.value};b=d("WASmaxInBizSettingsSetPrivacySettingResponseError").parseSetPrivacySettingResponseError(b,a);if(b.success)return{name:"SetPrivacySettingResponseError",value:b.value};throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(d("WASmaxRpcUtils").errorMessageRpcParsing("SetPrivacySetting",{Success:c,Error:b}))});return h.apply(this,arguments)}g.sendSetPrivacySettingRPC=a}),98); __d("WASmaxInBizSettingsServerNotificationMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"notification");if(!b.success)return b;b=d("WASmaxParseUtils").attrIntRange(a,"t",0,void 0);if(!b.success)return b;var c=d("WASmaxParseUtils").attrStanzaId(a,"id");if(!c.success)return c;a=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrIntRange,a,"offline",0,1024);return!a.success?a:d("WAResultOrError").makeResult({t:b.value,id:c.value,offline:a.value})}g.parseServerNotificationMixin=a}),98); __d("WASmaxInBizSettingsSyncPrivacySettingRequest",["WAResultOrError","WASmaxInBizSettingsServerNotificationMixin","WASmaxInBizSettingsSmbDataSharingSettingMixin","WASmaxParseJid","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"notification");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"privacy");if(!b.success)return b;var c=d("WASmaxParseJid").literalJid(d("WASmaxParseJid").attrDomainJid,a,"from","s.whatsapp.net");if(!c.success)return c;var e=d("WASmaxParseUtils").optional(d("WASmaxParseJid").attrUserJid,a,"to");if(!e.success)return e;var f=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","business");if(!f.success)return f;b=d("WASmaxInBizSettingsSmbDataSharingSettingMixin").parseSmbDataSharingSettingMixin(b.value);a=d("WASmaxInBizSettingsServerNotificationMixin").parseServerNotificationMixin(a);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({from:c.value,to:e.value,type:f.value,privacySmbDataSharingSettingMixin:b.success?b.value:null},a.value))}g.parseSyncPrivacySettingRequest=a}),98); __d("WASmaxBizSettingsSyncPrivacySettingRPC",["WASmaxInBizSettingsSyncPrivacySettingRequest","WASmaxParsingFailure","WASmaxRpcUtils"],(function(a,b,c,d,e,f,g){function a(a){a=d("WASmaxInBizSettingsSyncPrivacySettingRequest").parseSyncPrivacySettingRequest(a);if(!a.success)throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(d("WASmaxRpcUtils").errorMessageRpcParsing("SyncPrivacySetting",{Request:a}));return{parsedRequest:a.value}}g.receiveSyncPrivacySettingRPC=a}),98); __d("WASmaxInBlocklistsGetBlockListResponseInternalServerError",["WAResultOrError","WASmaxInBlocklistsIQErrorResponseMixin","WASmaxInBlocklistsServerErrors","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"error");if(!c.success)return c;a=d("WASmaxInBlocklistsIQErrorResponseMixin").parseIQErrorResponseMixin(a,b);if(!a.success)return a;b=d("WASmaxInBlocklistsServerErrors").parseServerErrors(c.value);return!b.success?b:d("WAResultOrError").makeResult(babelHelpers["extends"]({},a.value,{errorServerErrors:b.value}))}g.parseGetBlockListResponseInternalServerError=a}),98); __d("WASmaxInBlocklistsEnums",[],(function(a,b,c,d,e,f){a={lid:"lid",pn:"pn"};f.ENUM_LID_PN=a}),66); __d("WASmaxInBlocklistsGetBlockListResponseInvalidRequest",["WAResultOrError","WASmaxInBlocklistsEnums","WASmaxInBlocklistsGetBlocklistErrors","WASmaxInBlocklistsIQErrorResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"error");if(!c.success)return c;var e=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrStringEnum,c.value,"addressing_mode",d("WASmaxInBlocklistsEnums").ENUM_LID_PN);if(!e.success)return e;a=d("WASmaxInBlocklistsIQErrorResponseMixin").parseIQErrorResponseMixin(a,b);if(!a.success)return a;b=d("WASmaxInBlocklistsGetBlocklistErrors").parseGetBlocklistErrors(c.value);return!b.success?b:d("WAResultOrError").makeResult(babelHelpers["extends"]({errorAddressingMode:e.value},a.value,{errorGetBlocklistErrors:b.value}))}g.parseGetBlockListResponseInvalidRequest=a}),98); __d("WASmaxInBlocklistsDisplayNameMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){a=d("WASmaxParseUtils").attrString(a,"display_name");return!a.success?a:d("WAResultOrError").makeResult({displayName:a.value})}g.parseDisplayNameMixin=a}),98); __d("WASmaxInBlocklistsPnJidMixin",["WAResultOrError","WASmaxParseJid"],(function(a,b,c,d,e,f,g){function a(a){a=d("WASmaxParseJid").attrUserJid(a,"pn_jid");return!a.success?a:d("WAResultOrError").makeResult({pnJid:a.value})}g.parsePnJidMixin=a}),98); __d("WASmaxInBlocklistsUsernameMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){a=d("WASmaxParseUtils").attrString(a,"username");return!a.success?a:d("WAResultOrError").makeResult({username:a.value})}g.parseUsernameMixin=a}),98); __d("WASmaxInBlocklistsBlocklistIds",["WAResultOrError","WASmaxInBlocklistsDisplayNameMixin","WASmaxInBlocklistsPnJidMixin","WASmaxInBlocklistsUsernameMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxInBlocklistsUsernameMixin").parseUsernameMixin(a);if(b.success)return d("WAResultOrError").makeResult({name:"Username",value:b.value});var c=d("WASmaxInBlocklistsPnJidMixin").parsePnJidMixin(a);if(c.success)return d("WAResultOrError").makeResult({name:"PnJid",value:c.value});var e=d("WASmaxInBlocklistsDisplayNameMixin").parseDisplayNameMixin(a);return e.success?d("WAResultOrError").makeResult({name:"DisplayName",value:e.value}):d("WASmaxParseUtils").errorMixinDisjunction(a,["Username","PnJid","DisplayName"],[b,c,e])}g.parseBlocklistIds=a}),98); __d("WASmaxInBlocklistsBlocklistIdentifierMixin",["WAResultOrError","WASmaxInBlocklistsBlocklistIds"],(function(a,b,c,d,e,f,g){function a(a){a=d("WASmaxInBlocklistsBlocklistIds").parseBlocklistIds(a);return!a.success?a:d("WAResultOrError").makeResult({blocklistIds:a.value})}g.parseBlocklistIdentifierMixin=a}),98); __d("WASmaxInBlocklistsGetBlockListResponseMigratedSuccessWithMismatch",["WAResultOrError","WASmaxInBlocklistsBlocklistIdentifierMixin","WASmaxParseJid","WASmaxParseReference","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function h(a){var b=d("WASmaxParseUtils").assertTag(a,"item");if(!b.success)return b;b=d("WASmaxParseJid").attrUserJid(a,"jid");if(!b.success)return b;a=d("WASmaxInBlocklistsBlocklistIdentifierMixin").parseBlocklistIdentifierMixin(a);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({jid:b.value},a.value))}function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"list");if(!c.success)return c;var e=d("WASmaxParseReference").attrStringFromReference(b,["to"]);if(!e.success)return e;e=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"from",e.value);if(!e.success)return e;e=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","result");if(!e.success)return e;b=d("WASmaxParseReference").attrStringFromReference(b,["id"]);if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"id",b.value);if(!a.success)return a;b=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrString,c.value,"dhash");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,c.value,"addressing_mode","lid");if(!a.success)return a;c=d("WASmaxParseUtils").mapChildrenWithTag(c.value,"item",0,64e3,h);return!c.success?c:d("WAResultOrError").makeResult({type:e.value,listDhash:b.value,listAddressingMode:a.value,listItem:c.value})}g.parseGetBlockListResponseMigratedSuccessWithMismatchListItem=h;g.parseGetBlockListResponseMigratedSuccessWithMismatch=a}),98); __d("WASmaxInBlocklistsGetBlockListResponseSuccessWithMatch",["WAResultOrError","WASmaxInBlocklistsEnums","WASmaxParseReference","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["to"]);if(!c.success)return c;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"from",c.value);if(!c.success)return c;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","result");if(!c.success)return c;b=d("WASmaxParseReference").attrStringFromReference(b,["id"]);if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"id",b.value);if(!b.success)return b;b=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrStringEnum,a,"addressing_mode",d("WASmaxInBlocklistsEnums").ENUM_LID_PN);return!b.success?b:d("WAResultOrError").makeResult({type:c.value,addressingMode:b.value})}g.parseGetBlockListResponseSuccessWithMatch=a}),98); __d("WASmaxInBlocklistsGetBlockListResponseSuccessWithMismatch",["WAResultOrError","WASmaxInBlocklistsDisplayNameMixin","WASmaxParseJid","WASmaxParseReference","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function h(a){var b=d("WASmaxParseUtils").assertTag(a,"item");if(!b.success)return b;b=d("WASmaxParseJid").attrUserJid(a,"jid");if(!b.success)return b;var c=d("WASmaxParseUtils").optional(d("WASmaxParseJid").attrUserJid,a,"lid");if(!c.success)return c;a=d("WASmaxInBlocklistsDisplayNameMixin").parseDisplayNameMixin(a);return d("WAResultOrError").makeResult({jid:b.value,lid:c.value,displayNameMixin:a.success?a.value:null})}function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"list");if(!c.success)return c;var e=d("WASmaxParseReference").attrStringFromReference(b,["to"]);if(!e.success)return e;e=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"from",e.value);if(!e.success)return e;e=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","result");if(!e.success)return e;b=d("WASmaxParseReference").attrStringFromReference(b,["id"]);if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"id",b.value);if(!a.success)return a;b=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrString,c.value,"dhash");if(!b.success)return b;a=d("WASmaxParseUtils").optionalLiteral(d("WASmaxParseUtils").attrString,c.value,"addressing_mode","pn");if(!a.success)return a;c=d("WASmaxParseUtils").mapChildrenWithTag(c.value,"item",0,64e3,h);return!c.success?c:d("WAResultOrError").makeResult({type:e.value,listDhash:b.value,listAddressingMode:a.value,listItem:c.value})}g.parseGetBlockListResponseSuccessWithMismatchListItem=h;g.parseGetBlockListResponseSuccessWithMismatch=a}),98); __d("WASmaxOutBlocklistsGetBlockListRequest",["WASmaxChildren","WASmaxJsx","WAWap"],(function(a,b,c,d,e,f,g){function h(a){a=a.itemDhash;a=d("WASmaxJsx").smax("item",{dhash:d("WAWap").CUSTOM_STRING(a)});return a}function a(a){a=a.itemArgs;a=d("WASmaxJsx").smax("iq",{to:d("WAWap").S_WHATSAPP_NET,xmlns:"blocklist",type:"get",id:d("WAWap").generateId()},d("WASmaxChildren").OPTIONAL_CHILD(h,a));return a}g.makeGetBlockListRequestItem=h;g.makeGetBlockListRequest=a}),98); __d("WASmaxBlocklistsGetBlockListRPC",["WAComms","WASmaxInBlocklistsGetBlockListResponseInternalServerError","WASmaxInBlocklistsGetBlockListResponseInvalidRequest","WASmaxInBlocklistsGetBlockListResponseMigratedSuccessWithMismatch","WASmaxInBlocklistsGetBlockListResponseSuccessWithMatch","WASmaxInBlocklistsGetBlockListResponseSuccessWithMismatch","WASmaxOutBlocklistsGetBlockListRequest","WASmaxParsingFailure","WASmaxRpcUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=d("WASmaxOutBlocklistsGetBlockListRequest").makeGetBlockListRequest(a);b=(yield d("WAComms").sendSmaxStanza(a,b));var c=d("WASmaxInBlocklistsGetBlockListResponseSuccessWithMismatch").parseGetBlockListResponseSuccessWithMismatch(b,a);if(c.success)return{name:"GetBlockListResponseSuccessWithMismatch",value:c.value};var e=d("WASmaxInBlocklistsGetBlockListResponseMigratedSuccessWithMismatch").parseGetBlockListResponseMigratedSuccessWithMismatch(b,a);if(e.success)return{name:"GetBlockListResponseMigratedSuccessWithMismatch",value:e.value};var f=d("WASmaxInBlocklistsGetBlockListResponseSuccessWithMatch").parseGetBlockListResponseSuccessWithMatch(b,a);if(f.success)return{name:"GetBlockListResponseSuccessWithMatch",value:f.value};var g=d("WASmaxInBlocklistsGetBlockListResponseInvalidRequest").parseGetBlockListResponseInvalidRequest(b,a);if(g.success)return{name:"GetBlockListResponseInvalidRequest",value:g.value};b=d("WASmaxInBlocklistsGetBlockListResponseInternalServerError").parseGetBlockListResponseInternalServerError(b,a);if(b.success)return{name:"GetBlockListResponseInternalServerError",value:b.value};throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(d("WASmaxRpcUtils").errorMessageRpcParsing("GetBlockList",{SuccessWithMismatch:c,MigratedSuccessWithMismatch:e,SuccessWithMatch:f,InvalidRequest:g,InternalServerError:b}))});return h.apply(this,arguments)}g.sendGetBlockListRPC=a}),98); __d("WASmaxInBlocklistsIQErrorForbiddenMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","forbidden");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",403);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorForbiddenMixin=a}),98); __d("WASmaxInBlocklistsIQErrorNotAcceptableMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function h(a){var b=d("WASmaxParseUtils").assertTag(a,"field");if(!b.success)return b;b=d("WASmaxParseUtils").attrString(a,"name");if(!b.success)return b;a=d("WASmaxParseUtils").attrString(a,"reason");return!a.success?a:d("WAResultOrError").makeResult({name:b.value,reason:a.value})}function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").optionalChildWithTag(a,"field",h);if(!b.success)return b;var c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","not-acceptable");if(!c.success)return c;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",406);return!a.success?a:d("WAResultOrError").makeResult({text:c.value,code:a.value,field:b.value})}g.parseIQErrorNotAcceptableField=h;g.parseIQErrorNotAcceptableMixin=a}),98); __d("WASmaxInBlocklistsIQErrorNotAllowedMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","not-allowed");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",405);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorNotAllowedMixin=a}),98); __d("WASmaxInBlocklistsUpdateBlocklistErrors",["WAResultOrError","WASmaxInBlocklistsIQErrorBadRequestMixin","WASmaxInBlocklistsIQErrorForbiddenMixin","WASmaxInBlocklistsIQErrorNotAcceptableMixin","WASmaxInBlocklistsIQErrorNotAllowedMixin","WASmaxInBlocklistsIQErrorRateOverlimitMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxInBlocklistsIQErrorNotAcceptableMixin").parseIQErrorNotAcceptableMixin(a);if(b.success)return d("WAResultOrError").makeResult({name:"IQErrorNotAcceptable",value:b.value});var c=d("WASmaxInBlocklistsIQErrorBadRequestMixin").parseIQErrorBadRequestMixin(a);if(c.success)return d("WAResultOrError").makeResult({name:"IQErrorBadRequest",value:c.value});var e=d("WASmaxInBlocklistsIQErrorForbiddenMixin").parseIQErrorForbiddenMixin(a);if(e.success)return d("WAResultOrError").makeResult({name:"IQErrorForbidden",value:e.value});var f=d("WASmaxInBlocklistsIQErrorRateOverlimitMixin").parseIQErrorRateOverlimitMixin(a);if(f.success)return d("WAResultOrError").makeResult({name:"IQErrorRateOverlimit",value:f.value});var g=d("WASmaxInBlocklistsIQErrorNotAllowedMixin").parseIQErrorNotAllowedMixin(a);return g.success?d("WAResultOrError").makeResult({name:"IQErrorNotAllowed",value:g.value}):d("WASmaxParseUtils").errorMixinDisjunction(a,["IQErrorNotAcceptable","IQErrorBadRequest","IQErrorForbidden","IQErrorRateOverlimit","IQErrorNotAllowed"],[b,c,e,f,g])}g.parseUpdateBlocklistErrors=a}),98); __d("WASmaxInBlocklistsUpdateBlockListResponseInvalidRequest",["WAResultOrError","WASmaxInBlocklistsEnums","WASmaxInBlocklistsIQErrorResponseMixin","WASmaxInBlocklistsUpdateBlocklistErrors","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"error");if(!c.success)return c;var e=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrStringEnum,c.value,"addressing_mode",d("WASmaxInBlocklistsEnums").ENUM_LID_PN);if(!e.success)return e;a=d("WASmaxInBlocklistsIQErrorResponseMixin").parseIQErrorResponseMixin(a,b);if(!a.success)return a;b=d("WASmaxInBlocklistsUpdateBlocklistErrors").parseUpdateBlocklistErrors(c.value);return!b.success?b:d("WAResultOrError").makeResult(babelHelpers["extends"]({errorAddressingMode:e.value},a.value,{errorUpdateBlocklistErrors:b.value}))}g.parseUpdateBlockListResponseInvalidRequest=a}),98); __d("WASmaxInBlocklistsUpdateBlockListResponseMigratedSuccessWithMismatch",["WAResultOrError","WASmaxInBlocklistsBlocklistIdentifierMixin","WASmaxParseJid","WASmaxParseReference","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function h(a){var b=d("WASmaxParseUtils").assertTag(a,"item");if(!b.success)return b;b=d("WASmaxParseJid").attrUserJid(a,"jid");if(!b.success)return b;a=d("WASmaxInBlocklistsBlocklistIdentifierMixin").parseBlocklistIdentifierMixin(a);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({jid:b.value},a.value))}function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"list");if(!c.success)return c;var e=d("WASmaxParseReference").attrStringFromReference(b,["to"]);if(!e.success)return e;e=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"from",e.value);if(!e.success)return e;e=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","result");if(!e.success)return e;var f=d("WASmaxParseReference").attrStringFromReference(b,["id"]);if(!f.success)return f;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"id",f.value);if(!a.success)return a;f=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,c.value,"matched","false");if(!f.success)return f;a=d("WASmaxParseReference").optionalAttrStringFromReference(b,["item","dhash"]);if(!a.success)return a;b=d("WASmaxParseUtils").optionalLiteral(d("WASmaxParseUtils").attrString,c.value,"c_dhash",a.value);if(!b.success)return b;a=d("WASmaxParseUtils").attrString(c.value,"dhash");if(!a.success)return a;var g=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,c.value,"addressing_mode","lid");if(!g.success)return g;c=d("WASmaxParseUtils").mapChildrenWithTag(c.value,"item",0,64e3,h);return!c.success?c:d("WAResultOrError").makeResult({type:e.value,listMatched:f.value,hasListCDhash:b.value!=null,listDhash:a.value,listAddressingMode:g.value,listItem:c.value})}g.parseUpdateBlockListResponseMigratedSuccessWithMismatchListItem=h;g.parseUpdateBlockListResponseMigratedSuccessWithMismatch=a}),98); __d("WASmaxInBlocklistsUpdateBlockListResponseServerError",["WAResultOrError","WASmaxInBlocklistsIQErrorResponseMixin","WASmaxInBlocklistsServerErrors","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"error");if(!c.success)return c;a=d("WASmaxInBlocklistsIQErrorResponseMixin").parseIQErrorResponseMixin(a,b);if(!a.success)return a;b=d("WASmaxInBlocklistsServerErrors").parseServerErrors(c.value);return!b.success?b:d("WAResultOrError").makeResult(babelHelpers["extends"]({},a.value,{errorServerErrors:b.value}))}g.parseUpdateBlockListResponseServerError=a}),98); __d("WASmaxInBlocklistsUpdateBlockListResponseSuccessWithMatch",["WAResultOrError","WASmaxInBlocklistsEnums","WASmaxParseReference","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"list");if(!c.success)return c;var e=d("WASmaxParseReference").attrStringFromReference(b,["to"]);if(!e.success)return e;e=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"from",e.value);if(!e.success)return e;e=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","result");if(!e.success)return e;b=d("WASmaxParseReference").attrStringFromReference(b,["id"]);if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"id",b.value);if(!a.success)return a;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,c.value,"matched","true");if(!b.success)return b;a=d("WASmaxParseUtils").attrString(c.value,"dhash");if(!a.success)return a;c=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrStringEnum,c.value,"addressing_mode",d("WASmaxInBlocklistsEnums").ENUM_LID_PN);return!c.success?c:d("WAResultOrError").makeResult({type:e.value,listMatched:b.value,listDhash:a.value,listAddressingMode:c.value})}g.parseUpdateBlockListResponseSuccessWithMatch=a}),98); __d("WASmaxInBlocklistsUpdateBlockListResponseSuccessWithMismatch",["WAResultOrError","WASmaxInBlocklistsDisplayNameMixin","WASmaxParseJid","WASmaxParseReference","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function h(a){var b=d("WASmaxParseUtils").assertTag(a,"item");if(!b.success)return b;b=d("WASmaxParseJid").attrUserJid(a,"jid");if(!b.success)return b;a=d("WASmaxInBlocklistsDisplayNameMixin").parseDisplayNameMixin(a);return d("WAResultOrError").makeResult({jid:b.value,displayNameMixin:a.success?a.value:null})}function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"list");if(!c.success)return c;var e=d("WASmaxParseReference").attrStringFromReference(b,["to"]);if(!e.success)return e;e=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"from",e.value);if(!e.success)return e;e=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","result");if(!e.success)return e;var f=d("WASmaxParseReference").attrStringFromReference(b,["id"]);if(!f.success)return f;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"id",f.value);if(!a.success)return a;f=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,c.value,"matched","false");if(!f.success)return f;a=d("WASmaxParseReference").optionalAttrStringFromReference(b,["item","dhash"]);if(!a.success)return a;b=d("WASmaxParseUtils").optionalLiteral(d("WASmaxParseUtils").attrString,c.value,"c_dhash",a.value);if(!b.success)return b;a=d("WASmaxParseUtils").attrString(c.value,"dhash");if(!a.success)return a;var g=d("WASmaxParseUtils").optionalLiteral(d("WASmaxParseUtils").attrString,c.value,"addressing_mode","pn");if(!g.success)return g;c=d("WASmaxParseUtils").mapChildrenWithTag(c.value,"item",0,64e3,h);return!c.success?c:d("WAResultOrError").makeResult({type:e.value,listMatched:f.value,hasListCDhash:b.value!=null,listDhash:a.value,listAddressingMode:g.value,listItem:c.value})}g.parseUpdateBlockListResponseSuccessWithMismatchListItem=h;g.parseUpdateBlockListResponseSuccessWithMismatch=a}),98); __d("WASmaxOutBlocklistsDisplayNameMixin",["WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(a){a=a.anyDisplayName;a=d("WASmaxJsx").smax("smax$any",{display_name:d("WAWap").CUSTOM_STRING(a)});return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeDisplayNameMixin=a}),98); __d("WASmaxOutBlocklistsPnJidMixin",["WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(a){a=a.anyPnJid;a=d("WASmaxJsx").smax("smax$any",{pn_jid:d("WAWap").JID(a)});return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergePnJidMixin=a}),98); __d("WASmaxOutBlocklistsUsernameMixin",["WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(a){a=a.anyUsername;a=d("WASmaxJsx").smax("smax$any",{username:d("WAWap").CUSTOM_STRING(a)});return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeUsernameMixin=a}),98); __d("WASmaxOutBlocklistsBlocklistIds",["WASmaxMixinGroupExhaustiveError","WASmaxOutBlocklistsDisplayNameMixin","WASmaxOutBlocklistsPnJidMixin","WASmaxOutBlocklistsUsernameMixin"],(function(a,b,c,d,e,f,g){function a(a,b){if(b.username)return d("WASmaxOutBlocklistsUsernameMixin").mergeUsernameMixin(a,b.username);if(b.pnJid)return d("WASmaxOutBlocklistsPnJidMixin").mergePnJidMixin(a,b.pnJid);if(b.displayName)return d("WASmaxOutBlocklistsDisplayNameMixin").mergeDisplayNameMixin(a,b.displayName);throw new(d("WASmaxMixinGroupExhaustiveError").SmaxMixinGroupExhaustiveError)()}g.mergeBlocklistIds=a}),98); __d("WASmaxOutBlocklistsBlocklistIdentifierMixin",["WASmaxJsx","WASmaxMixins","WASmaxOutBlocklistsBlocklistIds"],(function(a,b,c,d,e,f,g){function h(a){a=a.blocklistIdsArgs;a=d("WASmaxOutBlocklistsBlocklistIds").mergeBlocklistIds(d("WASmaxJsx").smax("smax$any",null),a);return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeBlocklistIdentifierMixin=a}),98); __d("WASmaxOutBlocklistsUpdateBlockListMigratedBlockItemMixin",["WASmaxJsx","WASmaxMixins","WASmaxOutBlocklistsBlocklistIdentifierMixin","WAWap"],(function(a,b,c,d,e,f,g){function h(a){var b=a.itemJid;b=d("WASmaxOutBlocklistsBlocklistIdentifierMixin").mergeBlocklistIdentifierMixin(d("WASmaxJsx").smax("item",{jid:d("WAWap").JID(b)}),a);return b}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeUpdateBlockListMigratedBlockItemMixin=a}),98); __d("WASmaxOutBlocklistsUpdateBlockListNonMigratedBlockItemMixin",["WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(a){a=a.itemJid;a=d("WASmaxJsx").smax("item",{jid:d("WAWap").USER_JID(a)});return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeUpdateBlockListNonMigratedBlockItemMixin=a}),98); __d("WASmaxOutBlocklistsUpdateBlockListOrUpdateBlockListNonMigratedBlockItemMixinGroup",["WASmaxMixinGroupExhaustiveError","WASmaxOutBlocklistsUpdateBlockListMigratedBlockItemMixin","WASmaxOutBlocklistsUpdateBlockListNonMigratedBlockItemMixin"],(function(a,b,c,d,e,f,g){function a(a,b){if(b.updateBlockListMigratedBlockItem)return d("WASmaxOutBlocklistsUpdateBlockListMigratedBlockItemMixin").mergeUpdateBlockListMigratedBlockItemMixin(a,b.updateBlockListMigratedBlockItem);if(b.updateBlockListNonMigratedBlockItem)return d("WASmaxOutBlocklistsUpdateBlockListNonMigratedBlockItemMixin").mergeUpdateBlockListNonMigratedBlockItemMixin(a,b.updateBlockListNonMigratedBlockItem);throw new(d("WASmaxMixinGroupExhaustiveError").SmaxMixinGroupExhaustiveError)()}g.mergeUpdateBlockListOrUpdateBlockListNonMigratedBlockItemMixinGroup=a}),98); __d("WASmaxOutBlocklistsUpdateBlockListBlockItemMixin",["WASmaxJsx","WASmaxMixins","WASmaxOutBlocklistsUpdateBlockListOrUpdateBlockListNonMigratedBlockItemMixinGroup"],(function(a,b,c,d,e,f,g){function h(a){a=a.updateBlockListOrUpdateBlockListNonMigratedBlockItemMixinGroupArgs;a=d("WASmaxOutBlocklistsUpdateBlockListOrUpdateBlockListNonMigratedBlockItemMixinGroup").mergeUpdateBlockListOrUpdateBlockListNonMigratedBlockItemMixinGroup(d("WASmaxJsx").smax("item",{action:"block"}),a);return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeUpdateBlockListBlockItemMixin=a}),98); __d("WASmaxOutBlocklistsUpdateBlockListUnblockItemMixin",["WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(a){a=a.itemJid;a=d("WASmaxJsx").smax("item",{action:"unblock",jid:d("WAWap").USER_JID(a)});return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeUpdateBlockListUnblockItemMixin=a}),98); __d("WASmaxOutBlocklistsUpdateBlockListBlockOrUpdateBlockListUnblockItemMixinGroup",["WASmaxMixinGroupExhaustiveError","WASmaxOutBlocklistsUpdateBlockListBlockItemMixin","WASmaxOutBlocklistsUpdateBlockListUnblockItemMixin"],(function(a,b,c,d,e,f,g){function a(a,b){if(b.updateBlockListBlockItem)return d("WASmaxOutBlocklistsUpdateBlockListBlockItemMixin").mergeUpdateBlockListBlockItemMixin(a,b.updateBlockListBlockItem);if(b.updateBlockListUnblockItem)return d("WASmaxOutBlocklistsUpdateBlockListUnblockItemMixin").mergeUpdateBlockListUnblockItemMixin(a,b.updateBlockListUnblockItem);throw new(d("WASmaxMixinGroupExhaustiveError").SmaxMixinGroupExhaustiveError)()}g.mergeUpdateBlockListBlockOrUpdateBlockListUnblockItemMixinGroup=a}),98); __d("WASmaxOutBlocklistsUpdateBlockListReportBlockEntryPointMixin",["WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(a){a=a.entryPointSource;a=d("WASmaxJsx").smax("iq",null,d("WASmaxJsx").smax("entry_point",{source:d("WAWap").CUSTOM_STRING(a)}));return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeUpdateBlockListReportBlockEntryPointMixin=a}),98); __d("WASmaxOutBlocklistsUpdateBlockListRequest",["WASmaxAttrs","WASmaxChildren","WASmaxJsx","WASmaxMixins","WASmaxOutBlocklistsUpdateBlockListBlockOrUpdateBlockListUnblockItemMixinGroup","WASmaxOutBlocklistsUpdateBlockListReportBlockEntryPointMixin","WAWap"],(function(a,b,c,d,e,f,g){function h(a){var b,c,e=a.bizOptOutReason,f=a.bizOptOutReasonDescription,g=a.bizOptOutEntryPoint,h=a.bizOptOutFirstMessage,i=a.bizOptOutBusinessDiscoveryEntryPoint,j=a.bizOptOutBusinessDiscoveryTimestamp;a=a.bizOptOutBusinessDiscoveryId;e=d("WASmaxJsx").smax("biz_opt_out",{reason:(b=d("WASmaxAttrs")).OPTIONAL((c=d("WAWap")).CUSTOM_STRING,e),reason_description:b.OPTIONAL(c.CUSTOM_STRING,f),entry_point:b.OPTIONAL(c.CUSTOM_STRING,g),first_message:b.OPTIONAL(c.CUSTOM_STRING,h),business_discovery_entry_point:b.OPTIONAL(c.CUSTOM_STRING,i),business_discovery_timestamp:b.OPTIONAL(c.INT,j),business_discovery_id:b.OPTIONAL(c.CUSTOM_STRING,a)});return e}function a(a){var b=a.bizOptOutArgs,c=a.updateBlockListReportBlockEntryPointMixinArgs,e=a.itemDhash;a=a.updateBlockListBlockOrUpdateBlockListUnblockItemMixinGroupArgs;e=d("WASmaxMixins").optionalMerge(d("WASmaxOutBlocklistsUpdateBlockListReportBlockEntryPointMixin").mergeUpdateBlockListReportBlockEntryPointMixin,d("WASmaxJsx").smax("iq",{to:d("WAWap").S_WHATSAPP_NET,xmlns:"blocklist",type:"set",id:d("WAWap").generateId()},d("WASmaxOutBlocklistsUpdateBlockListBlockOrUpdateBlockListUnblockItemMixinGroup").mergeUpdateBlockListBlockOrUpdateBlockListUnblockItemMixinGroup(d("WASmaxJsx").smax("item",{dhash:d("WASmaxAttrs").OPTIONAL(d("WAWap").CUSTOM_STRING,e)},d("WASmaxChildren").OPTIONAL_CHILD(h,b)),a)),c);return e}g.makeUpdateBlockListRequestItemBizOptOut=h;g.makeUpdateBlockListRequest=a}),98); __d("WASmaxBlocklistsUpdateBlockListRPC",["WAComms","WASmaxInBlocklistsUpdateBlockListResponseInvalidRequest","WASmaxInBlocklistsUpdateBlockListResponseMigratedSuccessWithMismatch","WASmaxInBlocklistsUpdateBlockListResponseServerError","WASmaxInBlocklistsUpdateBlockListResponseSuccessWithMatch","WASmaxInBlocklistsUpdateBlockListResponseSuccessWithMismatch","WASmaxOutBlocklistsUpdateBlockListRequest","WASmaxParsingFailure","WASmaxRpcUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=d("WASmaxOutBlocklistsUpdateBlockListRequest").makeUpdateBlockListRequest(a);b=(yield d("WAComms").sendSmaxStanza(a,b));var c=d("WASmaxInBlocklistsUpdateBlockListResponseSuccessWithMatch").parseUpdateBlockListResponseSuccessWithMatch(b,a);if(c.success)return{name:"UpdateBlockListResponseSuccessWithMatch",value:c.value};var e=d("WASmaxInBlocklistsUpdateBlockListResponseSuccessWithMismatch").parseUpdateBlockListResponseSuccessWithMismatch(b,a);if(e.success)return{name:"UpdateBlockListResponseSuccessWithMismatch",value:e.value};var f=d("WASmaxInBlocklistsUpdateBlockListResponseMigratedSuccessWithMismatch").parseUpdateBlockListResponseMigratedSuccessWithMismatch(b,a);if(f.success)return{name:"UpdateBlockListResponseMigratedSuccessWithMismatch",value:f.value};var g=d("WASmaxInBlocklistsUpdateBlockListResponseInvalidRequest").parseUpdateBlockListResponseInvalidRequest(b,a);if(g.success)return{name:"UpdateBlockListResponseInvalidRequest",value:g.value};b=d("WASmaxInBlocklistsUpdateBlockListResponseServerError").parseUpdateBlockListResponseServerError(b,a);if(b.success)return{name:"UpdateBlockListResponseServerError",value:b.value};throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(d("WASmaxRpcUtils").errorMessageRpcParsing("UpdateBlockList",{SuccessWithMatch:c,SuccessWithMismatch:e,MigratedSuccessWithMismatch:f,InvalidRequest:g,ServerError:b}))});return h.apply(this,arguments)}g.sendUpdateBlockListRPC=a}),98); __d("WASmaxInBotIQErrorBadRequestMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","bad-request");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",400);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorBadRequestMixin=a}),98); __d("WASmaxInBotIQErrorForbiddenMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","forbidden");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",403);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorForbiddenMixin=a}),98); __d("WASmaxInBotIQErrorInternalServerErrorMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","internal-server-error");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",500);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorInternalServerErrorMixin=a}),98); __d("WASmaxInBotIQErrorNotAllowedMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","not-allowed");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",405);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorNotAllowedMixin=a}),98); __d("WASmaxInBotBotListErrors",["WAResultOrError","WASmaxInBotIQErrorBadRequestMixin","WASmaxInBotIQErrorForbiddenMixin","WASmaxInBotIQErrorInternalServerErrorMixin","WASmaxInBotIQErrorNotAllowedMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxInBotIQErrorInternalServerErrorMixin").parseIQErrorInternalServerErrorMixin(a);if(b.success)return d("WAResultOrError").makeResult({name:"IQErrorInternalServerError",value:b.value});var c=d("WASmaxInBotIQErrorForbiddenMixin").parseIQErrorForbiddenMixin(a);if(c.success)return d("WAResultOrError").makeResult({name:"IQErrorForbidden",value:c.value});var e=d("WASmaxInBotIQErrorBadRequestMixin").parseIQErrorBadRequestMixin(a);if(e.success)return d("WAResultOrError").makeResult({name:"IQErrorBadRequest",value:e.value});var f=d("WASmaxInBotIQErrorNotAllowedMixin").parseIQErrorNotAllowedMixin(a);return f.success?d("WAResultOrError").makeResult({name:"IQErrorNotAllowed",value:f.value}):d("WASmaxParseUtils").errorMixinDisjunction(a,["IQErrorInternalServerError","IQErrorForbidden","IQErrorBadRequest","IQErrorNotAllowed"],[b,c,e,f])}g.parseBotListErrors=a}),98); __d("WASmaxInBotIQErrorResponseMixin",["WAResultOrError","WASmaxParseReference","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["id"]);if(!c.success)return c;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"id",c.value);if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["to"]);if(!c.success)return c;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"from",c.value);if(!b.success)return b;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","error");return!c.success?c:d("WAResultOrError").makeResult({type:c.value})}g.parseIQErrorResponseMixin=a}),98); __d("WASmaxInBotBotListResponseError",["WAResultOrError","WASmaxInBotBotListErrors","WASmaxInBotIQErrorResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"error");if(!c.success)return c;a=d("WASmaxInBotIQErrorResponseMixin").parseIQErrorResponseMixin(a,b);if(!a.success)return a;b=d("WASmaxInBotBotListErrors").parseBotListErrors(c.value);return!b.success?b:d("WAResultOrError").makeResult(babelHelpers["extends"]({},a.value,{errorBotListErrors:b.value}))}g.parseBotListResponseError=a}),98); __d("WASmaxInBotEnums",[],(function(a,b,c,d,e,f){a={all:"all",category:"category",featured:"featured"};b={dark:"dark",light:"light"};c={hidden:"hidden",hscroll:"hscroll",hscroll_icebreakers:"hscroll_icebreakers",hscroll_large:"hscroll_large",hscroll_small:"hscroll_small",listview:"listview"};f.ENUM_ALL_CATEGORY_FEATURED=a;f.ENUM_DARK_LIGHT=b;f.ENUM_HIDDEN_HSCROLL_HSCROLLICEBREAKERS_HSCROLLLARGE_HSCROLLSMALL_LISTVIEW=c}),66); __d("WASmaxInBotIQResultResponseMixin",["WAResultOrError","WASmaxParseReference","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["id"]);if(!c.success)return c;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"id",c.value);if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["to"]);if(!c.success)return c;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"from",c.value);if(!b.success)return b;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","result");return!c.success?c:d("WAResultOrError").makeResult({type:c.value})}g.parseIQResultResponseMixin=a}),98); __d("WASmaxInBotBotListResponseSuccessV2",["WAResultOrError","WASmaxInBotEnums","WASmaxInBotIQResultResponseMixin","WASmaxParseJid","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function h(a){var b=d("WASmaxParseUtils").assertTag(a,"theme");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"background");if(!b.success)return b;var c=d("WASmaxParseUtils").flattenedChildWithTag(a,"primary_text");if(!c.success)return c;var e=d("WASmaxParseUtils").flattenedChildWithTag(a,"secondary_text");if(!e.success)return e;a=d("WASmaxParseUtils").attrStringEnum(a,"mode",d("WASmaxInBotEnums").ENUM_DARK_LIGHT);if(!a.success)return a;b=d("WASmaxParseUtils").contentString(b.value);if(!b.success)return b;c=d("WASmaxParseUtils").contentString(c.value);if(!c.success)return c;e=d("WASmaxParseUtils").contentString(e.value);return!e.success?e:d("WAResultOrError").makeResult({mode:a.value,backgroundElementValue:b.value,primaryTextElementValue:c.value,secondaryTextElementValue:e.value})}function i(a){var b=d("WASmaxParseUtils").assertTag(a,"bot");if(!b.success)return b;b=d("WASmaxParseJid").attrUserJid(a,"jid");if(!b.success)return b;var c=d("WASmaxParseUtils").attrString(a,"persona_id");if(!c.success)return c;var e=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrInt,a,"count");if(!e.success)return e;a=d("WASmaxParseUtils").mapChildrenWithTag(a,"theme",0,2,h);return!a.success?a:d("WAResultOrError").makeResult({jid:b.value,personaId:c.value,count:e.value,theme:a.value})}function j(a){var b=d("WASmaxParseUtils").assertTag(a,"section");if(!b.success)return b;b=d("WASmaxParseUtils").attrString(a,"name");if(!b.success)return b;var c=d("WASmaxParseUtils").attrStringEnum(a,"type",d("WASmaxInBotEnums").ENUM_ALL_CATEGORY_FEATURED);if(!c.success)return c;a=d("WASmaxParseUtils").mapChildrenWithTag(a,"bot",0,Infinity,i);return!a.success?a:d("WAResultOrError").makeResult({name:b.value,type:c.value,bot:a.value})}function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"bot");if(!c.success)return c;var e=d("WASmaxParseUtils").flattenedChildWithTag(c.value,"default");if(!e.success)return e;var f=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,c.value,"v","2");if(!f.success)return f;var g=d("WASmaxParseJid").attrUserJid(e.value,"jid");if(!g.success)return g;e=d("WASmaxParseUtils").attrString(e.value,"persona_id");if(!e.success)return e;a=d("WASmaxInBotIQResultResponseMixin").parseIQResultResponseMixin(a,b);if(!a.success)return a;b=d("WASmaxParseUtils").mapChildrenWithTag(c.value,"section",1,Infinity,j);return!b.success?b:d("WAResultOrError").makeResult(babelHelpers["extends"]({botV:f.value,botDefaultJid:g.value,botDefaultPersonaId:e.value},a.value,{botSection:b.value}))}g.parseBotListResponseSuccessV2BotSectionBotTheme=h;g.parseBotListResponseSuccessV2BotSectionBot=i;g.parseBotListResponseSuccessV2BotSection=j;g.parseBotListResponseSuccessV2=a}),98); __d("WASmaxInBotBotListResponseSuccessV3",["WAResultOrError","WASmaxInBotEnums","WASmaxInBotIQResultResponseMixin","WASmaxParseJid","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function h(a){var b=d("WASmaxParseUtils").assertTag(a,"bot");if(!b.success)return b;b=d("WASmaxParseJid").attrUserJid(a,"jid");if(!b.success)return b;var c=d("WASmaxParseUtils").attrString(a,"persona_id");if(!c.success)return c;var e=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrString,a,"card_title");if(!e.success)return e;a=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrInt,a,"count");return!a.success?a:d("WAResultOrError").makeResult({jid:b.value,personaId:c.value,cardTitle:e.value,count:a.value})}function i(a){var b=d("WASmaxParseUtils").assertTag(a,"section");if(!b.success)return b;b=d("WASmaxParseUtils").attrString(a,"name");if(!b.success)return b;var c=d("WASmaxParseUtils").attrStringEnum(a,"type",d("WASmaxInBotEnums").ENUM_ALL_CATEGORY_FEATURED);if(!c.success)return c;var e=d("WASmaxParseUtils").attrStringEnum(a,"display_type",d("WASmaxInBotEnums").ENUM_HIDDEN_HSCROLL_HSCROLLICEBREAKERS_HSCROLLLARGE_HSCROLLSMALL_LISTVIEW);if(!e.success)return e;a=d("WASmaxParseUtils").mapChildrenWithTag(a,"bot",0,Infinity,h);return!a.success?a:d("WAResultOrError").makeResult({name:b.value,type:c.value,displayType:e.value,bot:a.value})}function j(a){var b=d("WASmaxParseUtils").assertTag(a,"default");if(!b.success)return b;b=d("WASmaxParseJid").attrUserJid(a,"jid");if(!b.success)return b;a=d("WASmaxParseUtils").attrString(a,"persona_id");return!a.success?a:d("WAResultOrError").makeResult({jid:b.value,personaId:a.value})}function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"bot");if(!c.success)return c;var e=d("WASmaxParseUtils").optionalChildWithTag(c.value,"default",j);if(!e.success)return e;var f=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,c.value,"v","3");if(!f.success)return f;var g=d("WASmaxParseUtils").attrString(c.value,"bhash");if(!g.success)return g;a=d("WASmaxInBotIQResultResponseMixin").parseIQResultResponseMixin(a,b);if(!a.success)return a;b=d("WASmaxParseUtils").mapChildrenWithTag(c.value,"section",0,Infinity,i);return!b.success?b:d("WAResultOrError").makeResult(babelHelpers["extends"]({botV:f.value,botBhash:g.value},a.value,{botDefault:e.value,botSection:b.value}))}g.parseBotListResponseSuccessV3BotSectionBot=h;g.parseBotListResponseSuccessV3BotSection=i;g.parseBotListResponseSuccessV3BotDefault=j;g.parseBotListResponseSuccessV3=a}),98); __d("WASmaxOutBotBaseIQGetRequestMixin",["WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxJsx").smax("iq",{id:d("WAWap").generateId(),type:"get"});return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeBaseIQGetRequestMixin=a}),98); __d("WASmaxOutBotBotListIQMixin",["WASmaxJsx","WASmaxMixins","WASmaxOutBotBaseIQGetRequestMixin","WAWap"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxOutBotBaseIQGetRequestMixin").mergeBaseIQGetRequestMixin(d("WASmaxJsx").smax("iq",{to:d("WAWap").S_WHATSAPP_NET,xmlns:"bot"}));return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeBotListIQMixin=a}),98); __d("WASmaxOutBotBotListRequest",["WASmaxAttrs","WASmaxChildren","WASmaxJsx","WASmaxOutBotBotListIQMixin","WAWap"],(function(a,b,c,d,e,f,g){function h(a){a=a.botJid;a=d("WASmaxJsx").smax("bot",{jid:d("WAWap").JID(a)});return a}function a(a){var b=a.botArgs,c=a.botV;a=a.botBhash;c=d("WASmaxOutBotBotListIQMixin").mergeBotListIQMixin(d("WASmaxJsx").smax("iq",null,d("WASmaxJsx").smax("bot",{v:d("WASmaxAttrs").OPTIONAL(d("WAWap").CUSTOM_STRING,c),bhash:d("WASmaxAttrs").OPTIONAL(d("WAWap").CUSTOM_STRING,a)},d("WASmaxChildren").REPEATED_CHILD(h,b,0,Infinity))));return c}g.makeBotListRequestBotBot=h;g.makeBotListRequest=a}),98); __d("WASmaxBotBotListRPC",["WAComms","WASmaxInBotBotListResponseError","WASmaxInBotBotListResponseSuccessV2","WASmaxInBotBotListResponseSuccessV3","WASmaxOutBotBotListRequest","WASmaxParsingFailure","WASmaxRpcUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=d("WASmaxOutBotBotListRequest").makeBotListRequest(a);b=(yield d("WAComms").sendSmaxStanza(a,b));var c=d("WASmaxInBotBotListResponseSuccessV2").parseBotListResponseSuccessV2(b,a);if(c.success)return{name:"BotListResponseSuccessV2",value:c.value};var e=d("WASmaxInBotBotListResponseSuccessV3").parseBotListResponseSuccessV3(b,a);if(e.success)return{name:"BotListResponseSuccessV3",value:e.value};b=d("WASmaxInBotBotListResponseError").parseBotListResponseError(b,a);if(b.success)return{name:"BotListResponseError",value:b.value};throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(d("WASmaxRpcUtils").errorMessageRpcParsing("BotList",{SuccessV2:c,SuccessV3:e,Error:b}))});return h.apply(this,arguments)}g.sendBotListRPC=a}),98); __d("WASmaxInClientExpirationClientExpirationRequest",["WAResultOrError","WASmaxParseJid","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"ib");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"client_expiration");if(!b.success)return b;a=d("WASmaxParseJid").literalJid(d("WASmaxParseJid").attrDomainJid,a,"from","s.whatsapp.net");if(!a.success)return a;b=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrIntRange,b.value,"t",0,void 0);return!b.success?b:d("WAResultOrError").makeResult({from:a.value,clientExpirationT:b.value})}g.parseClientExpirationRequest=a}),98); __d("WASmaxClientExpirationClientExpirationRPC",["WASmaxInClientExpirationClientExpirationRequest","WASmaxParsingFailure","WASmaxRpcUtils"],(function(a,b,c,d,e,f,g){function a(a){a=d("WASmaxInClientExpirationClientExpirationRequest").parseClientExpirationRequest(a);if(!a.success)throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(d("WASmaxRpcUtils").errorMessageRpcParsing("ClientExpiration",{Request:a}));return{parsedRequest:a.value}}g.receiveClientExpirationRPC=a}),98); __d("WASmaxInGroupsIQErrorAlreadyExistsMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","already-exists");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",304);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorAlreadyExistsMixin=a}),98); __d("WASmaxInGroupsIQErrorConflictMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","conflict");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",409);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorConflictMixin=a}),98); __d("WASmaxInGroupsAcceptGroupAddClientErrors",["WAResultOrError","WASmaxInGroupsIQErrorAlreadyExistsMixin","WASmaxInGroupsIQErrorBadRequestMixin","WASmaxInGroupsIQErrorConflictMixin","WASmaxInGroupsIQErrorFallbackClientMixin","WASmaxInGroupsIQErrorForbiddenMixin","WASmaxInGroupsIQErrorGoneMixin","WASmaxInGroupsIQErrorItemNotFoundMixin","WASmaxInGroupsIQErrorLockedMixin","WASmaxInGroupsIQErrorNotAllowedMixin","WASmaxInGroupsIQErrorNotAuthorizedMixin","WASmaxInGroupsIQErrorParentLinkedGroupsParticipantsResourceLimitMixin","WASmaxInGroupsIQErrorResourceConstraintMixin","WASmaxInGroupsIQErrorResourceLimitMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxInGroupsIQErrorAlreadyExistsMixin").parseIQErrorAlreadyExistsMixin(a);if(b.success)return d("WAResultOrError").makeResult({name:"IQErrorAlreadyExists",value:b.value});var c=d("WASmaxInGroupsIQErrorBadRequestMixin").parseIQErrorBadRequestMixin(a);if(c.success)return d("WAResultOrError").makeResult({name:"IQErrorBadRequest",value:c.value});var e=d("WASmaxInGroupsIQErrorNotAuthorizedMixin").parseIQErrorNotAuthorizedMixin(a);if(e.success)return d("WAResultOrError").makeResult({name:"IQErrorNotAuthorized",value:e.value});var f=d("WASmaxInGroupsIQErrorForbiddenMixin").parseIQErrorForbiddenMixin(a);if(f.success)return d("WAResultOrError").makeResult({name:"IQErrorForbidden",value:f.value});var g=d("WASmaxInGroupsIQErrorItemNotFoundMixin").parseIQErrorItemNotFoundMixin(a);if(g.success)return d("WAResultOrError").makeResult({name:"IQErrorItemNotFound",value:g.value});var h=d("WASmaxInGroupsIQErrorConflictMixin").parseIQErrorConflictMixin(a);if(h.success)return d("WAResultOrError").makeResult({name:"IQErrorConflict",value:h.value});var i=d("WASmaxInGroupsIQErrorGoneMixin").parseIQErrorGoneMixin(a);if(i.success)return d("WAResultOrError").makeResult({name:"IQErrorGone",value:i.value});var j=d("WASmaxInGroupsIQErrorResourceLimitMixin").parseIQErrorResourceLimitMixin(a);if(j.success)return d("WAResultOrError").makeResult({name:"IQErrorResourceLimit",value:j.value});var k=d("WASmaxInGroupsIQErrorLockedMixin").parseIQErrorLockedMixin(a);if(k.success)return d("WAResultOrError").makeResult({name:"IQErrorLocked",value:k.value});var l=d("WASmaxInGroupsIQErrorResourceConstraintMixin").parseIQErrorResourceConstraintMixin(a);if(l.success)return d("WAResultOrError").makeResult({name:"IQErrorResourceConstraint",value:l.value});var m=d("WASmaxInGroupsIQErrorNotAllowedMixin").parseIQErrorNotAllowedMixin(a);if(m.success)return d("WAResultOrError").makeResult({name:"IQErrorNotAllowed",value:m.value});var n=d("WASmaxInGroupsIQErrorParentLinkedGroupsParticipantsResourceLimitMixin").parseIQErrorParentLinkedGroupsParticipantsResourceLimitMixin(a);if(n.success)return d("WAResultOrError").makeResult({name:"IQErrorParentLinkedGroupsParticipantsResourceLimit",value:n.value});var o=d("WASmaxInGroupsIQErrorFallbackClientMixin").parseIQErrorFallbackClientMixin(a);return o.success?d("WAResultOrError").makeResult({name:"IQErrorFallbackClient",value:o.value}):d("WASmaxParseUtils").errorMixinDisjunction(a,["IQErrorAlreadyExists","IQErrorBadRequest","IQErrorNotAuthorized","IQErrorForbidden","IQErrorItemNotFound","IQErrorConflict","IQErrorGone","IQErrorResourceLimit","IQErrorLocked","IQErrorResourceConstraint","IQErrorNotAllowed","IQErrorParentLinkedGroupsParticipantsResourceLimit","IQErrorFallbackClient"],[b,c,e,f,g,h,i,j,k,l,m,n,o])}g.parseAcceptGroupAddClientErrors=a}),98); __d("WASmaxInGroupsAcceptGroupAddResponseClientError",["WAResultOrError","WASmaxInGroupsAcceptGroupAddClientErrors","WASmaxInGroupsIQErrorResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"error");if(!c.success)return c;a=d("WASmaxInGroupsIQErrorResponseMixin").parseIQErrorResponseMixin(a,b);if(!a.success)return a;b=d("WASmaxInGroupsAcceptGroupAddClientErrors").parseAcceptGroupAddClientErrors(c.value);return!b.success?b:d("WAResultOrError").makeResult(babelHelpers["extends"]({},a.value,{errorAcceptGroupAddClientErrors:b.value}))}g.parseAcceptGroupAddResponseClientError=a}),98); __d("WASmaxInGroupsAcceptGroupAddResponseGroupJoinRequestSuccess",["WASmaxInGroupsIQResultResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"membership_approval_request");if(!c.success)return c;c=d("WASmaxInGroupsIQResultResponseMixin").parseIQResultResponseMixin(a,b);return!c.success?c:c}g.parseAcceptGroupAddResponseGroupJoinRequestSuccess=a}),98); __d("WASmaxInGroupsAcceptGroupAddResponseServerError",["WASmaxInGroupsBaseServerErrorMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxInGroupsBaseServerErrorMixin").parseBaseServerErrorMixin(a,b);return!c.success?c:c}g.parseAcceptGroupAddResponseServerError=a}),98); __d("WASmaxInGroupsAcceptGroupAddResponseSuccess",["WASmaxInGroupsIQResultResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxInGroupsIQResultResponseMixin").parseIQResultResponseMixin(a,b);return!c.success?c:c}g.parseAcceptGroupAddResponseSuccess=a}),98); __d("WASmaxOutGroupsAcceptGroupAddRequest",["WASmaxJsx","WASmaxOutGroupsBaseSetGroupMixin","WAWap"],(function(a,b,c,d,e,f,g){function a(a){var b=a.acceptCode,c=a.acceptExpiration,e=a.acceptAdmin;b=d("WASmaxOutGroupsBaseSetGroupMixin").mergeBaseSetGroupMixin(d("WASmaxJsx").smax("iq",null,d("WASmaxJsx").smax("accept",{code:d("WAWap").CUSTOM_STRING(b),expiration:d("WAWap").INT(c),admin:d("WAWap").USER_JID(e)})),a);return b}g.makeAcceptGroupAddRequest=a}),98); __d("WASmaxGroupsAcceptGroupAddRPC",["WAComms","WASmaxInGroupsAcceptGroupAddResponseClientError","WASmaxInGroupsAcceptGroupAddResponseGroupJoinRequestSuccess","WASmaxInGroupsAcceptGroupAddResponseServerError","WASmaxInGroupsAcceptGroupAddResponseSuccess","WASmaxOutGroupsAcceptGroupAddRequest","WASmaxParsingFailure","WASmaxRpcUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=d("WASmaxOutGroupsAcceptGroupAddRequest").makeAcceptGroupAddRequest(a);b=(yield d("WAComms").sendSmaxStanza(a,b));var c=d("WASmaxInGroupsAcceptGroupAddResponseGroupJoinRequestSuccess").parseAcceptGroupAddResponseGroupJoinRequestSuccess(b,a);if(c.success)return{name:"AcceptGroupAddResponseGroupJoinRequestSuccess",value:c.value};var e=d("WASmaxInGroupsAcceptGroupAddResponseSuccess").parseAcceptGroupAddResponseSuccess(b,a);if(e.success)return{name:"AcceptGroupAddResponseSuccess",value:e.value};var f=d("WASmaxInGroupsAcceptGroupAddResponseClientError").parseAcceptGroupAddResponseClientError(b,a);if(f.success)return{name:"AcceptGroupAddResponseClientError",value:f.value};b=d("WASmaxInGroupsAcceptGroupAddResponseServerError").parseAcceptGroupAddResponseServerError(b,a);if(b.success)return{name:"AcceptGroupAddResponseServerError",value:b.value};throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(d("WASmaxRpcUtils").errorMessageRpcParsing("AcceptGroupAdd",{GroupJoinRequestSuccess:c,Success:e,ClientError:f,ServerError:b}))});return h.apply(this,arguments)}g.sendAcceptGroupAddRPC=a}),98); __d("WASmaxInGroupsIQErrorItemNotFoundOrBadRequestOrRateOverlimitOrFallbackClientMixinGroup",["WAResultOrError","WASmaxInGroupsIQErrorBadRequestMixin","WASmaxInGroupsIQErrorFallbackClientMixin","WASmaxInGroupsIQErrorItemNotFoundMixin","WASmaxInGroupsIQErrorRateOverlimitMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxInGroupsIQErrorItemNotFoundMixin").parseIQErrorItemNotFoundMixin(a);if(b.success)return d("WAResultOrError").makeResult({name:"IQErrorItemNotFound",value:b.value});var c=d("WASmaxInGroupsIQErrorBadRequestMixin").parseIQErrorBadRequestMixin(a);if(c.success)return d("WAResultOrError").makeResult({name:"IQErrorBadRequest",value:c.value});var e=d("WASmaxInGroupsIQErrorRateOverlimitMixin").parseIQErrorRateOverlimitMixin(a);if(e.success)return d("WAResultOrError").makeResult({name:"IQErrorRateOverlimit",value:e.value});var f=d("WASmaxInGroupsIQErrorFallbackClientMixin").parseIQErrorFallbackClientMixin(a);return f.success?d("WAResultOrError").makeResult({name:"IQErrorFallbackClient",value:f.value}):d("WASmaxParseUtils").errorMixinDisjunction(a,["IQErrorItemNotFound","IQErrorBadRequest","IQErrorRateOverlimit","IQErrorFallbackClient"],[b,c,e,f])}g.parseIQErrorItemNotFoundOrBadRequestOrRateOverlimitOrFallbackClientMixinGroup=a}),98); __d("WASmaxInGroupsAcknowledgeGroupResponseClientError",["WAResultOrError","WASmaxInGroupsIQErrorItemNotFoundOrBadRequestOrRateOverlimitOrFallbackClientMixinGroup","WASmaxInGroupsIQErrorResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"error");if(!c.success)return c;a=d("WASmaxInGroupsIQErrorResponseMixin").parseIQErrorResponseMixin(a,b);if(!a.success)return a;b=d("WASmaxInGroupsIQErrorItemNotFoundOrBadRequestOrRateOverlimitOrFallbackClientMixinGroup").parseIQErrorItemNotFoundOrBadRequestOrRateOverlimitOrFallbackClientMixinGroup(c.value);return!b.success?b:d("WAResultOrError").makeResult(babelHelpers["extends"]({},a.value,{errorIQErrorItemNotFoundOrBadRequestOrRateOverlimitOrFallbackClientMixinGroup:b.value}))}g.parseAcknowledgeGroupResponseClientError=a}),98); __d("WASmaxInGroupsAcknowledgeGroupResponseServerError",["WASmaxInGroupsBaseServerErrorMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxInGroupsBaseServerErrorMixin").parseBaseServerErrorMixin(a,b);return!c.success?c:c}g.parseAcknowledgeGroupResponseServerError=a}),98); __d("WASmaxInGroupsAcknowledgeGroupResponseSuccess",["WAResultOrError","WASmaxParseReference","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["to"]);if(!c.success)return c;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"from",c.value);if(!c.success)return c;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","result");if(!c.success)return c;b=d("WASmaxParseReference").attrStringFromReference(b,["id"]);if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"id",b.value);return!a.success?a:d("WAResultOrError").makeResult({type:c.value})}g.parseAcknowledgeGroupResponseSuccess=a}),98); __d("WASmaxOutGroupsAcknowledgeGroupRequest",["WASmaxJsx","WASmaxOutGroupsBaseSetGroupMixin"],(function(a,b,c,d,e,f,g){function a(a){a=d("WASmaxOutGroupsBaseSetGroupMixin").mergeBaseSetGroupMixin(d("WASmaxJsx").smax("iq",null,d("WASmaxJsx").smax("ack",null)),a);return a}g.makeAcknowledgeGroupRequest=a}),98); __d("WASmaxGroupsAcknowledgeGroupRPC",["WAComms","WASmaxInGroupsAcknowledgeGroupResponseClientError","WASmaxInGroupsAcknowledgeGroupResponseServerError","WASmaxInGroupsAcknowledgeGroupResponseSuccess","WASmaxOutGroupsAcknowledgeGroupRequest","WASmaxParsingFailure","WASmaxRpcUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=d("WASmaxOutGroupsAcknowledgeGroupRequest").makeAcknowledgeGroupRequest(a);b=(yield d("WAComms").sendSmaxStanza(a,b));var c=d("WASmaxInGroupsAcknowledgeGroupResponseSuccess").parseAcknowledgeGroupResponseSuccess(b,a);if(c.success)return{name:"AcknowledgeGroupResponseSuccess",value:c.value};var e=d("WASmaxInGroupsAcknowledgeGroupResponseClientError").parseAcknowledgeGroupResponseClientError(b,a);if(e.success)return{name:"AcknowledgeGroupResponseClientError",value:e.value};b=d("WASmaxInGroupsAcknowledgeGroupResponseServerError").parseAcknowledgeGroupResponseServerError(b,a);if(b.success)return{name:"AcknowledgeGroupResponseServerError",value:b.value};throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(d("WASmaxRpcUtils").errorMessageRpcParsing("AcknowledgeGroup",{Success:c,ClientError:e,ServerError:b}))});return h.apply(this,arguments)}g.sendAcknowledgeGroupRPC=a}),98); __d("WASmaxInGroupsGetGroupInfoClientErrors",["WAResultOrError","WASmaxInGroupsIQErrorBadRequestMixin","WASmaxInGroupsIQErrorFallbackClientMixin","WASmaxInGroupsIQErrorForbiddenMixin","WASmaxInGroupsIQErrorGoneMixin","WASmaxInGroupsIQErrorItemNotFoundMixin","WASmaxInGroupsIQErrorRateOverlimitMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxInGroupsIQErrorGoneMixin").parseIQErrorGoneMixin(a);if(b.success)return d("WAResultOrError").makeResult({name:"IQErrorGone",value:b.value});var c=d("WASmaxInGroupsIQErrorBadRequestMixin").parseIQErrorBadRequestMixin(a);if(c.success)return d("WAResultOrError").makeResult({name:"IQErrorBadRequest",value:c.value});var e=d("WASmaxInGroupsIQErrorForbiddenMixin").parseIQErrorForbiddenMixin(a);if(e.success)return d("WAResultOrError").makeResult({name:"IQErrorForbidden",value:e.value});var f=d("WASmaxInGroupsIQErrorItemNotFoundMixin").parseIQErrorItemNotFoundMixin(a);if(f.success)return d("WAResultOrError").makeResult({name:"IQErrorItemNotFound",value:f.value});var g=d("WASmaxInGroupsIQErrorRateOverlimitMixin").parseIQErrorRateOverlimitMixin(a);if(g.success)return d("WAResultOrError").makeResult({name:"IQErrorRateOverlimit",value:g.value});var h=d("WASmaxInGroupsIQErrorFallbackClientMixin").parseIQErrorFallbackClientMixin(a);return h.success?d("WAResultOrError").makeResult({name:"IQErrorFallbackClient",value:h.value}):d("WASmaxParseUtils").errorMixinDisjunction(a,["IQErrorGone","IQErrorBadRequest","IQErrorForbidden","IQErrorItemNotFound","IQErrorRateOverlimit","IQErrorFallbackClient"],[b,c,e,f,g,h])}g.parseGetGroupInfoClientErrors=a}),98); __d("WASmaxInGroupsGetGroupInfoResponseClientError",["WAResultOrError","WASmaxInGroupsGetGroupInfoClientErrors","WASmaxInGroupsIQErrorResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"error");if(!c.success)return c;a=d("WASmaxInGroupsIQErrorResponseMixin").parseIQErrorResponseMixin(a,b);if(!a.success)return a;b=d("WASmaxInGroupsGetGroupInfoClientErrors").parseGetGroupInfoClientErrors(c.value);return!b.success?b:d("WAResultOrError").makeResult(babelHelpers["extends"]({},a.value,{errorGetGroupInfoClientErrors:b.value}))}g.parseGetGroupInfoResponseClientError=a}),98); __d("WASmaxInGroupsGetGroupInfoResponseServerError",["WASmaxInGroupsBaseServerErrorMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxInGroupsBaseServerErrorMixin").parseBaseServerErrorMixin(a,b);return!c.success?c:c}g.parseGetGroupInfoResponseServerError=a}),98); __d("WASmaxInGroupsGetGroupInfoResponseSuccess",["WAResultOrError","WASmaxInGroupsDedupAttrsMixin","WASmaxInGroupsGroupInfoMixin","WASmaxParseReference","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function h(a){var b=d("WASmaxParseUtils").assertTag(a,"group");if(!b.success)return b;b=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrIntRange,a,"size",0,19999);if(!b.success)return b;var c=d("WASmaxInGroupsGroupInfoMixin").parseGroupInfoMixin(a);if(!c.success)return c;a=d("WASmaxInGroupsDedupAttrsMixin").parseDedupAttrsMixin(a);return d("WAResultOrError").makeResult(babelHelpers["extends"]({size:b.value},c.value,{dedupAttrsMixin:a.success?a.value:null}))}function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").optionalChildWithTag(a,"group",h);if(!c.success)return c;var e=d("WASmaxParseReference").attrStringFromReference(b,["to"]);if(!e.success)return e;e=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"from",e.value);if(!e.success)return e;e=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","result");if(!e.success)return e;b=d("WASmaxParseReference").attrStringFromReference(b,["id"]);if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"id",b.value);return!a.success?a:d("WAResultOrError").makeResult({type:e.value,group:c.value})}g.parseGetGroupInfoResponseSuccessGroup=h;g.parseGetGroupInfoResponseSuccess=a}),98); __d("WASmaxOutGroupsAddRequestMixin",["WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(a){a=a.addRequestAdmin;a=d("WASmaxJsx").smax("add_request",{admin:d("WAWap").USER_JID(a)});return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeAddRequestMixin=a}),98); __d("WASmaxOutGroupsCodeMixin",["WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(a){a=a.addRequestCode;a=d("WASmaxJsx").smax("add_request",{code:d("WAWap").CUSTOM_STRING(a)});return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeCodeMixin=a}),98); __d("WASmaxOutGroupsGetGroupInfoRequestTypeAttributeMixin",["WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(a){a=a.anyRequest;a=d("WASmaxJsx").smax("smax$any",{request:d("WAWap").CUSTOM_STRING(a)});return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeGetGroupInfoRequestTypeAttributeMixin=a}),98); __d("WASmaxOutGroupsGetGroupInfoRequestTypeMixin",["WASmaxJsx","WASmaxMixins","WASmaxOutGroupsGetGroupInfoRequestTypeAttributeMixin"],(function(a,b,c,d,e,f,g){function h(a){a=d("WASmaxOutGroupsGetGroupInfoRequestTypeAttributeMixin").mergeGetGroupInfoRequestTypeAttributeMixin(d("WASmaxJsx").smax("query",null),a);return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeGetGroupInfoRequestTypeMixin=a}),98); __d("WASmaxOutGroupsGetGroupInfoRequest",["WASmaxAttrs","WASmaxChildren","WASmaxJsx","WASmaxMixins","WASmaxOutGroupsAddRequestMixin","WASmaxOutGroupsBaseGetGroupMixin","WASmaxOutGroupsCodeMixin","WASmaxOutGroupsGetGroupInfoRequestTypeMixin","WAWap"],(function(a,b,c,d,e,f,g){function h(a){var b=a.addRequestExpiration;b=d("WASmaxOutGroupsCodeMixin").mergeCodeMixin(d("WASmaxOutGroupsAddRequestMixin").mergeAddRequestMixin(d("WASmaxJsx").smax("add_request",{expiration:d("WAWap").INT(b)}),a),a);return b}function a(a){var b=a.addRequestArgs,c=a.queryPhash,e=a.getGroupInfoRequestTypeMixinArgs;c=d("WASmaxOutGroupsBaseGetGroupMixin").mergeBaseGetGroupMixin(d("WASmaxJsx").smax("iq",null,d("WASmaxMixins").optionalMerge(d("WASmaxOutGroupsGetGroupInfoRequestTypeMixin").mergeGetGroupInfoRequestTypeMixin,d("WASmaxJsx").smax("query",{phash:d("WASmaxAttrs").OPTIONAL(d("WAWap").CUSTOM_STRING,c)},d("WASmaxChildren").OPTIONAL_CHILD(h,b)),e)),a);return c}g.makeGetGroupInfoRequestQueryAddRequest=h;g.makeGetGroupInfoRequest=a}),98); __d("WASmaxGroupsGetGroupInfoRPC",["WAComms","WASmaxInGroupsGetGroupInfoResponseClientError","WASmaxInGroupsGetGroupInfoResponseServerError","WASmaxInGroupsGetGroupInfoResponseSuccess","WASmaxOutGroupsGetGroupInfoRequest","WASmaxParsingFailure","WASmaxRpcUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=d("WASmaxOutGroupsGetGroupInfoRequest").makeGetGroupInfoRequest(a);b=(yield d("WAComms").sendSmaxStanza(a,b));var c=d("WASmaxInGroupsGetGroupInfoResponseSuccess").parseGetGroupInfoResponseSuccess(b,a);if(c.success)return{name:"GetGroupInfoResponseSuccess",value:c.value};var e=d("WASmaxInGroupsGetGroupInfoResponseClientError").parseGetGroupInfoResponseClientError(b,a);if(e.success)return{name:"GetGroupInfoResponseClientError",value:e.value};b=d("WASmaxInGroupsGetGroupInfoResponseServerError").parseGetGroupInfoResponseServerError(b,a);if(b.success)return{name:"GetGroupInfoResponseServerError",value:b.value};throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(d("WASmaxRpcUtils").errorMessageRpcParsing("GetGroupInfo",{Success:c,ClientError:e,ServerError:b}))});return h.apply(this,arguments)}g.sendGetGroupInfoRPC=a}),98); __d("WASmaxInGroupsGetGroupProfilePictureClientErrors",["WAResultOrError","WASmaxInGroupsIQErrorBadRequestMixin","WASmaxInGroupsIQErrorFallbackClientMixin","WASmaxInGroupsIQErrorForbiddenMixin","WASmaxInGroupsIQErrorItemNotFoundMixin","WASmaxInGroupsIQErrorNotAllowedMixin","WASmaxInGroupsIQErrorRateOverlimitMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxInGroupsIQErrorItemNotFoundMixin").parseIQErrorItemNotFoundMixin(a);if(b.success)return d("WAResultOrError").makeResult({name:"IQErrorItemNotFound",value:b.value});var c=d("WASmaxInGroupsIQErrorForbiddenMixin").parseIQErrorForbiddenMixin(a);if(c.success)return d("WAResultOrError").makeResult({name:"IQErrorForbidden",value:c.value});var e=d("WASmaxInGroupsIQErrorNotAllowedMixin").parseIQErrorNotAllowedMixin(a);if(e.success)return d("WAResultOrError").makeResult({name:"IQErrorNotAllowed",value:e.value});var f=d("WASmaxInGroupsIQErrorBadRequestMixin").parseIQErrorBadRequestMixin(a);if(f.success)return d("WAResultOrError").makeResult({name:"IQErrorBadRequest",value:f.value});var g=d("WASmaxInGroupsIQErrorRateOverlimitMixin").parseIQErrorRateOverlimitMixin(a);if(g.success)return d("WAResultOrError").makeResult({name:"IQErrorRateOverlimit",value:g.value});var h=d("WASmaxInGroupsIQErrorFallbackClientMixin").parseIQErrorFallbackClientMixin(a);return h.success?d("WAResultOrError").makeResult({name:"IQErrorFallbackClient",value:h.value}):d("WASmaxParseUtils").errorMixinDisjunction(a,["IQErrorItemNotFound","IQErrorForbidden","IQErrorNotAllowed","IQErrorBadRequest","IQErrorRateOverlimit","IQErrorFallbackClient"],[b,c,e,f,g,h])}g.parseGetGroupProfilePictureClientErrors=a}),98); __d("WASmaxInGroupsGetGroupProfilePicturesResponseClientError",["WAResultOrError","WASmaxInGroupsGetGroupProfilePictureClientErrors","WASmaxInGroupsIQErrorResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"error");if(!c.success)return c;a=d("WASmaxInGroupsIQErrorResponseMixin").parseIQErrorResponseMixin(a,b);if(!a.success)return a;b=d("WASmaxInGroupsGetGroupProfilePictureClientErrors").parseGetGroupProfilePictureClientErrors(c.value);return!b.success?b:d("WAResultOrError").makeResult(babelHelpers["extends"]({},a.value,{errorGetGroupProfilePictureClientErrors:b.value}))}g.parseGetGroupProfilePicturesResponseClientError=a}),98); __d("WASmaxInGroupsGetGroupProfilePicturesResponseServerError",["WASmaxInGroupsBaseServerErrorMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxInGroupsBaseServerErrorMixin").parseBaseServerErrorMixin(a,b);return!c.success?c:c}g.parseGetGroupProfilePicturesResponseServerError=a}),98); __d("WASmaxInGroupsBadLinkedGroupProfilePictureErrorMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"picture");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"status","405");return!b.success?b:d("WAResultOrError").makeResult({status:b.value})}g.parseBadLinkedGroupProfilePictureErrorMixin=a}),98); __d("WASmaxInGroupsBadServerProfilePictureErrorMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"picture");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"status","500");return!b.success?b:d("WAResultOrError").makeResult({status:b.value})}g.parseBadServerProfilePictureErrorMixin=a}),98); __d("WASmaxInGroupsPictureDidNotChangeMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"picture");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"status","304");return!b.success?b:d("WAResultOrError").makeResult({status:b.value})}g.parsePictureDidNotChangeMixin=a}),98); __d("WASmaxInGroupsPictureNotFoundMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"picture");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"status","204");return!b.success?b:d("WAResultOrError").makeResult({status:b.value})}g.parsePictureNotFoundMixin=a}),98); __d("WASmaxInGroupsPictureDidNotChangeOrPictureNotFoundOrBadServerProfilePictureErrorOrBadLinkedGroupProfilePictureErrorMixinGroup",["WAResultOrError","WASmaxInGroupsBadLinkedGroupProfilePictureErrorMixin","WASmaxInGroupsBadServerProfilePictureErrorMixin","WASmaxInGroupsPictureDidNotChangeMixin","WASmaxInGroupsPictureNotFoundMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxInGroupsPictureDidNotChangeMixin").parsePictureDidNotChangeMixin(a);if(b.success)return d("WAResultOrError").makeResult({name:"PictureDidNotChange",value:b.value});var c=d("WASmaxInGroupsPictureNotFoundMixin").parsePictureNotFoundMixin(a);if(c.success)return d("WAResultOrError").makeResult({name:"PictureNotFound",value:c.value});var e=d("WASmaxInGroupsBadServerProfilePictureErrorMixin").parseBadServerProfilePictureErrorMixin(a);if(e.success)return d("WAResultOrError").makeResult({name:"BadServerProfilePictureError",value:e.value});var f=d("WASmaxInGroupsBadLinkedGroupProfilePictureErrorMixin").parseBadLinkedGroupProfilePictureErrorMixin(a);return f.success?d("WAResultOrError").makeResult({name:"BadLinkedGroupProfilePictureError",value:f.value}):d("WASmaxParseUtils").errorMixinDisjunction(a,["PictureDidNotChange","PictureNotFound","BadServerProfilePictureError","BadLinkedGroupProfilePictureError"],[b,c,e,f])}g.parsePictureDidNotChangeOrPictureNotFoundOrBadServerProfilePictureErrorOrBadLinkedGroupProfilePictureErrorMixinGroup=a}),98); __d("WASmaxInGroupsGetGroupProfilePicturesPartialProfilePictureResponseMixin",["WAResultOrError","WASmaxInGroupsPictureDidNotChangeOrPictureNotFoundOrBadServerProfilePictureErrorOrBadLinkedGroupProfilePictureErrorMixinGroup","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"picture");if(!b.success)return b;b=d("WASmaxInGroupsPictureDidNotChangeOrPictureNotFoundOrBadServerProfilePictureErrorOrBadLinkedGroupProfilePictureErrorMixinGroup").parsePictureDidNotChangeOrPictureNotFoundOrBadServerProfilePictureErrorOrBadLinkedGroupProfilePictureErrorMixinGroup(a);return d("WAResultOrError").makeResult({pictureDidNotChangeOrPictureNotFoundOrBadServerProfilePictureErrorOrBadLinkedGroupProfilePictureErrorMixinGroup:b.success?b.value:null})}g.parseGetGroupProfilePicturesPartialProfilePictureResponseMixin=a}),98); __d("WASmaxInGroupsProfilePictureIdMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"picture");if(!b.success)return b;b=d("WASmaxParseUtils").attrString(a,"id");return!b.success?b:d("WAResultOrError").makeResult({id:b.value})}g.parseProfilePictureIdMixin=a}),98); __d("WASmaxInGroupsProfilePictureTypeMixin",["WAResultOrError","WASmaxInGroupsEnums","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"picture");if(!b.success)return b;b=d("WASmaxParseUtils").attrStringEnum(a,"type",d("WASmaxInGroupsEnums").ENUM_IMAGE_PREVIEW);return!b.success?b:d("WAResultOrError").makeResult({type:b.value})}g.parseProfilePictureTypeMixin=a}),98); __d("WASmaxInGroupsProfilePictureBlobResponseMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"picture");if(!b.success)return b;b=d("WASmaxParseUtils").contentBytesRange(a,1,void 0);return!b.success?b:d("WAResultOrError").makeResult({elementValue:b.value})}g.parseProfilePictureBlobResponseMixin=a}),98); __d("WASmaxInGroupsProfilePictureUrlResponseMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"picture");if(!b.success)return b;b=d("WASmaxParseUtils").attrString(a,"url");if(!b.success)return b;a=d("WASmaxParseUtils").attrString(a,"direct_path");return!a.success?a:d("WAResultOrError").makeResult({url:b.value,directPath:a.value})}g.parseProfilePictureUrlResponseMixin=a}),98); __d("WASmaxInGroupsProfilePictureUrlOrBlobResponseMixinGroup",["WAResultOrError","WASmaxInGroupsProfilePictureBlobResponseMixin","WASmaxInGroupsProfilePictureUrlResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxInGroupsProfilePictureUrlResponseMixin").parseProfilePictureUrlResponseMixin(a);if(b.success)return d("WAResultOrError").makeResult({name:"ProfilePictureUrlResponse",value:b.value});var c=d("WASmaxInGroupsProfilePictureBlobResponseMixin").parseProfilePictureBlobResponseMixin(a);return c.success?d("WAResultOrError").makeResult({name:"ProfilePictureBlobResponse",value:c.value}):d("WASmaxParseUtils").errorMixinDisjunction(a,["ProfilePictureUrlResponse","ProfilePictureBlobResponse"],[b,c])}g.parseProfilePictureUrlOrBlobResponseMixinGroup=a}),98); __d("WASmaxInGroupsGetGroupProfilePicturesSuccessProfilePictureResponseMixin",["WAResultOrError","WASmaxInGroupsProfilePictureIdMixin","WASmaxInGroupsProfilePictureTypeMixin","WASmaxInGroupsProfilePictureUrlOrBlobResponseMixinGroup","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"picture");if(!b.success)return b;b=d("WASmaxInGroupsProfilePictureIdMixin").parseProfilePictureIdMixin(a);if(!b.success)return b;var c=d("WASmaxInGroupsProfilePictureTypeMixin").parseProfilePictureTypeMixin(a);if(!c.success)return c;a=d("WASmaxInGroupsProfilePictureUrlOrBlobResponseMixinGroup").parseProfilePictureUrlOrBlobResponseMixinGroup(a);return d("WAResultOrError").makeResult(babelHelpers["extends"]({},b.value,c.value,{profilePictureUrlOrBlobResponseMixinGroup:a.success?a.value:null}))}g.parseGetGroupProfilePicturesSuccessProfilePictureResponseMixin=a}),98); __d("WASmaxInGroupsGetGroupProfilePicturesSuccessOrGetGroupProfilePicturesPartialProfilePictureResponseMixinGroup",["WAResultOrError","WASmaxInGroupsGetGroupProfilePicturesPartialProfilePictureResponseMixin","WASmaxInGroupsGetGroupProfilePicturesSuccessProfilePictureResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxInGroupsGetGroupProfilePicturesSuccessProfilePictureResponseMixin").parseGetGroupProfilePicturesSuccessProfilePictureResponseMixin(a);if(b.success)return d("WAResultOrError").makeResult({name:"GetGroupProfilePicturesSuccessProfilePictureResponse",value:b.value});var c=d("WASmaxInGroupsGetGroupProfilePicturesPartialProfilePictureResponseMixin").parseGetGroupProfilePicturesPartialProfilePictureResponseMixin(a);return c.success?d("WAResultOrError").makeResult({name:"GetGroupProfilePicturesPartialProfilePictureResponse",value:c.value}):d("WASmaxParseUtils").errorMixinDisjunction(a,["SuccessProfilePictureResponse","PartialProfilePictureResponse"],[b,c])}g.parseGetGroupProfilePicturesSuccessOrGetGroupProfilePicturesPartialProfilePictureResponseMixinGroup=a}),98); __d("WASmaxInGroupsSubGroupMixin",["WAResultOrError","WASmaxParseJid"],(function(a,b,c,d,e,f,g){function a(a){a=d("WASmaxParseJid").attrGroupJid(a,"sub_group_jid");return!a.success?a:d("WAResultOrError").makeResult({subGroupJid:a.value})}g.parseSubGroupMixin=a}),98); __d("WASmaxInGroupsParentOrSubGroupMixinGroup",["WAResultOrError","WASmaxInGroupsParentGroupMixin","WASmaxInGroupsSubGroupMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxInGroupsParentGroupMixin").parseParentGroupMixin(a);if(b.success)return d("WAResultOrError").makeResult({name:"ParentGroup",value:b.value});var c=d("WASmaxInGroupsSubGroupMixin").parseSubGroupMixin(a);return c.success?d("WAResultOrError").makeResult({name:"SubGroup",value:c.value}):d("WASmaxParseUtils").errorMixinDisjunction(a,["ParentGroup","SubGroup"],[b,c])}g.parseParentOrSubGroupMixinGroup=a}),98); __d("WASmaxInGroupsGetGroupProfilePicturesProfilePicturesResponseMixin",["WAResultOrError","WASmaxInGroupsGetGroupProfilePicturesSuccessOrGetGroupProfilePicturesPartialProfilePictureResponseMixinGroup","WASmaxInGroupsParentOrSubGroupMixinGroup","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function h(a){var b=d("WASmaxParseUtils").assertTag(a,"picture");if(!b.success)return b;b=d("WASmaxInGroupsParentOrSubGroupMixinGroup").parseParentOrSubGroupMixinGroup(a);if(!b.success)return b;a=d("WASmaxInGroupsGetGroupProfilePicturesSuccessOrGetGroupProfilePicturesPartialProfilePictureResponseMixinGroup").parseGetGroupProfilePicturesSuccessOrGetGroupProfilePicturesPartialProfilePictureResponseMixinGroup(a);return!a.success?a:d("WAResultOrError").makeResult({parentOrSubGroupMixinGroup:b.value,getGroupProfilePicturesSuccessOrGetGroupProfilePicturesPartialProfilePictureResponseMixinGroup:a.value})}function a(a){a=d("WASmaxParseUtils").flattenedChildWithTag(a,"pictures");if(!a.success)return a;a=d("WASmaxParseUtils").mapChildrenWithTag(a.value,"picture",1,1e3,h);return!a.success?a:d("WAResultOrError").makeResult({picturesPicture:a.value})}g.parseGetGroupProfilePicturesProfilePicturesResponsePicturesPicture=h;g.parseGetGroupProfilePicturesProfilePicturesResponseMixin=a}),98); __d("WASmaxInGroupsGetGroupProfilePicturesResponseSuccessGroupPictures",["WAResultOrError","WASmaxInGroupsGetGroupProfilePicturesProfilePicturesResponseMixin","WASmaxInGroupsIQResultResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxInGroupsIQResultResponseMixin").parseIQResultResponseMixin(a,b);if(!c.success)return c;b=d("WASmaxInGroupsGetGroupProfilePicturesProfilePicturesResponseMixin").parseGetGroupProfilePicturesProfilePicturesResponseMixin(a);return!b.success?b:d("WAResultOrError").makeResult(babelHelpers["extends"]({},c.value,b.value))}g.parseGetGroupProfilePicturesResponseSuccessGroupPictures=a}),98); __d("WASmaxOutGroupsBaseGetGroupOrServerMixinGroup",["WASmaxMixinGroupExhaustiveError","WASmaxOutGroupsBaseGetGroupMixin","WASmaxOutGroupsBaseGetServerMixin"],(function(a,b,c,d,e,f,g){function a(a,b){if(b.baseGetGroup)return d("WASmaxOutGroupsBaseGetGroupMixin").mergeBaseGetGroupMixin(a,b.baseGetGroup);if(b.isBaseGetServer)return d("WASmaxOutGroupsBaseGetServerMixin").mergeBaseGetServerMixin(a);throw new(d("WASmaxMixinGroupExhaustiveError").SmaxMixinGroupExhaustiveError)()}g.mergeBaseGetGroupOrServerMixinGroup=a}),98); __d("WASmaxOutGroupsSubGroupMixin",["WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(a){a=a.anySubGroupJid;a=d("WASmaxJsx").smax("smax$any",{sub_group_jid:d("WAWap").GROUP_JID(a)});return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeSubGroupMixin=a}),98); __d("WASmaxOutGroupsParentOrSubGroupMixinGroup",["WASmaxMixinGroupExhaustiveError","WASmaxOutGroupsParentGroupMixin","WASmaxOutGroupsSubGroupMixin"],(function(a,b,c,d,e,f,g){function a(a,b){if(b.parentGroup)return d("WASmaxOutGroupsParentGroupMixin").mergeParentGroupMixin(a,b.parentGroup);if(b.subGroup)return d("WASmaxOutGroupsSubGroupMixin").mergeSubGroupMixin(a,b.subGroup);throw new(d("WASmaxMixinGroupExhaustiveError").SmaxMixinGroupExhaustiveError)()}g.mergeParentOrSubGroupMixinGroup=a}),98); __d("WASmaxOutGroupsProfilePictureIdMixin",["WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(a){a=a.pictureId;a=d("WASmaxJsx").smax("picture",{id:d("WAWap").CUSTOM_STRING(a)});return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeProfilePictureIdMixin=a}),98); __d("WASmaxOutGroupsProfilePictureQueryMixin",["WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(a){a=a.pictureQuery;a=d("WASmaxJsx").smax("picture",{query:d("WAWap").CUSTOM_STRING(a)});return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeProfilePictureQueryMixin=a}),98); __d("WASmaxOutGroupsProfilePictureTypeMixin",["WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(a){a=a.pictureType;a=d("WASmaxJsx").smax("picture",{type:d("WAWap").CUSTOM_STRING(a)});return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeProfilePictureTypeMixin=a}),98); __d("WASmaxOutGroupsSubGroupHintMixin",["WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(a){a=a.anyLinkedGroupsMembershipHint;a=d("WASmaxJsx").smax("smax$any",{linked_groups_membership_hint:d("WAWap").GROUP_JID(a)});return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeSubGroupHintMixin=a}),98); __d("WASmaxOutGroupsGetGroupProfilePicturesProfilePicturesRequestMixin",["WASmaxChildren","WASmaxJsx","WASmaxMixins","WASmaxOutGroupsParentOrSubGroupMixinGroup","WASmaxOutGroupsProfilePictureIdMixin","WASmaxOutGroupsProfilePictureQueryMixin","WASmaxOutGroupsProfilePictureTypeMixin","WASmaxOutGroupsSubGroupHintMixin"],(function(a,b,c,d,e,f,g){function h(a){var b=a.profilePictureIdMixinArgs,c=a.profilePictureTypeMixinArgs,e=a.profilePictureQueryMixinArgs;a=a.parentOrSubGroupMixinGroupArgs;b=d("WASmaxOutGroupsParentOrSubGroupMixinGroup").mergeParentOrSubGroupMixinGroup(d("WASmaxMixins").optionalMerge(d("WASmaxOutGroupsProfilePictureQueryMixin").mergeProfilePictureQueryMixin,d("WASmaxMixins").optionalMerge(d("WASmaxOutGroupsProfilePictureTypeMixin").mergeProfilePictureTypeMixin,d("WASmaxMixins").optionalMerge(d("WASmaxOutGroupsProfilePictureIdMixin").mergeProfilePictureIdMixin,d("WASmaxJsx").smax("picture",null),b),c),e),a);return b}function i(a){var b=a.pictureArgs;a=a.subGroupHintMixinArgs;b=d("WASmaxJsx").smax("smax$any",null,d("WASmaxMixins").optionalMerge(d("WASmaxOutGroupsSubGroupHintMixin").mergeSubGroupHintMixin,d("WASmaxJsx").smax("pictures",null,d("WASmaxChildren").REPEATED_CHILD(h,b,1,1e3)),a));return b}function a(a,b){b=i(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.makeGetGroupProfilePicturesProfilePicturesRequestPicturesPicture=h;g.mergeGetGroupProfilePicturesProfilePicturesRequestMixin=a}),98); __d("WASmaxOutGroupsGetGroupProfilePicturesRequest",["WASmaxJsx","WASmaxOutGroupsBaseGetGroupOrServerMixinGroup","WASmaxOutGroupsGetGroupProfilePicturesProfilePicturesRequestMixin"],(function(a,b,c,d,e,f,g){function a(a){var b=a.baseGetGroupOrServerMixinGroupArgs;a=d("WASmaxOutGroupsBaseGetGroupOrServerMixinGroup").mergeBaseGetGroupOrServerMixinGroup(d("WASmaxOutGroupsGetGroupProfilePicturesProfilePicturesRequestMixin").mergeGetGroupProfilePicturesProfilePicturesRequestMixin(d("WASmaxJsx").smax("iq",null),a),b);return a}g.makeGetGroupProfilePicturesRequest=a}),98); __d("WASmaxGroupsGetGroupProfilePicturesRPC",["WAComms","WASmaxInGroupsGetGroupProfilePicturesResponseClientError","WASmaxInGroupsGetGroupProfilePicturesResponseServerError","WASmaxInGroupsGetGroupProfilePicturesResponseSuccessGroupPictures","WASmaxOutGroupsGetGroupProfilePicturesRequest","WASmaxParsingFailure","WASmaxRpcUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=d("WASmaxOutGroupsGetGroupProfilePicturesRequest").makeGetGroupProfilePicturesRequest(a);b=(yield d("WAComms").sendSmaxStanza(a,b));var c=d("WASmaxInGroupsGetGroupProfilePicturesResponseSuccessGroupPictures").parseGetGroupProfilePicturesResponseSuccessGroupPictures(b,a);if(c.success)return{name:"GetGroupProfilePicturesResponseSuccessGroupPictures",value:c.value};var e=d("WASmaxInGroupsGetGroupProfilePicturesResponseClientError").parseGetGroupProfilePicturesResponseClientError(b,a);if(e.success)return{name:"GetGroupProfilePicturesResponseClientError",value:e.value};b=d("WASmaxInGroupsGetGroupProfilePicturesResponseServerError").parseGetGroupProfilePicturesResponseServerError(b,a);if(b.success)return{name:"GetGroupProfilePicturesResponseServerError",value:b.value};throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(d("WASmaxRpcUtils").errorMessageRpcParsing("GetGroupProfilePictures",{SuccessGroupPictures:c,ClientError:e,ServerError:b}))});return h.apply(this,arguments)}g.sendGetGroupProfilePicturesRPC=a}),98); __d("WASmaxInMdIQErrorBadRequestMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","bad-request");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",400);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorBadRequestMixin=a}),98); __d("WASmaxInMdIQErrorInternalServerErrorMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","internal-server-error");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",500);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorInternalServerErrorMixin=a}),98); __d("WASmaxInMdCompanionFinishErrors",["WAResultOrError","WASmaxInMdIQErrorBadRequestMixin","WASmaxInMdIQErrorInternalServerErrorMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxInMdIQErrorInternalServerErrorMixin").parseIQErrorInternalServerErrorMixin(a);if(b.success)return d("WAResultOrError").makeResult({name:"IQErrorInternalServerError",value:b.value});var c=d("WASmaxInMdIQErrorBadRequestMixin").parseIQErrorBadRequestMixin(a);return c.success?d("WAResultOrError").makeResult({name:"IQErrorBadRequest",value:c.value}):d("WASmaxParseUtils").errorMixinDisjunction(a,["IQErrorInternalServerError","IQErrorBadRequest"],[b,c])}g.parseCompanionFinishErrors=a}),98); __d("WASmaxInMdIQErrorResponseMixin",["WAResultOrError","WASmaxParseReference","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["id"]);if(!c.success)return c;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"id",c.value);if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["to"]);if(!c.success)return c;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"from",c.value);if(!b.success)return b;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","error");return!c.success?c:d("WAResultOrError").makeResult({type:c.value})}g.parseIQErrorResponseMixin=a}),98); __d("WASmaxInMdCompanionFinishResponseError",["WAResultOrError","WASmaxInMdCompanionFinishErrors","WASmaxInMdIQErrorResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"error");if(!c.success)return c;a=d("WASmaxInMdIQErrorResponseMixin").parseIQErrorResponseMixin(a,b);if(!a.success)return a;b=d("WASmaxInMdCompanionFinishErrors").parseCompanionFinishErrors(c.value);return!b.success?b:d("WAResultOrError").makeResult(babelHelpers["extends"]({},a.value,{errorCompanionFinishErrors:b.value}))}g.parseCompanionFinishResponseError=a}),98); __d("WASmaxInMdIQResultResponseMixin",["WAResultOrError","WASmaxParseReference","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["id"]);if(!c.success)return c;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"id",c.value);if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["to"]);if(!c.success)return c;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"from",c.value);if(!b.success)return b;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","result");return!c.success?c:d("WAResultOrError").makeResult({type:c.value})}g.parseIQResultResponseMixin=a}),98); __d("WASmaxInMdCompanionFinishResponseSuccess",["WASmaxInMdIQResultResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxInMdIQResultResponseMixin").parseIQResultResponseMixin(a,b);return!c.success?c:c}g.parseCompanionFinishResponseSuccess=a}),98); __d("WASmaxInMdIQErrorFeatureNotAvailableMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","feature-not-available");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",452);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorFeatureNotAvailableMixin=a}),98); __d("WASmaxInMdIQErrorForbiddenMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","forbidden");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",403);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorForbiddenMixin=a}),98); __d("WASmaxInMdIQErrorRateOverlimitMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","rate-overlimit");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",429);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorRateOverlimitMixin=a}),98); __d("WASmaxInMdIqMixinErrors",["WAResultOrError","WASmaxInMdIQErrorBadRequestMixin","WASmaxInMdIQErrorFeatureNotAvailableMixin","WASmaxInMdIQErrorForbiddenMixin","WASmaxInMdIQErrorInternalServerErrorMixin","WASmaxInMdIQErrorRateOverlimitMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxInMdIQErrorInternalServerErrorMixin").parseIQErrorInternalServerErrorMixin(a);if(b.success)return d("WAResultOrError").makeResult({name:"IQErrorInternalServerError",value:b.value});var c=d("WASmaxInMdIQErrorBadRequestMixin").parseIQErrorBadRequestMixin(a);if(c.success)return d("WAResultOrError").makeResult({name:"IQErrorBadRequest",value:c.value});var e=d("WASmaxInMdIQErrorFeatureNotAvailableMixin").parseIQErrorFeatureNotAvailableMixin(a);if(e.success)return d("WAResultOrError").makeResult({name:"IQErrorFeatureNotAvailable",value:e.value});var f=d("WASmaxInMdIQErrorRateOverlimitMixin").parseIQErrorRateOverlimitMixin(a);if(f.success)return d("WAResultOrError").makeResult({name:"IQErrorRateOverlimit",value:f.value});var g=d("WASmaxInMdIQErrorForbiddenMixin").parseIQErrorForbiddenMixin(a);return g.success?d("WAResultOrError").makeResult({name:"IQErrorForbidden",value:g.value}):d("WASmaxParseUtils").errorMixinDisjunction(a,["IQErrorInternalServerError","IQErrorBadRequest","IQErrorFeatureNotAvailable","IQErrorRateOverlimit","IQErrorForbidden"],[b,c,e,f,g])}g.parseIqMixinErrors=a}),98); __d("WASmaxInMdCompanionHelloResponseError",["WAResultOrError","WASmaxInMdIQErrorResponseMixin","WASmaxInMdIqMixinErrors","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"error");if(!c.success)return c;a=d("WASmaxInMdIQErrorResponseMixin").parseIQErrorResponseMixin(a,b);if(!a.success)return a;b=d("WASmaxInMdIqMixinErrors").parseIqMixinErrors(c.value);return!b.success?b:d("WAResultOrError").makeResult(babelHelpers["extends"]({},a.value,{errorIqMixinErrors:b.value}))}g.parseCompanionHelloResponseError=a}),98); __d("WASmaxInMdCompanionHelloResponseNotifyCompanion",["WAResultOrError","WASmaxInMdIQResultResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"link_code_companion_reg");if(!c.success)return c;var e=d("WASmaxParseUtils").flattenedChildWithTag(c.value,"link_code_pairing_ref");if(!e.success)return e;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,c.value,"stage","companion_hello");if(!c.success)return c;e=d("WASmaxParseUtils").contentBytes(e.value);if(!e.success)return e;a=d("WASmaxInMdIQResultResponseMixin").parseIQResultResponseMixin(a,b);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({linkCodeCompanionRegStage:c.value,linkCodeCompanionRegLinkCodePairingRefElementValue:e.value},a.value))}g.parseCompanionHelloResponseNotifyCompanion=a}),98); __d("WASmaxInMdServerNotificationMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"notification");if(!b.success)return b;b=d("WASmaxParseUtils").attrIntRange(a,"t",0,void 0);if(!b.success)return b;var c=d("WASmaxParseUtils").attrStanzaId(a,"id");if(!c.success)return c;a=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrIntRange,a,"offline",0,1024);return!a.success?a:d("WAResultOrError").makeResult({t:b.value,id:c.value,offline:a.value})}g.parseServerNotificationMixin=a}),98); __d("WASmaxInMdPrimaryHelloNotifyCompanionRequest",["WAResultOrError","WASmaxInMdServerNotificationMixin","WASmaxParseJid","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"notification");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"link_code_companion_reg");if(!b.success)return b;var c=d("WASmaxParseUtils").flattenedChildWithTag(b.value,"link_code_pairing_wrapped_primary_ephemeral_pub");if(!c.success)return c;var e=d("WASmaxParseUtils").flattenedChildWithTag(b.value,"primary_identity_pub");if(!e.success)return e;var f=d("WASmaxParseUtils").flattenedChildWithTag(b.value,"link_code_pairing_ref");if(!f.success)return f;var g=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","link_code_companion_reg");if(!g.success)return g;var h=d("WASmaxParseJid").literalJid(d("WASmaxParseJid").attrDomainJid,a,"from","s.whatsapp.net");if(!h.success)return h;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,b.value,"stage","primary_hello");if(!b.success)return b;c=d("WASmaxParseUtils").contentBytes(c.value);if(!c.success)return c;e=d("WASmaxParseUtils").contentBytes(e.value);if(!e.success)return e;f=d("WASmaxParseUtils").contentBytes(f.value);if(!f.success)return f;a=d("WASmaxInMdServerNotificationMixin").parseServerNotificationMixin(a);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({type:g.value,from:h.value,linkCodeCompanionRegStage:b.value,linkCodeCompanionRegLinkCodePairingWrappedPrimaryEphemeralPubElementValue:c.value,linkCodeCompanionRegPrimaryIdentityPubElementValue:e.value,linkCodeCompanionRegLinkCodePairingRefElementValue:f.value},a.value))}g.parsePrimaryHelloNotifyCompanionRequest=a}),98); __d("WASmaxInMdRefreshCodeNotifyCompanionRequest",["WAResultOrError","WASmaxInMdEnums","WASmaxInMdServerNotificationMixin","WASmaxParseJid","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"notification");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"link_code_companion_reg");if(!b.success)return b;var c=d("WASmaxParseUtils").flattenedChildWithTag(b.value,"link_code_pairing_ref");if(!c.success)return c;var e=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","link_code_companion_reg");if(!e.success)return e;var f=d("WASmaxParseJid").literalJid(d("WASmaxParseJid").attrDomainJid,a,"from","s.whatsapp.net");if(!f.success)return f;var g=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,b.value,"stage","refresh_code");if(!g.success)return g;b=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrStringEnum,b.value,"force_manual_refresh",d("WASmaxInMdEnums").ENUM_FALSE_TRUE);if(!b.success)return b;c=d("WASmaxParseUtils").contentBytes(c.value);if(!c.success)return c;a=d("WASmaxInMdServerNotificationMixin").parseServerNotificationMixin(a);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({type:e.value,from:f.value,linkCodeCompanionRegStage:g.value,linkCodeCompanionRegForceManualRefresh:b.value,linkCodeCompanionRegLinkCodePairingRefElementValue:c.value},a.value))}g.parseRefreshCodeNotifyCompanionRequest=a}),98); __d("WASmaxInMessagePublishNewsletterResponseNegative",["WASmaxInMessagePublishNegativeAckMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"ack");if(!c.success)return c;c=d("WASmaxInMessagePublishNegativeAckMixin").parseNegativeAckMixin(a,b);return!c.success?c:c}g.parseNewsletterResponseNegative=a}),98); __d("WASmaxInMessagePublishNewsletterResponseSuccess",["WAResultOrError","WASmaxInMessagePublishAckMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"ack");if(!c.success)return c;c=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrIntRange,a,"server_id",99,2147476647);if(!c.success)return c;a=d("WASmaxInMessagePublishAckMixin").parseAckMixin(a,b);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({serverId:c.value},a.value))}g.parseNewsletterResponseSuccess=a}),98); __d("WASmaxInNewslettersAdminEditMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"message");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"edit","3");return!b.success?b:d("WAResultOrError").makeResult({edit:b.value})}g.parseAdminEditMixin=a}),98); __d("WASmaxInNewslettersAdminRevokeMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"message");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"edit","8");return!b.success?b:d("WAResultOrError").makeResult({edit:b.value})}g.parseAdminRevokeMixin=a}),98); __d("WASmaxInNewslettersIQErrorBadRequestMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","bad-request");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",400);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorBadRequestMixin=a}),98); __d("WASmaxInNewslettersIQErrorResponseMixin",["WAResultOrError","WASmaxParseReference","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["id"]);if(!c.success)return c;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"id",c.value);if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["to"]);if(!c.success)return c;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"from",c.value);if(!b.success)return b;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","error");return!c.success?c:d("WAResultOrError").makeResult({type:c.value})}g.parseIQErrorResponseMixin=a}),98); __d("WASmaxInNewslettersBadRequestIQErrorResponseMixin",["WAResultOrError","WASmaxInNewslettersIQErrorBadRequestMixin","WASmaxInNewslettersIQErrorResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"error");if(!c.success)return c;c=d("WASmaxInNewslettersIQErrorBadRequestMixin").parseIQErrorBadRequestMixin(c.value);if(!c.success)return c;a=d("WASmaxInNewslettersIQErrorResponseMixin").parseIQErrorResponseMixin(a,b);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({errorIQErrorBadRequestMixin:c.value},a.value))}g.parseBadRequestIQErrorResponseMixin=a}),98); __d("WASmaxInNewslettersIQErrorRateOverlimitMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","rate-overlimit");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",429);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorRateOverlimitMixin=a}),98); __d("WASmaxInNewslettersRateLimitedIQErrorResponseMixin",["WAResultOrError","WASmaxInNewslettersIQErrorRateOverlimitMixin","WASmaxInNewslettersIQErrorResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"error");if(!c.success)return c;c=d("WASmaxInNewslettersIQErrorRateOverlimitMixin").parseIQErrorRateOverlimitMixin(c.value);if(!c.success)return c;a=d("WASmaxInNewslettersIQErrorResponseMixin").parseIQErrorResponseMixin(a,b);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({errorIQErrorRateOverlimitMixin:c.value},a.value))}g.parseRateLimitedIQErrorResponseMixin=a}),98); __d("WASmaxInNewslettersBadRequestOrRateLimitedIQErrorResponseMixinGroup",["WAResultOrError","WASmaxInNewslettersBadRequestIQErrorResponseMixin","WASmaxInNewslettersRateLimitedIQErrorResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxInNewslettersBadRequestIQErrorResponseMixin").parseBadRequestIQErrorResponseMixin(a,b);if(c.success)return d("WAResultOrError").makeResult({name:"BadRequestIQErrorResponse",value:c.value});b=d("WASmaxInNewslettersRateLimitedIQErrorResponseMixin").parseRateLimitedIQErrorResponseMixin(a,b);return b.success?d("WAResultOrError").makeResult({name:"RateLimitedIQErrorResponse",value:b.value}):d("WASmaxParseUtils").errorMixinDisjunction(a,["BadRequestIQErrorResponse","RateLimitedIQErrorResponse"],[c,b])}g.parseBadRequestOrRateLimitedIQErrorResponseMixinGroup=a}),98); __d("WASmaxInNewslettersNewsletterCreationTimeMetadataMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"metadata");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"creation_time");if(!b.success)return b;a=d("WASmaxParseUtils").attrIntRange(b.value,"value",0,void 0);return!a.success?a:d("WAResultOrError").makeResult({creationTimeValue:a.value})}g.parseNewsletterCreationTimeMetadataMixin=a}),98); __d("WASmaxInNewslettersQueryDescriptionResponseMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"description");if(!b.success)return b;b=d("WASmaxParseUtils").attrString(a,"id");if(!b.success)return b;var c=d("WASmaxParseUtils").attrIntRange(a,"update_time",0,void 0);if(!c.success)return c;a=d("WASmaxParseUtils").contentString(a);return!a.success?a:d("WAResultOrError").makeResult({id:b.value,updateTime:c.value,elementValue:a.value})}g.parseQueryDescriptionResponseMixin=a}),98); __d("WASmaxInNewslettersNewsletterDescriptionMetadataMixin",["WAResultOrError","WASmaxInNewslettersQueryDescriptionResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"metadata");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"description");if(!b.success)return b;a=d("WASmaxInNewslettersQueryDescriptionResponseMixin").parseQueryDescriptionResponseMixin(b.value);return d("WAResultOrError").makeResult({descriptionQueryDescriptionResponseMixin:a.success?a.value:null})}g.parseNewsletterDescriptionMetadataMixin=a}),98); __d("WASmaxInNewslettersNewsletterInviteLinkMetadataMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"metadata");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"invite");if(!b.success)return b;a=d("WASmaxParseUtils").attrString(b.value,"code");return!a.success?a:d("WAResultOrError").makeResult({inviteCode:a.value})}g.parseNewsletterInviteLinkMetadataMixin=a}),98); __d("WASmaxInNewslettersNewsletterLinkedAccountsMetadataMixin",["WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"metadata");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"linked_accounts");return!b.success?b:d("WASmaxParseUtils").voidSuccess}g.parseNewsletterLinkedAccountsMetadataMixin=a}),98); __d("WASmaxInNewslettersEnums",[],(function(a,b,c,d,e,f){a={"1p_sticker":"1p_sticker",audio:"audio",avatar_sticker:"avatar_sticker",cataloglink:"cataloglink",collection:"collection",document:"document",genai_sticker:"genai_sticker",gif:"gif",image:"image",productlink:"productlink",ptt:"ptt",ptv:"ptv",sticker:"sticker",sticker_pack:"sticker_pack",url:"url",user_created_sticker:"user_created_sticker",vcard:"vcard",video:"video"};b={active:"active",geosuspended:"geosuspended",suspended:"suspended"};c={admin:"admin",guest:"guest",owner:"owner",subscriber:"subscriber"};d={all:"all",basic:"basic",none:"none"};e={hd_image_dual_upload:"hd_image_dual_upload",hd_video_dual_upload:"hd_video_dual_upload",media_poll:"media_poll",motion_photo:"motion_photo",sticker_annotation:"sticker_annotation"};var g={image:"image",preview:"preview"},h={image:"image",text:"text"},i={off:"off",on:"on",undefined:"undefined"},j={"private":"private","public":"public"},k={unverified:"unverified",verified:"verified"};f.ENUM_1PSTICKER_AUDIO_AVATARSTICKER_CATALOGLINK_COLLECTION_DOCUMENT_GENAISTICKER_GIF_IMAGE_PRODUCTLINK_PTT_PTV_STICKER_STICKERPACK_URL_USERCREATEDSTICKER_VCARD_VIDEO=a;f.ENUM_ACTIVE_GEOSUSPENDED_SUSPENDED=b;f.ENUM_ADMIN_GUEST_OWNER_SUBSCRIBER=c;f.ENUM_ALL_BASIC_NONE=d;f.ENUM_HDIMAGEDUALUPLOAD_HDVIDEODUALUPLOAD_MEDIAPOLL_MOTIONPHOTO_STICKERANNOTATION=e;f.ENUM_IMAGE_PREVIEW=g;f.ENUM_IMAGE_TEXT=h;f.ENUM_OFF_ON_UNDEFINED=i;f.ENUM_PRIVATE_PUBLIC=j;f.ENUM_UNVERIFIED_VERIFIED=k}),66); __d("WASmaxInNewslettersNewsletterMembershipMetadataMixin",["WAResultOrError","WASmaxInNewslettersEnums","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"metadata");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"membership");if(!b.success)return b;a=d("WASmaxParseUtils").attrStringEnum(b.value,"type",d("WASmaxInNewslettersEnums").ENUM_ADMIN_GUEST_OWNER_SUBSCRIBER);return!a.success?a:d("WAResultOrError").makeResult({membershipType:a.value})}g.parseNewsletterMembershipMetadataMixin=a}),98); __d("WASmaxInNewslettersNewsletterMutedMetadataMixin",["WAResultOrError","WASmaxInNewslettersEnums","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"metadata");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"muted");if(!b.success)return b;a=d("WASmaxParseUtils").attrStringEnum(b.value,"state",d("WASmaxInNewslettersEnums").ENUM_OFF_ON_UNDEFINED);return!a.success?a:d("WAResultOrError").makeResult({mutedState:a.value})}g.parseNewsletterMutedMetadataMixin=a}),98); __d("WASmaxInNewslettersNewsletterNameMetadataMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"metadata");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"name");if(!b.success)return b;a=d("WASmaxParseUtils").attrString(b.value,"id");if(!a.success)return a;var c=d("WASmaxParseUtils").attrIntRange(b.value,"update_time",0,void 0);if(!c.success)return c;b=d("WASmaxParseUtils").contentString(b.value);return!b.success?b:d("WAResultOrError").makeResult({nameId:a.value,nameUpdateTime:c.value,nameElementValue:b.value})}g.parseNewsletterNameMetadataMixin=a}),98); __d("WASmaxInNewslettersQueryPictureDirectPathResponseMixin",["WAResultOrError","WASmaxInNewslettersEnums","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"picture");if(!b.success)return b;b=d("WASmaxParseUtils").attrString(a,"id");if(!b.success)return b;var c=d("WASmaxParseUtils").attrStringEnum(a,"type",d("WASmaxInNewslettersEnums").ENUM_IMAGE_PREVIEW);if(!c.success)return c;a=d("WASmaxParseUtils").attrString(a,"direct_path");return!a.success?a:d("WAResultOrError").makeResult({id:b.value,type:c.value,directPath:a.value})}g.parseQueryPictureDirectPathResponseMixin=a}),98); __d("WASmaxInNewslettersQueryPictureEmptyResponseMixin",["WAResultOrError","WASmaxInNewslettersEnums","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"picture");if(!b.success)return b;b=d("WASmaxParseUtils").attrStringEnum(a,"type",d("WASmaxInNewslettersEnums").ENUM_IMAGE_PREVIEW);return!b.success?b:d("WAResultOrError").makeResult({type:b.value})}g.parseQueryPictureEmptyResponseMixin=a}),98); __d("WASmaxInNewslettersQueryPictureDirectPathOrEmptyResponseMixinGroup",["WAResultOrError","WASmaxInNewslettersQueryPictureDirectPathResponseMixin","WASmaxInNewslettersQueryPictureEmptyResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxInNewslettersQueryPictureDirectPathResponseMixin").parseQueryPictureDirectPathResponseMixin(a);if(b.success)return d("WAResultOrError").makeResult({name:"QueryPictureDirectPathResponse",value:b.value});var c=d("WASmaxInNewslettersQueryPictureEmptyResponseMixin").parseQueryPictureEmptyResponseMixin(a);return c.success?d("WAResultOrError").makeResult({name:"QueryPictureEmptyResponse",value:c.value}):d("WASmaxParseUtils").errorMixinDisjunction(a,["QueryPictureDirectPathResponse","QueryPictureEmptyResponse"],[b,c])}g.parseQueryPictureDirectPathOrEmptyResponseMixinGroup=a}),98); __d("WASmaxInNewslettersNewsletterPictureMetadataMixin",["WAResultOrError","WASmaxInNewslettersQueryPictureDirectPathOrEmptyResponseMixinGroup","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function h(a){var b=d("WASmaxParseUtils").assertTag(a,"picture");if(!b.success)return b;b=d("WASmaxInNewslettersQueryPictureDirectPathOrEmptyResponseMixinGroup").parseQueryPictureDirectPathOrEmptyResponseMixinGroup(a);return!b.success?b:d("WAResultOrError").makeResult({queryPictureDirectPathOrEmptyResponseMixinGroup:b.value})}function a(a){var b=d("WASmaxParseUtils").assertTag(a,"metadata");if(!b.success)return b;b=d("WASmaxParseUtils").mapChildrenWithTag(a,"picture",0,2,h);return!b.success?b:d("WAResultOrError").makeResult({picture:b.value})}g.parseNewsletterPictureMetadataPicture=h;g.parseNewsletterPictureMetadataMixin=a}),98); __d("WASmaxInNewslettersNewsletterPrivacyMetadataMixin",["WAResultOrError","WASmaxInNewslettersEnums","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"metadata");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"privacy");if(!b.success)return b;a=d("WASmaxParseUtils").attrStringEnum(b.value,"type",d("WASmaxInNewslettersEnums").ENUM_PRIVATE_PUBLIC);return!a.success?a:d("WAResultOrError").makeResult({privacyType:a.value})}g.parseNewsletterPrivacyMetadataMixin=a}),98); __d("WASmaxInNewslettersNewsletterStateMetadataMixin",["WAResultOrError","WASmaxInNewslettersEnums","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"metadata");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"state");if(!b.success)return b;a=d("WASmaxParseUtils").attrStringEnum(b.value,"type",d("WASmaxInNewslettersEnums").ENUM_ACTIVE_GEOSUSPENDED_SUSPENDED);return!a.success?a:d("WAResultOrError").makeResult({stateType:a.value})}g.parseNewsletterStateMetadataMixin=a}),98); __d("WASmaxInNewslettersNewsletterSubscribersMetadataMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"metadata");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"subscribers");if(!b.success)return b;a=d("WASmaxParseUtils").attrIntRange(b.value,"count",0,void 0);return!a.success?a:d("WAResultOrError").makeResult({subscribersCount:a.value})}g.parseNewsletterSubscribersMetadataMixin=a}),98); __d("WASmaxInNewslettersNewsletterVerificationMetadataMixin",["WAResultOrError","WASmaxInNewslettersEnums","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"metadata");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"verification");if(!b.success)return b;a=d("WASmaxParseUtils").attrStringEnum(b.value,"state",d("WASmaxInNewslettersEnums").ENUM_UNVERIFIED_VERIFIED);return!a.success?a:d("WAResultOrError").makeResult({verificationState:a.value})}g.parseNewsletterVerificationMetadataMixin=a}),98); __d("WASmaxInNewslettersCommonNewsletterMetadataMixin",["WAResultOrError","WASmaxInNewslettersNewsletterCreationTimeMetadataMixin","WASmaxInNewslettersNewsletterDescriptionMetadataMixin","WASmaxInNewslettersNewsletterInviteLinkMetadataMixin","WASmaxInNewslettersNewsletterLinkedAccountsMetadataMixin","WASmaxInNewslettersNewsletterMembershipMetadataMixin","WASmaxInNewslettersNewsletterMutedMetadataMixin","WASmaxInNewslettersNewsletterNameMetadataMixin","WASmaxInNewslettersNewsletterPictureMetadataMixin","WASmaxInNewslettersNewsletterPrivacyMetadataMixin","WASmaxInNewslettersNewsletterStateMetadataMixin","WASmaxInNewslettersNewsletterSubscribersMetadataMixin","WASmaxInNewslettersNewsletterVerificationMetadataMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"metadata");if(!b.success)return b;b=d("WASmaxInNewslettersNewsletterCreationTimeMetadataMixin").parseNewsletterCreationTimeMetadataMixin(a);var c=d("WASmaxInNewslettersNewsletterNameMetadataMixin").parseNewsletterNameMetadataMixin(a),e=d("WASmaxInNewslettersNewsletterPictureMetadataMixin").parseNewsletterPictureMetadataMixin(a),f=d("WASmaxInNewslettersNewsletterDescriptionMetadataMixin").parseNewsletterDescriptionMetadataMixin(a),g=d("WASmaxInNewslettersNewsletterInviteLinkMetadataMixin").parseNewsletterInviteLinkMetadataMixin(a),h=d("WASmaxInNewslettersNewsletterSubscribersMetadataMixin").parseNewsletterSubscribersMetadataMixin(a),i=d("WASmaxInNewslettersNewsletterPrivacyMetadataMixin").parseNewsletterPrivacyMetadataMixin(a),j=d("WASmaxInNewslettersNewsletterVerificationMetadataMixin").parseNewsletterVerificationMetadataMixin(a),k=d("WASmaxInNewslettersNewsletterLinkedAccountsMetadataMixin").parseNewsletterLinkedAccountsMetadataMixin(a),l=d("WASmaxInNewslettersNewsletterMembershipMetadataMixin").parseNewsletterMembershipMetadataMixin(a),m=d("WASmaxInNewslettersNewsletterMutedMetadataMixin").parseNewsletterMutedMetadataMixin(a);a=d("WASmaxInNewslettersNewsletterStateMetadataMixin").parseNewsletterStateMetadataMixin(a);return d("WAResultOrError").makeResult({newsletterCreationTimeMetadataMixin:b.success?b.value:null,newsletterNameMetadataMixin:c.success?c.value:null,newsletterPictureMetadataMixin:e.success?e.value:null,newsletterDescriptionMetadataMixin:f.success?f.value:null,newsletterInviteLinkMetadataMixin:g.success?g.value:null,newsletterSubscribersMetadataMixin:h.success?h.value:null,newsletterPrivacyMetadataMixin:i.success?i.value:null,newsletterVerificationMetadataMixin:j.success?j.value:null,hasNewsletterLinkedAccountsMetadataMixin:k.success,newsletterMembershipMetadataMixin:l.success?l.value:null,newsletterMutedMetadataMixin:m.success?m.value:null,newsletterStateMetadataMixin:a.success?a.value:null})}g.parseCommonNewsletterMetadataMixin=a}),98); __d("WASmaxInNewslettersServerNotificationMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"notification");if(!b.success)return b;b=d("WASmaxParseUtils").attrIntRange(a,"t",0,void 0);if(!b.success)return b;var c=d("WASmaxParseUtils").attrStanzaId(a,"id");if(!c.success)return c;a=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrIntRange,a,"offline",0,1024);return!a.success?a:d("WAResultOrError").makeResult({t:b.value,id:c.value,offline:a.value})}g.parseServerNotificationMixin=a}),98); __d("WASmaxInNewslettersCommonNotificationMixin",["WAResultOrError","WASmaxInNewslettersServerNotificationMixin","WASmaxParseJid","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"notification");if(!b.success)return b;b=d("WASmaxParseJid").attrNewsletterJid(a,"from");if(!b.success)return b;var c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","newsletter");if(!c.success)return c;a=d("WASmaxInNewslettersServerNotificationMixin").parseServerNotificationMixin(a);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({from:b.value,type:c.value},a.value))}g.parseCommonNotificationMixin=a}),98); __d("WASmaxInNewslettersContentTypeMediaMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"message");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","media");return!b.success?b:d("WAResultOrError").makeResult({type:b.value})}g.parseContentTypeMediaMixin=a}),98); __d("WASmaxInNewslettersContentTypePollCreationMixin",["WAResultOrError","WASmaxInNewslettersEnums","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"message");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"meta");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","poll");if(!a.success)return a;var c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,b.value,"polltype","creation");if(!c.success)return c;b=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrStringEnum,b.value,"contenttype",d("WASmaxInNewslettersEnums").ENUM_IMAGE_TEXT);return!b.success?b:d("WAResultOrError").makeResult({type:a.value,metaPolltype:c.value,metaContenttype:b.value})}g.parseContentTypePollCreationMixin=a}),98); __d("WASmaxInNewslettersContentTypePollResultSnapshotMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"message");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"meta");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","poll");if(!a.success)return a;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,b.value,"polltype","result_snapshot");return!b.success?b:d("WAResultOrError").makeResult({type:a.value,metaPolltype:b.value})}g.parseContentTypePollResultSnapshotMixin=a}),98); __d("WASmaxInNewslettersContentTypeTextMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"message");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","text");return!b.success?b:d("WAResultOrError").makeResult({type:b.value})}g.parseContentTypeTextMixin=a}),98); __d("WASmaxInNewslettersContentTypeTextOrMediaOrPollCreationMixinGroup",["WAResultOrError","WASmaxInNewslettersContentTypeMediaMixin","WASmaxInNewslettersContentTypePollCreationMixin","WASmaxInNewslettersContentTypeTextMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxInNewslettersContentTypeTextMixin").parseContentTypeTextMixin(a);if(b.success)return d("WAResultOrError").makeResult({name:"ContentTypeText",value:b.value});var c=d("WASmaxInNewslettersContentTypeMediaMixin").parseContentTypeMediaMixin(a);if(c.success)return d("WAResultOrError").makeResult({name:"ContentTypeMedia",value:c.value});var e=d("WASmaxInNewslettersContentTypePollCreationMixin").parseContentTypePollCreationMixin(a);return e.success?d("WAResultOrError").makeResult({name:"ContentTypePollCreation",value:e.value}):d("WASmaxParseUtils").errorMixinDisjunction(a,["ContentTypeText","ContentTypeMedia","ContentTypePollCreation"],[b,c,e])}g.parseContentTypeTextOrMediaOrPollCreationMixinGroup=a}),98); __d("WASmaxInNewslettersCreateResponseClientError",["WAResultOrError","WASmaxInNewslettersBadRequestOrRateLimitedIQErrorResponseMixinGroup","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxInNewslettersBadRequestOrRateLimitedIQErrorResponseMixinGroup").parseBadRequestOrRateLimitedIQErrorResponseMixinGroup(a,b);return!c.success?c:d("WAResultOrError").makeResult({badRequestOrRateLimitedIQErrorResponseMixinGroup:c.value})}g.parseCreateResponseClientError=a}),98); __d("WASmaxInNewslettersIQErrorInternalServerErrorMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","internal-server-error");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",500);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorInternalServerErrorMixin=a}),98); __d("WASmaxInNewslettersInternalServerErrorIQErrorResponseMixin",["WAResultOrError","WASmaxInNewslettersIQErrorInternalServerErrorMixin","WASmaxInNewslettersIQErrorResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"error");if(!c.success)return c;c=d("WASmaxInNewslettersIQErrorInternalServerErrorMixin").parseIQErrorInternalServerErrorMixin(c.value);if(!c.success)return c;a=d("WASmaxInNewslettersIQErrorResponseMixin").parseIQErrorResponseMixin(a,b);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({errorIQErrorInternalServerErrorMixin:c.value},a.value))}g.parseInternalServerErrorIQErrorResponseMixin=a}),98); __d("WASmaxInNewslettersCreateResponseServerError",["WASmaxInNewslettersInternalServerErrorIQErrorResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxInNewslettersInternalServerErrorIQErrorResponseMixin").parseInternalServerErrorIQErrorResponseMixin(a,b);return!c.success?c:c}g.parseCreateResponseServerError=a}),98); __d("WASmaxInNewslettersIQResultResponseMixin",["WAResultOrError","WASmaxParseReference","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["id"]);if(!c.success)return c;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"id",c.value);if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["to"]);if(!c.success)return c;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"from",c.value);if(!b.success)return b;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","result");return!c.success?c:d("WAResultOrError").makeResult({type:c.value})}g.parseIQResultResponseMixin=a}),98); __d("WASmaxInNewslettersNewsletterIDMetadataMixin",["WAResultOrError","WASmaxParseJid","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"metadata");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"id");if(!b.success)return b;a=d("WASmaxParseJid").attrNewsletterJid(b.value,"jid");return!a.success?a:d("WAResultOrError").makeResult({idJid:a.value})}g.parseNewsletterIDMetadataMixin=a}),98); __d("WASmaxInNewslettersNewsletterMetadataIQResponsePayloadMixin",["WAResultOrError","WASmaxInNewslettersCommonNewsletterMetadataMixin","WASmaxInNewslettersNewsletterIDMetadataMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"metadata");if(!b.success)return b;b=d("WASmaxInNewslettersNewsletterIDMetadataMixin").parseNewsletterIDMetadataMixin(a);if(!b.success)return b;a=d("WASmaxInNewslettersCommonNewsletterMetadataMixin").parseCommonNewsletterMetadataMixin(a);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({},b.value,a.value))}g.parseNewsletterMetadataIQResponsePayloadMixin=a}),98); __d("WASmaxInNewslettersNewsletterWithMetadataIQResponsePayloadMixin",["WASmaxInNewslettersNewsletterMetadataIQResponsePayloadMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"newsletter");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"metadata");if(!b.success)return b;a=d("WASmaxInNewslettersNewsletterMetadataIQResponsePayloadMixin").parseNewsletterMetadataIQResponsePayloadMixin(b.value);return!a.success?a:a}g.parseNewsletterWithMetadataIQResponsePayloadMixin=a}),98); __d("WASmaxInNewslettersCreateResponseSuccess",["WAResultOrError","WASmaxInNewslettersIQResultResponseMixin","WASmaxInNewslettersNewsletterWithMetadataIQResponsePayloadMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"newsletter");if(!c.success)return c;c=d("WASmaxInNewslettersNewsletterWithMetadataIQResponsePayloadMixin").parseNewsletterWithMetadataIQResponsePayloadMixin(c.value);if(!c.success)return c;a=d("WASmaxInNewslettersIQResultResponseMixin").parseIQResultResponseMixin(a,b);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({newsletterNewsletterWithMetadataIQResponsePayloadMixin:c.value},a.value))}g.parseCreateResponseSuccess=a}),98); __d("WASmaxInNewslettersIQErrorItemNotFoundMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","item-not-found");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",404);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorItemNotFoundMixin=a}),98); __d("WASmaxInNewslettersItemNotFoundIQErrorResponseMixin",["WAResultOrError","WASmaxInNewslettersIQErrorItemNotFoundMixin","WASmaxInNewslettersIQErrorResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"error");if(!c.success)return c;c=d("WASmaxInNewslettersIQErrorItemNotFoundMixin").parseIQErrorItemNotFoundMixin(c.value);if(!c.success)return c;a=d("WASmaxInNewslettersIQErrorResponseMixin").parseIQErrorResponseMixin(a,b);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({errorIQErrorItemNotFoundMixin:c.value},a.value))}g.parseItemNotFoundIQErrorResponseMixin=a}),98); __d("WASmaxInNewslettersIQErrorLockedMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","locked");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",423);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorLockedMixin=a}),98); __d("WASmaxInNewslettersSuspendedIQErrorResponseMixin",["WAResultOrError","WASmaxInNewslettersIQErrorLockedMixin","WASmaxInNewslettersIQErrorResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"error");if(!c.success)return c;c=d("WASmaxInNewslettersIQErrorLockedMixin").parseIQErrorLockedMixin(c.value);if(!c.success)return c;a=d("WASmaxInNewslettersIQErrorResponseMixin").parseIQErrorResponseMixin(a,b);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({errorIQErrorLockedMixin:c.value},a.value))}g.parseSuspendedIQErrorResponseMixin=a}),98); __d("WASmaxInNewslettersIQErrorUnavailableForLegalReasonsGenericMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","features-disabled");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",451);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorUnavailableForLegalReasonsGenericMixin=a}),98); __d("WASmaxInNewslettersUnavailableForLegalReasonsResponseMixin",["WAResultOrError","WASmaxInNewslettersIQErrorResponseMixin","WASmaxInNewslettersIQErrorUnavailableForLegalReasonsGenericMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"error");if(!c.success)return c;c=d("WASmaxInNewslettersIQErrorUnavailableForLegalReasonsGenericMixin").parseIQErrorUnavailableForLegalReasonsGenericMixin(c.value);if(!c.success)return c;a=d("WASmaxInNewslettersIQErrorResponseMixin").parseIQErrorResponseMixin(a,b);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({errorIQErrorUnavailableForLegalReasonsGenericMixin:c.value},a.value))}g.parseUnavailableForLegalReasonsResponseMixin=a}),98); __d("WASmaxInNewslettersGetNewsletterMessageUpdatesClientErrors",["WAResultOrError","WASmaxInNewslettersBadRequestIQErrorResponseMixin","WASmaxInNewslettersItemNotFoundIQErrorResponseMixin","WASmaxInNewslettersRateLimitedIQErrorResponseMixin","WASmaxInNewslettersSuspendedIQErrorResponseMixin","WASmaxInNewslettersUnavailableForLegalReasonsResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxInNewslettersBadRequestIQErrorResponseMixin").parseBadRequestIQErrorResponseMixin(a,b);if(c.success)return d("WAResultOrError").makeResult({name:"BadRequestIQErrorResponse",value:c.value});var e=d("WASmaxInNewslettersUnavailableForLegalReasonsResponseMixin").parseUnavailableForLegalReasonsResponseMixin(a,b);if(e.success)return d("WAResultOrError").makeResult({name:"UnavailableForLegalReasonsResponse",value:e.value});var f=d("WASmaxInNewslettersItemNotFoundIQErrorResponseMixin").parseItemNotFoundIQErrorResponseMixin(a,b);if(f.success)return d("WAResultOrError").makeResult({name:"ItemNotFoundIQErrorResponse",value:f.value});var g=d("WASmaxInNewslettersSuspendedIQErrorResponseMixin").parseSuspendedIQErrorResponseMixin(a,b);if(g.success)return d("WAResultOrError").makeResult({name:"SuspendedIQErrorResponse",value:g.value});b=d("WASmaxInNewslettersRateLimitedIQErrorResponseMixin").parseRateLimitedIQErrorResponseMixin(a,b);return b.success?d("WAResultOrError").makeResult({name:"RateLimitedIQErrorResponse",value:b.value}):d("WASmaxParseUtils").errorMixinDisjunction(a,["BadRequestIQErrorResponse","UnavailableForLegalReasonsResponse","ItemNotFoundIQErrorResponse","SuspendedIQErrorResponse","RateLimitedIQErrorResponse"],[c,e,f,g,b])}g.parseGetNewsletterMessageUpdatesClientErrors=a}),98); __d("WASmaxInNewslettersGetNewsletterMessageUpdatesResponseClientError",["WAResultOrError","WASmaxInNewslettersGetNewsletterMessageUpdatesClientErrors","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxInNewslettersGetNewsletterMessageUpdatesClientErrors").parseGetNewsletterMessageUpdatesClientErrors(a,b);return!c.success?c:d("WAResultOrError").makeResult({getNewsletterMessageUpdatesClientErrors:c.value})}g.parseGetNewsletterMessageUpdatesResponseClientError=a}),98); __d("WASmaxInNewslettersGetNewsletterMessageUpdatesResponseServerError",["WASmaxInNewslettersInternalServerErrorIQErrorResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxInNewslettersInternalServerErrorIQErrorResponseMixin").parseInternalServerErrorIQErrorResponseMixin(a,b);return!c.success?c:c}g.parseGetNewsletterMessageUpdatesResponseServerError=a}),98); __d("WASmaxInNewslettersMessageAssociationTypeMixin",["WAResultOrError","WASmaxInNewslettersEnums","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"message");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"meta");if(!b.success)return b;a=d("WASmaxParseUtils").attrStringEnum(b.value,"message_association_type",d("WASmaxInNewslettersEnums").ENUM_HDIMAGEDUALUPLOAD_HDVIDEODUALUPLOAD_MEDIAPOLL_MOTIONPHOTO_STICKERANNOTATION);return!a.success?a:d("WAResultOrError").makeResult({metaMessageAssociationType:a.value})}g.parseMessageAssociationTypeMixin=a}),98); __d("WASmaxInNewslettersPayloadMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"plaintext");if(!b.success)return b;b=d("WASmaxParseUtils").contentBytesRange(a,1,1048576);return!b.success?b:d("WAResultOrError").makeResult({elementValue:b.value})}g.parsePayloadMixin=a}),98); __d("WASmaxInNewslettersWAMOSubMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"message");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"meta");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,b.value,"is_wamo_sub","true");return!a.success?a:d("WAResultOrError").makeResult({metaIsWamoSub:a.value})}g.parseWAMOSubMixin=a}),98); __d("WASmaxInNewslettersNewsletterMediaMixin",["WAResultOrError","WASmaxInNewslettersContentTypeMediaMixin","WASmaxInNewslettersEnums","WASmaxInNewslettersMessageAssociationTypeMixin","WASmaxInNewslettersPayloadMixin","WASmaxInNewslettersWAMOSubMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"message");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"plaintext");if(!b.success)return b;var c=d("WASmaxParseUtils").attrStringEnum(b.value,"mediatype",d("WASmaxInNewslettersEnums").ENUM_1PSTICKER_AUDIO_AVATARSTICKER_CATALOGLINK_COLLECTION_DOCUMENT_GENAISTICKER_GIF_IMAGE_PRODUCTLINK_PTT_PTV_STICKER_STICKERPACK_URL_USERCREATEDSTICKER_VCARD_VIDEO);if(!c.success)return c;b=d("WASmaxInNewslettersPayloadMixin").parsePayloadMixin(b.value);if(!b.success)return b;var e=d("WASmaxInNewslettersContentTypeMediaMixin").parseContentTypeMediaMixin(a);if(!e.success)return e;var f=d("WASmaxInNewslettersWAMOSubMixin").parseWAMOSubMixin(a);a=d("WASmaxInNewslettersMessageAssociationTypeMixin").parseMessageAssociationTypeMixin(a);return d("WAResultOrError").makeResult(babelHelpers["extends"]({plaintextMediatype:c.value,plaintextPayloadMixin:b.value},e.value,{wAMOSubMixin:f.success?f.value:null,messageAssociationTypeMixin:a.success?a.value:null}))}g.parseNewsletterMediaMixin=a}),98); __d("WASmaxInNewslettersNewsletterTextMixin",["WAResultOrError","WASmaxInNewslettersContentTypeTextMixin","WASmaxInNewslettersPayloadMixin","WASmaxInNewslettersWAMOSubMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"message");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"plaintext");if(!b.success)return b;b=d("WASmaxInNewslettersPayloadMixin").parsePayloadMixin(b.value);if(!b.success)return b;var c=d("WASmaxInNewslettersContentTypeTextMixin").parseContentTypeTextMixin(a);if(!c.success)return c;a=d("WASmaxInNewslettersWAMOSubMixin").parseWAMOSubMixin(a);return d("WAResultOrError").makeResult(babelHelpers["extends"]({plaintextPayloadMixin:b.value},c.value,{wAMOSubMixin:a.success?a.value:null}))}g.parseNewsletterTextMixin=a}),98); __d("WASmaxInNewslettersNewsletterTextOrMediaMixinGroup",["WAResultOrError","WASmaxInNewslettersNewsletterMediaMixin","WASmaxInNewslettersNewsletterTextMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxInNewslettersNewsletterTextMixin").parseNewsletterTextMixin(a);if(b.success)return d("WAResultOrError").makeResult({name:"NewsletterText",value:b.value});var c=d("WASmaxInNewslettersNewsletterMediaMixin").parseNewsletterMediaMixin(a);return c.success?d("WAResultOrError").makeResult({name:"NewsletterMedia",value:c.value}):d("WASmaxParseUtils").errorMixinDisjunction(a,["NewsletterText","NewsletterMedia"],[b,c])}g.parseNewsletterTextOrMediaMixinGroup=a}),98); __d("WASmaxInNewslettersNewsletterEditMixin",["WAResultOrError","WASmaxInNewslettersAdminEditMixin","WASmaxInNewslettersNewsletterTextOrMediaMixinGroup","WASmaxInNewslettersWAMOSubMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"message");if(!b.success)return b;b=d("WASmaxInNewslettersAdminEditMixin").parseAdminEditMixin(a);if(!b.success)return b;var c=d("WASmaxInNewslettersWAMOSubMixin").parseWAMOSubMixin(a);a=d("WASmaxInNewslettersNewsletterTextOrMediaMixinGroup").parseNewsletterTextOrMediaMixinGroup(a);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({},b.value,{wAMOSubMixin:c.success?c.value:null,newsletterTextOrMediaMixinGroup:a.value}))}g.parseNewsletterEditMixin=a}),98); __d("WASmaxInNewslettersNewsletterPollCreationMixin",["WAResultOrError","WASmaxInNewslettersContentTypePollCreationMixin","WASmaxInNewslettersPayloadMixin","WASmaxInNewslettersWAMOSubMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"message");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"plaintext");if(!b.success)return b;b=d("WASmaxInNewslettersPayloadMixin").parsePayloadMixin(b.value);if(!b.success)return b;var c=d("WASmaxInNewslettersContentTypePollCreationMixin").parseContentTypePollCreationMixin(a);if(!c.success)return c;a=d("WASmaxInNewslettersWAMOSubMixin").parseWAMOSubMixin(a);return d("WAResultOrError").makeResult(babelHelpers["extends"]({plaintextPayloadMixin:b.value},c.value,{wAMOSubMixin:a.success?a.value:null}))}g.parseNewsletterPollCreationMixin=a}),98); __d("WASmaxInNewslettersNewsletterPollResultSnapshotMixin",["WAResultOrError","WASmaxInNewslettersContentTypePollResultSnapshotMixin","WASmaxInNewslettersPayloadMixin","WASmaxInNewslettersWAMOSubMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"message");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"plaintext");if(!b.success)return b;b=d("WASmaxInNewslettersPayloadMixin").parsePayloadMixin(b.value);if(!b.success)return b;var c=d("WASmaxInNewslettersContentTypePollResultSnapshotMixin").parseContentTypePollResultSnapshotMixin(a);if(!c.success)return c;a=d("WASmaxInNewslettersWAMOSubMixin").parseWAMOSubMixin(a);return d("WAResultOrError").makeResult(babelHelpers["extends"]({plaintextPayloadMixin:b.value},c.value,{wAMOSubMixin:a.success?a.value:null}))}g.parseNewsletterPollResultSnapshotMixin=a}),98); __d("WASmaxInNewslettersNewsletterRevokeMixin",["WAResultOrError","WASmaxInNewslettersAdminRevokeMixin","WASmaxInNewslettersContentTypeTextMixin","WASmaxInNewslettersWAMOSubMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"message");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"plaintext");if(!b.success)return b;b=d("WASmaxInNewslettersAdminRevokeMixin").parseAdminRevokeMixin(a);if(!b.success)return b;var c=d("WASmaxInNewslettersContentTypeTextMixin").parseContentTypeTextMixin(a);if(!c.success)return c;a=d("WASmaxInNewslettersWAMOSubMixin").parseWAMOSubMixin(a);return d("WAResultOrError").makeResult(babelHelpers["extends"]({},b.value,c.value,{wAMOSubMixin:a.success?a.value:null}))}g.parseNewsletterRevokeMixin=a}),98); __d("WASmaxInNewslettersNewsletterWAMOEmptyMixin",["WAResultOrError","WASmaxInNewslettersAdminEditMixin","WASmaxInNewslettersAdminRevokeMixin","WASmaxInNewslettersContentTypeTextOrMediaOrPollCreationMixinGroup","WASmaxInNewslettersWAMOSubMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"message");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"plaintext");if(!b.success)return b;b=d("WASmaxInNewslettersWAMOSubMixin").parseWAMOSubMixin(a);if(!b.success)return b;var c=d("WASmaxInNewslettersAdminRevokeMixin").parseAdminRevokeMixin(a),e=d("WASmaxInNewslettersAdminEditMixin").parseAdminEditMixin(a);a=d("WASmaxInNewslettersContentTypeTextOrMediaOrPollCreationMixinGroup").parseContentTypeTextOrMediaOrPollCreationMixinGroup(a);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({},b.value,{adminRevokeMixin:c.success?c.value:null,adminEditMixin:e.success?e.value:null,contentTypeTextOrMediaOrPollCreationMixinGroup:a.value}))}g.parseNewsletterWAMOEmptyMixin=a}),98); __d("WASmaxInNewslettersNewsletterMessageHistoryContent",["WAResultOrError","WASmaxInNewslettersNewsletterEditMixin","WASmaxInNewslettersNewsletterMediaMixin","WASmaxInNewslettersNewsletterPollCreationMixin","WASmaxInNewslettersNewsletterPollResultSnapshotMixin","WASmaxInNewslettersNewsletterRevokeMixin","WASmaxInNewslettersNewsletterTextMixin","WASmaxInNewslettersNewsletterWAMOEmptyMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxInNewslettersNewsletterEditMixin").parseNewsletterEditMixin(a);if(b.success)return d("WAResultOrError").makeResult({name:"NewsletterEdit",value:b.value});var c=d("WASmaxInNewslettersNewsletterTextMixin").parseNewsletterTextMixin(a);if(c.success)return d("WAResultOrError").makeResult({name:"NewsletterText",value:c.value});var e=d("WASmaxInNewslettersNewsletterMediaMixin").parseNewsletterMediaMixin(a);if(e.success)return d("WAResultOrError").makeResult({name:"NewsletterMedia",value:e.value});var f=d("WASmaxInNewslettersNewsletterRevokeMixin").parseNewsletterRevokeMixin(a);if(f.success)return d("WAResultOrError").makeResult({name:"NewsletterRevoke",value:f.value});var g=d("WASmaxInNewslettersNewsletterPollCreationMixin").parseNewsletterPollCreationMixin(a);if(g.success)return d("WAResultOrError").makeResult({name:"NewsletterPollCreation",value:g.value});var h=d("WASmaxInNewslettersNewsletterPollResultSnapshotMixin").parseNewsletterPollResultSnapshotMixin(a);if(h.success)return d("WAResultOrError").makeResult({name:"NewsletterPollResultSnapshot",value:h.value});var i=d("WASmaxInNewslettersNewsletterWAMOEmptyMixin").parseNewsletterWAMOEmptyMixin(a);return i.success?d("WAResultOrError").makeResult({name:"NewsletterWAMOEmpty",value:i.value}):d("WASmaxParseUtils").errorMixinDisjunction(a,["NewsletterEdit","NewsletterText","NewsletterMedia","NewsletterRevoke","NewsletterPollCreation","NewsletterPollResultSnapshot","NewsletterWAMOEmpty"],[b,c,e,f,g,h,i])}g.parseNewsletterMessageHistoryContent=a}),98); __d("WASmaxInNewslettersNewsletterMessageLastEditTimestampMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"message");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"meta");if(!b.success)return b;a=d("WASmaxParseUtils").attrIntRange(b.value,"msg_edit_t",15778656e5,41024736e5);return!a.success?a:d("WAResultOrError").makeResult({metaMsgEditT:a.value})}g.parseNewsletterMessageLastEditTimestampMixin=a}),98); __d("WASmaxInNewslettersNewsletterMessageOriginalTimestampMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"message");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"meta");if(!b.success)return b;a=d("WASmaxParseUtils").attrIntRange(b.value,"original_msg_t",1577865600,4102473600);return!a.success?a:d("WAResultOrError").makeResult({metaOriginalMsgT:a.value})}g.parseNewsletterMessageOriginalTimestampMixin=a}),98); __d("WASmaxInNewslettersNewsletterMessageHistoryMixin",["WAResultOrError","WASmaxInNewslettersNewsletterMessageHistoryContent","WASmaxInNewslettersNewsletterMessageLastEditTimestampMixin","WASmaxInNewslettersNewsletterMessageOriginalTimestampMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"message");if(!b.success)return b;b=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrStanzaId,a,"id");if(!b.success)return b;var c=d("WASmaxParseUtils").attrIntRange(a,"server_id",99,2147476647);if(!c.success)return c;var e=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrIntRange,a,"t",0,void 0);if(!e.success)return e;var f=d("WASmaxParseUtils").optionalLiteral(d("WASmaxParseUtils").attrString,a,"is_sender","true");if(!f.success)return f;var g=d("WASmaxInNewslettersNewsletterMessageOriginalTimestampMixin").parseNewsletterMessageOriginalTimestampMixin(a),h=d("WASmaxInNewslettersNewsletterMessageLastEditTimestampMixin").parseNewsletterMessageLastEditTimestampMixin(a);a=d("WASmaxInNewslettersNewsletterMessageHistoryContent").parseNewsletterMessageHistoryContent(a);return d("WAResultOrError").makeResult({id:b.value,serverId:c.value,t:e.value,isSender:f.value,newsletterMessageOriginalTimestampMixin:g.success?g.value:null,newsletterMessageLastEditTimestampMixin:h.success?h.value:null,newsletterMessageHistoryContent:a.success?a.value:null})}g.parseNewsletterMessageHistoryMixin=a}),98); __d("WASmaxInNewslettersNewsletterPollVotesMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function h(a){var b=d("WASmaxParseUtils").assertTag(a,"vote");if(!b.success)return b;b=d("WASmaxParseUtils").attrIntRange(a,"count",1,void 0);if(!b.success)return b;a=d("WASmaxParseUtils").contentBytesRange(a,32,32);return!a.success?a:d("WAResultOrError").makeResult({count:b.value,elementValue:a.value})}function a(a){var b=d("WASmaxParseUtils").assertTag(a,"message");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"votes");if(!b.success)return b;a=d("WASmaxParseUtils").mapChildrenWithTag(b.value,"vote",0,1e3,h);return!a.success?a:d("WAResultOrError").makeResult({votesVote:a.value})}g.parseNewsletterPollVotesVotesVote=h;g.parseNewsletterPollVotesMixin=a}),98); __d("WASmaxInNewslettersNewsletterReactionsMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function h(a){var b=d("WASmaxParseUtils").assertTag(a,"reaction");if(!b.success)return b;b=d("WASmaxParseUtils").attrString(a,"code");if(!b.success)return b;a=d("WASmaxParseUtils").attrIntRange(a,"count",1,void 0);return!a.success?a:d("WAResultOrError").makeResult({code:b.value,count:a.value})}function a(a){var b=d("WASmaxParseUtils").assertTag(a,"message");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"reactions");if(!b.success)return b;a=d("WASmaxParseUtils").mapChildrenWithTag(b.value,"reaction",0,1e3,h);return!a.success?a:d("WAResultOrError").makeResult({reactionsReaction:a.value})}g.parseNewsletterReactionsReactionsReaction=h;g.parseNewsletterReactionsMixin=a}),98); __d("WASmaxInNewslettersNewsletterViewsCountMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"message");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"views_count");if(!b.success)return b;a=d("WASmaxParseUtils").attrIntRange(b.value,"count",0,void 0);return!a.success?a:d("WAResultOrError").makeResult({viewsCountCount:a.value})}g.parseNewsletterViewsCountMixin=a}),98); __d("WASmaxInNewslettersNewsletterMessageHistoryWithAddOnsMixin",["WAResultOrError","WASmaxInNewslettersNewsletterMessageHistoryMixin","WASmaxInNewslettersNewsletterPollVotesMixin","WASmaxInNewslettersNewsletterReactionsMixin","WASmaxInNewslettersNewsletterViewsCountMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"message");if(!b.success)return b;b=d("WASmaxInNewslettersNewsletterMessageHistoryMixin").parseNewsletterMessageHistoryMixin(a);if(!b.success)return b;var c=d("WASmaxInNewslettersNewsletterReactionsMixin").parseNewsletterReactionsMixin(a),e=d("WASmaxInNewslettersNewsletterViewsCountMixin").parseNewsletterViewsCountMixin(a);a=d("WASmaxInNewslettersNewsletterPollVotesMixin").parseNewsletterPollVotesMixin(a);return d("WAResultOrError").makeResult(babelHelpers["extends"]({},b.value,{newsletterReactionsMixin:c.success?c.value:null,newsletterViewsCountMixin:e.success?e.value:null,newsletterPollVotesMixin:a.success?a.value:null}))}g.parseNewsletterMessageHistoryWithAddOnsMixin=a}),98); __d("WASmaxInNewslettersNewsletterMessageResponsePayloadMixin",["WAResultOrError","WASmaxInNewslettersNewsletterMessageHistoryWithAddOnsMixin","WASmaxParseJid","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function h(a){var b=d("WASmaxParseUtils").assertTag(a,"message");if(!b.success)return b;b=d("WASmaxInNewslettersNewsletterMessageHistoryWithAddOnsMixin").parseNewsletterMessageHistoryWithAddOnsMixin(a);return!b.success?b:b}function a(a){var b=d("WASmaxParseUtils").assertTag(a,"messages");if(!b.success)return b;b=d("WASmaxParseUtils").optional(d("WASmaxParseJid").attrNewsletterJid,a,"jid");if(!b.success)return b;var c=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrIntRange,a,"t",0,void 0);if(!c.success)return c;a=d("WASmaxParseUtils").mapChildrenWithTag(a,"message",0,300,h);return!a.success?a:d("WAResultOrError").makeResult({jid:b.value,t:c.value,message:a.value})}g.parseNewsletterMessageResponsePayloadMessage=h;g.parseNewsletterMessageResponsePayloadMixin=a}),98); __d("WASmaxInNewslettersGetNewsletterMessageUpdatesResponseSuccess",["WAResultOrError","WASmaxInNewslettersIQResultResponseMixin","WASmaxInNewslettersNewsletterMessageResponsePayloadMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"message_updates");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(c.value,"messages");if(!c.success)return c;c=d("WASmaxInNewslettersNewsletterMessageResponsePayloadMixin").parseNewsletterMessageResponsePayloadMixin(c.value);if(!c.success)return c;a=d("WASmaxInNewslettersIQResultResponseMixin").parseIQResultResponseMixin(a,b);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({messageUpdatesMessagesNewsletterMessageResponsePayloadMixin:c.value},a.value))}g.parseGetNewsletterMessageUpdatesResponseSuccess=a}),98); __d("WASmaxInNewslettersIQErrorNotAllowedMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","not-allowed");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",405);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorNotAllowedMixin=a}),98); __d("WASmaxInNewslettersNotAllowedIQErrorResponseMixin",["WAResultOrError","WASmaxInNewslettersIQErrorNotAllowedMixin","WASmaxInNewslettersIQErrorResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"error");if(!c.success)return c;c=d("WASmaxInNewslettersIQErrorNotAllowedMixin").parseIQErrorNotAllowedMixin(c.value);if(!c.success)return c;a=d("WASmaxInNewslettersIQErrorResponseMixin").parseIQErrorResponseMixin(a,b);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({errorIQErrorNotAllowedMixin:c.value},a.value))}g.parseNotAllowedIQErrorResponseMixin=a}),98); __d("WASmaxInNewslettersGetNewsletterMessagesClientErrors",["WAResultOrError","WASmaxInNewslettersBadRequestIQErrorResponseMixin","WASmaxInNewslettersItemNotFoundIQErrorResponseMixin","WASmaxInNewslettersNotAllowedIQErrorResponseMixin","WASmaxInNewslettersRateLimitedIQErrorResponseMixin","WASmaxInNewslettersSuspendedIQErrorResponseMixin","WASmaxInNewslettersUnavailableForLegalReasonsResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxInNewslettersBadRequestIQErrorResponseMixin").parseBadRequestIQErrorResponseMixin(a,b);if(c.success)return d("WAResultOrError").makeResult({name:"BadRequestIQErrorResponse",value:c.value});var e=d("WASmaxInNewslettersUnavailableForLegalReasonsResponseMixin").parseUnavailableForLegalReasonsResponseMixin(a,b);if(e.success)return d("WAResultOrError").makeResult({name:"UnavailableForLegalReasonsResponse",value:e.value});var f=d("WASmaxInNewslettersItemNotFoundIQErrorResponseMixin").parseItemNotFoundIQErrorResponseMixin(a,b);if(f.success)return d("WAResultOrError").makeResult({name:"ItemNotFoundIQErrorResponse",value:f.value});var g=d("WASmaxInNewslettersSuspendedIQErrorResponseMixin").parseSuspendedIQErrorResponseMixin(a,b);if(g.success)return d("WAResultOrError").makeResult({name:"SuspendedIQErrorResponse",value:g.value});var h=d("WASmaxInNewslettersRateLimitedIQErrorResponseMixin").parseRateLimitedIQErrorResponseMixin(a,b);if(h.success)return d("WAResultOrError").makeResult({name:"RateLimitedIQErrorResponse",value:h.value});b=d("WASmaxInNewslettersNotAllowedIQErrorResponseMixin").parseNotAllowedIQErrorResponseMixin(a,b);return b.success?d("WAResultOrError").makeResult({name:"NotAllowedIQErrorResponse",value:b.value}):d("WASmaxParseUtils").errorMixinDisjunction(a,["BadRequestIQErrorResponse","UnavailableForLegalReasonsResponse","ItemNotFoundIQErrorResponse","SuspendedIQErrorResponse","RateLimitedIQErrorResponse","NotAllowedIQErrorResponse"],[c,e,f,g,h,b])}g.parseGetNewsletterMessagesClientErrors=a}),98); __d("WASmaxInNewslettersGetNewsletterMessagesResponseClientError",["WAResultOrError","WASmaxInNewslettersGetNewsletterMessagesClientErrors","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxInNewslettersGetNewsletterMessagesClientErrors").parseGetNewsletterMessagesClientErrors(a,b);return!c.success?c:d("WAResultOrError").makeResult({getNewsletterMessagesClientErrors:c.value})}g.parseGetNewsletterMessagesResponseClientError=a}),98); __d("WASmaxInNewslettersGetNewsletterMessagesResponseServerError",["WAResultOrError","WASmaxInNewslettersIQErrorInternalServerErrorMixin","WASmaxParseJid","WASmaxParseReference","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"error");if(!c.success)return c;b=d("WASmaxParseReference").attrStringFromReference(b,["id"]);if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"id",b.value);if(!b.success)return b;b=d("WASmaxParseJid").literalJid(d("WASmaxParseJid").attrDomainJid,a,"from","s.whatsapp.net");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","error");if(!a.success)return a;c=d("WASmaxInNewslettersIQErrorInternalServerErrorMixin").parseIQErrorInternalServerErrorMixin(c.value);return!c.success?c:d("WAResultOrError").makeResult({from:b.value,type:a.value,errorIQErrorInternalServerErrorMixin:c.value})}g.parseGetNewsletterMessagesResponseServerError=a}),98); __d("WASmaxInNewslettersGetNewsletterMessagesResponseSuccess",["WAResultOrError","WASmaxInNewslettersNewsletterMessageResponsePayloadMixin","WASmaxParseJid","WASmaxParseReference","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"messages");if(!c.success)return c;b=d("WASmaxParseReference").attrStringFromReference(b,["id"]);if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"id",b.value);if(!b.success)return b;b=d("WASmaxParseJid").literalJid(d("WASmaxParseJid").attrDomainJid,a,"from","s.whatsapp.net");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","result");if(!a.success)return a;c=d("WASmaxInNewslettersNewsletterMessageResponsePayloadMixin").parseNewsletterMessageResponsePayloadMixin(c.value);return!c.success?c:d("WAResultOrError").makeResult({from:b.value,type:a.value,messagesNewsletterMessageResponsePayloadMixin:c.value})}g.parseGetNewsletterMessagesResponseSuccess=a}),98); __d("WASmaxInNewslettersIQErrorNotAuthorizedMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","not-authorized");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",401);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorNotAuthorizedMixin=a}),98); __d("WASmaxInNewslettersLiveUpdatesNotificationRequest",["WAResultOrError","WASmaxInNewslettersCommonNotificationMixin","WASmaxInNewslettersNewsletterMessageResponsePayloadMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"notification");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"live_updates");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(b.value,"messages");if(!b.success)return b;b=d("WASmaxInNewslettersNewsletterMessageResponsePayloadMixin").parseNewsletterMessageResponsePayloadMixin(b.value);if(!b.success)return b;a=d("WASmaxInNewslettersCommonNotificationMixin").parseCommonNotificationMixin(a);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({liveUpdatesMessagesNewsletterMessageResponsePayloadMixin:b.value},a.value))}g.parseLiveUpdatesNotificationRequest=a}),98); __d("WASmaxInNewslettersUnauthorizedIQErrorResponseMixin",["WAResultOrError","WASmaxInNewslettersIQErrorNotAuthorizedMixin","WASmaxInNewslettersIQErrorResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"error");if(!c.success)return c;c=d("WASmaxInNewslettersIQErrorNotAuthorizedMixin").parseIQErrorNotAuthorizedMixin(c.value);if(!c.success)return c;a=d("WASmaxInNewslettersIQErrorResponseMixin").parseIQErrorResponseMixin(a,b);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({errorIQErrorNotAuthorizedMixin:c.value},a.value))}g.parseUnauthorizedIQErrorResponseMixin=a}),98); __d("WASmaxInNewslettersMyAddonsClientErrors",["WAResultOrError","WASmaxInNewslettersBadRequestIQErrorResponseMixin","WASmaxInNewslettersItemNotFoundIQErrorResponseMixin","WASmaxInNewslettersRateLimitedIQErrorResponseMixin","WASmaxInNewslettersUnauthorizedIQErrorResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxInNewslettersBadRequestIQErrorResponseMixin").parseBadRequestIQErrorResponseMixin(a,b);if(c.success)return d("WAResultOrError").makeResult({name:"BadRequestIQErrorResponse",value:c.value});var e=d("WASmaxInNewslettersUnauthorizedIQErrorResponseMixin").parseUnauthorizedIQErrorResponseMixin(a,b);if(e.success)return d("WAResultOrError").makeResult({name:"UnauthorizedIQErrorResponse",value:e.value});var f=d("WASmaxInNewslettersItemNotFoundIQErrorResponseMixin").parseItemNotFoundIQErrorResponseMixin(a,b);if(f.success)return d("WAResultOrError").makeResult({name:"ItemNotFoundIQErrorResponse",value:f.value});b=d("WASmaxInNewslettersRateLimitedIQErrorResponseMixin").parseRateLimitedIQErrorResponseMixin(a,b);return b.success?d("WAResultOrError").makeResult({name:"RateLimitedIQErrorResponse",value:b.value}):d("WASmaxParseUtils").errorMixinDisjunction(a,["BadRequestIQErrorResponse","UnauthorizedIQErrorResponse","ItemNotFoundIQErrorResponse","RateLimitedIQErrorResponse"],[c,e,f,b])}g.parseMyAddonsClientErrors=a}),98); __d("WASmaxInNewslettersMyAddOnsResponseClientError",["WAResultOrError","WASmaxInNewslettersMyAddonsClientErrors","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxInNewslettersMyAddonsClientErrors").parseMyAddonsClientErrors(a,b);return!c.success?c:d("WAResultOrError").makeResult({myAddonsClientErrors:c.value})}g.parseMyAddOnsResponseClientError=a}),98); __d("WASmaxInNewslettersMyAddOnsResponseServerError",["WASmaxInNewslettersInternalServerErrorIQErrorResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxInNewslettersInternalServerErrorIQErrorResponseMixin").parseInternalServerErrorIQErrorResponseMixin(a,b);return!c.success?c:c}g.parseMyAddOnsResponseServerError=a}),98); __d("WASmaxInNewslettersNewsletterMyPollVoteMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function h(a){var b=d("WASmaxParseUtils").assertTag(a,"vote");if(!b.success)return b;b=d("WASmaxParseUtils").contentBytesRange(a,32,32);return!b.success?b:d("WAResultOrError").makeResult({elementValue:b.value})}function a(a){var b=d("WASmaxParseUtils").assertTag(a,"message");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"votes");if(!b.success)return b;a=d("WASmaxParseUtils").attrIntRange(b.value,"t",0,void 0);if(!a.success)return a;b=d("WASmaxParseUtils").mapChildrenWithTag(b.value,"vote",0,1e3,h);return!b.success?b:d("WAResultOrError").makeResult({votesT:a.value,votesVote:b.value})}g.parseNewsletterMyPollVoteVotesVote=h;g.parseNewsletterMyPollVoteMixin=a}),98); __d("WASmaxInNewslettersNewsletterMyReactionMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"message");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"reaction");if(!b.success)return b;a=d("WASmaxParseUtils").attrString(b.value,"code");if(!a.success)return a;b=d("WASmaxParseUtils").attrIntRange(b.value,"t",0,void 0);return!b.success?b:d("WAResultOrError").makeResult({reactionCode:a.value,reactionT:b.value})}g.parseNewsletterMyReactionMixin=a}),98); __d("WASmaxInNewslettersNewsletterMessageMyAddOnsMixin",["WAResultOrError","WASmaxInNewslettersNewsletterMyPollVoteMixin","WASmaxInNewslettersNewsletterMyReactionMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"message");if(!b.success)return b;b=d("WASmaxParseUtils").attrIntRange(a,"server_id",99,2147476647);if(!b.success)return b;var c=d("WASmaxInNewslettersNewsletterMyReactionMixin").parseNewsletterMyReactionMixin(a);a=d("WASmaxInNewslettersNewsletterMyPollVoteMixin").parseNewsletterMyPollVoteMixin(a);return d("WAResultOrError").makeResult({serverId:b.value,newsletterMyReactionMixin:c.success?c.value:null,newsletterMyPollVoteMixin:a.success?a.value:null})}g.parseNewsletterMessageMyAddOnsMixin=a}),98); __d("WASmaxInNewslettersMyAddOnsResponseSuccess",["WAResultOrError","WASmaxInNewslettersIQResultResponseMixin","WASmaxInNewslettersNewsletterMessageMyAddOnsMixin","WASmaxParseJid","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function h(a){var b=d("WASmaxParseUtils").assertTag(a,"message");if(!b.success)return b;b=d("WASmaxInNewslettersNewsletterMessageMyAddOnsMixin").parseNewsletterMessageMyAddOnsMixin(a);return!b.success?b:b}function i(a){var b=d("WASmaxParseUtils").assertTag(a,"messages");if(!b.success)return b;b=d("WASmaxParseJid").attrNewsletterJid(a,"jid");if(!b.success)return b;a=d("WASmaxParseUtils").mapChildrenWithTag(a,"message",0,5e3,h);return!a.success?a:d("WAResultOrError").makeResult({jid:b.value,message:a.value})}function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"my_addons");if(!c.success)return c;a=d("WASmaxInNewslettersIQResultResponseMixin").parseIQResultResponseMixin(a,b);if(!a.success)return a;b=d("WASmaxParseUtils").mapChildrenWithTag(c.value,"messages",0,5e3,i);return!b.success?b:d("WAResultOrError").makeResult(babelHelpers["extends"]({},a.value,{myAddonsMessages:b.value}))}g.parseMyAddOnsResponseSuccessMyAddonsMessagesMessage=h;g.parseMyAddOnsResponseSuccessMyAddonsMessages=i;g.parseMyAddOnsResponseSuccess=a}),98); __d("WASmaxInPreKeysFetchMissingPreKeysResponseRequestError",["WAResultOrError","WASmaxInPreKeysIQErrorResponseMixin","WASmaxInPreKeysRequestErrorsFetch","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"error");if(!c.success)return c;a=d("WASmaxInPreKeysIQErrorResponseMixin").parseIQErrorResponseMixin(a,b);if(!a.success)return a;b=d("WASmaxInPreKeysRequestErrorsFetch").parseRequestErrorsFetch(c.value);return!b.success?b:d("WAResultOrError").makeResult(babelHelpers["extends"]({},a.value,{errorRequestErrorsFetch:b.value}))}g.parseFetchMissingPreKeysResponseRequestError=a}),98); __d("WASmaxInPreKeysFetchMissingPreKeysResponseServerError",["WAResultOrError","WASmaxInPreKeysIQErrorResponseMixin","WASmaxInPreKeysServerErrors","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"error");if(!c.success)return c;a=d("WASmaxInPreKeysIQErrorResponseMixin").parseIQErrorResponseMixin(a,b);if(!a.success)return a;b=d("WASmaxInPreKeysServerErrors").parseServerErrors(c.value);return!b.success?b:d("WAResultOrError").makeResult(babelHelpers["extends"]({},a.value,{errorServerErrors:b.value}))}g.parseFetchMissingPreKeysResponseServerError=a}),98); __d("WASmaxInPreKeysFetchMissingPreKeysUserErrorFallbackMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"user");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"error");if(!b.success)return b;a=d("WASmaxParseUtils").attrString(b.value,"text");if(!a.success)return a;b=d("WASmaxParseUtils").attrIntRange(b.value,"code",500,599);return!b.success?b:d("WAResultOrError").makeResult({errorText:a.value,errorCode:b.value})}g.parseFetchMissingPreKeysUserErrorFallbackMixin=a}),98); __d("WASmaxInPreKeysFetchMissingPreKeysUserErrorMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"user");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"error");if(!b.success)return b;a=d("WASmaxParseUtils").attrString(b.value,"text");if(!a.success)return a;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,b.value,"code",500);return!b.success?b:d("WAResultOrError").makeResult({errorText:a.value,errorCode:b.value})}g.parseFetchMissingPreKeysUserErrorMixin=a}),98); __d("WASmaxInPreKeysFetchMissingPreKeysUserSuccessMixin",["WAResultOrError","WASmaxInPreKeysDeviceIdentityMixin","WASmaxInPreKeysEnums","WASmaxInPreKeysIdentityKeyMixin","WASmaxInPreKeysKeyTypeMixin","WASmaxInPreKeysPreKeyMixin","WASmaxInPreKeysRegistrationIDMixin","WASmaxInPreKeysSignedPreKeyMixin","WASmaxParseJid","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function h(a){var b=d("WASmaxParseUtils").assertTag(a,"device");if(!b.success)return b;b=d("WASmaxParseUtils").attrIntRange(a,"id",0,99);if(!b.success)return b;var c=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrIntRange,a,"t",0,void 0);if(!c.success)return c;var e=d("WASmaxParseUtils").optionalLiteral(d("WASmaxParseUtils").attrString,a,"is_cloud_api","true");if(!e.success)return e;var f=d("WASmaxInPreKeysRegistrationIDMixin").parseRegistrationIDMixin(a);if(!f.success)return f;var g=d("WASmaxInPreKeysKeyTypeMixin").parseKeyTypeMixin(a),h=d("WASmaxInPreKeysIdentityKeyMixin").parseIdentityKeyMixin(a);if(!h.success)return h;var i=d("WASmaxInPreKeysPreKeyMixin").parsePreKeyMixin(a),j=d("WASmaxInPreKeysSignedPreKeyMixin").parseSignedPreKeyMixin(a);if(!j.success)return j;a=d("WASmaxInPreKeysDeviceIdentityMixin").parseDeviceIdentityMixin(a);return d("WAResultOrError").makeResult(babelHelpers["extends"]({id:b.value,t:c.value,isCloudApi:e.value},f.value,{keyTypeMixin:g.success?g.value:null},h.value,{preKeyMixin:i.success?i.value:null},j.value,{deviceIdentityMixin:a.success?a.value:null}))}function a(a){var b=d("WASmaxParseUtils").assertTag(a,"user");if(!b.success)return b;b=d("WASmaxParseJid").attrJidEnum(a,"jid",d("WASmaxInPreKeysEnums").USERJID_USERJID);if(!b.success)return b;a=d("WASmaxParseUtils").mapChildrenWithTag(a,"device",1,100,h);return!a.success?a:d("WAResultOrError").makeResult({jid:b.value,device:a.value})}g.parseFetchMissingPreKeysUserSuccessDevice=h;g.parseFetchMissingPreKeysUserSuccessMixin=a}),98); __d("WASmaxInPreKeysUserFetchMissingPreKeysSuccessOrFetchMissingPreKeysErrorOrFetchMissingPreKeysErrorFallbackMixinGroup",["WAResultOrError","WASmaxInPreKeysFetchMissingPreKeysUserErrorFallbackMixin","WASmaxInPreKeysFetchMissingPreKeysUserErrorMixin","WASmaxInPreKeysFetchMissingPreKeysUserSuccessMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxInPreKeysFetchMissingPreKeysUserSuccessMixin").parseFetchMissingPreKeysUserSuccessMixin(a);if(b.success)return d("WAResultOrError").makeResult({name:"FetchMissingPreKeysUserSuccess",value:b.value});var c=d("WASmaxInPreKeysFetchMissingPreKeysUserErrorMixin").parseFetchMissingPreKeysUserErrorMixin(a);if(c.success)return d("WAResultOrError").makeResult({name:"FetchMissingPreKeysUserError",value:c.value});var e=d("WASmaxInPreKeysFetchMissingPreKeysUserErrorFallbackMixin").parseFetchMissingPreKeysUserErrorFallbackMixin(a);return e.success?d("WAResultOrError").makeResult({name:"FetchMissingPreKeysUserErrorFallback",value:e.value}):d("WASmaxParseUtils").errorMixinDisjunction(a,["UserSuccess","UserError","UserErrorFallback"],[b,c,e])}g.parseUserFetchMissingPreKeysSuccessOrFetchMissingPreKeysErrorOrFetchMissingPreKeysErrorFallbackMixinGroup=a}),98); __d("WASmaxInPreKeysFetchMissingPreKeysResponseSuccess",["WAResultOrError","WASmaxInPreKeysEnums","WASmaxInPreKeysIQResultResponseMixin","WASmaxInPreKeysResponsePaddingMixin","WASmaxInPreKeysUserFetchMissingPreKeysSuccessOrFetchMissingPreKeysErrorOrFetchMissingPreKeysErrorFallbackMixinGroup","WASmaxParseJid","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function h(a){var b=d("WASmaxParseUtils").assertTag(a,"user");if(!b.success)return b;b=d("WASmaxParseJid").attrJidEnum(a,"jid",d("WASmaxInPreKeysEnums").USERJID_USERJID);if(!b.success)return b;a=d("WASmaxInPreKeysUserFetchMissingPreKeysSuccessOrFetchMissingPreKeysErrorOrFetchMissingPreKeysErrorFallbackMixinGroup").parseUserFetchMissingPreKeysSuccessOrFetchMissingPreKeysErrorOrFetchMissingPreKeysErrorFallbackMixinGroup(a);return!a.success?a:d("WAResultOrError").makeResult({jid:b.value,userFetchMissingPreKeysSuccessOrFetchMissingPreKeysErrorOrFetchMissingPreKeysErrorFallbackMixinGroup:a.value})}function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"list");if(!c.success)return c;b=d("WASmaxInPreKeysIQResultResponseMixin").parseIQResultResponseMixin(a,b);if(!b.success)return b;a=d("WASmaxInPreKeysResponsePaddingMixin").parseResponsePaddingMixin(a);c=d("WASmaxParseUtils").mapChildrenWithTag(c.value,"user",0,1e5,h);return!c.success?c:d("WAResultOrError").makeResult(babelHelpers["extends"]({},b.value,{responsePaddingMixin:a.success?a.value:null,listUser:c.value}))}g.parseFetchMissingPreKeysResponseSuccessListUser=h;g.parseFetchMissingPreKeysResponseSuccess=a}),98); __d("WASmaxInPresenceEnums",["WAJids"],(function(a,b,c,d,e,f,g){a={deny:"deny",error:"error",none:"none"};b={validators:[d("WAJids").validateGroupJid,d("WAJids").validateUserJid],typeName:"GroupJid|UserJid"};g.ENUM_DENY_ERROR_NONE=a;g.GROUPJID_USERJID=b}),98); __d("WASmaxInPresenceAvailableMixin",["WAResultOrError","WASmaxInPresenceEnums","WASmaxParseJid","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"presence");if(!b.success)return b;b=d("WASmaxParseJid").attrJidEnum(a,"from",d("WASmaxInPresenceEnums").GROUPJID_USERJID);if(!b.success)return b;var c=d("WASmaxParseUtils").optionalLiteral(d("WASmaxParseUtils").attrString,a,"type","available");if(!c.success)return c;a=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrString,a,"last");return!a.success?a:d("WAResultOrError").makeResult({from:b.value,type:c.value,last:a.value})}g.parseAvailableMixin=a}),98); __d("WASmaxInPresenceGroupAvailableMixin",["WAResultOrError","WASmaxParseJid","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"presence");if(!b.success)return b;b=d("WASmaxParseJid").attrGroupJid(a,"from");if(!b.success)return b;a=d("WASmaxParseUtils").attrIntRange(a,"count",1,1024);return!a.success?a:d("WAResultOrError").makeResult({from:b.value,count:a.value})}g.parseGroupAvailableMixin=a}),98); __d("WASmaxInPresenceGroupUnavailableMixin",["WAResultOrError","WASmaxParseJid","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"presence");if(!b.success)return b;b=d("WASmaxParseJid").attrGroupJid(a,"from");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","unavailable");return!a.success?a:d("WAResultOrError").makeResult({from:b.value,type:a.value})}g.parseGroupUnavailableMixin=a}),98); __d("WASmaxInPresenceLastSeenWithOtherValueMixin",["WAResultOrError","WASmaxInPresenceEnums","WASmaxParseJid","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"presence");if(!b.success)return b;b=d("WASmaxParseJid").attrUserJid(a,"from");if(!b.success)return b;var c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","unavailable");if(!c.success)return c;a=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrStringEnum,a,"last",d("WASmaxInPresenceEnums").ENUM_DENY_ERROR_NONE);return!a.success?a:d("WAResultOrError").makeResult({from:b.value,type:c.value,last:a.value})}g.parseLastSeenWithOtherValueMixin=a}),98); __d("WASmaxInPresenceUserUnavailableMixin",["WAResultOrError","WASmaxParseJid","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"presence");if(!b.success)return b;b=d("WASmaxParseJid").attrUserJid(a,"from");if(!b.success)return b;var c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","unavailable");if(!c.success)return c;a=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrString,a,"last");return!a.success?a:d("WAResultOrError").makeResult({from:b.value,type:c.value,last:a.value})}g.parseUserUnavailableMixin=a}),98); __d("WASmaxInPresencePresenceUpdates",["WAResultOrError","WASmaxInPresenceAvailableMixin","WASmaxInPresenceGroupAvailableMixin","WASmaxInPresenceGroupUnavailableMixin","WASmaxInPresenceLastSeenWithOtherValueMixin","WASmaxInPresenceUserUnavailableMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxInPresenceGroupAvailableMixin").parseGroupAvailableMixin(a);if(b.success)return d("WAResultOrError").makeResult({name:"GroupAvailable",value:b.value});var c=d("WASmaxInPresenceGroupUnavailableMixin").parseGroupUnavailableMixin(a);if(c.success)return d("WAResultOrError").makeResult({name:"GroupUnavailable",value:c.value});var e=d("WASmaxInPresenceLastSeenWithOtherValueMixin").parseLastSeenWithOtherValueMixin(a);if(e.success)return d("WAResultOrError").makeResult({name:"LastSeenWithOtherValue",value:e.value});var f=d("WASmaxInPresenceUserUnavailableMixin").parseUserUnavailableMixin(a);if(f.success)return d("WAResultOrError").makeResult({name:"UserUnavailable",value:f.value});var g=d("WASmaxInPresenceAvailableMixin").parseAvailableMixin(a);return g.success?d("WAResultOrError").makeResult({name:"Available",value:g.value}):d("WASmaxParseUtils").errorMixinDisjunction(a,["GroupAvailable","GroupUnavailable","LastSeenWithOtherValue","UserUnavailable","Available"],[b,c,e,f,g])}g.parsePresenceUpdates=a}),98); __d("WASmaxInPresenceServerUpdateRequest",["WAResultOrError","WASmaxInPresencePresenceUpdates","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"presence");if(!b.success)return b;b=d("WASmaxInPresencePresenceUpdates").parsePresenceUpdates(a);return!b.success?b:d("WAResultOrError").makeResult({presenceUpdates:b.value})}g.parseServerUpdateRequest=a}),98); __d("WASmaxInProfilePictureEnums",["WAJids"],(function(a,b,c,d,e,f,g){a={"false":"false","true":"true"};b={image:"image",preview:"preview"};c={lid:"lid",pn:"pn"};f={validators:[(e=d("WAJids")).validateDomainJid,e.validateGroupJid,e.validateUserJid,e.validateUserJid],typeName:"DomainJid|GroupJid|UserJid|UserJid"};d={validators:[e.validateGroupJid,e.validateUserJid],typeName:"GroupJid|UserJid"};e={validators:[e.validateUserJid,e.validateUserJid],typeName:"UserJid|UserJid"};g.ENUM_FALSE_TRUE=a;g.ENUM_IMAGE_PREVIEW=b;g.ENUM_LID_PN=c;g.DOMAINJID_GROUPJID_USERJID_USERJID=f;g.GROUPJID_USERJID=d;g.USERJID_USERJID=e}),98); __d("WASmaxInProfilePictureIQErrorResponseMixin",["WAResultOrError","WASmaxParseReference","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["id"]);if(!c.success)return c;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"id",c.value);if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["to"]);if(!c.success)return c;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"from",c.value);if(!b.success)return b;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","error");return!c.success?c:d("WAResultOrError").makeResult({type:c.value})}g.parseIQErrorResponseMixin=a}),98); __d("WASmaxInProfilePictureIQErrorBadRequestMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","bad-request");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",400);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorBadRequestMixin=a}),98); __d("WASmaxInProfilePictureIQErrorFeatureNotImplementedMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","feature-not-implemented");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",501);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorFeatureNotImplementedMixin=a}),98); __d("WASmaxInProfilePictureIQErrorInternalServerErrorMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","internal-server-error");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",500);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorInternalServerErrorMixin=a}),98); __d("WASmaxInProfilePictureIQErrorItemNotFoundMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","item-not-found");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",404);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorItemNotFoundMixin=a}),98); __d("WASmaxInProfilePictureIQErrorNotAuthorizedMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","not-authorized");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",401);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorNotAuthorizedMixin=a}),98); __d("WASmaxInProfilePictureIQErrorRateOverlimitMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","rate-overlimit");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",429);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorRateOverlimitMixin=a}),98); __d("WASmaxInProfilePictureIQErrorServiceUnavailableMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","service-unavailable");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",503);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorServiceUnavailableMixin=a}),98); __d("WASmaxInProfilePictureProfilePictureGetErrors",["WAResultOrError","WASmaxInProfilePictureIQErrorBadRequestMixin","WASmaxInProfilePictureIQErrorFeatureNotImplementedMixin","WASmaxInProfilePictureIQErrorInternalServerErrorMixin","WASmaxInProfilePictureIQErrorItemNotFoundMixin","WASmaxInProfilePictureIQErrorNotAuthorizedMixin","WASmaxInProfilePictureIQErrorRateOverlimitMixin","WASmaxInProfilePictureIQErrorServiceUnavailableMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxInProfilePictureIQErrorBadRequestMixin").parseIQErrorBadRequestMixin(a);if(b.success)return d("WAResultOrError").makeResult({name:"IQErrorBadRequest",value:b.value});var c=d("WASmaxInProfilePictureIQErrorNotAuthorizedMixin").parseIQErrorNotAuthorizedMixin(a);if(c.success)return d("WAResultOrError").makeResult({name:"IQErrorNotAuthorized",value:c.value});var e=d("WASmaxInProfilePictureIQErrorItemNotFoundMixin").parseIQErrorItemNotFoundMixin(a);if(e.success)return d("WAResultOrError").makeResult({name:"IQErrorItemNotFound",value:e.value});var f=d("WASmaxInProfilePictureIQErrorRateOverlimitMixin").parseIQErrorRateOverlimitMixin(a);if(f.success)return d("WAResultOrError").makeResult({name:"IQErrorRateOverlimit",value:f.value});var g=d("WASmaxInProfilePictureIQErrorInternalServerErrorMixin").parseIQErrorInternalServerErrorMixin(a);if(g.success)return d("WAResultOrError").makeResult({name:"IQErrorInternalServerError",value:g.value});var h=d("WASmaxInProfilePictureIQErrorFeatureNotImplementedMixin").parseIQErrorFeatureNotImplementedMixin(a);if(h.success)return d("WAResultOrError").makeResult({name:"IQErrorFeatureNotImplemented",value:h.value});var i=d("WASmaxInProfilePictureIQErrorServiceUnavailableMixin").parseIQErrorServiceUnavailableMixin(a);return i.success?d("WAResultOrError").makeResult({name:"IQErrorServiceUnavailable",value:i.value}):d("WASmaxParseUtils").errorMixinDisjunction(a,["IQErrorBadRequest","IQErrorNotAuthorized","IQErrorItemNotFound","IQErrorRateOverlimit","IQErrorInternalServerError","IQErrorFeatureNotImplemented","IQErrorServiceUnavailable"],[b,c,e,f,g,h,i])}g.parseProfilePictureGetErrors=a}),98); __d("WASmaxInProfilePictureGetResponseError",["WAResultOrError","WASmaxInProfilePictureIQErrorResponseMixin","WASmaxInProfilePictureProfilePictureGetErrors","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"error");if(!c.success)return c;a=d("WASmaxInProfilePictureIQErrorResponseMixin").parseIQErrorResponseMixin(a,b);if(!a.success)return a;b=d("WASmaxInProfilePictureProfilePictureGetErrors").parseProfilePictureGetErrors(c.value);return!b.success?b:d("WAResultOrError").makeResult(babelHelpers["extends"]({},a.value,{errorProfilePictureGetErrors:b.value}))}g.parseGetResponseError=a}),98); __d("WASmaxInProfilePictureIQResultResponseMixin",["WAResultOrError","WASmaxParseReference","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["id"]);if(!c.success)return c;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"id",c.value);if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["to"]);if(!c.success)return c;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"from",c.value);if(!b.success)return b;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","result");return!c.success?c:d("WAResultOrError").makeResult({type:c.value})}g.parseIQResultResponseMixin=a}),98); __d("WASmaxInProfilePictureGetResponseSuccessAvatarURLs",["WAResultOrError","WASmaxInProfilePictureIQResultResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function h(a){var b=d("WASmaxParseUtils").assertTag(a,"avatar");if(!b.success)return b;b=d("WASmaxParseUtils").attrString(a,"url");if(!b.success)return b;var c=d("WASmaxParseUtils").attrString(a,"pose_id");if(!c.success)return c;a=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrString,a,"hash");return!a.success?a:d("WAResultOrError").makeResult({url:b.value,poseId:c.value,hash:a.value})}function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxInProfilePictureIQResultResponseMixin").parseIQResultResponseMixin(a,b);if(!c.success)return c;b=d("WASmaxParseUtils").mapChildrenWithTag(a,"avatar",1,4,h);return!b.success?b:d("WAResultOrError").makeResult(babelHelpers["extends"]({},c.value,{avatar:b.value}))}g.parseGetResponseSuccessAvatarURLsAvatar=h;g.parseGetResponseSuccessAvatarURLs=a}),98); __d("WASmaxInProfilePictureGetResponseSuccessNoData",["WASmaxInProfilePictureIQResultResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxInProfilePictureIQResultResponseMixin").parseIQResultResponseMixin(a,b);return!c.success?c:c}g.parseGetResponseSuccessNoData=a}),98); __d("WASmaxInProfilePictureGetResponseSuccessPictureBlob",["WAResultOrError","WASmaxInProfilePictureEnums","WASmaxInProfilePictureIQResultResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"picture");if(!c.success)return c;var e=d("WASmaxParseUtils").attrString(c.value,"id");if(!e.success)return e;var f=d("WASmaxParseUtils").attrStringEnum(c.value,"type",d("WASmaxInProfilePictureEnums").ENUM_IMAGE_PREVIEW);if(!f.success)return f;var g=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrStringEnum,c.value,"has_staging",d("WASmaxInProfilePictureEnums").ENUM_FALSE_TRUE);if(!g.success)return g;c=d("WASmaxParseUtils").contentBytesRange(c.value,1,void 0);if(!c.success)return c;a=d("WASmaxInProfilePictureIQResultResponseMixin").parseIQResultResponseMixin(a,b);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({pictureId:e.value,pictureType:f.value,pictureHasStaging:g.value,pictureElementValue:c.value},a.value))}g.parseGetResponseSuccessPictureBlob=a}),98); __d("WASmaxInProfilePictureGetResponseSuccessPictureURL",["WAResultOrError","WASmaxInProfilePictureEnums","WASmaxInProfilePictureIQResultResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"picture");if(!c.success)return c;var e=d("WASmaxParseUtils").attrString(c.value,"id");if(!e.success)return e;var f=d("WASmaxParseUtils").attrStringEnum(c.value,"type",d("WASmaxInProfilePictureEnums").ENUM_IMAGE_PREVIEW);if(!f.success)return f;var g=d("WASmaxParseUtils").attrString(c.value,"url");if(!g.success)return g;var h=d("WASmaxParseUtils").attrString(c.value,"direct_path");if(!h.success)return h;var i=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrString,c.value,"hash");if(!i.success)return i;c=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrStringEnum,c.value,"has_staging",d("WASmaxInProfilePictureEnums").ENUM_FALSE_TRUE);if(!c.success)return c;a=d("WASmaxInProfilePictureIQResultResponseMixin").parseIQResultResponseMixin(a,b);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({pictureId:e.value,pictureType:f.value,pictureUrl:g.value,pictureDirectPath:h.value,pictureHash:i.value,pictureHasStaging:c.value},a.value))}g.parseGetResponseSuccessPictureURL=a}),98); __d("WASmaxInPsaIQErrorInternalServerErrorMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","internal-server-error");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",500);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorInternalServerErrorMixin=a}),98); __d("WASmaxInPsaIQErrorRateOverlimitMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","rate-overlimit");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",429);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorRateOverlimitMixin=a}),98); __d("WASmaxInPsaIQErrorRequestTimeoutMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","request-timeout");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",408);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorRequestTimeoutMixin=a}),98); __d("WASmaxInPsaIQErrorServiceUnavailableMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","service-unavailable");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",503);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorServiceUnavailableMixin=a}),98); __d("WASmaxInPsaChatBlockError",["WAResultOrError","WASmaxInPsaIQErrorInternalServerErrorMixin","WASmaxInPsaIQErrorRateOverlimitMixin","WASmaxInPsaIQErrorRequestTimeoutMixin","WASmaxInPsaIQErrorServiceUnavailableMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxInPsaIQErrorInternalServerErrorMixin").parseIQErrorInternalServerErrorMixin(a);if(b.success)return d("WAResultOrError").makeResult({name:"IQErrorInternalServerError",value:b.value});var c=d("WASmaxInPsaIQErrorRequestTimeoutMixin").parseIQErrorRequestTimeoutMixin(a);if(c.success)return d("WAResultOrError").makeResult({name:"IQErrorRequestTimeout",value:c.value});var e=d("WASmaxInPsaIQErrorServiceUnavailableMixin").parseIQErrorServiceUnavailableMixin(a);if(e.success)return d("WAResultOrError").makeResult({name:"IQErrorServiceUnavailable",value:e.value});var f=d("WASmaxInPsaIQErrorRateOverlimitMixin").parseIQErrorRateOverlimitMixin(a);return f.success?d("WAResultOrError").makeResult({name:"IQErrorRateOverlimit",value:f.value}):d("WASmaxParseUtils").errorMixinDisjunction(a,["IQErrorInternalServerError","IQErrorRequestTimeout","IQErrorServiceUnavailable","IQErrorRateOverlimit"],[b,c,e,f])}g.parseChatBlockError=a}),98); __d("WASmaxInPsaIQErrorResponseMixin",["WAResultOrError","WASmaxParseReference","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["id"]);if(!c.success)return c;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"id",c.value);if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["to"]);if(!c.success)return c;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"from",c.value);if(!b.success)return b;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","error");return!c.success?c:d("WAResultOrError").makeResult({type:c.value})}g.parseIQErrorResponseMixin=a}),98); __d("WASmaxInPsaChatBlockGetResponseServerError",["WAResultOrError","WASmaxInPsaChatBlockError","WASmaxInPsaIQErrorResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"error");if(!c.success)return c;a=d("WASmaxInPsaIQErrorResponseMixin").parseIQErrorResponseMixin(a,b);if(!a.success)return a;b=d("WASmaxInPsaChatBlockError").parseChatBlockError(c.value);return!b.success?b:d("WAResultOrError").makeResult(babelHelpers["extends"]({},a.value,{errorChatBlockError:b.value}))}g.parseChatBlockGetResponseServerError=a}),98); __d("WASmaxInPsaEnums",["WAJids"],(function(a,b,c,d,e,f,g){a={blocked:"blocked",unblocked:"unblocked"};b={image:"image",video:"video"};c={validators:[d("WAJids").validateStatusJid,d("WAJids").validateUserJid],typeName:"StatusJid|UserJid"};g.ENUM_BLOCKED_UNBLOCKED=a;g.ENUM_IMAGE_VIDEO=b;g.STATUSJID_USERJID=c}),98); __d("WASmaxInPsaIQResultResponseMixin",["WAResultOrError","WASmaxParseReference","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["id"]);if(!c.success)return c;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"id",c.value);if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["to"]);if(!c.success)return c;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"from",c.value);if(!b.success)return b;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","result");return!c.success?c:d("WAResultOrError").makeResult({type:c.value})}g.parseIQResultResponseMixin=a}),98); __d("WASmaxInPsaChatBlockGetResponseSuccess",["WAResultOrError","WASmaxInPsaEnums","WASmaxInPsaIQResultResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"blocking");if(!c.success)return c;c=d("WASmaxParseUtils").attrStringEnum(c.value,"status",d("WASmaxInPsaEnums").ENUM_BLOCKED_UNBLOCKED);if(!c.success)return c;a=d("WASmaxInPsaIQResultResponseMixin").parseIQResultResponseMixin(a,b);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({blockingStatus:c.value},a.value))}g.parseChatBlockGetResponseSuccess=a}),98); __d("WASmaxInPsaChatBlockSetResponseServerError",["WAResultOrError","WASmaxInPsaChatBlockError","WASmaxInPsaIQErrorResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"error");if(!c.success)return c;a=d("WASmaxInPsaIQErrorResponseMixin").parseIQErrorResponseMixin(a,b);if(!a.success)return a;b=d("WASmaxInPsaChatBlockError").parseChatBlockError(c.value);return!b.success?b:d("WAResultOrError").makeResult(babelHelpers["extends"]({},a.value,{errorChatBlockError:b.value}))}g.parseChatBlockSetResponseServerError=a}),98); __d("WASmaxInPsaChatBlockSetResponseSuccess",["WAResultOrError","WASmaxInPsaEnums","WASmaxInPsaIQResultResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"blocking");if(!c.success)return c;c=d("WASmaxParseUtils").attrStringEnum(c.value,"status",d("WASmaxInPsaEnums").ENUM_BLOCKED_UNBLOCKED);if(!c.success)return c;a=d("WASmaxInPsaIQResultResponseMixin").parseIQResultResponseMixin(a,b);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({blockingStatus:c.value},a.value))}g.parseChatBlockSetResponseSuccess=a}),98); __d("WASmaxInPsaServerNotificationMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"notification");if(!b.success)return b;b=d("WASmaxParseUtils").attrIntRange(a,"t",0,void 0);if(!b.success)return b;var c=d("WASmaxParseUtils").attrStanzaId(a,"id");if(!c.success)return c;a=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrIntRange,a,"offline",0,1024);return!a.success?a:d("WAResultOrError").makeResult({t:b.value,id:c.value,offline:a.value})}g.parseServerNotificationMixin=a}),98); __d("WASmaxInPsaResetSmbLastQpPrefetchTimestampRequest",["WAResultOrError","WASmaxInPsaServerNotificationMixin","WASmaxParseJid","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"notification");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"reset_smb_last_qp_prefetch_timestamp");if(!b.success)return b;b=d("WASmaxParseJid").attrUserJid(a,"from");if(!b.success)return b;var c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","psa");if(!c.success)return c;a=d("WASmaxInPsaServerNotificationMixin").parseServerNotificationMixin(a);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({from:b.value,type:c.value},a.value))}g.parseResetSmbLastQpPrefetchTimestampRequest=a}),98); __d("WASmaxInQpSurfacesEnums",[],(function(a,b,c,d,e,f){a={"false":"false","true":"true"};f.ENUM_FALSE_TRUE=a}),66); __d("WASmaxInQpSurfacesQPSurfacesMixin",["WAResultOrError","WASmaxInQpSurfacesEnums","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function h(a){var b=d("WASmaxParseUtils").assertTag(a,"trigger");if(!b.success)return b;b=d("WASmaxParseUtils").attrString(a,"name");return!b.success?b:d("WAResultOrError").makeResult({name:b.value})}function i(a){var b=d("WASmaxParseUtils").assertTag(a,"header");if(!b.success)return b;b=d("WASmaxParseUtils").attrString(a,"title");return!b.success?b:d("WAResultOrError").makeResult({title:b.value})}function j(a){var b=d("WASmaxParseUtils").assertTag(a,"light");if(!b.success)return b;b=d("WASmaxParseUtils").contentBytes(a);return!b.success?b:d("WAResultOrError").makeResult({elementValue:b.value})}function k(a){var b=d("WASmaxParseUtils").assertTag(a,"dark");if(!b.success)return b;b=d("WASmaxParseUtils").contentBytes(a);return!b.success?b:d("WAResultOrError").makeResult({elementValue:b.value})}function l(a){var b=d("WASmaxParseUtils").assertTag(a,"image");if(!b.success)return b;b=d("WASmaxParseUtils").optionalChildWithTag(a,"light",j);if(!b.success)return b;var c=d("WASmaxParseUtils").optionalChildWithTag(a,"dark",k);if(!c.success)return c;a=d("WASmaxParseUtils").attrString(a,"description");return!a.success?a:d("WAResultOrError").makeResult({description:a.value,light:b.value,dark:c.value})}function m(a){var b=d("WASmaxParseUtils").assertTag(a,"primary_action");if(!b.success)return b;b=d("WASmaxParseUtils").attrString(a,"text");if(!b.success)return b;var c=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrString,a,"universal_link");if(!c.success)return c;a=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrString,a,"deep_link");return!a.success?a:d("WAResultOrError").makeResult({text:b.value,universalLink:c.value,deepLink:a.value})}function n(a){var b=d("WASmaxParseUtils").assertTag(a,"secondary_action");if(!b.success)return b;b=d("WASmaxParseUtils").attrString(a,"text");if(!b.success)return b;var c=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrString,a,"universal_link");if(!c.success)return c;a=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrString,a,"deep_link");return!a.success?a:d("WAResultOrError").makeResult({text:b.value,universalLink:c.value,deepLink:a.value})}function o(a){var b=d("WASmaxParseUtils").assertTag(a,"colors");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"light");if(!b.success)return b;a=d("WASmaxParseUtils").flattenedChildWithTag(a,"dark");if(!a.success)return a;var c=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrString,b.value,"background");if(!c.success)return c;b=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrString,b.value,"highlight");if(!b.success)return b;var e=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrString,a.value,"background");if(!e.success)return e;a=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrString,a.value,"highlight");return!a.success?a:d("WAResultOrError").makeResult({lightBackground:c.value,lightHighlight:b.value,darkBackground:e.value,darkHighlight:a.value})}function p(a){var b=d("WASmaxParseUtils").assertTag(a,"attribute");if(!b.success)return b;b=d("WASmaxParseUtils").attrString(a,"key");if(!b.success)return b;a=d("WASmaxParseUtils").attrString(a,"value");return!a.success?a:d("WAResultOrError").makeResult({key:b.value,value:a.value})}function q(a){var b=d("WASmaxParseUtils").assertTag(a,"content_attributes");if(!b.success)return b;b=d("WASmaxParseUtils").mapChildrenWithTag(a,"attribute",0,50,p);return!b.success?b:d("WAResultOrError").makeResult({attribute:b.value})}function r(a){var b=d("WASmaxParseUtils").assertTag(a,"filter_rules");if(!b.success)return b;b=d("WASmaxParseUtils").contentBytes(a);return!b.success?b:d("WAResultOrError").makeResult({elementValue:b.value})}function s(a){var b=d("WASmaxParseUtils").assertTag(a,"instance_log_data");if(!b.success)return b;b=d("WASmaxParseUtils").contentBytes(a);return!b.success?b:d("WAResultOrError").makeResult({elementValue:b.value})}function t(a){var b=d("WASmaxParseUtils").assertTag(a,"promotion_config");if(!b.success)return b;b=d("WASmaxParseUtils").attrInt(a,"max_impressions");if(!b.success)return b;var c=d("WASmaxParseUtils").attrInt(a,"max_primary_clicks");if(!c.success)return c;var e=d("WASmaxParseUtils").attrInt(a,"max_secondary_clicks");if(!e.success)return e;a=d("WASmaxParseUtils").attrInt(a,"max_dismisses");return!a.success?a:d("WAResultOrError").makeResult({maxImpressions:b.value,maxPrimaryClicks:c.value,maxSecondaryClicks:e.value,maxDismisses:a.value})}function u(a){var b=d("WASmaxParseUtils").assertTag(a,"user_info");if(!b.success)return b;b=d("WASmaxParseUtils").attrInt(a,"impression_count");if(!b.success)return b;var c=d("WASmaxParseUtils").attrInt(a,"primary_click_count");if(!c.success)return c;var e=d("WASmaxParseUtils").attrInt(a,"secondary_click_count");if(!e.success)return e;a=d("WASmaxParseUtils").attrInt(a,"dismiss_click_count");return!a.success?a:d("WAResultOrError").makeResult({impressionCount:b.value,primaryClickCount:c.value,secondaryClickCount:e.value,dismissClickCount:a.value})}function v(a){var b=d("WASmaxParseUtils").assertTag(a,"pacing");if(!b.success)return b;b=d("WASmaxParseUtils").optionalChildWithTag(a,"promotion_config",t);if(!b.success)return b;a=d("WASmaxParseUtils").optionalChildWithTag(a,"user_info",u);return!a.success?a:d("WAResultOrError").makeResult({promotionConfig:b.value,userInfo:a.value})}function w(a){var b=d("WASmaxParseUtils").assertTag(a,"promotion");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"title");if(!b.success)return b;var c=d("WASmaxParseUtils").flattenedChildWithTag(a,"text");if(!c.success)return c;var e=d("WASmaxParseUtils").flattenedChildWithTag(a,"qp_config");if(!e.success)return e;var f=d("WASmaxParseUtils").flattenedChildWithTag(e.value,"triggers");if(!f.success)return f;var g=d("WASmaxParseUtils").optionalChildWithTag(a,"header",i);if(!g.success)return g;var j=d("WASmaxParseUtils").optionalChildWithTag(a,"image",l);if(!j.success)return j;var k=d("WASmaxParseUtils").optionalChildWithTag(a,"primary_action",m);if(!k.success)return k;var p=d("WASmaxParseUtils").optionalChildWithTag(a,"secondary_action",n);if(!p.success)return p;var t=d("WASmaxParseUtils").optionalChildWithTag(a,"colors",o);if(!t.success)return t;var u=d("WASmaxParseUtils").optionalChildWithTag(a,"content_attributes",q);if(!u.success)return u;var w=d("WASmaxParseUtils").optionalChildWithTag(e.value,"filter_rules",r);if(!w.success)return w;var x=d("WASmaxParseUtils").optionalChildWithTag(e.value,"instance_log_data",s);if(!x.success)return x;var y=d("WASmaxParseUtils").optionalChildWithTag(e.value,"pacing",v);if(!y.success)return y;var z=d("WASmaxParseUtils").attrString(a,"id");if(!z.success)return z;a=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrString,a,"instance_id");if(!a.success)return a;b=d("WASmaxParseUtils").contentString(b.value);if(!b.success)return b;c=d("WASmaxParseUtils").contentString(c.value);if(!c.success)return c;var A=d("WASmaxParseUtils").attrString(e.value,"template_name");if(!A.success)return A;var B=d("WASmaxParseUtils").attrInt(e.value,"start_time_seconds");if(!B.success)return B;var C=d("WASmaxParseUtils").attrInt(e.value,"end_time_seconds");if(!C.success)return C;var D=d("WASmaxParseUtils").attrInt(e.value,"ttl_seconds");if(!D.success)return D;var E=d("WASmaxParseUtils").attrStringEnum(e.value,"dismissable",d("WASmaxInQpSurfacesEnums").ENUM_FALSE_TRUE);if(!E.success)return E;var F=d("WASmaxParseUtils").attrStringEnum(e.value,"force_pass",d("WASmaxInQpSurfacesEnums").ENUM_FALSE_TRUE);if(!F.success)return F;var G=d("WASmaxParseUtils").attrInt(e.value,"surface_delay_time_seconds");if(!G.success)return G;var H=d("WASmaxParseUtils").attrStringEnum(e.value,"deterministic",d("WASmaxInQpSurfacesEnums").ENUM_FALSE_TRUE);if(!H.success)return H;var I=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrString,e.value,"experiment_key");if(!I.success)return I;var J=d("WASmaxParseUtils").attrStringEnum(e.value,"exposure_holdout",d("WASmaxInQpSurfacesEnums").ENUM_FALSE_TRUE);if(!J.success)return J;var K=d("WASmaxParseUtils").attrInt(e.value,"max_impressions");if(!K.success)return K;var L=d("WASmaxParseUtils").attrInt(e.value,"impression_cooldown");if(!L.success)return L;var M=d("WASmaxParseUtils").attrInt(e.value,"eligibility_duration_ms");if(!M.success)return M;var N=d("WASmaxParseUtils").attrInt(e.value,"priority");if(!N.success)return N;e=d("WASmaxParseUtils").attrStringEnum(e.value,"log_eligibility_waterfall",d("WASmaxInQpSurfacesEnums").ENUM_FALSE_TRUE);if(!e.success)return e;f=d("WASmaxParseUtils").mapChildrenWithTag(f.value,"trigger",1,50,h);return!f.success?f:d("WAResultOrError").makeResult({id:z.value,instanceId:a.value,titleElementValue:b.value,textElementValue:c.value,qpConfigTemplateName:A.value,qpConfigStartTimeSeconds:B.value,qpConfigEndTimeSeconds:C.value,qpConfigTtlSeconds:D.value,qpConfigDismissable:E.value,qpConfigForcePass:F.value,qpConfigSurfaceDelayTimeSeconds:G.value,qpConfigDeterministic:H.value,qpConfigExperimentKey:I.value,qpConfigExposureHoldout:J.value,qpConfigMaxImpressions:K.value,qpConfigImpressionCooldown:L.value,qpConfigEligibilityDurationMs:M.value,qpConfigPriority:N.value,qpConfigLogEligibilityWaterfall:e.value,header:g.value,image:j.value,primaryAction:k.value,secondaryAction:p.value,colors:t.value,contentAttributes:u.value,qpConfigFilterRules:w.value,qpConfigInstanceLogData:x.value,qpConfigPacing:y.value,qpConfigTriggersTrigger:f.value})}function x(a){var b=d("WASmaxParseUtils").assertTag(a,"surface");if(!b.success)return b;b=d("WASmaxParseUtils").attrString(a,"id");if(!b.success)return b;a=d("WASmaxParseUtils").mapChildrenWithTag(a,"promotion",0,100,w);return!a.success?a:d("WAResultOrError").makeResult({id:b.value,promotion:a.value})}function a(a){var b=d("WASmaxParseUtils").assertTag(a,"surfaces");if(!b.success)return b;b=d("WASmaxParseUtils").mapChildrenWithTag(a,"surface",0,100,x);return!b.success?b:d("WAResultOrError").makeResult({surface:b.value})}g.parseQPSurfacesSurfacePromotionQpConfigTriggersTrigger=h;g.parseQPSurfacesSurfacePromotionHeader=i;g.parseQPSurfacesSurfacePromotionImageLight=j;g.parseQPSurfacesSurfacePromotionImageDark=k;g.parseQPSurfacesSurfacePromotionImage=l;g.parseQPSurfacesSurfacePromotionPrimaryAction=m;g.parseQPSurfacesSurfacePromotionSecondaryAction=n;g.parseQPSurfacesSurfacePromotionColors=o;g.parseQPSurfacesSurfacePromotionContentAttributesAttribute=p;g.parseQPSurfacesSurfacePromotionContentAttributes=q;g.parseQPSurfacesSurfacePromotionQpConfigFilterRules=r;g.parseQPSurfacesSurfacePromotionQpConfigInstanceLogData=s;g.parseQPSurfacesSurfacePromotionQpConfigPacingPromotionConfig=t;g.parseQPSurfacesSurfacePromotionQpConfigPacingUserInfo=u;g.parseQPSurfacesSurfacePromotionQpConfigPacing=v;g.parseQPSurfacesSurfacePromotion=w;g.parseQPSurfacesSurface=x;g.parseQPSurfacesMixin=a}),98); __d("WASmaxInQpSurfacesServerNotificationMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"notification");if(!b.success)return b;b=d("WASmaxParseUtils").attrIntRange(a,"t",0,void 0);if(!b.success)return b;var c=d("WASmaxParseUtils").attrStanzaId(a,"id");if(!c.success)return c;a=d("WASmaxParseUtils").optional(d("WASmaxParseUtils").attrIntRange,a,"offline",0,1024);return!a.success?a:d("WAResultOrError").makeResult({t:b.value,id:c.value,offline:a.value})}g.parseServerNotificationMixin=a}),98); __d("WASmaxInQpSurfacesQPNotificationRequest",["WAResultOrError","WASmaxInQpSurfacesQPSurfacesMixin","WASmaxInQpSurfacesServerNotificationMixin","WASmaxParseJid","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"notification");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"surfaces");if(!b.success)return b;var c=d("WASmaxParseJid").attrUserJid(a,"from");if(!c.success)return c;var e=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","psa");if(!e.success)return e;b=d("WASmaxInQpSurfacesQPSurfacesMixin").parseQPSurfacesMixin(b.value);if(!b.success)return b;a=d("WASmaxInQpSurfacesServerNotificationMixin").parseServerNotificationMixin(a);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({from:c.value,type:e.value,surfacesQPSurfacesMixin:b.value},a.value))}g.parseQPNotificationRequest=a}),98); __d("WASmaxInSpamEnums",["WAJids"],(function(a,b,c,d,e,f,g){a={validators:[d("WAJids").validateDomainJid,d("WAJids").validateUserJid],typeName:"DomainJid|UserJid"};g.DOMAINJID_USERJID=a}),98); __d("WASmaxInSpamIQErrorBadRequestMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","bad-request");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",400);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorBadRequestMixin=a}),98); __d("WASmaxInSpamIQErrorForbiddenMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","forbidden");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",403);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorForbiddenMixin=a}),98); __d("WASmaxInSpamIQErrorInternalServerErrorMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","internal-server-error");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",500);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorInternalServerErrorMixin=a}),98); __d("WASmaxInSpamIQErrorRateOverlimitMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","rate-overlimit");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",429);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorRateOverlimitMixin=a}),98); __d("WASmaxInSpamIQErrorReportTokenValidationFailMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").attrString(a,"text");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",548);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorReportTokenValidationFailMixin=a}),98); __d("WASmaxInSpamSpamIqErrors",["WAResultOrError","WASmaxInSpamIQErrorBadRequestMixin","WASmaxInSpamIQErrorForbiddenMixin","WASmaxInSpamIQErrorInternalServerErrorMixin","WASmaxInSpamIQErrorRateOverlimitMixin","WASmaxInSpamIQErrorReportTokenValidationFailMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxInSpamIQErrorInternalServerErrorMixin").parseIQErrorInternalServerErrorMixin(a);if(b.success)return d("WAResultOrError").makeResult({name:"IQErrorInternalServerError",value:b.value});var c=d("WASmaxInSpamIQErrorBadRequestMixin").parseIQErrorBadRequestMixin(a);if(c.success)return d("WAResultOrError").makeResult({name:"IQErrorBadRequest",value:c.value});var e=d("WASmaxInSpamIQErrorForbiddenMixin").parseIQErrorForbiddenMixin(a);if(e.success)return d("WAResultOrError").makeResult({name:"IQErrorForbidden",value:e.value});var f=d("WASmaxInSpamIQErrorRateOverlimitMixin").parseIQErrorRateOverlimitMixin(a);if(f.success)return d("WAResultOrError").makeResult({name:"IQErrorRateOverlimit",value:f.value});var g=d("WASmaxInSpamIQErrorReportTokenValidationFailMixin").parseIQErrorReportTokenValidationFailMixin(a);return g.success?d("WAResultOrError").makeResult({name:"IQErrorReportTokenValidationFail",value:g.value}):d("WASmaxParseUtils").errorMixinDisjunction(a,["IQErrorInternalServerError","IQErrorBadRequest","IQErrorForbidden","IQErrorRateOverlimit","IQErrorReportTokenValidationFail"],[b,c,e,f,g])}g.parseSpamIqErrors=a}),98); __d("WASmaxInSpamGroupReportResponseError",["WAResultOrError","WASmaxInSpamEnums","WASmaxInSpamSpamIqErrors","WASmaxParseJid","WASmaxParseReference","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"error");if(!c.success)return c;b=d("WASmaxParseReference").attrStringFromReference(b,["id"]);if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"id",b.value);if(!b.success)return b;b=d("WASmaxParseUtils").optional(d("WASmaxParseJid").attrJidEnum,a,"from",d("WASmaxInSpamEnums").DOMAINJID_USERJID);if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","error");if(!a.success)return a;c=d("WASmaxInSpamSpamIqErrors").parseSpamIqErrors(c.value);return!c.success?c:d("WAResultOrError").makeResult({from:b.value,type:a.value,errorSpamIqErrors:c.value})}g.parseGroupReportResponseError=a}),98); __d("WASmaxInSpamReportIdMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"iq");if(!b.success)return b;b=d("WASmaxParseUtils").flattenedChildWithTag(a,"report");if(!b.success)return b;a=d("WASmaxParseUtils").attrString(b.value,"id");return!a.success?a:d("WAResultOrError").makeResult({reportId:a.value})}g.parseReportIdMixin=a}),98); __d("WASmaxInSpamGroupReportResponseSuccess",["WAResultOrError","WASmaxInSpamEnums","WASmaxInSpamReportIdMixin","WASmaxParseJid","WASmaxParseReference","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["id"]);if(!c.success)return c;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"id",c.value);if(!b.success)return b;c=d("WASmaxParseUtils").optional(d("WASmaxParseJid").attrJidEnum,a,"from",d("WASmaxInSpamEnums").DOMAINJID_USERJID);if(!c.success)return c;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","result");if(!b.success)return b;a=d("WASmaxInSpamReportIdMixin").parseReportIdMixin(a);return d("WAResultOrError").makeResult({from:c.value,type:b.value,reportIdMixin:a.success?a.value:null})}g.parseGroupReportResponseSuccess=a}),98); __d("WASmaxInSpamIndividualReportResponseError",["WAResultOrError","WASmaxInSpamEnums","WASmaxInSpamSpamIqErrors","WASmaxParseJid","WASmaxParseReference","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"error");if(!c.success)return c;b=d("WASmaxParseReference").attrStringFromReference(b,["id"]);if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"id",b.value);if(!b.success)return b;b=d("WASmaxParseUtils").optional(d("WASmaxParseJid").attrJidEnum,a,"from",d("WASmaxInSpamEnums").DOMAINJID_USERJID);if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","error");if(!a.success)return a;c=d("WASmaxInSpamSpamIqErrors").parseSpamIqErrors(c.value);return!c.success?c:d("WAResultOrError").makeResult({from:b.value,type:a.value,errorSpamIqErrors:c.value})}g.parseIndividualReportResponseError=a}),98); __d("WASmaxInSpamIndividualReportResponseSuccess",["WAResultOrError","WASmaxInSpamEnums","WASmaxInSpamReportIdMixin","WASmaxParseJid","WASmaxParseReference","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["id"]);if(!c.success)return c;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"id",c.value);if(!b.success)return b;c=d("WASmaxParseUtils").optional(d("WASmaxParseJid").attrJidEnum,a,"from",d("WASmaxInSpamEnums").DOMAINJID_USERJID);if(!c.success)return c;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","result");if(!b.success)return b;a=d("WASmaxInSpamReportIdMixin").parseReportIdMixin(a);return d("WAResultOrError").makeResult({from:c.value,type:b.value,reportIdMixin:a.success?a.value:null})}g.parseIndividualReportResponseSuccess=a}),98); __d("WASmaxInSpamNewsletterReportResponseError",["WAResultOrError","WASmaxInSpamEnums","WASmaxInSpamSpamIqErrors","WASmaxParseJid","WASmaxParseReference","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"error");if(!c.success)return c;b=d("WASmaxParseReference").attrStringFromReference(b,["id"]);if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"id",b.value);if(!b.success)return b;b=d("WASmaxParseUtils").optional(d("WASmaxParseJid").attrJidEnum,a,"from",d("WASmaxInSpamEnums").DOMAINJID_USERJID);if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","error");if(!a.success)return a;c=d("WASmaxInSpamSpamIqErrors").parseSpamIqErrors(c.value);return!c.success?c:d("WAResultOrError").makeResult({from:b.value,type:a.value,errorSpamIqErrors:c.value})}g.parseNewsletterReportResponseError=a}),98); __d("WASmaxInSpamNewsletterReportResponseSuccess",["WAResultOrError","WASmaxInSpamEnums","WASmaxInSpamReportIdMixin","WASmaxParseJid","WASmaxParseReference","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["id"]);if(!c.success)return c;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"id",c.value);if(!b.success)return b;c=d("WASmaxParseUtils").optional(d("WASmaxParseJid").attrJidEnum,a,"from",d("WASmaxInSpamEnums").DOMAINJID_USERJID);if(!c.success)return c;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","result");if(!b.success)return b;a=d("WASmaxInSpamReportIdMixin").parseReportIdMixin(a);return d("WAResultOrError").makeResult({from:c.value,type:b.value,reportIdMixin:a.success?a.value:null})}g.parseNewsletterReportResponseSuccess=a}),98); __d("WASmaxInSpamStatusReportResponseError",["WAResultOrError","WASmaxInSpamEnums","WASmaxInSpamSpamIqErrors","WASmaxParseJid","WASmaxParseReference","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"error");if(!c.success)return c;b=d("WASmaxParseReference").attrStringFromReference(b,["id"]);if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"id",b.value);if(!b.success)return b;b=d("WASmaxParseUtils").optional(d("WASmaxParseJid").attrJidEnum,a,"from",d("WASmaxInSpamEnums").DOMAINJID_USERJID);if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","error");if(!a.success)return a;c=d("WASmaxInSpamSpamIqErrors").parseSpamIqErrors(c.value);return!c.success?c:d("WAResultOrError").makeResult({from:b.value,type:a.value,errorSpamIqErrors:c.value})}g.parseStatusReportResponseError=a}),98); __d("WASmaxInSpamStatusReportResponseSuccess",["WAResultOrError","WASmaxInSpamEnums","WASmaxInSpamReportIdMixin","WASmaxParseJid","WASmaxParseReference","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["id"]);if(!c.success)return c;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"id",c.value);if(!b.success)return b;c=d("WASmaxParseUtils").optional(d("WASmaxParseJid").attrJidEnum,a,"from",d("WASmaxInSpamEnums").DOMAINJID_USERJID);if(!c.success)return c;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","result");if(!b.success)return b;a=d("WASmaxInSpamReportIdMixin").parseReportIdMixin(a);return d("WAResultOrError").makeResult({from:c.value,type:b.value,reportIdMixin:a.success?a.value:null})}g.parseStatusReportResponseSuccess=a}),98); __d("WASmaxInStatsIQErrorBadRequestMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","bad-request");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",400);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorBadRequestMixin=a}),98); __d("WASmaxInStatsIQErrorFeatureNotImplementedMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","feature-not-implemented");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",501);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorFeatureNotImplementedMixin=a}),98); __d("WASmaxInStatsIQErrorNotAcceptableMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function h(a){var b=d("WASmaxParseUtils").assertTag(a,"field");if(!b.success)return b;b=d("WASmaxParseUtils").attrString(a,"name");if(!b.success)return b;a=d("WASmaxParseUtils").attrString(a,"reason");return!a.success?a:d("WAResultOrError").makeResult({name:b.value,reason:a.value})}function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").optionalChildWithTag(a,"field",h);if(!b.success)return b;var c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","not-acceptable");if(!c.success)return c;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",406);return!a.success?a:d("WAResultOrError").makeResult({text:c.value,code:a.value,field:b.value})}g.parseIQErrorNotAcceptableField=h;g.parseIQErrorNotAcceptableMixin=a}),98); __d("WASmaxInStatsIQErrorResponseMixin",["WAResultOrError","WASmaxParseReference","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["id"]);if(!c.success)return c;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"id",c.value);if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["to"]);if(!c.success)return c;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"from",c.value);if(!b.success)return b;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","error");return!c.success?c:d("WAResultOrError").makeResult({type:c.value})}g.parseIQErrorResponseMixin=a}),98); __d("WASmaxInStatsIQErrorServiceUnavailableMixin",["WAResultOrError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxParseUtils").assertTag(a,"error");if(!b.success)return b;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"text","service-unavailable");if(!b.success)return b;a=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrInt,a,"code",503);return!a.success?a:d("WAResultOrError").makeResult({text:b.value,code:a.value})}g.parseIQErrorServiceUnavailableMixin=a}),98); __d("WASmaxInStatsIQResultResponseMixin",["WAResultOrError","WASmaxParseReference","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["id"]);if(!c.success)return c;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"id",c.value);if(!c.success)return c;c=d("WASmaxParseReference").attrStringFromReference(b,["to"]);if(!c.success)return c;b=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"from",c.value);if(!b.success)return b;c=d("WASmaxParseUtils").literal(d("WASmaxParseUtils").attrString,a,"type","result");return!c.success?c:d("WAResultOrError").makeResult({type:c.value})}g.parseIQResultResponseMixin=a}),98); __d("WASmaxInStatsSendBufferNoRetryError",["WAResultOrError","WASmaxInStatsIQErrorBadRequestMixin","WASmaxInStatsIQErrorFeatureNotImplementedMixin","WASmaxInStatsIQErrorNotAcceptableMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxInStatsIQErrorBadRequestMixin").parseIQErrorBadRequestMixin(a);if(b.success)return d("WAResultOrError").makeResult({name:"IQErrorBadRequest",value:b.value});var c=d("WASmaxInStatsIQErrorNotAcceptableMixin").parseIQErrorNotAcceptableMixin(a);if(c.success)return d("WAResultOrError").makeResult({name:"IQErrorNotAcceptable",value:c.value});var e=d("WASmaxInStatsIQErrorFeatureNotImplementedMixin").parseIQErrorFeatureNotImplementedMixin(a);return e.success?d("WAResultOrError").makeResult({name:"IQErrorFeatureNotImplemented",value:e.value}):d("WASmaxParseUtils").errorMixinDisjunction(a,["IQErrorBadRequest","IQErrorNotAcceptable","IQErrorFeatureNotImplemented"],[b,c,e])}g.parseSendBufferNoRetryError=a}),98); __d("WASmaxInStatsSendBufferResponseErrorNoRetry",["WAResultOrError","WASmaxInStatsIQErrorResponseMixin","WASmaxInStatsSendBufferNoRetryError","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"error");if(!c.success)return c;a=d("WASmaxInStatsIQErrorResponseMixin").parseIQErrorResponseMixin(a,b);if(!a.success)return a;b=d("WASmaxInStatsSendBufferNoRetryError").parseSendBufferNoRetryError(c.value);return!b.success?b:d("WAResultOrError").makeResult(babelHelpers["extends"]({},a.value,{errorSendBufferNoRetryError:b.value}))}g.parseSendBufferResponseErrorNoRetry=a}),98); __d("WASmaxInStatsSendBufferResponseErrorRetry",["WAResultOrError","WASmaxInStatsIQErrorResponseMixin","WASmaxInStatsIQErrorServiceUnavailableMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxParseUtils").flattenedChildWithTag(a,"error");if(!c.success)return c;c=d("WASmaxInStatsIQErrorServiceUnavailableMixin").parseIQErrorServiceUnavailableMixin(c.value);if(!c.success)return c;a=d("WASmaxInStatsIQErrorResponseMixin").parseIQErrorResponseMixin(a,b);return!a.success?a:d("WAResultOrError").makeResult(babelHelpers["extends"]({errorIQErrorServiceUnavailableMixin:c.value},a.value))}g.parseSendBufferResponseErrorRetry=a}),98); __d("WASmaxInStatsSendBufferResponseSuccess",["WASmaxInStatsIQResultResponseMixin","WASmaxParseUtils"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WASmaxParseUtils").assertTag(a,"iq");if(!c.success)return c;c=d("WASmaxInStatsIQResultResponseMixin").parseIQResultResponseMixin(a,b);return!c.success?c:c}g.parseSendBufferResponseSuccess=a}),98); __d("WASmaxOutMdBaseIQSetRequestMixin",["WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxJsx").smax("iq",{id:d("WAWap").generateId(),type:"set"});return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeBaseIQSetRequestMixin=a}),98); __d("WASmaxOutMdCompanionFinishRequest",["WASmaxJsx","WASmaxOutMdBaseIQSetRequestMixin","WAWap"],(function(a,b,c,d,e,f,g){function a(a){var b,c=a.linkCodeCompanionRegJid,e=a.linkCodePairingWrappedKeyBundleElementValue,f=a.companionIdentityPublicElementValue;a=a.linkCodePairingRefElementValue;c=d("WASmaxOutMdBaseIQSetRequestMixin").mergeBaseIQSetRequestMixin((b=d("WASmaxJsx")).smax("iq",{xmlns:"md",to:d("WAWap").S_WHATSAPP_NET},b.smax("link_code_companion_reg",{jid:d("WAWap").USER_JID(c),stage:"companion_finish"},b.smax("link_code_pairing_wrapped_key_bundle",null,e),b.smax("companion_identity_public",null,f),b.smax("link_code_pairing_ref",null,a))));return c}g.makeCompanionFinishRequest=a}),98); __d("WASmaxMdCompanionFinishRPC",["WAComms","WASmaxInMdCompanionFinishResponseError","WASmaxInMdCompanionFinishResponseSuccess","WASmaxOutMdCompanionFinishRequest","WASmaxParsingFailure","WASmaxRpcUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=d("WASmaxOutMdCompanionFinishRequest").makeCompanionFinishRequest(a);b=(yield d("WAComms").sendSmaxStanza(a,b));var c=d("WASmaxInMdCompanionFinishResponseSuccess").parseCompanionFinishResponseSuccess(b,a);if(c.success)return{name:"CompanionFinishResponseSuccess",value:c.value};b=d("WASmaxInMdCompanionFinishResponseError").parseCompanionFinishResponseError(b,a);if(b.success)return{name:"CompanionFinishResponseError",value:b.value};throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(d("WASmaxRpcUtils").errorMessageRpcParsing("CompanionFinish",{Success:c,Error:b}))});return h.apply(this,arguments)}g.sendCompanionFinishRPC=a}),98); __d("WASmaxOutMdCompanionHelloRequest",["WASmaxAttrs","WASmaxChildren","WASmaxJsx","WASmaxOutMdBaseIQSetRequestMixin","WAWap"],(function(a,b,c,d,e,f,g){function h(a){a=a.linkCodePairingNonceElementValue;a=d("WASmaxJsx").smax("link_code_pairing_nonce",null,a);return a}function a(a){var b,c=a.linkCodePairingNonceArgs,e=a.linkCodeCompanionRegJid,f=a.linkCodeCompanionRegShouldShowPushNotification,g=a.linkCodePairingWrappedCompanionEphemeralPubElementValue,i=a.companionServerAuthKeyPubElementValue,j=a.companionPlatformIdElementValue;a=a.companionPlatformDisplayElementValue;e=d("WASmaxOutMdBaseIQSetRequestMixin").mergeBaseIQSetRequestMixin((b=d("WASmaxJsx")).smax("iq",{xmlns:"md",to:d("WAWap").S_WHATSAPP_NET},b.smax("link_code_companion_reg",{jid:d("WAWap").USER_JID(e),stage:"companion_hello",should_show_push_notification:d("WASmaxAttrs").OPTIONAL(d("WAWap").CUSTOM_STRING,f)},b.smax("link_code_pairing_wrapped_companion_ephemeral_pub",null,g),b.smax("companion_server_auth_key_pub",null,i),b.smax("companion_platform_id",null,j),b.smax("companion_platform_display",null,a),d("WASmaxChildren").OPTIONAL_CHILD(h,c))));return e}g.makeCompanionHelloRequestLinkCodeCompanionRegLinkCodePairingNonce=h;g.makeCompanionHelloRequest=a}),98); __d("WASmaxMdCompanionHelloRPC",["WAComms","WASmaxInMdCompanionHelloResponseError","WASmaxInMdCompanionHelloResponseNotifyCompanion","WASmaxOutMdCompanionHelloRequest","WASmaxParsingFailure","WASmaxRpcUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=d("WASmaxOutMdCompanionHelloRequest").makeCompanionHelloRequest(a);b=(yield d("WAComms").sendSmaxStanza(a,b));var c=d("WASmaxInMdCompanionHelloResponseNotifyCompanion").parseCompanionHelloResponseNotifyCompanion(b,a);if(c.success)return{name:"CompanionHelloResponseNotifyCompanion",value:c.value};b=d("WASmaxInMdCompanionHelloResponseError").parseCompanionHelloResponseError(b,a);if(b.success)return{name:"CompanionHelloResponseError",value:b.value};throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(d("WASmaxRpcUtils").errorMessageRpcParsing("CompanionHello",{NotifyCompanion:c,Error:b}))});return h.apply(this,arguments)}g.sendCompanionHelloRPC=a}),98); __d("WASmaxOutMdNotificationClientAckMixin",["WASmaxJsx","WASmaxMixins","WASmaxParseJid","WASmaxParseReference","WASmaxParseUtils","WASmaxParsingFailure","WAWap"],(function(a,b,c,d,e,f,g){function h(a){var b=d("WASmaxParseReference").attrFromReference(d("WASmaxParseUtils").attrStanzaId,a,["id"]);if(!b.success)throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(b.error);var c=d("WASmaxParseReference").attrFromReference(d("WASmaxParseJid").attrDomainJid,a,["from"]);if(!c.success)throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(c.error);a=d("WASmaxParseReference").attrFromReference(d("WASmaxParseUtils").attrString,a,["type"]);if(!a.success)throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(a.error);b=d("WASmaxJsx").smax("ack",{id:d("WAWap").STANZA_ID(b.value),to:d("WAWap").DOMAIN_JID(c.value),"class":"notification",type:d("WAWap").CUSTOM_STRING(a.value)});return b}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeNotificationClientAckMixin=a}),98); __d("WASmaxOutMdPrimaryHelloNotifyCompanionResponseAck",["WASmaxJsx","WASmaxOutMdNotificationClientAckMixin"],(function(a,b,c,d,e,f,g){function a(a){a=d("WASmaxOutMdNotificationClientAckMixin").mergeNotificationClientAckMixin(d("WASmaxJsx").smax("ack",null),a);return a}g.makePrimaryHelloNotifyCompanionResponseAck=a}),98); __d("WASmaxMdPrimaryHelloNotifyCompanionRPC",["WASmaxInMdPrimaryHelloNotifyCompanionRequest","WASmaxOutMdPrimaryHelloNotifyCompanionResponseAck","WASmaxParsingFailure","WASmaxRpcUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxInMdPrimaryHelloNotifyCompanionRequest").parsePrimaryHelloNotifyCompanionRequest(a);if(!b.success)throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(d("WASmaxRpcUtils").errorMessageRpcParsing("PrimaryHelloNotifyCompanion",{Request:b}));return{parsedRequest:b.value,makePrimaryHelloNotifyCompanionResponseAck:function(){return d("WASmaxOutMdPrimaryHelloNotifyCompanionResponseAck").makePrimaryHelloNotifyCompanionResponseAck(a)}}}g.receivePrimaryHelloNotifyCompanionRPC=a}),98); __d("WASmaxOutMdRefreshCodeNotifyCompanionResponseAck",["WASmaxJsx","WASmaxOutMdNotificationClientAckMixin"],(function(a,b,c,d,e,f,g){function a(a){a=d("WASmaxOutMdNotificationClientAckMixin").mergeNotificationClientAckMixin(d("WASmaxJsx").smax("ack",null),a);return a}g.makeRefreshCodeNotifyCompanionResponseAck=a}),98); __d("WASmaxMdRefreshCodeNotifyCompanionRPC",["WASmaxInMdRefreshCodeNotifyCompanionRequest","WASmaxOutMdRefreshCodeNotifyCompanionResponseAck","WASmaxParsingFailure","WASmaxRpcUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxInMdRefreshCodeNotifyCompanionRequest").parseRefreshCodeNotifyCompanionRequest(a);if(!b.success)throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(d("WASmaxRpcUtils").errorMessageRpcParsing("RefreshCodeNotifyCompanion",{Request:b}));return{parsedRequest:b.value,makeRefreshCodeNotifyCompanionResponseAck:function(){return d("WASmaxOutMdRefreshCodeNotifyCompanionResponseAck").makeRefreshCodeNotifyCompanionResponseAck(a)}}}g.receiveRefreshCodeNotifyCompanionRPC=a}),98); __d("WASmaxOutMessagePublishNewsletterPollVoteMixin",["WASmaxChildren","WASmaxJsx","WASmaxMixins","WASmaxOutMessagePublishContentTypePollVoteMixin"],(function(a,b,c,d,e,f,g){function h(a){a=a.voteElementValue;a=d("WASmaxJsx").smax("vote",null,a);return a}function i(a){var b=a.voteArgs;b=d("WASmaxOutMessagePublishContentTypePollVoteMixin").mergeContentTypePollVoteMixin(d("WASmaxJsx").smax("message",null,d("WASmaxJsx").smax("votes",null,d("WASmaxChildren").REPEATED_CHILD(h,b,0,1e3))),a);return b}function a(a,b){b=i(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.makeNewsletterPollVoteVotesVote=h;g.mergeNewsletterPollVoteMixin=a}),98); __d("WASmaxOutMessagePublishNewsletterReactionMixin",["WASmaxJsx","WASmaxMixins","WASmaxOutMessagePublishContentTypeReactionMixin","WAWap"],(function(a,b,c,d,e,f,g){function h(a){a=a.reactionCode;a=d("WASmaxOutMessagePublishContentTypeReactionMixin").mergeContentTypeReactionMixin(d("WASmaxJsx").smax("message",null,d("WASmaxJsx").smax("reaction",{code:d("WAWap").CUSTOM_STRING(a)})));return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeNewsletterReactionMixin=a}),98); __d("WASmaxOutMessagePublishNewsletterReactionRevokeMixin",["WASmaxJsx","WASmaxMixins","WASmaxOutMessagePublishContentTypeReactionMixin","WASmaxOutMessagePublishRevokeMixin"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxOutMessagePublishContentTypeReactionMixin").mergeContentTypeReactionMixin(d("WASmaxOutMessagePublishRevokeMixin").mergeRevokeMixin(d("WASmaxJsx").smax("message",null,d("WASmaxJsx").smax("reaction",null))));return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeNewsletterReactionRevokeMixin=a}),98); __d("WASmaxOutMessagePublishNewsletterReactionOrReactionRevokeOrPollVoteMixinGroup",["WASmaxMixinGroupExhaustiveError","WASmaxOutMessagePublishNewsletterPollVoteMixin","WASmaxOutMessagePublishNewsletterReactionMixin","WASmaxOutMessagePublishNewsletterReactionRevokeMixin"],(function(a,b,c,d,e,f,g){function a(a,b){if(b.newsletterReaction)return d("WASmaxOutMessagePublishNewsletterReactionMixin").mergeNewsletterReactionMixin(a,b.newsletterReaction);if(b.isNewsletterReactionRevoke)return d("WASmaxOutMessagePublishNewsletterReactionRevokeMixin").mergeNewsletterReactionRevokeMixin(a);if(b.newsletterPollVote)return d("WASmaxOutMessagePublishNewsletterPollVoteMixin").mergeNewsletterPollVoteMixin(a,b.newsletterPollVote);throw new(d("WASmaxMixinGroupExhaustiveError").SmaxMixinGroupExhaustiveError)()}g.mergeNewsletterReactionOrReactionRevokeOrPollVoteMixinGroup=a}),98); __d("WASmaxOutMessagePublishNewsletterClientAndServerIDMixin",["WASmaxJsx","WASmaxMixins","WASmaxOutMessagePublishNewsletterReactionOrReactionRevokeOrPollVoteMixinGroup","WAWap"],(function(a,b,c,d,e,f,g){function h(a){var b=a.messageId,c=a.messageServerId;a=a.newsletterReactionOrReactionRevokeOrPollVoteMixinGroupArgs;b=d("WASmaxOutMessagePublishNewsletterReactionOrReactionRevokeOrPollVoteMixinGroup").mergeNewsletterReactionOrReactionRevokeOrPollVoteMixinGroup(d("WASmaxJsx").smax("message",{id:d("WAWap").STANZA_ID(b),server_id:d("WAWap").INT(c)}),a);return b}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeNewsletterClientAndServerIDMixin=a}),98); __d("WASmaxOutMessagePublishAdminEditMixin",["WASmaxJsx","WASmaxMixins"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxJsx").smax("message",{edit:"3"});return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeAdminEditMixin=a}),98); __d("WASmaxOutMessagePublishPayloadMixin",["WASmaxJsx","WASmaxMixins"],(function(a,b,c,d,e,f,g){function h(a){a=a.plaintextElementValue;a=d("WASmaxJsx").smax("plaintext",null,a);return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergePayloadMixin=a}),98); __d("WASmaxOutMessagePublishWAMOSubMixin",["WASmaxJsx","WASmaxMixins"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxJsx").smax("message",null,d("WASmaxJsx").smax("meta",{is_wamo_sub:"true"}));return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeWAMOSubMixin=a}),98); __d("WASmaxOutMessagePublishNewsletterMediaMixin",["WASmaxJsx","WASmaxMixins","WASmaxOutMessagePublishContentTypeMediaMixin","WASmaxOutMessagePublishMessageAssociationTypeMixin","WASmaxOutMessagePublishPayloadMixin","WASmaxOutMessagePublishWAMOSubMixin","WAWap"],(function(a,b,c,d,e,f,g){function h(a){var b=a.hasWAMOSub,c=a.messageAssociationTypeMixinArgs,e=a.plaintextMediatype;a=a.payloadMixinArgs;e=d("WASmaxMixins").optionalMerge(d("WASmaxOutMessagePublishMessageAssociationTypeMixin").mergeMessageAssociationTypeMixin,d("WASmaxMixins").optionalMerge(d("WASmaxOutMessagePublishWAMOSubMixin").mergeWAMOSubMixin,d("WASmaxOutMessagePublishContentTypeMediaMixin").mergeContentTypeMediaMixin(d("WASmaxJsx").smax("message",null,d("WASmaxOutMessagePublishPayloadMixin").mergePayloadMixin(d("WASmaxJsx").smax("plaintext",{mediatype:d("WAWap").CUSTOM_STRING(e)}),a))),b),c);return e}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeNewsletterMediaMixin=a}),98); __d("WASmaxOutMessagePublishNewsletterTextMixin",["WASmaxJsx","WASmaxMixins","WASmaxOutMessagePublishContentTypeTextMixin","WASmaxOutMessagePublishPayloadMixin","WASmaxOutMessagePublishWAMOSubMixin"],(function(a,b,c,d,e,f,g){function h(a){var b=a.hasWAMOSub;a=a.payloadMixinArgs;a=d("WASmaxMixins").optionalMerge(d("WASmaxOutMessagePublishWAMOSubMixin").mergeWAMOSubMixin,d("WASmaxOutMessagePublishContentTypeTextMixin").mergeContentTypeTextMixin(d("WASmaxJsx").smax("message",null,d("WASmaxOutMessagePublishPayloadMixin").mergePayloadMixin(d("WASmaxJsx").smax("plaintext",null),a))),b);return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeNewsletterTextMixin=a}),98); __d("WASmaxOutMessagePublishNewsletterTextOrMediaMixinGroup",["WASmaxMixinGroupExhaustiveError","WASmaxOutMessagePublishNewsletterMediaMixin","WASmaxOutMessagePublishNewsletterTextMixin"],(function(a,b,c,d,e,f,g){function a(a,b){if(b.newsletterText)return d("WASmaxOutMessagePublishNewsletterTextMixin").mergeNewsletterTextMixin(a,b.newsletterText);if(b.newsletterMedia)return d("WASmaxOutMessagePublishNewsletterMediaMixin").mergeNewsletterMediaMixin(a,b.newsletterMedia);throw new(d("WASmaxMixinGroupExhaustiveError").SmaxMixinGroupExhaustiveError)()}g.mergeNewsletterTextOrMediaMixinGroup=a}),98); __d("WASmaxOutMessagePublishNewsletterEditMixin",["WASmaxJsx","WASmaxMixins","WASmaxOutMessagePublishAdminEditMixin","WASmaxOutMessagePublishNewsletterTextOrMediaMixinGroup","WASmaxOutMessagePublishWAMOSubMixin"],(function(a,b,c,d,e,f,g){function h(a){var b=a.hasWAMOSub;a=a.newsletterTextOrMediaMixinGroupArgs;b=d("WASmaxOutMessagePublishNewsletterTextOrMediaMixinGroup").mergeNewsletterTextOrMediaMixinGroup(d("WASmaxMixins").optionalMerge(d("WASmaxOutMessagePublishWAMOSubMixin").mergeWAMOSubMixin,d("WASmaxOutMessagePublishAdminEditMixin").mergeAdminEditMixin(d("WASmaxJsx").smax("message",null)),b),a);return b}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeNewsletterEditMixin=a}),98); __d("WASmaxOutMessagePublishNewsletterMediaPublishMixin",["WASmaxAttrs","WASmaxJsx","WASmaxMixins","WASmaxOutMessagePublishNewsletterMediaMixin","WAWap"],(function(a,b,c,d,e,f,g){function h(a){var b=a.messageMediaId;b=d("WASmaxOutMessagePublishNewsletterMediaMixin").mergeNewsletterMediaMixin(d("WASmaxJsx").smax("message",{media_id:d("WASmaxAttrs").OPTIONAL(d("WAWap").CUSTOM_STRING,b)}),a);return b}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeNewsletterMediaPublishMixin=a}),98); __d("WASmaxOutMessagePublishNewsletterPollCreationMixin",["WASmaxJsx","WASmaxMixins","WASmaxOutMessagePublishContentTypePollCreationMixin","WASmaxOutMessagePublishPayloadMixin","WASmaxOutMessagePublishWAMOSubMixin"],(function(a,b,c,d,e,f,g){function h(a){var b=a.hasWAMOSub,c=a.payloadMixinArgs;c=d("WASmaxMixins").optionalMerge(d("WASmaxOutMessagePublishWAMOSubMixin").mergeWAMOSubMixin,d("WASmaxOutMessagePublishContentTypePollCreationMixin").mergeContentTypePollCreationMixin(d("WASmaxJsx").smax("message",null,d("WASmaxOutMessagePublishPayloadMixin").mergePayloadMixin(d("WASmaxJsx").smax("plaintext",null),c)),a),b);return c}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeNewsletterPollCreationMixin=a}),98); __d("WASmaxOutMessagePublishNewsletterPollResultSnapshotMixin",["WASmaxJsx","WASmaxMixins","WASmaxOutMessagePublishContentTypePollResultSnapshotMixin","WASmaxOutMessagePublishPayloadMixin","WASmaxOutMessagePublishWAMOSubMixin"],(function(a,b,c,d,e,f,g){function h(a){var b=a.hasWAMOSub;a=a.payloadMixinArgs;a=d("WASmaxMixins").optionalMerge(d("WASmaxOutMessagePublishWAMOSubMixin").mergeWAMOSubMixin,d("WASmaxOutMessagePublishContentTypePollResultSnapshotMixin").mergeContentTypePollResultSnapshotMixin(d("WASmaxJsx").smax("message",null,d("WASmaxOutMessagePublishPayloadMixin").mergePayloadMixin(d("WASmaxJsx").smax("plaintext",null),a))),b);return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeNewsletterPollResultSnapshotMixin=a}),98); __d("WASmaxOutMessagePublishAdminRevokeMixin",["WASmaxJsx","WASmaxMixins"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxJsx").smax("message",{edit:"8"});return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeAdminRevokeMixin=a}),98); __d("WASmaxOutMessagePublishNewsletterRevokeMixin",["WASmaxJsx","WASmaxMixins","WASmaxOutMessagePublishAdminRevokeMixin","WASmaxOutMessagePublishContentTypeTextMixin","WASmaxOutMessagePublishWAMOSubMixin"],(function(a,b,c,d,e,f,g){function h(a){a=a.hasWAMOSub;a=d("WASmaxMixins").optionalMerge(d("WASmaxOutMessagePublishWAMOSubMixin").mergeWAMOSubMixin,d("WASmaxOutMessagePublishContentTypeTextMixin").mergeContentTypeTextMixin(d("WASmaxOutMessagePublishAdminRevokeMixin").mergeAdminRevokeMixin(d("WASmaxJsx").smax("message",null,d("WASmaxJsx").smax("plaintext",null)))),a);return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeNewsletterRevokeMixin=a}),98); __d("WASmaxOutMessagePublishNewsletterClientIdContent",["WASmaxMixinGroupExhaustiveError","WASmaxOutMessagePublishNewsletterEditMixin","WASmaxOutMessagePublishNewsletterMediaPublishMixin","WASmaxOutMessagePublishNewsletterPollCreationMixin","WASmaxOutMessagePublishNewsletterPollResultSnapshotMixin","WASmaxOutMessagePublishNewsletterRevokeMixin","WASmaxOutMessagePublishNewsletterTextMixin"],(function(a,b,c,d,e,f,g){function a(a,b){if(b.newsletterEdit)return d("WASmaxOutMessagePublishNewsletterEditMixin").mergeNewsletterEditMixin(a,b.newsletterEdit);if(b.newsletterText)return d("WASmaxOutMessagePublishNewsletterTextMixin").mergeNewsletterTextMixin(a,b.newsletterText);if(b.newsletterMediaPublish)return d("WASmaxOutMessagePublishNewsletterMediaPublishMixin").mergeNewsletterMediaPublishMixin(a,b.newsletterMediaPublish);if(b.newsletterRevoke)return d("WASmaxOutMessagePublishNewsletterRevokeMixin").mergeNewsletterRevokeMixin(a,b.newsletterRevoke);if(b.newsletterPollCreation)return d("WASmaxOutMessagePublishNewsletterPollCreationMixin").mergeNewsletterPollCreationMixin(a,b.newsletterPollCreation);if(b.newsletterPollResultSnapshot)return d("WASmaxOutMessagePublishNewsletterPollResultSnapshotMixin").mergeNewsletterPollResultSnapshotMixin(a,b.newsletterPollResultSnapshot);throw new(d("WASmaxMixinGroupExhaustiveError").SmaxMixinGroupExhaustiveError)()}g.mergeNewsletterClientIdContent=a}),98); __d("WASmaxOutMessagePublishNewsletterClientIDMixin",["WASmaxJsx","WASmaxMixins","WASmaxOutMessagePublishNewsletterClientIdContent","WAWap"],(function(a,b,c,d,e,f,g){function h(a){var b=a.messageId;a=a.newsletterClientIdContentArgs;b=d("WASmaxOutMessagePublishNewsletterClientIdContent").mergeNewsletterClientIdContent(d("WASmaxJsx").smax("message",{id:d("WAWap").STANZA_ID(b)}),a);return b}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeNewsletterClientIDMixin=a}),98); __d("WASmaxOutMessagePublishClientNewsletterOrNewsletterAndServerIDMixinGroup",["WASmaxMixinGroupExhaustiveError","WASmaxOutMessagePublishNewsletterClientAndServerIDMixin","WASmaxOutMessagePublishNewsletterClientIDMixin"],(function(a,b,c,d,e,f,g){function a(a,b){if(b.newsletterClientID)return d("WASmaxOutMessagePublishNewsletterClientIDMixin").mergeNewsletterClientIDMixin(a,b.newsletterClientID);if(b.newsletterClientAndServerID)return d("WASmaxOutMessagePublishNewsletterClientAndServerIDMixin").mergeNewsletterClientAndServerIDMixin(a,b.newsletterClientAndServerID);throw new(d("WASmaxMixinGroupExhaustiveError").SmaxMixinGroupExhaustiveError)()}g.mergeClientNewsletterOrNewsletterAndServerIDMixinGroup=a}),98); __d("WASmaxOutMessagePublishNewsletterRequest",["WASmaxJsx","WASmaxOutMessagePublishClientNewsletterOrNewsletterAndServerIDMixinGroup","WAWap"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageTo;a=a.clientNewsletterOrNewsletterAndServerIDMixinGroupArgs;b=d("WASmaxOutMessagePublishClientNewsletterOrNewsletterAndServerIDMixinGroup").mergeClientNewsletterOrNewsletterAndServerIDMixinGroup(d("WASmaxJsx").smax("message",{to:d("WAWap").JID(b)}),a);return b}g.makeNewsletterRequest=a}),98); __d("WASmaxMessagePublishNewsletterRPC",["WAComms","WASmaxInMessagePublishNewsletterResponseNegative","WASmaxInMessagePublishNewsletterResponseSuccess","WASmaxOutMessagePublishNewsletterRequest","WASmaxParsingFailure","WASmaxRpcUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=d("WASmaxOutMessagePublishNewsletterRequest").makeNewsletterRequest(a);b=(yield d("WAComms").sendSmaxStanza(a,b));var c=d("WASmaxInMessagePublishNewsletterResponseNegative").parseNewsletterResponseNegative(b,a);if(c.success)return{name:"NewsletterResponseNegative",value:c.value};b=d("WASmaxInMessagePublishNewsletterResponseSuccess").parseNewsletterResponseSuccess(b,a);if(b.success)return{name:"NewsletterResponseSuccess",value:b.value};throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(d("WASmaxRpcUtils").errorMessageRpcParsing("Newsletter",{Negative:c,Success:b}))});return h.apply(this,arguments)}g.sendNewsletterRPC=a}),98); __d("WASmaxOutNewslettersNewsletterCreationTimeFieldMixin",["WASmaxJsx","WASmaxMixins"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxJsx").smax("metadata",null,d("WASmaxJsx").smax("creation_time",null));return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeNewsletterCreationTimeFieldMixin=a}),98); __d("WASmaxOutNewslettersNewsletterDescriptionFieldMixin",["WASmaxJsx","WASmaxMixins"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxJsx").smax("metadata",null,d("WASmaxJsx").smax("description",null));return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeNewsletterDescriptionFieldMixin=a}),98); __d("WASmaxOutNewslettersNewsletterHandleFieldMixin",["WASmaxJsx","WASmaxMixins"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxJsx").smax("metadata",null,d("WASmaxJsx").smax("handle",null));return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeNewsletterHandleFieldMixin=a}),98); __d("WASmaxOutNewslettersNewsletterIDFieldMixin",["WASmaxJsx","WASmaxMixins"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxJsx").smax("metadata",null,d("WASmaxJsx").smax("id",null));return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeNewsletterIDFieldMixin=a}),98); __d("WASmaxOutNewslettersNewsletterInviteLinkFieldMixin",["WASmaxJsx","WASmaxMixins"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxJsx").smax("metadata",null,d("WASmaxJsx").smax("invite",null));return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeNewsletterInviteLinkFieldMixin=a}),98); __d("WASmaxOutNewslettersNewsletterLinkedAccountsFieldMixin",["WASmaxJsx","WASmaxMixins"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxJsx").smax("metadata",null,d("WASmaxJsx").smax("linked_accounts",null));return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeNewsletterLinkedAccountsFieldMixin=a}),98); __d("WASmaxOutNewslettersNewsletterMembershipFieldMixin",["WASmaxJsx","WASmaxMixins"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxJsx").smax("metadata",null,d("WASmaxJsx").smax("membership",null));return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeNewsletterMembershipFieldMixin=a}),98); __d("WASmaxOutNewslettersNewsletterMutedFieldMixin",["WASmaxJsx","WASmaxMixins"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxJsx").smax("metadata",null,d("WASmaxJsx").smax("muted",null));return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeNewsletterMutedFieldMixin=a}),98); __d("WASmaxOutNewslettersNewsletterNameFieldMixin",["WASmaxJsx","WASmaxMixins"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxJsx").smax("metadata",null,d("WASmaxJsx").smax("name",null));return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeNewsletterNameFieldMixin=a}),98); __d("WASmaxOutNewslettersBaseNewsletterPictureFieldMixin",["WASmaxAttrs","WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(a){a=a.pictureId;a=d("WASmaxJsx").smax("picture",{id:d("WASmaxAttrs").OPTIONAL(d("WAWap").CUSTOM_STRING,a),query:"direct_path"});return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeBaseNewsletterPictureFieldMixin=a}),98); __d("WASmaxOutNewslettersNewsletterPictureFieldMixin",["WASmaxChildren","WASmaxJsx","WASmaxMixins","WASmaxOutNewslettersBaseNewsletterPictureFieldMixin","WAWap"],(function(a,b,c,d,e,f,g){function h(a){var b=a.pictureType;b=d("WASmaxOutNewslettersBaseNewsletterPictureFieldMixin").mergeBaseNewsletterPictureFieldMixin(d("WASmaxJsx").smax("picture",{type:d("WAWap").CUSTOM_STRING(b)}),a);return b}function i(a){a=a.pictureArgs;a=d("WASmaxJsx").smax("metadata",null,d("WASmaxChildren").REPEATED_CHILD(h,a,0,2));return a}function a(a,b){b=i(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.makeNewsletterPictureFieldPicture=h;g.mergeNewsletterPictureFieldMixin=a}),98); __d("WASmaxOutNewslettersNewsletterPrivacyFieldMixin",["WASmaxJsx","WASmaxMixins"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxJsx").smax("metadata",null,d("WASmaxJsx").smax("privacy",null));return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeNewsletterPrivacyFieldMixin=a}),98); __d("WASmaxOutNewslettersNewsletterStateFieldMixin",["WASmaxJsx","WASmaxMixins"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxJsx").smax("metadata",null,d("WASmaxJsx").smax("state",null));return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeNewsletterStateFieldMixin=a}),98); __d("WASmaxOutNewslettersNewsletterSubscribersFieldMixin",["WASmaxJsx","WASmaxMixins"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxJsx").smax("metadata",null,d("WASmaxJsx").smax("subscribers",null));return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeNewsletterSubscribersFieldMixin=a}),98); __d("WASmaxOutNewslettersNewsletterVerificationFieldMixin",["WASmaxJsx","WASmaxMixins"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxJsx").smax("metadata",null,d("WASmaxJsx").smax("verification",null));return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeNewsletterVerificationFieldMixin=a}),98); __d("WASmaxOutNewslettersAllNewsletterMetadataIQRequestPayloadMixin",["WASmaxJsx","WASmaxMixins","WASmaxOutNewslettersNewsletterCreationTimeFieldMixin","WASmaxOutNewslettersNewsletterDescriptionFieldMixin","WASmaxOutNewslettersNewsletterHandleFieldMixin","WASmaxOutNewslettersNewsletterIDFieldMixin","WASmaxOutNewslettersNewsletterInviteLinkFieldMixin","WASmaxOutNewslettersNewsletterLinkedAccountsFieldMixin","WASmaxOutNewslettersNewsletterMembershipFieldMixin","WASmaxOutNewslettersNewsletterMutedFieldMixin","WASmaxOutNewslettersNewsletterNameFieldMixin","WASmaxOutNewslettersNewsletterPictureFieldMixin","WASmaxOutNewslettersNewsletterPrivacyFieldMixin","WASmaxOutNewslettersNewsletterStateFieldMixin","WASmaxOutNewslettersNewsletterSubscribersFieldMixin","WASmaxOutNewslettersNewsletterVerificationFieldMixin"],(function(a,b,c,d,e,f,g){function h(a){var b,c=a.hasNewsletterCreationTimeField,e=a.hasNewsletterNameField,f=a.hasNewsletterDescriptionField,g=a.hasNewsletterInviteLinkField,h=a.hasNewsletterHandleField,i=a.hasNewsletterSubscribersField,j=a.hasNewsletterPrivacyField,k=a.hasNewsletterVerificationField,l=a.hasNewsletterLinkedAccountsField,m=a.hasNewsletterStateField,n=a.newsletterPictureFieldMixinArgs,o=a.hasNewsletterMembershipField;a=a.hasNewsletterMutedField;b=(b=d("WASmaxMixins")).optionalMerge(d("WASmaxOutNewslettersNewsletterMutedFieldMixin").mergeNewsletterMutedFieldMixin,b.optionalMerge(d("WASmaxOutNewslettersNewsletterMembershipFieldMixin").mergeNewsletterMembershipFieldMixin,b.optionalMerge(d("WASmaxOutNewslettersNewsletterPictureFieldMixin").mergeNewsletterPictureFieldMixin,b.optionalMerge(d("WASmaxOutNewslettersNewsletterStateFieldMixin").mergeNewsletterStateFieldMixin,b.optionalMerge(d("WASmaxOutNewslettersNewsletterLinkedAccountsFieldMixin").mergeNewsletterLinkedAccountsFieldMixin,b.optionalMerge(d("WASmaxOutNewslettersNewsletterVerificationFieldMixin").mergeNewsletterVerificationFieldMixin,b.optionalMerge(d("WASmaxOutNewslettersNewsletterPrivacyFieldMixin").mergeNewsletterPrivacyFieldMixin,b.optionalMerge(d("WASmaxOutNewslettersNewsletterSubscribersFieldMixin").mergeNewsletterSubscribersFieldMixin,b.optionalMerge(d("WASmaxOutNewslettersNewsletterHandleFieldMixin").mergeNewsletterHandleFieldMixin,b.optionalMerge(d("WASmaxOutNewslettersNewsletterInviteLinkFieldMixin").mergeNewsletterInviteLinkFieldMixin,b.optionalMerge(d("WASmaxOutNewslettersNewsletterDescriptionFieldMixin").mergeNewsletterDescriptionFieldMixin,b.optionalMerge(d("WASmaxOutNewslettersNewsletterNameFieldMixin").mergeNewsletterNameFieldMixin,b.optionalMerge(d("WASmaxOutNewslettersNewsletterCreationTimeFieldMixin").mergeNewsletterCreationTimeFieldMixin,d("WASmaxOutNewslettersNewsletterIDFieldMixin").mergeNewsletterIDFieldMixin(d("WASmaxJsx").smax("metadata",null)),c),e),f),g),h),i),j),k),l),m),n),o),a);return b}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeAllNewsletterMetadataIQRequestPayloadMixin=a}),98); __d("WASmaxOutNewslettersSetNameMixinMixin",["WASmaxJsx","WASmaxMixins"],(function(a,b,c,d,e,f,g){function h(a){a=a.nameElementValue;a=d("WASmaxJsx").smax("metadata",null,d("WASmaxJsx").smax("name",null,a));return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeSetNameMixinMixin=a}),98); __d("WASmaxOutNewslettersSetNewDescriptionMixinMixin",["WASmaxJsx","WASmaxMixins"],(function(a,b,c,d,e,f,g){function h(a){a=a.descriptionElementValue;a=d("WASmaxJsx").smax("metadata",null,d("WASmaxJsx").smax("description",null,a));return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeSetNewDescriptionMixinMixin=a}),98); __d("WASmaxOutNewslettersSetNewPictureMixinMixin",["WASmaxJsx","WASmaxMixins"],(function(a,b,c,d,e,f,g){function h(a){a=a.pictureElementValue;a=d("WASmaxJsx").smax("metadata",null,d("WASmaxJsx").smax("picture",null,a));return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeSetNewPictureMixinMixin=a}),98); __d("WASmaxOutNewslettersCreateRequestMixinMixin",["WASmaxJsx","WASmaxMixins","WASmaxOutNewslettersAllNewsletterMetadataIQRequestPayloadMixin","WASmaxOutNewslettersSetNameMixinMixin","WASmaxOutNewslettersSetNewDescriptionMixinMixin","WASmaxOutNewslettersSetNewPictureMixinMixin"],(function(a,b,c,d,e,f,g){function h(a){var b,c=a.setNameMixinMixinArgs,e=a.setNewDescriptionMixinMixinArgs,f=a.setNewPictureMixinMixinArgs;a=a.allNewsletterMetadataIQRequestPayloadMixinArgs;c=(b=d("WASmaxJsx")).smax("create",null,d("WASmaxMixins").optionalMerge(d("WASmaxOutNewslettersSetNewPictureMixinMixin").mergeSetNewPictureMixinMixin,d("WASmaxMixins").optionalMerge(d("WASmaxOutNewslettersSetNewDescriptionMixinMixin").mergeSetNewDescriptionMixinMixin,d("WASmaxOutNewslettersSetNameMixinMixin").mergeSetNameMixinMixin(b.smax("metadata",null),c),e),f),b.smax("query",null,d("WASmaxOutNewslettersAllNewsletterMetadataIQRequestPayloadMixin").mergeAllNewsletterMetadataIQRequestPayloadMixin(b.smax("metadata",null),a)));return c}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeCreateRequestMixinMixin=a}),98); __d("WASmaxOutNewslettersBaseIQSetRequestMixin",["WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxJsx").smax("iq",{id:d("WAWap").generateId(),type:"set"});return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeBaseIQSetRequestMixin=a}),98); __d("WASmaxOutNewslettersSelfIQSetRequestMixin",["WASmaxJsx","WASmaxMixins","WASmaxOutNewslettersBaseIQSetRequestMixin","WAWap"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxOutNewslettersBaseIQSetRequestMixin").mergeBaseIQSetRequestMixin(d("WASmaxJsx").smax("iq",{to:d("WAWap").S_WHATSAPP_NET,xmlns:"newsletter"}));return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeSelfIQSetRequestMixin=a}),98); __d("WASmaxOutNewslettersCreateRequest",["WASmaxJsx","WASmaxOutNewslettersCreateRequestMixinMixin","WASmaxOutNewslettersSelfIQSetRequestMixin"],(function(a,b,c,d,e,f,g){function a(a){a=a.createRequestMixinMixinArgs;a=d("WASmaxOutNewslettersSelfIQSetRequestMixin").mergeSelfIQSetRequestMixin(d("WASmaxJsx").smax("iq",null,d("WASmaxOutNewslettersCreateRequestMixinMixin").mergeCreateRequestMixinMixin(d("WASmaxJsx").smax("create",null),a)));return a}g.makeCreateRequest=a}),98); __d("WASmaxNewslettersCreateRPC",["WAComms","WASmaxInNewslettersCreateResponseClientError","WASmaxInNewslettersCreateResponseServerError","WASmaxInNewslettersCreateResponseSuccess","WASmaxOutNewslettersCreateRequest","WASmaxParsingFailure","WASmaxRpcUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=d("WASmaxOutNewslettersCreateRequest").makeCreateRequest(a);b=(yield d("WAComms").sendSmaxStanza(a,b));var c=d("WASmaxInNewslettersCreateResponseSuccess").parseCreateResponseSuccess(b,a);if(c.success)return{name:"CreateResponseSuccess",value:c.value};var e=d("WASmaxInNewslettersCreateResponseClientError").parseCreateResponseClientError(b,a);if(e.success)return{name:"CreateResponseClientError",value:e.value};b=d("WASmaxInNewslettersCreateResponseServerError").parseCreateResponseServerError(b,a);if(b.success)return{name:"CreateResponseServerError",value:b.value};throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(d("WASmaxRpcUtils").errorMessageRpcParsing("Create",{Success:c,ClientError:e,ServerError:b}))});return h.apply(this,arguments)}g.sendCreateRPC=a}),98); __d("WASmaxOutNewslettersMessageUpdatesAfterMixinMixin",["WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(a){a=a.messageUpdatesAfter;a=d("WASmaxJsx").smax("message_updates",{after:d("WAWap").INT(a)});return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeMessageUpdatesAfterMixinMixin=a}),98); __d("WASmaxOutNewslettersMessageUpdatesBeforeMixinMixin",["WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(a){a=a.messageUpdatesBefore;a=d("WASmaxJsx").smax("message_updates",{before:d("WAWap").INT(a)});return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeMessageUpdatesBeforeMixinMixin=a}),98); __d("WASmaxOutNewslettersMessageUpdatesBeforeOrAfterMixinMixinGroup",["WASmaxMixinGroupExhaustiveError","WASmaxOutNewslettersMessageUpdatesAfterMixinMixin","WASmaxOutNewslettersMessageUpdatesBeforeMixinMixin"],(function(a,b,c,d,e,f,g){function a(a,b){if(b.messageUpdatesBeforeMixin)return d("WASmaxOutNewslettersMessageUpdatesBeforeMixinMixin").mergeMessageUpdatesBeforeMixinMixin(a,b.messageUpdatesBeforeMixin);if(b.messageUpdatesAfterMixin)return d("WASmaxOutNewslettersMessageUpdatesAfterMixinMixin").mergeMessageUpdatesAfterMixinMixin(a,b.messageUpdatesAfterMixin);throw new(d("WASmaxMixinGroupExhaustiveError").SmaxMixinGroupExhaustiveError)()}g.mergeMessageUpdatesBeforeOrAfterMixinMixinGroup=a}),98); __d("WASmaxOutNewslettersBaseIQGetRequestMixin",["WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxJsx").smax("iq",{id:d("WAWap").generateId(),type:"get"});return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeBaseIQGetRequestMixin=a}),98); __d("WASmaxOutNewslettersNewsletterIQGetRequestMixin",["WASmaxJsx","WASmaxMixins","WASmaxOutNewslettersBaseIQGetRequestMixin","WAWap"],(function(a,b,c,d,e,f,g){function h(a){a=a.iqTo;a=d("WASmaxOutNewslettersBaseIQGetRequestMixin").mergeBaseIQGetRequestMixin(d("WASmaxJsx").smax("iq",{to:d("WAWap").JID(a),xmlns:"newsletter"}));return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeNewsletterIQGetRequestMixin=a}),98); __d("WASmaxOutNewslettersGetNewsletterMessageUpdatesRequest",["WASmaxAttrs","WASmaxJsx","WASmaxOutNewslettersMessageUpdatesBeforeOrAfterMixinMixinGroup","WASmaxOutNewslettersNewsletterIQGetRequestMixin","WAWap"],(function(a,b,c,d,e,f,g){function a(a){var b=a.messageUpdatesCount,c=a.messageUpdatesSince,e=a.messageUpdatesBeforeOrAfterMixinMixinGroupArgs;b=d("WASmaxOutNewslettersNewsletterIQGetRequestMixin").mergeNewsletterIQGetRequestMixin(d("WASmaxJsx").smax("iq",null,d("WASmaxOutNewslettersMessageUpdatesBeforeOrAfterMixinMixinGroup").mergeMessageUpdatesBeforeOrAfterMixinMixinGroup(d("WASmaxJsx").smax("message_updates",{count:d("WAWap").INT(b),since:d("WASmaxAttrs").OPTIONAL(d("WAWap").INT,c)}),e)),a);return b}g.makeGetNewsletterMessageUpdatesRequest=a}),98); __d("WASmaxNewslettersGetNewsletterMessageUpdatesRPC",["WAComms","WASmaxInNewslettersGetNewsletterMessageUpdatesResponseClientError","WASmaxInNewslettersGetNewsletterMessageUpdatesResponseServerError","WASmaxInNewslettersGetNewsletterMessageUpdatesResponseSuccess","WASmaxOutNewslettersGetNewsletterMessageUpdatesRequest","WASmaxParsingFailure","WASmaxRpcUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=d("WASmaxOutNewslettersGetNewsletterMessageUpdatesRequest").makeGetNewsletterMessageUpdatesRequest(a);b=(yield d("WAComms").sendSmaxStanza(a,b));var c=d("WASmaxInNewslettersGetNewsletterMessageUpdatesResponseSuccess").parseGetNewsletterMessageUpdatesResponseSuccess(b,a);if(c.success)return{name:"GetNewsletterMessageUpdatesResponseSuccess",value:c.value};var e=d("WASmaxInNewslettersGetNewsletterMessageUpdatesResponseClientError").parseGetNewsletterMessageUpdatesResponseClientError(b,a);if(e.success)return{name:"GetNewsletterMessageUpdatesResponseClientError",value:e.value};b=d("WASmaxInNewslettersGetNewsletterMessageUpdatesResponseServerError").parseGetNewsletterMessageUpdatesResponseServerError(b,a);if(b.success)return{name:"GetNewsletterMessageUpdatesResponseServerError",value:b.value};throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(d("WASmaxRpcUtils").errorMessageRpcParsing("GetNewsletterMessageUpdates",{Success:c,ClientError:e,ServerError:b}))});return h.apply(this,arguments)}g.sendGetNewsletterMessageUpdatesRPC=a}),98); __d("WASmaxOutNewslettersAfterMixinMixin",["WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(a){a=a.messagesAfter;a=d("WASmaxJsx").smax("messages",{after:d("WAWap").INT(a)});return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeAfterMixinMixin=a}),98); __d("WASmaxOutNewslettersBeforeMixinMixin",["WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(a){a=a.messagesBefore;a=d("WASmaxJsx").smax("messages",{before:d("WAWap").INT(a)});return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeBeforeMixinMixin=a}),98); __d("WASmaxOutNewslettersMessageDirections",["WASmaxMixinGroupExhaustiveError","WASmaxOutNewslettersAfterMixinMixin","WASmaxOutNewslettersBeforeMixinMixin"],(function(a,b,c,d,e,f,g){function a(a,b){if(b.beforeMixin)return d("WASmaxOutNewslettersBeforeMixinMixin").mergeBeforeMixinMixin(a,b.beforeMixin);if(b.afterMixin)return d("WASmaxOutNewslettersAfterMixinMixin").mergeAfterMixinMixin(a,b.afterMixin);throw new(d("WASmaxMixinGroupExhaustiveError").SmaxMixinGroupExhaustiveError)()}g.mergeMessageDirections=a}),98); __d("WASmaxOutNewslettersNewsletterMessageRequestPayloadMixin",["WASmaxJsx","WASmaxMixins","WASmaxOutNewslettersMessageDirections","WAWap"],(function(a,b,c,d,e,f,g){function h(a){var b=a.messagesCount;a=a.messageDirectionsArgs;b=d("WASmaxMixins").optionalMerge(d("WASmaxOutNewslettersMessageDirections").mergeMessageDirections,d("WASmaxJsx").smax("messages",{count:d("WAWap").INT(b)}),a);return b}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeNewsletterMessageRequestPayloadMixin=a}),98); __d("WASmaxOutNewslettersQueryNewsletterInviteParamsMixin",["WASmaxAttrs","WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(a){var b=a.anyKey;a=a.anyViewRole;b=d("WASmaxJsx").smax("smax$any",{type:"invite",key:d("WAWap").CUSTOM_STRING(b),view_role:d("WASmaxAttrs").OPTIONAL(d("WAWap").CUSTOM_STRING,a)});return b}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeQueryNewsletterInviteParamsMixin=a}),98); __d("WASmaxOutNewslettersQueryNewsletterJIDParamsMixin",["WASmaxAttrs","WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(a){var b=a.anyJid;a=a.anyViewRole;b=d("WASmaxJsx").smax("smax$any",{type:"jid",jid:d("WAWap").JID(b),view_role:d("WASmaxAttrs").OPTIONAL(d("WAWap").CUSTOM_STRING,a)});return b}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeQueryNewsletterJIDParamsMixin=a}),98); __d("WASmaxOutNewslettersQueryNewsletterParams",["WASmaxMixinGroupExhaustiveError","WASmaxOutNewslettersQueryNewsletterInviteParamsMixin","WASmaxOutNewslettersQueryNewsletterJIDParamsMixin"],(function(a,b,c,d,e,f,g){function a(a,b){if(b.queryNewsletterJIDParams)return d("WASmaxOutNewslettersQueryNewsletterJIDParamsMixin").mergeQueryNewsletterJIDParamsMixin(a,b.queryNewsletterJIDParams);if(b.queryNewsletterInviteParams)return d("WASmaxOutNewslettersQueryNewsletterInviteParamsMixin").mergeQueryNewsletterInviteParamsMixin(a,b.queryNewsletterInviteParams);throw new(d("WASmaxMixinGroupExhaustiveError").SmaxMixinGroupExhaustiveError)()}g.mergeQueryNewsletterParams=a}),98); __d("WASmaxOutNewslettersQueryNewsletterParamsMixin",["WASmaxJsx","WASmaxMixins","WASmaxOutNewslettersQueryNewsletterParams"],(function(a,b,c,d,e,f,g){function h(a){a=a.queryNewsletterParamsArgs;a=d("WASmaxOutNewslettersQueryNewsletterParams").mergeQueryNewsletterParams(d("WASmaxJsx").smax("smax$any",null),a);return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeQueryNewsletterParamsMixin=a}),98); __d("WASmaxOutNewslettersSelfIQGetRequestMixin",["WASmaxJsx","WASmaxMixins","WASmaxOutNewslettersBaseIQGetRequestMixin","WAWap"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxOutNewslettersBaseIQGetRequestMixin").mergeBaseIQGetRequestMixin(d("WASmaxJsx").smax("iq",{to:d("WAWap").S_WHATSAPP_NET,xmlns:"newsletter"}));return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeSelfIQGetRequestMixin=a}),98); __d("WASmaxOutNewslettersNewsletterMessageRequestIQPayloadMixin",["WASmaxJsx","WASmaxMixins","WASmaxOutNewslettersNewsletterMessageRequestPayloadMixin","WASmaxOutNewslettersQueryNewsletterParamsMixin","WASmaxOutNewslettersSelfIQGetRequestMixin"],(function(a,b,c,d,e,f,g){function h(a){var b=a.queryNewsletterParamsMixinArgs;a=a.newsletterMessageRequestPayloadMixinArgs;b=d("WASmaxOutNewslettersSelfIQGetRequestMixin").mergeSelfIQGetRequestMixin(d("WASmaxJsx").smax("iq",null,d("WASmaxOutNewslettersNewsletterMessageRequestPayloadMixin").mergeNewsletterMessageRequestPayloadMixin(d("WASmaxOutNewslettersQueryNewsletterParamsMixin").mergeQueryNewsletterParamsMixin(d("WASmaxJsx").smax("messages",null),b),a)));return b}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeNewsletterMessageRequestIQPayloadMixin=a}),98); __d("WASmaxOutNewslettersGetNewsletterMessagesRequest",["WASmaxJsx","WASmaxOutNewslettersNewsletterMessageRequestIQPayloadMixin"],(function(a,b,c,d,e,f,g){function a(a){a=d("WASmaxOutNewslettersNewsletterMessageRequestIQPayloadMixin").mergeNewsletterMessageRequestIQPayloadMixin(d("WASmaxJsx").smax("iq",null),a);return a}g.makeGetNewsletterMessagesRequest=a}),98); __d("WASmaxNewslettersGetNewsletterMessagesRPC",["WAComms","WASmaxInNewslettersGetNewsletterMessagesResponseClientError","WASmaxInNewslettersGetNewsletterMessagesResponseServerError","WASmaxInNewslettersGetNewsletterMessagesResponseSuccess","WASmaxOutNewslettersGetNewsletterMessagesRequest","WASmaxParsingFailure","WASmaxRpcUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=d("WASmaxOutNewslettersGetNewsletterMessagesRequest").makeGetNewsletterMessagesRequest(a);b=(yield d("WAComms").sendSmaxStanza(a,b));var c=d("WASmaxInNewslettersGetNewsletterMessagesResponseSuccess").parseGetNewsletterMessagesResponseSuccess(b,a);if(c.success)return{name:"GetNewsletterMessagesResponseSuccess",value:c.value};var e=d("WASmaxInNewslettersGetNewsletterMessagesResponseClientError").parseGetNewsletterMessagesResponseClientError(b,a);if(e.success)return{name:"GetNewsletterMessagesResponseClientError",value:e.value};b=d("WASmaxInNewslettersGetNewsletterMessagesResponseServerError").parseGetNewsletterMessagesResponseServerError(b,a);if(b.success)return{name:"GetNewsletterMessagesResponseServerError",value:b.value};throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(d("WASmaxRpcUtils").errorMessageRpcParsing("GetNewsletterMessages",{Success:c,ClientError:e,ServerError:b}))});return h.apply(this,arguments)}g.sendGetNewsletterMessagesRPC=a}),98); __d("WASmaxOutNewslettersNotificationClientAckMixin",["WASmaxJsx","WASmaxMixins","WASmaxParseJid","WASmaxParseReference","WASmaxParseUtils","WASmaxParsingFailure","WAWap"],(function(a,b,c,d,e,f,g){function h(a){var b=d("WASmaxParseReference").attrFromReference(d("WASmaxParseUtils").attrStanzaId,a,["id"]);if(!b.success)throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(b.error);var c=d("WASmaxParseReference").attrFromReference(d("WASmaxParseJid").attrNewsletterJid,a,["from"]);if(!c.success)throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(c.error);a=d("WASmaxParseReference").attrFromReference(d("WASmaxParseUtils").attrString,a,["type"]);if(!a.success)throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(a.error);b=d("WASmaxJsx").smax("ack",{id:d("WAWap").STANZA_ID(b.value),to:d("WAWap").JID(c.value),"class":"notification",type:d("WAWap").CUSTOM_STRING(a.value)});return b}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeNotificationClientAckMixin=a}),98); __d("WASmaxOutNewslettersLiveUpdatesNotificationResponseAck",["WASmaxJsx","WASmaxOutNewslettersNotificationClientAckMixin"],(function(a,b,c,d,e,f,g){function a(a){a=d("WASmaxOutNewslettersNotificationClientAckMixin").mergeNotificationClientAckMixin(d("WASmaxJsx").smax("ack",null),a);return a}g.makeLiveUpdatesNotificationResponseAck=a}),98); __d("WASmaxNewslettersLiveUpdatesNotificationRPC",["WASmaxInNewslettersLiveUpdatesNotificationRequest","WASmaxOutNewslettersLiveUpdatesNotificationResponseAck","WASmaxParsingFailure","WASmaxRpcUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxInNewslettersLiveUpdatesNotificationRequest").parseLiveUpdatesNotificationRequest(a);if(!b.success)throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(d("WASmaxRpcUtils").errorMessageRpcParsing("LiveUpdatesNotification",{Request:b}));return{parsedRequest:b.value,makeLiveUpdatesNotificationResponseAck:function(){return d("WASmaxOutNewslettersLiveUpdatesNotificationResponseAck").makeLiveUpdatesNotificationResponseAck(a)}}}g.receiveLiveUpdatesNotificationRPC=a}),98); __d("WASmaxOutNewslettersMyAddOnsRequest",["WASmaxAttrs","WASmaxJsx","WASmaxOutNewslettersSelfIQGetRequestMixin","WAWap"],(function(a,b,c,d,e,f,g){function a(a){var b=a.myAddonsLimit;a=a.myAddonsJid;b=d("WASmaxOutNewslettersSelfIQGetRequestMixin").mergeSelfIQGetRequestMixin(d("WASmaxJsx").smax("iq",null,d("WASmaxJsx").smax("my_addons",{limit:d("WAWap").INT(b),jid:d("WASmaxAttrs").OPTIONAL(d("WAWap").JID,a)})));return b}g.makeMyAddOnsRequest=a}),98); __d("WASmaxNewslettersMyAddOnsRPC",["WAComms","WASmaxInNewslettersMyAddOnsResponseClientError","WASmaxInNewslettersMyAddOnsResponseServerError","WASmaxInNewslettersMyAddOnsResponseSuccess","WASmaxOutNewslettersMyAddOnsRequest","WASmaxParsingFailure","WASmaxRpcUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=d("WASmaxOutNewslettersMyAddOnsRequest").makeMyAddOnsRequest(a);b=(yield d("WAComms").sendSmaxStanza(a,b));var c=d("WASmaxInNewslettersMyAddOnsResponseSuccess").parseMyAddOnsResponseSuccess(b,a);if(c.success)return{name:"MyAddOnsResponseSuccess",value:c.value};var e=d("WASmaxInNewslettersMyAddOnsResponseClientError").parseMyAddOnsResponseClientError(b,a);if(e.success)return{name:"MyAddOnsResponseClientError",value:e.value};b=d("WASmaxInNewslettersMyAddOnsResponseServerError").parseMyAddOnsResponseServerError(b,a);if(b.success)return{name:"MyAddOnsResponseServerError",value:b.value};throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(d("WASmaxRpcUtils").errorMessageRpcParsing("MyAddOns",{Success:c,ClientError:e,ServerError:b}))});return h.apply(this,arguments)}g.sendMyAddOnsRPC=a}),98); __d("WASmaxOutPreKeysFetchMissingPreKeysRequest",["WASmaxAttrs","WASmaxChildren","WASmaxJsx","WASmaxOutPreKeysClientRequestMixin","WASmaxOutPreKeysRegistrationIDMixin","WAWap"],(function(a,b,c,d,e,f,g){function h(a){var b=a.deviceId;b=d("WASmaxOutPreKeysRegistrationIDMixin").mergeRegistrationIDMixin(d("WASmaxJsx").smax("device",{id:d("WAWap").INT(b)}),a);return b}function i(a){var b=a.deviceArgs,c=a.userJid;a=a.hasUserReasonIdentity;c=d("WASmaxJsx").smax("user",{jid:d("WAWap").JID(c),reason:d("WASmaxAttrs").OPTIONAL_LITERAL("identity",a)},d("WASmaxChildren").REPEATED_CHILD(h,b,0,100));return c}function a(a){a=a.userArgs;a=d("WASmaxOutPreKeysClientRequestMixin").mergeClientRequestMixin(d("WASmaxJsx").smax("iq",{type:"get"},d("WASmaxJsx").smax("key_fetch",null,d("WASmaxChildren").REPEATED_CHILD(i,a,1,1e5))));return a}g.makeFetchMissingPreKeysRequestKeyFetchUserDevice=h;g.makeFetchMissingPreKeysRequestKeyFetchUser=i;g.makeFetchMissingPreKeysRequest=a}),98); __d("WASmaxOutPresencePrivacyTokenContentsMixin",["WASmaxJsx","WASmaxMixins"],(function(a,b,c,d,e,f,g){function h(a){a=a.anyElementValue;a=d("WASmaxJsx").smax("smax$any",null,a);return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergePrivacyTokenContentsMixin=a}),98); __d("WASmaxOutPresenceTCTokenMixin",["WASmaxAttrs","WASmaxJsx","WASmaxMixins","WASmaxOutPresencePrivacyTokenContentsMixin","WAWap"],(function(a,b,c,d,e,f,g){function h(a){var b=a.tctokenT;a=a.privacyTokenContentsMixinArgs;b=d("WASmaxJsx").smax("smax$any",null,d("WASmaxOutPresencePrivacyTokenContentsMixin").mergePrivacyTokenContentsMixin(d("WASmaxJsx").smax("tctoken",{t:d("WASmaxAttrs").OPTIONAL(d("WAWap").INT,b)}),a));return b}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeTCTokenMixin=a}),98); __d("WASmaxOutPresenceSubscribeRequest",["WASmaxAttrs","WASmaxJsx","WASmaxMixins","WASmaxOutPresenceTCTokenMixin","WAWap"],(function(a,b,c,d,e,f,g){function a(a){var b=a.presenceTo,c=a.presenceName,e=a.presenceContext;a=a.tCTokenMixinArgs;b=d("WASmaxMixins").optionalMerge(d("WASmaxOutPresenceTCTokenMixin").mergeTCTokenMixin,d("WASmaxJsx").smax("presence",{type:"subscribe",to:d("WAWap").JID(b),name:d("WASmaxAttrs").OPTIONAL(d("WAWap").CUSTOM_STRING,c),context:d("WASmaxAttrs").OPTIONAL(d("WAWap").GROUP_JID,e)}),a);return b}g.makeSubscribeRequest=a}),98); __d("WASmaxOutProfilePictureAddRequestMixin",["WASmaxAttrs","WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(a){var b=a.addRequestCode,c=a.addRequestAdmin;a=a.addRequestExpiration;b=d("WASmaxJsx").smax("picture",null,d("WASmaxJsx").smax("add_request",{code:d("WAWap").CUSTOM_STRING(b),admin:d("WASmaxAttrs").OPTIONAL(d("WAWap").USER_JID,c),expiration:d("WAWap").INT(a)}));return b}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeAddRequestMixin=a}),98); __d("WASmaxOutProfilePictureAvatarMixin",["WASmaxChildren","WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(a){a=a.avatarPoseId;a=d("WASmaxJsx").smax("avatar",{pose_id:d("WAWap").CUSTOM_STRING(a)});return a}function i(a){a=a.avatarArgs;a=d("WASmaxJsx").smax("picture",{type:"avatar"},d("WASmaxChildren").REPEATED_CHILD(h,a,0,4));return a}function a(a,b){b=i(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.makeAvatarAvatar=h;g.mergeAvatarMixin=a}),98); __d("WASmaxOutProfilePictureBaseIQGetRequestMixin",["WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxJsx").smax("iq",{id:d("WAWap").generateId(),type:"get"});return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeBaseIQGetRequestMixin=a}),98); __d("WASmaxOutProfilePictureBaseGetIQMixin",["WASmaxJsx","WASmaxMixins","WASmaxOutProfilePictureBaseIQGetRequestMixin"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxOutProfilePictureBaseIQGetRequestMixin").mergeBaseIQGetRequestMixin(d("WASmaxJsx").smax("iq",{xmlns:"w:profile:picture"}));return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeBaseGetIQMixin=a}),98); __d("WASmaxOutProfilePictureServerDomainIQMixin",["WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxJsx").smax("iq",{to:d("WAWap").S_WHATSAPP_NET});return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeServerDomainIQMixin=a}),98); __d("WASmaxOutProfilePictureGetIQMixin",["WASmaxJsx","WASmaxMixins","WASmaxOutProfilePictureServerDomainIQMixin","WAWap"],(function(a,b,c,d,e,f,g){function h(a){a=a.iqTarget;a=d("WASmaxOutProfilePictureServerDomainIQMixin").mergeServerDomainIQMixin(d("WASmaxJsx").smax("iq",{target:d("WAWap").JID(a)}));return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeGetIQMixin=a}),98); __d("WASmaxOutProfilePicturePrivacyTokenContentsMixin",["WASmaxJsx","WASmaxMixins"],(function(a,b,c,d,e,f,g){function h(a){a=a.anyElementValue;a=d("WASmaxJsx").smax("smax$any",null,a);return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergePrivacyTokenContentsMixin=a}),98); __d("WASmaxOutProfilePictureTCTokenMixin",["WASmaxAttrs","WASmaxJsx","WASmaxMixins","WASmaxOutProfilePicturePrivacyTokenContentsMixin","WAWap"],(function(a,b,c,d,e,f,g){function h(a){var b=a.tctokenT;a=a.privacyTokenContentsMixinArgs;b=d("WASmaxJsx").smax("smax$any",null,d("WASmaxOutProfilePicturePrivacyTokenContentsMixin").mergePrivacyTokenContentsMixin(d("WASmaxJsx").smax("tctoken",{t:d("WASmaxAttrs").OPTIONAL(d("WAWap").INT,b)}),a));return b}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeTCTokenMixin=a}),98); __d("WASmaxOutProfilePictureGetRequest",["WASmaxAttrs","WASmaxJsx","WASmaxMixins","WASmaxOutProfilePictureAddRequestMixin","WASmaxOutProfilePictureAvatarMixin","WASmaxOutProfilePictureBaseGetIQMixin","WASmaxOutProfilePictureGetIQMixin","WASmaxOutProfilePictureTCTokenMixin","WAWap"],(function(a,b,c,d,e,f,g){function a(a){var b,c,e=a.pictureType,f=a.pictureId,g=a.pictureQuery,h=a.pictureInvite,i=a.picturePersonaId,j=a.pictureCommonGid,k=a.addRequestMixinArgs,l=a.tCTokenMixinArgs,m=a.avatarMixinArgs;e=d("WASmaxOutProfilePictureGetIQMixin").mergeGetIQMixin(d("WASmaxOutProfilePictureBaseGetIQMixin").mergeBaseGetIQMixin(d("WASmaxJsx").smax("iq",null,d("WASmaxMixins").optionalMerge(d("WASmaxOutProfilePictureAvatarMixin").mergeAvatarMixin,d("WASmaxMixins").optionalMerge(d("WASmaxOutProfilePictureTCTokenMixin").mergeTCTokenMixin,d("WASmaxMixins").optionalMerge(d("WASmaxOutProfilePictureAddRequestMixin").mergeAddRequestMixin,d("WASmaxJsx").smax("picture",{type:(b=d("WASmaxAttrs")).OPTIONAL((c=d("WAWap")).CUSTOM_STRING,e),id:b.OPTIONAL(c.CUSTOM_STRING,f),query:b.OPTIONAL(c.CUSTOM_STRING,g),invite:b.OPTIONAL(c.CUSTOM_STRING,h),persona_id:b.OPTIONAL(c.CUSTOM_STRING,i),common_gid:b.OPTIONAL(c.GROUP_JID,j)}),k),l),m))),a);return e}g.makeGetRequest=a}),98); __d("WASmaxOutPsaBaseIQGetRequestMixin",["WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxJsx").smax("iq",{id:d("WAWap").generateId(),type:"get"});return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeBaseIQGetRequestMixin=a}),98); __d("WASmaxOutPsaBaseIQSetRequestMixin",["WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxJsx").smax("iq",{id:d("WAWap").generateId(),type:"set"});return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeBaseIQSetRequestMixin=a}),98); __d("WASmaxOutPsaChatBlockGetRequest",["WASmaxJsx","WASmaxOutPsaBaseIQGetRequestMixin","WAWap"],(function(a,b,c,d,e,f,g){function a(){var a=d("WASmaxOutPsaBaseIQGetRequestMixin").mergeBaseIQGetRequestMixin(d("WASmaxJsx").smax("iq",{to:d("WAWap").S_WHATSAPP_NET,xmlns:"w:comms:chat"},d("WASmaxJsx").smax("query",null,d("WASmaxJsx").smax("blocking_status",null))));return a}g.makeChatBlockGetRequest=a}),98); __d("WASmaxOutPsaChatBlockSetRequest",["WASmaxJsx","WASmaxOutPsaBaseIQSetRequestMixin","WAWap"],(function(a,b,c,d,e,f,g){function a(a){a=a.blockingAction;a=d("WASmaxOutPsaBaseIQSetRequestMixin").mergeBaseIQSetRequestMixin(d("WASmaxJsx").smax("iq",{to:d("WAWap").S_WHATSAPP_NET,xmlns:"w:comms:chat"},d("WASmaxJsx").smax("blocking",{action:d("WAWap").CUSTOM_STRING(a)})));return a}g.makeChatBlockSetRequest=a}),98); __d("WASmaxOutPsaNotificationClientAckMixin",["WASmaxInPsaEnums","WASmaxJsx","WASmaxMixins","WASmaxParseJid","WASmaxParseReference","WASmaxParseUtils","WASmaxParsingFailure","WAWap"],(function(a,b,c,d,e,f,g){function h(a){var b=d("WASmaxParseReference").attrFromReference(d("WASmaxParseUtils").attrStanzaId,a,["id"]);if(!b.success)throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(b.error);var c=d("WASmaxParseReference").attrFromReference(d("WASmaxParseJid").attrJidEnum,a,["from"],d("WASmaxInPsaEnums").STATUSJID_USERJID);if(!c.success)throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(c.error);a=d("WASmaxParseReference").attrFromReference(d("WASmaxParseUtils").attrString,a,["type"]);if(!a.success)throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(a.error);b=d("WASmaxJsx").smax("ack",{id:d("WAWap").STANZA_ID(b.value),to:d("WAWap").JID(c.value),"class":"notification",type:d("WAWap").CUSTOM_STRING(a.value)});return b}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeNotificationClientAckMixin=a}),98); __d("WASmaxOutPsaResetSmbLastQpPrefetchTimestampResponseAck",["WASmaxJsx","WASmaxOutPsaNotificationClientAckMixin"],(function(a,b,c,d,e,f,g){function a(a){a=d("WASmaxOutPsaNotificationClientAckMixin").mergeNotificationClientAckMixin(d("WASmaxJsx").smax("ack",null),a);return a}g.makeResetSmbLastQpPrefetchTimestampResponseAck=a}),98); __d("WASmaxOutQpSurfacesNotificationClientAckMixin",["WASmaxJsx","WASmaxMixins","WASmaxParseJid","WASmaxParseReference","WASmaxParseUtils","WASmaxParsingFailure","WAWap"],(function(a,b,c,d,e,f,g){function h(a){var b=d("WASmaxParseReference").attrFromReference(d("WASmaxParseUtils").attrStanzaId,a,["id"]);if(!b.success)throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(b.error);var c=d("WASmaxParseReference").attrFromReference(d("WASmaxParseJid").attrUserJid,a,["from"]);if(!c.success)throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(c.error);a=d("WASmaxParseReference").attrFromReference(d("WASmaxParseUtils").attrString,a,["type"]);if(!a.success)throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(a.error);b=d("WASmaxJsx").smax("ack",{id:d("WAWap").STANZA_ID(b.value),to:d("WAWap").USER_JID(c.value),"class":"notification",type:d("WAWap").CUSTOM_STRING(a.value)});return b}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeNotificationClientAckMixin=a}),98); __d("WASmaxOutQpSurfacesQPNotificationResponseAck",["WASmaxJsx","WASmaxOutQpSurfacesNotificationClientAckMixin"],(function(a,b,c,d,e,f,g){function a(a){a=d("WASmaxOutQpSurfacesNotificationClientAckMixin").mergeNotificationClientAckMixin(d("WASmaxJsx").smax("ack",null),a);return a}g.makeQPNotificationResponseAck=a}),98); __d("WASmaxOutSpamAdminRevokeMixin",["WASmaxJsx","WASmaxMixins"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxJsx").smax("message",{edit:"8"});return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeAdminRevokeMixin=a}),98); __d("WASmaxOutSpamAutomatedMixin",["WASmaxJsx","WASmaxMixins"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxJsx").smax("message",null,d("WASmaxJsx").smax("automated",null));return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeAutomatedMixin=a}),98); __d("WASmaxOutSpamBaseIQSetRequestMixin",["WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxJsx").smax("iq",{id:d("WAWap").generateId(),type:"set"});return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeBaseIQSetRequestMixin=a}),98); __d("WASmaxOutSpamBaseReportMixin",["WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(a){a=a.spamListSpamFlow;a=d("WASmaxJsx").smax("iq",{to:d("WAWap").S_WHATSAPP_NET,xmlns:"spam"},d("WASmaxJsx").smax("spam_list",{spam_flow:d("WAWap").CUSTOM_STRING(a)}));return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeBaseReportMixin=a}),98); __d("WASmaxOutSpamBizOptOutMixin",["WASmaxAttrs","WASmaxChildren","WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(a){var b,c,e=a.bizOptOutReason,f=a.bizOptOutBusinessDiscoveryEntryPoint,g=a.bizOptOutBusinessDiscoveryTimestamp,h=a.bizOptOutFirstMessage;a=a.bizOptOutBusinessDiscoveryId;e=d("WASmaxJsx").smax("biz_opt_out",{reason:(b=d("WASmaxAttrs")).OPTIONAL((c=d("WAWap")).CUSTOM_STRING,e),business_discovery_entry_point:b.OPTIONAL(c.CUSTOM_STRING,f),business_discovery_timestamp:b.OPTIONAL(c.INT,g),first_message:b.OPTIONAL(c.CUSTOM_STRING,h),business_discovery_id:b.OPTIONAL(c.CUSTOM_STRING,a)});return e}function i(a){a=a.bizOptOutArgs;a=d("WASmaxJsx").smax("spam_list",null,d("WASmaxChildren").OPTIONAL_CHILD(h,a));return a}function a(a,b){b=i(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.makeBizOptOutBizOptOut=h;g.mergeBizOptOutMixin=a}),98); __d("WASmaxOutSpamBizReportMixin",["WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(a){var b=a.bizApiReportKnownAccount;a=a.bizApiReportMessageReport;b=d("WASmaxJsx").smax("spam_list",null,d("WASmaxJsx").smax("biz_api_report",{known_account:d("WAWap").CUSTOM_STRING(b),message_report:d("WAWap").CUSTOM_STRING(a)}));return b}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeBizReportMixin=a}),98); __d("WASmaxOutSpamCallReportMixin",["WASmaxAttrs","WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(a){var b,c=a.callTo,e=a.callFrom,f=a.callId,g=a.callInfoDuration,h=a.callInfoTerminateReason,i=a.callInfoReason,j=a.callInfoTerminator,k=a.callInfoStartTime,l=a.callInfoAdder,m=a.callInfoCreator;a=a.callInfoMediatype;e=d("WASmaxJsx").smax("call",{to:(b=d("WAWap")).JID(c),from:b.USER_JID(e),id:b.STANZA_ID(f)},d("WASmaxJsx").smax("call_info",{duration:b.INT(g),terminate_reason:(c=d("WASmaxAttrs")).OPTIONAL(b.CUSTOM_STRING,h),reason:c.OPTIONAL(b.CUSTOM_STRING,i),terminator:c.OPTIONAL(b.USER_JID,j),start_time:c.OPTIONAL(b.INT,k),adder:c.OPTIONAL(b.USER_JID,l),creator:c.OPTIONAL(b.USER_JID,m),mediatype:c.OPTIONAL(b.CUSTOM_STRING,a)}));return e}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeCallReportMixin=a}),98); __d("WASmaxOutSpamClientFrankingTagMixin",["WASmaxJsx","WASmaxMixins"],(function(a,b,c,d,e,f,g){function h(a){a=a.frankingTagElementValue;a=d("WASmaxJsx").smax("smax$any",null,d("WASmaxJsx").smax("franking",null,d("WASmaxJsx").smax("franking_tag",null,a)));return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeClientFrankingTagMixin=a}),98); __d("WASmaxOutSpamClientReportingContentValidationMixin",["WASmaxAttrs","WASmaxChildren","WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(a){var b=a.reportingContentArgs,c=a.contentValidationArgs,e=a.reportingAdditionalInfoArgs,f=a.reportingTagId,g=a.reportingTagTsS;a=a.reportingTagElementValue;f=d("WASmaxJsx").smax("reporting_validation",null,d("WASmaxJsx").smax("reporting_tag",{id:d("WAWap").STANZA_ID(f),ts_s:d("WAWap").INT(g)},a),d("WASmaxChildren").OPTIONAL_CHILD(i,b),d("WASmaxChildren").OPTIONAL_CHILD(j,c),d("WASmaxChildren").OPTIONAL_CHILD(k,e));return f}function i(a){a=a.reportingContentElementValue;a=d("WASmaxJsx").smax("reporting_content",null,a);return a}function j(a){var b=a.contentValidationType,c=a.reportingTokenV,e=a.reportingTokenElementValue;a=a.reportingTokenKeyElementValue;b=d("WASmaxJsx").smax("content_validation",{type:d("WASmaxAttrs").OPTIONAL(d("WAWap").CUSTOM_STRING,b)},d("WASmaxJsx").smax("reporting_token",{v:d("WAWap").INT(c)},e),d("WASmaxJsx").smax("reporting_token_key",null,a));return b}function k(a){a=a.reportingAdditionalInfoText;a=d("WASmaxJsx").smax("reporting_additional_info",{text:d("WAWap").CUSTOM_STRING(a)});return a}function l(a){a=a.reportingValidationArgs;a=d("WASmaxJsx").smax("smax$any",null,d("WASmaxJsx").smax("reporting",null,d("WASmaxChildren").REPEATED_CHILD(h,a,0,1e3)));return a}function a(a,b){b=l(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.makeClientReportingContentValidationReportingReportingValidation=h;g.makeClientReportingContentValidationReportingReportingValidationReportingContent=i;g.makeClientReportingContentValidationReportingReportingValidationContentValidation=j;g.makeClientReportingContentValidationReportingReportingValidationReportingAdditionalInfo=k;g.mergeClientReportingContentValidationMixin=a}),98); __d("WASmaxOutSpamClientReportingTokenMixin",["WASmaxAttrs","WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(a){var b=a.reportingTokenV;a=a.reportingTokenElementValue;b=d("WASmaxJsx").smax("smax$any",null,d("WASmaxJsx").smax("reporting",null,d("WASmaxJsx").smax("reporting_token",{v:d("WASmaxAttrs").OPTIONAL(d("WAWap").INT,b)},a)));return b}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeClientReportingTokenMixin=a}),98); __d("WASmaxOutSpamContentTypeMediaMixin",["WASmaxJsx","WASmaxMixins"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxJsx").smax("message",{type:"media"});return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeContentTypeMediaMixin=a}),98); __d("WASmaxOutSpamContentTypePayMixin",["WASmaxJsx","WASmaxMixins"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxJsx").smax("message",{type:"pay"});return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeContentTypePayMixin=a}),98); __d("WASmaxOutSpamContentTypePollCreationMixin",["WASmaxAttrs","WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(a){a=a.metaContenttype;a=d("WASmaxJsx").smax("message",{type:"poll"},d("WASmaxJsx").smax("meta",{polltype:"creation",contenttype:d("WASmaxAttrs").OPTIONAL(d("WAWap").CUSTOM_STRING,a)}));return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeContentTypePollCreationMixin=a}),98); __d("WASmaxOutSpamContentTypeTextMixin",["WASmaxJsx","WASmaxMixins"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxJsx").smax("message",{type:"text"});return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeContentTypeTextMixin=a}),98); __d("WASmaxOutSpamContentTypeTextOrMediaMixinGroup",["WASmaxMixinGroupExhaustiveError","WASmaxOutSpamContentTypeMediaMixin","WASmaxOutSpamContentTypeTextMixin"],(function(a,b,c,d,e,f,g){function a(a,b){if(b.isContentTypeText)return d("WASmaxOutSpamContentTypeTextMixin").mergeContentTypeTextMixin(a);if(b.isContentTypeMedia)return d("WASmaxOutSpamContentTypeMediaMixin").mergeContentTypeMediaMixin(a);throw new(d("WASmaxMixinGroupExhaustiveError").SmaxMixinGroupExhaustiveError)()}g.mergeContentTypeTextOrMediaMixinGroup=a}),98); __d("WASmaxOutSpamEntitySubjectMixin",["WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(a){a=a.spamListSubject;a=d("WASmaxJsx").smax("iq",null,d("WASmaxJsx").smax("spam_list",{subject:d("WAWap").CUSTOM_STRING(a)}));return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeEntitySubjectMixin=a}),98); __d("WASmaxOutSpamExtensionScreenMixin",["WASmaxAttrs","WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(a){var b,c=a.extensionScreenExtensionId,e=a.extensionScreenSessionId,f=a.extensionScreenT,g=a.extensionScreenName,h=a.extensionScreenEntryPoint;a=a.dataElementValue;c=d("WASmaxJsx").smax("extension_screen",{extension_id:(b=d("WAWap")).CUSTOM_STRING(c),session_id:b.CUSTOM_STRING(e),t:b.INT(f),name:b.CUSTOM_STRING(g),entry_point:d("WASmaxAttrs").OPTIONAL(b.CUSTOM_STRING,h)},d("WASmaxJsx").smax("data",null,a));return c}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeExtensionScreenMixin=a}),98); __d("WASmaxOutSpamExtensionScreenDataMixin",["WASmaxChildren","WASmaxJsx","WASmaxMixins","WASmaxOutSpamExtensionScreenMixin"],(function(a,b,c,d,e,f,g){function h(a){a=d("WASmaxOutSpamExtensionScreenMixin").mergeExtensionScreenMixin(d("WASmaxJsx").smax("extension_screen",null),a);return a}function i(a){a=a.extensionScreenArgs;a=d("WASmaxJsx").smax("message",null,d("WASmaxChildren").REPEATED_CHILD(h,a,1,100));return a}function a(a,b){b=i(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.makeExtensionScreenDataExtensionScreen=h;g.mergeExtensionScreenDataMixin=a}),98); __d("WASmaxOutSpamFRXMixin",["WASmaxChildren","WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(a){a=a.tagValue;a=d("WASmaxJsx").smax("tag",{value:d("WAWap").CUSTOM_STRING(a)});return a}function i(a){a=a.parametersElementValue;a=d("WASmaxJsx").smax("parameters",null,a);return a}function j(a){var b,c=a.tagArgs,e=a.parametersArgs,f=a.spamListReportee;a=a.contextElementValue;f=(b=d("WASmaxJsx")).smax("iq",null,b.smax("spam_list",{reportee:d("WAWap").USER_JID(f)}),b.smax("frx",null,b.smax("tagset",null,d("WASmaxChildren").REPEATED_CHILD(h,c,0,20)),b.smax("context",null,a),d("WASmaxChildren").OPTIONAL_CHILD(i,e)));return f}function a(a,b){b=j(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.makeFRXFrxTagsetTag=h;g.makeFRXFrxParameters=i;g.mergeFRXMixin=a}),98); __d("WASmaxOutSpamIABReportLinkMixin",["WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(a){a=a.iabReportedLink;a=d("WASmaxJsx").smax("message",null,d("WASmaxJsx").smax("iab",{reported_link:d("WAWap").CUSTOM_STRING(a)}));return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeIABReportLinkMixin=a}),98); __d("WASmaxOutSpamMessageEditMixin",["WASmaxJsx","WASmaxMixins"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxJsx").smax("message",{edit:"1"});return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeMessageEditMixin=a}),98); __d("WASmaxOutSpamRawV3Mixin",["WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(a){a=a.rawProtocolV;a=d("WASmaxJsx").smax("raw",{v:d("WAWap").INT(3),protocol_v:d("WAWap").INT(a)});return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeRawV3Mixin=a}),98); __d("WASmaxOutSpamServerFrankingTagMixin",["WASmaxJsx","WASmaxMixins"],(function(a,b,c,d,e,f,g){function h(a){a=a.reportingTagElementValue;a=d("WASmaxJsx").smax("smax$any",null,d("WASmaxJsx").smax("franking",null,d("WASmaxJsx").smax("reporting_tag",null,a)));return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeServerFrankingTagMixin=a}),98); __d("WASmaxOutSpamMessageFrankingMixin",["WASmaxChildren","WASmaxJsx","WASmaxMixins","WASmaxOutSpamClientFrankingTagMixin","WASmaxOutSpamRawV3Mixin","WASmaxOutSpamServerFrankingTagMixin"],(function(a,b,c,d,e,f,g){function h(a){a=d("WASmaxOutSpamRawV3Mixin").mergeRawV3Mixin(d("WASmaxJsx").smax("raw",null),a);return a}function i(a){var b=a.rawArgs,c=a.clientFrankingTagMixinArgs;b=d("WASmaxOutSpamServerFrankingTagMixin").mergeServerFrankingTagMixin(d("WASmaxMixins").optionalMerge(d("WASmaxOutSpamClientFrankingTagMixin").mergeClientFrankingTagMixin,d("WASmaxJsx").smax("message",null,d("WASmaxChildren").OPTIONAL_CHILD(h,b)),c),a);return b}function a(a,b){b=i(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.makeMessageFrankingRaw=h;g.mergeMessageFrankingMixin=a}),98); __d("WASmaxOutSpamMessageParticipantMixin",["WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(a){a=a.messageParticipant;a=d("WASmaxJsx").smax("message",{participant:d("WAWap").USER_JID(a)});return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeMessageParticipantMixin=a}),98); __d("WASmaxOutSpamReportPayNodeMixin",["WASmaxAttrs","WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(a){var b,c=a.payType,e=a.payId,f=a.paySender;a=a.payReceiver;c=d("WASmaxJsx").smax("pay",{type:(b=d("WAWap")).CUSTOM_STRING(c),id:d("WASmaxAttrs").OPTIONAL(b.CUSTOM_STRING,e),sender:d("WASmaxAttrs").OPTIONAL(b.USER_JID,f),receiver:d("WASmaxAttrs").OPTIONAL(b.USER_JID,a)});return c}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeReportPayNodeMixin=a}),98); __d("WASmaxOutSpamMessageWithPaymentReportMixin",["WASmaxJsx","WASmaxMixins","WASmaxOutSpamContentTypePayMixin","WASmaxOutSpamReportPayNodeMixin"],(function(a,b,c,d,e,f,g){function h(a){a=a.reportPayNodeMixinArgs;a=d("WASmaxOutSpamContentTypePayMixin").mergeContentTypePayMixin(d("WASmaxJsx").smax("message",null,d("WASmaxOutSpamReportPayNodeMixin").mergeReportPayNodeMixin(d("WASmaxJsx").smax("pay",null),a)));return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeMessageWithPaymentReportMixin=a}),98); __d("WASmaxOutSpamMessageWithPollMixin",["WASmaxJsx","WASmaxMixins","WASmaxOutSpamContentTypePollCreationMixin"],(function(a,b,c,d,e,f,g){function h(a){a=d("WASmaxOutSpamContentTypePollCreationMixin").mergeContentTypePollCreationMixin(d("WASmaxJsx").smax("message",null),a);return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeMessageWithPollMixin=a}),98); __d("WASmaxOutSpamMessageWithTypeMixin",["WASmaxJsx","WASmaxMixins","WASmaxOutSpamContentTypeTextOrMediaMixinGroup"],(function(a,b,c,d,e,f,g){function h(a){a=a.contentTypeTextOrMediaMixinGroupArgs;a=d("WASmaxOutSpamContentTypeTextOrMediaMixinGroup").mergeContentTypeTextOrMediaMixinGroup(d("WASmaxJsx").smax("message",null),a);return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeMessageWithTypeMixin=a}),98); __d("WASmaxOutSpamMessagePayloadTypes",["WASmaxMixinGroupExhaustiveError","WASmaxOutSpamMessageWithPaymentReportMixin","WASmaxOutSpamMessageWithPollMixin","WASmaxOutSpamMessageWithTypeMixin"],(function(a,b,c,d,e,f,g){function a(a,b){if(b.messageWithPaymentReport)return d("WASmaxOutSpamMessageWithPaymentReportMixin").mergeMessageWithPaymentReportMixin(a,b.messageWithPaymentReport);if(b.messageWithType)return d("WASmaxOutSpamMessageWithTypeMixin").mergeMessageWithTypeMixin(a,b.messageWithType);if(b.messageWithPoll)return d("WASmaxOutSpamMessageWithPollMixin").mergeMessageWithPollMixin(a,b.messageWithPoll);throw new(d("WASmaxMixinGroupExhaustiveError").SmaxMixinGroupExhaustiveError)()}g.mergeMessagePayloadTypes=a}),98); __d("WASmaxOutSpamMessageWithHsmTemplateMixin",["WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(a){a=a.hsmTid;a=d("WASmaxJsx").smax("message",null,d("WASmaxJsx").smax("hsm",{tid:d("WAWap").CUSTOM_STRING(a)}));return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeMessageWithHsmTemplateMixin=a}),98); __d("WASmaxOutSpamMulticastMixin",["WASmaxJsx","WASmaxMixins"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxJsx").smax("message",null,d("WASmaxJsx").smax("multicast",null));return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeMulticastMixin=a}),98); __d("WASmaxOutSpamPreFilledNumberMixin",["WASmaxJsx","WASmaxMixins"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxJsx").smax("message",null,d("WASmaxJsx").smax("url_number",null));return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergePreFilledNumberMixin=a}),98); __d("WASmaxOutSpamPreFilledTextMixin",["WASmaxJsx","WASmaxMixins"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxJsx").smax("message",null,d("WASmaxJsx").smax("url_text",null));return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergePreFilledTextMixin=a}),98); __d("WASmaxOutSpamRawV2Mixin",["WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxJsx").smax("raw",{v:d("WAWap").INT(2)});return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeRawV2Mixin=a}),98); __d("WASmaxOutSpamRawMixins",["WASmaxMixinGroupExhaustiveError","WASmaxOutSpamRawV2Mixin","WASmaxOutSpamRawV3Mixin"],(function(a,b,c,d,e,f,g){function a(a,b){if(b.isRawV2)return d("WASmaxOutSpamRawV2Mixin").mergeRawV2Mixin(a);if(b.rawV3)return d("WASmaxOutSpamRawV3Mixin").mergeRawV3Mixin(a,b.rawV3);throw new(d("WASmaxMixinGroupExhaustiveError").SmaxMixinGroupExhaustiveError)()}g.mergeRawMixins=a}),98); __d("WASmaxOutSpamRevokeMixin",["WASmaxJsx","WASmaxMixins"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxJsx").smax("message",{edit:"7"});return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeRevokeMixin=a}),98); __d("WASmaxOutSpamSMBBroadcastSourceMixin",["WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(a){a=a.metaBizSource;a=d("WASmaxJsx").smax("message",null,d("WASmaxJsx").smax("meta",{biz_source:d("WAWap").CUSTOM_STRING(a)}));return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeSMBBroadcastSourceMixin=a}),98); __d("WASmaxOutSpamServerReportingTokenMixin",["WASmaxJsx","WASmaxMixins"],(function(a,b,c,d,e,f,g){function h(a){a=a.reportingTagElementValue;a=d("WASmaxJsx").smax("smax$any",null,d("WASmaxJsx").smax("reporting",null,d("WASmaxJsx").smax("reporting_tag",null,a)));return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeServerReportingTokenMixin=a}),98); __d("WASmaxOutSpamWaMessageReportingMixin",["WASmaxChildren","WASmaxJsx","WASmaxMixins","WASmaxOutSpamClientReportingContentValidationMixin","WASmaxOutSpamClientReportingTokenMixin","WASmaxOutSpamRawV2Mixin","WASmaxOutSpamServerReportingTokenMixin"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxOutSpamRawV2Mixin").mergeRawV2Mixin(d("WASmaxJsx").smax("raw",null));return a}function i(a){var b=a.hasRaw,c=a.clientReportingContentValidationMixinArgs,e=a.clientReportingTokenMixinArgs;a=a.serverReportingTokenMixinArgs;b=d("WASmaxMixins").optionalMerge(d("WASmaxOutSpamServerReportingTokenMixin").mergeServerReportingTokenMixin,d("WASmaxMixins").optionalMerge(d("WASmaxOutSpamClientReportingTokenMixin").mergeClientReportingTokenMixin,d("WASmaxMixins").optionalMerge(d("WASmaxOutSpamClientReportingContentValidationMixin").mergeClientReportingContentValidationMixin,d("WASmaxJsx").smax("message",null,d("WASmaxChildren").HAS_OPTIONAL_CHILD(h,b)),c),e),a);return b}function a(a,b){b=i(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.makeWaMessageReportingRaw=h;g.mergeWaMessageReportingMixin=a}),98); __d("WASmaxOutSpamMessageMixin",["WASmaxAttrs","WASmaxChildren","WASmaxJsx","WASmaxMixins","WASmaxOutSpamAdminRevokeMixin","WASmaxOutSpamAutomatedMixin","WASmaxOutSpamExtensionScreenDataMixin","WASmaxOutSpamIABReportLinkMixin","WASmaxOutSpamMessageEditMixin","WASmaxOutSpamMessageFrankingMixin","WASmaxOutSpamMessageParticipantMixin","WASmaxOutSpamMessagePayloadTypes","WASmaxOutSpamMessageWithHsmTemplateMixin","WASmaxOutSpamMulticastMixin","WASmaxOutSpamPreFilledNumberMixin","WASmaxOutSpamPreFilledTextMixin","WASmaxOutSpamRawMixins","WASmaxOutSpamRevokeMixin","WASmaxOutSpamSMBBroadcastSourceMixin","WASmaxOutSpamWaMessageReportingMixin","WAWap"],(function(a,b,c,d,e,f,g){function h(a){var b=a.rawMediatype,c=a.rawElementValue;a=a.rawMixinsArgs;b=d("WASmaxOutSpamRawMixins").mergeRawMixins(d("WASmaxJsx").smax("raw",{mediatype:d("WASmaxAttrs").OPTIONAL(d("WAWap").CUSTOM_STRING,b)},c),a);return b}function a(){var a=d("WASmaxJsx").smax("enc",null);return a}function i(a){var b,c=a.rawArgs,e=a.messageT,f=a.messageId,g=a.messageSelected,i=a.messageUnsent,j=a.messageDeletedReason,k=a.hasRevoke,l=a.hasAdminRevoke,m=a.hasMessageEdit,n=a.hasMulticast,o=a.hasPreFilledNumber,p=a.hasPreFilledText,q=a.hasAutomated,r=a.messageWithHsmTemplateMixinArgs,s=a.extensionScreenDataMixinArgs,t=a.messageParticipantMixinArgs,u=a.messageFrankingMixinArgs,v=a.waMessageReportingMixinArgs,w=a.sMBBroadcastSourceMixinArgs,x=a.iABReportLinkMixinArgs;a=a.messagePayloadTypesArgs;e=d("WASmaxOutSpamMessagePayloadTypes").mergeMessagePayloadTypes((b=d("WASmaxMixins")).optionalMerge(d("WASmaxOutSpamIABReportLinkMixin").mergeIABReportLinkMixin,b.optionalMerge(d("WASmaxOutSpamSMBBroadcastSourceMixin").mergeSMBBroadcastSourceMixin,b.optionalMerge(d("WASmaxOutSpamWaMessageReportingMixin").mergeWaMessageReportingMixin,b.optionalMerge(d("WASmaxOutSpamMessageFrankingMixin").mergeMessageFrankingMixin,b.optionalMerge(d("WASmaxOutSpamMessageParticipantMixin").mergeMessageParticipantMixin,b.optionalMerge(d("WASmaxOutSpamExtensionScreenDataMixin").mergeExtensionScreenDataMixin,b.optionalMerge(d("WASmaxOutSpamMessageWithHsmTemplateMixin").mergeMessageWithHsmTemplateMixin,b.optionalMerge(d("WASmaxOutSpamAutomatedMixin").mergeAutomatedMixin,b.optionalMerge(d("WASmaxOutSpamPreFilledTextMixin").mergePreFilledTextMixin,b.optionalMerge(d("WASmaxOutSpamPreFilledNumberMixin").mergePreFilledNumberMixin,b.optionalMerge(d("WASmaxOutSpamMulticastMixin").mergeMulticastMixin,b.optionalMerge(d("WASmaxOutSpamMessageEditMixin").mergeMessageEditMixin,b.optionalMerge(d("WASmaxOutSpamAdminRevokeMixin").mergeAdminRevokeMixin,b.optionalMerge(d("WASmaxOutSpamRevokeMixin").mergeRevokeMixin,d("WASmaxJsx").smax("message",{t:(b=d("WAWap")).INT(e),id:b.STANZA_ID(f),selected:d("WASmaxAttrs").OPTIONAL(b.CUSTOM_STRING,g),unsent:d("WASmaxAttrs").OPTIONAL(b.CUSTOM_STRING,i),deleted_reason:d("WASmaxAttrs").OPTIONAL(b.CUSTOM_STRING,j)},d("WASmaxChildren").OPTIONAL_CHILD(h,c)),k),l),m),n),o),p),q),r),s),t),u),v),w),x),a);return e}function b(a,b){b=i(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.makeMessageRaw=h;g.makeMessageEnc=a;g.mergeMessageMixin=b}),98); __d("WASmaxOutSpamGroupReportRequest",["WASmaxAttrs","WASmaxChildren","WASmaxJsx","WASmaxMixins","WASmaxOutSpamBaseIQSetRequestMixin","WASmaxOutSpamBaseReportMixin","WASmaxOutSpamCallReportMixin","WASmaxOutSpamEntitySubjectMixin","WASmaxOutSpamFRXMixin","WASmaxOutSpamMessageMixin","WAWap"],(function(a,b,c,d,e,f,g){function h(a){var b=a.messageFrom,c=a.messagePhash;b=d("WASmaxOutSpamMessageMixin").mergeMessageMixin(d("WASmaxJsx").smax("message",{from:d("WAWap").GROUP_JID(b),phash:d("WASmaxAttrs").OPTIONAL(d("WAWap").CUSTOM_STRING,c)}),a);return b}function i(a){a=d("WASmaxOutSpamCallReportMixin").mergeCallReportMixin(d("WASmaxJsx").smax("call",null),a);return a}function a(a){var b=a.messageArgs,c=a.callArgs,e=a.fRXMixinArgs,f=a.spamListJid,g=a.spamListSource;f=d("WASmaxOutSpamEntitySubjectMixin").mergeEntitySubjectMixin(d("WASmaxMixins").optionalMerge(d("WASmaxOutSpamFRXMixin").mergeFRXMixin,d("WASmaxOutSpamBaseReportMixin").mergeBaseReportMixin(d("WASmaxOutSpamBaseIQSetRequestMixin").mergeBaseIQSetRequestMixin(d("WASmaxJsx").smax("iq",null,d("WASmaxJsx").smax("spam_list",{jid:d("WAWap").GROUP_JID(f),source:d("WASmaxAttrs").OPTIONAL(d("WAWap").USER_JID,g)},[].concat(d("WASmaxChildren").REPEATED_CHILD(h,b,0,210),d("WASmaxChildren").REPEATED_CHILD(i,c,0,5))))),a),e),a);return f}g.makeGroupReportRequestSpamListMessage=h;g.makeGroupReportRequestSpamListCall=i;g.makeGroupReportRequest=a}),98); __d("WASmaxOutSpamMessageRecipientMixin",["WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(a){a=a.messageTo;a=d("WASmaxJsx").smax("message",{to:d("WAWap").JID(a)});return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeMessageRecipientMixin=a}),98); __d("WASmaxOutSpamMessageSenderMixin",["WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(a){a=a.messageFrom;a=d("WASmaxJsx").smax("message",{from:d("WAWap").JID(a)});return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeMessageSenderMixin=a}),98); __d("WASmaxOutSpamMessageSenderOrRecipientMixinGroup",["WASmaxMixinGroupExhaustiveError","WASmaxOutSpamMessageRecipientMixin","WASmaxOutSpamMessageSenderMixin"],(function(a,b,c,d,e,f,g){function a(a,b){if(b.messageSender)return d("WASmaxOutSpamMessageSenderMixin").mergeMessageSenderMixin(a,b.messageSender);if(b.messageRecipient)return d("WASmaxOutSpamMessageRecipientMixin").mergeMessageRecipientMixin(a,b.messageRecipient);throw new(d("WASmaxMixinGroupExhaustiveError").SmaxMixinGroupExhaustiveError)()}g.mergeMessageSenderOrRecipientMixinGroup=a}),98); __d("WASmaxOutSpamPrivacyTokenContentsMixin",["WASmaxJsx","WASmaxMixins"],(function(a,b,c,d,e,f,g){function h(a){a=a.anyElementValue;a=d("WASmaxJsx").smax("smax$any",null,a);return a}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergePrivacyTokenContentsMixin=a}),98); __d("WASmaxOutSpamTCTokenMixin",["WASmaxAttrs","WASmaxJsx","WASmaxMixins","WASmaxOutSpamPrivacyTokenContentsMixin","WAWap"],(function(a,b,c,d,e,f,g){function h(a){var b=a.tctokenT;a=a.privacyTokenContentsMixinArgs;b=d("WASmaxJsx").smax("smax$any",null,d("WASmaxOutSpamPrivacyTokenContentsMixin").mergePrivacyTokenContentsMixin(d("WASmaxJsx").smax("tctoken",{t:d("WASmaxAttrs").OPTIONAL(d("WAWap").INT,b)}),a));return b}function a(a,b){b=h(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeTCTokenMixin=a}),98); __d("WASmaxOutSpamUIStateSetMixin",["WASmaxChildren","WASmaxJsx","WASmaxMixins"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxJsx").smax("uistate",{value:"spam_banner"});return a}function i(a){a=a.hasUistate;a=d("WASmaxJsx").smax("spam_list",null,d("WASmaxJsx").smax("uistateset",null,d("WASmaxChildren").HAS_OPTIONAL_CHILD(h,a)));return a}function a(a,b){b=i(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.makeUIStateSetUistatesetUistate=h;g.mergeUIStateSetMixin=a}),98); __d("WASmaxOutSpamUserInitiatedExtensionMixin",["WASmaxChildren","WASmaxJsx","WASmaxMixins","WASmaxOutSpamExtensionScreenMixin"],(function(a,b,c,d,e,f,g){function h(a){a=d("WASmaxOutSpamExtensionScreenMixin").mergeExtensionScreenMixin(d("WASmaxJsx").smax("extension_screen",null),a);return a}function i(a){a=a.extensionScreenArgs;a=d("WASmaxJsx").smax("user_initiated_extension",null,d("WASmaxChildren").REPEATED_CHILD(h,a,1,100));return a}function a(a,b){b=i(b);return d("WASmaxMixins").mergeStanzas(a,b)}g.makeUserInitiatedExtensionExtensionScreen=h;g.mergeUserInitiatedExtensionMixin=a}),98); __d("WASmaxOutSpamIndividualReportRequest",["WASmaxAttrs","WASmaxChildren","WASmaxJsx","WASmaxMixins","WASmaxOutSpamBaseIQSetRequestMixin","WASmaxOutSpamBaseReportMixin","WASmaxOutSpamBizOptOutMixin","WASmaxOutSpamBizReportMixin","WASmaxOutSpamCallReportMixin","WASmaxOutSpamFRXMixin","WASmaxOutSpamMessageMixin","WASmaxOutSpamMessageSenderOrRecipientMixinGroup","WASmaxOutSpamTCTokenMixin","WASmaxOutSpamUIStateSetMixin","WASmaxOutSpamUserInitiatedExtensionMixin","WAWap"],(function(a,b,c,d,e,f,g){function h(a){var b=a.messageSenderOrRecipientMixinGroupArgs;a=d("WASmaxOutSpamMessageSenderOrRecipientMixinGroup").mergeMessageSenderOrRecipientMixinGroup(d("WASmaxOutSpamMessageMixin").mergeMessageMixin(d("WASmaxJsx").smax("message",null),a),b);return a}function i(a){a=d("WASmaxOutSpamCallReportMixin").mergeCallReportMixin(d("WASmaxJsx").smax("call",null),a);return a}function j(a){a=d("WASmaxOutSpamUserInitiatedExtensionMixin").mergeUserInitiatedExtensionMixin(d("WASmaxJsx").smax("user_initiated_extension",null),a);return a}function a(a){var b,c=a.messageArgs,e=a.callArgs,f=a.userInitiatedExtensionArgs,g=a.fRXMixinArgs,k=a.spamListJid,l=a.bizOptOutMixinArgs,m=a.uIStateSetMixinArgs,n=a.bizReportMixinArgs,o=a.tCTokenMixinArgs;b=(b=d("WASmaxMixins")).optionalMerge(d("WASmaxOutSpamFRXMixin").mergeFRXMixin,d("WASmaxOutSpamBaseReportMixin").mergeBaseReportMixin(d("WASmaxOutSpamBaseIQSetRequestMixin").mergeBaseIQSetRequestMixin(d("WASmaxJsx").smax("iq",null,b.optionalMerge(d("WASmaxOutSpamTCTokenMixin").mergeTCTokenMixin,b.optionalMerge(d("WASmaxOutSpamBizReportMixin").mergeBizReportMixin,b.optionalMerge(d("WASmaxOutSpamUIStateSetMixin").mergeUIStateSetMixin,b.optionalMerge(d("WASmaxOutSpamBizOptOutMixin").mergeBizOptOutMixin,d("WASmaxJsx").smax("spam_list",{jid:d("WASmaxAttrs").OPTIONAL(d("WAWap").JID,k)},[].concat(d("WASmaxChildren").REPEATED_CHILD(h,c,0,210),d("WASmaxChildren").REPEATED_CHILD(i,e,0,5),d("WASmaxChildren").REPEATED_CHILD(j,f,0,5))),l),m),n),o))),a),g);return b}g.makeIndividualReportRequestSpamListMessage=h;g.makeIndividualReportRequestSpamListCall=i;g.makeIndividualReportRequestSpamListUserInitiatedExtension=j;g.makeIndividualReportRequest=a}),98); __d("WASmaxOutSpamNewsletterReportRequest",["WASmaxChildren","WASmaxJsx","WASmaxOutSpamBaseIQSetRequestMixin","WASmaxOutSpamBaseReportMixin","WASmaxOutSpamEntitySubjectMixin","WASmaxOutSpamMessageMixin","WAWap"],(function(a,b,c,d,e,f,g){function h(a){var b=a.messageFrom;b=d("WASmaxOutSpamMessageMixin").mergeMessageMixin(d("WASmaxJsx").smax("message",{from:d("WAWap").JID(b)}),a);return b}function a(a){var b=a.messageArgs,c=a.spamListJid;c=d("WASmaxOutSpamEntitySubjectMixin").mergeEntitySubjectMixin(d("WASmaxOutSpamBaseReportMixin").mergeBaseReportMixin(d("WASmaxOutSpamBaseIQSetRequestMixin").mergeBaseIQSetRequestMixin(d("WASmaxJsx").smax("iq",null,d("WASmaxJsx").smax("spam_list",{jid:d("WAWap").JID(c)},d("WASmaxChildren").REPEATED_CHILD(h,b,0,65)))),a),a);return c}g.makeNewsletterReportRequestSpamListMessage=h;g.makeNewsletterReportRequest=a}),98); __d("WASmaxOutSpamStatusReportRequest",["WASmaxJsx","WASmaxMixins","WASmaxOutSpamBaseIQSetRequestMixin","WASmaxOutSpamBaseReportMixin","WASmaxOutSpamBizOptOutMixin","WASmaxOutSpamBizReportMixin","WASmaxOutSpamFRXMixin","WASmaxOutSpamMessageMixin","WASmaxOutSpamMessageRecipientMixin","WAWap"],(function(a,b,c,d,e,f,g){function a(a){var b,c=a.fRXMixinArgs,e=a.spamListJid,f=a.bizOptOutMixinArgs,g=a.bizReportMixinArgs,h=a.messageFrom,i=a.messageMixinArgs,j=a.messageRecipientMixinArgs;e=(b=d("WASmaxMixins")).optionalMerge(d("WASmaxOutSpamFRXMixin").mergeFRXMixin,d("WASmaxOutSpamBaseReportMixin").mergeBaseReportMixin(d("WASmaxOutSpamBaseIQSetRequestMixin").mergeBaseIQSetRequestMixin(d("WASmaxJsx").smax("iq",null,b.optionalMerge(d("WASmaxOutSpamBizReportMixin").mergeBizReportMixin,b.optionalMerge(d("WASmaxOutSpamBizOptOutMixin").mergeBizOptOutMixin,d("WASmaxJsx").smax("spam_list",{jid:d("WAWap").JID(e)},b.optionalMerge(d("WASmaxOutSpamMessageRecipientMixin").mergeMessageRecipientMixin,d("WASmaxOutSpamMessageMixin").mergeMessageMixin(d("WASmaxJsx").smax("message",{from:d("WAWap").JID(h)}),i),j)),f),g))),a),c);return e}g.makeStatusReportRequest=a}),98); __d("WASmaxOutStatsBaseIQSetRequestMixin",["WASmaxJsx","WASmaxMixins","WAWap"],(function(a,b,c,d,e,f,g){function h(){var a=d("WASmaxJsx").smax("iq",{id:d("WAWap").generateId(),type:"set"});return a}function a(a){var b=h();return d("WASmaxMixins").mergeStanzas(a,b)}g.mergeBaseIQSetRequestMixin=a}),98); __d("WASmaxOutStatsSendBufferRequest",["WASmaxJsx","WASmaxOutStatsBaseIQSetRequestMixin","WAWap"],(function(a,b,c,d,e,f,g){function a(a){var b=a.addT;a=a.addElementValue;b=d("WASmaxOutStatsBaseIQSetRequestMixin").mergeBaseIQSetRequestMixin(d("WASmaxJsx").smax("iq",{xmlns:"w:stats",to:d("WAWap").S_WHATSAPP_NET},d("WASmaxJsx").smax("add",{t:d("WAWap").INT(b)},a)));return b}g.makeSendBufferRequest=a}),98); __d("WASmaxOutUnifiedSessionShareRequest",["WASmaxJsx","WAWap"],(function(a,b,c,d,e,f,g){function a(a){a=a.unifiedSessionId;a=d("WASmaxJsx").smax("ib",null,d("WASmaxJsx").smax("unified_session",{id:d("WAWap").CUSTOM_STRING(a)}));return a}g.makeShareRequest=a}),98); __d("WASmaxPreKeysFetchMissingPreKeysRPC",["WAComms","WASmaxInPreKeysFetchMissingPreKeysResponseRequestError","WASmaxInPreKeysFetchMissingPreKeysResponseServerError","WASmaxInPreKeysFetchMissingPreKeysResponseSuccess","WASmaxOutPreKeysFetchMissingPreKeysRequest","WASmaxParsingFailure","WASmaxRpcUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=d("WASmaxOutPreKeysFetchMissingPreKeysRequest").makeFetchMissingPreKeysRequest(a);b=(yield d("WAComms").sendSmaxStanza(a,b));var c=d("WASmaxInPreKeysFetchMissingPreKeysResponseSuccess").parseFetchMissingPreKeysResponseSuccess(b,a);if(c.success)return{name:"FetchMissingPreKeysResponseSuccess",value:c.value};var e=d("WASmaxInPreKeysFetchMissingPreKeysResponseRequestError").parseFetchMissingPreKeysResponseRequestError(b,a);if(e.success)return{name:"FetchMissingPreKeysResponseRequestError",value:e.value};b=d("WASmaxInPreKeysFetchMissingPreKeysResponseServerError").parseFetchMissingPreKeysResponseServerError(b,a);if(b.success)return{name:"FetchMissingPreKeysResponseServerError",value:b.value};throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(d("WASmaxRpcUtils").errorMessageRpcParsing("FetchMissingPreKeys",{Success:c,RequestError:e,ServerError:b}))});return h.apply(this,arguments)}g.sendFetchMissingPreKeysRPC=a}),98); __d("WASmaxPresenceServerUpdateRPC",["WASmaxInPresenceServerUpdateRequest","WASmaxParsingFailure","WASmaxRpcUtils"],(function(a,b,c,d,e,f,g){function a(a){a=d("WASmaxInPresenceServerUpdateRequest").parseServerUpdateRequest(a);if(!a.success)throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(d("WASmaxRpcUtils").errorMessageRpcParsing("ServerUpdate",{Request:a}));return{parsedRequest:a.value}}g.receiveServerUpdateRPC=a}),98); __d("WASmaxPresenceSubscribeRPC",["WAComms","WASmaxOutPresenceSubscribeRequest","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=d("WASmaxOutPresenceSubscribeRequest").makeSubscribeRequest(a);yield d("WAComms").castSmaxStanza(a)});return h.apply(this,arguments)}g.sendSubscribeRPC=a}),98); __d("WASmaxProfilePictureGetRPC",["WAComms","WASmaxInProfilePictureGetResponseError","WASmaxInProfilePictureGetResponseSuccessAvatarURLs","WASmaxInProfilePictureGetResponseSuccessNoData","WASmaxInProfilePictureGetResponseSuccessPictureBlob","WASmaxInProfilePictureGetResponseSuccessPictureURL","WASmaxOutProfilePictureGetRequest","WASmaxParsingFailure","WASmaxRpcUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=d("WASmaxOutProfilePictureGetRequest").makeGetRequest(a);b=(yield d("WAComms").sendSmaxStanza(a,b));var c=d("WASmaxInProfilePictureGetResponseSuccessPictureURL").parseGetResponseSuccessPictureURL(b,a);if(c.success)return{name:"GetResponseSuccessPictureURL",value:c.value};var e=d("WASmaxInProfilePictureGetResponseSuccessAvatarURLs").parseGetResponseSuccessAvatarURLs(b,a);if(e.success)return{name:"GetResponseSuccessAvatarURLs",value:e.value};var f=d("WASmaxInProfilePictureGetResponseSuccessPictureBlob").parseGetResponseSuccessPictureBlob(b,a);if(f.success)return{name:"GetResponseSuccessPictureBlob",value:f.value};var g=d("WASmaxInProfilePictureGetResponseSuccessNoData").parseGetResponseSuccessNoData(b,a);if(g.success)return{name:"GetResponseSuccessNoData",value:g.value};b=d("WASmaxInProfilePictureGetResponseError").parseGetResponseError(b,a);if(b.success)return{name:"GetResponseError",value:b.value};throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(d("WASmaxRpcUtils").errorMessageRpcParsing("Get",{SuccessPictureURL:c,SuccessAvatarURLs:e,SuccessPictureBlob:f,SuccessNoData:g,Error:b}))});return h.apply(this,arguments)}g.sendGetRPC=a}),98); __d("WASmaxPsaChatBlockGetRPC",["WAComms","WASmaxInPsaChatBlockGetResponseServerError","WASmaxInPsaChatBlockGetResponseSuccess","WASmaxOutPsaChatBlockGetRequest","WASmaxParsingFailure","WASmaxRpcUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=d("WASmaxOutPsaChatBlockGetRequest").makeChatBlockGetRequest();a=(yield d("WAComms").sendSmaxStanza(b,a));var c=d("WASmaxInPsaChatBlockGetResponseSuccess").parseChatBlockGetResponseSuccess(a,b);if(c.success)return{name:"ChatBlockGetResponseSuccess",value:c.value};a=d("WASmaxInPsaChatBlockGetResponseServerError").parseChatBlockGetResponseServerError(a,b);if(a.success)return{name:"ChatBlockGetResponseServerError",value:a.value};throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(d("WASmaxRpcUtils").errorMessageRpcParsing("ChatBlockGet",{Success:c,ServerError:a}))});return h.apply(this,arguments)}g.sendChatBlockGetRPC=a}),98); __d("WASmaxPsaChatBlockSetRPC",["WAComms","WASmaxInPsaChatBlockSetResponseServerError","WASmaxInPsaChatBlockSetResponseSuccess","WASmaxOutPsaChatBlockSetRequest","WASmaxParsingFailure","WASmaxRpcUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=d("WASmaxOutPsaChatBlockSetRequest").makeChatBlockSetRequest(a);b=(yield d("WAComms").sendSmaxStanza(a,b));var c=d("WASmaxInPsaChatBlockSetResponseSuccess").parseChatBlockSetResponseSuccess(b,a);if(c.success)return{name:"ChatBlockSetResponseSuccess",value:c.value};b=d("WASmaxInPsaChatBlockSetResponseServerError").parseChatBlockSetResponseServerError(b,a);if(b.success)return{name:"ChatBlockSetResponseServerError",value:b.value};throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(d("WASmaxRpcUtils").errorMessageRpcParsing("ChatBlockSet",{Success:c,ServerError:b}))});return h.apply(this,arguments)}g.sendChatBlockSetRPC=a}),98); __d("WASmaxPsaResetSmbLastQpPrefetchTimestampRPC",["WASmaxInPsaResetSmbLastQpPrefetchTimestampRequest","WASmaxOutPsaResetSmbLastQpPrefetchTimestampResponseAck","WASmaxParsingFailure","WASmaxRpcUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxInPsaResetSmbLastQpPrefetchTimestampRequest").parseResetSmbLastQpPrefetchTimestampRequest(a);if(!b.success)throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(d("WASmaxRpcUtils").errorMessageRpcParsing("ResetSmbLastQpPrefetchTimestamp",{Request:b}));return{parsedRequest:b.value,makeResetSmbLastQpPrefetchTimestampResponseAck:function(){return d("WASmaxOutPsaResetSmbLastQpPrefetchTimestampResponseAck").makeResetSmbLastQpPrefetchTimestampResponseAck(a)}}}g.receiveResetSmbLastQpPrefetchTimestampRPC=a}),98); __d("WASmaxQpSurfacesQPNotificationRPC",["WASmaxInQpSurfacesQPNotificationRequest","WASmaxOutQpSurfacesQPNotificationResponseAck","WASmaxParsingFailure","WASmaxRpcUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WASmaxInQpSurfacesQPNotificationRequest").parseQPNotificationRequest(a);if(!b.success)throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(d("WASmaxRpcUtils").errorMessageRpcParsing("QPNotification",{Request:b}));return{parsedRequest:b.value,makeQPNotificationResponseAck:function(){return d("WASmaxOutQpSurfacesQPNotificationResponseAck").makeQPNotificationResponseAck(a)}}}g.receiveQPNotificationRPC=a}),98); __d("WASmaxSpamGroupReportRPC",["WAComms","WASmaxInSpamGroupReportResponseError","WASmaxInSpamGroupReportResponseSuccess","WASmaxOutSpamGroupReportRequest","WASmaxParsingFailure","WASmaxRpcUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=d("WASmaxOutSpamGroupReportRequest").makeGroupReportRequest(a);b=(yield d("WAComms").sendSmaxStanza(a,b));var c=d("WASmaxInSpamGroupReportResponseSuccess").parseGroupReportResponseSuccess(b,a);if(c.success)return{name:"GroupReportResponseSuccess",value:c.value};b=d("WASmaxInSpamGroupReportResponseError").parseGroupReportResponseError(b,a);if(b.success)return{name:"GroupReportResponseError",value:b.value};throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(d("WASmaxRpcUtils").errorMessageRpcParsing("GroupReport",{Success:c,Error:b}))});return h.apply(this,arguments)}g.sendGroupReportRPC=a}),98); __d("WASmaxSpamIndividualReportRPC",["WAComms","WASmaxInSpamIndividualReportResponseError","WASmaxInSpamIndividualReportResponseSuccess","WASmaxOutSpamIndividualReportRequest","WASmaxParsingFailure","WASmaxRpcUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=d("WASmaxOutSpamIndividualReportRequest").makeIndividualReportRequest(a);b=(yield d("WAComms").sendSmaxStanza(a,b));var c=d("WASmaxInSpamIndividualReportResponseSuccess").parseIndividualReportResponseSuccess(b,a);if(c.success)return{name:"IndividualReportResponseSuccess",value:c.value};b=d("WASmaxInSpamIndividualReportResponseError").parseIndividualReportResponseError(b,a);if(b.success)return{name:"IndividualReportResponseError",value:b.value};throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(d("WASmaxRpcUtils").errorMessageRpcParsing("IndividualReport",{Success:c,Error:b}))});return h.apply(this,arguments)}g.sendIndividualReportRPC=a}),98); __d("WASmaxSpamNewsletterReportRPC",["WAComms","WASmaxInSpamNewsletterReportResponseError","WASmaxInSpamNewsletterReportResponseSuccess","WASmaxOutSpamNewsletterReportRequest","WASmaxParsingFailure","WASmaxRpcUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=d("WASmaxOutSpamNewsletterReportRequest").makeNewsletterReportRequest(a);b=(yield d("WAComms").sendSmaxStanza(a,b));var c=d("WASmaxInSpamNewsletterReportResponseSuccess").parseNewsletterReportResponseSuccess(b,a);if(c.success)return{name:"NewsletterReportResponseSuccess",value:c.value};b=d("WASmaxInSpamNewsletterReportResponseError").parseNewsletterReportResponseError(b,a);if(b.success)return{name:"NewsletterReportResponseError",value:b.value};throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(d("WASmaxRpcUtils").errorMessageRpcParsing("NewsletterReport",{Success:c,Error:b}))});return h.apply(this,arguments)}g.sendNewsletterReportRPC=a}),98); __d("WASmaxSpamStatusReportRPC",["WAComms","WASmaxInSpamStatusReportResponseError","WASmaxInSpamStatusReportResponseSuccess","WASmaxOutSpamStatusReportRequest","WASmaxParsingFailure","WASmaxRpcUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=d("WASmaxOutSpamStatusReportRequest").makeStatusReportRequest(a);b=(yield d("WAComms").sendSmaxStanza(a,b));var c=d("WASmaxInSpamStatusReportResponseSuccess").parseStatusReportResponseSuccess(b,a);if(c.success)return{name:"StatusReportResponseSuccess",value:c.value};b=d("WASmaxInSpamStatusReportResponseError").parseStatusReportResponseError(b,a);if(b.success)return{name:"StatusReportResponseError",value:b.value};throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(d("WASmaxRpcUtils").errorMessageRpcParsing("StatusReport",{Success:c,Error:b}))});return h.apply(this,arguments)}g.sendStatusReportRPC=a}),98); __d("WASmaxStatsSendBufferRPC",["WAComms","WASmaxInStatsSendBufferResponseErrorNoRetry","WASmaxInStatsSendBufferResponseErrorRetry","WASmaxInStatsSendBufferResponseSuccess","WASmaxOutStatsSendBufferRequest","WASmaxParsingFailure","WASmaxRpcUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=d("WASmaxOutStatsSendBufferRequest").makeSendBufferRequest(a);b=(yield d("WAComms").sendSmaxStanza(a,b));var c=d("WASmaxInStatsSendBufferResponseSuccess").parseSendBufferResponseSuccess(b,a);if(c.success)return{name:"SendBufferResponseSuccess",value:c.value};var e=d("WASmaxInStatsSendBufferResponseErrorNoRetry").parseSendBufferResponseErrorNoRetry(b,a);if(e.success)return{name:"SendBufferResponseErrorNoRetry",value:e.value};b=d("WASmaxInStatsSendBufferResponseErrorRetry").parseSendBufferResponseErrorRetry(b,a);if(b.success)return{name:"SendBufferResponseErrorRetry",value:b.value};throw new(d("WASmaxParsingFailure").SmaxParsingFailure)(d("WASmaxRpcUtils").errorMessageRpcParsing("SendBuffer",{Success:c,ErrorNoRetry:e,ErrorRetry:b}))});return h.apply(this,arguments)}g.sendSendBufferRPC=a}),98); __d("WASmaxUnifiedSessionShareRPC",["WAComms","WASmaxOutUnifiedSessionShareRequest","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=d("WASmaxOutUnifiedSessionShareRequest").makeShareRequest(a);yield d("WAComms").castSmaxStanza(a)});return h.apply(this,arguments)}g.sendShareRPC=a}),98); __d("WASyncdAction",["Promise","WASyncdConst"],(function(a,b,c,d,e,f,g){"use strict";var h;a=function(){function a(){}var c=a.prototype;c.resolveConflicts=function(a,c){c=c.timestamp;return c>=a.timestamp?(h||(h=b("Promise"))).resolve(d("WASyncdConst").ConflictResolutionState.ApplyRemoteAndDropLocal):(h||(h=b("Promise"))).resolve(d("WASyncdConst").ConflictResolutionState.SkipRemote)};c.dropMutationDueToCrossIndexConflict=function(a,c){return(h||(h=b("Promise"))).resolve(!1)};return a}();g.SyncActionBase=a}),98); __d("WAWebSyncdCryptoConst",[],(function(a,b,c,d,e,f){"use strict";a="WhatsApp Mutation Keys";b=160;c=32;d=32;e=32;var g=32,h=32;c=c;d=c+d;e=d+e;g=e+g;h=g+h;var i="0x01",j="0x02",k=0,l=32,m=8,n=16;f.HKDF_INFO=a;f.DERIVED_KEY_LENGTH=b;f.INDEX_KEY_END=c;f.VALUE_ENCRYPTION_KEY_END=d;f.VALUE_MAC_KEY_END=e;f.SNAPSHOT_MAC_KEY_END=g;f.PATCH_MAC_KEY_END=h;f.OPERATION_SET_HEX=i;f.OPERATION_REMOVE_HEX=j;f.MAX_OF_MIN_DATA_LENGTH=k;f.MAC_LENGTH=l;f.OCTET_LENGTH=m;f.IV_LENGTH=n}),66); __d("WAWebSyncdError",[],(function(a,b,c,d,e,f){"use strict";a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.name="SyncdMissingKeyError",b)||babelHelpers.assertThisInitialized(c)}return b}(babelHelpers.wrapNativeSuper(Error));b=function(a){babelHelpers.inheritsLoose(b,a);function b(b,c){var d;d=a.call(this,b)||this;d.name="SyncdRetryableError";d.backoff=c;d.message=b;return d}return b}(babelHelpers.wrapNativeSuper(Error));c=function(a){babelHelpers.inheritsLoose(b,a);function b(b){var c;c=a.call(this,b)||this;c.name="SyncdFatalError";c.message=b;return c}return b}(babelHelpers.wrapNativeSuper(Error));f.SyncdMissingKeyError=a;f.SyncdRetryableError=b;f.SyncdFatalError=c}),66); __d("WAWebSyncdDecode",["WAServerSync.pb","WASyncAction.pb","WAWebSyncdError","WAWebSyncdMetricFatalError","decodeProtobuf"],(function(a,b,c,d,e,f,g){"use strict";function a(a,b){try{return d("decodeProtobuf").decodeProtobuf(d("WAServerSync.pb").ExternalBlobReferenceSpec,b)}catch(b){d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.EXTERNAL_BLOB_REFERENCE_PROTOBUF_DESERIALIZATION_FAILED,a);throw new(d("WAWebSyncdError").SyncdFatalError)("external blob reference protobuf deserialization failed")}}function b(a,b){try{return d("decodeProtobuf").decodeProtobuf(d("WAServerSync.pb").SyncdSnapshotSpec,b)}catch(b){d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.SNAPSHOT_PROTOBUF_DESERIALIZATION_FAILED,a);throw new(d("WAWebSyncdError").SyncdFatalError)("snapshot protobuf deserialization failed")}}function c(a,b){try{return d("decodeProtobuf").decodeProtobuf(d("WAServerSync.pb").SyncdPatchSpec,b)}catch(b){d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.PATCH_PROTOBUF_DESERIALIZATION_FAILED,a);throw new(d("WAWebSyncdError").SyncdFatalError)("patch protobuf deserialization failed")}}function e(a,b){try{return d("decodeProtobuf").decodeProtobuf(d("WAServerSync.pb").SyncdMutationsSpec,b)}catch(b){d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.MUTATIONS_PROTOBUF_DESERIALIZATION_FAILED,a);throw new(d("WAWebSyncdError").SyncdFatalError)("mutations protobuf deserialization failed")}}function f(a,b){try{return d("decodeProtobuf").decodeProtobuf(d("WASyncAction.pb").SyncActionDataSpec,b)}catch(c){d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.ACTION_DATA_PROTOBUF_DESERIALIZATION_FAILED,(b=a)!=null?b:void 0);throw new(d("WAWebSyncdError").SyncdFatalError)("action data protobuf deserialization failed")}}g.decodeExternalBlobReference=a;g.decodeSyncdSnapshot=b;g.decodeSyncdPatch=c;g.decodeSyncdMutations=e;g.decodeSyncActionData=f}),98); __d("WAWebSyncdRequestEncode",["WAServerSync.pb","WASyncAction.pb","WAWebSyncdError","WAWebSyncdMetricFatalError","encodeProtobuf"],(function(a,b,c,d,e,f,g){"use strict";function a(a){try{return d("encodeProtobuf").encodeProtobuf(d("WAServerSync.pb").SyncdPatchSpec,a).readBuffer()}catch(a){d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.PATCH_PROTOBUF_SERIALIZATION_FAILED);throw new(d("WAWebSyncdError").SyncdFatalError)("patch protobuf serialization failed")}}function b(a){try{return d("encodeProtobuf").encodeProtobuf(d("WAServerSync.pb").SyncdMutationsSpec,a).readBuffer()}catch(a){d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.MUTATIONS_PROTOBUF_SERIALIZATION_FAILED);throw new(d("WAWebSyncdError").SyncdFatalError)("mutations protobuf serialization failed")}}function c(a){try{return d("encodeProtobuf").encodeProtobuf(d("WASyncAction.pb").SyncActionDataSpec,a).readBuffer()}catch(a){d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.ACTION_DATA_PROTOBUF_SERIALIZATION_FAILED);throw new(d("WAWebSyncdError").SyncdFatalError)("action data protobuf serialization failed")}}g.encodeSyncdPatch=a;g.encodeSyncdMutations=b;g.encodeSyncActionData=c}),98); __d("WAWebSyncdValidateSyncActionProtobuf",["WAWebSyncdError","WAWebSyncdMetricFatalError"],(function(a,b,c,d,e,f,g){"use strict";a=function(){function a(){}a.validateSyncActionDataProtobuf=function(a,b){var c=b.index,e=b.value,f=b.padding;b=b.version;if(!c){var g;d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.MISSING_ACTION_INDEX,(g=a)!=null?g:void 0);throw new(d("WAWebSyncdError").SyncdFatalError)("missing action index")}if(b==null){d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.MISSING_ACTION_VERSION,(g=a)!=null?g:void 0);throw new(d("WAWebSyncdError").SyncdFatalError)("missing action version")}return{index:c,value:e,padding:f,version:b}};return a}();g["default"]=a}),98); __d("kotlin-kotlin-stdlib",[],(function(a,b,c,d,e,f){(function(){if(typeof globalThis==="object")return;Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0});__magic__.globalThis=__magic__;delete Object.prototype.__magic__})();typeof Math.imul==="undefined"&&(Math.imul=function(a,b){return(a&4294901760)*(b&65535)+(a&65535)*(b|0)|0});typeof ArrayBuffer.isView==="undefined"&&(ArrayBuffer.isView=function(a){return a!=null&&a.__proto__!=null&&a.__proto__.__proto__===Int8Array.prototype.__proto__});typeof Array.prototype.fill==="undefined"&&Object.defineProperty(Array.prototype,"fill",{value:function(a){if(this==null)throw new TypeError("this is null or not defined");var b=Object(this),c=b.length>>>0,d=arguments[1],e=d>>0,f=e<0?Math.max(c+e,0):Math.min(e,c),g=arguments[2],h=g===void 0?c:g>>0,i=h<0?Math.max(c+h,0):Math.min(h,c);while(f<i)b[f]=a,f++;return b}});[Int8Array,Int16Array,Uint16Array,Int32Array,Float32Array,Float64Array].forEach(function(a){typeof a.prototype.fill==="undefined"&&Object.defineProperty(a.prototype,"fill",{value:Array.prototype.fill})});typeof Math.clz32==="undefined"&&(Math.clz32=function(a,b){return function(c){c=c>>>0;return c===0?32:31-(a(c)/b|0)|0}}(Math.log,Math.LN2));var g=Math.imul,h=ArrayBuffer.isView,i=Math.clz32;C(pj,"Exception",ij,Error);C(N,"RuntimeException",Uk,pj);C(Da,"KotlinNothingValueException",wa,N);D(R,"Annotation");C(Ea,"ExperimentalJsCollectionsApi",H,H,[R]);C(Fa,"ExperimentalJsFileName",H,H,[R]);C(Ga,"ExperimentalJsExport",H,H,[R]);C(Ha,"IntrinsicConstEvaluation",H,H,[R]);E(Sa);D(Km,"Comparable");C(Va,"Char",H,H,[Km]);D(la,"Iterable");D(Wa,"MutableIterable",H,H,[la]);E(Xa);D(q,"Collection",H,H,[la]);function a(){return lc(this)}D(qb,"List",H,H,[q]);D(nb,"MutableCollection",H,H,[q,Wa]);function b(){return yc(this)}D(Za,"MutableList",H,H,[qb,nb]);E($a);function c(){return pc(this)}D(bb,"Set",H,H,[q]);E(cb);function d(){return xc(this)}D(eb,"MutableSet",H,H,[bb,nb]);D(fb,"Entry");E(gb);function e(){return uc(this)}D(ib,"Map");D(jb,"MutableEntry",H,H,[fb]);E(kb);function j(){return zc(this)}D(mb,"MutableMap",H,H,[ib]);E(ob);E(rb);C(r,"Enum",H,H,[Km]);E(wb);C(Pm,"Number");C(s,"Long",H,Pm,[Pm,Km]);Ye(Db,"DefaultConstructorMarker");D(Fb,"FunctionAdapter");D(Lm,"Iterator");C(Ib,H,H,H,[Lm]);C(op,"BooleanIterator",H,H,[Lm]);C(Jb,H,H,op);C(mp,"CharIterator",H,H,[Lm]);C(Kb,H,H,mp);C(ip,"ByteIterator",H,H,[Lm]);C(Lb,H,H,ip);C(np,"ShortIterator",H,H,[Lm]);C(Mb,H,H,np);C(hp,"IntIterator",H,H,[Lm]);C(Nb,H,H,hp);C(lp,"FloatIterator",H,H,[Lm]);C(Ob,H,H,lp);C(jp,"LongIterator",H,H,[Lm]);C(Pb,H,H,jp);C(kp,"DoubleIterator",H,H,[Lm]);C(Qb,H,H,kp);C(ec,"DoNotIntrinsify",H,H,[R]);C(oc,"JsArrayView",oc,Array);C(tc,"JsSetView",tc,Set);C(wc,"JsMapView",wc,Map);C(ge,"JsIntrinsic",H,H,[R]);C(he,"JsFun",H,H,[R]);C(ie,"JsGenerator",H,H,[R]);C(je,"JsImplicitExport",H,H,[R]);Ye(af,"ByteCompanionObject");Ye(jf,"ShortCompanionObject");Ye(lf,"IntCompanionObject");Ye(nf,"FloatCompanionObject");Ye(pf,"DoubleCompanionObject");Ye(rf,"StringCompanionObject");Ye(tf,"BooleanCompanionObject");C(hk,"Error",ak,Error);C(Xf,"IrLinkageError",H,hk);D(vf,"SuspendFunction0",H,H,H,[0]);D(Zf,"SuspendFunction1",H,H,H,[1]);D($f,"SuspendFunction2",H,H,H,[2]);D(ag,"Function1");D(bg,"Function0");D(cg,"Function2");D(dg,"Function3");D(hl,"KCallable");D(pl,"KFunction",H,H,[hl]);D(eg,"KFunction2");D(fg,"KFunction0");D(og,"Comparator");C(yg,"Ignore",H,H,[R]);C(zg,"JsExport",H,H,[R]);C(Ag,"JsName",H,H,[R]);C(Bg,"JsQualifier",H,H,[R]);C(Cg,"JsFileName",H,H,[R]);C(Dg,"EagerInitialization",H,H,[R]);C(xo,"AbstractCollection",H,H,[q]);C(Ng,"AbstractMutableCollection",H,xo,[xo,nb]);D(Nm,"MutableIterator",H,H,[Lm]);C(Og,"IteratorImpl",H,H,[Nm]);D(Mm,"ListIterator",H,H,[Lm]);D(Om,"MutableListIterator",H,H,[Mm,Nm]);C(Pg,"ListIteratorImpl",H,Og,[Og,Om]);C(I,"AbstractMutableList",H,Ng,[Ng,Za]);D(Fi,"RandomAccess");C(Qg,"SubList",H,I,[I,Fi]);C(Oo,"AbstractMap",H,H,[ib]);C(Tg,"AbstractMutableMap",H,Oo,[Oo,mb]);C(Ug,"AbstractMutableSet",H,Ng,[Ng,eb]);E(Zg);C(J,"ArrayList",kg,I,[I,Za,Fi]);C(nh,"HashMap",eh,Tg,[Tg,mb]);C(oh,"HashMapKeys",H,Ug,[eb,Ug]);C(ph,"HashMapValues",H,Ng,[nb,Ng]);C(rh,"HashMapEntrySetBase",H,Ug,[eb,Ug]);C(qh,"HashMapEntrySet",H,rh);C(sh,H,H,H,[Nm]);C(th,"HashMapKeysDefault",H,Ug);C(uh,H,H,H,[Nm]);C(vh,"HashMapValuesDefault",H,Ng);C(Ch,"HashSet",yh,Ug,[Ug,eb]);E(fi);C(ii,"Itr");C(ji,"KeysItr",H,ii,[ii,Nm]);C(ki,"ValuesItr",H,ii,[ii,Nm]);C(li,"EntriesItr",H,ii,[ii,Nm]);C(mi,"EntryRef",H,H,[jb]);function k(a){$l$block_0:{var b;G(a,q)?b=a.isEmpty_y1axqb_k$():b=!1;if(b){b=!0;break $l$block_0}a=a.iterator_jk1svi_k$();while(a.hasNext_bitz1p_k$()){var c=a.next_20eer_k$();c=c;(c==null?!1:G(c,fb))?c=this.containsOtherEntry_yvdc55_k$(c):c=!1;if(!c){b=!1;break $l$block_0}}b=!0}return b}D(Bh,"InternalMap");C(K,"InternalHashMap",Gh,H,[Bh]);Ye(si,"EmptyHolder");C(vi,"LinkedHashMap",oi,nh,[nh,mb]);Ye(Bi,"EmptyHolder");C(Ei,"LinkedHashSet",xi,Ch,[Ch,eb]);C(Gi,"BaseOutput");C(Hi,"NodeJsOutput",H,Gi);C(Ji,"BufferedOutput",Ji,Gi);C(Ii,"BufferedOutputToConsoleLog",Ii,Ji);D(Jp,"Continuation");C(Wi,"InterceptedCoroutine",H,H,[Jp]);C(L,"CoroutineImpl",H,Wi,[Wi,Jp]);Ye(Li,"CompletedContinuation",H,H,[Jp]);C(Ti,"GeneratorCoroutineImpl",H,Wi,[Wi,Jp]);C(Si,H,H,L);C(Xi,H,H,L);C(Yi,H,H,L);C($i,H,H,H,[Jp]);C(bj,"EnumEntriesSerializationProxy");C(gj,"NoSuchElementException",dj,N);C(xj,"IllegalArgumentException",rj,N);C(Gj,"UnsupportedOperationException",zj,N);C(Lj,"ArithmeticException",Ij,N);C(Uj,"UninitializedPropertyAccessException",Nj,N);C(Zj,"IndexOutOfBoundsException",Wj,N);C(qk,"NoWhenBranchMatchedException",jk,N);C(vk,"NullPointerException",sk,N);C(Ek,"IllegalStateException",xk,N);C(Jk,"ClassCastException",Gk,N);C(Sk,"ConcurrentModificationException",Lk,N);C(al,"JsPolyfill",H,H,[R]);D(bl,"Serializable");D(Zr,"KClassifier");D(il,"KClass",H,H,[Zr]);C(jl,"KClassImpl",H,H,[il]);Ye(kl,"NothingKClassImpl",H,jl);C(nl,"ErrorKClass",nl,H,[il]);C(O,"PrimitiveKClassImpl",H,jl);C(ol,"SimpleKClassImpl",H,jl);D(ql,"KProperty",H,H,[hl]);D(rl,"KProperty0",H,H,[ql]);D(sl,"KProperty1",H,H,[ql]);D(tl,"KProperty2",H,H,[ql]);D(vl,"KMutableProperty",H,H,[ql]);D(ul,"KMutableProperty0",H,H,[rl,vl]);D(wl,"KMutableProperty1",H,H,[sl,vl]);D(xl,"KMutableProperty2",H,H,[tl,vl]);D(yl,"KType");C(zl,"KTypeImpl",H,H,[yl]);Ye(Al,"DynamicKType",H,H,[yl]);D($r,"KTypeParameter",H,H,[Zr]);C(Dl,"KTypeParameterImpl",H,H,[$r]);Ye(P,"PrimitiveClasses");D(Cl,"Appendable");C(hm,"CharacterCodingException",gm,pj);D(Jm,"CharSequence");C(Q,"StringBuilder",mm,H,[Cl,Jm]);C(ym,"sam$kotlin_Comparator$0",H,H,[og,Fb]);C(Qm,"Suppress",H,H,[R]);C(Rm,"SinceKotlin",H,H,[R]);C(Sm,"Deprecated",H,H,[R]);C(Tm,"ReplaceWith",H,H,[R]);C(Um,"DeprecatedSinceKotlin",H,H,[R]);C(Vm,"PublishedApi",H,H,[R]);C(Wm,"ParameterName",H,H,[R]);C(Xm,"ExtensionFunctionType",H,H,[R]);C(en,"DeprecationLevel",H,r);C(fn,"UnsafeVariance",H,H,[R]);Ye(kn,"Unit");C(mn,"Target",H,H,[R]);C(Fn,"AnnotationTarget",H,r);C(Gn,"Retention",H,H,[R]);C(Nn,"AnnotationRetention",H,r);C(On,"MustBeDocumented",H,H,[R]);C(Pn,"Repeatable",H,H,[R]);C(io,"ExperimentalStdlibApi",H,H,[R]);C(jo,"OptionalExpectation",H,H,[R]);C(ko,"ExperimentalMultiplatform",H,H,[R]);C(lo,"OptIn",H,H,[R]);C(ro,"Level",H,r);C(uo,"RequiresOptIn",H,H,[R]);C(vo,"WasExperimental",H,H,[R]);C(Do,"AbstractList",H,xo,[xo,qb]);C(yo,"SubList",H,Do,[Do,Fi]);C(zo,"IteratorImpl",H,H,[Lm]);C(Ao,"ListIteratorImpl",H,zo,[zo,Mm]);E(Bo);C(Eo,H,H,H,[Lm]);C(Fo,H,H,H,[Lm]);E(Io);C(So,"AbstractSet",H,xo,[xo,bb]);C(Lo,H,H,So);C(No,H,H,xo);E(Po);Ye(Yo,"EmptyList",H,H,[qb,bl,Fi]);Ye(ap,"EmptyIterator",H,H,[Mm]);D(an,"Sequence");D(pp,"ContractBuilder");C(yp,"InvocationKind",H,r);C(zp,"ExperimentalContracts",H,H,[R]);D(Hp,"Effect");D(up,"ConditionalEffect",H,H,[Hp]);D(Ip,"SimpleEffect",H,H,[Hp]);D(Ep,"Returns",H,H,[Ip]);D(Fp,"CallsInPlace",H,H,[Hp]);D(Gp,"ReturnsNotNull",H,H,[Ip]);C(Kp,H,H,H,[Jp]);D(Pp,"Key");Ye(Lp,"Key",H,H,[Pp]);function l(a){var b;a===Vp()?b=this:b=a.fold_j2vaxd_k$(this,Rp);return b}D(Sp,"CoroutineContext");D(Qp,"Element",H,H,[Sp]);D(Op,"ContinuationInterceptor",H,H,[Qp]);Ye(Tp,"EmptyCoroutineContext",H,H,[Sp,bl]);E(Wp);C(bq,"Serialized",H,H,[bl]);C(eq,"CombinedContext",H,H,[Sp,bl]);C(fq,"AbstractCoroutineContextKey",H,H,[Pp]);C(nq,"CoroutineSingletons",H,r);D(dq,"EnumEntries",H,H,[qb]);C(sq,"EnumEntriesList",H,Do,[dq,Do,bl]);C(tq,"ExperimentalTypeInference",H,H,[R]);C(uq,"NoInfer",H,H,[R]);C(vq,"InlineOnly",H,H,[R]);C(wq,"DynamicExtension",H,H,[R]);C(xq,"LowPriorityInOverloadResolution",H,H,[R]);C(yq,"ContractsDsl",H,H,[R]);C(zq,"OnlyInputTypes",H,H,[R]);C(Aq,"RequireKotlin",H,H,[R]);C(Iq,"RequireKotlinVersionKind",H,r);C(gr,"PaddingOption",H,r);C(U,"Base64");Ye(nr,"Default",H,U);C(wr,"ExperimentalEncodingApi",H,H,[R]);E(xr);C(Pr,"IntProgression",H,H,[la]);D(Eq,"ClosedRange");D(Yr,"OpenEndRange");C(Ar,"IntRange",H,Pr,[Pr,Eq,Yr]);E(Br);C(Tr,"LongProgression",H,H,[la]);C(Er,"LongRange",H,Tr,[Tr,Eq,Yr]);E(Fr);C(Xr,"CharProgression",H,H,[la]);C(Ir,"CharRange",H,Xr,[Xr,Eq,Yr]);C(Jr,"IntProgressionIterator",H,hp);C(Kr,"LongProgressionIterator",H,jp);C(Lr,"CharProgressionIterator",H,mp);E(Mr);E(Qr);E(Ur);E(as);C(ds,"KTypeProjection");C(ls,"KVariance",H,r);C(us,H,H,mp);E(Cs);C(Fs,"Failure",H,H,[bl]);C(Is,"Result",H,H,[bl]);C(Ls,"NotImplementedError",Ls,hk);E(Os);C(Ws,"UByte",H,H,[Km]);C(at,"Iterator",H,H,[Lm]);C(jt,"UByteArray",H,H,[q]);E(kt);C(X,"UInt",H,H,[Km]);C(vt,"Iterator",H,H,[Lm]);C(Et,"UIntArray",H,H,[q]);E(Ft);C(Mt,"UIntProgression",H,H,[la]);C(It,"UIntRange",H,Mt,[Mt,Eq,Yr]);E(Jt);C(Nt,"UIntProgressionIterator",H,H,[Lm]);E(Ot);C($,"ULong",H,H,[Km]);C(Zt,"Iterator",H,H,[Lm]);C(hu,"ULongArray",H,H,[q]);E(iu);C(pu,"ULongProgression",H,H,[la]);C(lu,"ULongRange",H,pu,[pu,Eq,Yr]);E(mu);C(qu,"ULongProgressionIterator",H,H,[Lm]);E(xu);C(Fu,"UShort",H,H,[Km]);C(Ju,"Iterator",H,H,[Lm]);C(Su,"UShortArray",H,H,[q]);C(Tu,"ExperimentalUnsignedTypes",H,H,[R]);function m(a,b){if(b==null){var c=a.length-1|0;if(0<=c)do{var d=c;c=c+-1|0;if(a[d]==null)return d}while(0<=c)}else{d=a.length-1|0;if(0<=d)do{c=d;d=d+-1|0;if(u(b,a[c]))return c}while(0<=d)}return-1}function aa(a,b,c,d,e,f,g){b=b===H?", ":b;c=c===H?"":c;d=d===H?"":d;e=e===H?-1:e;f=f===H?"...":f;g=g===H?null:g;return ga(a,mm(),b,c,d,e,f,g).toString()}function ba(a,b){return ha(a,b)>=0}function ca(a,b){return ia(a,b)>=0}function da(a,b){if(b==null){var c=0,d=a.length-1|0;if(c<=d)do{var e=c;c=c+1|0;if(a[e]==null)return e}while(c<=d)}else{e=0;c=a.length-1|0;if(e<=c)do{d=e;e=e+1|0;if(u(b,a[d]))return d}while(e<=c)}return-1}function ea(a,b){return ja(a,b)>=0}function fa(a,b){return ka(a,b)>=0}function ga(a,b,c,d,e,f,g,h){c=c===H?", ":c;d=d===H?"":d;e=e===H?"":e;f=f===H?-1:f;g=g===H?"...":g;h=h===H?null:h;b.append_jgojdo_k$(d);d=0;var i=0,j=a.length;$l$loop:while(i<j){var k=a[i];i=i+1|0;d=d+1|0;d>1&&b.append_jgojdo_k$(c);if(f<0||d<=f)ps(b,k,h);else break $l$loop}f>=0&&d>f&&b.append_jgojdo_k$(g);b.append_jgojdo_k$(e);return b}function ha(a,b){var c=0,d=a.length-1|0;if(c<=d)do{var e=c;c=c+1|0;if(b===a[e])return e}while(c<=d);return-1}function ia(a,b){var c=0,d=a.length-1|0;if(c<=d)do{var e=c;c=c+1|0;if(b===a[e])return e}while(c<=d);return-1}function ja(a,b){var c=0,d=a.length-1|0;if(c<=d)do{var e=c;c=c+1|0;if(b===a[e])return e}while(c<=d);return-1}function ka(a,b){var c=0,d=a.length-1|0;if(c<=d)do{var e=c;c=c+1|0;if(b.equals(a[e]))return e}while(c<=d);return-1}function la(a){return a.length-1|0}function la(a){return a.length-1|0}function la(a){return a.length-1|0}function la(a){return a.length-1|0}function la(a){return a.length-1|0}function ma(a,b){return(0<=b?b<=(a.length-1|0):!1)?a[b]:null}function na(a,b,c,d,e,f,g){b=b===H?", ":b;c=c===H?"":c;d=d===H?"":d;e=e===H?-1:e;f=f===H?"...":f;g=g===H?null:g;return oa(a,mm(),b,c,d,e,f,g).toString()}function oa(a,b,c,d,e,f,g,h){c=c===H?", ":c;d=d===H?"":d;e=e===H?"":e;f=f===H?-1:f;g=g===H?"...":g;h=h===H?null:h;b.append_jgojdo_k$(d);d=0;a=a.iterator_jk1svi_k$();$l$loop:while(a.hasNext_bitz1p_k$()){var i=a.next_20eer_k$();d=d+1|0;d>1&&b.append_jgojdo_k$(c);if(f<0||d<=f)ps(b,i,h);else break $l$loop}f>=0&&d>f&&b.append_jgojdo_k$(g);b.append_jgojdo_k$(e);return b}function pa(a,b){b=F(b).minus_mfbszm_k$(F(1));return a.rangeTo_dxc9t6_k$(b.toLong_edfucp_k$())}function qa(a,b){b=F(b).minus_mfbszm_k$(F(1));return a.rangeTo_dxc9t6_k$(b.toLong_edfucp_k$())}function ra(a,b){b=F(b).minus_mfbszm_k$(F(1));return a.rangeTo_dxc9t6_k$(b.toLong_edfucp_k$())}function sa(a,b){if(b.compareTo_9jj042_k$(new s(0,-2147483648))<=0)return Dr().get_EMPTY_i8q41w_k$();b=b.minus_mfbszm_k$(F(1));return a.rangeTo_dxc9t6_k$(b.toLong_edfucp_k$())}function la(a,b){return Ka(b,n(0))<=0?Hr().get_EMPTY_i8q41w_k$():Oa(a,Pa(Na(b,1)))}function ta(a,b){return a>b?b:a}function ua(a,b){return a<b?b:a}function la(a,b){var c=V(0);if(sg(W(b),W(c))<=0)return Ht().get_EMPTY_i8q41w_k$();c=V(1);b=V(W(b)-W(c)|0);return new It(a,b)}function la(a,b){var c=Y(new s(0,0));if(ug(Z(b),Z(c))<=0)return ku().get_EMPTY_i8q41w_k$();c=V(1);c=W(c);c=F(c).and_4spn93_k$(new s(-1,0));c=Y(c);b=Y(Z(b).minus_mfbszm_k$(Z(c)));return new lu(a,b)}function va(a){Tk(a);Da.call(a);return a}function wa(){var a=va(t(z(Da)));y(a,wa);return a}function xa(a,b){Vk(a,b);Da.call(b);return b}function ya(a){a=xa(a,t(z(Da)));y(a,ya);return a}function za(a,b,c){Xk(a,b,c);Da.call(c);return c}function Aa(a,b){a=za(a,b,t(z(Da)));y(a,Aa);return a}function Ba(a,b){Zk(a,b);Da.call(b);return b}function Ca(a){a=Ba(a,t(z(Da)));y(a,Ca);return a}function Da(){y(this,Da)}function Ea(){}z(Ea).equals=function(a){if(!(a instanceof Ea))return!1;a instanceof Ea||A();return!0};z(Ea).hashCode=function(){return 0};z(Ea).toString=function(){return"@kotlin.js.ExperimentalJsCollectionsApi()"};function Fa(){}z(Fa).equals=function(a){if(!(a instanceof Fa))return!1;a instanceof Fa||A();return!0};z(Fa).hashCode=function(){return 0};z(Fa).toString=function(){return"@kotlin.js.ExperimentalJsFileName()"};function Ga(){}z(Ga).equals=function(a){if(!(a instanceof Ga))return!1;a instanceof Ga||A();return!0};z(Ga).hashCode=function(){return 0};z(Ga).toString=function(){return"@kotlin.js.ExperimentalJsExport()"};function Ha(){}z(Ha).equals=function(a){if(!(a instanceof Ha))return!1;a instanceof Ha||A();return!0};z(Ha).hashCode=function(){return 0};z(Ha).toString=function(){return"@kotlin.internal.IntrinsicConstEvaluation()"};function n(a){return a}function Ia(a){return a}function Ja(a){a=wu(a)&65535;return n(a)}function Ka(a,b){return Ia(a)-Ia(b)|0}function La(a,b){return Ka(a.value_1,b instanceof Va?b.value_1:A())}function Ma(a,b){return gf(Ia(a)+b|0)}function Na(a,b){return gf(Ia(a)-b|0)}function Oa(a,b){return new Ir(a,b)}function Pa(a){return a}function o(a){return Ia(a)}function p(a){return String.fromCharCode(Ia(a))}function Qa(a,b){return!(b instanceof Va)?!1:Ia(a)===Ia(b.value_1)}function Ra(a){return Ia(a)}function Sa(){Ta=this,this.MIN_VALUE_1=n(0),this.MAX_VALUE_1=n(65535),this.MIN_HIGH_SURROGATE_1=n(55296),this.MAX_HIGH_SURROGATE_1=n(56319),this.MIN_LOW_SURROGATE_1=n(56320),this.MAX_LOW_SURROGATE_1=n(57343),this.MIN_SURROGATE_1=n(55296),this.MAX_SURROGATE_1=n(57343),this.SIZE_BYTES_1=2,this.SIZE_BITS_1=16}z(Sa).get_MIN_VALUE_9z8va5_k$=function(){return this.MIN_VALUE_1};z(Sa).get_MAX_VALUE_bm2fhr_k$=function(){return this.MAX_VALUE_1};z(Sa).get_MIN_HIGH_SURROGATE_t8674j_k$=function(){return this.MIN_HIGH_SURROGATE_1};z(Sa).get_MAX_HIGH_SURROGATE_eamm67_k$=function(){return this.MAX_HIGH_SURROGATE_1};z(Sa).get_MIN_LOW_SURROGATE_mwv6vb_k$=function(){return this.MIN_LOW_SURROGATE_1};z(Sa).get_MAX_LOW_SURROGATE_gxd79n_k$=function(){return this.MAX_LOW_SURROGATE_1};z(Sa).get_MIN_SURROGATE_6v5u0s_k$=function(){return this.MIN_SURROGATE_1};z(Sa).get_MAX_SURROGATE_r7zmwa_k$=function(){return this.MAX_SURROGATE_1};z(Sa).get_SIZE_BYTES_qphg4q_k$=function(){return this.SIZE_BYTES_1};z(Sa).get_SIZE_BITS_7qhjj9_k$=function(){return this.SIZE_BITS_1};var Ta;function Ua(){Ta==null&&new Sa();return Ta}function Va(a){Ua(),this.value_1=a}z(Va).compareTo_gstm7h_k$=function(a){return Ka(this.value_1,a)};z(Va).compareTo_hpufkf_k$=function(a){return La(this,a)};z(Va).toString=function(){return p(this.value_1)};z(Va).equals=function(a){return Qa(this.value_1,a)};z(Va).hashCode=function(){return Ra(this.value_1)};function Wa(){}function la(){}z(Xa).fromJsArray_n3u761_k$=function(a){return Bc(a)};function Xa(){Ya=this}var Ya;function Za(){}z($a).fromJsSet_alycnr_k$=function(a){return Cc(a)};function $a(){ab=this}var ab;function bb(){}function q(){}z(cb).fromJsSet_alycnr_k$=function(a){return Dc(a)};function cb(){db=this}var db;function eb(){}function fb(){}z(gb).fromJsMap_p3spvk_k$=function(a){return Ec(a)};function gb(){hb=this}var hb;function ib(){}function jb(){}z(kb).fromJsMap_p3spvk_k$=function(a){return Fc(a)};function kb(){lb=this}var lb;function mb(){}function nb(){}z(ob).fromJsArray_n3u761_k$=function(a){return Ac(a)};function ob(){pb=this}var pb;function qb(){}function rb(){sb=this}var sb;function tb(){sb==null&&new rb();return sb}function r(a,b){tb(),this.name_1=a,this.ordinal_1=b}z(r).get_name_woqyms_k$=function(){return this.name_1};z(r).get_ordinal_ip24qg_k$=function(){return this.ordinal_1};z(r).compareTo_30rs7w_k$=function(a){return Kd(this.ordinal_1,a.ordinal_1)};z(r).compareTo_hpufkf_k$=function(a){return this.compareTo_30rs7w_k$(a instanceof r?a:A())};z(r).equals=function(a){return this===a};z(r).hashCode=function(){return Od(this)};z(r).toString=function(){return this.name_1};function ub(a){a=a==null?null:x(a);return a==null?"null":a}function vb(a,b){a=a==null?null:x(a);a=a==null?"null":a;b=b==null?null:x(b);return a+(b==null?"null":b)}function wb(){xb=this,this.MIN_VALUE_1=new s(0,-2147483648),this.MAX_VALUE_1=new s(-1,2147483647),this.SIZE_BYTES_1=8,this.SIZE_BITS_1=64}z(wb).get_MIN_VALUE_7nmmor_k$=function(){return this.MIN_VALUE_1};z(wb).get_MAX_VALUE_54a9lf_k$=function(){return this.MAX_VALUE_1};z(wb).get_SIZE_BYTES_qphg4q_k$=function(){return this.SIZE_BYTES_1};z(wb).get_SIZE_BITS_7qhjj9_k$=function(){return this.SIZE_BITS_1};var xb;function yb(){xb==null&&new wb();return xb}function s(a,b){yb(),Pm.call(this),this.low_1=a,this.high_1=b}z(s).get_low_mx1tz7_k$=function(){return this.low_1};z(s).get_high_ofkkcd_k$=function(){return this.high_1};z(s).compareTo_z0c5i0_k$=function(a){return this.compareTo_9jj042_k$(F(a))};z(s).compareTo_ka11ag_k$=function(a){return this.compareTo_9jj042_k$(F(a))};z(s).compareTo_7hwzko_k$=function(a){return this.compareTo_9jj042_k$(F(a))};z(s).compareTo_9jj042_k$=function(a){return we(this,a)};z(s).compareTo_hpufkf_k$=function(a){return this.compareTo_9jj042_k$(a instanceof s?a:A())};z(s).compareTo_9qeqt4_k$=function(a){return Kd(this.toFloat_jhbgwv_k$(),a)};z(s).compareTo_t5h9ae_k$=function(a){return Kd(this.toDouble_ygsx0s_k$(),a)};z(s).plus_hard1a_k$=function(a){return this.plus_r93sks_k$(F(a))};z(s).plus_7d0ae6_k$=function(a){return this.plus_r93sks_k$(F(a))};z(s).plus_gv6ohq_k$=function(a){return this.plus_r93sks_k$(F(a))};z(s).plus_r93sks_k$=function(a){return xe(this,a)};z(s).plus_xnnzhe_k$=function(a){return this.toFloat_jhbgwv_k$()+a};z(s).plus_pjpmi4_k$=function(a){return this.toDouble_ygsx0s_k$()+a};z(s).minus_m4jcmg_k$=function(a){return this.minus_mfbszm_k$(F(a))};z(s).minus_t8tq14_k$=function(a){return this.minus_mfbszm_k$(F(a))};z(s).minus_vfk7ag_k$=function(a){return this.minus_mfbszm_k$(F(a))};z(s).minus_mfbszm_k$=function(a){return ye(this,a)};z(s).minus_brujug_k$=function(a){return this.toFloat_jhbgwv_k$()-a};z(s).minus_ur3tau_k$=function(a){return this.toDouble_ygsx0s_k$()-a};z(s).times_l3vm36_k$=function(a){return this.times_nfzjiw_k$(F(a))};z(s).times_pycwwe_k$=function(a){return this.times_nfzjiw_k$(F(a))};z(s).times_kr2a3y_k$=function(a){return this.times_nfzjiw_k$(F(a))};z(s).times_nfzjiw_k$=function(a){return ze(this,a)};z(s).times_422v76_k$=function(a){return this.toFloat_jhbgwv_k$()*a};z(s).times_qz1dds_k$=function(a){return this.toDouble_ygsx0s_k$()*a};z(s).div_op7y5j_k$=function(a){return this.div_jun7gj_k$(F(a))};z(s).div_haijbb_k$=function(a){return this.div_jun7gj_k$(F(a))};z(s).div_fxyyjd_k$=function(a){return this.div_jun7gj_k$(F(a))};z(s).div_jun7gj_k$=function(a){return Ae(this,a)};z(s).div_nq5qk9_k$=function(a){return this.toFloat_jhbgwv_k$()/a};z(s).div_k6dnjf_k$=function(a){return this.toDouble_ygsx0s_k$()/a};z(s).rem_wr7kce_k$=function(a){return this.rem_bsnl9o_k$(F(a))};z(s).rem_g0zx5q_k$=function(a){return this.rem_bsnl9o_k$(F(a))};z(s).rem_agrhqa_k$=function(a){return this.rem_bsnl9o_k$(F(a))};z(s).rem_bsnl9o_k$=function(a){return Be(this,a)};z(s).rem_ozocpu_k$=function(a){return this.toFloat_jhbgwv_k$()%a};z(s).rem_rpe504_k$=function(a){return this.toDouble_ygsx0s_k$()%a};z(s).inc_28ke_k$=function(){return this.plus_r93sks_k$(new s(1,0))};z(s).dec_24n6_k$=function(){return this.minus_mfbszm_k$(new s(1,0))};z(s).unaryPlus_g9fn1l_k$=function(){return this};z(s).unaryMinus_6uz0qp_k$=function(){return this.inv_28kx_k$().plus_r93sks_k$(new s(1,0))};z(s).rangeTo_umivsw_k$=function(a){return new Er(this,F(a))};z(s).rangeTo_suedwg_k$=function(a){return new Er(this,F(a))};z(s).rangeTo_d1bgzk_k$=function(a){return new Er(this,F(a))};z(s).rangeTo_dxc9t6_k$=function(a){return new Er(this,a)};z(s).rangeUntil_3oumv_k$=function(a){return pa(this,a)};z(s).rangeUntil_vu7vsn_k$=function(a){return qa(this,a)};z(s).rangeUntil_621v6f_k$=function(a){return ra(this,a)};z(s).rangeUntil_qkxqzx_k$=function(a){return sa(this,a)};z(s).shl_bg8if3_k$=function(a){return Ce(this,a)};z(s).shr_9fl3wl_k$=function(a){return De(this,a)};z(s).ushr_z7nmq8_k$=function(a){return Ee(this,a)};z(s).and_4spn93_k$=function(a){return new s(this.low_1&a.low_1,this.high_1&a.high_1)};z(s).or_v7fvkl_k$=function(a){return new s(this.low_1|a.low_1,this.high_1|a.high_1)};z(s).xor_qzz94j_k$=function(a){return new s(this.low_1^a.low_1,this.high_1^a.high_1)};z(s).inv_28kx_k$=function(){return new s(~this.low_1,~this.high_1)};z(s).toByte_edm0nx_k$=function(){return bf(this.low_1)};z(s).toChar_tavt71_k$=function(){return gf(this.low_1)};z(s).toShort_ja8oqn_k$=function(){return ef(this.low_1)};z(s).toInt_1tsl84_k$=function(){return this.low_1};z(s).toLong_edfucp_k$=function(){return this};z(s).toFloat_jhbgwv_k$=function(){return this.toDouble_ygsx0s_k$()};z(s).toDouble_ygsx0s_k$=function(){return Fe(this)};z(s).toString=function(){return Ge(this,10)};z(s).equals=function(a){a instanceof s?a=He(this,a):a=!1;return a};z(s).hashCode=function(){return Ie(this)};z(s).valueOf=function(){return this.toDouble_ygsx0s_k$()};function zb(a){var b=1,c=[],d=0,e=a.length;while(d<e){var f=a[d];d=d+1|0;var g=b,h=f.prototype.$imask$;h=h==null?f.$imask$:h;h==null||(c.push(h),g=h.length);h=f.$metadata$.iid;h==null?f=null:f=Ab(h);h=f;h==null||(c.push(h),g=Math.max(g,h.length));g>b&&(b=g)}return Bb(b,c)}function Ab(a){var b=a>>5,c=new Int32Array(b+1|0);a=a&31;a=1<<a;c[b]=c[b]|a;return c}function Bb(a,b){var c=0,d=new Int32Array(a);while(c<a){var e=c,f=0,g=0,h=b.length;while(g<h){var i=b[g];g=g+1|0;e<i.length&&(f=f|i[e])}d[e]=f;c=c+1|0}return d}function Cb(a,b){var c=b>>5;if(c>a.length)return!1;b=b&31;b=1<<b;return!((a[c]&b)===0)}function Db(){Eb=this}var Eb;function Fb(){}function Gb(a,b){var c=0,d=a.length-1|0;if(c<=d)do{var e=c;c=c+1|0;a[e]=b}while(!(e===d));return a}function Hb(a){var b="LongArray";a=Gb(Array(a),new s(0,0));a.$type$=b;return a}function Ib(a){this.$array_1=a,this.index_1=0}z(Ib).set_index_69f5xp_k$=function(a){this.index_1=a};z(Ib).get_index_it478p_k$=function(){return this.index_1};z(Ib).hasNext_bitz1p_k$=function(){return!(this.index_1===this.$array_1.length)};z(Ib).next_20eer_k$=function(){if(!(this.index_1===this.$array_1.length)){var a=this.index_1;this.index_1=a+1|0;a=this.$array_1[a]}else throw fj(""+this.index_1);return a};function Jb(a){this.$array_1=a,op.call(this),this.index_1=0}z(Jb).set_index_69f5xp_k$=function(a){this.index_1=a};z(Jb).get_index_it478p_k$=function(){return this.index_1};z(Jb).hasNext_bitz1p_k$=function(){return!(this.index_1===this.$array_1.length)};z(Jb).nextBoolean_nfdk1h_k$=function(){if(!(this.index_1===this.$array_1.length)){var a=this.index_1;this.index_1=a+1|0;a=this.$array_1[a]}else throw fj(""+this.index_1);return a};function Kb(a){this.$array_1=a,mp.call(this),this.index_1=0}z(Kb).set_index_69f5xp_k$=function(a){this.index_1=a};z(Kb).get_index_it478p_k$=function(){return this.index_1};z(Kb).hasNext_bitz1p_k$=function(){return!(this.index_1===this.$array_1.length)};z(Kb).nextChar_yvnk6j_k$=function(){if(!(this.index_1===this.$array_1.length)){var a=this.index_1;this.index_1=a+1|0;a=this.$array_1[a]}else throw fj(""+this.index_1);return a};function Lb(a){this.$array_1=a,ip.call(this),this.index_1=0}z(Lb).set_index_69f5xp_k$=function(a){this.index_1=a};z(Lb).get_index_it478p_k$=function(){return this.index_1};z(Lb).hasNext_bitz1p_k$=function(){return!(this.index_1===this.$array_1.length)};z(Lb).nextByte_njqopn_k$=function(){if(!(this.index_1===this.$array_1.length)){var a=this.index_1;this.index_1=a+1|0;a=this.$array_1[a]}else throw fj(""+this.index_1);return a};function Mb(a){this.$array_1=a,np.call(this),this.index_1=0}z(Mb).set_index_69f5xp_k$=function(a){this.index_1=a};z(Mb).get_index_it478p_k$=function(){return this.index_1};z(Mb).hasNext_bitz1p_k$=function(){return!(this.index_1===this.$array_1.length)};z(Mb).nextShort_jxwabt_k$=function(){if(!(this.index_1===this.$array_1.length)){var a=this.index_1;this.index_1=a+1|0;a=this.$array_1[a]}else throw fj(""+this.index_1);return a};function Nb(a){this.$array_1=a,hp.call(this),this.index_1=0}z(Nb).set_index_69f5xp_k$=function(a){this.index_1=a};z(Nb).get_index_it478p_k$=function(){return this.index_1};z(Nb).hasNext_bitz1p_k$=function(){return!(this.index_1===this.$array_1.length)};z(Nb).nextInt_ujorgc_k$=function(){if(!(this.index_1===this.$array_1.length)){var a=this.index_1;this.index_1=a+1|0;a=this.$array_1[a]}else throw fj(""+this.index_1);return a};function Ob(a){this.$array_1=a,lp.call(this),this.index_1=0}z(Ob).set_index_69f5xp_k$=function(a){this.index_1=a};z(Ob).get_index_it478p_k$=function(){return this.index_1};z(Ob).hasNext_bitz1p_k$=function(){return!(this.index_1===this.$array_1.length)};z(Ob).nextFloat_jqti5l_k$=function(){if(!(this.index_1===this.$array_1.length)){var a=this.index_1;this.index_1=a+1|0;a=this.$array_1[a]}else throw fj(""+this.index_1);return a};function Pb(a){this.$array_1=a,jp.call(this),this.index_1=0}z(Pb).set_index_69f5xp_k$=function(a){this.index_1=a};z(Pb).get_index_it478p_k$=function(){return this.index_1};z(Pb).hasNext_bitz1p_k$=function(){return!(this.index_1===this.$array_1.length)};z(Pb).nextLong_njwv0v_k$=function(){if(!(this.index_1===this.$array_1.length)){var a=this.index_1;this.index_1=a+1|0;a=this.$array_1[a]}else throw fj(""+this.index_1);return a};function Qb(a){this.$array_1=a,kp.call(this),this.index_1=0}z(Qb).set_index_69f5xp_k$=function(a){this.index_1=a};z(Qb).get_index_it478p_k$=function(){return this.index_1};z(Qb).hasNext_bitz1p_k$=function(){return!(this.index_1===this.$array_1.length)};z(Qb).nextDouble_s2xvfg_k$=function(){if(!(this.index_1===this.$array_1.length)){var a=this.index_1;this.index_1=a+1|0;a=this.$array_1[a]}else throw fj(""+this.index_1);return a};function Rb(){dc();return Sb}var Sb;function Tb(){dc();return Ub}var Ub,Vb;function Wb(){dc();return Xb}var Xb;function Yb(){dc();return Zb}var Zb;function $b(){dc();return ac}var ac;function bc(a){dc();if((a|0)===a)return cf(a);Tb()[0]=a;return g(Wb()[$b()],31)+Wb()[Yb()]|0}var cc;function dc(){cc||(cc=!0,Sb=new ArrayBuffer(8),Ub=new Float64Array(Rb()),Vb=new Float32Array(Rb()),Xb=new Int32Array(Rb()),Tb()[0]=-1,Zb=Wb()[0]===0?0:1,ac=1-Yb()|0)}function ec(){}z(ec).equals=function(a){if(!(a instanceof ec))return!1;a instanceof ec||A();return!0};z(ec).hashCode=function(){return 0};z(ec).toString=function(){return"@kotlin.js.DoNotIntrinsify()"};function fc(a,b){if(gc(a)){var c=a.charCodeAt(b),d=n(0);if(c<o(d))d=!0;else{var e=n(65535);d=c>o(e)}if(d)throw M("Invalid Char code: "+c);e=gf(c)}else e=a.get_kdzpvg_k$(b);return e}function gc(a){return typeof a==="string"}function hc(a){var b;gc(a)?b=a.length:b=a.get_length_g42xv3_k$();return b}function ic(a,b){a=a;b=b;if(a===b)return!0;if(a==null||b==null||!Ef(b)||a.length!=b.length)return!1;var c=0,d=a.length;if(c<d)do{var e=c;c=c+1|0;if(!u(a[e],b[e]))return!1}while(c<d);return!0}function jc(a){return aa(a,", ","[","]",H,H,kc)}function kc(a){return x(a)}function lc(a){var b=Gc(a);a=Hc(a);var c=Ic(),d=Jc(),e=Kc();return mc(b,a,c,d,e)}function mc(a,b,c,d,e){var f=t(z(oc));return new Proxy(f,{get:function(c,d,e){if(d==="length")return a();e=typeof d;e=e==="string"||e==="number"?+d:void 0;return!isNaN(e)?b(e):c[d]},has:function(b,c){return!isNaN(c)&&c<a()},set:function(b,f,g){if(f==="length"){b=a();var h=i==="string"||i==="number"?+f:void 0;if(isNaN(h))throw new RangeError("invalid array length");h<b?d(b-h):e(h-b);return!0}var i=typeof f;h=i==="string"||i==="number"?+f:void 0;if(isNaN(h))return!1;c(h,g);return!0}})}function nc(){throw zj()}function oc(){Array.call(this)}function pc(a){var b=Lc(a),c=Mc(),d=Nc(),e=Oc(),f=Pc(a),g=Qc(a);a=Sc(a);return qc(b,c,d,e,f,g,a,Tc)}function qc(a,b,c,d,e,f,g,h){var i=t(z(tc));i[typeof Symbol==="function"?Symbol.iterator:"@@iterator"]=f;Rd(i,"size",a,H);var j=i;return Object.assign(j,{add:function(a){b(a);return this},"delete":c,clear:d,has:e,keys:f,values:f,entries:g,forEach:function(a,b){h(a,b||j)}})}function rc(a,b){var c;b===H?c=Uc:c=b;b=c;var d=Vc(a),e=Wc(a);return{next:function(){var a={done:!e()};a.done||(a.value=b(d()));return a}}}function sc(a,b){var c=b.entries(),d=c.next();while(!d.done){var e=d.value;a(e[0],e[1],b);d=c.next()}}function tc(){Set.call(this)}function uc(a){var b=Xc(a),c=Yc(a),d=Zc(a),e=$c(),f=ad(),g=bd(),h=cd(a),i=dd(a);a=fd(a);return vc(b,c,d,e,f,g,h,i,a,gd)}function vc(a,b,c,d,e,f,g,h,i,j){g=t(z(wc));g[typeof Symbol==="function"?Symbol.iterator:"@@iterator"]=i;Rd(g,"size",a,H);var k=g;return Object.assign(k,{get:b,set:function(a,b){d(a,b);return this},"delete":e,clear:f,has:c,keys:h,values:h,entries:i,forEach:function(a,b){j(a,b||k)}})}function wc(){Map.call(this)}function xc(a){var b=hd(a),c=id(a),d=jd(a),e=kd(a),f=ld(a),g=md(a);a=od(a);return qc(b,c,d,e,f,g,a,pd)}function yc(a){var b=qd(a),c=rd(a),d=sd(a);a=td(a);var e=ud();return mc(b,c,d,a,e)}function zc(a){var b=vd(a),c=wd(a),d=xd(a),e=yd(a),f=zd(a),g=Ad(a),h=Bd(a),i=Cd(a);a=Ed(a);return vc(b,c,d,e,f,g,h,i,a,Fd)}function Ac(a){a=a.slice();return new J(a).build_nmwvly_k$()}function Bc(a){a=a.slice();return new J(a)}function Cc(a){var b=xi();sc(Gd(b),a);return b.build_nmwvly_k$()}function Dc(a){var b=xi();sc(Hd(b),a);return b}function Ec(a){var b=oi();sc(Id(b),a);return b.build_nmwvly_k$()}function Fc(a){var b=oi();sc(Jd(b),a);return b}function Gc(a){return function(){return a.get_size_woubt6_k$()}}function Hc(a){return function(b){return a.get_c1px32_k$(b)}}function Ic(){var a=function(){nc();return S()};a.callableName="UNSUPPORTED_OPERATION";return a}function Jc(){var a=function(){nc();return S()};a.callableName="UNSUPPORTED_OPERATION";return a}function Kc(){var a=function(){nc();return S()};a.callableName="UNSUPPORTED_OPERATION";return a}function Lc(a){return function(){return a.get_size_woubt6_k$()}}function Mc(){var a=function(){nc();return S()};a.callableName="UNSUPPORTED_OPERATION";return a}function Nc(){var a=function(){nc();return S()};a.callableName="UNSUPPORTED_OPERATION";return a}function Oc(){var a=function(){nc();return S()};a.callableName="UNSUPPORTED_OPERATION";return a}function Pc(a){return function(b){return a.contains_aljjnj_k$(b)}}function Qc(a){return function(){return rc(a.iterator_jk1svi_k$())}}function Rc(a){return[a,a]}function Sc(a){return function(){var b=a.iterator_jk1svi_k$();return rc(b,Rc)}}function Tc(a,b){sc(a,b);return S()}function Uc(a){return a}function Vc(a){return function(){return a.next_20eer_k$()}}function Wc(a){return function(){return a.hasNext_bitz1p_k$()}}function Xc(a){return function(){return a.get_size_woubt6_k$()}}function Yc(a){return function(b){return a.get_wei43m_k$(b)}}function Zc(a){return function(b){return a.containsKey_aw81wo_k$(b)}}function $c(){var a=function(){nc();return S()};a.callableName="UNSUPPORTED_OPERATION";return a}function ad(){var a=function(){nc();return S()};a.callableName="UNSUPPORTED_OPERATION";return a}function bd(){var a=function(){nc();return S()};a.callableName="UNSUPPORTED_OPERATION";return a}function cd(a){return function(){return rc(a.get_keys_wop4xp_k$().iterator_jk1svi_k$())}}function dd(a){return function(){return rc(a.get_values_ksazhn_k$().iterator_jk1svi_k$())}}function ed(a){return[a.get_key_18j28a_k$(),a.get_value_j01efc_k$()]}function fd(a){return function(){var b=a.get_entries_p20ztl_k$().iterator_jk1svi_k$();return rc(b,ed)}}function gd(a,b){sc(a,b);return S()}function hd(a){return function(){return a.get_size_woubt6_k$()}}function id(a){return function(b){a.add_utx5q5_k$(b);return S()}}function jd(a){return function(b){return a.remove_cedx0m_k$(b)}}function kd(a){return function(){a.clear_j9egeb_k$();return S()}}function ld(a){return function(b){return a.contains_aljjnj_k$(b)}}function md(a){return function(){return rc(a.iterator_jk1svi_k$())}}function nd(a){return[a,a]}function od(a){return function(){var b=a.iterator_jk1svi_k$();return rc(b,nd)}}function pd(a,b){sc(a,b);return S()}function qd(a){return function(){return a.get_size_woubt6_k$()}}function rd(a){return function(b){return a.get_c1px32_k$(b)}}function sd(a){return function(b,c){a.set_82063s_k$(b,c);return S()}}function td(a){return function(b){a.subList_xle3r2_k$(a.get_size_woubt6_k$()-b|0,a.get_size_woubt6_k$()).clear_j9egeb_k$();return S()}}function ud(){var a=function(){nc();return S()};a.callableName="UNSUPPORTED_OPERATION";return a}function vd(a){return function(){return a.get_size_woubt6_k$()}}function wd(a){return function(b){return a.get_wei43m_k$(b)}}function xd(a){return function(b){return a.containsKey_aw81wo_k$(b)}}function yd(a){return function(b,c){a.put_4fpzoq_k$(b,c);return S()}}function zd(a){return function(b){a.remove_gppy8k_k$(b);return S()}}function Ad(a){return function(){a.clear_j9egeb_k$();return S()}}function Bd(a){return function(){return rc(a.get_keys_wop4xp_k$().iterator_jk1svi_k$())}}function Cd(a){return function(){return rc(a.get_values_ksazhn_k$().iterator_jk1svi_k$())}}function Dd(a){return[a.get_key_18j28a_k$(),a.get_value_j01efc_k$()]}function Ed(a){return function(){var b=a.get_entries_p20ztl_k$().iterator_jk1svi_k$();return rc(b,Dd)}}function Fd(a,b){sc(a,b);return S()}function Gd(a){return function(b,c,d){a.add_utx5q5_k$(c);return S()}}function Hd(a){return function(b,c,d){a.add_utx5q5_k$(c);return S()}}function Id(a){return function(b,c,d){a.put_4fpzoq_k$(b,c);return S()}}function Jd(a){return function(b,c,d){a.put_4fpzoq_k$(b,c);return S()}}function Kd(a,b){var c;switch(typeof a){case"number":var d;typeof b==="number"?d=Ld(a,b):b instanceof s?d=Ld(a,b.toDouble_ygsx0s_k$()):d=Md(a,b);c=d;break;case"string":case"boolean":c=Md(a,b);break;default:c=Nd(a,b);break}return c}function Ld(a,b){var c;if(a<b)c=-1;else if(a>b)c=1;else if(a===b){var d;if(a!==0)d=0;else{var e=1/a,f;e===1/b?f=0:e<0?f=-1:f=1;d=f}c=d}else a!==a?c=b!==b?0:1:c=-1;return c}function Md(a,b){return a<b?-1:a>b?1:0}function Nd(a,b){return a.compareTo_hpufkf_k$(b)}function Od(a){return Pd(a)}function Pd(b){if(!("kotlinHashCodeValue$"in b)){var a=Qd(),c=new Object();c.value=a;c.enumerable=!1;Object.defineProperty(b,"kotlinHashCodeValue$",c)}return b.kotlinHashCodeValue$}function Qd(){return Math.random()*4294967296|0}function t(a){a=a===H?null:a;return Object.create(a)}function u(a,b){if(a==null)return b==null;if(b==null)return!1;if(typeof a==="object"&&typeof a.equals==="function")return a.equals(b);if(a!==a)return b!==b;if(typeof a==="number"&&typeof b==="number"){if(a===b){var c;if(a!==0)c=!0;else{var d=1/a;c=d===1/b}d=c}else d=!1;return d}return a===b}function Rd(a,b,c,d){return Object.defineProperty(a,b,{configurable:!0,get:c,set:d})}function v(a){if(a==null)return 0;var b=typeof a,c;switch(b){case"object":c="function"===typeof a.hashCode?a.hashCode():Pd(a);break;case"function":c=Pd(a);break;case"number":c=bc(a);break;case"boolean":c=Sd(a);break;case"string":c=w(String(a));break;case"bigint":c=Td(a);break;case"symbol":c=Ud(a);break;default:c=function(){throw new Error("Unexpected typeof `"+b+"`")}();break}return c}function Sd(a){return a?1231:1237}function w(b){var a=0,c=b.length,d=0;c=c-1|0;if(d<=c)do{var e=d;d=d+1|0;var f=b.charCodeAt(e);a=g(a,31)+f|0}while(!(e===c));return a}function Td(b){var c=BigInt(32),d=BigInt(4294967295),e=b<0?-b:b,a=0;b=b<0?-1:1;while(e!=0){var f=Number(e&d);a=g(31,a)+f|0;e=e>>c}return g(a,b)}function Ud(a){var b=Vd(a)?Wd():Xd(),c=b.get(a);if(c!==H)return c;c=Qd();b.set(a,c);return c}function Vd(a){return(typeof Symbol==="function"?Symbol.keyFor:"@@keyFor")(a)!=H}function Wd(){Yd===H&&(Yd=new Map());return Yd}function Xd(){Zd===H&&(Zd=new WeakMap());return Zd}var Yd,Zd;function x(a){var b;a==null?b="null":Ef(a)?b="[...]":!(typeof a.toString==="function")?b=$d(a):b=a.toString();return b}function $d(a){return Object.prototype.toString.call(a)}function y(a,b){Error.captureStackTrace!=null?Error.captureStackTrace(a,b):a.stack=new Error().stack}function z(a){return a.prototype}function ae(a,b){b!==H&&Object.assign(a,b)}function ae(a){return a===H}function be(a,b,c){Error.call(a),ce(a,b,c)}function ce(a,b,c){var d=Uf(Object.getPrototypeOf(a));if((d&1)===0){if(b==null){if(!(b===null)){var e=c==null?null:c.toString();e=e==null?H:e}else e=H;e=e}else e=b;a.message=e}(d&2)===0&&(a.cause=c);a.name=Object.getPrototypeOf(a).constructor.name}function de(a){var b;a==null?ee():b=a;return b}function ee(){throw sk()}function fe(){throw jk()}function A(){throw Gk()}function ae(a){throw M(a)}function ge(){}z(ge).equals=function(a){if(!(a instanceof ge))return!1;a instanceof ge||A();return!0};z(ge).hashCode=function(){return 0};z(ge).toString=function(){return"@kotlin.js.JsIntrinsic()"};function he(a){this.code_1=a}z(he).get_code_wok7xy_k$=function(){return this.code_1};z(he).equals=function(a){if(!(a instanceof he))return!1;a=a instanceof he?a:A();return!(this.code_1===a.code_1)?!1:!0};z(he).hashCode=function(){return g(w("code"),127)^w(this.code_1)};z(he).toString=function(){return"@kotlin.js.JsFun(code="+this.code_1+")"};function ie(){}z(ie).equals=function(a){if(!(a instanceof ie))return!1;a instanceof ie||A();return!0};z(ie).hashCode=function(){return 0};z(ie).toString=function(){return"@kotlin.js.JsGenerator()"};function je(a){this.couldBeConvertedToExplicitExport_1=a}z(je).get_couldBeConvertedToExplicitExport_oo9t22_k$=function(){return this.couldBeConvertedToExplicitExport_1};z(je).equals=function(a){if(!(a instanceof je))return!1;a=a instanceof je?a:A();return!(this.couldBeConvertedToExplicitExport_1===a.couldBeConvertedToExplicitExport_1)?!1:!0};z(je).hashCode=function(){return g(w("couldBeConvertedToExplicitExport"),127)^Sd(this.couldBeConvertedToExplicitExport_1)};z(je).toString=function(){return"@kotlin.js.JsImplicitExport(couldBeConvertedToExplicitExport="+this.couldBeConvertedToExplicitExport_1+")"};function ke(){B();return le}var le;function me(){B();return ne}var ne;function oe(){B();return pe}var pe;function qe(){B();return re}var re;function se(){B();return te}var te;function ue(){B();return ve}var ve;function we(a,b){B();if(He(a,b))return 0;var c=Ke(a),d=Ke(b);return c&&!d?-1:!c&&d?1:Ke(ye(a,b))?-1:1}function xe(a,b){B();var c=a.get_high_ofkkcd_k$()>>>16|0,d=a.get_high_ofkkcd_k$()&65535,e=a.get_low_mx1tz7_k$()>>>16|0;a=a.get_low_mx1tz7_k$()&65535;var f=b.get_high_ofkkcd_k$()>>>16|0,g=b.get_high_ofkkcd_k$()&65535,h=b.get_low_mx1tz7_k$()>>>16|0;b=b.get_low_mx1tz7_k$()&65535;var i=0,j=0,k=0,l=0;l=l+(a+b|0)|0;k=k+(l>>>16|0)|0;l=l&65535;k=k+(e+h|0)|0;j=j+(k>>>16|0)|0;k=k&65535;j=j+(d+g|0)|0;i=i+(j>>>16|0)|0;j=j&65535;i=i+(c+f|0)|0;i=i&65535;return new s(k<<16|l,i<<16|j)}function ye(a,b){B();return xe(a,b.unaryMinus_6uz0qp_k$())}function ze(a,b){B();if(Le(a))return ke();else if(Le(b))return ke();if(He(a,se()))return Me(b)?se():ke();else if(He(b,se()))return Me(a)?se():ke();if(Ke(a)){var c;Ke(b)?c=ze(Ne(a),Ne(b)):c=Ne(ze(Ne(a),b));return c}else if(Ke(b))return Ne(ze(a,Ne(b)));if(Oe(a,ue())&&Oe(b,ue()))return Pe(Fe(a)*Fe(b));c=a.get_high_ofkkcd_k$()>>>16|0;var d=a.get_high_ofkkcd_k$()&65535,e=a.get_low_mx1tz7_k$()>>>16|0;a=a.get_low_mx1tz7_k$()&65535;var f=b.get_high_ofkkcd_k$()>>>16|0,h=b.get_high_ofkkcd_k$()&65535,i=b.get_low_mx1tz7_k$()>>>16|0;b=b.get_low_mx1tz7_k$()&65535;var j=0,k=0,l=0,m=0;m=m+g(a,b)|0;l=l+(m>>>16|0)|0;m=m&65535;l=l+g(e,b)|0;k=k+(l>>>16|0)|0;l=l&65535;l=l+g(a,i)|0;k=k+(l>>>16|0)|0;l=l&65535;k=k+g(d,b)|0;j=j+(k>>>16|0)|0;k=k&65535;k=k+g(e,i)|0;j=j+(k>>>16|0)|0;k=k&65535;k=k+g(a,h)|0;j=j+(k>>>16|0)|0;k=k&65535;j=j+(((g(c,b)+g(d,i)|0)+g(e,h)|0)+g(a,f)|0)|0;j=j&65535;return new s(l<<16|m,j<<16|k)}function Ae(a,b){B();if(Le(b))throw kj("division by zero");else if(Le(a))return ke();if(He(a,se()))if(He(b,me())||He(b,oe()))return se();else if(He(b,se()))return me();else{var c=De(a,1);c=Ce(c.div_jun7gj_k$(b),1);if(He(c,ke()))return Ke(b)?me():oe();else{var d=ye(a,ze(b,c));return xe(c,d.div_jun7gj_k$(b))}}else if(He(b,se()))return ke();if(Ke(a)){Ke(b)?c=Ne(a).div_jun7gj_k$(Ne(b)):c=Ne(Ne(a).div_jun7gj_k$(b));return c}else if(Ke(b))return Ne(a.div_jun7gj_k$(Ne(b)));d=ke();c=a;while(Re(c,b)){a=Fe(c)/Fe(b);a=Math.max(1,Math.floor(a));var e=Math.ceil(Math.log(a)/Math.LN2);e=e<=48?1:Math.pow(2,e-48);var f=Pe(a),g=ze(f,b);while(Ke(g)||Qe(g,c))a=a-e,f=Pe(a),g=ze(f,b);Le(f)&&(f=me());d=xe(d,f);c=ye(c,g)}return d}function Be(a,b){B();return ye(a,ze(a.div_jun7gj_k$(b),b))}function Ce(a,b){B();b=b&63;if(b===0)return a;else if(b<32)return new s(a.get_low_mx1tz7_k$()<<b,a.get_high_ofkkcd_k$()<<b|(a.get_low_mx1tz7_k$()>>>(32-b|0)|0));else return new s(0,a.get_low_mx1tz7_k$()<<(b-32|0))}function De(a,b){B();b=b&63;if(b===0)return a;else if(b<32)return new s(a.get_low_mx1tz7_k$()>>>b|0|a.get_high_ofkkcd_k$()<<(32-b|0),a.get_high_ofkkcd_k$()>>b);else return new s(a.get_high_ofkkcd_k$()>>(b-32|0),a.get_high_ofkkcd_k$()>=0?0:-1)}function Ee(a,b){B();b=b&63;if(b===0)return a;else if(b<32)return new s(a.get_low_mx1tz7_k$()>>>b|0|a.get_high_ofkkcd_k$()<<(32-b|0),a.get_high_ofkkcd_k$()>>>b|0);else{var c;b===32?c=new s(a.get_high_ofkkcd_k$(),0):c=new s(a.get_high_ofkkcd_k$()>>>(b-32|0)|0,0);return c}}function Fe(a){B();return a.get_high_ofkkcd_k$()*4294967296+Se(a)}function Ge(a,b){B();if(b<2||36<b)throw kj("radix out of range: "+b);if(Le(a))return"0";if(Ke(a))if(He(a,se())){var c=Je(b),d=a.div_jun7gj_k$(c);c=ye(ze(d,c),a).toInt_1tsl84_k$();d=Ge(d,b);return d+c.toString(b)}else return"-"+Ge(Ne(a),b);d=b===2?31:b<=10?9:b<=21?7:b<=35?6:5;c=Pe(Math.pow(b,d));a=a;var e="";while(!0){var f=a.div_jun7gj_k$(c),g=ye(a,ze(f,c)).toInt_1tsl84_k$();g=g.toString(b);a=f;if(Le(a))return g+e;else{while(g.length<d)g="0"+g;e=g+e}}}function He(a,b){B();return a.get_high_ofkkcd_k$()===b.get_high_ofkkcd_k$()&&a.get_low_mx1tz7_k$()===b.get_low_mx1tz7_k$()}function Ie(a){B();return a.get_low_mx1tz7_k$()^a.get_high_ofkkcd_k$()}function Je(a){B();return new s(a,a<0?-1:0)}function Ke(a){B();return a.get_high_ofkkcd_k$()<0}function Le(a){B();return a.get_high_ofkkcd_k$()===0&&a.get_low_mx1tz7_k$()===0}function Me(a){B();return(a.get_low_mx1tz7_k$()&1)===1}function Ne(a){B();return a.unaryMinus_6uz0qp_k$()}function Oe(a,b){B();return we(a,b)<0}function Pe(a){B();if(pg(a))return ke();else if(a<=-9223372036854776e3)return se();else if(a+1>=9223372036854776e3)return qe();else if(a<0)return Ne(Pe(-a));else{var b=4294967296,c=a%b|0;a=a/b|0;return new s(c,a)}}function Qe(a,b){B();return we(a,b)>0}function Re(a,b){B();return we(a,b)>=0}function Se(a){B();return a.get_low_mx1tz7_k$()>=0?a.get_low_mx1tz7_k$():4294967296+a.get_low_mx1tz7_k$()}var Te;function B(){Te||(Te=!0,le=Je(0),ne=Je(1),pe=Je(-1),re=new s(-1,2147483647),te=new s(0,-2147483648),ve=Je(16777216))}function Ue(a,b,c,d,e,f){var g=H,h=a==="interface"?Ve():H;return{kind:a,simpleName:b,associatedObjectKey:d,associatedObjects:e,suspendArity:f,$kClass$:g,defaultConstructor:c,iid:h}}function Ve(){We===H&&(We=0);We=We+1|0;return We}var We;function Xe(a,b,c,d,e,f,g,h,i){e==null||(b.prototype=Object.create(e.prototype),b.prototype.constructor=b);e=Ue(a,c,d,h,i,g);b.$metadata$=e;if(!(f==null)){a=u(e.iid,H)?b.prototype:b;a.$imask$=zb(f)}}function C(a,b,c,d,e,f,g,h){var i="class";Xe(i,a,b,c,d,e,f,g,h)}function Ye(a,b,c,d,e,f,g,h){var i="object";Xe(i,a,b,c,d,e,f,g,h)}function D(a,b,c,d,e,f,g,h){var i="interface";Xe(i,a,b,c,d,e,f,g,h)}function E(a,b,c,d){Ye(a,"Companion",H,b,c,d,H,H)}function Ze(a,b,c,d,e){return Ue("class",a,b,c,d,e)}function $e(a){var b=0,c=0,d=a.length-1|0;if(c<=d)do{var e=c;c=c+1|0;var f=b;b=f+a[e].length|0}while(!(e===d));f=a[0];e=new f.constructor(b);f.$type$!=null&&(e.$type$=f.$type$);b=0;c=0;d=a.length-1|0;if(c<=d)do{f=c;c=c+1|0;var g=a[f],h=0,i=g.length-1|0;if(h<=i)do{var j=h;h=h+1|0;var k=b;b=k+1|0;e[k]=g[j]}while(!(j===i))}while(!(f===d));return e}function af(a){return bf(cf(a))}function bf(a){return a<<24>>24}function cf(a){var b;a instanceof s?b=a.toInt_1tsl84_k$():b=df(a);return b}function df(a){var b;a>2147483647?b=2147483647:a<-2147483648?b=-2147483648:b=a|0;return b}function af(a){return ef(cf(a))}function ef(a){return a<<16>>16}function ff(a){var b;a instanceof s?b=a:b=Pe(a);return b}function gf(a){a=cf(a);a=vu(ef(a));return Ja(a)}function F(a){return Je(a)}function af(){hf=this,this.MIN_VALUE=-128,this.MAX_VALUE=127,this.SIZE_BYTES=1,this.SIZE_BITS=8}z(af).get_MIN_VALUE_7nmmor_k$=function(){return this.MIN_VALUE};z(af).get_MAX_VALUE_54a9lf_k$=function(){return this.MAX_VALUE};z(af).get_SIZE_BYTES_qphg4q_k$=function(){return this.SIZE_BYTES};z(af).get_SIZE_BITS_7qhjj9_k$=function(){return this.SIZE_BITS};var hf;function jf(){kf=this,this.MIN_VALUE=-32768,this.MAX_VALUE=32767,this.SIZE_BYTES=2,this.SIZE_BITS=16}z(jf).get_MIN_VALUE_7nmmor_k$=function(){return this.MIN_VALUE};z(jf).get_MAX_VALUE_54a9lf_k$=function(){return this.MAX_VALUE};z(jf).get_SIZE_BYTES_qphg4q_k$=function(){return this.SIZE_BYTES};z(jf).get_SIZE_BITS_7qhjj9_k$=function(){return this.SIZE_BITS};var kf;function lf(){mf=this,this.MIN_VALUE=-2147483648,this.MAX_VALUE=2147483647,this.SIZE_BYTES=4,this.SIZE_BITS=32}z(lf).get_MIN_VALUE_7nmmor_k$=function(){return this.MIN_VALUE};z(lf).get_MAX_VALUE_54a9lf_k$=function(){return this.MAX_VALUE};z(lf).get_SIZE_BYTES_qphg4q_k$=function(){return this.SIZE_BYTES};z(lf).get_SIZE_BITS_7qhjj9_k$=function(){return this.SIZE_BITS};var mf;function nf(){of=this,this.MIN_VALUE=14e-46,this.MAX_VALUE=34028235e31,this.POSITIVE_INFINITY=Infinity,this.NEGATIVE_INFINITY=-Infinity,this.NaN=NaN,this.SIZE_BYTES=4,this.SIZE_BITS=32}z(nf).get_MIN_VALUE_7nmmor_k$=function(){return this.MIN_VALUE};z(nf).get_MAX_VALUE_54a9lf_k$=function(){return this.MAX_VALUE};z(nf).get_POSITIVE_INFINITY_yq30fv_k$=function(){return this.POSITIVE_INFINITY};z(nf).get_NEGATIVE_INFINITY_e9bp9z_k$=function(){return this.NEGATIVE_INFINITY};z(nf).get_NaN_18jnv2_k$=function(){return this.NaN};z(nf).get_SIZE_BYTES_qphg4q_k$=function(){return this.SIZE_BYTES};z(nf).get_SIZE_BITS_7qhjj9_k$=function(){return this.SIZE_BITS};var of;function pf(){qf=this,this.MIN_VALUE=5e-324,this.MAX_VALUE=17976931348623157e292,this.POSITIVE_INFINITY=Infinity,this.NEGATIVE_INFINITY=-Infinity,this.NaN=NaN,this.SIZE_BYTES=8,this.SIZE_BITS=64}z(pf).get_MIN_VALUE_7nmmor_k$=function(){return this.MIN_VALUE};z(pf).get_MAX_VALUE_54a9lf_k$=function(){return this.MAX_VALUE};z(pf).get_POSITIVE_INFINITY_yq30fv_k$=function(){return this.POSITIVE_INFINITY};z(pf).get_NEGATIVE_INFINITY_e9bp9z_k$=function(){return this.NEGATIVE_INFINITY};z(pf).get_NaN_18jnv2_k$=function(){return this.NaN};z(pf).get_SIZE_BYTES_qphg4q_k$=function(){return this.SIZE_BYTES};z(pf).get_SIZE_BITS_7qhjj9_k$=function(){return this.SIZE_BITS};var qf;function rf(){sf=this}var sf;function tf(){uf=this}var uf;function vf(a,b){return new Ar(a,b)}function wf(){Df();return xf}var xf;function yf(){Df();return Ze(H,H,H,H,H)}function vf(a,b,c,d,e){Df();d.get=d;d.set=e;d.callableName=a;return zf(d,Af(b,e),Bf(d,c))}function zf(a,b,c){Df();a.$metadata$=b;a.constructor=a;a.$imask$=c;return a}function Af(a,b){Df();return wf()[a][b==null?0:1]}function Bf(a,b){Df();a=a.$imask$;if(a==null){b=[b];b=zb(b)}else b=a;return b}var Cf;function Df(){if(!Cf){Cf=!0;var a=[yf(),yf()],b=[yf(),yf()];xf=[a,b,[yf(),yf()]]}}function Ef(a){return Ff(a)||h(a)}function Ff(a){return Array.isArray(a)}function G(a,b){return Gf(a,b.$metadata$.iid)}function Gf(a,b){a=a.$imask$;if(a==null)return!1;else a=a;a=a;return Cb(a,b)}function Hf(a){Ff(a)?a=!a.$type$:a=!1;return a}function If(a){var b;typeof a==="number"?b=!0:b=a instanceof s;return b}function Jf(a){return typeof a==="string"||G(a,Jm)}function Kf(a){return Ff(a)&&a.$type$==="BooleanArray"}function Lf(a){return a instanceof Int8Array}function Mf(a){return a instanceof Int16Array}function Nf(a){a instanceof Uint16Array?a=a.$type$==="CharArray":a=!1;return a}function Of(a){return a instanceof Int32Array}function Pf(a){return a instanceof Float32Array}function Qf(a){return Ff(a)&&a.$type$==="LongArray"}function Rf(a){return a instanceof Float64Array}function Sf(a,b){if(b===Object)return a!=null;var c=typeof a,d=typeof b;if(a==null||b==null||!(c==="object")&&!(c==="function"))return!1;c=d==="object"?Tf(b):b;d=c.$metadata$;if((d==null?null:d.kind)==="interface"){b=d.iid;if(b==null)return!1;else d=b;b=d;return Gf(a,b)}return a instanceof c}function Tf(a){return Object.getPrototypeOf(a)}function Uf(a){var b=a.constructor;b=b==null?null:b.$metadata$;var c=b==null?null:b.errorInfo;if(c==null)null;else return c;c=0;Vf(a,"message")&&(c=c|1);Vf(a,"cause")&&(c=c|2);if(!(c===3)){a=Wf(a);a!=Error.prototype&&(c=c|Uf(a))}b==null||(b.errorInfo=c);return c}function Vf(a,b){return Object.prototype.hasOwnProperty.call(a,b)}function Wf(a){return Object.getPrototypeOf(a)}function Xf(a){bk(a,this),y(this,Xf)}var H,Yf;function vf(){Yf||(Yf=!0,H=void 0)}function vf(){}function Zf(){}function $f(){}function ag(){}function bg(){}function cg(){}function dg(){}function eg(){}function fg(){}function gg(a,b,c,d){c=c===H?0:c,d=d===H?a.length:d,T().checkRangeIndexes_mmy49x_k$(c,d,a.length),a.fill(b,c,d)}function hg(a,b,c){T().checkRangeIndexes_mmy49x_k$(b,c,a.length);return a.slice(b,c)}function ig(a,b){return ic(a,b)}function jg(a,b){if(!(b>=0)){var c="Invalid new array size: "+b+".";throw M(x(c))}return cl(a,new Int8Array(b))}function kg(a){return new J(a)}function lg(a,b){if(!(b>=0)){var c="Invalid new array size: "+b+".";throw M(x(c))}return cl(a,new Int32Array(b))}function mg(a,b){if(!(b>=0)){var c="Invalid new array size: "+b+".";throw M(x(c))}return dl(a,b,null)}function kg(a,b){return ic(a,b)}function kg(a,b){return ic(a,b)}function kg(a,b){return ic(a,b)}function ng(a,b){return ic(a,b)}function og(){}function pg(a){return!(a===a)}function qg(a){var b;a===0?b=0:b=1<<(31-i(a)|0);return b}function rg(a){return(a&2147483647)+((a>>>31|0)<<30)*2}function sg(a,b){return Kd(a^-2147483648,b^-2147483648)}function kg(a,b){a=W(a);a=F(a).and_4spn93_k$(new s(-1,0));b=W(b);b=F(b).and_4spn93_k$(new s(-1,0));a=a.div_jun7gj_k$(b);return V(a.toInt_1tsl84_k$())}function tg(a,b){a=W(a);a=F(a).and_4spn93_k$(new s(-1,0));b=W(b);b=F(b).and_4spn93_k$(new s(-1,0));a=a.rem_bsnl9o_k$(b);return V(a.toInt_1tsl84_k$())}function ug(a,b){return a.xor_qzz94j_k$(new s(0,-2147483648)).compareTo_9jj042_k$(b.xor_qzz94j_k$(new s(0,-2147483648)))}function kg(a,b){var c=Z(a),d=Z(b);if(d.compareTo_9jj042_k$(new s(0,0))<0){ug(Z(a),Z(b))<0?a=Y(new s(0,0)):a=Y(new s(1,0));return a}if(c.compareTo_9jj042_k$(new s(0,0))>=0)return Y(c.div_jun7gj_k$(d));b=c.ushr_z7nmq8_k$(1).div_jun7gj_k$(d).shl_bg8if3_k$(1);a=c.minus_mfbszm_k$(b.times_nfzjiw_k$(d));c=Y(a);a=Y(d);ug(Z(c),Z(a))>=0?d=1:d=0;c=d;a=b.plus_r93sks_k$(F(c));return Y(a)}function vg(a,b){var c=Z(a),d=Z(b);if(d.compareTo_9jj042_k$(new s(0,0))<0){var e;ug(Z(a),Z(b))<0?e=a:e=Y(Z(a).minus_mfbszm_k$(Z(b)));return e}if(c.compareTo_9jj042_k$(new s(0,0))>=0)return Y(c.rem_bsnl9o_k$(d));a=c.ushr_z7nmq8_k$(1).div_jun7gj_k$(d).shl_bg8if3_k$(1);b=c.minus_mfbszm_k$(a.times_nfzjiw_k$(d));e=Y(b);c=Y(d);ug(Z(e),Z(c))>=0?a=d:a=new s(0,0);return Y(b.minus_mfbszm_k$(a))}function wg(a){return a.ushr_z7nmq8_k$(11).toDouble_ygsx0s_k$()*2048+a.and_4spn93_k$(new s(2047,0)).toDouble_ygsx0s_k$()}function xg(a,b){if(a.compareTo_9jj042_k$(new s(0,0))>=0)return tm(a,b);var c=a.ushr_z7nmq8_k$(1).div_jun7gj_k$(F(b)).shl_bg8if3_k$(1),d=c.times_nfzjiw_k$(F(b));a=a.minus_mfbszm_k$(d);a.compareTo_9jj042_k$(F(b))>=0&&(a=a.minus_mfbszm_k$(F(b)),c=c.plus_r93sks_k$(F(1)));return tm(c,b)+tm(a,b)}function kg(a){var b;if(pg(a))b=V(0);else{var c=V(0);if(a<=rg(W(c)))b=V(0);else{c=V(-1);if(a>=rg(W(c)))b=V(-1);else if(a<=2147483647){c=cf(a);b=V(c)}else{c=cf(a-2147483647);a=V(c);c=2147483647;c=V(c);b=V(W(a)+W(c)|0)}}}return b}function kg(a){var b;if(pg(a))b=Y(new s(0,0));else{var c=Y(new s(0,0));if(a<=wg(Z(c)))b=Y(new s(0,0));else{c=Y(new s(-1,-1));if(a>=wg(Z(c)))b=Y(new s(-1,-1));else if(a<new s(-1,2147483647).toDouble_ygsx0s_k$()){c=ff(a);b=Y(c)}else{c=ff(a-9223372036854776e3);a=Y(c);c=Y(new s(0,-2147483648));b=Y(Z(a).plus_r93sks_k$(Z(c)))}}}return b}function yg(){}z(yg).equals=function(a){if(!(a instanceof yg))return!1;a instanceof yg||A();return!0};z(yg).hashCode=function(){return 0};z(yg).toString=function(){return"@kotlin.js.JsExport.Ignore()"};function zg(){}z(zg).equals=function(a){if(!(a instanceof zg))return!1;a instanceof zg||A();return!0};z(zg).hashCode=function(){return 0};z(zg).toString=function(){return"@kotlin.js.JsExport()"};function Ag(a){this.name_1=a}z(Ag).get_name_woqyms_k$=function(){return this.name_1};z(Ag).equals=function(a){if(!(a instanceof Ag))return!1;a=a instanceof Ag?a:A();return!(this.name_1===a.name_1)?!1:!0};z(Ag).hashCode=function(){return g(w("name"),127)^w(this.name_1)};z(Ag).toString=function(){return"@kotlin.js.JsName(name="+this.name_1+")"};function Bg(a){this.value_1=a}z(Bg).get_value_j01efc_k$=function(){return this.value_1};z(Bg).equals=function(a){if(!(a instanceof Bg))return!1;a=a instanceof Bg?a:A();return!(this.value_1===a.value_1)?!1:!0};z(Bg).hashCode=function(){return g(w("value"),127)^w(this.value_1)};z(Bg).toString=function(){return"@kotlin.js.JsQualifier(value="+this.value_1+")"};function Cg(a){this.name_1=a}z(Cg).get_name_woqyms_k$=function(){return this.name_1};z(Cg).equals=function(a){if(!(a instanceof Cg))return!1;a=a instanceof Cg?a:A();return!(this.name_1===a.name_1)?!1:!0};z(Cg).hashCode=function(){return g(w("name"),127)^w(this.name_1)};z(Cg).toString=function(){return"@kotlin.js.JsFileName(name="+this.name_1+")"};function Dg(){}z(Dg).equals=function(a){if(!(a instanceof Dg))return!1;a instanceof Dg||A();return!0};z(Dg).hashCode=function(){return 0};z(Dg).toString=function(){return"@kotlin.js.EagerInitialization()"};function Eg(a){return To(a)}function Fg(a,b){return Uo(a,b)}function Gg(a,b){return b}function Hg(a,b){return Gb(Array(b),null)}function Ig(a){var b;a.toArray!==void 0?b=a.toArray():b=Eg(a);return b}function Jg(a){a<0&&Wo();return a}function Kg(a,b,c,d,e){T().checkRangeIndexes_mmy49x_k$(d,e,a.length);var f=e-d|0;T().checkRangeIndexes_mmy49x_k$(c,c+f|0,b.length);if(h(b)&&h(a)){e=a.subarray(d,e);b.set(e,c)}else if(!(a===b)||c<=d){e=0;if(e<f)do{var g=e;e=e+1|0;b[c+g|0]=a[d+g|0]}while(e<f)}else{g=f-1|0;if(0<=g)do{e=g;g=g+-1|0;b[c+e|0]=a[d+e|0]}while(0<=g)}}function Lg(a){return function(b){return a.contains_aljjnj_k$(b)}}function Mg(a){return function(b){return!a.contains_aljjnj_k$(b)}}function Ng(){xo.call(this)}z(Ng).remove_cedx0m_k$=function(a){this.checkIsMutable_jn1ih0_k$();var b=this.iterator_jk1svi_k$();while(b.hasNext_bitz1p_k$())if(u(b.next_20eer_k$(),a)){b.remove_ldkf9o_k$();return!0}return!1};z(Ng).addAll_4lagoh_k$=function(a){this.checkIsMutable_jn1ih0_k$();var b=!1;a=a.iterator_jk1svi_k$();while(a.hasNext_bitz1p_k$()){var c=a.next_20eer_k$();this.add_utx5q5_k$(c)&&(b=!0)}return b};z(Ng).removeAll_y0z8pe_k$=function(a){this.checkIsMutable_jn1ih0_k$();var b=G(this,Wa)?this:A();return ep(b,Lg(a))};z(Ng).retainAll_9fhiib_k$=function(a){this.checkIsMutable_jn1ih0_k$();var b=G(this,Wa)?this:A();return ep(b,Mg(a))};z(Ng).clear_j9egeb_k$=function(){this.checkIsMutable_jn1ih0_k$();var a=this.iterator_jk1svi_k$();while(a.hasNext_bitz1p_k$())a.next_20eer_k$(),a.remove_ldkf9o_k$()};z(Ng).toJSON=function(){return this.toArray()};z(Ng).checkIsMutable_jn1ih0_k$=function(){};function Og(a){this.$this_1=a,this.index_1=0,this.last_1=-1}z(Og).set_index_69f5xp_k$=function(a){this.index_1=a};z(Og).get_index_it478p_k$=function(){return this.index_1};z(Og).set_last_hgfygb_k$=function(a){this.last_1=a};z(Og).get_last_wopotb_k$=function(){return this.last_1};z(Og).hasNext_bitz1p_k$=function(){return this.index_1<this.$this_1.get_size_woubt6_k$()};z(Og).next_20eer_k$=function(){if(!this.hasNext_bitz1p_k$())throw dj();var a=this,b=this.index_1;this.index_1=b+1|0;a.last_1=b;return this.$this_1.get_c1px32_k$(this.last_1)};z(Og).remove_ldkf9o_k$=function(){if(this.last_1===-1){var a="Call next() or previous() before removing element from the iterator.";throw zk(x(a))}this.$this_1.removeAt_6niowx_k$(this.last_1);this.index_1=this.last_1;this.last_1=-1};function Pg(a,b){this.$this_2=a,Og.call(this,a),T().checkPositionIndex_w4k0on_k$(b,this.$this_2.get_size_woubt6_k$()),this.index_1=b}z(Pg).hasPrevious_qh0629_k$=function(){return this.index_1>0};z(Pg).nextIndex_jshxun_k$=function(){return this.index_1};z(Pg).previous_l2dfd5_k$=function(){if(!this.hasPrevious_qh0629_k$())throw dj();var a=this;this.index_1=this.index_1-1|0;a.last_1=this.index_1;return this.$this_2.get_c1px32_k$(this.last_1)};z(Pg).previousIndex_4qtyw5_k$=function(){return this.index_1-1|0};z(Pg).add_lsk6ib_k$=function(a){this.$this_2.add_dl6gt3_k$(this.index_1,a),this.index_1=this.index_1+1|0,this.last_1=-1};z(Pg).add_jcyd1a_k$=function(a){return this.add_lsk6ib_k$((a==null?!0:!(a==null))?a:A())};z(Pg).set_fh2j0_k$=function(a){if(this.last_1===-1){var b="Call next() or previous() before updating element value with the iterator.";throw zk(x(b))}this.$this_2.set_82063s_k$(this.last_1,a)};z(Pg).set_tg4fwj_k$=function(a){return this.set_fh2j0_k$((a==null?!0:!(a==null))?a:A())};function Qg(a,b,c){I.call(this),this.list_1=a,this.fromIndex_1=b,this._size_1=0,T().checkRangeIndexes_mmy49x_k$(this.fromIndex_1,c,this.list_1.get_size_woubt6_k$()),this._size_1=c-this.fromIndex_1|0}z(Qg).add_dl6gt3_k$=function(a,b){T().checkPositionIndex_w4k0on_k$(a,this._size_1),this.list_1.add_dl6gt3_k$(this.fromIndex_1+a|0,b),this._size_1=this._size_1+1|0};z(Qg).get_c1px32_k$=function(a){T().checkElementIndex_s0yg86_k$(a,this._size_1);return this.list_1.get_c1px32_k$(this.fromIndex_1+a|0)};z(Qg).removeAt_6niowx_k$=function(a){T().checkElementIndex_s0yg86_k$(a,this._size_1);a=this.list_1.removeAt_6niowx_k$(this.fromIndex_1+a|0);this._size_1=this._size_1-1|0;return a};z(Qg).set_82063s_k$=function(a,b){T().checkElementIndex_s0yg86_k$(a,this._size_1);return this.list_1.set_82063s_k$(this.fromIndex_1+a|0,b)};z(Qg).removeRange_sm1kzt_k$=function(a,b){this.list_1.removeRange_sm1kzt_k$(this.fromIndex_1+a|0,this.fromIndex_1+b|0),this._size_1=this._size_1-(b-a|0)|0};z(Qg).get_size_woubt6_k$=function(){return this._size_1};z(Qg).checkIsMutable_jn1ih0_k$=function(){return this.list_1.checkIsMutable_jn1ih0_k$()};function Rg(a){return function(b){return a.contains_aljjnj_k$(b)}}function Sg(a){return function(b){return!a.contains_aljjnj_k$(b)}}function I(){Ng.call(this),this.modCount_1=0}z(I).set_modCount_dsd9nm_k$=function(a){this.modCount_1=a};z(I).get_modCount_sgzjli_k$=function(){return this.modCount_1};z(I).add_utx5q5_k$=function(a){this.checkIsMutable_jn1ih0_k$();this.add_dl6gt3_k$(this.get_size_woubt6_k$(),a);return!0};z(I).addAll_lxodh3_k$=function(a,b){T().checkPositionIndex_w4k0on_k$(a,this.get_size_woubt6_k$());this.checkIsMutable_jn1ih0_k$();a=a;var c=!1;b=b.iterator_jk1svi_k$();while(b.hasNext_bitz1p_k$()){var d=b.next_20eer_k$(),e=a;a=e+1|0;this.add_dl6gt3_k$(e,d);c=!0}return c};z(I).clear_j9egeb_k$=function(){this.checkIsMutable_jn1ih0_k$(),this.removeRange_sm1kzt_k$(0,this.get_size_woubt6_k$())};z(I).removeAll_y0z8pe_k$=function(a){this.checkIsMutable_jn1ih0_k$();return dp(this,Rg(a))};z(I).retainAll_9fhiib_k$=function(a){this.checkIsMutable_jn1ih0_k$();return dp(this,Sg(a))};z(I).iterator_jk1svi_k$=function(){return new Og(this)};z(I).contains_aljjnj_k$=function(a){return this.indexOf_si1fv9_k$(a)>=0};z(I).indexOf_si1fv9_k$=function(a){$l$block:{var b=0,c=this.iterator_jk1svi_k$();while(c.hasNext_bitz1p_k$()){var d=c.next_20eer_k$();if(u(d,a)){d=b;break $l$block}b=b+1|0}d=-1}return d};z(I).lastIndexOf_v2p1fv_k$=function(a){$l$block:{var b=this.listIterator_70e65o_k$(this.get_size_woubt6_k$());while(b.hasPrevious_qh0629_k$()){var c=b.previous_l2dfd5_k$();if(u(c,a)){c=b.nextIndex_jshxun_k$();break $l$block}}c=-1}return c};z(I).listIterator_xjshxw_k$=function(){return this.listIterator_70e65o_k$(0)};z(I).listIterator_70e65o_k$=function(a){return new Pg(this,a)};z(I).subList_xle3r2_k$=function(a,b){return new Qg(this,a,b)};z(I).removeRange_sm1kzt_k$=function(a,b){var c=this.listIterator_70e65o_k$(a);b=b-a|0;a=0;if(a<b)do a,a=a+1|0,c.next_20eer_k$(),c.remove_ldkf9o_k$();while(a<b)};z(I).equals=function(a){if(a===this)return!0;return!(a==null?!1:G(a,qb))?!1:T().orderedEquals_p8tefk_k$(this,a)};z(I).hashCode=function(){return T().orderedHashCode_bw6l9m_k$(this)};function Tg(){Oo.call(this),this.keysView_1=null,this.valuesView_1=null}z(Tg).createKeysView_aa1bmb_k$=function(){return new th(this)};z(Tg).createValuesView_4isqvv_k$=function(){return new vh(this)};z(Tg).get_keys_wop4xp_k$=function(){var a=this.keysView_1;if(a==null){var b=this.createKeysView_aa1bmb_k$();this.keysView_1=b;b=b}else b=a;return b};z(Tg).get_values_ksazhn_k$=function(){var a=this.valuesView_1;if(a==null){var b=this.createValuesView_4isqvv_k$();this.valuesView_1=b;b=b}else b=a;return b};z(Tg).clear_j9egeb_k$=function(){this.get_entries_p20ztl_k$().clear_j9egeb_k$()};z(Tg).putAll_wgg6cj_k$=function(a){this.checkIsMutable_jn1ih0_k$();a=a.get_entries_p20ztl_k$().iterator_jk1svi_k$();while(a.hasNext_bitz1p_k$()){var b=a.next_20eer_k$(),c=b.get_key_18j28a_k$();b=b.get_value_j01efc_k$();this.put_4fpzoq_k$(c,b)}};z(Tg).remove_gppy8k_k$=function(a){this.checkIsMutable_jn1ih0_k$();var b=this.get_entries_p20ztl_k$().iterator_jk1svi_k$();while(b.hasNext_bitz1p_k$()){var c=b.next_20eer_k$(),d=c.get_key_18j28a_k$();if(u(a,d)){d=c.get_value_j01efc_k$();b.remove_ldkf9o_k$();return d}}return null};z(Tg).checkIsMutable_jn1ih0_k$=function(){};function Ug(){Ng.call(this)}z(Ug).equals=function(a){if(a===this)return!0;return!(a==null?!1:G(a,bb))?!1:Ro().setEquals_mjzluv_k$(this,a)};z(Ug).hashCode=function(){return Ro().unorderedHashCode_usxz8d_k$(this)};function Vg(a){if(!(a>=0)){var b="capacity must be non-negative.";throw M(x(b))}return Gb(Array(a),null)}function Wg(a,b,c){a.fill(null,b,c)}function Xg(a,b){return mg(a,b)}function Yg(a,b){a[b]=null}function Zg(){$g=this;var a=this,b=dh(0);b.isReadOnly_1=!0;a.Empty_1=b}var $g;function ah(){$g==null&&new Zg();return $g}function bh(a){var b=[];J.call(a,b);return a}function kg(){return bh(t(z(J)))}function ch(a,b){var c=[];J.call(b,c);if(!(a>=0)){c="Negative initial capacity: "+a;throw M(x(c))}return b}function dh(a){return ch(a,t(z(J)))}function eh(a,b){a=Ig(a);J.call(b,a);return b}function fh(a,b){var c=a.get_size_woubt6_k$();a.array_1.length=a.get_size_woubt6_k$()+b|0;return c}function gh(a,b){T().checkElementIndex_s0yg86_k$(b,a.get_size_woubt6_k$());return b}function hh(a,b){T().checkPositionIndex_w4k0on_k$(b,a.get_size_woubt6_k$());return b}function J(a){ah(),I.call(this),this.array_1=a,this.isReadOnly_1=!1}z(J).build_nmwvly_k$=function(){this.checkIsMutable_jn1ih0_k$();this.isReadOnly_1=!0;return this.get_size_woubt6_k$()>0?this:ah().Empty_1};z(J).trimToSize_dmxq0i_k$=function(){};z(J).ensureCapacity_wr7980_k$=function(a){};z(J).get_size_woubt6_k$=function(){return this.array_1.length};z(J).get_c1px32_k$=function(a){a=this.array_1[gh(this,a)];return(a==null?!0:!(a==null))?a:A()};z(J).set_82063s_k$=function(a,b){this.checkIsMutable_jn1ih0_k$();gh(this,a);var c=this.array_1[a];this.array_1[a]=b;a=c;return(a==null?!0:!(a==null))?a:A()};z(J).add_utx5q5_k$=function(a){this.checkIsMutable_jn1ih0_k$();this.array_1.push(a);a=this.get_modCount_sgzjli_k$();this.set_modCount_dsd9nm_k$(a+1|0);return!0};z(J).add_dl6gt3_k$=function(a,b){this.checkIsMutable_jn1ih0_k$();this.array_1.splice(hh(this,a),0,b);a=this.get_modCount_sgzjli_k$();this.set_modCount_dsd9nm_k$(a+1|0)};z(J).addAll_4lagoh_k$=function(a){this.checkIsMutable_jn1ih0_k$();if(a.isEmpty_y1axqb_k$())return!1;var b=fh(this,a.get_size_woubt6_k$()),c=0;a=a.iterator_jk1svi_k$();while(a.hasNext_bitz1p_k$()){var d=a.next_20eer_k$(),e=c;c=e+1|0;e=Jg(e);this.array_1[b+e|0]=d}e=this.get_modCount_sgzjli_k$();this.set_modCount_dsd9nm_k$(e+1|0);return!0};z(J).addAll_lxodh3_k$=function(a,b){this.checkIsMutable_jn1ih0_k$();hh(this,a);if(a===this.get_size_woubt6_k$())return this.addAll_4lagoh_k$(b);if(b.isEmpty_y1axqb_k$())return!1;a=this.array_1.splice(a);this.addAll_4lagoh_k$(b);b=fh(this,a.length);var c=a.length,d=0;if(d<c)do{var e=d;d=d+1|0;this.array_1[b+e|0]=a[e]}while(d<c);e=this.get_modCount_sgzjli_k$();this.set_modCount_dsd9nm_k$(e+1|0);return!0};z(J).removeAt_6niowx_k$=function(a){this.checkIsMutable_jn1ih0_k$();gh(this,a);var b=this.get_modCount_sgzjli_k$();this.set_modCount_dsd9nm_k$(b+1|0);a===Vo(this)?b=this.array_1.pop():b=this.array_1.splice(a,1)[0];return b};z(J).remove_cedx0m_k$=function(a){this.checkIsMutable_jn1ih0_k$();var b=0,c=this.array_1.length-1|0;if(b<=c)do{var d=b;b=b+1|0;if(u(this.array_1[d],a)){this.array_1.splice(d,1);d=this.get_modCount_sgzjli_k$();this.set_modCount_dsd9nm_k$(d+1|0);return!0}}while(b<=c);return!1};z(J).removeRange_sm1kzt_k$=function(a,b){this.checkIsMutable_jn1ih0_k$();var c=this.get_modCount_sgzjli_k$();this.set_modCount_dsd9nm_k$(c+1|0);this.array_1.splice(a,b-a|0)};z(J).clear_j9egeb_k$=function(){this.checkIsMutable_jn1ih0_k$();var a=this;a.array_1=[];a=this.get_modCount_sgzjli_k$();this.set_modCount_dsd9nm_k$(a+1|0)};z(J).indexOf_si1fv9_k$=function(a){return da(this.array_1,a)};z(J).lastIndexOf_v2p1fv_k$=function(a){return m(this.array_1,a)};z(J).toString=function(){return jc(this.array_1)};z(J).toArray_6cwqme_k$=function(a){if(a.length<this.get_size_woubt6_k$()){var b=this.toArray_jjyjqa_k$();return Hf(b)?b:A()}b=this.array_1;b=Hf(b)?b:A();var c=b.length;Kg(b,a,0,0,c);return Gg(this.get_size_woubt6_k$(),a)};z(J).toArray_jjyjqa_k$=function(){return[].slice.call(this.array_1)};z(J).toArray=function(){return this.toArray_jjyjqa_k$()};z(J).asJsArrayView_ialsn1_k$=function(){return this.array_1};z(J).checkIsMutable_jn1ih0_k$=function(){if(this.isReadOnly_1)throw zj()};function ih(a,b){Tg.call(b);nh.call(b);b.internalMap_1=a;return b}function jh(a){ih(Gh(),a);return a}function eh(){return jh(t(z(nh)))}function kh(a,b,c){ih(Mh(a,b),c);return c}function lh(a,b){kh(a,1,b);return b}function mh(a,b){ih(Kh(a),b);return b}z(nh).get_internalMap_mkm00e_k$=function(){return this.internalMap_1};z(nh).clear_j9egeb_k$=function(){this.internalMap_1.clear_j9egeb_k$()};z(nh).containsKey_aw81wo_k$=function(a){return this.internalMap_1.contains_vbgn2f_k$(a)};z(nh).containsValue_yf2ykl_k$=function(a){return this.internalMap_1.containsValue_yf2ykl_k$(a)};z(nh).createKeysView_aa1bmb_k$=function(){return new oh(this.internalMap_1)};z(nh).createValuesView_4isqvv_k$=function(){return new ph(this.internalMap_1)};z(nh).get_entries_p20ztl_k$=function(){var a=this.entriesView_1;if(a==null){var b=new qh(this.internalMap_1);this.entriesView_1=b;b=b}else b=a;return b};z(nh).get_wei43m_k$=function(a){return this.internalMap_1.get_wei43m_k$(a)};z(nh).put_4fpzoq_k$=function(a,b){return this.internalMap_1.put_4fpzoq_k$(a,b)};z(nh).remove_gppy8k_k$=function(a){return this.internalMap_1.remove_gppy8k_k$(a)};z(nh).get_size_woubt6_k$=function(){return this.internalMap_1.get_size_woubt6_k$()};z(nh).putAll_wgg6cj_k$=function(a){return this.internalMap_1.putAll_wgg6cj_k$(a)};function nh(){this.entriesView_1=null}function oh(a){Ug.call(this),this.backing_1=a}z(oh).get_size_woubt6_k$=function(){return this.backing_1.get_size_woubt6_k$()};z(oh).isEmpty_y1axqb_k$=function(){return this.backing_1.get_size_woubt6_k$()===0};z(oh).contains_aljjnj_k$=function(a){return this.backing_1.contains_vbgn2f_k$(a)};z(oh).clear_j9egeb_k$=function(){return this.backing_1.clear_j9egeb_k$()};z(oh).add_utx5q5_k$=function(a){throw zj()};z(oh).addAll_4lagoh_k$=function(a){throw zj()};z(oh).remove_cedx0m_k$=function(a){return this.backing_1.removeKey_ijmwbh_k$(a)};z(oh).iterator_jk1svi_k$=function(){return this.backing_1.keysIterator_mjslfm_k$()};z(oh).checkIsMutable_jn1ih0_k$=function(){return this.backing_1.checkIsMutable_h5js84_k$()};function ph(a){Ng.call(this),this.backing_1=a}z(ph).get_size_woubt6_k$=function(){return this.backing_1.get_size_woubt6_k$()};z(ph).isEmpty_y1axqb_k$=function(){return this.backing_1.get_size_woubt6_k$()===0};z(ph).contains_m22g8e_k$=function(a){return this.backing_1.containsValue_yf2ykl_k$(a)};z(ph).contains_aljjnj_k$=function(a){return!(a==null?!0:!(a==null))?!1:this.contains_m22g8e_k$((a==null?!0:!(a==null))?a:A())};z(ph).add_sqnzo4_k$=function(a){throw zj()};z(ph).add_utx5q5_k$=function(a){return this.add_sqnzo4_k$((a==null?!0:!(a==null))?a:A())};z(ph).addAll_txis5e_k$=function(a){throw zj()};z(ph).addAll_4lagoh_k$=function(a){return this.addAll_txis5e_k$(a)};z(ph).clear_j9egeb_k$=function(){return this.backing_1.clear_j9egeb_k$()};z(ph).iterator_jk1svi_k$=function(){return this.backing_1.valuesIterator_3ptos0_k$()};z(ph).remove_xv0fr_k$=function(a){return this.backing_1.removeValue_ccp5hc_k$(a)};z(ph).remove_cedx0m_k$=function(a){return!(a==null?!0:!(a==null))?!1:this.remove_xv0fr_k$((a==null?!0:!(a==null))?a:A())};z(ph).checkIsMutable_jn1ih0_k$=function(){return this.backing_1.checkIsMutable_h5js84_k$()};function qh(a){rh.call(this,a)}z(qh).iterator_jk1svi_k$=function(){return this.backing_1.entriesIterator_or017i_k$()};function rh(a){Ug.call(this),this.backing_1=a}z(rh).get_backing_4h5ufi_k$=function(){return this.backing_1};z(rh).get_size_woubt6_k$=function(){return this.backing_1.get_size_woubt6_k$()};z(rh).isEmpty_y1axqb_k$=function(){return this.backing_1.get_size_woubt6_k$()===0};z(rh).contains_pftbw2_k$=function(a){return this.backing_1.containsEntry_jg6xfi_k$(a)};z(rh).contains_aljjnj_k$=function(a){return!(a==null?!1:G(a,fb))?!1:this.contains_pftbw2_k$((a==null?!1:G(a,fb))?a:A())};z(rh).clear_j9egeb_k$=function(){return this.backing_1.clear_j9egeb_k$()};z(rh).add_k8z7xs_k$=function(a){throw zj()};z(rh).add_utx5q5_k$=function(a){return this.add_k8z7xs_k$((a==null?!1:G(a,fb))?a:A())};z(rh).addAll_4lagoh_k$=function(a){throw zj()};z(rh).remove_z40ynn_k$=function(a){return this.backing_1.removeEntry_dxtz15_k$(a)};z(rh).remove_cedx0m_k$=function(a){return!(a==null?!1:G(a,fb))?!1:this.remove_z40ynn_k$((a==null?!1:G(a,fb))?a:A())};z(rh).containsAll_xk45sd_k$=function(a){return this.backing_1.containsAllEntries_5fw0no_k$(a)};z(rh).checkIsMutable_jn1ih0_k$=function(){return this.backing_1.checkIsMutable_h5js84_k$()};function sh(a){this.$entryIterator_1=a}z(sh).hasNext_bitz1p_k$=function(){return this.$entryIterator_1.hasNext_bitz1p_k$()};z(sh).next_20eer_k$=function(){return this.$entryIterator_1.next_20eer_k$().get_key_18j28a_k$()};z(sh).remove_ldkf9o_k$=function(){return this.$entryIterator_1.remove_ldkf9o_k$()};function th(a){Ug.call(this),this.backingMap_1=a}z(th).add_b330zt_k$=function(a){throw Bj("Add is not supported on keys")};z(th).add_utx5q5_k$=function(a){return this.add_b330zt_k$((a==null?!0:!(a==null))?a:A())};z(th).clear_j9egeb_k$=function(){return this.backingMap_1.clear_j9egeb_k$()};z(th).contains_vbgn2f_k$=function(a){return this.backingMap_1.containsKey_aw81wo_k$(a)};z(th).contains_aljjnj_k$=function(a){return!(a==null?!0:!(a==null))?!1:this.contains_vbgn2f_k$((a==null?!0:!(a==null))?a:A())};z(th).iterator_jk1svi_k$=function(){var a=this.backingMap_1.get_entries_p20ztl_k$().iterator_jk1svi_k$();return new sh(a)};z(th).remove_gppy8k_k$=function(a){this.checkIsMutable_jn1ih0_k$();if(this.backingMap_1.containsKey_aw81wo_k$(a)){this.backingMap_1.remove_gppy8k_k$(a);return!0}return!1};z(th).remove_cedx0m_k$=function(a){return!(a==null?!0:!(a==null))?!1:this.remove_gppy8k_k$((a==null?!0:!(a==null))?a:A())};z(th).get_size_woubt6_k$=function(){return this.backingMap_1.get_size_woubt6_k$()};z(th).checkIsMutable_jn1ih0_k$=function(){return this.backingMap_1.checkIsMutable_jn1ih0_k$()};function uh(a){this.$entryIterator_1=a}z(uh).hasNext_bitz1p_k$=function(){return this.$entryIterator_1.hasNext_bitz1p_k$()};z(uh).next_20eer_k$=function(){return this.$entryIterator_1.next_20eer_k$().get_value_j01efc_k$()};z(uh).remove_ldkf9o_k$=function(){return this.$entryIterator_1.remove_ldkf9o_k$()};function vh(a){Ng.call(this),this.backingMap_1=a}z(vh).add_sqnzo4_k$=function(a){throw Bj("Add is not supported on values")};z(vh).add_utx5q5_k$=function(a){return this.add_sqnzo4_k$((a==null?!0:!(a==null))?a:A())};z(vh).clear_j9egeb_k$=function(){return this.backingMap_1.clear_j9egeb_k$()};z(vh).contains_m22g8e_k$=function(a){return this.backingMap_1.containsValue_yf2ykl_k$(a)};z(vh).contains_aljjnj_k$=function(a){return!(a==null?!0:!(a==null))?!1:this.contains_m22g8e_k$((a==null?!0:!(a==null))?a:A())};z(vh).iterator_jk1svi_k$=function(){var a=this.backingMap_1.get_entries_p20ztl_k$().iterator_jk1svi_k$();return new uh(a)};z(vh).get_size_woubt6_k$=function(){return this.backingMap_1.get_size_woubt6_k$()};z(vh).checkIsMutable_jn1ih0_k$=function(){return this.backingMap_1.checkIsMutable_jn1ih0_k$()};function wh(a,b){Ug.call(b);Ch.call(b);b.internalMap_1=a;return b}function xh(a){wh(Gh(),a);return a}function yh(){return xh(t(z(Ch)))}function zh(a,b){wh(Ih(a.get_size_woubt6_k$()),b);a=a.iterator_jk1svi_k$();while(a.hasNext_bitz1p_k$()){var c=a.next_20eer_k$();b.internalMap_1.put_4fpzoq_k$(c,!0)}return b}function Ah(a,b,c){wh(Mh(a,b),c);return c}function Bh(a,b){Ah(a,1,b);return b}z(Ch).get_internalMap_mkm00e_k$=function(){return this.internalMap_1};z(Ch).add_utx5q5_k$=function(a){return this.internalMap_1.put_4fpzoq_k$(a,!0)==null};z(Ch).clear_j9egeb_k$=function(){this.internalMap_1.clear_j9egeb_k$()};z(Ch).contains_aljjnj_k$=function(a){return this.internalMap_1.contains_vbgn2f_k$(a)};z(Ch).isEmpty_y1axqb_k$=function(){return this.internalMap_1.get_size_woubt6_k$()===0};z(Ch).iterator_jk1svi_k$=function(){return this.internalMap_1.keysIterator_mjslfm_k$()};z(Ch).remove_cedx0m_k$=function(a){return!(this.internalMap_1.remove_gppy8k_k$(a)==null)};z(Ch).get_size_woubt6_k$=function(){return this.internalMap_1.get_size_woubt6_k$()};function Ch(){}function Dh(a,b){return qg(g(ua(b,1),3))}function Eh(a,b){return i(b)+1|0}function Fh(a){Hh(8,a);return a}function Gh(){return Fh(t(z(K)))}function Hh(a,b){K.call(b,Vg(a),null,new Int32Array(a),new Int32Array(Dh(hi(),a)),2,0);return b}function Ih(a){return Hh(a,t(z(K)))}function Jh(a,b){Hh(a.get_size_woubt6_k$(),b);b.putAll_wgg6cj_k$(a);return b}function Kh(a){return Jh(a,t(z(K)))}function Lh(a,b,c){Hh(a,c);if(!(b>0)){a="Non-positive load factor: "+b;throw M(x(a))}return c}function Mh(a,b){return Lh(a,b,t(z(K)))}function Nh(a){return a.keysArray_1.length}function Oh(a){return a.hashArray_1.length}function Ph(a){a.modCount_1=a.modCount_1+1|0}function Qh(a,b){Rh(a,b)?Vh(a,!0):Sh(a,a.length_1+b|0)}function Rh(a,b){var c=Nh(a)-a.length_1|0,d=a.length_1-a.get_size_woubt6_k$()|0;return c<b&&(d+c|0)>=b&&d>=(Nh(a)/4|0)}function Sh(a,b){if(b<0)throw Wk("too many elements");if(b>Nh(a)){b=T().newCapacity_k5ozfy_k$(Nh(a),b);a.keysArray_1=Xg(a.keysArray_1,b);var c=a,d=a.valuesArray_1;c.valuesArray_1=d==null?null:Xg(d,b);a.presenceArray_1=lg(a.presenceArray_1,b);c=Dh(hi(),b);c>Oh(a)&&Wh(a,c)}}function Th(a){var b=a.valuesArray_1;if(!(b==null))return b;b=Vg(Nh(a));a.valuesArray_1=b;return b}function Uh(a,b){return b==null?0:g(v(b),-1640531527)>>>a.hashShift_1|0}function Vh(b,c){var d=0,e=0,f=b.valuesArray_1;while(d<b.length_1){var a=b.presenceArray_1[d];a>=0&&(b.keysArray_1[e]=b.keysArray_1[d],f==null||(f[e]=f[d]),c&&(b.presenceArray_1[e]=a,b.hashArray_1[a]=e+1|0),e=e+1|0);d=d+1|0}Wg(b.keysArray_1,e,b.length_1);f==null?null:Wg(f,e,b.length_1);b.length_1=e}function Wh(a,b){Ph(a);a.length_1>a._size_1&&Vh(a,!1);a.hashArray_1=new Int32Array(b);a.hashShift_1=Eh(hi(),b);b=0;while(b<a.length_1){var c=b;b=c+1|0;if(!Xh(a,c))throw zk("This cannot happen with fixed magic multiplier and grow-only hash array. Have object hashCodes changed?")}}function Xh(a,b){var c=Uh(a,a.keysArray_1[b]),d=a.maxProbeDistance_1;while(!0){var e=a.hashArray_1[c];if(e===0){a.hashArray_1[c]=b+1|0;a.presenceArray_1[b]=c;return!0}d=d-1|0;if(d<0)return!1;e=c;c=e-1|0;e===0&&(c=Oh(a)-1|0)}}function Yh(a,b){var c=Uh(a,b),d=a.maxProbeDistance_1;while(!0){var e=a.hashArray_1[c];if(e===0)return-1;if(e>0&&u(a.keysArray_1[e-1|0],b))return e-1|0;d=d-1|0;if(d<0)return-1;e=c;c=e-1|0;e===0&&(c=Oh(a)-1|0)}}function Zh(a,b){var c=a.length_1;$l$loop:while(!0){c=c-1|0;if(!(c>=0))break $l$loop;if(a.presenceArray_1[c]>=0&&u(de(a.valuesArray_1)[c],b))return c}return-1}function $h(a,b){a.checkIsMutable_h5js84_k$();retry:while(!0){var c=Uh(a,b),d=ta(g(a.maxProbeDistance_1,2),Oh(a)/2|0),e=0;while(!0){var f=a.hashArray_1[c];if(f<=0){if(a.length_1>=Nh(a)){Qh(a,1);continue retry}var h=a.length_1;a.length_1=h+1|0;h=h;a.keysArray_1[h]=b;a.presenceArray_1[h]=c;a.hashArray_1[c]=h+1|0;a._size_1=a._size_1+1|0;Ph(a);e>a.maxProbeDistance_1&&(a.maxProbeDistance_1=e);return h}if(u(a.keysArray_1[f-1|0],b))return-f|0;e=e+1|0;if(e>d){Wh(a,g(Oh(a),2));continue retry}h=c;c=h-1|0;h===0&&(c=Oh(a)-1|0)}}}function ai(a,b){Yg(a.keysArray_1,b);var c=a.valuesArray_1;c==null?null:Yg(c,b);bi(a,a.presenceArray_1[b]);a.presenceArray_1[b]=-1;a._size_1=a._size_1-1|0;Ph(a)}function bi(a,b){var c=b;b=b;var d=0,e=ta(g(a.maxProbeDistance_1,2),Oh(a)/2|0);while(!0){var f=c;c=f-1|0;f===0&&(c=Oh(a)-1|0);d=d+1|0;if(d>a.maxProbeDistance_1){a.hashArray_1[b]=0;return S()}f=a.hashArray_1[c];if(f===0){a.hashArray_1[b]=0;return S()}if(f<0)a.hashArray_1[b]=-1,b=c,d=0;else{var h=Uh(a,a.keysArray_1[f-1|0]);((h-c|0)&(Oh(a)-1|0))>=d&&(a.hashArray_1[b]=f,a.presenceArray_1[f-1|0]=b,b=c,d=0)}e=e-1|0;if(e<0){a.hashArray_1[b]=-1;return S()}}}function ci(a,b){return a._size_1===b.get_size_woubt6_k$()&&a.containsAllEntries_5fw0no_k$(b.get_entries_p20ztl_k$())}function di(a,b){var c=$h(a,b.get_key_18j28a_k$());a=Th(a);if(c>=0){a[c]=b.get_value_j01efc_k$();return!0}var d=a[(-c|0)-1|0];if(!u(b.get_value_j01efc_k$(),d)){a[(-c|0)-1|0]=b.get_value_j01efc_k$();return!0}return!1}function ei(a,b){if(b.isEmpty_y1axqb_k$())return!1;Qh(a,b.get_size_woubt6_k$());b=b.iterator_jk1svi_k$();var c=!1;while(b.hasNext_bitz1p_k$())di(a,b.next_20eer_k$())&&(c=!0);return c}function fi(){gi=this,this.MAGIC_1=-1640531527,this.INITIAL_CAPACITY_1=8,this.INITIAL_MAX_PROBE_DISTANCE_1=2,this.TOMBSTONE_1=-1}var gi;function hi(){gi==null&&new fi();return gi}function ii(a){this.map_1=a,this.index_1=0,this.lastIndex_1=-1,this.expectedModCount_1=this.map_1.modCount_1,this.initNext_evzkid_k$()}z(ii).get_map_e7zhmd_k$=function(){return this.map_1};z(ii).set_index_kugn4r_k$=function(a){this.index_1=a};z(ii).get_index_nqeon3_k$=function(){return this.index_1};z(ii).set_lastIndex_4vlb5b_k$=function(a){this.lastIndex_1=a};z(ii).get_lastIndex_mpp0vp_k$=function(){return this.lastIndex_1};z(ii).initNext_evzkid_k$=function(){while(this.index_1<this.map_1.length_1&&this.map_1.presenceArray_1[this.index_1]<0)this.index_1=this.index_1+1|0};z(ii).hasNext_bitz1p_k$=function(){return this.index_1<this.map_1.length_1};z(ii).remove_ldkf9o_k$=function(){this.checkForComodification_o4dljl_k$();if(this.lastIndex_1===-1){var a="Call next() before removing element from the iterator.";throw zk(x(a))}this.map_1.checkIsMutable_h5js84_k$();ai(this.map_1,this.lastIndex_1);this.lastIndex_1=-1;this.expectedModCount_1=this.map_1.modCount_1};z(ii).checkForComodification_o4dljl_k$=function(){if(!(this.map_1.modCount_1===this.expectedModCount_1))throw Lk()};function ji(a){ii.call(this,a)}z(ji).next_20eer_k$=function(){this.checkForComodification_o4dljl_k$();if(this.index_1>=this.map_1.length_1)throw dj();var a=this,b=this.index_1;this.index_1=b+1|0;a.lastIndex_1=b;a=this.map_1.keysArray_1[this.lastIndex_1];this.initNext_evzkid_k$();return a};function ki(a){ii.call(this,a)}z(ki).next_20eer_k$=function(){this.checkForComodification_o4dljl_k$();if(this.index_1>=this.map_1.length_1)throw dj();var a=this,b=this.index_1;this.index_1=b+1|0;a.lastIndex_1=b;a=de(this.map_1.valuesArray_1)[this.lastIndex_1];this.initNext_evzkid_k$();return a};function li(a){ii.call(this,a)}z(li).next_20eer_k$=function(){this.checkForComodification_o4dljl_k$();if(this.index_1>=this.map_1.length_1)throw dj();var a=this,b=this.index_1;this.index_1=b+1|0;a.lastIndex_1=b;a=new mi(this.map_1,this.lastIndex_1);this.initNext_evzkid_k$();return a};z(li).nextHashCode_b13whm_k$=function(){if(this.index_1>=this.map_1.length_1)throw dj();var a=this,b=this.index_1;this.index_1=b+1|0;a.lastIndex_1=b;a=this.map_1.keysArray_1[this.lastIndex_1];b=a==null?null:v(a);a=b==null?0:b;b=de(this.map_1.valuesArray_1)[this.lastIndex_1];b=b==null?null:v(b);a=a^(b==null?0:b);this.initNext_evzkid_k$();return a};z(li).nextAppendString_c748pk_k$=function(a){if(this.index_1>=this.map_1.length_1)throw dj();var b=this,c=this.index_1;this.index_1=c+1|0;b.lastIndex_1=c;b=this.map_1.keysArray_1[this.lastIndex_1];u(b,this.map_1)?a.append_22ad7x_k$("(this Map)"):a.append_t8pm91_k$(b);a.append_am5a4z_k$(n(61));c=de(this.map_1.valuesArray_1)[this.lastIndex_1];u(c,this.map_1)?a.append_22ad7x_k$("(this Map)"):a.append_t8pm91_k$(c);this.initNext_evzkid_k$()};function mi(a,b){this.map_1=a,this.index_1=b}z(mi).get_key_18j28a_k$=function(){return this.map_1.keysArray_1[this.index_1]};z(mi).get_value_j01efc_k$=function(){return de(this.map_1.valuesArray_1)[this.index_1]};z(mi).setValue_9cjski_k$=function(a){this.map_1.checkIsMutable_h5js84_k$();var b=Th(this.map_1),c=b[this.index_1];b[this.index_1]=a;return c};z(mi).equals=function(a){var b;(a==null?!1:G(a,fb))?b=u(a.get_key_18j28a_k$(),this.get_key_18j28a_k$()):b=!1;b?b=u(a.get_value_j01efc_k$(),this.get_value_j01efc_k$()):b=!1;return b};z(mi).hashCode=function(){var a=this.get_key_18j28a_k$();a=a==null?null:v(a);a=a==null?0:a;var b=this.get_value_j01efc_k$();b=b==null?null:v(b);return a^(b==null?0:b)};z(mi).toString=function(){return ub(this.get_key_18j28a_k$())+"="+ub(this.get_value_j01efc_k$())};function K(a,b,c,d,e,f){hi(),this.keysArray_1=a,this.valuesArray_1=b,this.presenceArray_1=c,this.hashArray_1=d,this.maxProbeDistance_1=e,this.length_1=f,this.hashShift_1=Eh(hi(),Oh(this)),this.modCount_1=0,this._size_1=0,this.isReadOnly_1=!1}z(K).get_size_woubt6_k$=function(){return this._size_1};z(K).build_52xuhq_k$=function(){this.checkIsMutable_h5js84_k$(),this.isReadOnly_1=!0};z(K).isEmpty_y1axqb_k$=function(){return this._size_1===0};z(K).containsValue_yf2ykl_k$=function(a){return Zh(this,a)>=0};z(K).get_wei43m_k$=function(a){a=Yh(this,a);return a<0?null:de(this.valuesArray_1)[a]};z(K).contains_vbgn2f_k$=function(a){return Yh(this,a)>=0};z(K).put_4fpzoq_k$=function(a,b){a=$h(this,a);var c=Th(this);if(a<0){var d=c[(-a|0)-1|0];c[(-a|0)-1|0]=b;return d}else{c[a]=b;return null}};z(K).putAll_wgg6cj_k$=function(a){this.checkIsMutable_h5js84_k$(),ei(this,a.get_entries_p20ztl_k$())};z(K).remove_gppy8k_k$=function(a){this.checkIsMutable_h5js84_k$();a=Yh(this,a);if(a<0)return null;var b=de(this.valuesArray_1)[a];ai(this,a);return b};z(K).clear_j9egeb_k$=function(){this.checkIsMutable_h5js84_k$();var b=0,c=this.length_1-1|0;if(b<=c)do{var d=b;b=b+1|0;var a=this.presenceArray_1[d];a>=0&&(this.hashArray_1[a]=0,this.presenceArray_1[d]=-1)}while(!(d===c));Wg(this.keysArray_1,0,this.length_1);a=this.valuesArray_1;a==null?null:Wg(a,0,this.length_1);this._size_1=0;this.length_1=0;Ph(this)};z(K).equals=function(a){var b;if(a===this)b=!0;else{(a==null?!1:G(a,ib))?a=ci(this,a):a=!1;b=a}return b};z(K).hashCode=function(){var a=0,b=this.entriesIterator_or017i_k$();while(b.hasNext_bitz1p_k$())a=a+b.nextHashCode_b13whm_k$()|0;return a};z(K).toString=function(){var a=jm(2+g(this._size_1,3)|0);a.append_22ad7x_k$("{");var b=0,c=this.entriesIterator_or017i_k$();while(c.hasNext_bitz1p_k$())b>0&&a.append_22ad7x_k$(", "),c.nextAppendString_c748pk_k$(a),b=b+1|0;a.append_22ad7x_k$("}");return a.toString()};z(K).checkIsMutable_h5js84_k$=function(){if(this.isReadOnly_1)throw zj()};z(K).removeKey_ijmwbh_k$=function(a){this.checkIsMutable_h5js84_k$();a=Yh(this,a);if(a<0)return!1;ai(this,a);return!0};z(K).containsEntry_jg6xfi_k$=function(a){var b=Yh(this,a.get_key_18j28a_k$());return b<0?!1:u(de(this.valuesArray_1)[b],a.get_value_j01efc_k$())};z(K).containsOtherEntry_yvdc55_k$=function(a){return this.containsEntry_jg6xfi_k$(G(a,fb)?a:A())};z(K).removeEntry_dxtz15_k$=function(a){this.checkIsMutable_h5js84_k$();var b=Yh(this,a.get_key_18j28a_k$());if(b<0)return!1;if(!u(de(this.valuesArray_1)[b],a.get_value_j01efc_k$()))return!1;ai(this,b);return!0};z(K).removeValue_ccp5hc_k$=function(a){this.checkIsMutable_h5js84_k$();a=Zh(this,a);if(a<0)return!1;ai(this,a);return!0};z(K).keysIterator_mjslfm_k$=function(){return new ji(this)};z(K).valuesIterator_3ptos0_k$=function(){return new ki(this)};z(K).entriesIterator_or017i_k$=function(){return new li(this)};function Bh(){}function ni(a){jh(a);vi.call(a);return a}function oi(){return ni(t(z(vi)))}function pi(a,b){lh(a,b);vi.call(b);return b}function pi(a,b,c){kh(a,b,c);vi.call(c);return c}function pi(a,b){mh(a,b);vi.call(b);return b}function qi(a,b){ih(a,b);vi.call(b);return b}function ri(a){return qi(a,t(z(vi)))}function si(){ti=this;var a=this,b=Ih(0);b.build_52xuhq_k$();a.value_1=ri(b)}z(si).get_value_j01efc_k$=function(){return this.value_1};var ti;function ui(){ti==null&&new si();return ti}z(vi).build_nmwvly_k$=function(){this.get_internalMap_mkm00e_k$().build_52xuhq_k$();var a;this.get_size_woubt6_k$()>0?a=this:a=ui().value_1;return a};z(vi).checkIsMutable_jn1ih0_k$=function(){return this.get_internalMap_mkm00e_k$().checkIsMutable_h5js84_k$()};function vi(){}function wi(a){xh(a);Ei.call(a);return a}function xi(){return wi(t(z(Ei)))}function pi(a,b){zh(a,b);Ei.call(b);return b}function yi(a,b,c){Ah(a,b,c);Ei.call(c);return c}function pi(a,b){yi(a,1,b);return b}function zi(a,b){wh(a,b);Ei.call(b);return b}function Ai(a){return zi(a,t(z(Ei)))}function Bi(){Ci=this;var a=this,b=Ih(0);b.build_52xuhq_k$();a.value_1=Ai(b)}z(Bi).get_value_j01efc_k$=function(){return this.value_1};var Ci;function Di(){Ci==null&&new Bi();return Ci}z(Ei).build_nmwvly_k$=function(){this.get_internalMap_mkm00e_k$().build_52xuhq_k$();return this.get_size_woubt6_k$()>0?this:Di().value_1};z(Ei).checkIsMutable_jn1ih0_k$=function(){return this.get_internalMap_mkm00e_k$().checkIsMutable_h5js84_k$()};function Ei(){}function Fi(){}function Gi(){}z(Gi).println_uvj9r3_k$=function(){this.print_o1pwgy_k$("\n")};z(Gi).println_ghnc0w_k$=function(a){this.print_o1pwgy_k$(a),this.println_uvj9r3_k$()};z(Gi).flush_shahbo_k$=function(){};function Hi(a){Gi.call(this),this.outputStream_1=a}z(Hi).get_outputStream_2dy5nu_k$=function(){return this.outputStream_1};z(Hi).print_o1pwgy_k$=function(a){a=String(a);this.outputStream_1.write(a)};function Ii(){Ji.call(this)}z(Ii).print_o1pwgy_k$=function(a){a=String(a);var b=a.lastIndexOf("\n",0);if(b>=0){var c=this,d=this.buffer_1;c.buffer_1=d+a.substring(0,b);this.flush_shahbo_k$();c=a;d=b+1|0;a=c.substring(d)}this.buffer_1=this.buffer_1+a};z(Ii).flush_shahbo_k$=function(){this.buffer_1=""};function Ji(){Gi.call(this),this.buffer_1=""}z(Ji).set_buffer_25ukzx_k$=function(a){this.buffer_1=a};z(Ji).get_buffer_bmaafd_k$=function(){return this.buffer_1};z(Ji).print_o1pwgy_k$=function(a){var b=this,c=this.buffer_1;b.buffer_1=c+String(a)};z(Ji).flush_shahbo_k$=function(){this.buffer_1=""};var Ki;function pi(){if(!Ki){Ki=!0;var a=typeof process!=="undefined"&&process.versions&&!!process.versions.node;pi=a?new Hi(process.stdout):new Ii()}}function L(a){Wi.call(this);this.resultContinuation_1=a;this.state_1=0;this.exceptionState_1=0;this.result_1=null;this.exception_1=null;this.finallyPath_1=null;a=this;var b=this.resultContinuation_1;a._context_1=b==null?null:b.get_context_h02k06_k$()}z(L).set_state_rjd8d0_k$=function(a){this.state_1=a};z(L).get_state_iypx7s_k$=function(){return this.state_1};z(L).set_exceptionState_fex74n_k$=function(a){this.exceptionState_1=a};z(L).get_exceptionState_wflpxn_k$=function(){return this.exceptionState_1};z(L).set_result_xj64lm_k$=function(a){this.result_1=a};z(L).get_result_iyg5d2_k$=function(){return this.result_1};z(L).set_exception_px07aa_k$=function(a){this.exception_1=a};z(L).get_exception_x0n6w6_k$=function(){return this.exception_1};z(L).set_finallyPath_ohgcno_k$=function(a){this.finallyPath_1=a};z(L).get_finallyPath_aqs201_k$=function(){return this.finallyPath_1};z(L).get_context_h02k06_k$=function(){return de(this._context_1)};z(L).resumeWith_b9cu3x_k$=function(a){var b=this,c;if(zs(a))c=null;else{var d=ys(a);c=(d==null?!0:!(d==null))?d:A()}d=c;c=As(a);while(!0){a=b;c==null?a.result_1=d:(a.state_1=a.exceptionState_1,a.exception_1=c);try{var e=a.doResume_5yljmg_k$();if(e===gq())return S();d=e;c=null}catch(a){e=a;d=null;c=e}a.releaseIntercepted_5cyqh6_k$();e=de(a.resultContinuation_1);if(e instanceof L)b=e;else{if(!(c==null)){a=de(c);Es();a=xs(Js(a));e.resumeWith_dtxwbr_k$(a)}else{a=d;Es();a=xs(a);e.resumeWith_dtxwbr_k$(a)}return S()}}};z(L).resumeWith_dtxwbr_k$=function(a){return this.resumeWith_b9cu3x_k$(a)};z(L).create_d196fn_k$=function(a){throw Bj("create(Continuation) has not been overridden")};z(L).create_wyq9v6_k$=function(a,b){throw Bj("create(Any?;Continuation) has not been overridden")};function Li(){Mi=this}z(Li).get_context_h02k06_k$=function(){var a="This continuation is already complete";throw zk(x(a))};z(Li).resumeWith_b9cu3x_k$=function(a){a="This continuation is already complete";throw zk(x(a))};z(Li).resumeWith_dtxwbr_k$=function(a){return this.resumeWith_b9cu3x_k$(a)};z(Li).toString=function(){return"This continuation is already complete"};var Mi;function Ni(){Mi==null&&new Li();return Mi}function Oi(){Vi();return Pi}var Pi;function Qi(){Vi();return Ri}var Ri;function Si(a){return a.jsIterators_1}function Si(a){return a.unknown_1}function Si(a){return a.savedResult_1}function Ti(a){Wi.call(this);this.resultContinuation_1=a;a=this;a.jsIterators_1=[];a=this;var b=this.resultContinuation_1;a._context_1=b==null?null:b.get_context_h02k06_k$();this.isRunning_1=!1;this.unknown_1=xs(Symbol());this.savedResult_1=this.unknown_1}z(Ti).get_resultContinuation_pafyil_k$=function(){return this.resultContinuation_1};z(Ti).set_isRunning_m21k59_k$=function(a){this.isRunning_1=a};z(Ti).get_isRunning_okmtn0_k$=function(){return this.isRunning_1};z(Ti).get_context_h02k06_k$=function(){return de(this._context_1)};z(Ti).dropLastIterator_mimyvx_k$=function(){this.jsIterators_1.pop()};z(Ti).addNewIterator_cdx7u0_k$=function(a){this.jsIterators_1.push(a)};z(Ti).shouldResumeImmediately_bh2j8i_k$=function(){return!(ys(this.unknown_1)===ys(this.savedResult_1))};z(Ti).resumeWith_b9cu3x_k$=function(a){ys(this.unknown_1)===ys(this.savedResult_1)&&(this.savedResult_1=a);if(this.isRunning_1)return S();a=this.savedResult_1;var b;if(zs(a))b=null;else{a=ys(a);b=(a==null?!0:!(a==null))?a:A()}a=b;b=As(this.savedResult_1);this.savedResult_1=this.unknown_1;var c=this;while(!0){$l$loop:while(!0){if(c.jsIterators_1.length===0)break $l$loop;var d=c;d=d.jsIterators_1[d.jsIterators_1.length-1|0];var e=b;b=null;e=e;this.isRunning_1=!0;try{d=e==null?d.next(a):d["throw"](e);a=d.value;b=null;d.done&&c.jsIterators_1.pop();if(!(ys(this.unknown_1)===ys(this.savedResult_1))){e=this.savedResult_1;if(zs(e))d=null;else{e=ys(e);d=(e==null?!0:!(e==null))?e:A()}a=d;b=As(this.savedResult_1);this.savedResult_1=this.unknown_1}else if(a===gq())return S()}catch(a){if(a instanceof Error){e=a;b=e;c.jsIterators_1.pop()}else throw a}finally{this.isRunning_1=!1}}this.releaseIntercepted_5cyqh6_k$();d=de(this.resultContinuation_1);if(d instanceof Ti)c=d;else{if(!(b==null)){e=de(b);Es();e=xs(Js(e));d.resumeWith_dtxwbr_k$(e);e=S()}else{var f=a;Es();f=xs(f);d.resumeWith_dtxwbr_k$(f);e=S()}return e}}};z(Ti).resumeWith_dtxwbr_k$=function(a){return this.resumeWith_b9cu3x_k$(a)};function Si(a){Vi();return a!=null&&a.constructor===Qi()}var Ui;function Vi(){Ui||(Ui=!0,Pi=function(){var a=new Function("return function*(suspended, c) { var a = c(); if (a === suspended) a = yield a; return a }");return a()}(),Ri=Oi().constructor.prototype)}function Wi(){this._intercepted_1=null}z(Wi).intercepted_vh228x_k$=function(){var a=this._intercepted_1;if(a==null){var b=this.get_context_h02k06_k$().get_y2st91_k$(Np());b=b==null?null:b.interceptContinuation_3dnmlu_k$(this);b=b==null?this:b;this._intercepted_1=b;b=b}else b=a;return b};z(Wi).releaseIntercepted_5cyqh6_k$=function(){var a=this._intercepted_1;!(a==null)&&!(a===this)&&de(this.get_context_h02k06_k$().get_y2st91_k$(Np())).releaseInterceptedContinuation_rgafzi_k$(a);this._intercepted_1=Ni()};function Si(a,b,c){this.$this_createCoroutineUnintercepted_1=b,this.$completion_1=c,L.call(this,G(a,Jp)?a:A())}z(Si).doResume_5yljmg_k$=function(){if(this.get_exception_x0n6w6_k$()!=null)throw this.get_exception_x0n6w6_k$();var a=this.$this_createCoroutineUnintercepted_1;return typeof a==="function"?a(this.$completion_1):this.$this_createCoroutineUnintercepted_1.invoke_ib42db_k$(this.$completion_1)};function Xi(a,b){this.$block_1=b,L.call(this,G(a,Jp)?a:A())}z(Xi).doResume_5yljmg_k$=function(){if(this.get_exception_x0n6w6_k$()!=null)throw this.get_exception_x0n6w6_k$();return this.$block_1()};function Yi(a,b,c,d){this.$this_createCoroutineUnintercepted_1=b,this.$receiver_1=c,this.$completion_1=d,L.call(this,G(a,Jp)?a:A())}z(Yi).doResume_5yljmg_k$=function(){if(this.get_exception_x0n6w6_k$()!=null)throw this.get_exception_x0n6w6_k$();var a=this.$this_createCoroutineUnintercepted_1;return typeof a==="function"?a(this.$receiver_1,this.$completion_1):this.$this_createCoroutineUnintercepted_1.invoke_qns8j1_k$(this.$receiver_1,this.$completion_1)};function Zi(a,b){return function(){var c=a,d=b;return typeof d==="function"?d(c):b.invoke_ib42db_k$(c)}}function Zi(a,b){return function(){return a(b)}}function Zi(a,b,c){return function(){var d=a,e=b;return typeof e==="function"?e(c,d):b.invoke_qns8j1_k$(c,d)}}function Zi(a,b,c,d){return function(){var e=a,f=b;return typeof f==="function"?f(c,d,e):b.invoke_4tzzq6_k$(c,d,e)}}function $i(a){this.$context_1=a}z($i).get_context_h02k06_k$=function(){return this.$context_1};z($i).resumeWith_b9cu3x_k$=function(a){Ks(a);a=ys(a);(a==null?!0:!(a==null))||A();return S()};z($i).resumeWith_dtxwbr_k$=function(a){return this.resumeWith_b9cu3x_k$(a)};var aj;function Zi(){if(!aj){aj=!0;var a=Vp();Zi=new $i(a)}}function bj(a){}function cj(a){Tk(a);gj.call(a);return a}function dj(){var a=cj(t(z(gj)));y(a,dj);return a}function ej(a,b){Vk(a,b);gj.call(b);return b}function fj(a){a=ej(a,t(z(gj)));y(a,fj);return a}function gj(){y(this,gj)}function hj(a){be(a);pj.call(a);return a}function ij(){var a=hj(t(z(pj)));y(a,ij);return a}function jj(a,b){be(b,a);pj.call(b);return b}function kj(a){a=jj(a,t(z(pj)));y(a,kj);return a}function lj(a,b,c){be(c,a,b);pj.call(c);return c}function mj(a,b){a=lj(a,b,t(z(pj)));y(a,mj);return a}function nj(a,b){be(b,H,a);pj.call(b);return b}function oj(a){a=nj(a,t(z(pj)));y(a,oj);return a}function pj(){y(this,pj)}function qj(a){Tk(a);xj.call(a);return a}function rj(){var a=qj(t(z(xj)));y(a,rj);return a}function sj(a,b){Vk(a,b);xj.call(b);return b}function M(a){a=sj(a,t(z(xj)));y(a,M);return a}function tj(a,b,c){Xk(a,b,c);xj.call(c);return c}function uj(a,b){a=tj(a,b,t(z(xj)));y(a,uj);return a}function vj(a,b){Zk(a,b);xj.call(b);return b}function wj(a){a=vj(a,t(z(xj)));y(a,wj);return a}function xj(){y(this,xj)}function yj(a){Tk(a);Gj.call(a);return a}function zj(){var a=yj(t(z(Gj)));y(a,zj);return a}function Aj(a,b){Vk(a,b);Gj.call(b);return b}function Bj(a){a=Aj(a,t(z(Gj)));y(a,Bj);return a}function Cj(a,b,c){Xk(a,b,c);Gj.call(c);return c}function Dj(a,b){a=Cj(a,b,t(z(Gj)));y(a,Dj);return a}function Ej(a,b){Zk(a,b);Gj.call(b);return b}function Fj(a){a=Ej(a,t(z(Gj)));y(a,Fj);return a}function Gj(){y(this,Gj)}function Hj(a){Tk(a);Lj.call(a);return a}function Ij(){var a=Hj(t(z(Lj)));y(a,Ij);return a}function Jj(a,b){Vk(a,b);Lj.call(b);return b}function Kj(a){a=Jj(a,t(z(Lj)));y(a,Kj);return a}function Lj(){y(this,Lj)}function Mj(a){Tk(a);Uj.call(a);return a}function Nj(){var a=Mj(t(z(Uj)));y(a,Nj);return a}function Oj(a,b){Vk(a,b);Uj.call(b);return b}function Pj(a){a=Oj(a,t(z(Uj)));y(a,Pj);return a}function Qj(a,b,c){Xk(a,b,c);Uj.call(c);return c}function Rj(a,b){a=Qj(a,b,t(z(Uj)));y(a,Rj);return a}function Sj(a,b){Zk(a,b);Uj.call(b);return b}function Tj(a){a=Sj(a,t(z(Uj)));y(a,Tj);return a}function Uj(){y(this,Uj)}function Vj(a){Tk(a);Zj.call(a);return a}function Wj(){var a=Vj(t(z(Zj)));y(a,Wj);return a}function Xj(a,b){Vk(a,b);Zj.call(b);return b}function Yj(a){a=Xj(a,t(z(Zj)));y(a,Yj);return a}function Zj(){y(this,Zj)}function $j(a){be(a);hk.call(a);return a}function ak(){var a=$j(t(z(hk)));y(a,ak);return a}function bk(a,b){be(b,a);hk.call(b);return b}function ck(a){a=bk(a,t(z(hk)));y(a,ck);return a}function dk(a,b,c){be(c,a,b);hk.call(c);return c}function ek(a,b){a=dk(a,b,t(z(hk)));y(a,ek);return a}function fk(a,b){be(b,H,a);hk.call(b);return b}function gk(a){a=fk(a,t(z(hk)));y(a,gk);return a}function hk(){y(this,hk)}function ik(a){Tk(a);qk.call(a);return a}function jk(){var a=ik(t(z(qk)));y(a,jk);return a}function kk(a,b){Vk(a,b);qk.call(b);return b}function lk(a){a=kk(a,t(z(qk)));y(a,lk);return a}function mk(a,b,c){Xk(a,b,c);qk.call(c);return c}function nk(a,b){a=mk(a,b,t(z(qk)));y(a,nk);return a}function ok(a,b){Zk(a,b);qk.call(b);return b}function pk(a){a=ok(a,t(z(qk)));y(a,pk);return a}function qk(){y(this,qk)}function rk(a){Tk(a);vk.call(a);return a}function sk(){var a=rk(t(z(vk)));y(a,sk);return a}function tk(a,b){Vk(a,b);vk.call(b);return b}function uk(a){a=tk(a,t(z(vk)));y(a,uk);return a}function vk(){y(this,vk)}function wk(a){Tk(a);Ek.call(a);return a}function xk(){var a=wk(t(z(Ek)));y(a,xk);return a}function yk(a,b){Vk(a,b);Ek.call(b);return b}function zk(a){a=yk(a,t(z(Ek)));y(a,zk);return a}function Ak(a,b,c){Xk(a,b,c);Ek.call(c);return c}function Bk(a,b){a=Ak(a,b,t(z(Ek)));y(a,Bk);return a}function Ck(a,b){Zk(a,b);Ek.call(b);return b}function Dk(a){a=Ck(a,t(z(Ek)));y(a,Dk);return a}function Ek(){y(this,Ek)}function Fk(a){Tk(a);Jk.call(a);return a}function Gk(){var a=Fk(t(z(Jk)));y(a,Gk);return a}function Hk(a,b){Vk(a,b);Jk.call(b);return b}function Ik(a){a=Hk(a,t(z(Jk)));y(a,Ik);return a}function Jk(){y(this,Jk)}function Kk(a){Tk(a);Sk.call(a);return a}function Lk(){var a=Kk(t(z(Sk)));y(a,Lk);return a}function Mk(a,b){Vk(a,b);Sk.call(b);return b}function Nk(a){a=Mk(a,t(z(Sk)));y(a,Nk);return a}function Ok(a,b,c){Xk(a,b,c);Sk.call(c);return c}function Pk(a,b){a=Ok(a,b,t(z(Sk)));y(a,Pk);return a}function Qk(a,b){Zk(a,b);Sk.call(b);return b}function Rk(a){a=Qk(a,t(z(Sk)));y(a,Rk);return a}function Sk(){y(this,Sk)}function Tk(a){hj(a);N.call(a);return a}function Uk(){var a=Tk(t(z(N)));y(a,Uk);return a}function Vk(a,b){jj(a,b);N.call(b);return b}function Wk(a){a=Vk(a,t(z(N)));y(a,Wk);return a}function Xk(a,b,c){lj(a,b,c);N.call(c);return c}function Yk(a,b){a=Xk(a,b,t(z(N)));y(a,Yk);return a}function Zk(a,b){nj(a,b);N.call(b);return b}function $k(a){a=Zk(a,t(z(N)));y(a,$k);return a}function N(){y(this,N)}function al(a){this.implementation_1=a}z(al).get_implementation_9txf7p_k$=function(){return this.implementation_1};z(al).equals=function(a){if(!(a instanceof al))return!1;a=a instanceof al?a:A();return!(this.implementation_1===a.implementation_1)?!1:!0};z(al).hashCode=function(){return g(w("implementation"),127)^w(this.implementation_1)};z(al).toString=function(){return"@kotlin.js.JsPolyfill(implementation="+this.implementation_1+")"};function bl(){}function cl(a,b){var c=a.length,d=b.length,e=0,f=b;while(e<c&&e<d){var g=e,h=e;e=h+1|0;f[g]=a[h]}return b}function dl(a,b,c){var d=a.slice(0,b);a.$type$!==void 0&&(d.$type$=a.$type$);a=a.length;if(b>a){d.length=b;while(a<b){var e=a;a=e+1|0;d[e]=c}}return d}var el,fl;function gl(){fl||(fl=!0,gl=Math.pow(2,-26),el=Math.pow(2,-53))}function hl(){}function il(){}function jl(a){this.jClass_1=a}z(jl).get_jClass_i6cf5d_k$=function(){return this.jClass_1};z(jl).get_qualifiedName_aokcf6_k$=function(){throw new Ls()};z(jl).equals=function(a){var b;a instanceof kl?b=!1:a instanceof nl?b=!1:a instanceof jl?b=u(this.get_jClass_i6cf5d_k$(),a.get_jClass_i6cf5d_k$()):b=!1;return b};z(jl).hashCode=function(){var a=this.get_simpleName_r6f8py_k$();a=a==null?null:w(a);return a==null?0:a};z(jl).toString=function(){return"class "+this.get_simpleName_r6f8py_k$()};function kl(){ll=this,jl.call(this,Object),this.simpleName_1="Nothing"}z(kl).get_simpleName_r6f8py_k$=function(){return this.simpleName_1};z(kl).isInstance_6tn68w_k$=function(a){return!1};z(kl).get_jClass_i6cf5d_k$=function(){throw Bj("There's no native JS class for Nothing type")};z(kl).equals=function(a){return a===this};z(kl).hashCode=function(){return 0};var ll;function ml(){ll==null&&new kl();return ll}function nl(){}z(nl).get_simpleName_r6f8py_k$=function(){var a="Unknown simpleName for ErrorKClass";throw zk(x(a))};z(nl).get_qualifiedName_aokcf6_k$=function(){var a="Unknown qualifiedName for ErrorKClass";throw zk(x(a))};z(nl).isInstance_6tn68w_k$=function(a){a="Can's check isInstance on ErrorKClass";throw zk(x(a))};z(nl).equals=function(a){return a===this};z(nl).hashCode=function(){return 0};function O(a,b,c){jl.call(this,a),this.givenSimpleName_1=b,this.isInstanceFunction_1=c}z(O).equals=function(a){return!(a instanceof O)?!1:z(jl).equals.call(this,a)&&this.givenSimpleName_1===a.givenSimpleName_1};z(O).get_simpleName_r6f8py_k$=function(){return this.givenSimpleName_1};z(O).isInstance_6tn68w_k$=function(a){return this.isInstanceFunction_1(a)};function ol(a){jl.call(this,a);var b=this;a=a.$metadata$;b.simpleName_1=a==null?null:a.simpleName}z(ol).get_simpleName_r6f8py_k$=function(){return this.simpleName_1};z(ol).isInstance_6tn68w_k$=function(a){return Sf(a,this.get_jClass_i6cf5d_k$())};function pl(){}function ql(){}function rl(){}function sl(){}function tl(){}function ul(){}function vl(){}function wl(){}function xl(){}function yl(){}function zl(a,b,c){this.classifier_1=a,this.arguments_1=b,this.isMarkedNullable_1=c}z(zl).get_classifier_ottyl2_k$=function(){return this.classifier_1};z(zl).get_arguments_p5ddub_k$=function(){return this.arguments_1};z(zl).get_isMarkedNullable_4el8ow_k$=function(){return this.isMarkedNullable_1};z(zl).equals=function(a){var b;a instanceof zl?b=u(this.classifier_1,a.classifier_1):b=!1;b?b=u(this.arguments_1,a.arguments_1):b=!1;b?b=this.isMarkedNullable_1===a.isMarkedNullable_1:b=!1;return b};z(zl).hashCode=function(){return g(g(v(this.classifier_1),31)+v(this.arguments_1)|0,31)+Sd(this.isMarkedNullable_1)|0};z(zl).toString=function(){var a=this.classifier_1;a=G(a,il)?a:null;a=a==null?x(this.classifier_1):a.get_simpleName_r6f8py_k$()==null?"(non-denotable type)":a.get_simpleName_r6f8py_k$();var b=this.arguments_1.isEmpty_y1axqb_k$()?"":na(this.arguments_1,", ","<",">"),c=this.isMarkedNullable_1?"?":"";return vb(a,b)+c};function Al(){Bl=this,this.classifier_1=null,this.arguments_1=Xo(),this.isMarkedNullable_1=!1}z(Al).get_classifier_ottyl2_k$=function(){return this.classifier_1};z(Al).get_arguments_p5ddub_k$=function(){return this.arguments_1};z(Al).get_isMarkedNullable_4el8ow_k$=function(){return this.isMarkedNullable_1};z(Al).toString=function(){return"dynamic"};var Bl;function Cl(){Bl==null&&new Al();return Bl}function Dl(a,b,c,d){this.name_1=a,this.upperBounds_1=b,this.variance_1=c,this.isReified_1=d}z(Dl).get_name_woqyms_k$=function(){return this.name_1};z(Dl).get_upperBounds_k5qia_k$=function(){return this.upperBounds_1};z(Dl).get_variance_ik7ku2_k$=function(){return this.variance_1};z(Dl).get_isReified_gx0s91_k$=function(){return this.isReified_1};z(Dl).toString=function(){return this.name_1};z(Dl).component1_7eebsc_k$=function(){return this.name_1};z(Dl).component2_7eebsb_k$=function(){return this.upperBounds_1};z(Dl).component3_7eebsa_k$=function(){return this.variance_1};z(Dl).component4_7eebs9_k$=function(){return this.isReified_1};z(Dl).copy_hiuxq5_k$=function(a,b,c,d){return new Dl(a,b,c,d)};z(Dl).copy$default_puwfie_k$=function(a,b,c,d,e){a=a===H?this.name_1:a;b=b===H?this.upperBounds_1:b;c=c===H?this.variance_1:c;d=d===H?this.isReified_1:d;return e===H?this.copy_hiuxq5_k$(a,b,c,d):e.copy_hiuxq5_k$.call(this,a,b,c,d)};z(Dl).hashCode=function(){var a=w(this.name_1);a=g(a,31)+v(this.upperBounds_1)|0;a=g(a,31)+this.variance_1.hashCode()|0;a=g(a,31)+Sd(this.isReified_1)|0;return a};z(Dl).equals=function(a){if(this===a)return!0;if(!(a instanceof Dl))return!1;a=a instanceof Dl?a:A();if(!(this.name_1===a.name_1))return!1;if(!u(this.upperBounds_1,a.upperBounds_1))return!1;if(!this.variance_1.equals(a.variance_1))return!1;return!(this.isReified_1===a.isReified_1)?!1:!0};function El(){cm();return Fl}var Fl;function Gl(a){return!(a==null)}function Hl(a){return If(a)}function Il(a){return a==null?!1:typeof a==="boolean"}function Jl(a){return a==null?!1:typeof a==="number"}function Kl(a){return a==null?!1:typeof a==="number"}function Ll(a){return a==null?!1:typeof a==="number"}function Ml(a){return a==null?!1:typeof a==="number"}function Nl(a){return a==null?!1:typeof a==="number"}function Ol(a){return a==null?!1:Hf(a)}function Pl(a){return a==null?!1:typeof a==="string"}function Ql(a){return a instanceof Error}function Rl(a){return a==null?!1:Kf(a)}function Sl(a){return a==null?!1:Nf(a)}function Tl(a){return a==null?!1:Lf(a)}function Ul(a){return a==null?!1:Mf(a)}function Vl(a){return a==null?!1:Of(a)}function Wl(a){return a==null?!1:Qf(a)}function Xl(a){return a==null?!1:Pf(a)}function Yl(a){return a==null?!1:Rf(a)}function Zl(a){return function(b){typeof b==="function"?b=b.length===a:b=!1;return b}}function P(){$l=this;var a=this,b=Object;a.anyClass=new O(b,"Any",Gl);a=this;b=Number;a.numberClass=new O(b,"Number",Hl);this.nothingClass=ml();a=this;b=Boolean;a.booleanClass=new O(b,"Boolean",Il);a=this;b=Number;a.byteClass=new O(b,"Byte",Jl);a=this;b=Number;a.shortClass=new O(b,"Short",Kl);a=this;b=Number;a.intClass=new O(b,"Int",Ll);a=this;b=Number;a.floatClass=new O(b,"Float",Ml);a=this;b=Number;a.doubleClass=new O(b,"Double",Nl);a=this;b=Array;a.arrayClass=new O(b,"Array",Ol);a=this;b=String;a.stringClass=new O(b,"String",Pl);a=this;b=Error;a.throwableClass=new O(b,"Throwable",Ql);a=this;b=Array;a.booleanArrayClass=new O(b,"BooleanArray",Rl);a=this;b=Uint16Array;a.charArrayClass=new O(b,"CharArray",Sl);a=this;b=Int8Array;a.byteArrayClass=new O(b,"ByteArray",Tl);a=this;b=Int16Array;a.shortArrayClass=new O(b,"ShortArray",Ul);a=this;b=Int32Array;a.intArrayClass=new O(b,"IntArray",Vl);a=this;b=Array;a.longArrayClass=new O(b,"LongArray",Wl);a=this;b=Float32Array;a.floatArrayClass=new O(b,"FloatArray",Xl);a=this;b=Float64Array;a.doubleArrayClass=new O(b,"DoubleArray",Yl)}z(P).get_anyClass_x0jl4l_k$=function(){return this.anyClass};z(P).get_numberClass_pnym9y_k$=function(){return this.numberClass};z(P).get_nothingClass_7ivpcc_k$=function(){return this.nothingClass};z(P).get_booleanClass_d285fr_k$=function(){return this.booleanClass};z(P).get_byteClass_pu7s61_k$=function(){return this.byteClass};z(P).get_shortClass_5ajsv9_k$=function(){return this.shortClass};z(P).get_intClass_mw4y9a_k$=function(){return this.intClass};z(P).get_floatClass_xlwq2t_k$=function(){return this.floatClass};z(P).get_doubleClass_dahzcy_k$=function(){return this.doubleClass};z(P).get_arrayClass_udg0fc_k$=function(){return this.arrayClass};z(P).get_stringClass_bik2gy_k$=function(){return this.stringClass};z(P).get_throwableClass_ee1a8x_k$=function(){return this.throwableClass};z(P).get_booleanArrayClass_lnbwea_k$=function(){return this.booleanArrayClass};z(P).get_charArrayClass_7lhfoe_k$=function(){return this.charArrayClass};z(P).get_byteArrayClass_57my8g_k$=function(){return this.byteArrayClass};z(P).get_shortArrayClass_c1p7wy_k$=function(){return this.shortArrayClass};z(P).get_intArrayClass_h44pbv_k$=function(){return this.intArrayClass};z(P).get_longArrayClass_v379a4_k$=function(){return this.longArrayClass};z(P).get_floatArrayClass_qngmha_k$=function(){return this.floatArrayClass};z(P).get_doubleArrayClass_84hee1_k$=function(){return this.doubleArrayClass};z(P).functionClass=function(a){var b=El()[a];if(b==null){var c=Function,d="Function"+a;c=new O(c,d,Zl(a));El()[a]=c;d=c}else d=b;return d};var $l;function am(){$l==null&&new P();return $l}var bm;function cm(){bm||(bm=!0,Fl=Gb(Array(0),null))}function Cl(a){var b;Array.isArray(a)?b=dm(a):b=em(a);return b}function dm(a){var b;switch(a.length){case 1:b=em(a[0]);break;case 0:b=ml();break;default:b=new nl();break}return b}function em(a){if(a===String)return am().get_stringClass_bik2gy_k$();var b=a.$metadata$;if(b!=null){if(b.$kClass$==null){var c=new ol(a);b.$kClass$=c;c=c}else c=b.$kClass$;b=c}else b=new ol(a);return b}function Cl(){}function fm(a){hm.call(a,null);return a}function gm(){var a=fm(t(z(hm)));y(a,gm);return a}function hm(a){jj(a,this),y(this,hm)}function im(a,b){lm(b);return b}function jm(a){return im(a,t(z(Q)))}function km(a,b){Q.call(b,x(a));return b}function lm(a){Q.call(a,"");return a}function mm(){return lm(t(z(Q)))}function nm(a,b,c,d){if(b<0||b>d)throw Yj("startIndex: "+b+", length: "+d);if(b>c)throw M("startIndex("+b+") > endIndex("+c+")")}function Q(a){this.string_1=a===void 0?"":a}z(Q).get_length_g42xv3_k$=function(){return this.string_1.length};z(Q).get_kdzpvg_k$=function(a){var b=this.string_1;if(0<=a?a<=(hc(b)-1|0):!1)b=fc(b,a);else throw Yj("index: "+a+", length: "+this.get_length_g42xv3_k$()+"}");return b};z(Q).subSequence_hm5hnj_k$=function(a,b){return this.string_1.substring(a,b)};z(Q).append_am5a4z_k$=function(a){this.string_1=this.string_1+p(a);return this};z(Q).append_jgojdo_k$=function(a){this.string_1=this.string_1+ub(a);return this};z(Q).append_xdc1zw_k$=function(a,b,c){return this.appendRange_arc5oa_k$(a==null?"null":a,b,c)};z(Q).reverse_i6tiw2_k$=function(){var a="",b=this.string_1.length-1|0;while(b>=0){var c=this.string_1,d=b;b=d-1|0;c=fc(c,d);if(pm(c)&&b>=0){d=this.string_1;var e=b;b=e-1|0;d=fc(d,e);qm(d)?a=a+new Va(d)+p(c):a=a+new Va(c)+p(d)}else a=a+p(c)}this.string_1=a;return this};z(Q).append_t8pm91_k$=function(a){this.string_1=this.string_1+ub(a);return this};z(Q).append_g4kq45_k$=function(a){this.string_1=this.string_1+a;return this};z(Q).append_yxu0ua_k$=function(a){return this.append_22ad7x_k$(a.toString())};z(Q).append_osrnku_k$=function(a){return this.append_22ad7x_k$(a.toString())};z(Q).append_uppzia_k$=function(a){return this.append_22ad7x_k$(a.toString())};z(Q).append_8gl4h8_k$=function(a){return this.append_22ad7x_k$(a.toString())};z(Q).append_g7wmaq_k$=function(a){return this.append_22ad7x_k$(a.toString())};z(Q).append_jynnak_k$=function(a){return this.append_22ad7x_k$(a.toString())};z(Q).append_eohvew_k$=function(a){this.string_1=this.string_1+wm(a);return this};z(Q).append_22ad7x_k$=function(a){var b=this,c=this.string_1;b.string_1=c+(a==null?"null":a);return this};z(Q).capacity_14dpom_k$=function(){return this.get_length_g42xv3_k$()};z(Q).ensureCapacity_wr7980_k$=function(a){};z(Q).indexOf_x62zdd_k$=function(a){return this.string_1.indexOf(a)};z(Q).indexOf_jar3b_k$=function(a,b){return this.string_1.indexOf(a,b)};z(Q).lastIndexOf_8r5hvr_k$=function(a){return this.string_1.lastIndexOf(a)};z(Q).lastIndexOf_dql50x_k$=function(a,b){var c;hc(a)===0?c=b<0:c=!1;return c?-1:this.string_1.lastIndexOf(a,b)};z(Q).insert_ktc7wm_k$=function(a,b){T().checkPositionIndex_w4k0on_k$(a,this.get_length_g42xv3_k$());var c=this;b=this.string_1.substring(0,a)+b;c.string_1=b+this.string_1.substring(a);return this};z(Q).insert_i0btdl_k$=function(a,b){return this.insert_xumlbs_k$(a,b.toString())};z(Q).insert_kf40vb_k$=function(a,b){return this.insert_xumlbs_k$(a,b.toString())};z(Q).insert_5z02kn_k$=function(a,b){return this.insert_xumlbs_k$(a,b.toString())};z(Q).insert_qjjc8h_k$=function(a,b){return this.insert_xumlbs_k$(a,b.toString())};z(Q).insert_9lbr89_k$=function(a,b){return this.insert_xumlbs_k$(a,b.toString())};z(Q).insert_zi6gm1_k$=function(a,b){return this.insert_xumlbs_k$(a,b.toString())};z(Q).insert_azl3w2_k$=function(a,b){T().checkPositionIndex_w4k0on_k$(a,this.get_length_g42xv3_k$());var c=this;b=this.string_1.substring(0,a)+p(b);c.string_1=b+this.string_1.substring(a);return this};z(Q).insert_117419_k$=function(a,b){T().checkPositionIndex_w4k0on_k$(a,this.get_length_g42xv3_k$());var c=this;b=this.string_1.substring(0,a)+wm(b);c.string_1=b+this.string_1.substring(a);return this};z(Q).insert_nbdn49_k$=function(a,b){T().checkPositionIndex_w4k0on_k$(a,this.get_length_g42xv3_k$());var c=this;b=this.string_1.substring(0,a)+ub(b);c.string_1=b+this.string_1.substring(a);return this};z(Q).insert_fjhmv4_k$=function(a,b){T().checkPositionIndex_w4k0on_k$(a,this.get_length_g42xv3_k$());var c=this;b=this.string_1.substring(0,a)+ub(b);c.string_1=b+this.string_1.substring(a);return this};z(Q).insert_xumlbs_k$=function(a,b){T().checkPositionIndex_w4k0on_k$(a,this.get_length_g42xv3_k$());b=b==null?"null":b;var c=this;b=this.string_1.substring(0,a)+b;c.string_1=b+this.string_1.substring(a);return this};z(Q).setLength_oy0ork_k$=function(a){if(a<0)throw M("Negative new length: "+a+".");if(a<=this.get_length_g42xv3_k$()){var b=this;b.string_1=this.string_1.substring(0,a)}else{b=this.get_length_g42xv3_k$();if(b<a)do b,b=b+1|0,this.string_1=this.string_1+p(n(0));while(b<a)}};z(Q).substring_376r6h_k$=function(a){T().checkPositionIndex_w4k0on_k$(a,this.get_length_g42xv3_k$());return this.string_1.substring(a)};z(Q).substring_d7lab3_k$=function(a,b){T().checkBoundsIndexes_tsopv1_k$(a,b,this.get_length_g42xv3_k$());return this.string_1.substring(a,b)};z(Q).trimToSize_dmxq0i_k$=function(){};z(Q).toString=function(){return this.string_1};z(Q).clear_1keqml_k$=function(){this.string_1="";return this};z(Q).set_l67naf_k$=function(a,b){T().checkElementIndex_s0yg86_k$(a,this.get_length_g42xv3_k$());var c=this;b=this.string_1.substring(0,a)+p(b);var d=this.string_1;a=a+1|0;c.string_1=b+d.substring(a)};z(Q).setRange_ekuxun_k$=function(a,b,c){nm(this,a,b,this.get_length_g42xv3_k$());var d=this;a=this.string_1.substring(0,a)+c;d.string_1=a+this.string_1.substring(b);return this};z(Q).deleteAt_mq1vvq_k$=function(a){T().checkElementIndex_s0yg86_k$(a,this.get_length_g42xv3_k$());var b=this,c=this.string_1.substring(0,a),d=this.string_1;a=a+1|0;b.string_1=c+d.substring(a);return this};z(Q).deleteRange_2clgry_k$=function(a,b){nm(this,a,b,this.get_length_g42xv3_k$());var c=this;a=this.string_1.substring(0,a);c.string_1=a+this.string_1.substring(b);return this};z(Q).toCharArray_bwugy6_k$=function(a,b,c,d){T().checkBoundsIndexes_tsopv1_k$(c,d,this.get_length_g42xv3_k$());T().checkBoundsIndexes_tsopv1_k$(b,(b+d|0)-c|0,a.length);b=b;c=c;if(c<d)do{var e=c;c=c+1|0;var f=b;b=f+1|0;a[f]=fc(this.string_1,e)}while(c<d)};z(Q).toCharArray$default_lalpk3_k$=function(a,b,c,d,e){b=b===H?0:b;c=c===H?0:c;d=d===H?this.get_length_g42xv3_k$():d;var f;e===H?(this.toCharArray_bwugy6_k$(a,b,c,d),f=S()):f=e.toCharArray_bwugy6_k$.call(this,a,b,c,d);return f};z(Q).appendRange_1a5qnl_k$=function(a,b,c){this.string_1=this.string_1+xm(a,b,c);return this};z(Q).appendRange_arc5oa_k$=function(a,b,c){a=x(a);T().checkBoundsIndexes_tsopv1_k$(b,c,a.length);var d=this,e=this.string_1;d.string_1=e+a.substring(b,c);return this};z(Q).insertRange_qm6w02_k$=function(a,b,c,d){T().checkPositionIndex_w4k0on_k$(a,this.get_length_g42xv3_k$());var e=this;b=this.string_1.substring(0,a)+xm(b,c,d);e.string_1=b+this.string_1.substring(a);return this};z(Q).insertRange_vx3juf_k$=function(a,b,c,d){T().checkPositionIndex_w4k0on_k$(a,this.get_length_g42xv3_k$());b=x(b);T().checkBoundsIndexes_tsopv1_k$(c,d,b.length);var e=this,f=this.string_1.substring(0,a);f=f+b.substring(c,d);e.string_1=f+this.string_1.substring(a);return this};function om(a){var b=p(a).toUpperCase();return b.length>1?a:fc(b,0)}function pm(a){return n(56320)<=a?a<=n(57343):!1}function qm(a){return n(55296)<=a?a<=n(56319):!1}function rm(a,b){return a.toString(sm(b))}function sm(a){if(!(2<=a?a<=36:!1))throw M("radix "+a+" was not in valid range 2..36");return a}function tm(a,b){return Ge(a,sm(b))}var um;function vm(a,b,c){c=c===H?!1:c;Bm();if(c){c=a.length;var d=b.length,e=Math.min(c,d);if(e===0)return c-d|0;var f=0;if(f<e)do{var g=f;f=f+1|0;var h=fc(a,g);g=fc(b,g);if(!(h===g)){h=om(h);g=om(g);if(!(h===g)){var i=h;i=p(i).toLowerCase();h=fc(i,0);i=g;i=p(i).toLowerCase();g=fc(i,0);if(!(h===g))return Ka(h,g)}}}while(f<e);return c-d|0}else return Kd(a,b)}function wm(a){Bm();var b="",c=0,d=a.length;while(c<d){var e=a[c];c=c+1|0;b=b+p(e)}return b}function xm(a,b,c){b=b===H?0:b;c=c===H?a.length:c;Bm();T().checkBoundsIndexes_tsopv1_k$(b,c,a.length);var d="";b=b;if(b<c)do{var e=b;b=b+1|0;d=d+p(a[e])}while(b<c);return d}function km(a){Bm();return Em(a,0,a.length,!1)}function ym(a){this.function_1=a}z(ym).compare_bczr_k$=function(a,b){return this.function_1(a,b)};z(ym).compare=function(a,b){return this.compare_bczr_k$(a,b)};z(ym).getFunctionDelegate_jtodtf_k$=function(){return this.function_1};z(ym).equals=function(a){if(a==null?!1:G(a,og)){(a==null?!1:G(a,Fb))?a=u(this.getFunctionDelegate_jtodtf_k$(),a.getFunctionDelegate_jtodtf_k$()):a=!1;a=a}else a=!1;return a};z(ym).hashCode=function(){return v(this.getFunctionDelegate_jtodtf_k$())};function zm(a,b){Bm();return vm(a,b,!0)}var Am;function Bm(){if(!Am){Am=!0;var a=zm;um=new ym(a)}}function Cm(){Im();return Dm}var Dm;function Em(a,b,c,d){Im();if(!(b>=0&&c<=a.length&&b<=c)){var e="Failed requirement.";throw M(x(e))}e=new Int8Array(g(c-b|0,3));var f=0;b=b;while(b<c){var h=b;b=h+1|0;h=fc(a,h);h=o(h);if(h<128){var i=f;f=i+1|0;e[i]=bf(h)}else if(h<2048){i=f;f=i+1|0;e[i]=bf(h>>6|192);i=f;f=i+1|0;e[i]=bf(h&63|128)}else if(h<55296||h>=57344){i=f;f=i+1|0;e[i]=bf(h>>12|224);i=f;f=i+1|0;e[i]=bf(h>>6&63|128);i=f;f=i+1|0;e[i]=bf(h&63|128)}else{i=Fm(a,h,b,c,d);if(i<=0){h=f;f=h+1|0;e[h]=Cm()[0];h=f;f=h+1|0;e[h]=Cm()[1];h=f;f=h+1|0;e[h]=Cm()[2]}else{h=f;f=h+1|0;e[h]=bf(i>>18|240);h=f;f=h+1|0;e[h]=bf(i>>12&63|128);h=f;f=h+1|0;e[h]=bf(i>>6&63|128);h=f;f=h+1|0;e[h]=bf(i&63|128);b=b+1|0}}}return e.length===f?e:jg(e,f)}function Fm(a,b,c,d,e){Im();if(!(55296<=b?b<=56319:!1)||c>=d)return Gm(0,c,e);d=fc(a,c);a=o(d);return!(56320<=a?a<=57343:!1)?Gm(0,c,e):65536+((b&1023)<<10)|0|a&1023}function Gm(a,b,c){Im();if(c)throw new hm("Malformed sequence starting at "+(b-1|0));return-a|0}var Hm;function Im(){Hm||(Hm=!0,Dm=new Int8Array([-17,-65,-67]))}function R(){}function Jm(){}function Km(){}function Lm(){}function Mm(){}function Nm(){}function Om(){}function Pm(){}z(Pm).toChar_tavt71_k$=function(){return gf(cf(this))};function Qm(a){this.names_1=a}z(Qm).get_names_ivn21r_k$=function(){return this.names_1};z(Qm).equals=function(a){if(!(a instanceof Qm))return!1;a=a instanceof Qm?a:A();return!ng(this.names_1,a.names_1)?!1:!0};z(Qm).hashCode=function(){return g(w("names"),127)^v(this.names_1)};z(Qm).toString=function(){return"@kotlin.Suppress(names="+x(this.names_1)+")"};function Rm(a){this.version_1=a}z(Rm).get_version_72w4j3_k$=function(){return this.version_1};z(Rm).equals=function(a){if(!(a instanceof Rm))return!1;a=a instanceof Rm?a:A();return!(this.version_1===a.version_1)?!1:!0};z(Rm).hashCode=function(){return g(w("version"),127)^w(this.version_1)};z(Rm).toString=function(){return"@kotlin.SinceKotlin(version="+this.version_1+")"};function Sm(a,b,c){b=b===H?new Tm("",[]):b,c=c===H?gn():c,this.message_1=a,this.replaceWith_1=b,this.level_1=c}z(Sm).get_message_h23axq_k$=function(){return this.message_1};z(Sm).get_replaceWith_l0ddm9_k$=function(){return this.replaceWith_1};z(Sm).get_level_ium7h7_k$=function(){return this.level_1};z(Sm).equals=function(a){if(!(a instanceof Sm))return!1;a=a instanceof Sm?a:A();if(!(this.message_1===a.message_1))return!1;if(!this.replaceWith_1.equals(a.replaceWith_1))return!1;return!this.level_1.equals(a.level_1)?!1:!0};z(Sm).hashCode=function(){var a=g(w("message"),127)^w(this.message_1);a=a+(g(w("replaceWith"),127)^v(this.replaceWith_1))|0;a=a+(g(w("level"),127)^this.level_1.hashCode())|0;return a};z(Sm).toString=function(){return"@kotlin.Deprecated(message="+this.message_1+", replaceWith="+x(this.replaceWith_1)+", level="+this.level_1.toString()+")"};function Tm(a,b){this.expression_1=a,this.imports_1=b}z(Tm).get_expression_l5w7j5_k$=function(){return this.expression_1};z(Tm).get_imports_x49mdh_k$=function(){return this.imports_1};z(Tm).equals=function(a){if(!(a instanceof Tm))return!1;a=a instanceof Tm?a:A();if(!(this.expression_1===a.expression_1))return!1;return!ng(this.imports_1,a.imports_1)?!1:!0};z(Tm).hashCode=function(){var a=g(w("expression"),127)^w(this.expression_1);a=a+(g(w("imports"),127)^v(this.imports_1))|0;return a};z(Tm).toString=function(){return"@kotlin.ReplaceWith(expression="+this.expression_1+", imports="+x(this.imports_1)+")"};function Um(a,b,c){a=a===H?"":a,b=b===H?"":b,c=c===H?"":c,this.warningSince_1=a,this.errorSince_1=b,this.hiddenSince_1=c}z(Um).get_warningSince_szk795_k$=function(){return this.warningSince_1};z(Um).get_errorSince_6p3nh7_k$=function(){return this.errorSince_1};z(Um).get_hiddenSince_8z3cp_k$=function(){return this.hiddenSince_1};z(Um).equals=function(a){if(!(a instanceof Um))return!1;a=a instanceof Um?a:A();if(!(this.warningSince_1===a.warningSince_1))return!1;if(!(this.errorSince_1===a.errorSince_1))return!1;return!(this.hiddenSince_1===a.hiddenSince_1)?!1:!0};z(Um).hashCode=function(){var a=g(w("warningSince"),127)^w(this.warningSince_1);a=a+(g(w("errorSince"),127)^w(this.errorSince_1))|0;a=a+(g(w("hiddenSince"),127)^w(this.hiddenSince_1))|0;return a};z(Um).toString=function(){return"@kotlin.DeprecatedSinceKotlin(warningSince="+this.warningSince_1+", errorSince="+this.errorSince_1+", hiddenSince="+this.hiddenSince_1+")"};function Vm(){}z(Vm).equals=function(a){if(!(a instanceof Vm))return!1;a instanceof Vm||A();return!0};z(Vm).hashCode=function(){return 0};z(Vm).toString=function(){return"@kotlin.PublishedApi()"};function Wm(a){this.name_1=a}z(Wm).get_name_woqyms_k$=function(){return this.name_1};z(Wm).equals=function(a){if(!(a instanceof Wm))return!1;a=a instanceof Wm?a:A();return!(this.name_1===a.name_1)?!1:!0};z(Wm).hashCode=function(){return g(w("name"),127)^w(this.name_1)};z(Wm).toString=function(){return"@kotlin.ParameterName(name="+this.name_1+")"};function Xm(){}z(Xm).equals=function(a){if(!(a instanceof Xm))return!1;a instanceof Xm||A();return!0};z(Xm).hashCode=function(){return 0};z(Xm).toString=function(){return"@kotlin.ExtensionFunctionType()"};var Ym,Zm,$m;function an(){return[gn(),hn(),jn()]}var bn;function cn(){if(bn)return S();bn=!0;Ym=new en("WARNING",0);Zm=new en("ERROR",1);$m=new en("HIDDEN",2)}var dn;function en(a,b){r.call(this,a,b)}function fn(){}z(fn).equals=function(a){if(!(a instanceof fn))return!1;a instanceof fn||A();return!0};z(fn).hashCode=function(){return 0};z(fn).toString=function(){return"@kotlin.UnsafeVariance()"};function gn(){cn();return Ym}function hn(){cn();return Zm}function jn(){cn();return $m}function kn(){ln=this}z(kn).toString=function(){return"kotlin.Unit"};var ln;function S(){ln==null&&new kn();return ln}function mn(a){this.allowedTargets_1=a}z(mn).get_allowedTargets_9sf77n_k$=function(){return this.allowedTargets_1};z(mn).equals=function(a){if(!(a instanceof mn))return!1;a=a instanceof mn?a:A();return!ng(this.allowedTargets_1,a.allowedTargets_1)?!1:!0};z(mn).hashCode=function(){return g(w("allowedTargets"),127)^v(this.allowedTargets_1)};z(mn).toString=function(){return"@kotlin.annotation.Target(allowedTargets="+x(this.allowedTargets_1)+")"};var nn,on,pn,qn,rn,sn,tn,un,vn,wn,xn,yn,zn,An,Bn;function an(){return[Qn(),Rn(),Sn(),Tn(),Un(),Vn(),Wn(),Xn(),Yn(),Zn(),$n(),ao(),bo(),co(),eo()]}var Cn;function Dn(){if(Cn)return S();Cn=!0;nn=new Fn("CLASS",0);on=new Fn("ANNOTATION_CLASS",1);pn=new Fn("TYPE_PARAMETER",2);qn=new Fn("PROPERTY",3);rn=new Fn("FIELD",4);sn=new Fn("LOCAL_VARIABLE",5);tn=new Fn("VALUE_PARAMETER",6);un=new Fn("CONSTRUCTOR",7);vn=new Fn("FUNCTION",8);wn=new Fn("PROPERTY_GETTER",9);xn=new Fn("PROPERTY_SETTER",10);yn=new Fn("TYPE",11);zn=new Fn("EXPRESSION",12);An=new Fn("FILE",13);Bn=new Fn("TYPEALIAS",14)}var En;function Fn(a,b){r.call(this,a,b)}function Gn(a){a=a===H?ho():a,this.value_1=a}z(Gn).get_value_j01efc_k$=function(){return this.value_1};z(Gn).equals=function(a){if(!(a instanceof Gn))return!1;a=a instanceof Gn?a:A();return!this.value_1.equals(a.value_1)?!1:!0};z(Gn).hashCode=function(){return g(w("value"),127)^this.value_1.hashCode()};z(Gn).toString=function(){return"@kotlin.annotation.Retention(value="+this.value_1.toString()+")"};var Hn,In,Jn;function an(){return[fo(),go(),ho()]}var Kn;function Ln(){if(Kn)return S();Kn=!0;Hn=new Nn("SOURCE",0);In=new Nn("BINARY",1);Jn=new Nn("RUNTIME",2)}var Mn;function Nn(a,b){r.call(this,a,b)}function On(){}z(On).equals=function(a){if(!(a instanceof On))return!1;a instanceof On||A();return!0};z(On).hashCode=function(){return 0};z(On).toString=function(){return"@kotlin.annotation.MustBeDocumented()"};function Pn(){}z(Pn).equals=function(a){if(!(a instanceof Pn))return!1;a instanceof Pn||A();return!0};z(Pn).hashCode=function(){return 0};z(Pn).toString=function(){return"@kotlin.annotation.Repeatable()"};function Qn(){Dn();return nn}function Rn(){Dn();return on}function Sn(){Dn();return pn}function Tn(){Dn();return qn}function Un(){Dn();return rn}function Vn(){Dn();return sn}function Wn(){Dn();return tn}function Xn(){Dn();return un}function Yn(){Dn();return vn}function Zn(){Dn();return wn}function $n(){Dn();return xn}function ao(){Dn();return yn}function bo(){Dn();return zn}function co(){Dn();return An}function eo(){Dn();return Bn}function fo(){Ln();return Hn}function go(){Ln();return In}function ho(){Ln();return Jn}function io(){}z(io).equals=function(a){if(!(a instanceof io))return!1;a instanceof io||A();return!0};z(io).hashCode=function(){return 0};z(io).toString=function(){return"@kotlin.ExperimentalStdlibApi()"};function jo(){}z(jo).equals=function(a){if(!(a instanceof jo))return!1;a instanceof jo||A();return!0};z(jo).hashCode=function(){return 0};z(jo).toString=function(){return"@kotlin.OptionalExpectation()"};function ko(){}z(ko).equals=function(a){if(!(a instanceof ko))return!1;a instanceof ko||A();return!0};z(ko).hashCode=function(){return 0};z(ko).toString=function(){return"@kotlin.ExperimentalMultiplatform()"};function lo(a){this.markerClass_1=a}z(lo).get_markerClass_h8iub9_k$=function(){return this.markerClass_1};z(lo).equals=function(a){if(!(a instanceof lo))return!1;a=a instanceof lo?a:A();return!ng(this.markerClass_1,a.markerClass_1)?!1:!0};z(lo).hashCode=function(){return g(w("markerClass"),127)^v(this.markerClass_1)};z(lo).toString=function(){return"@kotlin.OptIn(markerClass="+x(this.markerClass_1)+")"};var mo,no;function an(){return[so(),to()]}var oo;function po(){if(oo)return S();oo=!0;mo=new ro("WARNING",0);no=new ro("ERROR",1)}var qo;function ro(a,b){r.call(this,a,b)}function so(){po();return mo}function to(){po();return no}function uo(a,b){a=a===H?"":a,b=b===H?to():b,this.message_1=a,this.level_1=b}z(uo).get_message_h23axq_k$=function(){return this.message_1};z(uo).get_level_ium7h7_k$=function(){return this.level_1};z(uo).equals=function(a){if(!(a instanceof uo))return!1;a=a instanceof uo?a:A();if(!(this.message_1===a.message_1))return!1;return!this.level_1.equals(a.level_1)?!1:!0};z(uo).hashCode=function(){var a=g(w("message"),127)^w(this.message_1);a=a+(g(w("level"),127)^this.level_1.hashCode())|0;return a};z(uo).toString=function(){return"@kotlin.RequiresOptIn(message="+this.message_1+", level="+this.level_1.toString()+")"};function vo(a){this.markerClass_1=a}z(vo).get_markerClass_h8iub9_k$=function(){return this.markerClass_1};z(vo).equals=function(a){if(!(a instanceof vo))return!1;a=a instanceof vo?a:A();return!ng(this.markerClass_1,a.markerClass_1)?!1:!0};z(vo).hashCode=function(){return g(w("markerClass"),127)^v(this.markerClass_1)};z(vo).toString=function(){return"@kotlin.WasExperimental(markerClass="+x(this.markerClass_1)+")"};function wo(a){return function(b){return b===a?"(this Collection)":ub(b)}}function xo(){}z(xo).contains_aljjnj_k$=function(a){$l$block_0:{var b;G(this,q)?b=this.isEmpty_y1axqb_k$():b=!1;if(b){b=!1;break $l$block_0}var c=this.iterator_jk1svi_k$();while(c.hasNext_bitz1p_k$()){var d=c.next_20eer_k$();if(u(d,a)){b=!0;break $l$block_0}}b=!1}return b};z(xo).containsAll_xk45sd_k$=function(a){$l$block_0:{var b;G(a,q)?b=a.isEmpty_y1axqb_k$():b=!1;if(b){b=!0;break $l$block_0}a=a.iterator_jk1svi_k$();while(a.hasNext_bitz1p_k$()){var c=a.next_20eer_k$();if(!this.contains_aljjnj_k$(c)){b=!1;break $l$block_0}}b=!0}return b};z(xo).isEmpty_y1axqb_k$=function(){return this.get_size_woubt6_k$()===0};z(xo).toString=function(){return na(this,", ","[","]",H,H,wo(this))};z(xo).toArray=function(){return Eg(this)};z(xo).toArray_6cwqme_k$=function(a){return Fg(this,a)};function yo(a,b,c){Do.call(this),this.list_1=a,this.fromIndex_1=b,this._size_1=0,T().checkRangeIndexes_mmy49x_k$(this.fromIndex_1,c,this.list_1.get_size_woubt6_k$()),this._size_1=c-this.fromIndex_1|0}z(yo).get_c1px32_k$=function(a){T().checkElementIndex_s0yg86_k$(a,this._size_1);return this.list_1.get_c1px32_k$(this.fromIndex_1+a|0)};z(yo).get_size_woubt6_k$=function(){return this._size_1};function zo(a){this.$this_1=a,this.index_1=0}z(zo).set_index_69f5xp_k$=function(a){this.index_1=a};z(zo).get_index_it478p_k$=function(){return this.index_1};z(zo).hasNext_bitz1p_k$=function(){return this.index_1<this.$this_1.get_size_woubt6_k$()};z(zo).next_20eer_k$=function(){if(!this.hasNext_bitz1p_k$())throw dj();var a=this.index_1;this.index_1=a+1|0;return this.$this_1.get_c1px32_k$(a)};function Ao(a,b){this.$this_2=a,zo.call(this,a),T().checkPositionIndex_w4k0on_k$(b,this.$this_2.get_size_woubt6_k$()),this.index_1=b}z(Ao).hasPrevious_qh0629_k$=function(){return this.index_1>0};z(Ao).nextIndex_jshxun_k$=function(){return this.index_1};z(Ao).previous_l2dfd5_k$=function(){if(!this.hasPrevious_qh0629_k$())throw dj();this.index_1=this.index_1-1|0;return this.$this_2.get_c1px32_k$(this.index_1)};z(Ao).previousIndex_4qtyw5_k$=function(){return this.index_1-1|0};function Bo(){Co=this,this.maxArraySize_1=2147483639}z(Bo).checkElementIndex_s0yg86_k$=function(a,b){if(a<0||a>=b)throw Yj("index: "+a+", size: "+b)};z(Bo).checkPositionIndex_w4k0on_k$=function(a,b){if(a<0||a>b)throw Yj("index: "+a+", size: "+b)};z(Bo).checkRangeIndexes_mmy49x_k$=function(a,b,c){if(a<0||b>c)throw Yj("fromIndex: "+a+", toIndex: "+b+", size: "+c);if(a>b)throw M("fromIndex: "+a+" > toIndex: "+b)};z(Bo).checkBoundsIndexes_tsopv1_k$=function(a,b,c){if(a<0||b>c)throw Yj("startIndex: "+a+", endIndex: "+b+", size: "+c);if(a>b)throw M("startIndex: "+a+" > endIndex: "+b)};z(Bo).newCapacity_k5ozfy_k$=function(a,b){a=a+(a>>1)|0;(a-b|0)<0&&(a=b);(a-2147483639|0)>0&&(a=b>2147483639?2147483647:2147483639);return a};z(Bo).orderedHashCode_bw6l9m_k$=function(b){var a=1;b=b.iterator_jk1svi_k$();while(b.hasNext_bitz1p_k$()){var c=b.next_20eer_k$(),d=g(31,a);c=c==null?null:v(c);a=d+(c==null?0:c)|0}return a};z(Bo).orderedEquals_p8tefk_k$=function(a,b){if(!(a.get_size_woubt6_k$()===b.get_size_woubt6_k$()))return!1;b=b.iterator_jk1svi_k$();a=a.iterator_jk1svi_k$();while(a.hasNext_bitz1p_k$()){var c=a.next_20eer_k$(),d=b.next_20eer_k$();if(!u(c,d))return!1}return!0};var Co;function T(){Co==null&&new Bo();return Co}function Do(){T(),xo.call(this)}z(Do).iterator_jk1svi_k$=function(){return new zo(this)};z(Do).indexOf_si1fv9_k$=function(a){$l$block:{var b=0,c=this.iterator_jk1svi_k$();while(c.hasNext_bitz1p_k$()){var d=c.next_20eer_k$();if(u(d,a)){d=b;break $l$block}b=b+1|0}d=-1}return d};z(Do).lastIndexOf_v2p1fv_k$=function(a){$l$block:{var b=this.listIterator_70e65o_k$(this.get_size_woubt6_k$());while(b.hasPrevious_qh0629_k$()){var c=b.previous_l2dfd5_k$();if(u(c,a)){c=b.nextIndex_jshxun_k$();break $l$block}}c=-1}return c};z(Do).listIterator_xjshxw_k$=function(){return new Ao(this,0)};z(Do).listIterator_70e65o_k$=function(a){return new Ao(this,a)};z(Do).subList_xle3r2_k$=function(a,b){return new yo(this,a,b)};z(Do).equals=function(a){if(a===this)return!0;return!(a==null?!1:G(a,qb))?!1:T().orderedEquals_p8tefk_k$(this,a)};z(Do).hashCode=function(){return T().orderedHashCode_bw6l9m_k$(this)};function Eo(a){this.$entryIterator_1=a}z(Eo).hasNext_bitz1p_k$=function(){return this.$entryIterator_1.hasNext_bitz1p_k$()};z(Eo).next_20eer_k$=function(){return this.$entryIterator_1.next_20eer_k$().get_key_18j28a_k$()};function Fo(a){this.$entryIterator_1=a}z(Fo).hasNext_bitz1p_k$=function(){return this.$entryIterator_1.hasNext_bitz1p_k$()};z(Fo).next_20eer_k$=function(){return this.$entryIterator_1.next_20eer_k$().get_value_j01efc_k$()};function Go(a,b){return b===a?"(this Map)":ub(b)}function Ho(a,b){$l$block:{a=a.get_entries_p20ztl_k$().iterator_jk1svi_k$();while(a.hasNext_bitz1p_k$()){var c=a.next_20eer_k$();if(u(c.get_key_18j28a_k$(),b)){c=c;break $l$block}}c=null}return c}function Io(){Jo=this}z(Io).entryHashCode_z1arpf_k$=function(a){var b=a.get_key_18j28a_k$();b=b==null?null:v(b);b=b==null?0:b;a=a.get_value_j01efc_k$();a=a==null?null:v(a);return b^(a==null?0:a)};z(Io).entryToString_saurv6_k$=function(a){return ub(a.get_key_18j28a_k$())+"="+ub(a.get_value_j01efc_k$())};z(Io).entryEquals_z7rteo_k$=function(a,b){return!(b==null?!1:G(b,fb))?!1:u(a.get_key_18j28a_k$(),b.get_key_18j28a_k$())&&u(a.get_value_j01efc_k$(),b.get_value_j01efc_k$())};var Jo;function Ko(){Jo==null&&new Io();return Jo}function Lo(a){this.this$0__1=a,So.call(this)}z(Lo).contains_vbgn2f_k$=function(a){return this.this$0__1.containsKey_aw81wo_k$(a)};z(Lo).contains_aljjnj_k$=function(a){return!(a==null?!0:!(a==null))?!1:this.contains_vbgn2f_k$((a==null?!0:!(a==null))?a:A())};z(Lo).iterator_jk1svi_k$=function(){var a=this.this$0__1.get_entries_p20ztl_k$().iterator_jk1svi_k$();return new Eo(a)};z(Lo).get_size_woubt6_k$=function(){return this.this$0__1.get_size_woubt6_k$()};function Mo(a){return function(b){return a.toString_shrnxz_k$(b)}}function No(a){this.this$0__1=a,xo.call(this)}z(No).contains_m22g8e_k$=function(a){return this.this$0__1.containsValue_yf2ykl_k$(a)};z(No).contains_aljjnj_k$=function(a){return!(a==null?!0:!(a==null))?!1:this.contains_m22g8e_k$((a==null?!0:!(a==null))?a:A())};z(No).iterator_jk1svi_k$=function(){var a=this.this$0__1.get_entries_p20ztl_k$().iterator_jk1svi_k$();return new Fo(a)};z(No).get_size_woubt6_k$=function(){return this.this$0__1.get_size_woubt6_k$()};function Oo(){Ko(),this._keys_1=null,this._values_1=null}z(Oo).containsKey_aw81wo_k$=function(a){return!(Ho(this,a)==null)};z(Oo).containsValue_yf2ykl_k$=function(a){$l$block_0:{var b=this.get_entries_p20ztl_k$(),c;G(b,q)?c=b.isEmpty_y1axqb_k$():c=!1;if(c){c=!1;break $l$block_0}b=b.iterator_jk1svi_k$();while(b.hasNext_bitz1p_k$()){var d=b.next_20eer_k$();if(u(d.get_value_j01efc_k$(),a)){c=!0;break $l$block_0}}c=!1}return c};z(Oo).containsEntry_50dpfo_k$=function(a){if(!(a==null?!1:G(a,fb)))return!1;var b=a.get_key_18j28a_k$();a=a.get_value_j01efc_k$();var c=(G(this,ib)?this:A()).get_wei43m_k$(b);if(!u(a,c))return!1;c==null?a=!(G(this,ib)?this:A()).containsKey_aw81wo_k$(b):a=!1;return a?!1:!0};z(Oo).equals=function(a){if(a===this)return!0;if(!(a==null?!1:G(a,ib)))return!1;if(!(this.get_size_woubt6_k$()===a.get_size_woubt6_k$()))return!1;$l$block_0:{a=a.get_entries_p20ztl_k$();var b;G(a,q)?b=a.isEmpty_y1axqb_k$():b=!1;if(b){b=!0;break $l$block_0}a=a.iterator_jk1svi_k$();while(a.hasNext_bitz1p_k$()){var c=a.next_20eer_k$();if(!this.containsEntry_50dpfo_k$(c)){b=!1;break $l$block_0}}b=!0}return b};z(Oo).get_wei43m_k$=function(a){a=Ho(this,a);return a==null?null:a.get_value_j01efc_k$()};z(Oo).hashCode=function(){return v(this.get_entries_p20ztl_k$())};z(Oo).isEmpty_y1axqb_k$=function(){return this.get_size_woubt6_k$()===0};z(Oo).get_size_woubt6_k$=function(){return this.get_entries_p20ztl_k$().get_size_woubt6_k$()};z(Oo).get_keys_wop4xp_k$=function(){if(this._keys_1==null){var a=this;a._keys_1=new Lo(this)}return de(this._keys_1)};z(Oo).toString=function(){var a=this.get_entries_p20ztl_k$();return na(a,", ","{","}",H,H,Mo(this))};z(Oo).toString_shrnxz_k$=function(a){return Go(this,a.get_key_18j28a_k$())+"="+Go(this,a.get_value_j01efc_k$())};z(Oo).get_values_ksazhn_k$=function(){if(this._values_1==null){var a=this;a._values_1=new No(this)}return de(this._values_1)};z(Oo).set__values_jz9swx_k$=function(a){this._values_1=a};z(Oo).get__values_wfmpnc_k$=function(){return this._values_1};function Po(){Qo=this}z(Po).unorderedHashCode_usxz8d_k$=function(b){var a=0;b=b.iterator_jk1svi_k$();while(b.hasNext_bitz1p_k$()){var c=b.next_20eer_k$(),d=a;c=c==null?null:v(c);a=d+(c==null?0:c)|0}return a};z(Po).setEquals_mjzluv_k$=function(a,b){return!(a.get_size_woubt6_k$()===b.get_size_woubt6_k$())?!1:a.containsAll_xk45sd_k$(b)};var Qo;function Ro(){Qo==null&&new Po();return Qo}function So(){Ro(),xo.call(this)}z(So).equals=function(a){if(a===this)return!0;return!(a==null?!1:G(a,bb))?!1:Ro().setEquals_mjzluv_k$(this,a)};z(So).hashCode=function(){return Ro().unorderedHashCode_usxz8d_k$(this)};function To(a){if(a.isEmpty_y1axqb_k$())return[];var b=a.get_size_woubt6_k$();b=Gb(Array(b),null);a=a.iterator_jk1svi_k$();var c=0;while(a.hasNext_bitz1p_k$()){var d=c;c=d+1|0;b[d]=a.next_20eer_k$()}return b}function Uo(a,b){if(a.isEmpty_y1axqb_k$())return Gg(0,b);var c;b.length<a.get_size_woubt6_k$()?c=Hg(b,a.get_size_woubt6_k$()):c=b;b=c;c=a.iterator_jk1svi_k$();var d=0;while(c.hasNext_bitz1p_k$()){var e=d;d=e+1|0;var f=c.next_20eer_k$();b[e]=(f==null?!0:!(f==null))?f:A()}return Gg(a.get_size_woubt6_k$(),b)}function Vo(a){return a.get_size_woubt6_k$()-1|0}function Wo(){throw Kj("Index overflow has happened.")}function Xo(){return $o()}function Yo(){Zo=this,this.serialVersionUID_1=new s(-1478467534,-1720727600)}z(Yo).equals=function(a){(a==null?!1:G(a,qb))?a=a.isEmpty_y1axqb_k$():a=!1;return a};z(Yo).hashCode=function(){return 1};z(Yo).toString=function(){return"[]"};z(Yo).get_size_woubt6_k$=function(){return 0};z(Yo).isEmpty_y1axqb_k$=function(){return!0};z(Yo).contains_a7ux40_k$=function(a){return!1};z(Yo).contains_aljjnj_k$=function(a){return!1;var b;b=A();return this.contains_a7ux40_k$(b)};z(Yo).containsAll_g2avn8_k$=function(a){return a.isEmpty_y1axqb_k$()};z(Yo).containsAll_xk45sd_k$=function(a){return this.containsAll_g2avn8_k$(a)};z(Yo).get_c1px32_k$=function(a){throw Yj("Empty list doesn't contain element at index "+a+".")};z(Yo).indexOf_31ms1i_k$=function(a){return-1};z(Yo).indexOf_si1fv9_k$=function(a){return-1;var b;b=A();return this.indexOf_31ms1i_k$(b)};z(Yo).lastIndexOf_5pkqqc_k$=function(a){return-1};z(Yo).lastIndexOf_v2p1fv_k$=function(a){return-1;var b;b=A();return this.lastIndexOf_5pkqqc_k$(b)};z(Yo).iterator_jk1svi_k$=function(){return cp()};z(Yo).listIterator_xjshxw_k$=function(){return cp()};z(Yo).listIterator_70e65o_k$=function(a){if(!(a===0))throw Yj("Index: "+a);return cp()};z(Yo).subList_xle3r2_k$=function(a,b){if(a===0&&b===0)return this;throw Yj("fromIndex: "+a+", toIndex: "+b)};var Zo;function $o(){Zo==null&&new Yo();return Zo}function ap(){bp=this}z(ap).hasNext_bitz1p_k$=function(){return!1};z(ap).hasPrevious_qh0629_k$=function(){return!1};z(ap).nextIndex_jshxun_k$=function(){return 0};z(ap).previousIndex_4qtyw5_k$=function(){return-1};z(ap).next_20eer_k$=function(){throw dj()};z(ap).previous_l2dfd5_k$=function(){throw dj()};var bp;function cp(){bp==null&&new ap();return bp}function dp(a,b){return fp(a,b,!0)}function ep(a,b){return gp(a,b,!0)}function fp(a,b,c){if(!G(a,Fi))return gp(G(a,Wa)?a:A(),b,c);var d=0,e=0,f=Vo(a);if(e<=f)$l$loop:do{var g=e;e=e+1|0;var h=a.get_c1px32_k$(g);if(b(h)===c)continue $l$loop;d===g||a.set_82063s_k$(d,h);d=d+1|0}while(!(g===f));if(d<a.get_size_woubt6_k$()){h=Vo(a);g=d;if(g<=h)do{e=h;h=h+-1|0;a.removeAt_6niowx_k$(e)}while(!(e===g));return!0}else return!1}function gp(a,b,c){var d=!1;a=a.iterator_jk1svi_k$();while(a.hasNext_bitz1p_k$())b(a.next_20eer_k$())===c&&(a.remove_ldkf9o_k$(),d=!0);return d}function hp(){}z(hp).next_20eer_k$=function(){return this.nextInt_ujorgc_k$()};function ip(){}z(ip).next_20eer_k$=function(){return this.nextByte_njqopn_k$()};function jp(){}z(jp).next_20eer_k$=function(){return this.nextLong_njwv0v_k$()};function kp(){}z(kp).next_20eer_k$=function(){return this.nextDouble_s2xvfg_k$()};function lp(){}z(lp).next_20eer_k$=function(){return this.nextFloat_jqti5l_k$()};function mp(){}z(mp).next_30xa17_k$=function(){return this.nextChar_yvnk6j_k$()};z(mp).next_20eer_k$=function(){return new Va(this.next_30xa17_k$())};function np(){}z(np).next_20eer_k$=function(){return this.nextShort_jxwabt_k$()};function op(){}z(op).next_20eer_k$=function(){return this.nextBoolean_nfdk1h_k$()};function an(){}function pp(){}var qp,rp,sp,tp;function up(){return[Ap(),Bp(),Cp(),Dp()]}var vp;function wp(){if(vp)return S();vp=!0;qp=new yp("AT_MOST_ONCE",0);rp=new yp("AT_LEAST_ONCE",1);sp=new yp("EXACTLY_ONCE",2);tp=new yp("UNKNOWN",3)}var xp;function yp(a,b){r.call(this,a,b)}function zp(){}z(zp).equals=function(a){if(!(a instanceof zp))return!1;a instanceof zp||A();return!0};z(zp).hashCode=function(){return 0};z(zp).toString=function(){return"@kotlin.contracts.ExperimentalContracts()"};function Ap(){wp();return qp}function Bp(){wp();return rp}function Cp(){wp();return sp}function Dp(){wp();return tp}function up(){}function Ep(){}function Fp(){}function Gp(){}function Hp(){}function Ip(){}function Jp(){}function Kp(a,b){this.$context_1=a,this.$resumeWith_1=b}z(Kp).get_context_h02k06_k$=function(){return this.$context_1};z(Kp).resumeWith_dtxwbr_k$=function(a){return this.$resumeWith_1(new Is(a))};function Lp(){Mp=this}var Mp;function Np(){Mp==null&&new Lp();return Mp}function Op(){}function Pp(){}function Qp(){}function Rp(a,b){a=a.minusKey_9i5ggf_k$(b.get_key_18j28a_k$());var c;if(a===Vp())c=b;else{var d=a.get_y2st91_k$(Np()),e;if(d==null)e=new eq(a,b);else{a=a.minusKey_9i5ggf_k$(Np());e=a===Vp()?new eq(b,d):new eq(new eq(a,b),d)}c=e}return c}function Sp(){}function Tp(){Up=this,this.serialVersionUID_1=new s(0,0)}z(Tp).get_y2st91_k$=function(a){return null};z(Tp).fold_j2vaxd_k$=function(a,b){return a};z(Tp).plus_s13ygv_k$=function(a){return a};z(Tp).minusKey_9i5ggf_k$=function(a){return this};z(Tp).hashCode=function(){return 0};z(Tp).toString=function(){return"EmptyCoroutineContext"};var Up;function Vp(){Up==null&&new Tp();return Up}function Wp(){Xp=this,this.serialVersionUID_1=new s(0,0)}var Xp;function Yp(){Xp==null&&new Wp();return Xp}function Zp(a){a=a;var b=2;while(!0){var c=a.left_1;c=c instanceof eq?c:null;if(c==null)return b;else c=c;a=c;b=b+1|0}}function $p(a,b){return u(a.get_y2st91_k$(b.get_key_18j28a_k$()),b)}function aq(a,b){b=b;while(!0){if(!$p(a,b.element_1))return!1;var c=b.left_1;if(c instanceof eq)b=c;else return $p(a,G(c,Qp)?c:A())}}function bq(a){Yp(),this.elements_1=a}z(bq).get_elements_vxwh8g_k$=function(){return this.elements_1};function cq(a,b){var c;hc(a)===0?c=x(b):c=a+", "+x(b);return c}function dq(a,b){return function(c,d){c=b._v;b._v=c+1|0;a[c]=d;return S()}}function eq(a,b){this.left_1=a,this.element_1=b}z(eq).get_y2st91_k$=function(a){var b=this;while(!0){var c=b.element_1.get_y2st91_k$(a);if(c==null)null;else return c;c=b.left_1;if(c instanceof eq)b=c;else return c.get_y2st91_k$(a)}};z(eq).fold_j2vaxd_k$=function(a,b){return b(this.left_1.fold_j2vaxd_k$(a,b),this.element_1)};z(eq).minusKey_9i5ggf_k$=function(a){if(this.element_1.get_y2st91_k$(a)==null)null;else return this.left_1;a=this.left_1.minusKey_9i5ggf_k$(a);return a===this.left_1?this:a===Vp()?this.element_1:new eq(a,this.element_1)};z(eq).equals=function(a){var b;if(this===a)b=!0;else{var c;a instanceof eq?c=Zp(a)===Zp(this):c=!1;c?c=aq(a,this):c=!1;b=c}return b};z(eq).hashCode=function(){return v(this.left_1)+v(this.element_1)|0};z(eq).toString=function(){return"["+this.fold_j2vaxd_k$("",cq)+"]"};function fq(a,b){this.safeCast_1=b;b=this;var c;a instanceof fq?c=a.topmostKey_1:c=a;b.topmostKey_1=c}z(fq).tryCast_4izk6v_k$=function(a){return this.safeCast_1(a)};z(fq).isSubKey_wd0g2p_k$=function(a){return a===this||this.topmostKey_1===a};function gq(){return oq()}var hq,iq,jq;function dq(){return[oq(),pq(),qq()]}var kq;function lq(){if(kq)return S();kq=!0;hq=new nq("COROUTINE_SUSPENDED",0);iq=new nq("UNDECIDED",1);jq=new nq("RESUMED",2)}var mq;function nq(a,b){r.call(this,a,b)}function oq(){lq();return hq}function pq(){lq();return iq}function qq(){lq();return jq}function dq(){}function rq(a){return new sq(a)}function sq(a){Do.call(this),this.entries_1=a}z(sq).get_size_woubt6_k$=function(){return this.entries_1.length};z(sq).get_c1px32_k$=function(a){T().checkElementIndex_s0yg86_k$(a,this.entries_1.length);return this.entries_1[a]};z(sq).contains_qvgeh3_k$=function(a){if(a===null)return!1;var b=ma(this.entries_1,a.get_ordinal_ip24qg_k$());return b===a};z(sq).contains_aljjnj_k$=function(a){return!(a instanceof r)?!1:this.contains_qvgeh3_k$(a instanceof r?a:A())};z(sq).indexOf_cbd19f_k$=function(a){if(a===null)return-1;var b=a.get_ordinal_ip24qg_k$(),c=ma(this.entries_1,b);return c===a?b:-1};z(sq).indexOf_si1fv9_k$=function(a){return!(a instanceof r)?-1:this.indexOf_cbd19f_k$(a instanceof r?a:A())};z(sq).lastIndexOf_q19csz_k$=function(a){return this.indexOf_cbd19f_k$(a)};z(sq).lastIndexOf_v2p1fv_k$=function(a){return!(a instanceof r)?-1:this.lastIndexOf_q19csz_k$(a instanceof r?a:A())};function tq(){}z(tq).equals=function(a){if(!(a instanceof tq))return!1;a instanceof tq||A();return!0};z(tq).hashCode=function(){return 0};z(tq).toString=function(){return"@kotlin.experimental.ExperimentalTypeInference()"};function uq(){}z(uq).equals=function(a){if(!(a instanceof uq))return!1;a instanceof uq||A();return!0};z(uq).hashCode=function(){return 0};z(uq).toString=function(){return"@kotlin.internal.NoInfer()"};function vq(){}z(vq).equals=function(a){if(!(a instanceof vq))return!1;a instanceof vq||A();return!0};z(vq).hashCode=function(){return 0};z(vq).toString=function(){return"@kotlin.internal.InlineOnly()"};function wq(){}z(wq).equals=function(a){if(!(a instanceof wq))return!1;a instanceof wq||A();return!0};z(wq).hashCode=function(){return 0};z(wq).toString=function(){return"@kotlin.internal.DynamicExtension()"};function xq(){}z(xq).equals=function(a){if(!(a instanceof xq))return!1;a instanceof xq||A();return!0};z(xq).hashCode=function(){return 0};z(xq).toString=function(){return"@kotlin.internal.LowPriorityInOverloadResolution()"};function yq(){}z(yq).equals=function(a){if(!(a instanceof yq))return!1;a instanceof yq||A();return!0};z(yq).hashCode=function(){return 0};z(yq).toString=function(){return"@kotlin.internal.ContractsDsl()"};function zq(){}z(zq).equals=function(a){if(!(a instanceof zq))return!1;a instanceof zq||A();return!0};z(zq).hashCode=function(){return 0};z(zq).toString=function(){return"@kotlin.internal.OnlyInputTypes()"};function Aq(a,b,c,d,e){b=b===H?"":b,c=c===H?hn():c,d=d===H?Jq():d,e=e===H?-1:e,this.version_1=a,this.message_1=b,this.level_1=c,this.versionKind_1=d,this.errorCode_1=e}z(Aq).get_version_72w4j3_k$=function(){return this.version_1};z(Aq).get_message_h23axq_k$=function(){return this.message_1};z(Aq).get_level_ium7h7_k$=function(){return this.level_1};z(Aq).get_versionKind_pab57n_k$=function(){return this.versionKind_1};z(Aq).get_errorCode_dyf6uk_k$=function(){return this.errorCode_1};z(Aq).equals=function(a){if(!(a instanceof Aq))return!1;a=a instanceof Aq?a:A();if(!(this.version_1===a.version_1))return!1;if(!(this.message_1===a.message_1))return!1;if(!this.level_1.equals(a.level_1))return!1;if(!this.versionKind_1.equals(a.versionKind_1))return!1;return!(this.errorCode_1===a.errorCode_1)?!1:!0};z(Aq).hashCode=function(){var a=g(w("version"),127)^w(this.version_1);a=a+(g(w("message"),127)^w(this.message_1))|0;a=a+(g(w("level"),127)^this.level_1.hashCode())|0;a=a+(g(w("versionKind"),127)^this.versionKind_1.hashCode())|0;a=a+(g(w("errorCode"),127)^this.errorCode_1)|0;return a};z(Aq).toString=function(){return"@kotlin.internal.RequireKotlin(version="+this.version_1+", message="+this.message_1+", level="+this.level_1.toString()+", versionKind="+this.versionKind_1.toString()+", errorCode="+this.errorCode_1+")"};var Bq,Cq,Dq;function Eq(){return[Jq(),Kq(),Lq()]}var Fq;function Gq(){if(Fq)return S();Fq=!0;Bq=new Iq("LANGUAGE_VERSION",0);Cq=new Iq("COMPILER_VERSION",1);Dq=new Iq("API_VERSION",2)}var Hq;function Iq(a,b){r.call(this,a,b)}function Jq(){Gq();return Bq}function Kq(){Gq();return Cq}function Lq(){Gq();return Dq}function Mq(a,b,c){var d;if(c>0)d=a>=b?b:b-Oq(b,a,c)|0;else if(c<0)d=a<=b?b:b+Oq(a,b,-c|0)|0;else throw M("Step is zero.");return d}function Nq(a,b,c){var d;if(c.compareTo_9jj042_k$(new s(0,0))>0)d=a.compareTo_9jj042_k$(b)>=0?b:b.minus_mfbszm_k$(Pq(b,a,c));else if(c.compareTo_9jj042_k$(new s(0,0))<0)d=a.compareTo_9jj042_k$(b)<=0?b:b.plus_r93sks_k$(Pq(a,b,c.unaryMinus_6uz0qp_k$()));else throw M("Step is zero.");return d}function Oq(a,b,c){return Qq(Qq(a,c)-Qq(b,c)|0,c)}function Pq(a,b,c){return Rq(Rq(a,c).minus_mfbszm_k$(Rq(b,c)),c)}function Qq(a,b){a=a%b|0;return a>=0?a:a+b|0}function Rq(a,b){a=a.rem_bsnl9o_k$(b);return a.compareTo_9jj042_k$(new s(0,0))>=0?a:a.plus_r93sks_k$(b)}function Sq(){vr();return Tq}var Tq;function Uq(){vr();return Vq}var Vq;function Wq(){vr();return Xq}var Xq;function Yq(){vr();return Zq}var Zq,$q,ar,br,cr;function Eq(){return[qr(),rr(),sr(),tr()]}var dr;function er(){if(dr)return S();dr=!0;$q=new gr("PRESENT",0);ar=new gr("ABSENT",1);br=new gr("PRESENT_OPTIONAL",2);cr=new gr("ABSENT_OPTIONAL",3)}var fr;function gr(a,b){r.call(this,a,b)}function hr(a){return a.paddingOption_1.equals(qr())||a.paddingOption_1.equals(sr())}function ir(a,b,c,d,e,f){var g=a.isUrlSafe_1?Yq():Uq(),h=0,i=-8;e=e;var j=d,k=!1;$l$loop_1:while(e<f){if(i===-8&&(e+3|0)<f){var l=e;e=l+1|0;l=g[b[l]&255];var m=e;e=m+1|0;m=g[b[m]&255];var aa=e;e=aa+1|0;aa=g[b[aa]&255];var ba=e;e=ba+1|0;ba=g[b[ba]&255];l=l<<18|m<<12|aa<<6|ba;if(l>=0){m=j;j=m+1|0;c[m]=bf(l>>16);aa=j;j=aa+1|0;c[aa]=bf(l>>8);ba=j;j=ba+1|0;c[ba]=bf(l);continue $l$loop_1}e=e-4|0}m=b[e]&255;aa=g[m];if(aa<0)if(aa===-2){k=!0;e=jr(a,b,e,f,i);break $l$loop_1}else if(a.isMimeScheme_1){e=e+1|0;continue $l$loop_1}else throw M("Invalid symbol '"+p(gf(m))+"'("+rm(m,8)+") at index "+e);else e=e+1|0;h=h<<6|aa;i=i+6|0;if(i>=0){ba=j;j=ba+1|0;c[ba]=bf(h>>>i|0);h=h&((1<<i)-1|0);i=i-8|0}}if(i===-2)throw M("The last unit of input does not have enough bits");if(!(i===-8)&&!k&&a.paddingOption_1.equals(qr()))throw M("The padding option is set to PRESENT, but the input is not properly padded");if(!(h===0))throw M("The pad bits must be zeros");e=lr(a,b,e,f);if(e<f){l=b[e]&255;throw M("Symbol '"+p(gf(l))+"'("+rm(l,8)+") at index "+(e-1|0)+" is prohibited after the pad character")}return j-d|0}function jr(a,b,c,d,e){var f;switch(e){case-8:throw M("Redundant pad character at index "+c);case-2:f=c+1|0;break;case-4:kr(a,c);e=lr(a,b,c+1|0,d);if(e===d||!(b[e]===61))throw M("Missing one pad character at index "+e);f=e+1|0;break;case-6:kr(a,c);f=c+1|0;break;default:d="Unreachable";throw zk(x(d))}return f}function kr(a,b){if(a.paddingOption_1.equals(rr()))throw M("The padding option is set to ABSENT, but the input has a pad character at index "+b)}function lr(a,b,c,d){if(!a.isMimeScheme_1)return c;a=c;while(a<d){c=b[a]&255;if(!(Uq()[c]===-1))return a;a=a+1|0}return a}function mr(a,b,c,d){if(c<0||c>b)throw Yj("destination offset: "+c+", destination size: "+b);a=c+d|0;if(a<0||a>b)throw Yj("The destination array does not have enough capacity, "+("destination offset: "+c+", destination size: "+b+", capacity needed: "+d))}function nr(){or=this;U.call(this,!1,!1,qr());this.bitsPerByte_1=8;this.bitsPerSymbol_1=6;this.bytesPerGroup_1=3;this.symbolsPerGroup_1=4;this.padSymbol_1=61;this.mimeLineLength_1=76;this.mimeGroupsPerLine_1=19;var a=this;a.mimeLineSeparatorSymbols_1=new Int8Array([13,10]);this.UrlSafe_1=new U(!0,!1,qr());this.Mime_1=new U(!1,!0,qr())}z(nr).get_bytesPerGroup_cbt09w_k$=function(){return this.bytesPerGroup_1};z(nr).get_symbolsPerGroup_dkby8c_k$=function(){return this.symbolsPerGroup_1};z(nr).get_padSymbol_ncrxty_k$=function(){return this.padSymbol_1};z(nr).get_mimeLineLength_9wbd01_k$=function(){return this.mimeLineLength_1};z(nr).get_mimeLineSeparatorSymbols_69s681_k$=function(){return this.mimeLineSeparatorSymbols_1};z(nr).get_UrlSafe_pzautv_k$=function(){return this.UrlSafe_1};z(nr).get_Mime_wo61zx_k$=function(){return this.Mime_1};var or;function pr(){or==null&&new nr();return or}function qr(){er();return $q}function rr(){er();return ar}function sr(){er();return br}function tr(){er();return cr}function U(a,b,c){pr();this.isUrlSafe_1=a;this.isMimeScheme_1=b;this.paddingOption_1=c;if(!(!this.isUrlSafe_1||!this.isMimeScheme_1)){a="Failed requirement.";throw M(x(a))}}z(U).get_isUrlSafe_w6ekjj_k$=function(){return this.isUrlSafe_1};z(U).get_isMimeScheme_czmxr0_k$=function(){return this.isMimeScheme_1};z(U).get_paddingOption_4xskid_k$=function(){return this.paddingOption_1};z(U).withPadding_mhhch9_k$=function(a){return this.paddingOption_1.equals(a)?this:new U(this.isUrlSafe_1,this.isMimeScheme_1,a)};z(U).encodeToByteArray_yar674_k$=function(a,b,c){return this.encodeToByteArrayImpl_2nw9xk_k$(a,b,c)};z(U).encodeToByteArray$default_aer9q8_k$=function(a,b,c,d){b=b===H?0:b;c=c===H?a.length:c;return d===H?this.encodeToByteArray_yar674_k$(a,b,c):d.encodeToByteArray_yar674_k$.call(this,a,b,c)};z(U).encodeIntoByteArray_f2dbr7_k$=function(a,b,c,d,e){return this.encodeIntoByteArrayImpl_agts2t_k$(a,b,c,d,e)};z(U).encodeIntoByteArray$default_kjqqde_k$=function(a,b,c,d,e,f){c=c===H?0:c;d=d===H?0:d;e=e===H?a.length:e;return f===H?this.encodeIntoByteArray_f2dbr7_k$(a,b,c,d,e):f.encodeIntoByteArray_f2dbr7_k$.call(this,a,b,c,d,e)};z(U).encode_hqs3g6_k$=function(a,b,c){a=this.encodeToByteArrayImpl_2nw9xk_k$(a,b,c);return this.bytesToStringImpl_94yjtd_k$(a)};z(U).encode$default_h4nonq_k$=function(a,b,c,d){b=b===H?0:b;c=c===H?a.length:c;return d===H?this.encode_hqs3g6_k$(a,b,c):d.encode_hqs3g6_k$.call(this,a,b,c)};z(U).encodeToAppendable_lcyka2_k$=function(a,b,c,d){a=this.encodeToByteArrayImpl_2nw9xk_k$(a,c,d);c=this.bytesToStringImpl_94yjtd_k$(a);b.append_jgojdo_k$(c);return b};z(U).encodeToAppendable$default_bxqfu8_k$=function(a,b,c,d,e){c=c===H?0:c;d=d===H?a.length:d;return e===H?this.encodeToAppendable_lcyka2_k$(a,b,c,d):e.encodeToAppendable_lcyka2_k$.call(this,a,b,c,d)};z(U).decode_iptc9a_k$=function(a,b,c){this.checkSourceBounds_fk7x94_k$(a.length,b,c);var d=this.decodeSize_c4ofgn_k$(a,b,c);d=new Int8Array(d);a=ir(this,a,d,0,b,c);if(!(a===d.length)){b="Check failed.";throw zk(x(b))}return d};z(U).decode$default_vlp1n6_k$=function(a,b,c,d){b=b===H?0:b;c=c===H?a.length:c;return d===H?this.decode_iptc9a_k$(a,b,c):d.decode_iptc9a_k$.call(this,a,b,c)};z(U).decodeIntoByteArray_aclq1h_k$=function(a,b,c,d,e){this.checkSourceBounds_fk7x94_k$(a.length,d,e);mr(this,b.length,c,this.decodeSize_c4ofgn_k$(a,d,e));return ir(this,a,b,c,d,e)};z(U).decodeIntoByteArray$default_37hjje_k$=function(a,b,c,d,e,f){c=c===H?0:c;d=d===H?0:d;e=e===H?a.length:e;return f===H?this.decodeIntoByteArray_aclq1h_k$(a,b,c,d,e):f.decodeIntoByteArray_aclq1h_k$.call(this,a,b,c,d,e)};z(U).decode_lt35e9_k$=function(a,b,c){a=this.charsToBytesImpl_z1u042_k$(a,b,c);return this.decode$default_vlp1n6_k$(a)};z(U).decode$default_mne14l_k$=function(a,b,c,d){b=b===H?0:b;c=c===H?hc(a):c;return d===H?this.decode_lt35e9_k$(a,b,c):d.decode_lt35e9_k$.call(this,a,b,c)};z(U).decodeIntoByteArray_ad8mn2_k$=function(a,b,c,d,e){a=this.charsToBytesImpl_z1u042_k$(a,d,e);return this.decodeIntoByteArray$default_37hjje_k$(a,b,c)};z(U).decodeIntoByteArray$default_snnwgp_k$=function(a,b,c,d,e,f){c=c===H?0:c;d=d===H?0:d;e=e===H?hc(a):e;return f===H?this.decodeIntoByteArray_ad8mn2_k$(a,b,c,d,e):f.decodeIntoByteArray_ad8mn2_k$.call(this,a,b,c,d,e)};z(U).encodeToByteArrayImpl_2nw9xk_k$=function(a,b,c){this.checkSourceBounds_fk7x94_k$(a.length,b,c);var d=this.encodeSize_ced6p5_k$(c-b|0);d=new Int8Array(d);this.encodeIntoByteArrayImpl_agts2t_k$(a,d,0,b,c);return d};z(U).encodeIntoByteArrayImpl_agts2t_k$=function(a,b,c,d,e){this.checkSourceBounds_fk7x94_k$(a.length,d,e);mr(this,b.length,c,this.encodeSize_ced6p5_k$(e-d|0));var f=this.isUrlSafe_1?Wq():Sq();d=d;var g=c,h=this.isMimeScheme_1?19:2147483647;while((d+2|0)<e){var i=(e-d|0)/3|0;i=Math.min(i,h);var j=0;if(j<i)do{j;j=j+1|0;var k=d;d=k+1|0;k=a[k]&255;var l=d;d=l+1|0;l=a[l]&255;var m=d;d=m+1|0;m=a[m]&255;k=k<<16|l<<8|m;l=g;g=l+1|0;b[l]=f[k>>>18|0];m=g;g=m+1|0;b[m]=f[(k>>>12|0)&63];l=g;g=l+1|0;b[l]=f[(k>>>6|0)&63];m=g;g=m+1|0;b[m]=f[k&63]}while(j<i);if(i===h&&!(d===e)){l=g;g=l+1|0;b[l]=pr().mimeLineSeparatorSymbols_1[0];m=g;g=m+1|0;b[m]=pr().mimeLineSeparatorSymbols_1[1]}}k=e-d|0;if(k===1){j=d;d=j+1|0;i=a[j]&255;l=i<<4;m=g;g=m+1|0;b[m]=f[l>>>6|0];h=g;g=h+1|0;b[h]=f[l&63];if(hr(this)){j=g;g=j+1|0;b[j]=61;i=g;g=i+1|0;b[i]=61}}else if(k===2){m=d;d=m+1|0;h=a[m]&255;l=d;d=l+1|0;j=a[l]&255;i=h<<10|j<<2;k=g;g=k+1|0;b[k]=f[i>>>12|0];m=g;g=m+1|0;b[m]=f[(i>>>6|0)&63];a=g;g=a+1|0;b[a]=f[i&63];if(hr(this)){l=g;g=l+1|0;b[l]=61}}if(!(d===e)){h="Check failed.";throw zk(x(h))}return g-c|0};z(U).encodeSize_ced6p5_k$=function(a){var b=a/3|0;a=a%3|0;b=g(b,4);a===0||(b=b+(hr(this)?4:a+1|0)|0);this.isMimeScheme_1&&(b=b+g((b-1|0)/76|0,2)|0);if(b<0)throw M("Input is too big");return b};z(U).decodeSize_c4ofgn_k$=function(a,b,c){var d=c-b|0;if(d===0)return 0;if(d===1)throw M("Input should have at least 2 symbols for Base64 decoding, startIndex: "+b+", endIndex: "+c);if(this.isMimeScheme_1){b=b;if(b<c)$l$loop:do{var e=b;b=b+1|0;var f=a[e]&255;f=Uq()[f];if(f<0){if(f===-2){d=d-(c-e|0)|0;break $l$loop}d=d-1|0}}while(b<c);}else a[c-1|0]===61&&(d=d-1|0,a[c-2|0]===61&&(d=d-1|0));return F(d).times_nfzjiw_k$(F(6)).div_jun7gj_k$(F(8)).toInt_1tsl84_k$()};z(U).charsToBytesImpl_z1u042_k$=function(a,b,c){this.checkSourceBounds_fk7x94_k$(hc(a),b,c);var d=new Int8Array(c-b|0),e=0;b=b;if(b<c)do{var f=b;b=b+1|0;f=fc(a,f);f=o(f);if(f<=255){var g=e;e=g+1|0;d[g]=bf(f)}else{g=e;e=g+1|0;d[g]=63}}while(b<c);return d};z(U).bytesToStringImpl_94yjtd_k$=function(a){var b=jm(a.length),c=0,d=a.length;while(c<d){var e=a[c];c=c+1|0;b.append_am5a4z_k$(gf(e))}return b.toString()};z(U).checkSourceBounds_fk7x94_k$=function(a,b,c){T().checkBoundsIndexes_tsopv1_k$(b,c,a)};var ur;function vr(){if(!ur){ur=!0;Tq=new Int8Array([65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47]);var a=new Int32Array(256);gg(a,-1);a[61]=-2;var b=0,c=Sq(),d=0,e=c.length;while(d<e){var f=c[d];d=d+1|0;var g=b;b=g+1|0;a[f]=g}Vq=a;Xq=new Int8Array([65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,45,95]);f=new Int32Array(256);gg(f,-1);f[61]=-2;g=0;b=Wq();c=0;d=b.length;while(c<d){e=b[c];c=c+1|0;a=g;g=a+1|0;f[e]=a}Zq=f}}function wr(){}z(wr).equals=function(a){if(!(a instanceof wr))return!1;a instanceof wr||A();return!0};z(wr).hashCode=function(){return 0};z(wr).toString=function(){return"@kotlin.io.encoding.ExperimentalEncodingApi()"};function xr(){yr=this,this.EMPTY_1=new Ar(1,0)}z(xr).get_EMPTY_i8q41w_k$=function(){return this.EMPTY_1};var yr;function zr(){yr==null&&new xr();return yr}function Ar(a,b){zr(),Pr.call(this,a,b,1)}z(Ar).get_start_iypx6h_k$=function(){return this.get_first_irdx8n_k$()};z(Ar).get_endInclusive_r07xpi_k$=function(){return this.get_last_wopotb_k$()};z(Ar).get_endExclusive_pmwm6k_k$=function(){if(this.get_last_wopotb_k$()===2147483647){var a="Cannot return the exclusive upper bound of a range that includes MAX_VALUE.";throw zk(x(a))}return this.get_last_wopotb_k$()+1|0};z(Ar).contains_7q95ev_k$=function(a){return this.get_first_irdx8n_k$()<=a&&a<=this.get_last_wopotb_k$()};z(Ar).contains_3tkdvy_k$=function(a){return this.contains_7q95ev_k$(typeof a==="number"?a:A())};z(Ar).isEmpty_y1axqb_k$=function(){return this.get_first_irdx8n_k$()>this.get_last_wopotb_k$()};z(Ar).equals=function(a){a instanceof Ar?a=this.isEmpty_y1axqb_k$()&&a.isEmpty_y1axqb_k$()||this.get_first_irdx8n_k$()===a.get_first_irdx8n_k$()&&this.get_last_wopotb_k$()===a.get_last_wopotb_k$():a=!1;return a};z(Ar).hashCode=function(){return this.isEmpty_y1axqb_k$()?-1:g(31,this.get_first_irdx8n_k$())+this.get_last_wopotb_k$()|0};z(Ar).toString=function(){return""+this.get_first_irdx8n_k$()+".."+this.get_last_wopotb_k$()};function Br(){Cr=this,this.EMPTY_1=new Er(new s(1,0),new s(0,0))}z(Br).get_EMPTY_i8q41w_k$=function(){return this.EMPTY_1};var Cr;function Dr(){Cr==null&&new Br();return Cr}function Er(a,b){Dr(),Tr.call(this,a,b,new s(1,0))}z(Er).get_start_iypx6h_k$=function(){return this.get_first_irdx8n_k$()};z(Er).get_endInclusive_r07xpi_k$=function(){return this.get_last_wopotb_k$()};z(Er).get_endExclusive_pmwm6k_k$=function(){if(this.get_last_wopotb_k$().equals(new s(-1,2147483647))){var a="Cannot return the exclusive upper bound of a range that includes MAX_VALUE.";throw zk(x(a))}return this.get_last_wopotb_k$().plus_r93sks_k$(F(1))};z(Er).contains_aa6tld_k$=function(a){return this.get_first_irdx8n_k$().compareTo_9jj042_k$(a)<=0&&a.compareTo_9jj042_k$(this.get_last_wopotb_k$())<=0};z(Er).contains_3tkdvy_k$=function(a){return this.contains_aa6tld_k$(a instanceof s?a:A())};z(Er).isEmpty_y1axqb_k$=function(){return this.get_first_irdx8n_k$().compareTo_9jj042_k$(this.get_last_wopotb_k$())>0};z(Er).equals=function(a){a instanceof Er?a=this.isEmpty_y1axqb_k$()&&a.isEmpty_y1axqb_k$()||this.get_first_irdx8n_k$().equals(a.get_first_irdx8n_k$())&&this.get_last_wopotb_k$().equals(a.get_last_wopotb_k$()):a=!1;return a};z(Er).hashCode=function(){return this.isEmpty_y1axqb_k$()?-1:ff(31).times_nfzjiw_k$(this.get_first_irdx8n_k$().xor_qzz94j_k$(this.get_first_irdx8n_k$().ushr_z7nmq8_k$(32))).plus_r93sks_k$(this.get_last_wopotb_k$().xor_qzz94j_k$(this.get_last_wopotb_k$().ushr_z7nmq8_k$(32))).toInt_1tsl84_k$()};z(Er).toString=function(){return this.get_first_irdx8n_k$().toString()+".."+this.get_last_wopotb_k$().toString()};function Fr(){Gr=this,this.EMPTY_1=new Ir(n(1),n(0))}z(Fr).get_EMPTY_i8q41w_k$=function(){return this.EMPTY_1};var Gr;function Hr(){Gr==null&&new Fr();return Gr}function Ir(a,b){Hr(),Xr.call(this,a,b,1)}z(Ir).get_start_qjli63_k$=function(){return this.get_first_enpj7t_k$()};z(Ir).get_start_iypx6h_k$=function(){return new Va(this.get_start_qjli63_k$())};z(Ir).get_endInclusive_onwxgk_k$=function(){return this.get_last_rplkv5_k$()};z(Ir).get_endInclusive_r07xpi_k$=function(){return new Va(this.get_endInclusive_onwxgk_k$())};z(Ir).get_endExclusive_umwd3i_k$=function(){if(this.get_last_rplkv5_k$()===n(65535)){var a="Cannot return the exclusive upper bound of a range that includes MAX_VALUE.";throw zk(x(a))}return Ma(this.get_last_rplkv5_k$(),1)};z(Ir).get_endExclusive_pmwm6k_k$=function(){return new Va(this.get_endExclusive_umwd3i_k$())};z(Ir).contains_q699wu_k$=function(a){return Ka(this.get_first_enpj7t_k$(),a)<=0&&Ka(a,this.get_last_rplkv5_k$())<=0};z(Ir).contains_3tkdvy_k$=function(a){return this.contains_q699wu_k$(a instanceof Va?a.value_1:A())};z(Ir).isEmpty_y1axqb_k$=function(){return Ka(this.get_first_enpj7t_k$(),this.get_last_rplkv5_k$())>0};z(Ir).equals=function(a){a instanceof Ir?a=this.isEmpty_y1axqb_k$()&&a.isEmpty_y1axqb_k$()||this.get_first_enpj7t_k$()===a.get_first_enpj7t_k$()&&this.get_last_rplkv5_k$()===a.get_last_rplkv5_k$():a=!1;return a};z(Ir).hashCode=function(){var a;if(this.isEmpty_y1axqb_k$())a=-1;else{var b=this.get_first_enpj7t_k$();b=o(b);b=g(31,b);var c=this.get_last_rplkv5_k$();a=b+o(c)|0}return a};z(Ir).toString=function(){return p(this.get_first_enpj7t_k$())+".."+p(this.get_last_rplkv5_k$())};function Jr(a,b,c){hp.call(this),this.step_1=c,this.finalElement_1=b,this.hasNext_1=this.step_1>0?a<=b:a>=b,this.next_1=this.hasNext_1?a:this.finalElement_1}z(Jr).get_step_woujh1_k$=function(){return this.step_1};z(Jr).hasNext_bitz1p_k$=function(){return this.hasNext_1};z(Jr).nextInt_ujorgc_k$=function(){var a=this.next_1;if(a===this.finalElement_1){if(!this.hasNext_1)throw dj();this.hasNext_1=!1}else this.next_1=this.next_1+this.step_1|0;return a};function Kr(a,b,c){jp.call(this),this.step_1=c,this.finalElement_1=b,this.hasNext_1=this.step_1.compareTo_9jj042_k$(new s(0,0))>0?a.compareTo_9jj042_k$(b)<=0:a.compareTo_9jj042_k$(b)>=0,this.next_1=this.hasNext_1?a:this.finalElement_1}z(Kr).get_step_woujh1_k$=function(){return this.step_1};z(Kr).hasNext_bitz1p_k$=function(){return this.hasNext_1};z(Kr).nextLong_njwv0v_k$=function(){var a=this.next_1;if(a.equals(this.finalElement_1)){if(!this.hasNext_1)throw dj();this.hasNext_1=!1}else this.next_1=this.next_1.plus_r93sks_k$(this.step_1);return a};function Lr(a,b,c){mp.call(this);this.step_1=c;c=this;c.finalElement_1=o(b);this.hasNext_1=this.step_1>0?Ka(a,b)<=0:Ka(a,b)>=0;c=this;this.hasNext_1?b=o(a):b=this.finalElement_1;c.next_1=b}z(Lr).get_step_woujh1_k$=function(){return this.step_1};z(Lr).hasNext_bitz1p_k$=function(){return this.hasNext_1};z(Lr).nextChar_yvnk6j_k$=function(){var a=this.next_1;if(a===this.finalElement_1){if(!this.hasNext_1)throw dj();this.hasNext_1=!1}else this.next_1=this.next_1+this.step_1|0;return gf(a)};function Mr(){Nr=this}z(Mr).fromClosedRange_y6bqsv_k$=function(a,b,c){return new Pr(a,b,c)};var Nr;function Or(){Nr==null&&new Mr();return Nr}function Pr(a,b,c){Or();if(c===0)throw M("Step must be non-zero.");if(c===-2147483648)throw M("Step must be greater than Int.MIN_VALUE to avoid overflow on negation.");this.first_1=a;this.last_1=Mq(a,b,c);this.step_1=c}z(Pr).get_first_irdx8n_k$=function(){return this.first_1};z(Pr).get_last_wopotb_k$=function(){return this.last_1};z(Pr).get_step_woujh1_k$=function(){return this.step_1};z(Pr).iterator_jk1svi_k$=function(){return new Jr(this.first_1,this.last_1,this.step_1)};z(Pr).isEmpty_y1axqb_k$=function(){return this.step_1>0?this.first_1>this.last_1:this.first_1<this.last_1};z(Pr).equals=function(a){a instanceof Pr?a=this.isEmpty_y1axqb_k$()&&a.isEmpty_y1axqb_k$()||this.first_1===a.first_1&&this.last_1===a.last_1&&this.step_1===a.step_1:a=!1;return a};z(Pr).hashCode=function(){return this.isEmpty_y1axqb_k$()?-1:g(31,g(31,this.first_1)+this.last_1|0)+this.step_1|0};z(Pr).toString=function(){return this.step_1>0?""+this.first_1+".."+this.last_1+" step "+this.step_1:""+this.first_1+" downTo "+this.last_1+" step "+(-this.step_1|0)};function Qr(){Rr=this}z(Qr).fromClosedRange_brhbh5_k$=function(a,b,c){return new Tr(a,b,c)};var Rr;function Sr(){Rr==null&&new Qr();return Rr}function Tr(a,b,c){Sr();if(c.equals(new s(0,0)))throw M("Step must be non-zero.");if(c.equals(new s(0,-2147483648)))throw M("Step must be greater than Long.MIN_VALUE to avoid overflow on negation.");this.first_1=a;this.last_1=Nq(a,b,c);this.step_1=c}z(Tr).get_first_irdx8n_k$=function(){return this.first_1};z(Tr).get_last_wopotb_k$=function(){return this.last_1};z(Tr).get_step_woujh1_k$=function(){return this.step_1};z(Tr).iterator_jk1svi_k$=function(){return new Kr(this.first_1,this.last_1,this.step_1)};z(Tr).isEmpty_y1axqb_k$=function(){return this.step_1.compareTo_9jj042_k$(new s(0,0))>0?this.first_1.compareTo_9jj042_k$(this.last_1)>0:this.first_1.compareTo_9jj042_k$(this.last_1)<0};z(Tr).equals=function(a){a instanceof Tr?a=this.isEmpty_y1axqb_k$()&&a.isEmpty_y1axqb_k$()||this.first_1.equals(a.first_1)&&this.last_1.equals(a.last_1)&&this.step_1.equals(a.step_1):a=!1;return a};z(Tr).hashCode=function(){return this.isEmpty_y1axqb_k$()?-1:ff(31).times_nfzjiw_k$(ff(31).times_nfzjiw_k$(this.first_1.xor_qzz94j_k$(this.first_1.ushr_z7nmq8_k$(32))).plus_r93sks_k$(this.last_1.xor_qzz94j_k$(this.last_1.ushr_z7nmq8_k$(32)))).plus_r93sks_k$(this.step_1.xor_qzz94j_k$(this.step_1.ushr_z7nmq8_k$(32))).toInt_1tsl84_k$()};z(Tr).toString=function(){return this.step_1.compareTo_9jj042_k$(new s(0,0))>0?this.first_1.toString()+".."+this.last_1.toString()+" step "+this.step_1.toString():this.first_1.toString()+" downTo "+this.last_1.toString()+" step "+this.step_1.unaryMinus_6uz0qp_k$().toString()};function Ur(){Vr=this}z(Ur).fromClosedRange_iu4wj5_k$=function(a,b,c){return new Xr(a,b,c)};var Vr;function Wr(){Vr==null&&new Ur();return Vr}function Xr(a,b,c){Wr();if(c===0)throw M("Step must be non-zero.");if(c===-2147483648)throw M("Step must be greater than Int.MIN_VALUE to avoid overflow on negation.");this.first_1=a;var d=this;a=o(a);b=o(b);d.last_1=gf(Mq(a,b,c));this.step_1=c}z(Xr).get_first_enpj7t_k$=function(){return this.first_1};z(Xr).get_last_rplkv5_k$=function(){return this.last_1};z(Xr).get_step_woujh1_k$=function(){return this.step_1};z(Xr).iterator_jk1svi_k$=function(){return new Lr(this.first_1,this.last_1,this.step_1)};z(Xr).isEmpty_y1axqb_k$=function(){return this.step_1>0?Ka(this.first_1,this.last_1)>0:Ka(this.first_1,this.last_1)<0};z(Xr).equals=function(a){a instanceof Xr?a=this.isEmpty_y1axqb_k$()&&a.isEmpty_y1axqb_k$()||this.first_1===a.first_1&&this.last_1===a.last_1&&this.step_1===a.step_1:a=!1;return a};z(Xr).hashCode=function(){var a;if(this.isEmpty_y1axqb_k$())a=-1;else{var b=this.first_1;b=o(b);b=g(31,b);var c=this.last_1;c=o(c);a=g(31,b+c|0)+this.step_1|0}return a};z(Xr).toString=function(){return this.step_1>0?p(this.first_1)+".."+p(this.last_1)+" step "+this.step_1:p(this.first_1)+" downTo "+p(this.last_1)+" step "+(-this.step_1|0)};function Eq(){}function Yr(){}function Zr(){}function $r(){}function as(){bs=this,this.star_1=new ds(null,null)}z(as).get_star_gix5tf_k$=function(){return this.star_1};z(as).get_STAR_wo9fa3_k$=function(){return this.star_1};z(as).invariant_a4yrrz_k$=function(a){return new ds(ms(),a)};z(as).contravariant_bkjggt_k$=function(a){return new ds(ns(),a)};z(as).covariant_daguew_k$=function(a){return new ds(os(),a)};var bs;function cs(){bs==null&&new as();return bs}function ds(a,b){cs();this.variance_1=a;this.type_1=b;if(!(this.variance_1==null===(this.type_1==null))){a=this.variance_1==null?"Star projection must have no type specified.":"The projection variance "+ub(this.variance_1)+" requires type to be specified.";throw M(x(a))}}z(ds).get_variance_ik7ku2_k$=function(){return this.variance_1};z(ds).get_type_wovaf7_k$=function(){return this.type_1};z(ds).toString=function(){var a=this.variance_1,b;switch(a==null?-1:a.get_ordinal_ip24qg_k$()){case-1:b="*";break;case 0:b=ub(this.type_1);break;case 1:b="in "+ub(this.type_1);break;case 2:b="out "+ub(this.type_1);break;default:fe();break}return b};z(ds).component1_7eebsc_k$=function(){return this.variance_1};z(ds).component2_7eebsb_k$=function(){return this.type_1};z(ds).copy_3t4q9q_k$=function(a,b){return new ds(a,b)};z(ds).copy$default_dyrb1k_k$=function(a,b,c){a=a===H?this.variance_1:a;b=b===H?this.type_1:b;return c===H?this.copy_3t4q9q_k$(a,b):c.copy_3t4q9q_k$.call(this,a,b)};z(ds).hashCode=function(){var a=this.variance_1==null?0:this.variance_1.hashCode();a=g(a,31)+(this.type_1==null?0:v(this.type_1))|0;return a};z(ds).equals=function(a){if(this===a)return!0;if(!(a instanceof ds))return!1;a=a instanceof ds?a:A();if(!u(this.variance_1,a.variance_1))return!1;return!u(this.type_1,a.type_1)?!1:!0};var es,fs,gs;function hs(){return[ms(),ns(),os()]}var is;function js(){if(is)return S();is=!0;es=new ls("INVARIANT",0);fs=new ls("IN",1);gs=new ls("OUT",2)}var ks;function ls(a,b){r.call(this,a,b)}function ms(){js();return es}function ns(){js();return fs}function os(){js();return gs}function ps(a,b,c){!(c==null)?a.append_jgojdo_k$(c(b)):(b==null?!0:Jf(b))?a.append_jgojdo_k$(b):b instanceof Va?a.append_am5a4z_k$(b.value_1):a.append_jgojdo_k$(ub(b))}var qs,rs,ss,ts;function hs(){if(!ts){ts=!0;var a=0,b=new Int32Array(256);while(a<256){var c=a,d=fc("0123456789abcdef",c>>4);d=o(d)<<8;var e=fc("0123456789abcdef",c&15);b[c]=d|o(e);a=a+1|0}hs=b;c=0;d=new Int32Array(256);while(c<256){e=c;a=fc("0123456789ABCDEF",e>>4);b=o(a)<<8;a=fc("0123456789ABCDEF",e&15);d[e]=b|o(a);c=c+1|0}qs=d;e=0;b=new Int32Array(256);while(e<256)b[e]=-1,e=e+1|0;a=0;c="0123456789abcdef";d=0;while(d<hc(c)){e=fc(c,d);d=d+1|0;var f=a;a=f+1|0;b[o(e)]=f}e=0;f="0123456789ABCDEF";a=0;while(a<hc(f)){c=fc(f,a);a=a+1|0;d=e;e=d+1|0;b[o(c)]=d}rs=b;c=0;d=Hb(256);while(c<256)d[c]=new s(-1,-1),c=c+1|0;e=0;f="0123456789abcdef";a=0;while(a<hc(f)){b=fc(f,a);a=a+1|0;c=e;e=c+1|0;d[o(b)]=F(c)}b=0;c="0123456789ABCDEF";e=0;while(e<hc(c)){f=fc(c,e);e=e+1|0;a=b;b=a+1|0;d[o(f)]=F(a)}ss=d}}function us(a){this.$this_iterator_1=a,mp.call(this),this.index_1=0}z(us).nextChar_yvnk6j_k$=function(){var a=this.index_1;this.index_1=a+1|0;return fc(this.$this_iterator_1,a)};z(us).hasNext_bitz1p_k$=function(){return this.index_1<hc(this.$this_iterator_1)};var vs;function ws(){if(!vs){vs=!0;Es();var a=gq();ws=xs(a)}}function xs(a){return a}function ys(a){return a}function zs(a){a=ys(a);return a instanceof Fs}function As(a){ys(a)instanceof Fs?a=ys(a).exception_1:a=null;return a}function Bs(a){var b;ys(a)instanceof Fs?b=x(ys(a)):b="Success("+ub(ys(a))+")";return b}function Cs(){Ds=this}z(Cs).success_e7oken_k$=function(a){return xs(a)};z(Cs).failure_vz4kdm_k$=function(a){return xs(Js(a))};var Ds;function Es(){Ds==null&&new Cs();return Ds}function Fs(a){this.exception_1=a}z(Fs).get_exception_x0n6w6_k$=function(){return this.exception_1};z(Fs).equals=function(a){a instanceof Fs?a=u(this.exception_1,a.exception_1):a=!1;return a};z(Fs).hashCode=function(){return v(this.exception_1)};z(Fs).toString=function(){return"Failure("+this.exception_1.toString()+")"};function Gs(a){return a==null?0:v(a)}function Hs(a,b){if(!(b instanceof Is))return!1;b=b instanceof Is?b.value_1:A();return!u(a,b)?!1:!0}function Is(a){Es(),this.value_1=a}z(Is).toString=function(){return Bs(this.value_1)};z(Is).hashCode=function(){return Gs(this.value_1)};z(Is).equals=function(a){return Hs(this.value_1,a)};function Js(a){return new Fs(a)}function Ks(a){var b=ys(a);if(b instanceof Fs)throw ys(a).exception_1}function Ls(a){a=a===H?"An operation is not implemented.":a,bk(a,this),y(this,Ls)}function Ms(a){return a}function Ns(a){return a}function Os(){Ps=this,this.MIN_VALUE_1=Ms(0),this.MAX_VALUE_1=Ms(-1),this.SIZE_BYTES_1=1,this.SIZE_BITS_1=8}z(Os).get_MIN_VALUE_phf8xi_k$=function(){return this.MIN_VALUE_1};z(Os).get_MAX_VALUE_53rlic_k$=function(){return this.MAX_VALUE_1};z(Os).get_SIZE_BYTES_qphg4q_k$=function(){return this.SIZE_BYTES_1};z(Os).get_SIZE_BITS_7qhjj9_k$=function(){return this.SIZE_BITS_1};var Ps;function Qs(){Ps==null&&new Os();return Ps}function Rs(a,b){a=Ns(a)&255;b=Ns(b)&255;return Kd(a,b)}function Ss(a,b){return Rs(a.data_1,b instanceof Ws?b.data_1:A())}function Ts(a){return(Ns(a)&255).toString()}function Us(a){return a}function Vs(a,b){if(!(b instanceof Ws))return!1;return!(a===(b instanceof Ws?b.data_1:A()))?!1:!0}function Ws(a){Qs(),this.data_1=a}z(Ws).compareTo_ubn76t_k$=function(a){return Rs(this.data_1,a)};z(Ws).compareTo_hpufkf_k$=function(a){return Ss(this,a)};z(Ws).toString=function(){return Ts(this.data_1)};z(Ws).hashCode=function(){return Us(this.data_1)};z(Ws).equals=function(a){return Vs(this.data_1,a)};function Xs(a){return a}function Ys(a){return a}function Zs(a){return Ys(a).length}function $s(a){return new at(Ys(a))}function at(a){this.array_1=a,this.index_1=0}z(at).hasNext_bitz1p_k$=function(){return this.index_1<this.array_1.length};z(at).next_mib1ya_k$=function(){if(this.index_1<this.array_1.length){var a=this.index_1;this.index_1=a+1|0;a=this.array_1[a];a=Ms(a)}else throw fj(this.index_1.toString());return a};z(at).next_20eer_k$=function(){return new Ws(this.next_mib1ya_k$())};function bt(a,b){var c=new Ws(b)==null?A():new Ws(b);if(!(c instanceof Ws))return!1;c=Ys(a);a=Ns(b);return ba(c,a)}function ct(a,b){return!(b instanceof Ws)?!1:bt(a.storage_1,b instanceof Ws?b.data_1:A())}function dt(a,b){$l$block_0:{b=G(b,q)?b:A();var c;G(b,q)?c=b.isEmpty_y1axqb_k$():c=!1;if(c){c=!0;break $l$block_0}b=b.iterator_jk1svi_k$();while(b.hasNext_bitz1p_k$()){var d=b.next_20eer_k$();if(d instanceof Ws){var e=Ys(a);d=d.data_1;d=Ns(d);e=ba(e,d)}else e=!1;if(!e){c=!1;break $l$block_0}}c=!0}return c}function et(a,b){return dt(a.storage_1,b)}function ft(a){return Ys(a).length===0}function gt(a){return"UByteArray(storage="+x(a)+")"}function ht(a){return v(a)}function it(a,b){if(!(b instanceof jt))return!1;b=b instanceof jt?b.storage_1:A();return!u(a,b)?!1:!0}function jt(a){this.storage_1=a}z(jt).get_size_woubt6_k$=function(){return Zs(this.storage_1)};z(jt).iterator_jk1svi_k$=function(){return $s(this.storage_1)};z(jt).contains_h1c0bq_k$=function(a){return bt(this.storage_1,a)};z(jt).contains_aljjnj_k$=function(a){return ct(this,a)};z(jt).containsAll_fivw2r_k$=function(a){return dt(this.storage_1,a)};z(jt).containsAll_xk45sd_k$=function(a){return et(this,a)};z(jt).isEmpty_y1axqb_k$=function(){return ft(this.storage_1)};z(jt).toString=function(){return gt(this.storage_1)};z(jt).hashCode=function(){return ht(this.storage_1)};z(jt).equals=function(a){return it(this.storage_1,a)};function V(a){return a}function W(a){return a}function kt(){lt=this,this.MIN_VALUE_1=V(0),this.MAX_VALUE_1=V(-1),this.SIZE_BYTES_1=4,this.SIZE_BITS_1=32}z(kt).get_MIN_VALUE_9zjqdd_k$=function(){return this.MIN_VALUE_1};z(kt).get_MAX_VALUE_bmdakz_k$=function(){return this.MAX_VALUE_1};z(kt).get_SIZE_BYTES_qphg4q_k$=function(){return this.SIZE_BYTES_1};z(kt).get_SIZE_BITS_7qhjj9_k$=function(){return this.SIZE_BITS_1};var lt;function mt(){lt==null&&new kt();return lt}function nt(a,b){return sg(W(a),W(b))}function ot(a,b){return nt(a.data_1,b instanceof X?b.data_1:A())}function pt(a){a=W(a);return F(a).and_4spn93_k$(new s(-1,0)).toString()}function qt(a){return a}function rt(a,b){if(!(b instanceof X))return!1;return!(a===(b instanceof X?b.data_1:A()))?!1:!0}function X(a){mt(),this.data_1=a}z(X).compareTo_xshxy3_k$=function(a){return nt(this.data_1,a)};z(X).compareTo_hpufkf_k$=function(a){return ot(this,a)};z(X).toString=function(){return pt(this.data_1)};z(X).hashCode=function(){return qt(this.data_1)};z(X).equals=function(a){return rt(this.data_1,a)};function Xs(a){return a}function st(a){return a}function tt(a){return st(a).length}function ut(a){return new vt(st(a))}function vt(a){this.array_1=a,this.index_1=0}z(vt).hasNext_bitz1p_k$=function(){return this.index_1<this.array_1.length};z(vt).next_30mexz_k$=function(){if(this.index_1<this.array_1.length){var a=this.index_1;this.index_1=a+1|0;a=this.array_1[a];a=V(a)}else throw fj(this.index_1.toString());return a};z(vt).next_20eer_k$=function(){return new X(this.next_30mexz_k$())};function wt(a,b){var c=new X(b)==null?A():new X(b);if(!(c instanceof X))return!1;c=st(a);a=W(b);return ca(c,a)}function xt(a,b){return!(b instanceof X)?!1:wt(a.storage_1,b instanceof X?b.data_1:A())}function yt(a,b){$l$block_0:{b=G(b,q)?b:A();var c;G(b,q)?c=b.isEmpty_y1axqb_k$():c=!1;if(c){c=!0;break $l$block_0}b=b.iterator_jk1svi_k$();while(b.hasNext_bitz1p_k$()){var d=b.next_20eer_k$();if(d instanceof X){var e=st(a);d=d.data_1;d=W(d);e=ca(e,d)}else e=!1;if(!e){c=!1;break $l$block_0}}c=!0}return c}function zt(a,b){return yt(a.storage_1,b)}function At(a){return st(a).length===0}function Bt(a){return"UIntArray(storage="+x(a)+")"}function Ct(a){return v(a)}function Dt(a,b){if(!(b instanceof Et))return!1;b=b instanceof Et?b.storage_1:A();return!u(a,b)?!1:!0}function Et(a){this.storage_1=a}z(Et).get_size_woubt6_k$=function(){return tt(this.storage_1)};z(Et).iterator_jk1svi_k$=function(){return ut(this.storage_1)};z(Et).contains_of2a8q_k$=function(a){return wt(this.storage_1,a)};z(Et).contains_aljjnj_k$=function(a){return xt(this,a)};z(Et).containsAll_tt2ity_k$=function(a){return yt(this.storage_1,a)};z(Et).containsAll_xk45sd_k$=function(a){return zt(this,a)};z(Et).isEmpty_y1axqb_k$=function(){return At(this.storage_1)};z(Et).toString=function(){return Bt(this.storage_1)};z(Et).hashCode=function(){return Ct(this.storage_1)};z(Et).equals=function(a){return Dt(this.storage_1,a)};function Ft(){Gt=this,this.EMPTY_1=new It(V(-1),V(0))}z(Ft).get_EMPTY_i8q41w_k$=function(){return this.EMPTY_1};var Gt;function Ht(){Gt==null&&new Ft();return Gt}function It(a,b){Ht(),Mt.call(this,a,b,1)}z(It).get_start_qjwd9b_k$=function(){return this.first_1};z(It).get_start_iypx6h_k$=function(){return new X(this.get_start_qjwd9b_k$())};z(It).get_endInclusive_onm2dc_k$=function(){return this.last_1};z(It).get_endInclusive_r07xpi_k$=function(){return new X(this.get_endInclusive_onm2dc_k$())};z(It).get_endExclusive_un786q_k$=function(){if(this.last_1===V(-1)){var a="Cannot return the exclusive upper bound of a range that includes MAX_VALUE.";throw zk(x(a))}a=this.last_1;var b=V(1);return V(W(a)+W(b)|0)};z(It).get_endExclusive_pmwm6k_k$=function(){return new X(this.get_endExclusive_un786q_k$())};z(It).contains_of2a8q_k$=function(a){var b=this.first_1;if(sg(W(b),W(a))<=0){b=this.last_1;a=sg(W(a),W(b))<=0}else a=!1;return a};z(It).contains_3tkdvy_k$=function(a){return this.contains_of2a8q_k$(a instanceof X?a.data_1:A())};z(It).isEmpty_y1axqb_k$=function(){var a=this.first_1,b=this.last_1;return sg(W(a),W(b))>0};z(It).equals=function(a){a instanceof It?a=this.isEmpty_y1axqb_k$()&&a.isEmpty_y1axqb_k$()||this.first_1===a.first_1&&this.last_1===a.last_1:a=!1;return a};z(It).hashCode=function(){var a;if(this.isEmpty_y1axqb_k$())a=-1;else{var b=this.first_1;b=W(b);b=g(31,b);var c=this.last_1;a=b+W(c)|0}return a};z(It).toString=function(){return""+new X(this.first_1)+".."+new X(this.last_1)};function Jt(){Kt=this}z(Jt).fromClosedRange_cp9k1d_k$=function(a,b,c){return new Mt(a,b,c)};var Kt;function Lt(){Kt==null&&new Jt();return Kt}function Mt(a,b,c){Lt();if(c===0)throw M("Step must be non-zero.");if(c===-2147483648)throw M("Step must be greater than Int.MIN_VALUE to avoid overflow on negation.");this.first_1=a;this.last_1=ru(a,b,c);this.step_1=c}z(Mt).get_first_eo0eb1_k$=function(){return this.first_1};z(Mt).get_last_rpwfyd_k$=function(){return this.last_1};z(Mt).get_step_woujh1_k$=function(){return this.step_1};z(Mt).iterator_jk1svi_k$=function(){return new Nt(this.first_1,this.last_1,this.step_1)};z(Mt).isEmpty_y1axqb_k$=function(){if(this.step_1>0){var a=this.first_1,b=this.last_1;a=sg(W(a),W(b))>0}else{b=this.first_1;var c=this.last_1;a=sg(W(b),W(c))<0}return a};z(Mt).equals=function(a){a instanceof Mt?a=this.isEmpty_y1axqb_k$()&&a.isEmpty_y1axqb_k$()||this.first_1===a.first_1&&this.last_1===a.last_1&&this.step_1===a.step_1:a=!1;return a};z(Mt).hashCode=function(){var a;if(this.isEmpty_y1axqb_k$())a=-1;else{var b=this.first_1;b=W(b);b=g(31,b);var c=this.last_1;c=W(c);a=g(31,b+c|0)+this.step_1|0}return a};z(Mt).toString=function(){return this.step_1>0?""+new X(this.first_1)+".."+new X(this.last_1)+" step "+this.step_1:""+new X(this.first_1)+" downTo "+new X(this.last_1)+" step "+(-this.step_1|0)};function Nt(a,b,c){this.finalElement_1=b;var d=this,e;c>0?e=sg(W(a),W(b))<=0:e=sg(W(a),W(b))>=0;d.hasNext_1=e;b=this;b.step_1=V(c);this.next_1=this.hasNext_1?a:this.finalElement_1}z(Nt).hasNext_bitz1p_k$=function(){return this.hasNext_1};z(Nt).next_30mexz_k$=function(){var a=this.next_1;if(a===this.finalElement_1){if(!this.hasNext_1)throw dj();this.hasNext_1=!1}else{var b=this,c=this.next_1,d=this.step_1;b.next_1=V(W(c)+W(d)|0)}return a};z(Nt).next_20eer_k$=function(){return new X(this.next_30mexz_k$())};function Y(a){return a}function Z(a){return a}function Ot(){Pt=this,this.MIN_VALUE_1=Y(new s(0,0)),this.MAX_VALUE_1=Y(new s(-1,-1)),this.SIZE_BYTES_1=8,this.SIZE_BITS_1=64}z(Ot).get_MIN_VALUE_phlf8q_k$=function(){return this.MIN_VALUE_1};z(Ot).get_MAX_VALUE_53xrtk_k$=function(){return this.MAX_VALUE_1};z(Ot).get_SIZE_BYTES_qphg4q_k$=function(){return this.SIZE_BYTES_1};z(Ot).get_SIZE_BITS_7qhjj9_k$=function(){return this.SIZE_BITS_1};var Pt;function Qt(){Pt==null&&new Ot();return Pt}function Rt(a,b){return ug(Z(a),Z(b))}function St(a,b){return Rt(a.data_1,b instanceof $?b.data_1:A())}function Tt(a){a=Z(a);return xg(a,10)}function Ut(a){return a.hashCode()}function Vt(a,b){if(!(b instanceof $))return!1;b=b instanceof $?b.data_1:A();return!a.equals(b)?!1:!0}function $(a){Qt(),this.data_1=a}z($).compareTo_zaxduj_k$=function(a){return Rt(this.data_1,a)};z($).compareTo_hpufkf_k$=function(a){return St(this,a)};z($).toString=function(){return Tt(this.data_1)};z($).hashCode=function(){return Ut(this.data_1)};z($).equals=function(a){return Vt(this.data_1,a)};function Xs(a){return a}function Wt(a){return a}function Xt(a){return Wt(a).length}function Yt(a){return new Zt(Wt(a))}function Zt(a){this.array_1=a,this.index_1=0}z(Zt).hasNext_bitz1p_k$=function(){return this.index_1<this.array_1.length};z(Zt).next_mi4vn2_k$=function(){if(this.index_1<this.array_1.length){var a=this.index_1;this.index_1=a+1|0;a=this.array_1[a];a=Y(a)}else throw fj(this.index_1.toString());return a};z(Zt).next_20eer_k$=function(){return new $(this.next_mi4vn2_k$())};function $t(a,b){var c=new $(b)==null?A():new $(b);if(!(c instanceof $))return!1;c=Wt(a);a=Z(b);return fa(c,a)}function au(a,b){return!(b instanceof $)?!1:$t(a.storage_1,b instanceof $?b.data_1:A())}function bu(a,b){$l$block_0:{b=G(b,q)?b:A();var c;G(b,q)?c=b.isEmpty_y1axqb_k$():c=!1;if(c){c=!0;break $l$block_0}b=b.iterator_jk1svi_k$();while(b.hasNext_bitz1p_k$()){var d=b.next_20eer_k$();if(d instanceof $){var e=Wt(a);d=d.data_1;d=Z(d);e=fa(e,d)}else e=!1;if(!e){c=!1;break $l$block_0}}c=!0}return c}function cu(a,b){return bu(a.storage_1,b)}function du(a){return Wt(a).length===0}function eu(a){return"ULongArray(storage="+x(a)+")"}function fu(a){return v(a)}function gu(a,b){if(!(b instanceof hu))return!1;b=b instanceof hu?b.storage_1:A();return!u(a,b)?!1:!0}function hu(a){this.storage_1=a}z(hu).get_size_woubt6_k$=function(){return Xt(this.storage_1)};z(hu).iterator_jk1svi_k$=function(){return Yt(this.storage_1)};z(hu).contains_mfvh9i_k$=function(a){return $t(this.storage_1,a)};z(hu).contains_aljjnj_k$=function(a){return au(this,a)};z(hu).containsAll_ks3xcn_k$=function(a){return bu(this.storage_1,a)};z(hu).containsAll_xk45sd_k$=function(a){return cu(this,a)};z(hu).isEmpty_y1axqb_k$=function(){return du(this.storage_1)};z(hu).toString=function(){return eu(this.storage_1)};z(hu).hashCode=function(){return fu(this.storage_1)};z(hu).equals=function(a){return gu(this.storage_1,a)};function iu(){ju=this,this.EMPTY_1=new lu(Y(new s(-1,-1)),Y(new s(0,0)))}z(iu).get_EMPTY_i8q41w_k$=function(){return this.EMPTY_1};var ju;function ku(){ju==null&&new iu();return ju}function lu(a,b){ku(),pu.call(this,a,b,new s(1,0))}z(lu).get_start_t8fb1w_k$=function(){return this.first_1};z(lu).get_start_iypx6h_k$=function(){return new $(this.get_start_t8fb1w_k$())};z(lu).get_endInclusive_h0ahvv_k$=function(){return this.last_1};z(lu).get_endInclusive_r07xpi_k$=function(){return new $(this.get_endInclusive_h0ahvv_k$())};z(lu).get_endExclusive_qkt9qx_k$=function(){if(u(this.last_1,Y(new s(-1,-1)))){var a="Cannot return the exclusive upper bound of a range that includes MAX_VALUE.";throw zk(x(a))}a=this.last_1;var b=V(1);b=W(b);b=F(b).and_4spn93_k$(new s(-1,0));b=Y(b);return Y(Z(a).plus_r93sks_k$(Z(b)))};z(lu).get_endExclusive_pmwm6k_k$=function(){return new $(this.get_endExclusive_qkt9qx_k$())};z(lu).contains_mfvh9i_k$=function(a){var b=this.first_1;if(ug(Z(b),Z(a))<=0){b=this.last_1;a=ug(Z(a),Z(b))<=0}else a=!1;return a};z(lu).contains_3tkdvy_k$=function(a){return this.contains_mfvh9i_k$(a instanceof $?a.data_1:A())};z(lu).isEmpty_y1axqb_k$=function(){var a=this.first_1,b=this.last_1;return ug(Z(a),Z(b))>0};z(lu).equals=function(a){a instanceof lu?a=this.isEmpty_y1axqb_k$()&&a.isEmpty_y1axqb_k$()||u(this.first_1,a.first_1)&&u(this.last_1,a.last_1):a=!1;return a};z(lu).hashCode=function(){var a;if(this.isEmpty_y1axqb_k$())a=-1;else{var b=this.first_1,c=this.first_1;c=Y(Z(c).ushr_z7nmq8_k$(32));b=Y(Z(b).xor_qzz94j_k$(Z(c)));c=Z(b).toInt_1tsl84_k$();b=g(31,c);c=this.last_1;var d=this.last_1;d=Y(Z(d).ushr_z7nmq8_k$(32));c=Y(Z(c).xor_qzz94j_k$(Z(d)));a=b+Z(c).toInt_1tsl84_k$()|0}return a};z(lu).toString=function(){return""+new $(this.first_1)+".."+new $(this.last_1)};function mu(){nu=this}z(mu).fromClosedRange_e578op_k$=function(a,b,c){return new pu(a,b,c)};var nu;function ou(){nu==null&&new mu();return nu}function pu(a,b,c){ou();if(c.equals(new s(0,0)))throw M("Step must be non-zero.");if(c.equals(new s(0,-2147483648)))throw M("Step must be greater than Long.MIN_VALUE to avoid overflow on negation.");this.first_1=a;this.last_1=su(a,b,c);this.step_1=c}z(pu).get_first_shpxa6_k$=function(){return this.first_1};z(pu).get_last_6xn0iu_k$=function(){return this.last_1};z(pu).get_step_woujh1_k$=function(){return this.step_1};z(pu).iterator_jk1svi_k$=function(){return new qu(this.first_1,this.last_1,this.step_1)};z(pu).isEmpty_y1axqb_k$=function(){if(this.step_1.compareTo_9jj042_k$(new s(0,0))>0){var a=this.first_1,b=this.last_1;a=ug(Z(a),Z(b))>0}else{b=this.first_1;var c=this.last_1;a=ug(Z(b),Z(c))<0}return a};z(pu).equals=function(a){a instanceof pu?a=this.isEmpty_y1axqb_k$()&&a.isEmpty_y1axqb_k$()||u(this.first_1,a.first_1)&&u(this.last_1,a.last_1)&&this.step_1.equals(a.step_1):a=!1;return a};z(pu).hashCode=function(){var a;if(this.isEmpty_y1axqb_k$())a=-1;else{var b=this.first_1,c=this.first_1;c=Y(Z(c).ushr_z7nmq8_k$(32));b=Y(Z(b).xor_qzz94j_k$(Z(c)));c=Z(b).toInt_1tsl84_k$();b=g(31,c);c=this.last_1;var d=this.last_1;d=Y(Z(d).ushr_z7nmq8_k$(32));c=Y(Z(c).xor_qzz94j_k$(Z(d)));d=Z(c).toInt_1tsl84_k$();a=g(31,b+d|0)+this.step_1.xor_qzz94j_k$(this.step_1.ushr_z7nmq8_k$(32)).toInt_1tsl84_k$()|0}return a};z(pu).toString=function(){return this.step_1.compareTo_9jj042_k$(new s(0,0))>0?""+new $(this.first_1)+".."+new $(this.last_1)+" step "+this.step_1.toString():""+new $(this.first_1)+" downTo "+new $(this.last_1)+" step "+this.step_1.unaryMinus_6uz0qp_k$().toString()};function qu(a,b,c){this.finalElement_1=b;var d=this,e;c.compareTo_9jj042_k$(new s(0,0))>0?e=ug(Z(a),Z(b))<=0:e=ug(Z(a),Z(b))>=0;d.hasNext_1=e;b=this;b.step_1=Y(c);this.next_1=this.hasNext_1?a:this.finalElement_1}z(qu).hasNext_bitz1p_k$=function(){return this.hasNext_1};z(qu).next_mi4vn2_k$=function(){var a=this.next_1;if(u(a,this.finalElement_1)){if(!this.hasNext_1)throw dj();this.hasNext_1=!1}else{var b=this,c=this.next_1,d=this.step_1;b.next_1=Y(Z(c).plus_r93sks_k$(Z(d)))}return a};z(qu).next_20eer_k$=function(){return new $(this.next_mi4vn2_k$())};function ru(a,b,c){if(c>0){var d;if(sg(W(a),W(b))>=0)d=b;else{var e=V(c);e=tu(b,a,e);d=V(W(b)-W(e)|0)}e=d}else if(c<0){if(sg(W(a),W(b))<=0)d=b;else{c=-c|0;c=V(c);a=tu(a,b,c);d=V(W(b)+W(a)|0)}e=d}else throw M("Step is zero.");return e}function su(a,b,c){if(c.compareTo_9jj042_k$(new s(0,0))>0){var d;if(ug(Z(a),Z(b))>=0)d=b;else{var e=Y(c);e=uu(b,a,e);d=Y(Z(b).minus_mfbszm_k$(Z(e)))}e=d}else if(c.compareTo_9jj042_k$(new s(0,0))<0){if(ug(Z(a),Z(b))<=0)d=b;else{c=c.unaryMinus_6uz0qp_k$();c=Y(c);a=uu(a,b,c);d=Y(Z(b).plus_r93sks_k$(Z(a)))}e=d}else throw M("Step is zero.");return e}function tu(a,b,c){a=tg(a,c);b=tg(b,c);var d;if(sg(W(a),W(b))>=0)d=V(W(a)-W(b)|0);else{a=V(W(a)-W(b)|0);d=V(W(a)+W(c)|0)}return d}function uu(a,b,c){a=vg(a,c);b=vg(b,c);var d;if(ug(Z(a),Z(b))>=0)d=Y(Z(a).minus_mfbszm_k$(Z(b)));else{a=Y(Z(a).minus_mfbszm_k$(Z(b)));d=Y(Z(a).plus_r93sks_k$(Z(c)))}return d}function vu(a){return a}function wu(a){return a}function xu(){yu=this,this.MIN_VALUE_1=vu(0),this.MAX_VALUE_1=vu(-1),this.SIZE_BYTES_1=2,this.SIZE_BITS_1=16}z(xu).get_MIN_VALUE_8wxn4e_k$=function(){return this.MIN_VALUE_1};z(xu).get_MAX_VALUE_gfkyu8_k$=function(){return this.MAX_VALUE_1};z(xu).get_SIZE_BYTES_qphg4q_k$=function(){return this.SIZE_BYTES_1};z(xu).get_SIZE_BITS_7qhjj9_k$=function(){return this.SIZE_BITS_1};var yu;function zu(){yu==null&&new xu();return yu}function Au(a,b){a=wu(a)&65535;b=wu(b)&65535;return Kd(a,b)}function Bu(a,b){return Au(a.data_1,b instanceof Fu?b.data_1:A())}function Cu(a){return(wu(a)&65535).toString()}function Du(a){return a}function Eu(a,b){if(!(b instanceof Fu))return!1;return!(a===(b instanceof Fu?b.data_1:A()))?!1:!0}function Fu(a){zu(),this.data_1=a}z(Fu).compareTo_k5z7qt_k$=function(a){return Au(this.data_1,a)};z(Fu).compareTo_hpufkf_k$=function(a){return Bu(this,a)};z(Fu).toString=function(){return Cu(this.data_1)};z(Fu).hashCode=function(){return Du(this.data_1)};z(Fu).equals=function(a){return Eu(this.data_1,a)};function Xs(a){return a}function Gu(a){return a}function Hu(a){return Gu(a).length}function Iu(a){return new Ju(Gu(a))}function Ju(a){this.array_1=a,this.index_1=0}z(Ju).hasNext_bitz1p_k$=function(){return this.index_1<this.array_1.length};z(Ju).next_csnf8m_k$=function(){if(this.index_1<this.array_1.length){var a=this.index_1;this.index_1=a+1|0;a=this.array_1[a];a=vu(a)}else throw fj(this.index_1.toString());return a};z(Ju).next_20eer_k$=function(){return new Fu(this.next_csnf8m_k$())};function Ku(a,b){var c=new Fu(b)==null?A():new Fu(b);if(!(c instanceof Fu))return!1;c=Gu(a);a=wu(b);return ea(c,a)}function Lu(a,b){return!(b instanceof Fu)?!1:Ku(a.storage_1,b instanceof Fu?b.data_1:A())}function Mu(a,b){$l$block_0:{b=G(b,q)?b:A();var c;G(b,q)?c=b.isEmpty_y1axqb_k$():c=!1;if(c){c=!0;break $l$block_0}b=b.iterator_jk1svi_k$();while(b.hasNext_bitz1p_k$()){var d=b.next_20eer_k$();if(d instanceof Fu){var e=Gu(a);d=d.data_1;d=wu(d);e=ea(e,d)}else e=!1;if(!e){c=!1;break $l$block_0}}c=!0}return c}function Nu(a,b){return Mu(a.storage_1,b)}function Ou(a){return Gu(a).length===0}function Pu(a){return"UShortArray(storage="+x(a)+")"}function Qu(a){return v(a)}function Ru(a,b){if(!(b instanceof Su))return!1;b=b instanceof Su?b.storage_1:A();return!u(a,b)?!1:!0}function Su(a){this.storage_1=a}z(Su).get_size_woubt6_k$=function(){return Hu(this.storage_1)};z(Su).iterator_jk1svi_k$=function(){return Iu(this.storage_1)};z(Su).contains_2ufjxw_k$=function(a){return Ku(this.storage_1,a)};z(Su).contains_aljjnj_k$=function(a){return Lu(this,a)};z(Su).containsAll_e9sgm5_k$=function(a){return Mu(this.storage_1,a)};z(Su).containsAll_xk45sd_k$=function(a){return Nu(this,a)};z(Su).isEmpty_y1axqb_k$=function(){return Ou(this.storage_1)};z(Su).toString=function(){return Pu(this.storage_1)};z(Su).hashCode=function(){return Qu(this.storage_1)};z(Su).equals=function(a){return Ru(this.storage_1,a)};function Tu(){}z(Tu).equals=function(a){if(!(a instanceof Tu))return!1;a instanceof Tu||A();return!0};z(Tu).hashCode=function(){return 0};z(Tu).toString=function(){return"@kotlin.ExperimentalUnsignedTypes()"};z(I).asJsArrayView_ialsn1_k$=b;z(I).asJsReadonlyArrayView_ch6hjz_k$=a;z(Oo).asJsReadonlyMapView_6h4p3w_k$=e;z(Tg).asJsMapView_ii14sm_k$=j;z(Ug).asJsSetView_xjflv8_k$=d;z(Ug).asJsReadonlySetView=c;z(K).containsAllEntries_5fw0no_k$=k;z(Do).asJsReadonlyArrayView_ch6hjz_k$=a;z(So).asJsReadonlySetView=c;z(Yo).asJsReadonlyArrayView_ch6hjz_k$=a;z(eq).plus_s13ygv_k$=l;Xs="kotlinHashCodeValue$";Db=4294967296;rf=4294967296;tf=9223372036854776e3;vf="class";Zf="interface";$f="object";ag=null;bg=3;cg="0123456789abcdef";dg="0123456789ABCDEF";f.primitiveArrayConcatwxgknw08pmlb=$e;f.VOID7hggqo3abtya=H;f.Exception_init_$Init$25rnrjp6anyxk=hj;f.Unit_getInstance2zv6dminn5awl=S;f.contentEquals1cdp6c846cfdi=ig;f.copyOfRange3alro60z4hhf8=hg;f.enumEntries20mr21zbe3az4=rq;f.captureStack1fzi4aczwc4hg=y;f.defineProp3hxgpk2knu2px=Rd;f.initMetadataForClassbxx6q50dy2s7=C;f.initMetadataForCompanion1wyw17z38v6ac=E;f.initMetadataForInterface1egvbzx539z91=D;f.protoOf180f3jzyo7rfj=z;f.toByte4i43936u611k=bf;f.toLongw1zpgk99d84b=F;f.encodeToByteArray1onwao0uakjfh=km;f.Enum3alwj03lh1n41=r;f.Exceptiondt2hlxn7j7vw=pj;f.Long2qws0ah9gnpki=s;f.THROW_IAE23kobfj9wdoxr=ae}),66); __d("syncd-crypto",["kotlin-kotlin-stdlib"],(function(a,b,c,d,e,f,g){var h;(h=d("kotlin-kotlin-stdlib")).initMetadataForClassbxx6q50dy2s7(a,"KmpDerivedSyncdKeys");h.initMetadataForInterface1egvbzx539z91(b,"KmpDerivedSyncdKeysProvider");h.initMetadataForInterface1egvbzx539z91(c,"KmpSyncActionData");h.initMetadataForInterface1egvbzx539z91(e,"KmpSyncActionValue");h.initMetadataForClassbxx6q50dy2s7(j,"KmpSyncEncryptionData");h.initMetadataForInterface1egvbzx539z91(f,"KmpSyncMutationData");h.initMetadataForInterface1egvbzx539z91(k,"KmpSyncMutationDataFactory");h.initMetadataForClassbxx6q50dy2s7(l,"KmpSyncdCipherException",l,h.Exceptiondt2hlxn7j7vw);h.initMetadataForInterface1egvbzx539z91(m,"KmpSyncdCryptoProvider");h.initMetadataForClassbxx6q50dy2s7(t,"OpMode",h.VOID7hggqo3abtya,h.Enum3alwj03lh1n41);h.initMetadataForClassbxx6q50dy2s7(A,"MacAlgo",h.VOID7hggqo3abtya,h.Enum3alwj03lh1n41);h.initMetadataForCompanion1wyw17z38v6ac(H);h.initMetadataForClassbxx6q50dy2s7(L,"KmpSyncdEncryptionManager");h.initMetadataForClassbxx6q50dy2s7(M,"KmpSyncdKey");h.initMetadataForClassbxx6q50dy2s7(N,"KmpSyncdKeyException",h.VOID7hggqo3abtya,h.Exceptiondt2hlxn7j7vw);h.initMetadataForClassbxx6q50dy2s7(O,"KmpSyncdKeyFingerprint");h.initMetadataForClassbxx6q50dy2s7(P,"KmpSyncdKeyId");h.initMetadataForClassbxx6q50dy2s7(Q,"KmpSyncdMutationException",h.VOID7hggqo3abtya,h.Exceptiondt2hlxn7j7vw);h.initMetadataForClassbxx6q50dy2s7(V,"KmpSyncdOperation",h.VOID7hggqo3abtya,h.Enum3alwj03lh1n41);h.initMetadataForClassbxx6q50dy2s7(Y,"KmpSyncdParseException",h.VOID7hggqo3abtya,h.Exceptiondt2hlxn7j7vw);h.initMetadataForClassbxx6q50dy2s7(Z,"KmpResult");h.initMetadataForClassbxx6q50dy2s7($,"KmpSyncdKeyData");function i(b){var a;return new Int8Array([b.shr_9fl3wl_k$(56).and_4spn93_k$(new((a=d("kotlin-kotlin-stdlib")).Long2qws0ah9gnpki)(255,0)).toByte_edm0nx_k$(),b.shr_9fl3wl_k$(48).and_4spn93_k$(new a.Long2qws0ah9gnpki(255,0)).toByte_edm0nx_k$(),b.shr_9fl3wl_k$(40).and_4spn93_k$(new a.Long2qws0ah9gnpki(255,0)).toByte_edm0nx_k$(),b.shr_9fl3wl_k$(32).and_4spn93_k$(new a.Long2qws0ah9gnpki(255,0)).toByte_edm0nx_k$(),b.shr_9fl3wl_k$(24).and_4spn93_k$(new a.Long2qws0ah9gnpki(255,0)).toByte_edm0nx_k$(),b.shr_9fl3wl_k$(16).and_4spn93_k$(new a.Long2qws0ah9gnpki(255,0)).toByte_edm0nx_k$(),b.shr_9fl3wl_k$(8).and_4spn93_k$(new a.Long2qws0ah9gnpki(255,0)).toByte_edm0nx_k$(),b.and_4spn93_k$(new a.Long2qws0ah9gnpki(255,0)).toByte_edm0nx_k$()])}function a(a,b,c,d,e){this.indexKey=a,this.valueEncryptionKey=b,this.valueMacKey=c,this.snapshotMacKey=d,this.patchMacKey=e}h.protoOf180f3jzyo7rfj(a).get_indexKey_txyp6y_k$=function(){return this.indexKey};h.protoOf180f3jzyo7rfj(a).get_valueEncryptionKey_4gtu2c_k$=function(){return this.valueEncryptionKey};h.protoOf180f3jzyo7rfj(a).get_valueMacKey_csyzgo_k$=function(){return this.valueMacKey};h.protoOf180f3jzyo7rfj(a).get_snapshotMacKey_i0olf_k$=function(){return this.snapshotMacKey};h.protoOf180f3jzyo7rfj(a).get_patchMacKey_ju50un_k$=function(){return this.patchMacKey};function b(){}function c(){}function e(){}function j(a,b,c,d,e){this.keyId=a,this.indexHash=b,this.operation=c,this.indexAndValueCipherText=d,this.mutationMac=e}h.protoOf180f3jzyo7rfj(j).get_keyId_iu2gfl_k$=function(){return this.keyId};h.protoOf180f3jzyo7rfj(j).get_indexHash_4ugzah_k$=function(){return this.indexHash};h.protoOf180f3jzyo7rfj(j).get_operation_z0nqyq_k$=function(){return this.operation};h.protoOf180f3jzyo7rfj(j).get_indexAndValueCipherText_9918h1_k$=function(){return this.indexAndValueCipherText};h.protoOf180f3jzyo7rfj(j).get_mutationMac_xw6cu5_k$=function(){return this.mutationMac};function f(){}function k(){}function l(a,b){a=a===d("kotlin-kotlin-stdlib").VOID7hggqo3abtya?null:a,b=b===d("kotlin-kotlin-stdlib").VOID7hggqo3abtya?null:b,d("kotlin-kotlin-stdlib").Exception_init_$Init$25rnrjp6anyxk(this),d("kotlin-kotlin-stdlib").captureStack1fzi4aczwc4hg(this,l),this.message_1=a,this.cause_1=b}h.protoOf180f3jzyo7rfj(l).get_message_h23axq_k$=function(){return this.message_1};h.protoOf180f3jzyo7rfj(l).get_cause_iplhs0_k$=function(){return this.cause_1};function m(){}var n,o;function p(){return[B(),C()]}function q(a){switch(a){case"ENCRYPT":return B();case"DECRYPT":return C();default:s();d("kotlin-kotlin-stdlib").THROW_IAE23kobfj9wdoxr("No enum constant value.");break}}var r;function s(){if(r)return d("kotlin-kotlin-stdlib").Unit_getInstance2zv6dminn5awl();r=!0;n=new t("ENCRYPT",0);o=new t("DECRYPT",1)}var aa;function t(a,b){d("kotlin-kotlin-stdlib").Enum3alwj03lh1n41.call(this,a,b)}var u,v;function w(){return[D(),E()]}function x(a){switch(a){case"HMAC_SHA_256":return D();case"HMAC_SHA_512":return E();default:z();d("kotlin-kotlin-stdlib").THROW_IAE23kobfj9wdoxr("No enum constant value.");break}}var y;function z(){if(y)return d("kotlin-kotlin-stdlib").Unit_getInstance2zv6dminn5awl();y=!0;u=new A("HMAC_SHA_256",0);v=new A("HMAC_SHA_512",1)}var ba;function A(a,b){d("kotlin-kotlin-stdlib").Enum3alwj03lh1n41.call(this,a,b)}function B(){s();return n}function C(){s();return o}function D(){z();return u}function E(){z();return v}function F(b,c,e,f,g){var a;c=c.bytes;e=(a=d("kotlin-kotlin-stdlib")).primitiveArrayConcatwxgknw08pmlb([e,c]);c=i(a.toLongw1zpgk99d84b(e.length));var j=E();e=a.primitiveArrayConcatwxgknw08pmlb([e,g]);g=a.primitiveArrayConcatwxgknw08pmlb([e,c]);a=b.cryptoProvider_1.mac(j,g,f);return a.apply_4vmz4z_k$(la)}function G(a,b,c){b=(0-b|0)-c|0;c=Math.max(0,b);return a.cryptoProvider_1.generateRandomBytes(c)}function H(){I=this,this.IV_LENGTH_1=16,this.MAX_OF_MIN_DATA_LENGTH_1=0,this.MAC_LENGTH=32}h.protoOf180f3jzyo7rfj(H).get_MAC_LENGTH_cp2cfz_k$=function(){return this.MAC_LENGTH};var I;function J(){I==null&&new H();return I}function K(a,b,c){return function(e){return new j(a.keyId,e,b.operation,c,d("kotlin-kotlin-stdlib").copyOfRange3alro60z4hhf8(c,c.length-32|0,c.length))}}function ca(a,b,c,e,f,g){return function(h){var i=a;i=d("kotlin-kotlin-stdlib").primitiveArrayConcatwxgknw08pmlb([i,h]);h=b.cryptoProvider_1.mac(D(),c,e.indexKey);return h.apply_4vmz4z_k$(K(f,g,i))}}function da(a,b,c,e,f,g){return function(h){var i=a;i=d("kotlin-kotlin-stdlib").primitiveArrayConcatwxgknw08pmlb([i,h]);h=F(b,c.keyId,e.operation.asBytes_vqs4bj_k$(),f.valueMacKey,i);return h.applyResult_in24cb_k$(ca(i,b,g,f,c,e))}}function ea(a,b,c){return function(e){var f=d("kotlin-kotlin-stdlib").encodeToByteArray1onwao0uakjfh(a.index),g=a.value;g=g==null?null:g.toByteArray();var h;g==null?h=new Int8Array([]):h=g;g=h;h=b.cryptoProvider_1.generateRandomBytes(16);g=G(b,f.length,g.length);g=a.toProtobufValue(g).toByteArray();g=b.cryptoProvider_1.createCipherText(B(),h,g,e.valueEncryptionKey);return g.applyResult_in24cb_k$(da(h,b,c,a,e,f))}}function fa(a,b){return function(c){if(!d("kotlin-kotlin-stdlib").contentEquals1cdp6c846cfdi(a.indexHash,c))throw new l("Index hash corrupt");return b}}function ga(a,b,c){return function(e){e=a.syncMutationDataFactory_1.create(b.keyId,b.operation,e,b.mutationMac);var f=a.cryptoProvider_1.mac(D(),d("kotlin-kotlin-stdlib").encodeToByteArray1onwao0uakjfh(e.index),c.indexKey);return f.apply_4vmz4z_k$(fa(b,e))}}function ha(a,b,c,e,f,g){return function(h){if(!d("kotlin-kotlin-stdlib").contentEquals1cdp6c846cfdi(a,h))throw new l("Data mac corrupt");h=b.cryptoProvider_1.createCipherText(C(),c,e,f.valueEncryptionKey);return h.applyResult_in24cb_k$(ga(b,g,f))}}function ia(a,b,c,e,f,g){return function(h){var i=a,j=b;i=d("kotlin-kotlin-stdlib").primitiveArrayConcatwxgknw08pmlb([i,j]);j=c.operation.asBytes_vqs4bj_k$();j=F(e,f.keyId,j,h.valueMacKey,i);return j.applyResult_in24cb_k$(ha(g,e,a,b,h,c))}}function ja(a,b,c,e){return function(g){var f,j=D(),k=b,l=i((f=d("kotlin-kotlin-stdlib")).toLongw1zpgk99d84b(c));k=f.primitiveArrayConcatwxgknw08pmlb([k,l]);l=f.encodeToByteArray1onwao0uakjfh(e);f=f.primitiveArrayConcatwxgknw08pmlb([k,l]);return a.cryptoProvider_1.mac(j,f,g.snapshotMacKey)}}function ka(a,b,c,e,f){return function(j){var g,k=D(),l=b,m=c;l=(g=d("kotlin-kotlin-stdlib")).primitiveArrayConcatwxgknw08pmlb([l,m]);m=i(g.toLongw1zpgk99d84b(e));l=g.primitiveArrayConcatwxgknw08pmlb([l,m]);m=g.encodeToByteArray1onwao0uakjfh(f);g=g.primitiveArrayConcatwxgknw08pmlb([l,m]);return a.cryptoProvider_1.mac(k,g,j.patchMacKey)}}function la(a){return d("kotlin-kotlin-stdlib").copyOfRange3alro60z4hhf8(a,0,32)}function L(a,b,c){J(),this.derivedSyncdKeysProvider_1=a,this.syncMutationDataFactory_1=b,this.cryptoProvider_1=c}h.protoOf180f3jzyo7rfj(L).encrypt=function(a,b){var c=this.derivedSyncdKeysProvider_1.getFor(a.keyData);return c.applyResult_in24cb_k$(ea(b,this,a))};h.protoOf180f3jzyo7rfj(L).decrypt=function(a,b){var c=b.indexAndValueCipherText;if(c.length<48)throw new Y("Cipher text too short");c=[d("kotlin-kotlin-stdlib").copyOfRange3alro60z4hhf8(c,0,16),d("kotlin-kotlin-stdlib").copyOfRange3alro60z4hhf8(c,16,c.length-32|0),d("kotlin-kotlin-stdlib").copyOfRange3alro60z4hhf8(c,c.length-32|0,c.length)];var e=c[0],f=c[1];c=c[2];var g=this.derivedSyncdKeysProvider_1.getFor(a.keyData);return g.applyResult_in24cb_k$(ia(e,f,b,this,a,c))};h.protoOf180f3jzyo7rfj(L).calculateSnapshotMac=function(a,b,c,d){d=this.derivedSyncdKeysProvider_1.getFor(d);return d.applyResult_in24cb_k$(ja(this,c,b,a))};h.protoOf180f3jzyo7rfj(L).calculatePatchMac=function(a,b,c,d,e){c=this.derivedSyncdKeysProvider_1.getFor(c);return c.applyResult_in24cb_k$(ka(this,e,d,b,a))};function M(a,b){this.keyId=a,this.keyData=b}h.protoOf180f3jzyo7rfj(M).get_keyId_iu2gfl_k$=function(){return this.keyId};h.protoOf180f3jzyo7rfj(M).get_keyData_c88i0w_k$=function(){return this.keyData};function N(a){d("kotlin-kotlin-stdlib").Exception_init_$Init$25rnrjp6anyxk(this),d("kotlin-kotlin-stdlib").captureStack1fzi4aczwc4hg(this,N),this.cause_1=a}h.protoOf180f3jzyo7rfj(N).get_cause_iplhs0_k$=function(){return this.cause_1};function O(a,b,c){this.rawId=a,this.currentIndex=b,this.deviceIndexes=c}h.protoOf180f3jzyo7rfj(O).get_rawId_ixuf5m_k$=function(){return this.rawId};h.protoOf180f3jzyo7rfj(O).get_currentIndex_shwroi_k$=function(){return this.currentIndex};h.protoOf180f3jzyo7rfj(O).get_deviceIndexes_cfaxsx_k$=function(){return this.deviceIndexes};function P(a){this.bytes=a}h.protoOf180f3jzyo7rfj(P).get_bytes_ipgzsy_k$=function(){return this.bytes};function Q(a,b){d("kotlin-kotlin-stdlib").Exception_init_$Init$25rnrjp6anyxk(this),d("kotlin-kotlin-stdlib").captureStack1fzi4aczwc4hg(this,Q),this.message_1=a,this.cause_1=b}h.protoOf180f3jzyo7rfj(Q).get_message_h23axq_k$=function(){return this.message_1};h.protoOf180f3jzyo7rfj(Q).get_cause_iplhs0_k$=function(){return this.cause_1};var R,S;function ma(){return[W(),X()]}function na(a){switch(a){case"SET":return W();case"REMOVE":return X();default:U();d("kotlin-kotlin-stdlib").THROW_IAE23kobfj9wdoxr("No enum constant value.");break}}var T;function U(){if(T)return d("kotlin-kotlin-stdlib").Unit_getInstance2zv6dminn5awl();T=!0;R=new V("SET",0,1);S=new V("REMOVE",1,2)}var oa;function V(a,b,c){d("kotlin-kotlin-stdlib").Enum3alwj03lh1n41.call(this,a,b),this.rawValue_1=c}h.protoOf180f3jzyo7rfj(V).asBytes_vqs4bj_k$=function(){return new Int8Array([this.rawValue_1])};function W(){U();return R}function X(){U();return S}function Y(a){d("kotlin-kotlin-stdlib").Exception_init_$Init$25rnrjp6anyxk(this),d("kotlin-kotlin-stdlib").captureStack1fzi4aczwc4hg(this,Y),this.message_1=a}h.protoOf180f3jzyo7rfj(Y).get_message_h23axq_k$=function(){return this.message_1};function pa(a){return function(b){return a(b).toPromise()}}function qa(a){return a}function Z(a){this.promise_1=a}h.protoOf180f3jzyo7rfj(Z).apply_4vmz4z_k$=function(a){a=this.promise_1.then(a);return new Z(a)};h.protoOf180f3jzyo7rfj(Z).applyResult_in24cb_k$=function(a){a=this.promise_1.then(pa(a));var b=qa;a=a.then(b);return new Z(a)};h.protoOf180f3jzyo7rfj(Z).toPromise=function(){return this.promise_1};function $(a){this.keyData=a}h.protoOf180f3jzyo7rfj($).get_keyData_c88i0w_k$=function(){return this.keyData};h.defineProp3hxgpk2knu2px(h.protoOf180f3jzyo7rfj(l),"message",function(){return this.get_message_h23axq_k$()});h.defineProp3hxgpk2knu2px(h.protoOf180f3jzyo7rfj(l),"cause",function(){return this.get_cause_iplhs0_k$()});h.defineProp3hxgpk2knu2px(h.protoOf180f3jzyo7rfj(t),"name",h.protoOf180f3jzyo7rfj(t).get_name_woqyms_k$);h.defineProp3hxgpk2knu2px(h.protoOf180f3jzyo7rfj(t),"ordinal",h.protoOf180f3jzyo7rfj(t).get_ordinal_ip24qg_k$);h.defineProp3hxgpk2knu2px(h.protoOf180f3jzyo7rfj(A),"name",h.protoOf180f3jzyo7rfj(A).get_name_woqyms_k$);h.defineProp3hxgpk2knu2px(h.protoOf180f3jzyo7rfj(A),"ordinal",h.protoOf180f3jzyo7rfj(A).get_ordinal_ip24qg_k$);h.defineProp3hxgpk2knu2px(h.protoOf180f3jzyo7rfj(N),"cause",function(){return this.get_cause_iplhs0_k$()});h.defineProp3hxgpk2knu2px(h.protoOf180f3jzyo7rfj(Q),"message",function(){return this.get_message_h23axq_k$()});h.defineProp3hxgpk2knu2px(h.protoOf180f3jzyo7rfj(Q),"cause",function(){return this.get_cause_iplhs0_k$()});h.defineProp3hxgpk2knu2px(h.protoOf180f3jzyo7rfj(V),"name",h.protoOf180f3jzyo7rfj(V).get_name_woqyms_k$);h.defineProp3hxgpk2knu2px(h.protoOf180f3jzyo7rfj(V),"ordinal",h.protoOf180f3jzyo7rfj(V).get_ordinal_ip24qg_k$);h.defineProp3hxgpk2knu2px(h.protoOf180f3jzyo7rfj(Y),"message",function(){return this.get_message_h23axq_k$()});t.values=p;t.valueOf=q;h.defineProp3hxgpk2knu2px(t,"ENCRYPT",B);h.defineProp3hxgpk2knu2px(t,"DECRYPT",C);A.values=w;A.valueOf=x;h.defineProp3hxgpk2knu2px(A,"HMAC_SHA_256",D);h.defineProp3hxgpk2knu2px(A,"HMAC_SHA_512",E);h.defineProp3hxgpk2knu2px(L,"Companion",J);V.values=ma;V.valueOf=na;h.defineProp3hxgpk2knu2px(V,"SET",W);h.defineProp3hxgpk2knu2px(V,"REMOVE",X);g.KmpDerivedSyncdKeys=a;g.KmpSyncEncryptionData=j;g.KmpSyncdCipherException=l;g.OpMode=t;g.MacAlgo=A;g.KmpSyncdEncryptionManager=L;g.KmpSyncdKey=M;g.KmpSyncdKeyException=N;g.KmpSyncdKeyFingerprint=O;g.KmpSyncdKeyId=P;g.KmpSyncdMutationException=Q;g.KmpSyncdOperation=V;g.KmpSyncdParseException=Y;g.KmpResult=Z;g.KmpSyncdKeyData=$}),98); __d("WASyncdKmpConversion",["WAArrayBufferUtils","WAServerSync.pb","WASyncAction.pb","WASyncdKeyTypes","WAWebSyncdCryptoConst","WAWebSyncdDecode","WAWebSyncdRequestEncode","WAWebSyncdValidateSyncActionProtobuf","decodeProtobuf","err","syncd-crypto"],(function(a,b,c,d,e,f,g){"use strict";function h(a){return new(d("syncd-crypto").KmpSyncdKeyId)(new Int8Array(d("WASyncdKeyTypes").fromSyncKeyId(a)))}function i(a){return new(d("syncd-crypto").KmpSyncdKeyData)(new Int8Array(d("WASyncdKeyTypes").fromSyncKeyData(a)))}function j(a){switch(a){case d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET:return d("syncd-crypto").KmpSyncdOperation.SET;case d("WAServerSync.pb").SyncdMutation$SyncdOperation.REMOVE:return d("syncd-crypto").KmpSyncdOperation.REMOVE}}function k(a){return{toByteArray:function(){return new Int8Array(a)}}}function a(a,b){return new(d("syncd-crypto").KmpSyncdKey)(h(a),i(b))}function b(a,b){var c=b.index,e=b.binarySyncAction,f=b.operation,g=b.version,i=d("WAArrayBufferUtils").stringToArrayBuffer(c);return{index:c,version:g,keyId:h(a),operation:j(f),value:k(e),mutationMac:null,toProtobufValue:function(a){return k(d("WAWebSyncdRequestEncode").encodeSyncActionData({index:i,value:d("decodeProtobuf").decodeProtobuf(d("WASyncAction.pb").SyncActionValueSpec,e),padding:a.buffer,version:g}))}}}function e(a,b,e,f){var g=d("WAWebSyncdDecode").decodeSyncActionData(null,e.buffer);g=c("WAWebSyncdValidateSyncActionProtobuf").validateSyncActionDataProtobuf(null,g);var h=d("WAArrayBufferUtils").arrayBufferToString(g.index);g=g.version;e=e.buffer;return{index:h,version:g,keyId:a,operation:b,value:k(e),mutationMac:f,toProtobufValue:function(a){throw c("err")("toProtobufValue is not supposed to be called in decryption path")}}}function f(a,b,c){var e=new Int8Array(c.index.blob);c=new Int8Array(c.value.blob);var f=c.slice(-d("WAWebSyncdCryptoConst").MAC_LENGTH);return new(d("syncd-crypto").KmpSyncEncryptionData)(h(a),e,j(b),c,f)}g.toKmpSyncdKeyData=i;g.toKmpSyncdKey=a;g.toKmpSyncMutationDataForEncryption=b;g.toKmpSyncMutationDataForDecryption=e;g.toKmpSyncEncryptionData=f}),98); __d("WASyncdKmpCryptoHandler",["WACryptoAesCbc","WACryptoDependencies","WACryptoHmac","asyncToGeneratorRuntime","err","syncd-crypto"],(function(a,b,c,d,e,f,g){"use strict";function h(a,b,c){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e){e=(yield d("WACryptoAesCbc").aesCbcEncrypt(e,b,a));a.length!==16&&c("err")("IV must be 16 bytes");b=e.slice(a.length);return new Int8Array(b)});return i.apply(this,arguments)}function j(a,b,c){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){c=(yield d("WACryptoAesCbc").aesCbcDecrypt(c,a,b));return new Int8Array(c)});return k.apply(this,arguments)}function a(a,b,e,f){switch(a){case d("syncd-crypto").OpMode.ENCRYPT:return new(d("syncd-crypto").KmpResult)(h(b,e,f));case d("syncd-crypto").OpMode.DECRYPT:return new(d("syncd-crypto").KmpResult)(j(b,e,f));default:throw c("err")("Invalid mode: "+a.name+")")}}function e(a,b,c){a=a===d("syncd-crypto").MacAlgo.HMAC_SHA_256?d("WACryptoHmac").hmacSha256:d("WACryptoHmac").hmacSha512;return new(d("syncd-crypto").KmpResult)(a(c,b).then(function(a){return new Int8Array(a)}))}function f(a){a=new Int8Array(a);return d("WACryptoDependencies").getCrypto().getRandomValues(a)}a={createCipherText:a,mac:e,generateRandomBytes:f};g["default"]=a}),98); __d("WAWebSyncdCryptoHelper",["WACryptoHkdf","WASyncdKeyTypes","WAWebSyncdCryptoConst","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b;a=(yield i(a));return{indexKey:a.slice(0,(b=d("WAWebSyncdCryptoConst")).INDEX_KEY_END),valueEncryptionKey:a.slice(b.INDEX_KEY_END,b.VALUE_ENCRYPTION_KEY_END),valueMacKey:a.slice(b.VALUE_ENCRYPTION_KEY_END,b.VALUE_MAC_KEY_END),snapshotMacKey:a.slice(b.VALUE_MAC_KEY_END,b.SNAPSHOT_MAC_KEY_END),patchMacKey:a.slice(b.SNAPSHOT_MAC_KEY_END,b.PATCH_MAC_KEY_END)}});return h.apply(this,arguments)}function i(a){return d("WACryptoHkdf").extractAndExpand(d("WASyncdKeyTypes").fromSyncKeyData(a),d("WAWebSyncdCryptoConst").HKDF_INFO,d("WAWebSyncdCryptoConst").DERIVED_KEY_LENGTH)}g.generateEncryptionKeysUnmemoized=a}),98); __d("WAWebSyncdCrypto",["WABase64","WACryptoAesCbc","WACryptoDependencies","WACryptoHmac","WAMemoizeCache","WAServerSync.pb","WASyncdKeyTypes","WAWebSyncdCryptoConst","WAWebSyncdCryptoHelper","WAWebSyncdCryptoUtils","err"],(function(a,b,c,d,e,f,g){"use strict";var h=d("WAMemoizeCache").memoizeWithArgs(d("WAWebSyncdCryptoHelper").generateEncryptionKeysUnmemoized,function(a){return d("WABase64").encodeB64(d("WASyncdKeyTypes").fromSyncKeyData(a))});function a(a,b){return d("WACryptoHmac").hmacSha256(new Uint8Array(a),new Uint8Array(b))}function b(a,b){b=d("WASyncdKeyTypes").fromSyncKeyId(b);var e;switch(a){case d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET:e=d("WAWebSyncdCryptoConst").OPERATION_SET_HEX;break;case d("WAServerSync.pb").SyncdMutation$SyncdOperation.REMOVE:e=d("WAWebSyncdCryptoConst").OPERATION_REMOVE_HEX;break}if(e!=null){a=new Uint8Array([parseInt(e,16)]).buffer;var f=new Uint8Array(a.byteLength+b.byteLength);f.set(new Uint8Array(a));f.set(new Uint8Array(b),a.byteLength);return f.buffer}throw c("err")("invalid mutation operation value")}function e(a,b){a=Math.max(0,d("WAWebSyncdCryptoConst").MAX_OF_MIN_DATA_LENGTH-a-b);b=new Uint8Array(a);d("WACryptoDependencies").getCrypto().getRandomValues(b);return b.buffer}function f(a,b,c){return d("WACryptoAesCbc").aesCbcEncrypt(b,c,a)}function i(a,b,c){var e=new Uint8Array(d("WAWebSyncdCryptoConst").OCTET_LENGTH);e.set([a.byteLength],e.byteLength-1);a=d("WAWebSyncdCryptoUtils").combine([a,b,e.buffer]);return d("WACryptoHmac").hmacSha512(c,a,d("WAWebSyncdCryptoConst").MAC_LENGTH)}function j(a,b,c){return d("WACryptoAesCbc").aesCbcDecrypt(b,a,c)}function k(a){var b=a.byteLength;return new Uint8Array(a).slice(b-d("WAWebSyncdCryptoConst").MAC_LENGTH).buffer}g.generateEncryptionKeys=h;g.generateIndexMac=a;g.generateAssociatedData=b;g.generatePadding=e;g.generateCipherText=f;g.generateMac=i;g.decryptCipherText=j;g.valueMacFromIndexAndValueCipherText=k}),98); __d("WASyncdKmpEncryptionManager",["WALogger","WASyncdKeyTypes","WASyncdKmpConversion","WASyncdKmpCryptoHandler","WAWebSyncdCrypto","WAWebSyncdCryptoUtils","WAWebSyncdDecode","WAWebSyncdError","WAWebSyncdMetricFatalError","WAWebSyncdValidateSyncActionProtobuf","asyncToGeneratorRuntime","nullthrows","syncd-crypto"],(function(a,b,c,d,e,f,g){"use strict";function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd:kmp: generating snapshot mac"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd:kmp: generating patch mac"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd:kmp: decrypting mutation"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd:kmp: encrypting mutation"]);k=function(){return a};return a}function l(a){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebSyncdCrypto").generateEncryptionKeys(d("WASyncdKeyTypes").toSyncKeyData(a.keyData.buffer)));return new(d("syncd-crypto").KmpDerivedSyncdKeys)(new Int8Array(a.indexKey),new Int8Array(a.valueEncryptionKey),new Int8Array(a.valueMacKey),new Int8Array(a.snapshotMacKey),new Int8Array(a.patchMacKey))});return m.apply(this,arguments)}var n={getFor:function(a){return new(d("syncd-crypto").KmpResult)(l(a))},getForInternal:function(a){return new(d("syncd-crypto").KmpResult)(l(a))}},o={create:function(a,b,c,e){return d("WASyncdKmpConversion").toKmpSyncMutationDataForDecryption(a,b,c,e)},createInternal:function(a,b,c,e){return d("WASyncdKmpConversion").toKmpSyncMutationDataForDecryption(a,b,c,e)}},p=new(d("syncd-crypto").KmpSyncdEncryptionManager)(n,o,c("WASyncdKmpCryptoHandler"));function a(a,b,c){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){d("WALogger").LOG(k());c=d("WASyncdKmpConversion").toKmpSyncdKey(b,c);b=d("WASyncdKmpConversion").toKmpSyncMutationDataForEncryption(b,a);a=p.encrypt(c,b);c=(yield a.toPromise());return{indexMac:c.indexHash.buffer,indexAndValueCipherText:c.indexAndValueCipherText.buffer}});return q.apply(this,arguments)}function e(a,b,c,d,e){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e,f,g){d("WALogger").LOG(j());try{f=d("WASyncdKmpConversion").toKmpSyncEncryptionData(b,f,g);g=(yield p.decrypt(d("WASyncdKmpConversion").toKmpSyncdKey(b,e),f).toPromise());e=c("nullthrows")((b=g.value)==null?void 0:b.toByteArray(),"SyncdMutation decryption returned a null value, this should not happen");b=d("WAWebSyncdDecode").decodeSyncActionData(a,e.buffer);b=c("WAWebSyncdValidateSyncActionProtobuf").validateSyncActionDataProtobuf(a,b);g=c("nullthrows")(g.mutationMac,"SyncdMutation decryption returned a null mutationMac, this should not happen").buffer;return{syncAction:b,indexMac:f.indexHash.buffer,valueMac:g,indexValueBinary:e.buffer}}catch(b){d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.DECRYPTION_FAILED,a);if(b instanceof d("syncd-crypto").KmpSyncdCipherException)throw new(d("WAWebSyncdError").SyncdFatalError)(b.toString());throw b}});return r.apply(this,arguments)}function f(a,b,c,d,e){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e,f){d("WALogger").LOG(i());f=(yield p.calculatePatchMac(f,e,d("WASyncdKmpConversion").toKmpSyncdKeyData(a),new Int8Array(d("WAWebSyncdCryptoUtils").combine(c)),new Int8Array(b)).toPromise());return f.buffer});return s.apply(this,arguments)}function t(a,b,c,d){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e){d("WALogger").LOG(h());e=(yield p.calculateSnapshotMac(e,c,new Int8Array(b),d("WASyncdKmpConversion").toKmpSyncdKeyData(a)).toPromise());return e.buffer});return u.apply(this,arguments)}n={encryptMutation:a,decryptMutation:e,generatePatchMac:f,generateSnapshotMac:t};g.WASyncdKmpEncryptionManager=n}),98); __d("WAWamTypes",[],(function(a,b,c,d,e,f){"use strict";a={INT:0,BOOL:1,STRING:2,FLOAT:3};f.TYPES=a}),66); __d("WAWamBuffer",["WABinary","WAWamTypes","err"],(function(a,b,c,d,e,f,g){"use strict";var h=5,i=47,j=0,k=1,l=2,m=1,n=2,o=0,p=4,q=8;e=function(){function a(a,b,c,e){var f=this;this.$5=!1;this.$6=!1;var g=new(d("WABinary").Binary)(void 0,!0);g.writeString("WAM");g.writeUint8(h);g.writeUint8(b);g.writeUint16(c);switch(a){case"regular":g.writeUint8(j);break;case"realtime":g.writeUint8(k);break;default:a,g.writeUint8(l)}this.$1=a;this.$2=g;this.$3=c;this.$4=b;e.forEach(function(a,b){return void f.writeGlobal(b,a)})}var b=a.prototype;b.writeGlobal=function(a,b){if(b==null){u(this.$2,a,o);return}if(typeof b==="string")t(this.$2,a,o,b);else if(typeof b==="number")r(this.$2,a,o,b);else if(typeof b==="boolean")r(this.$2,a,o,b?1:0);else throw c("err")("Incorrect value type "+typeof b)};b.writeEvent=function(a,b,c,e){var f=this.$2;r(f,i,o,Math.floor(a/1e3));a=v(c);var g=a===-1?m|p:m;r(f,b,g,e);for(b=0;b<=a;b+=3){g=c[b+2];if(g!=null){e=c[b];var h=c[b+1],j=b===a?n|p:n;h===d("WAWamTypes").TYPES.INT?r(f,e,j,g):h===d("WAWamTypes").TYPES.BOOL?r(f,e,j,g?1:0):h===d("WAWamTypes").TYPES.STRING?t(f,e,j,g):s(f,e,j,g)}}this.$6=!0};b.getKey=function(){return{streamId:this.$4,sequenceNumber:this.$3,channel:this.$1}};b.getSize=function(){return this.$2.size()};b.peek=function(){return this.$2.peek(function(a){return a.readByteArray()})};b.getBuffer__INTERNAL=function(){return this.$2};b.isFinalized=function(){return this.$5};b.finalize=function(){this.$5=!0};b.hasEvents=function(){return this.$6};return a}();function r(a,b,c,d){d===0?u(a,b,c|1<<4):d===1?u(a,b,c|2<<4):-128<=d&&d<128?(u(a,b,c|3<<4),a.writeInt8(d)):-32768<=d&&d<32768?(u(a,b,c|4<<4),a.writeInt16(d)):-2147483648<=d&&d<2147483648?(u(a,b,c|5<<4),a.writeInt32(d)):(u(a,b,c|6<<4),a.writeInt64(d))}function s(a,b,c,d){u(a,b,c|7<<4),a.writeFloat64(d)}function t(a,b,c,e){var f=d("WABinary").numUtf8Bytes(e);f<256?(u(a,b,c|8<<4),a.writeUint8(f)):f<65536?(u(a,b,c|9<<4),a.writeUint16(f)):(u(a,b,c|10<<4),a.writeUint32(f));a.writeString(e)}function u(a,b,c){b<256?(a.writeUint8(c),a.writeUint8(b)):(a.writeUint8(c|q),a.writeUint16(b))}function v(a){var b=-1;for(var c=0;c<a.length;c+=3)a[c+2]!=null&&(b=c);return b}function a(a){var b=v(a);for(var c=0;c<=b;c+=3){var e=a[c+2];if(e!=null){var f=a[c+1];if(f===d("WAWamTypes").TYPES.INT&&isNaN(e))return!1}}return!0}function b(a){return typeof a==="number"?!isNaN(a):!0}g.WamBuffer=e;g.canWriteEvent=a;g.canWriteGlobal=b}),98); __d("WAWam",["Promise","WALogger","WAPromiseEach","WAShiftTimer","WAWamBuffer"],(function(a,b,c,d,e,f,g){"use strict";var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["WAM: Tried to set private stats ids on a non-private channel"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Skipping putting buffer to sink, as it does not contain any events"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["A WAM event in channel "," was dropped before serialization. Event correct: ",", pending attributes correct: ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["WAM realtime channel is not supported yet"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["A WAM event in channel private was dropped before serialization. Reason: missing psIdIntValue in the event payload"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["WAM: Tried to create a private buffer without setting private stats id"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["WAM: Tried to create a private buffer without setting private stats ids"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["WAM: Sequence number generator not initialised for channel ",""]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["WAM: Initialized with stream id ",""]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["WAM: Failed to initialize already initialized WAM"]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["WAM: Enqueued "," attribute keys for update"]);s=function(){return a};return a}var t=64*1024,u=5*60*1e3,v=3e3,w=1,x=2,y=6005;a=113760892;var z=0,A="none",B={putBuffer:function(a,c,d){return(h||(h=b("Promise"))).resolve()}};c=function(){function a(a){var b=this;this.$2=[];this.$3=new Map();this.$4=!1;this.$5=new Map();this.$8=-1;this.$9=B;this.$10=null;this.deinitialize=function(){b.$4=!1,b.$2=[],b.$3.clear(),b.$5=new Map(),b.$8=-1,b.$9=B,b.serializePending.cancel(),b.finalizeBuffers.cancel()};this.enqueueEvent=function(a,c,d,e,f,g){var h=w;b.$2.push({type:h,id:a,commitTime:c,psIdIntValue:d,weight:f,fields:e,resolve:g});b.$4&&b.serializePending.onOrBefore(v)};this.enqueueAttributesUpdate=function(a){var c={type:x,delta:[]};a.forEach(function(a,b){if(a===void 0)return;c.delta.push([b,a])});c.delta.length>0&&(d("WALogger").LOG(s(),c.delta.length),b.$2.push(c))};this.finalizeBuffers=new(d("WAShiftTimer").ShiftTimer)(function(){b.finalizeBuffers__INTERNAL()});this.serializePending=new(d("WAShiftTimer").ShiftTimer)(function(){b.serializePending__INTERNAL()});this.forceSerializePending=function(){if(!b.$4)return;b.$11()&&b.serializePending.forceRunNow()};this.$1=a}var b=a.prototype;b.initialize=function(a,b,c,e){if(this.$4){d("WALogger").ERROR(r()).sendLogs("wam-initialize");return}this.$7=e;this.$8=a;this.$9=c;this.$10=b;this.$11()&&this.serializePending.forceRunNow();this.$4=!0;d("WALogger").LOG(q(),this.$8)};b.finalizeBuffers__INTERNAL=function(){this.$5.forEach(function(a){a.finalize()}),this.$5.size>0&&this.serializePending.onOrBefore(v)};b.$12=function(a){var b;if(!((b=this.$7)==null?void 0:b.multipleSequences))return"regular";return a===z?"null-psid":a};b.$13=function(a){var b=this.$5.get(a);if(b)return b;var c=this.$12(a);if(this.$10==null){d("WALogger").ERROR(p(),this.$1).sendLogs("wam-serializePending");return}c=this.$10(c);b=new(d("WAWamBuffer").WamBuffer)(this.$1,this.$8,c,this.$3);this.$5.set(a,b);if(a!=="regular"){a;if(this.$6==null)d("WALogger").ERROR(o()).sendLogs("wam-serializePending");else{c=a===z?A:this.$6.get(a);c==null?d("WALogger").ERROR(n()).sendLogs("wam-serializePending"):b.writeGlobal(y,c)}}return b};b.serializePending__INTERNAL=function(){var a=this,b=[];this.finalizeBuffers.onOrBefore(u);var c=new Map(),e=-1;this.$2.forEach(function(f,g){if(f.type===w){var h=!0;c.forEach(function(a){d("WAWamBuffer").canWriteGlobal(a)||(h=!1)});var i=d("WAWamBuffer").canWriteEvent(f.fields);if(i&&h){var j;a.$1==="regular"?j=a.$13("regular"):a.$1==="private"?f.psIdIntValue==null?d("WALogger").ERROR(m()).sendLogs("wam-serializePending"):j=a.$13(f.psIdIntValue):(a.$1,d("WALogger").WARN(l()));j!=null&&(c.forEach(function(c,b){var d=a.$3.get(b);(d===void 0||d!==c)&&(a.$5.forEach(function(a){return a.writeGlobal(b,c)}),a.$3.set(b,c))}),c.clear(),j.writeEvent(f.commitTime,f.id,f.fields,f.weight))}else d("WALogger").WARN(k(),a.$1,i,h).devConsole("pending attributes",c,"pending event action",f);f.resolve!=null&&b.push(f.resolve);e=g}else{f.type;for(i=0;i<f.delta.length;++i){g=f.delta[i];var n=g[0];g=g[1];c.set(n,g)}}});var f=!1;this.$5.forEach(function(a){(a.isFinalized()||a.getSize()>t)&&(f=!0)});var g=[];this.$5.forEach(function(b,c){b.hasEvents()?g.push([b.getKey(),b.peek(),a.$12(c)]):d("WALogger").WARN(j())});var h=d("WAPromiseEach").promiseEach(g,function(b){var c=b[0],d=b[1];b=b[2];return a.$9.putBuffer(c,d,f,b)}).then(function(){b.forEach(function(a){return void a()})});this.$2=this.$2.slice(e+1);f&&(this.$5=new Map(),this.finalizeBuffers.cancel());return h};b.$11=function(){return this.$2.length>0&&this.$2.some(function(a){return a.type===w})};b.isInitialized=function(){return this.$4};b.getStreamId=function(){return this.$8};b.getPendingActions=function(){return this.$2};b.getBuffers__INTERNAL=function(){return this.$5};b.getGlobals__INTERNAL=function(){return this.$3};b.setGlobals__INTERNAL=function(a){this.$3=a};b.getSink__INTERNAL=function(){return this.$9};b.updatePrivateStatsIds=function(a){if(this.$1!=="private"){d("WALogger").ERROR(i()).sendLogs("wam-updatePrivateStatsIds");return}this.$6=a};return a}();g.PRIVATE_STATS_DEFAULT_PS_ID_KEY_HASH_INT=a;g.Wam=c}),98); __d("WAWamChannelManager",[],(function(a,b,c,d,e,f){"use strict";var g=function(){function a(){this.$1=new Map(),this.$2=new Map()}var b=a.prototype;b.getChannelInitialized=function(a){return this.$2.get(a)||!1};b.setChannelInitialized=function(a){this.$2.set(a,!0)};b.isSinkBusy=function(a){return this.$1.get(a)||!1};b.setSinkBusy=function(a,b){this.$1.set(a,b)};b.close=function(){var a=this;this.$1.forEach(function(b,c){a.$1.set(c,!1)});this.$2.forEach(function(b,c){a.$2.set(c,!1)})};return a}(),h;function a(){h==null&&(h=new g());return h}function b(){h!=null&&h.close()}f.getChannelManager=a;f.closeChannelManager=b}),66); __d("WAWamManager",["WALogger","WAWam"],(function(a,b,c,d,e,f,g){"use strict";function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["WamManager: Deinitializing WAM Channel ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["WAM instance for channel "," has already been initialized"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["SequenceNumberGenerator::initializeForChannel: Incorrect combination of parameters: "," "," ",""]);j=function(){return a};return a}var k=65535,l=function(){function a(a){this.$1=new Map(),this.$2=a}var b=a.prototype;b.$3=function(a,b){b==null||b===0?this.$1.set(a,"uninitialized"):b<0?this.$1.set(a,"uninitialized"):this.$1.set(a,b)};b.getSequenceNumber__INTERNAL=function(){return this.$1};b.initializeForChannel=function(a,b){var c=this;b.forEach(function(b,e){var f;if(a==="regular"&&e==="regular")c.$3(e,b);else if(a==="private"&&e!=="regular")c.$3(e,b);else if(a==="private"&&!((f=c.$2)==null?void 0:f.multipleSequences))c.$3(e,b);else{d("WALogger").ERROR(j(),a,e,(f=c.$2)==null?void 0:f.multipleSequences)}})};b.next=function(a){var b=this.$1.get(a),c;b==null||b==="uninitialized"?c=1:(c=b+1,c>k&&(c=1));this.$1.set(a,c);return c};return a}();a=function(){function a(){this.$1=new Map(),this.$2=null}var b=a.prototype;b.getWamInstance=function(a){var b=this.$1.get(a);b||(b=new(d("WAWam").Wam)(a),this.$1.set(a,b));return b};b.initialize=function(a,b,c,e,f){var g=this.getWamInstance(a);if(g.isInitialized()){d("WALogger").WARN(i(),a);return}this.$2==null&&(this.$2=new l(f));var h=this.$2;this.$2.initializeForChannel(a,c);g.initialize(b,function(a){return h.next(a)},e,f)};b.deinitialize=function(){this.$1.forEach(function(a,b){a.isInitialized()&&(d("WALogger").LOG(h(),b),a.deinitialize())}),this.$2=null};b.enqueueEvent=function(a,b,c,d,e,f,g){a=this.getWamInstance(a);a.enqueueEvent(b,c,d,e,f,g)};b.enqueueAttributesUpdate=function(a,b){a=this.getWamInstance(a);a.enqueueAttributesUpdate(b)};b.updatePrivateStatsIds=function(a){var b=this.getWamInstance("private");b.updatePrivateStatsIds(a)};b.forceFlushBuffers=function(){this.$1.forEach(function(a){a.forceSerializePending()})};b.rotateBuffers=function(){this.$1.forEach(function(a){a.finalizeBuffers.forceRunNow()})};b.getSequenceNumberGenerator__INTERNAL=function(){return this.$2};return a}();g.WamManager=a}),98); __d("WAWamUtils",["WABase64","WALogger","WAWamTypes","err"],(function(a,b,c,d,e,f,g){"use strict";var h,i;function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["logAttributes WAM channel is not an array"]);j=function(){return a};return a}var k=(h={},h[(i=d("WAWamTypes")).TYPES.INT]="number",h[i.TYPES.FLOAT]="number",h[i.TYPES.STRING]="string",h[i.TYPES.BOOL]="boolean",h);function a(a,b){if(b==null||b.length===0)return a;var c=new Map();for(var d=0;d<a.length;d+=3){var e=a[d];c.set(e,d)}for(e=0;e<b.length;++e){d=b[e];var f=d[0],g=d[1];d=d[2];if(d==null)continue;var h=c.get(f);if(h!=null){var i=a[h+2];if(i!==void 0)continue}i=k[g];i===typeof d&&(h==null?(c.set(f,a.length),a.push(f,g,d)):a[h+2]=d)}return a}function b(a){var b=new Map(),e=new Map();for(var f=0;f<a.length;f+=4){var g=a[f],h=a[f+1],i=a[f+2],k=a[f+3];if(i===d("WAWamTypes").TYPES.FLOAT)throw c("err")("Float attributes are currently not supported in runtime");if(!Array.isArray(g)){d("WALogger").ERROR(j()).sendLogs("wam-log-attributes");return}g.includes("regular")&&b.set(h,k);g.includes("private")&&e.set(h,k)}return{deltaRegular:b,deltaPrivate:e}}function e(a,b){var c=[];b.forEach(function(b){var e=b.channel;if(e==null){if(a!=="regular")return}else if(e!==a)return;if(b.finished){e=new Uint8Array(d("WABase64").decodeB64(b.buffer));b=b.key;c.push({key:b,content:e})}});return c}function l(a){return JSON.stringify([a.streamId,a.sequenceNumber,a.channel])}function f(a,b,c,e,f){var g=l(a);return{bufferKey:g,meta:{streamId:a.streamId,sequenceNumber:a.sequenceNumber},bufferRow:{key:g,channel:b,streamId:c,buffer:d("WABase64").encodeB64(e),finished:f}}}function m(a){var b=null;a&&(b=a.sequenceNumber);return b}g.appendRawFields=a;g.getDeltaFromAttributes=b;g.getFinishedBuffers=e;g.asBufferEntry=f;g.getSequenceNumber=m}),98); __d("WAWamEntrypoint",["Promise","WALogger","WAWamManager","WAWamUtils"],(function(a,b,c,d,e,f,g){"use strict";var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["wamEntrypoint: logAttributes"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["wamEntrypoint: logAsync"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["wamEntrypoint: log"]);k=function(){return a};return a}var l=1,m=!1,n=null;function o(){n||(n=new(d("WAWamManager").WamManager)());return n}function a(){m=!0}function c(a,b,c,d,e){o().initialize(c,a,b,d,e)}function e(){o().deinitialize()}function f(a,b,c,e,f,g,h){g===void 0&&(g=l);var i=Date.now();m&&h!=null&&d("WALogger").DEV(k()).devConsole(babelHelpers["extends"]({},h,{id:b,arrayFields:e,rawFields:f,weight:g}));o().enqueueEvent(a,b,i,c,d("WAWamUtils").appendRawFields(e,f),g)}function p(a,c,e,f,g,i,k){i===void 0&&(i=l);var n=Date.now();m&&k!=null&&d("WALogger").DEV(j()).devConsole(babelHelpers["extends"]({},k,{id:c,arrayFields:f,rawFields:g,weight:i}));return new(h||(h=b("Promise")))(function(b){o().enqueueEvent(a,c,n,e,d("WAWamUtils").appendRawFields(f,g),i,b)})}function q(a,b){var c=d("WAWamUtils").getDeltaFromAttributes(a);if(c==null)return;var e=c.deltaRegular;c=c.deltaPrivate;m&&b!=null&&d("WALogger").DEV(i()).devConsole(babelHelpers["extends"]({},b,{attributes:a,deltaRegular:e,deltaPrivate:c}));e.size>0&&o().enqueueAttributesUpdate("regular",e);c.size>0&&o().enqueueAttributesUpdate("private",c)}function r(a){o().updatePrivateStatsIds(a)}function s(){o().forceFlushBuffers()}function t(){o().rotateBuffers()}g.enableDebugMode=a;g.initializeWAM=c;g.deinitializeWAM=e;g.log=f;g.logAsync=p;g.logAttributes=q;g.updatePrivateStatsIds=r;g.forceFlushBuffers=s;g.rotateBuffers=t}),98); __d("WAWamStorage",["Promise","WALogger","WATimeUtils","WAWamChannelManager","WAWamEntrypoint","WAWamUtils","err"],(function(a,b,c,d,e,f,g){"use strict";var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["The private stats token was redeemed maximum number of time. The client shall re-issue a new one"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["The private stats token expired. The client shall re-issue a new one"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["WamStorage: Buffer "," is scheduled for send"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["WamStorage: Successfully put buffer "," to sink"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["WamStorage: Sink flush did not happen within timeout, buffer is not saved"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["[wam] startWamStorage: called again"]);n=function(){return a};return a}var o=null,p=null;function q(a){if(p)return p;else throw c("err")("WamStorage::"+a+" called before startWamStorage")}function a(a){p==null?p=a:d("WALogger").WARN(n()).sendLogs("startWamStorage")}function e(){d("WAWamEntrypoint").deinitializeWAM(),d("WAWamChannelManager").closeChannelManager(),p=null,o=null}function f(e,f,g,i){var a=q("initializeWAMSink"),j=d("WAWamChannelManager").getChannelManager();if(j.getChannelInitialized(f))return(h||(h=b("Promise"))).resolve();j.setChannelInitialized(f);var n=a.getStreamId(e),r={putBuffer:function(c,e,i,o){if(j.isSinkBusy(f)){d("WALogger").WARN(m());return(h||(h=b("Promise"))).resolve()}j.setSinkBusy(f,!0);e=d("WAWamUtils").asBufferEntry(c,f,n,e,i);var p=e.bufferKey,q=e.meta;e=e.bufferRow;return a.saveBuffer(q,e,o).then(function(){var a=[c.streamId,c.sequenceNumber];d("WALogger").LOG(l(),a);i&&(g(),d("WALogger").LOG(k(),p))})["finally"](function(){j.setSinkBusy(f,!1)})}};o==null&&(o=a.finishBuffer(n));return o.then(function(){if(a.getStartingSequenceNumbers){a.getStartingSequenceRow;return a.getStartingSequenceNumbers(f,n)}else{a.getStartingSequenceRow;if(i==null?void 0:i.multipleSequences)throw c("err")("getStartingSequenceRow must not used when enabling support for multiple sequences");return a.getStartingSequenceRow(n).then(function(a){a=d("WAWamUtils").getSequenceNumber(a);var b=new Map();b.set("regular",a);return b})}}).then(function(b){d("WAWamEntrypoint").initializeWAM(n,b,f,r,i),f==="private"&&a.updatePrivateStatsIds&&a.updatePrivateStatsIds().then(d("WAWamEntrypoint").updatePrivateStatsIds)})}function r(a){return q("getFinishedStreamBuffers").getBuffers().then(function(b){return d("WAWamUtils").getFinishedBuffers(a,b)})}var s=64,t=function(a,b){var c=(b==null?void 0:b.maxRedeemCount)!=null&&b.maxRedeemCount!==0?b.maxRedeemCount:s;b=(b==null?void 0:b.maxExpirySeconds)!=null&&b.maxExpirySeconds!==0?b.maxExpirySeconds:d("WATimeUtils").DAY_SECONDS;c={maxRedeemCount:c,maxExpirySeconds:b};if(!d("WATimeUtils").happenedWithin(a.creationTs,c.maxExpirySeconds)){d("WALogger").LOG(j());return!1}if(a.redeemCount>=c.maxRedeemCount){d("WALogger").LOG(i());return!1}return!0};function u(){var a=q("getPrivateStatsToken");if(!a.redeemPrivateStatsToken)throw c("err")("redeemPrivateStatsToken not implemented for WAM DB");return a.redeemPrivateStatsToken(t)}function v(b){var a=q("savePrivateStatsToken");if(!a.savePrivateStatsToken)throw c("err")("savePrivateStatsToken not implemented for WAM DB");return a.savePrivateStatsToken(b)}function w(){var a=q("privateStatsKillSwitchGetBlockedToken");if(!a.privateStatsKillSwitchGetBlockedToken)throw c("err")("privateStatsKillSwitchGetBlockedToken not implemented for WAM DB");return a.privateStatsKillSwitchGetBlockedToken()}function x(b){var a=q("privateStatsKillSwitchSet");if(!a.privateStatsKillSwitchSet)throw c("err")("privateStatsKillSwitchSet not implemented for WAM DB");return a.privateStatsKillSwitchSet(b)}function y(a){return q("removeBufferByKey").removeBufferByKey(a)}function z(){return q("nukeMetrics").nukeMetrics()}g.startWamStorage=a;g.closeWamStorage=e;g.initializeWAMSink=f;g.getFinishedStreamBuffers=r;g.redeemPrivateStatsToken=u;g.savePrivateStatsToken=v;g.privateStatsKillSwitchGetBlockedToken=w;g.privateStatsKillSwitchSet=x;g.removeBufferByKey=y;g.nukeMetrics=z}),98); __d("WAWebABPropsInternalNumber",["WAWebABProps"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WAWebABProps").getABPropConfigValue("system_msg_numbers_fb_branded").split(","),c=d("WAWebABProps").getABPropConfigValue("system_msg_numbers_fb_inc").split(",");return b.includes(a)||c.includes(a)}function b(a){var b=d("WAWebABProps").getABPropConfigValue("system_msg_numbers_fb_branded").split(",");return b.includes(a)}g.getIsInternalNumber=a;g.getFbBrandedNumber=b}),98); __d("WAWebABPropsWamGlobals",["WAWebABProps","WAWebWamGlobals"],(function(a,b,c,d,e,f,g){function a(){d("WAWebWamGlobals").Global.set({serviceImprovementOptOut:d("WAWebABProps").getABPropConfigValue("service_improvement_opt_out_flag")})}g.setAbPropDependingGlobalWamAttributes=a}),98); __d("WAWebAbPropsParsingJob",["WAWebABPropsConfigs"],(function(a,b,c,d,e,f,g){function a(a){var b=new Map();a.forEach(function(a){var c=a.configCode,d=a.configValue;a=a.configExpoKey;b.set(c,{configValue:d,configExpoKey:a})});var c=new Map();Object.keys(d("WAWebABPropsConfigs").ABPropConfigs).map(function(a){a=d("WAWebABPropsConfigs").ABPropConfigs[a][0];var e=b.get(a),f=e==null?void 0:e.configValue;e=e==null?void 0:e.configExpoKey;c.set(a,{configValue:f,configExpoKey:e==null?null:e.toString()})});return c}g.parseABProps=a}),98); __d("WAWebAddonSendMsgData",["WALogger","WAWebAck","WAWebAddonConstants","WAWebAddonCrossWindowUtils","WAWebAddonEncryptAddonMsgData","WAWebAddonInfraError","WAWebAddonPluginProcessor","WAWebAddonProcessMsgs","WAWebAddonProcessMsgsUtils","WAWebAddonRetryRequestUtils","WAWebAddonSelectUtils","WAWebAddonUpdateDataUtils","WAWebHandleMsgError","WAWebMsgType","WAWebReferentialMsgKey","WAWebSendMsgJob","WAWebSendMsgTypes","WAWebUserPrefsMeUser","WAWebWid","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["sendAddonMsgData: failure, msg: ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["sendAddonMsgData: failure, parent msg "," for addon "," is not found"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[addon-infra]: sent "," addon, id: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[addon-infra]: sending "," (",") addon, id: ",", parent: ",", isParentLid: ",""]);k=function(){return a};return a}function l(a,b){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=d("WAWebAddonEncryptAddonMsgData").createDualEncryptionHelper(a,b);b=b?yield b.decrypt():a;a=d("WAWebAddonSelectUtils").getAddonTableMode(a);yield d("WAWebAddonUpdateDataUtils").updateAddonsInTableMode({processMode:d("WAWebAddonConstants").AddonProcessMode.SetAck,tableMode:a},{add:[b]})});return m.apply(this,arguments)}var n=function(a){a=a.id;var b=a.remote;return a.fromMe&&d("WAWebUserPrefsMeUser").isMePrimary(b)?d("WAWebAck").ACK.READ:d("WAWebAck").ACK.SENT},o=new Set([d("WAWebAddonConstants").AddonProcessMode.Send,d("WAWebAddonConstants").AddonProcessMode.SendRetry,d("WAWebAddonConstants").AddonProcessMode.SendRevoke]),p=new Set([d("WAWebMsgType").MSG_TYPE.REACTION,d("WAWebMsgType").MSG_TYPE.REACTION_ENC]);function q(a){return p.has(a.type)?!0:new Set(["reaction","poll_update","comment","event_response"]).has(a.type)}function a(a,b){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e=d("WAWebAddonConstants").AddonProcessMode.Send;a.kind===d("WAWebMsgType").MsgKind.ProtocolAddonRevoke&&(e=d("WAWebAddonConstants").AddonProcessMode.SendRevoke);a.ack===d("WAWebAck").ACK.FAILED&&(e=d("WAWebAddonConstants").AddonProcessMode.SendRetry);var f;try{if(!o.has(e))throw new(d("WAWebAddonInfraError").AddonInfraError)(d("WAWebAddonInfraError").AddonInfraErrorCode.UnexpectedError);var g=d("WAWebAddonProcessMsgsUtils").getParentMsgKey(a);if(q(a))f=(yield d("WAWebAddonProcessMsgs").processOutgoingMsgOptimisticUpdate(e,a));else{d("WALogger").LOG(k(),d("WAWebAddonCrossWindowUtils").getAddonProcessorType(a),a.type,a.id.id,g.id,(g=g.participant)==null?void 0:g.isLid());g=(yield d("WAWebAddonProcessMsgsUtils").queryAddonParentMsgs([a],e));var m=g[0];g=g[1];f={encryptedMsgData:g[0],decryptedMsgData:g[0],parent:d("WAWebAddonSelectUtils").createAddonParentSelector(m).getForAddon(g[0])};if(e===d("WAWebAddonConstants").AddonProcessMode.SendRetry&&a.type===d("WAWebMsgType").MSG_TYPE.COMMENT){g=d("WAWebAddonPluginProcessor").getAddonProcessor(f.decryptedMsgData);g.convert.toDualEncryptedMsgData!=null&&(f.encryptedMsgData=(yield g.convert.toDualEncryptedMsgData(f.decryptedMsgData,f.parent)))}(e===d("WAWebAddonConstants").AddonProcessMode.Send||e===d("WAWebAddonConstants").AddonProcessMode.SendRetry)&&(yield d("WAWebAddonProcessMsgs").processOutgoingMsg(e,f.encryptedMsgData,m,b))}yield d("WAWebAddonRetryRequestUtils").storeSelfMessageTypeRow(f.decryptedMsgData);e=f.parent.broadcastId!=null&&c("WAWebWid").isWid(f.parent.broadcastId)&&Boolean((g=f.parent.broadcastId)==null?void 0:g.isBroadcastList());if(e){m=d("WAWebReferentialMsgKey").getReferentialMsgKey(f.parent);f.encryptedMsgData=d("WAWebAddonProcessMsgsUtils").updateMsgParentKeyValue(f.encryptedMsgData,m)}g=(yield d("WAWebSendMsgJob").encryptAndSendMsg({type:d("WAWebSendMsgTypes").SendMessageRecordType.Addon,data:f.encryptedMsgData},b));m=g.count;b=g.t;g=g.error;e&&(f.encryptedMsgData=d("WAWebAddonProcessMsgsUtils").updateMsgParentKeyValue(f.encryptedMsgData,f.parent.id));if(g!=null)throw new(d("WAWebHandleMsgError").MessageSentAckError)(g);yield l(babelHelpers["extends"]({},f.decryptedMsgData,{ack:n(f.encryptedMsgData)}),f.parent);d("WALogger").LOG(j(),f.decryptedMsgData.type,f.decryptedMsgData.id.id);return{t:parseInt(b,10),count:m}}catch(b){if(f==null){d("WALogger").ERROR(i(),d("WAWebAddonProcessMsgsUtils").getParentMsgKey(a),a.id.toString()).tags("messaging","addons").sendLogs("sendAddonMsgData: undefined parent");throw b}yield l(babelHelpers["extends"]({},f.decryptedMsgData,{ack:d("WAWebAck").ACK.FAILED}),f.parent);d("WALogger").WARN(h(),a.id.toString()).devConsole(f);throw b}});return r.apply(this,arguments)}g.isOptimisticAddonSendSupported=q;g.sendAddonProcess=a}),98); __d("WAWebUserPrefsIsLoggedIn",["WAWebUserPrefsMultiDevice"],(function(a,b,c,d,e,f,g){var h=!1;function a(){return d("WAWebUserPrefsMultiDevice").isRegistered()&&i()}function i(){return h}function b(a){h=a}g.isLoggedIn=a;g.setIsConnectedAsRegistered=b}),98); __d("WAWebAutoLogoutGating",["WAWebEnvironment","WAWebUA"],(function(a,b,c,d,e,f,g){function a(){var a=h();return a}function h(){return c("WAWebEnvironment").isWindows?!1:d("WAWebUA").UA.hasCredentiallessIframeSupport&&!d("WAWebUA").UA.isOculusBroswer}function b(){var a=self.location!==self.parent.location;if(!a)return!1;a=new URLSearchParams(window.location.search);a=a.get("autologout");return a!=="1"?!1:!0}function e(){var a=new URL(window.location.href);a.searchParams.set("autologout","1");return a.toString()}g.isAutoLogoutEnabled=a;g.isRunningInAutoLgoutIframe=b;g.getAutoLogoutIframeUrl=e}),98); __d("WAWebWamEnumWebcNativeUpsellCtaQrScreenExperimentGroup",[],(function(a,b,c,d,e,f){a=Object.freeze({NONE:1,TEST_BANNER_SLIM:2,TEST_BANNER_LARGE:3,CONTROL:4});f.WEBC_NATIVE_UPSELL_CTA_QR_SCREEN_EXPERIMENT_GROUP=a}),66); __d("WAWebDesktopUpsellQRCodeBannerExperiment",["WAWebWamEnumWebcNativeUpsellCtaQrScreenExperimentGroup","gkx"],(function(a,b,c,d,e,f,g){function a(){if(!c("gkx")("10030"))return d("WAWebWamEnumWebcNativeUpsellCtaQrScreenExperimentGroup").WEBC_NATIVE_UPSELL_CTA_QR_SCREEN_EXPERIMENT_GROUP.NONE;if(c("gkx")("10031"))return d("WAWebWamEnumWebcNativeUpsellCtaQrScreenExperimentGroup").WEBC_NATIVE_UPSELL_CTA_QR_SCREEN_EXPERIMENT_GROUP.TEST_BANNER_SLIM;return c("gkx")("10032")?d("WAWebWamEnumWebcNativeUpsellCtaQrScreenExperimentGroup").WEBC_NATIVE_UPSELL_CTA_QR_SCREEN_EXPERIMENT_GROUP.TEST_BANNER_LARGE:d("WAWebWamEnumWebcNativeUpsellCtaQrScreenExperimentGroup").WEBC_NATIVE_UPSELL_CTA_QR_SCREEN_EXPERIMENT_GROUP.CONTROL}g.getWAWebDesktopUpsellQRCodeBannerExperiment=a}),98); __d("WAWebLinkDeviceScreenGatedUtils",["$InternalEnum","WAWebEnvironment","gkx"],(function(a,b,c,d,e,f,g){"use strict";var h=b("$InternalEnum")({NONE:-1,CONTROL:0,TEST1:1,TEST2:2});function i(){if(c("WAWebEnvironment").isWeb){if(!c("gkx")("13938"))return h.NONE;if(c("gkx")("13939"))return h.TEST1;return c("gkx")("13940")?h.TEST2:h.CONTROL}return h.NONE}function a(){return i()===h.TEST1||i()===h.TEST2}g.LinkDeviceScreenVariantType=h;g.getLinkDeviceScreenVariant=i;g.isLinkDeviceScreenTestVariant=a}),98); __d("WAWebLinkDeviceExperience",["WABitArray","WAWebAutoLogoutGating","WAWebDesktopUpsellQRCodeBannerExperiment","WAWebLinkDeviceScreenGatedUtils","WAWebWamEnumWebcNativeUpsellCtaQrScreenExperimentGroup"],(function(a,b,c,d,e,f,g){b=function(){function a(a){this.flag=a}var b=a.prototype;b.getIndex=function(){return i()-1-this.flag};return a}();var h={ScreenRefreshFlag:new b(0),AutoLogoutFlag:new b(1),DesktopUpsellBannerControlFlag:new b(2),DesktopUpsellBannerTestSlimBannerFlag:new b(3),DesktopUpsellBannerTestLargeBannerFlag:new b(4),PairingScreenRefreshControlFlag:new b(5),PairingScreenRefreshVariant1Flag:new b(6),PairingScreenRefreshVariant2Flag:new b(7)};function i(){return Math.max.apply(Math,Object.values(h).map(function(a){return a.flag}))+1}function a(){var a=new(c("WABitArray"))(i());a.set(h.ScreenRefreshFlag.getIndex());d("WAWebAutoLogoutGating").isAutoLogoutEnabled()&&a.set(h.AutoLogoutFlag.getIndex());var b=d("WAWebDesktopUpsellQRCodeBannerExperiment").getWAWebDesktopUpsellQRCodeBannerExperiment();switch(b){case d("WAWebWamEnumWebcNativeUpsellCtaQrScreenExperimentGroup").WEBC_NATIVE_UPSELL_CTA_QR_SCREEN_EXPERIMENT_GROUP.NONE:break;case d("WAWebWamEnumWebcNativeUpsellCtaQrScreenExperimentGroup").WEBC_NATIVE_UPSELL_CTA_QR_SCREEN_EXPERIMENT_GROUP.CONTROL:a.set(h.DesktopUpsellBannerControlFlag.getIndex());break;case d("WAWebWamEnumWebcNativeUpsellCtaQrScreenExperimentGroup").WEBC_NATIVE_UPSELL_CTA_QR_SCREEN_EXPERIMENT_GROUP.TEST_BANNER_SLIM:a.set(h.DesktopUpsellBannerTestSlimBannerFlag.getIndex());break;case d("WAWebWamEnumWebcNativeUpsellCtaQrScreenExperimentGroup").WEBC_NATIVE_UPSELL_CTA_QR_SCREEN_EXPERIMENT_GROUP.TEST_BANNER_LARGE:a.set(h.DesktopUpsellBannerTestLargeBannerFlag.getIndex());break}b=d("WAWebLinkDeviceScreenGatedUtils").getLinkDeviceScreenVariant();switch(b){case d("WAWebLinkDeviceScreenGatedUtils").LinkDeviceScreenVariantType.NONE:break;case d("WAWebLinkDeviceScreenGatedUtils").LinkDeviceScreenVariantType.CONTROL:a.set(h.PairingScreenRefreshControlFlag.getIndex());break;case d("WAWebLinkDeviceScreenGatedUtils").LinkDeviceScreenVariantType.TEST1:a.set(h.PairingScreenRefreshVariant1Flag.getIndex());break;case d("WAWebLinkDeviceScreenGatedUtils").LinkDeviceScreenVariantType.TEST2:a.set(h.PairingScreenRefreshVariant2Flag.getIndex());break}return a.toNumber()}g.getWebCompanionLinkDeviceExperienceId=a}),98); __d("WAWebWamEnumApplicationState",[],(function(a,b,c,d,e,f){a=Object.freeze({FOREGROUND:1,BACKGROUND:2});f.APPLICATION_STATE=a}),66); __d("WAWebWamEnumMdLinkDeviceCompanionStage",[],(function(a,b,c,d,e,f){a=Object.freeze({PAIR_SUCCESS_RECEIVED:1,PAIR_DEVICE_SIGN_SENT:2,FIRST_CONNECT:3,UPLOAD_PREKEYS:4,COMPLETE:5,GENERATE_PREKEYS:6,SENT_PREKEYS:7});f.MD_LINK_DEVICE_COMPANION_STAGE=a}),66); __d("WAWebMdLinkDeviceCompanionWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumApplicationState","WAWebWamEnumMdLinkDeviceCompanionStage"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({MdLinkDeviceCompanion:[2576,{appContext:[13,a.TYPES.STRING],appContextBitfield:[14,a.TYPES.INTEGER],applicationState:[12,d("WAWebWamEnumApplicationState").APPLICATION_STATE],mdCompanionRefHash:[10,a.TYPES.STRING],mdDurationS:[8,a.TYPES.INTEGER],mdLinkDeviceCompanionErrorCode:[6,a.TYPES.INTEGER],mdLinkDeviceCompanionStage:[4,d("WAWebWamEnumMdLinkDeviceCompanionStage").MD_LINK_DEVICE_COMPANION_STAGE],mdLinkDeviceExperienceId:[11,a.TYPES.INTEGER],mdRegAttemptId:[9,a.TYPES.STRING],mdSessionId:[1,a.TYPES.STRING],mdTimestampS:[7,a.TYPES.INTEGER],mdWasUpgraded:[5,a.TYPES.BOOLEAN]},[1,1,1],"regular"]},{MdLinkDeviceCompanion:[]});g.MdLinkDeviceCompanionWamEvent=b}),98); __d("WAWebWamDeviceLinkReporter",["WABase64","WABinary","WACryptoSha256","WAResolvable","WATimeUtils","WAWebLinkDeviceExperience","WAWebMdLinkDeviceCompanionWamEvent","WAWebWamEnumMdLinkDeviceCompanionStage","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h=null,i=null,j=null,k=null;function a(a,b,c){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){h=new(d("WAWebMdLinkDeviceCompanionWamEvent").MdLinkDeviceCompanionWamEvent)();a=(yield n(a,b));i={regStartTime:c,sessionId:a}});return l.apply(this,arguments)}function c(a){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b;if(!h)return;yield (b=k)==null?void 0:b.promise;k=new(d("WAResolvable").Resolvable)();j=a;yield p()});return m.apply(this,arguments)}function n(a,b){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=new(d("WABinary").Binary)();c.writeBuffer(a);c.write("_".charCodeAt(0));c.writeBuffer(b);a=c.readByteArray();b=(yield d("WACryptoSha256").sha256(a));return d("WABase64").encodeB64(b)});return o.apply(this,arguments)}function p(a){if(!h||!i)return;var b=i,c=d("WATimeUtils").unixTimeWithoutClockSkewCorrection()-b.regStartTime;if(j==null)return;h=new(d("WAWebMdLinkDeviceCompanionWamEvent").MdLinkDeviceCompanionWamEvent)({mdDurationS:c,mdSessionId:b.sessionId,mdTimestampS:b.regStartTime,mdLinkDeviceCompanionErrorCode:a==null?0:a,mdLinkDeviceCompanionStage:j,mdLinkDeviceExperienceId:d("WAWebLinkDeviceExperience").getWebCompanionLinkDeviceExperienceId()});c=h;c.commitAndWaitForFlush(!0);(b=k)==null?void 0:b.resolve();(a!=null||c.mdLinkDeviceCompanionStage===d("WAWebWamEnumMdLinkDeviceCompanionStage").MD_LINK_DEVICE_COMPANION_STAGE.COMPLETE)&&(h=null,i=null,j=null)}g.initDeviceLinkEvent=a;g.setDeviceLinkPairStage=c;g.commitDeviceLinkEvent=p}),98); __d("WAWebCompanionRegUtils",["WALogger","WAShiftTimer","WATimeUtils","WAWebAdvSignatureApi","WAWebCmd","WAWebLogoutReasonConstants","WAWebSocketLogoutJob","WAWebSocketModel","WAWebUserPrefsIsLoggedIn","WAWebWamDeviceLinkReporter","WAWebWamEnumMdLinkDeviceCompanionStage","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][reg] main screen unblocked in ","ms"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][reg] begin device pairing latency measurement"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["logout due to initial history sync timeout"]);j=function(){return a};return a}var k=!1,l=!1,m=1e3,n=6e4*3;function o(){d("WALogger").ERROR(j()),void d("WAWebSocketLogoutJob").socketLogout(d("WAWebLogoutReasonConstants").LogoutReason.HistorySyncTimeout)}function a(){k=!1,l=!1}function c(){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(k||l)return;yield d("WAWebWamDeviceLinkReporter").setDeviceLinkPairStage(d("WAWebWamEnumMdLinkDeviceCompanionStage").MD_LINK_DEVICE_COMPANION_STAGE.FIRST_CONNECT);k=!0;yield d("WAWebAdvSignatureApi").clearADVSecretKey();d("WAWebUserPrefsIsLoggedIn").setIsConnectedAsRegistered(!0)});return p.apply(this,arguments)}function q(){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(k||l)return;l=!0;yield d("WAWebSocketModel").Socket.clearCredentialsAndStoredData();yield d("WAWebAdvSignatureApi").clearADVSecretKey()});return r.apply(this,arguments)}function e(){new(d("WAShiftTimer").ShiftTimer)(function(){q()}).onOrAfter(m)}var s;function f(){s==null&&(s=self.setTimeout(o,n),d("WAWebCmd").Cmd.on("on_initial_chat_synced",function(){self.clearTimeout(s)}))}function t(){var a=d("WATimeUtils").unixTimeMs();d("WALogger").LOG(i());d("WAWebCmd").Cmd.on("on_critical_sync_done",function(){d("WALogger").LOG(h(),d("WATimeUtils").unixTimeMs()-a)})}g.resetCompanionReg=a;g.startLogin=c;g.startLogout=q;g.logoutAfterValidationFail=e;g.startInitialHistorySyncTimeout=f;g.initDevicePairingLatencyMeasurement=t}),98); __d("WAWebPassiveModeManager",["Promise","WAAbortError","WALogger","WAPromiseRaceAbort","WAResolvable","WASendPassiveModeProtocol","WAWebCmd","WAWebHandleOfflineAbProps","WAWebPageLoadLogging","WAWebQplQuickPerformanceLoggerMarkerIds","WAWebQplQuickPerformanceLoggerModule","WAWebWamOfflineResumeReporter"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["PassiveModeManager: setPassiveModeTimeout: config timeout to be ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["PassiveModeManager: send passive active iq"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["PassiveModeManager: _endPassiveMode"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["PassiveModeManager: executePassiveTasks: passive mode end with timeout"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["PassiveModeManager: executePassiveTasks: done"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["PassiveModeManager: executePassiveTasks: end with error ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["PassiveModeManager: executePassiveTasks: abort by disconnect, skip send active"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["PassiveModeManager: executePassiveTasks: complete all tasks"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["PassiveModeManager: executePassiveTasks: failed for single task with ",""]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["PassiveModeManager: executePassiveTasks: start to execute "," passive tasks"]);r=function(){return a};return a}function a(){var b=babelHelpers.taggedTemplateLiteralLoose(["PassiveModeManager: enable debug passive mode"]);a=function(){return b};return b}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["PassiveModeManager: register passive task"]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["PassiveModeManager: reset status"]);t=function(){return a};return a}function u(){var a=babelHelpers.taggedTemplateLiteralLoose(["PassiveModeManager: processing tasks finished: ",""]);u=function(){return a};return a}function v(){var a=babelHelpers.taggedTemplateLiteralLoose(["PassiveModeManager: "," current tasks"]);v=function(){return a};return a}function w(){var a=babelHelpers.taggedTemplateLiteralLoose(["PassiveModeManager: trying to abort passive mode because of disconnect"]);w=function(){return a};return a}var x=6e4;e=function(){function a(){var a=this;this._disconnectAbortController=new AbortController();this._passiveEndPromise=new(d("WAResolvable").Resolvable)();this._debugPassiveModeEnabled=!1;this._passiveTasks=[];this._passiveModeTimeout=x;d("WAWebCmd").Cmd.on("socket_stream_disconnected",function(){var b;d("WALogger").LOG(w());d("WALogger").LOG(v(),a._passiveTasks.length);d("WALogger").LOG(u(),a._passiveEndPromise.resolveWasCalled());(b=a._disconnectAbortController)==null?void 0:b.abort();a.resetState()})}var e=a.prototype;e.resetState=function(){d("WALogger").LOG(t()),this._passiveTasks=[],this._passiveTimeoutTimer&&(self.clearTimeout(this._passiveTimeoutTimer),this._passiveTimeoutTimer=null),this._debugPassiveModeEnabled=!1,this._passiveEndPromise.resolveWasCalled()||this._passiveEndPromise.resolve(),this._passiveEndPromise=new(d("WAResolvable").Resolvable)(),this._disconnectAbortController=new AbortController()};e.registerPassiveTask=function(a){d("WALogger").LOG(s()),this._passiveTasks.push(a)};e.enableDebugPassiveMode=function(){};e.executePassiveTasks=function(){var a=this;if(!this.shouldConnectAsPassiveMode()){this._passiveEndPromise.resolve();return}d("WAWebPageLoadLogging").startPageLoadQplMeasure("passive_tasks");d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.OFFLINE_RESUME,"PassiveTasks_start");d("WALogger").LOG(r(),this._passiveTasks.length);void c("WAPromiseRaceAbort")((h||(h=b("Promise"))).all(this._passiveTasks.map(function(b){return b(a._disconnectAbortController.signal)["catch"](function(a){if(a.name===d("WAAbortError").ABORT_ERROR)throw a;d("WALogger").ERROR(q(),a)})})),this._disconnectAbortController.signal).then(function(){d("WALogger").LOG(p()),void a._endPassiveMode()})["catch"](d("WAAbortError").catchAbort(function(){d("WALogger").LOG(o()),a._passiveEndPromise.resolve()}))["catch"](function(b){d("WALogger").ERROR(n(),b),void a._endPassiveMode()})["finally"](function(){d("WAWebPageLoadLogging").endPageLoadQplMeasure("passive_tasks"),d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.OFFLINE_RESUME,"PassiveTasks_end"),d("WALogger").LOG(m()),a.resetState()});this._passiveTimeoutTimer=self.setTimeout(function(){var b=d("WALogger").ERROR(l());d("WAWebHandleOfflineAbProps").isNonBlockingOfflineResumeExpEnabled()&&(b=b.tags("offline-resume-experimental"));b.sendLogs("passive-timeout");void a._endPassiveMode();a.resetState()},this._passiveModeTimeout)};e._endPassiveMode=function(){d("WALogger").LOG(k()),this._passiveEndPromise.resolve(),d("WAWebWamOfflineResumeReporter").OfflineResumeReporter.logOfflinePassiveT(),this._debugPassiveModeEnabled||(d("WALogger").LOG(j()),void d("WASendPassiveModeProtocol").sendPassiveModeProtocol("active"))};e.waitForPassiveTaskEnd=function(){return this._passiveEndPromise.promise};e.shouldConnectAsPassiveMode=function(){return this._debugPassiveModeEnabled||this._passiveTasks.length>0};e.setPassiveModeTimeout=function(a){d("WALogger").LOG(i(),a),this._passiveModeTimeout=a};return a}();f=new e();g.PassiveTaskManager=f}),98); __d("WAWebUploadPrekeysForRegTask",["Promise","WAComms","WADeprecatedSendIq","WALogger","WAWap","WAWebConstantsDeprecated","WAWebSignalKeyApi","WAWebSignalStoreApi","WAWebSignalUtilsApi","WAWebUploadPreKeysJob","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["_uploadPreKeys: disconnected, unclear if on server: "," (count: ",", size: ","b)"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["_uploadPreKeys: unrecognized error "," (count: ",", size: ","b)"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["_uploadPreKeys: uploaded invalid keys (count: ",", size: ","b)"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["_uploadPreKeys: server requested backoff "," (count: ",", size: ","b)"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["_uploadPreKeys: "," keys uploaded, raw stanza size: ","b"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["PrekeyUploadForRegistrationTask: start key upload"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["PrekeyUploadForRegistrationTask: successfully generated "," keys"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["PrekeyUploadForRegistrationTask: start key generation"]);p=function(){return a};return a}var q=function(){function a(){}var e=a.prototype;e.startKeyGenerationStage=function(){this.$1||(this.$1=this.$3());return this.$1};e.startKeyUploadStage=function(){this.$2||(this.$2=this.$4());return this.$2};e.$3=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){d("WALogger").LOG(p());var a=(yield (h||(h=b("Promise"))).all([d("WAWebSignalStoreApi").waSignalStore.getRegistrationInfo(),d("WAWebSignalStoreApi").waSignalStore.getSignedPreKey()])),e=a[0];a=a[1];if(!e||!a)throw c("err")("No signal info is available");var f=(yield d("WAWebSignalStoreApi").waSignalStore.getOrGenPreKeys(d("WAWebUploadPreKeysJob").UPLOAD_KEYS_COUNT,d("WAWebSignalKeyApi").generatePreKeyPair));d("WALogger").LOG(o(),f.length);return{regInfo:e,signedPreKey:a,prekeys:f}});function e(){return a.apply(this,arguments)}return e}();e.$4=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=this.$1||this.startKeyGenerationStage();a=(yield a);var b=a.regInfo,e=a.signedPreKey;a=a.prekeys;d("WALogger").LOG(n());var f=a.length;if(f===0)throw c("err")("No preKey is available");var g=a[a.length-1].keyId,h=b.registrationId;b=b.identityKeyPair;h=d("WAWap").wap("iq",{id:d("WAWap").generateId(),xmlns:"encrypt",type:"set",to:d("WAWap").S_WHATSAPP_NET},d("WAWap").wap("registration",null,d("WAWap").BIG_ENDIAN_CONTENT(h)),d("WAWap").wap("type",null,c("WAWebConstantsDeprecated").KEY_BUNDLE_TYPE),d("WAWap").wap("identity",null,b.pubKey),d("WAWap").wap("list",null,a.map(d("WAWebSignalUtilsApi").xmppPreKey)),d("WAWebSignalUtilsApi").xmppSignedPreKey(e));try{yield d("WAComms").waitForConnection();yield d("WAWebSignalStoreApi").waSignalStore.markKeyAsUploaded(g);b=(yield d("WADeprecatedSendIq").deprecatedSendIqWithoutRetry(h,d("WAWebUploadPreKeysJob").uploadPreKeyResParser));if(b.success){d("WAWebSignalStoreApi").waSignalStore.setServerHasPreKeys(!0);d("WALogger").LOG(m(),a.length,h.toString().length);return{success:!0}}e=b.errorCode;e>=500?d("WALogger").WARN(l(),e,f,h.toString().length):e===406?d("WALogger").WARN(k(),f,h.toString().length):d("WALogger").WARN(j(),e,f,h.toString().length);return{errorCode:b.errorCode,errorText:b.errorText}}catch(a){d("WALogger").WARN(i(),a,f,h.toString().length);return}});function e(){return a.apply(this,arguments)}return e}();return a}();function a(){return new q()}g["default"]=a}),98); __d("WAWebRegisterPassiveTasks",["WAAbortError","WACustomError","WALogger","WAPromiseLoop","WAPromiseTimeout","WAWebABPropsLocalStorage","WAWebABPropsWamGlobals","WAWebAbPropsSyncJob","WAWebClearDanglingReceipts","WAWebGetMessageCache","WAWebHandleOfflineAbProps","WAWebOnlineDanglingReceipts","WAWebPassiveModeManager","WAWebSchemaDanglingReceipt","WAWebSignalStoreApi","WAWebUploadPrekeysForRegTask","WAWebUserPrefsGeneral","WAWebWamDeviceLinkReporter","WAWebWamEnumMdLinkDeviceCompanionStage","asyncToGeneratorRuntime","cr:10195"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[passive] flush message cache failed: ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[passive] flush message cache: timeout"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[passive] flush message cache: done"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[passive] flush message cache: stop after "," attempts"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[passive] flush message cache: size: ",", queue size: ",", generation: ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[passive] flush message cache"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["[passive] flush message cache: skip"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["[passive] sending dangling receipts failed: ",""]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["[passive] sending dangling receipts: done"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["[passive] sending dangling receipts"]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["error while sending online dangling receipts, ",""]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["[passive] sending online dangling receipts complete"]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["[passive] start sending online dangling receipts"]);t=function(){return a};return a}function u(){var a=babelHelpers.taggedTemplateLiteralLoose(["error while sync ab props prekeys, ",""]);u=function(){return a};return a}function v(){var a=babelHelpers.taggedTemplateLiteralLoose(["error while uploading prekeys, ",""]);v=function(){return a};return a}function w(){var a=babelHelpers.taggedTemplateLiteralLoose(["[passive] key upload complete"]);w=function(){return a};return a}function x(){var a=babelHelpers.taggedTemplateLiteralLoose(["[passive] start key upload"]);x=function(){return a};return a}var y=4,z=60*1e3;function a(){return A.apply(this,arguments)}function A(){A=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield d("WAWebSignalStoreApi").waSignalStore.getServerHasPreKeys());if(!a){yield d("WAWebWamDeviceLinkReporter").setDeviceLinkPairStage(d("WAWebWamEnumMdLinkDeviceCompanionStage").MD_LINK_DEVICE_COMPANION_STAGE.UPLOAD_PREKEYS);var e=c("WAWebUploadPrekeysForRegTask")();void e.startKeyGenerationStage();d("WAWebPassiveModeManager").PassiveTaskManager.registerPassiveTask(function(a){d("WALogger").LOG(x());return e.startKeyUploadStage().then(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){d("WALogger").LOG(w()),yield d("WAWebWamDeviceLinkReporter").setDeviceLinkPairStage(d("WAWebWamEnumMdLinkDeviceCompanionStage").MD_LINK_DEVICE_COMPANION_STAGE.COMPLETE),yield d("WAWebWamDeviceLinkReporter").commitDeviceLinkEvent()}))["catch"](function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){d("WALogger").ERROR(v(),a).verbose().devConsole(a).sendLogs("error while uploading prekeys"),yield d("WAWebWamDeviceLinkReporter").commitDeviceLinkEvent(-1)});return function(b){return a.apply(this,arguments)}}())})}(!d("WAWebABPropsLocalStorage").isABPropsAfterFirstSync()||(yield d("WAWebUserPrefsGeneral").getWhatsAppWebExternalBetaDirtyBitIdb()))&&(yield d("WAWebPassiveModeManager").PassiveTaskManager.registerPassiveTask(function(a){return d("WAWebAbPropsSyncJob").syncABPropsTask()["catch"](function(a){d("WALogger").WARN(u(),a).verbose()})}),void d("WAWebUserPrefsGeneral").setWhatsAppWebExternalBetaDirtyBitIdb(!1),d("WAWebABPropsWamGlobals").setAbPropDependingGlobalWamAttributes())});return A.apply(this,arguments)}function e(){return B.apply(this,arguments)}function B(){B=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){d("WAWebOnlineDanglingReceipts").hasOnlineDanglingReceipts()&&d("WAWebPassiveModeManager").PassiveTaskManager.registerPassiveTask(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){try{d("WALogger").LOG(t()),yield d("WAWebOnlineDanglingReceipts").sendAndClearOnlineDanglingReceipts(),d("WALogger").LOG(s())}catch(a){d("WALogger").ERROR(r(),a).verbose().devConsole(a).sendLogs("send-online-dangling-receipts-failed")}}));var a=(yield d("WAWebSchemaDanglingReceipt").getTable().count())>0,c=d("WAWebGetMessageCache").getMessageCache().size()>0||d("WAWebGetMessageCache").getMessageCache().checkpointQueue.size()>0;(a||c)&&d("WAWebPassiveModeManager").PassiveTaskManager.registerPassiveTask(function(){var e=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){if(a)try{d("WALogger").LOG(q()),yield d("WAWebClearDanglingReceipts").sendAndClearDanglingReceipts(b),d("WALogger").LOG(p())}catch(a){if(a.name===d("WAAbortError").ABORT_ERROR)throw a;d("WALogger").ERROR(o(),a).verbose().devConsole(a).sendLogs("send-and-clear-dangling-receipts-failed")}c&&(yield D())});return function(a){return e.apply(this,arguments)}}())});return B.apply(this,arguments)}var C=null;function D(){return E.apply(this,arguments)}function E(){E=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(C){d("WALogger").LOG(n());return C}try{d("WALogger").LOG(m());var a=d("WAPromiseLoop").promiseLoop(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){d("WALogger").LOG(l(),d("WAWebGetMessageCache").getMessageCache().size(),d("WAWebGetMessageCache").getMessageCache().checkpointQueue.size(),c),d("WAWebGetMessageCache").getMessageCache().size()>0&&d("WAWebGetMessageCache").getMessageCache().createSnapshot(),yield d("WAWebGetMessageCache").getMessageCache().checkpointQueue.wait(),d("WAWebGetMessageCache").getMessageCache().size()===0&&d("WAWebGetMessageCache").getMessageCache().checkpointQueue.size()===0?a():c+1>=y&&(d("WALogger").WARN(k(),y),a())});return function(b,c,d){return a.apply(this,arguments)}}());C=d("WAPromiseTimeout").promiseTimeout(a,z);yield C;d("WALogger").LOG(j())}catch(b){if(b instanceof d("WACustomError").TimeoutError){a=d("WALogger").ERROR(i());d("WAWebHandleOfflineAbProps").isNonBlockingOfflineResumeExpEnabled()&&(a=a.tags("offline-resume-experimental"));a.sendLogs("passive-flush-message-cache-timeout",{sampling:.01})}else d("WALogger").ERROR(h(),b).verbose().devConsole(b).sendLogs("passive-flush-message-cache-failed",{sampling:.01})}finally{C=null}});return E.apply(this,arguments)}g.registerPassiveTaskForStartUp=a;g.registerPassiveTasksForConnect=e}),98); __d("WAWebAdvStoredTimestampExpiredWamEvent",["WAWebWamCodegenUtils"],(function(a,b,c,d,e,f,g){a=d("WAWebWamCodegenUtils").defineEvents({AdvStoredTimestampExpired:[3036,{advExpireTimeInHours:[1,d("WAWebWamCodegenUtils").TYPES.INTEGER]},[1,1,1],"regular"]},{AdvStoredTimestampExpired:[]});g.AdvStoredTimestampExpiredWamEvent=a}),98); __d("WAWebAdvDeviceInfoCheckJob",["Promise","WAJids","WALogger","WATimeUtils","WAWebABProps","WAWebAdvStoredTimestampExpiredWamEvent","WAWebApiDeviceList","WAWebApiPendingDeviceSync","WAWebApiTasksScheduledTime","WAWebIdentityUpdateDeviceTableApi","WAWebLastADVCheckTimeApi","WAWebLogoutReasonConstants","WAWebSocketLogoutJob","WAWebUserPrefsMeUser","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["error running the adv device check job"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["skip first run"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["scheduled in "," seconds"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["Logging out due to own expired device"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["adv_device_info_check: sending usync query"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["adv: error sending usync query: ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["adv: removing companions: ",""]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["adv: running device info check with t=",""]);p=function(){return a};return a}var q=25*d("WATimeUtils").HOUR_SECONDS,r=function(){function a(a){this.advToSystemBridge=a}var c=a.prototype;c.run=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){d("WALogger").DEV(p(),a).tags("automated-device-verification");var b=this.advToSystemBridge,c=(yield b.getUsersForExpiration(a)),e=c.usersExpired;c=c.usersCloseToExpiration;d("WALogger").DEV(o(),Array.from(e.entries()).map(function(a){var b=a[0];a=a[1];return"\n\t"+b.toString()+" (t="+a.timestamp+")"})).tags("automated-device-verification");b.removeCompanions(e);b.sendADVStoredTimestampExpiredEvents(e,a);a=Array.from(e.keys()).concat(Array.from(c.keys())).filter(function(a){return!b.canRemoveUserDevices(a)});b.sendOrQueueDeviceUsyncQuery(a)["catch"](function(a){return d("WALogger").DEV(n(),a).tags("automated-device-verification")});return b.recordLocalTimestamp()});function c(b){return a.apply(this,arguments)}return c}();return a}(),s=function(){function a(){}var c=a.prototype;c.getNumDaysKeyIndexListExpiration=function(){return d("WAWebABProps").getABPropConfigValue("num_days_key_index_list_expiration")};c.getNumDaysBeforeDeviceExpiryCheck=function(){return d("WAWebABProps").getABPropConfigValue("num_days_before_device_expiry_check")};c.getUsersForExpiration=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=this,c=(yield d("WAWebApiDeviceList").getAllDeviceLists()),e=(yield d("WAWebLastADVCheckTimeApi").getLastADVDeviceInfoCheckTime()),f=this.getNumDaysKeyIndexListExpiration()*d("WATimeUtils").DAY_SECONDS,g=new Map(),h=new Map();c.forEach(function(c){if(c.deleted||z(c))return;else A(a,f,c,e)?g.set(d("WAWebWidFactory").createUserWid(c.id),c):B(a,f-b.getNumDaysBeforeDeviceExpiryCheck()*d("WATimeUtils").DAY_SECONDS,c)&&h.set(d("WAWebWidFactory").createUserWid(c.id),c)});return{usersExpired:g,usersCloseToExpiration:h}});function c(b){return a.apply(this,arguments)}return c}();c.sendADVStoredTimestampExpiredEvents=function(a,b){var c=this;a.forEach(function(a){a=b-(a.timestamp+c.getNumDaysKeyIndexListExpiration()*d("WATimeUtils").DAY_SECONDS);if(a<0)return;a=Math.round(a/d("WATimeUtils").HOUR_SECONDS);new(d("WAWebAdvStoredTimestampExpiredWamEvent").AdvStoredTimestampExpiredWamEvent)({advExpireTimeInHours:a}).commit()})};c.sendOrQueueDeviceUsyncQuery=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){d("WALogger").DEV(m());yield d("WAWebApiPendingDeviceSync").addUserToPendingDeviceSync(a.map(function(a){return a.toString()}));return d("WAWebApiPendingDeviceSync").doPendingDeviceSync()});function c(b){return a.apply(this,arguments)}return c}();c.canRemoveUserDevices=function(a){return!1};c.removeCompanions=function(a){var c=Array.from(a.entries());c=c.some(function(a){var b=a[0];a[1];return b.user===d("WAWebUserPrefsMeUser").getMeUser().user});if(c&&d("WAWebABProps").getABPropConfigValue("web_adv_logout_on_self_device_list_expired")){d("WALogger").LOG(l());void d("WAWebSocketLogoutJob").socketLogout(d("WAWebLogoutReasonConstants").LogoutReason.InvalidAdvStatus);return(h||(h=b("Promise"))).resolve()}return(h||(h=b("Promise"))).all(Array.from(a.entries()).map(function(a){var b=a[0];a=a[1];return d("WAWebIdentityUpdateDeviceTableApi").clearDeviceRecord(b,a.devices)}))};c.recordLocalTimestamp=function(){return(h||(h=b("Promise"))).resolve()};return a}(),t="advDeviceInfoCheck",u;function v(){return w.apply(this,arguments)}function w(){w=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){u!=null&&(self.clearTimeout(u),u=null);var a=d("WATimeUtils").unixTimeWithoutClockSkewCorrection(),c=(yield d("WAWebLastADVCheckTimeApi").getLastADVDeviceInfoCheckTime()),e=0,f=function(){return(h||(h=b("Promise"))).resolve()};c!=null?(e=Math.max(d("WATimeUtils").DAY_SECONDS-(a-c),0),f=function(){return y()},d("WALogger").DEV(k(),e).tags("automated-device-verification")):d("WALogger").DEV(j()).tags("automated-device-verification");u=self.setTimeout(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){try{yield f()}catch(a){d("WALogger").ERROR(i()).tags("automated-device-verification")}u=null;var a=d("WATimeUtils").unixTimeWithoutClockSkewCorrection();d("WAWebLastADVCheckTimeApi").setLastADVDeviceInfoCheckTime(a);d("WAWebApiTasksScheduledTime").updateTaskScheduledTime(t,d("WATimeUtils").castToUnixTime(a));v()}),e*1e3)});return w.apply(this,arguments)}var x;function y(){x==null&&(x=new r(new s()));return x.run(d("WATimeUtils").unixTimeWithoutClockSkewCorrection())}function z(a){return a.devices.length===1&&a.devices[0].id===d("WAJids").DEFAULT_DEVICE_ID}function A(a,b,c,d){if(a-c.timestamp>=b)return!0;return c.expectedTsUpdateTs!=null?a-c.expectedTsUpdateTs>=q&&c.expectedTsLastDeviceJobTs!==d:!1}function B(a,b,c){if(a-c.timestamp>=b)return!0;return c.expectedTs!=null?c.expectedTs>c.timestamp:!1}g.AdvToSystemBridgeImpl=s;g.scheduleAdvDeviceInfoCheck=v;g.runAdvDeviceInfoCheck=y}),98); __d("WAWebBackfillLidOriginCtwa",["WAJobOrchestratorTypes","WALogger","WAWebOrchestratorNonPersistedJob","WAWebSchemaChat","WAWebUserPrefsIndexedDBStorage","WAWebUsernameTypes","WAWebWid","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[lid] backfillLidOriginCtwa failed"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[lid] end backfillLidOriginCtwa"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[lid] backfillLidOriginCtwa with "," chats"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[lid] begin backfillLidOriginCtwa"]);k=function(){return a};return a}function a(){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.get("WABackfillLidOriginCtwaComplete")===!0)return;d("WALogger").LOG(k());return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("backfillLidOriginCtwa",b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield d("WAWebSchemaChat").getChatTable().all()).filter(function(a){var b=a.id;a=a.lidOriginType;return c("WAWebWid").isLid(b)&&a==null});a.length>0&&(yield d("WAWebSchemaChat").getChatTable().bulkCreateOrMerge(a.map(function(a){a=a.id;return{id:a,lidOriginType:d("WAWebUsernameTypes").LidOriginType.PNH_CTWA}})),d("WALogger").LOG(j(),a.length).sendLogs("backfill-lid-origin-nonempty",{sampling:0}));yield d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.set("WABackfillLidOriginCtwaComplete",!0);d("WALogger").LOG(i())}),{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.LOW}).waitUntilCompleted()["catch"](function(){d("WALogger").ERROR(h()).sendLogs("backfill-lid-origin-failed")})});return l.apply(this,arguments)}g.maybeBackfillLidOriginCtwa=a}),98); __d("WAWebSetWorkerLocalStorage",["WANullthrows","WAWebApiLocalStorage","WAWebUserPrefsKeys","WAWebUserPrefsMeUser","WAWebWidToJid","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=c("WANullthrows")(d("WAWebUserPrefsMeUser").getMaybeMeLid()),b=d("WAWebUserPrefsMeUser").getMeDisplayName();a=[{key:"deviceJid",value:d("WAWebWidToJid").widToDeviceJid(d("WAWebUserPrefsMeUser").assertGetMe())},{key:"lidDeviceJid",value:a.toString()},{key:d("WAWebUserPrefsKeys").KEYS.ME_DISPLAY_NAME,value:b}];yield d("WAWebApiLocalStorage").updateLocalStorage(a)});return h.apply(this,arguments)}function e(){return d("WAWebApiLocalStorage").clearLocalStorage()}g.setWorkerLocalStorage=a;g.clearWorkerLocalStorage=e}),98); __d("WAWebBackgroundSyncAction",["WALogger","WATimeUtils","WAWebABProps","WAWebPushNotificationsGatingUtils","WAWebPwaDocumentMetadataUtils","WAWebSetWorkerLocalStorage","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["pwa-background-sync-registration-update-failure: ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["pwa background sync is already unregistered"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["pwa background sync unregistered successfully"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["pwa background sync failed to unregister"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["Start pwa background sync unregistration"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["pwa background sync is already registered"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["pwa background sync failed to register"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["pwa background sync registered successfully"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["Start pwa background sync registration"]);p=function(){return a};return a}var q="background-sync";function a(a){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a===void 0&&(a=!1);try{var b,c,e;if(!d("WAWebPushNotificationsGatingUtils").canSupportPeriodicBackgroundSync()||!d("WAWebPwaDocumentMetadataUtils").isCurrentWebSessionInsidePwa())return;b=(yield (b=window.navigator.serviceWorker)==null?void 0:b.ready);if(!("periodicSync"in((c=b)!=null?c:[])))return;c=b==null?void 0:b.periodicSync;if(!c)return;b=(yield c.getTags==null?void 0:c.getTags());if(!b)return;e=(yield (e=window.navigator.permissions)==null?void 0:e.query==null?void 0:e.query({name:"background-sync"}));if((e==null?void 0:e.state)!=="granted")return;e=d("WAWebABProps").getABPropConfigValue("web_pwa_background_sync");if(!a&&e){yield d("WAWebSetWorkerLocalStorage").setWorkerLocalStorage();if(!b.includes(q)){d("WALogger").LOG(p());yield c.register==null?void 0:c.register(q,{minInterval:d("WAWebABProps").getABPropConfigValue("web_pwa_background_sync_min_interval_hours")*d("WATimeUtils").HOUR_MILLISECONDS});a=(yield c.getTags==null?void 0:c.getTags());(a==null?void 0:a.includes==null?void 0:a.includes(q))?d("WALogger").LOG(o()):d("WALogger").LOG(n())}else d("WALogger").LOG(m())}else if(b.includes(q)){d("WALogger").LOG(l());yield c.unregister==null?void 0:c.unregister(q);e=(yield c.getTags==null?void 0:c.getTags());(e==null?void 0:e.includes==null?void 0:e.includes(q))?d("WALogger").LOG(k()):d("WALogger").LOG(j())}else d("WALogger").LOG(i())}catch(a){d("WALogger").ERROR(h(),a.stack).devConsole(a).sendLogs("pwa-background-sync-registration-update-failure")}});return r.apply(this,arguments)}g.updatePeriodicBackgroundSyncRegistration=a}),98); __d("WAWebUserPrefsCartLidMigration",["WAWebUserPrefsKeys","WAWebUserPrefsStore"],(function(a,b,c,d,e,f,g){function a(a){c("WAWebUserPrefsStore").set(d("WAWebUserPrefsKeys").UserPrefs.CartDbLidMigrationComplete,a)}function b(){return c("WAWebUserPrefsStore").get(d("WAWebUserPrefsKeys").UserPrefs.CartDbLidMigrationComplete)===!0}g.setCartLidMigrationValue=a;g.isCartLidMigrationComplete=b}),98); __d("WAWebCartDbLidMigration",["WALogger","WAWebLid1X1MigrationGating","WAWebLidMigrationUtils","WAWebModelStorageUtils","WAWebUserPrefsCartLidMigration","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[LID] Failed to migrate cart db : ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["cartDbLidMigration: migration success"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["cartDbLidMigration: updated records: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["cartDbLidMigration: end migration with no records"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["cartDbLidMigration: start migration"]);l=function(){return a};return a}function a(){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(!d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()||d("WAWebUserPrefsCartLidMigration").isCartLidMigrationComplete())return;try{yield d("WAWebModelStorageUtils").getStorage().lock(["cart"],function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a[0];d("WALogger").LOG(l());var b=(yield a.all()),c=[];b=b.map(function(a){var b=a.id,e=d("WAWebWidFactory").createUserWid(b);if(e.isLid())return null;var f=d("WAWebLidMigrationUtils").toPn(e);e=d("WAWebLidMigrationUtils").toLid(e);if(e==null||(f==null?void 0:f.user)==null)return null;a.id=e.toString();c.push(b.toString());return{id:e.toString(),message:a.message,total:a.total,currency:a.currency,itemCount:a.itemCount,products:a.products}}).filter(Boolean);if(b.length===0){d("WALogger").LOG(k());d("WAWebUserPrefsCartLidMigration").setCartLidMigrationValue(!0);return}d("WALogger").LOG(j(),b.length);yield a.bulkCreateOrReplace(b);yield a.bulkRemove(c);d("WAWebUserPrefsCartLidMigration").setCartLidMigrationValue(!0);d("WALogger").LOG(i())});return function(b){return a.apply(this,arguments)}}())}catch(a){d("WAWebUserPrefsCartLidMigration").setCartLidMigrationValue(!1),d("WALogger").ERROR(h(),a).sendLogs("lid-cart-migration")}});return m.apply(this,arguments)}g.migrateCartDbLid=a}),98); __d("WAWebUserPrefsFavoritesLidMigration",["WAWebUserPrefsKeys","WAWebUserPrefsStore"],(function(a,b,c,d,e,f,g){function a(){c("WAWebUserPrefsStore").set(d("WAWebUserPrefsKeys").UserPrefs.FavoritesLidTableMigrationComplete,!0)}function b(){return c("WAWebUserPrefsStore").get(d("WAWebUserPrefsKeys").UserPrefs.FavoritesLidTableMigrationComplete)===!0}g.setFavoritesMigrationAsComplete=a;g.isFavoritesMigrationComplete=b}),98); __d("WAWebDBFavoriteDatabaseMigrationToLid",["WALogger","WAWebApiContact","WAWebLid1X1MigrationGating","WAWebModelStorageUtils","WAWebUserPrefsFavoritesLidMigration","WAWebWidFactory","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["migrateFavoritesDatabaseToLid: migration complete, success"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["migrateFavoritesDatabaseToLid: migration error: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["migrateFavoritesDatabaseToLid: all favorites after migration: "," does not match all favorites: "," minus deduped ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["migrateFavoritesDatabaseToLid: all favorites after migration: ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["migrateFavoritesDatabaseToLid: not found account lids: ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["migrateFavoritesDatabaseToLid: deduped favourites: ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["migrateFavoritesDatabaseToLid: not found chat rows: ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["migrateFavoritesDatabaseToLid: found "," favorites to migrate"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["migrateFavoritesDatabaseToLid: no favorites to migrate"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["migrateFavoritesDatabaseToLid: loaded "," favorites"]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["migrateFavoritesDatabaseToLid: start migration"]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["migrateFavoritesDatabaseToLid: 1-1 threads are not migrated to lid"]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["migrateFavoritesDatabaseToLid: migration already complete"]);t=function(){return a};return a}function a(){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(d("WAWebUserPrefsFavoritesLidMigration").isFavoritesMigrationComplete()){d("WALogger").LOG(t());return}if(!d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()){d("WALogger").ERROR(s()).sendLogs("migrateFavoritesDatabaseToLid-1-1-not-migrated");return}var a=!1;yield d("WAWebModelStorageUtils").getStorage().lock(["favorite","chat"],function(){var e=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){var e=b[0];b=b[1];e=e;b=b;try{d("WALogger").LOG(r());var f=(yield e.all()),g=[],h=new Set();d("WALogger").LOG(q(),f.length);f.forEach(function(a){var b=a.id,c=d("WAWebWidFactory").createWid(b);if(!c.isRegularUser())return;if(c.isLid()){h.add(b);return}g.push(a)});if(g.length===0){d("WALogger").LOG(p());a=!0;return}d("WALogger").LOG(o(),g.length);var s=g.map(function(a){return a.id}),t=(yield b.bulkGet(s)),u=0,v=0,w=0,x=[],y=[];g.forEach(function(a,b){var c=null,e=t[b];e!=null?c=e.accountLid:u++;if(c==null){c=(b=d("WAWebApiContact").getCurrentLid(d("WAWebWidFactory").createUserWid(s[b])))==null?void 0:b.toString();if(c==null){e!=null&&v++;return}}if(h.has(c)){w++;x.push(a.id);return}x.push(a.id);y.push(babelHelpers["extends"]({},a,{id:c}))});d("WALogger").LOG(n(),u);d("WALogger").LOG(m(),w);v>0&&d("WALogger").ERROR(l(),v).sendLogs("migrateFavoritesDatabaseToLid-not-found-account-lids");yield e.bulkRemove(x);yield e.bulkCreate(y);b=(yield e.count());d("WALogger").LOG(k(),b);if(b!==f.length-w){d("WALogger").ERROR(j(),b,f.length,w).sendLogs("migrateFavoritesDatabaseToLid-all-favorites-after-migration-mismatch");throw c("err")("migrateFavoritesDatabaseToLid: mismatch after migration")}a=v===0}catch(a){d("WALogger").ERROR(i(),a.message).sendLogs("migrateFavoritesDatabaseToLid-error");throw a}});return function(a){return e.apply(this,arguments)}}());a&&(d("WALogger").LOG(h()),d("WAWebUserPrefsFavoritesLidMigration").setFavoritesMigrationAsComplete())});return u.apply(this,arguments)}g.migrateFavoritesDatabaseToLid=a}),98); __d("WAWebDBLabelAssociationDatabaseMigrationToLid",["WALogger","WAWebApiContact","WAWebLid1X1MigrationGating","WAWebModelStorageUtils","WAWebSchemaLabelAssociation","WAWebUserPrefsLabelAssociationsLidMigration","WAWebWidFactory","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["migrateLabelAssociationsDatabaseToLid: migration complete, success"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["migrateLabelAssociationsDatabaseToLid: migration error: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["migrateLabelAssociationsDatabaseToLid: all associations after migration: "," does not match all LabelAssociations: "," minus deduped ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["migrateLabelAssociationsDatabaseToLid: all associations after migration: ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["migrateLabelAssociationsDatabaseToLid: not found account lids: ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["migrateLabelAssociationsDatabaseToLid: deduped associations: ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["migrateLabelAssociationsDatabaseToLid: not found chat rows: ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["migrateLabelAssociationsDatabaseToLid: found "," associations to migrate"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["migrateLabelAssociationsDatabaseToLid: no associations to migrate"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["migrateLabelAssociationsDatabaseToLid: loaded "," associations"]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["migrateLabelAssociationsDatabaseToLid: start migration"]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["migrateLabelAssociationsDatabaseToLid: 1-1 threads are not migrated to lid"]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["migrateLabelAssociationsDatabaseToLid: migration already complete"]);t=function(){return a};return a}function a(){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(d("WAWebUserPrefsLabelAssociationsLidMigration").isLabelAssociationsMigrationComplete()){d("WALogger").LOG(t());return}if(!d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()){d("WALogger").ERROR(s()).sendLogs("migrateLabelAssociationsDatabaseToLid-1-1-not-migrated");return}var a=!1;yield d("WAWebModelStorageUtils").getStorage().lock(["label-association","chat"],function(){var e=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){var e=b[0];b=b[1];e=e;b=b;try{d("WALogger").LOG(r());var f=(yield e.all()),g=[],h=new Set();d("WALogger").LOG(q(),f.length);f.forEach(function(a){var b=a.associationId,c=a.type;if(c!==d("WAWebSchemaLabelAssociation").LabelAssociationType.Jid)return;c=d("WAWebWidFactory").createWid(b);if(!c.isRegularUser())return;if(c.isLid()){h.add(b);return}g.push(a)});if(g.length===0){d("WALogger").LOG(p());a=!0;return}d("WALogger").LOG(o(),g.length);var s=g.map(function(a){return a.associationId}),t=(yield b.bulkGet(s)),u=0,v=0,w=0,x=[],y=[];g.forEach(function(a,b){var c=null,e=t[b];e!=null?c=e.accountLid:u++;if(c==null){c=(b=d("WAWebApiContact").getCurrentLid(d("WAWebWidFactory").createUserWid(s[b])))==null?void 0:b.toString();if(c==null){e!=null&&v++;return}}if(h.has(c)){w++;x.push(d("WAWebSchemaLabelAssociation").createLabelAssociationPrimaryKey(a));return}x.push(d("WAWebSchemaLabelAssociation").createLabelAssociationPrimaryKey(a));y.push(babelHelpers["extends"]({},a,{associationId:c}))});d("WALogger").LOG(n(),u);d("WALogger").LOG(m(),w);v>0&&d("WALogger").ERROR(l(),v).sendLogs("migrateLabelAssociationsDatabaseToLid-not-found-account-lids");yield e.bulkRemove(x);yield e.bulkCreate(y);b=(yield e.count());d("WALogger").LOG(k(),b);if(b!==f.length-w){d("WALogger").ERROR(j(),b,f.length,w).sendLogs("migrateLabelAssociationsDatabaseToLid-all-associations-after-migration-mismatch");throw c("err")("migrateLabelAssociationsDatabaseToLid: mismatch after migration")}a=v===0}catch(a){d("WALogger").ERROR(i(),a.message).sendLogs("migrateLabelAssociationsDatabaseToLid-error");throw a}});return function(a){return e.apply(this,arguments)}}());a&&(d("WALogger").LOG(h()),d("WAWebUserPrefsLabelAssociationsLidMigration").setLabelAssociationsMigrationAsComplete())});return u.apply(this,arguments)}g.migrateLabelAssociationsDatabaseToLid=a}),98); __d("WAWebEventsWaitForMain",["Promise","WAWebCmd","WAWebEventsWaitForBbEvent"],(function(a,b,c,d,e,f,g){var h;function a(){return d("WAWebCmd").Cmd.isMainLoaded?(h||(h=b("Promise"))).resolve():c("WAWebEventsWaitForBbEvent")(d("WAWebCmd").Cmd,"main_loaded")}g["default"]=a}),98); __d("WAWebFtsClientMessageIdResolver",["WAWebDBMessageSerialization","WAWebSchemaMessage"],(function(a,b,c,d,e,f,g){function a(a){var b=a.map(function(a){return+a.id}),c=new Map(a.map(function(a){return[+a.id,a]}));return d("WAWebSchemaMessage").getMessageTable().anyOf(["rowId"],b).then(function(a){var b=[];a.forEach(function(a){a=d("WAWebDBMessageSerialization").messageFromDbRow(a);var e=c.get(a.rowId);e!=null&&e.id===String(a.rowId)&&e.timestamp===a.t&&e.chatId===a.id.remote.toString()&&(b.push(a),c["delete"](a.rowId))});a=Array.from(c.keys(),function(a){return String(a)});b.sort(function(a,b){return b.t-a.t});return{resolved:b,unresolved:a}})}g.resolveMsgIds=a}),98); __d("WAWebFtsGenRequestId",[],(function(a,b,c,d,e,f){var g=0;function a(){return g++}f["default"]=a}),66); __d("WAWebBrokerMainConnect",["WAWebBrokerConnectionManager","WAWebBrokerProtocolHandshake","WAWebInvocationDispatcher","WAWebInvocationHandler"],(function(a,b,c,d,e,f,g){function a(a){var b=new MessageChannel(),e=b.port1;b=b.port2;c("WAWebInvocationHandler").respondTo(e);c("WAWebBrokerConnectionManager").init();c("WAWebInvocationDispatcher").setConnectionManager(c("WAWebBrokerConnectionManager"));c("WAWebBrokerConnectionManager").connectVia(e);a.postMessage(d("WAWebBrokerProtocolHandshake").buildHandshakePayload(b),[b])}g["default"]=a}),98); __d("WAWebFtsWorkerAdapter",["WANullthrows","WAWebBrokerMainConnect","WAWebFtsWorkerResource","WorkerBundleResource"],(function(a,b,c,d,e,f,g){var h=null,i=function(){function a(){this.worker=null}var b=a.prototype;b.initialize=function(a,b){this.worker=d("WorkerBundleResource").createDedicatedWebWorker(c("WAWebFtsWorkerResource")),c("WANullthrows")(this.worker).onmessage=function(b){a(b.data.message)},c("WANullthrows")(this.worker).onerror=b,c("WAWebBrokerMainConnect")(this)};b.postMessage=function(a,b){a={type:"message",message:a};c("WANullthrows")(this.worker).postMessage(a,b)};b.terminate=function(){c("WANullthrows")(this.worker).terminate()};return a}();function a(a,b){h||(h=new i(),h.initialize(a,b));return h}g.getFtsWorker=a}),98); __d("WAWebFtsClient",["Promise","WALogger","WANullthrows","WAWebEnvironment","WAWebFtsClientMessageIdResolver","WAWebFtsGenRequestId","WAWebFtsWorkerAdapter","asyncToGeneratorRuntime","cr:1274","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["FTS:client: worker completed job "," with error"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["FTS:client: worker error: ",""]);j=function(){return a};return a}e=(a=b("cr:1274"))!=null?a:{};f=e.FtsSQLiteClient;a=function(){function a(){this.$2=new Map()}var e=a.prototype;e.initialize=function(){var a=this;if(!this.$1){var b=function(b){a.$3(b)},c=function(b){return a.$4(b)};b=d("WAWebFtsWorkerAdapter").getFtsWorker(b,c);this.$1=b}};e.$4=function(a){d("WALogger").WARN(j(),a)};e.$3=function(a){var b=a.reqId,e=this.$2.get(b);e&&(a.error?(d("WALogger").WARN(i(),e.command.operation),e.reject(c("err")("FTS worker error"))):e.resolve(a.result),this.$5(b))};e.startIndexer=function(){return this.$6({operation:"start-indexer"})};e.indexFull=function(a){return this.$6({operation:"run"})};e.index=function(){return this.$6({operation:"consume"})};e.purge=function(a){return this.$6({operation:"purge",ids:a})};e.purgeRange=function(a){return this.$6(babelHelpers["extends"]({operation:"purge-range"},a))};e.reInit=function(){return this.$6({operation:"re-init"})};e.initExternalStorage=function(){return(h||(h=b("Promise"))).resolve()};e.destroyExternalStorage=function(){return(h||(h=b("Promise"))).resolve()};e.clearInitializationPromises=function(){return this.$6({operation:"clear-init"})};e.search=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=(yield this.$6({operation:"find",query:a,queryOptions:b}));return this.$7(a)});function c(b,c){return a.apply(this,arguments)}return c}();e.$7=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(Array.isArray(a)||typeof a==="boolean")return{canceled:!1,eof:!0,status:404,messages:[]};var b=(yield d("WAWebFtsClientMessageIdResolver").resolveMsgIds(a.messages)),c=b.resolved;b=b.unresolved;var e=a.eof;a=a.status;b.length>0&&this.purge(b);return{canceled:!1,eof:e,status:a,messages:c}});function c(b){return a.apply(this,arguments)}return c}();e.$6=function(a){var d=this;this.initialize();var e=c("WAWebFtsGenRequestId")();return new(h||(h=b("Promise")))(function(b,c){var f={command:a,reqId:e};d.$2.set(e,{resolve:b,reject:c,command:a});d.$8(f)})["finally"](function(){d.$5(e)})};e.$5=function(a){this.$2["delete"](a)};e.$8=function(a){c("WANullthrows")(this.$1).postMessage(a)};return a}();e=f!=null&&c("WAWebEnvironment").isWindows?new f():new a();g.ftsClient=e}),98); __d("WAWebHistorySyncProgress",["Promise","WALogger","WAWebBackendApi","WAWebCmd","WAWebProtobufsHistorySync.pb","WAWebUserPrefsHistorySync","WAWebUserPrefsTypes","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] computeProgress: compute progress when the first history sync chunk is downloaded"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] computeProgress: compute progress when the last processed history sync chunk is completed"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["updateProgressModel: error computing progress"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] sync complete, clearing paused timer "]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] initial sync complete, starting paused timer"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] ","s have passed without chunk uploads from phone, setting paused state..."]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] setting history sync paused timeout to ","s"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] clearing history sync paused timeout"]);p=function(){return a};return a}var q=2*60,r=3,s=null;function t(){d("WALogger").DEV(p()),s!=null&&self.clearTimeout(s)}function u(){t(),d("WALogger").DEV(o(),q),s=self.setTimeout(function(){d("WALogger").DEV(n(),q),z(!0)},q*1e3)}var v=0;function a(a){v=a?0:v+1,v===0&&u(),z(v>=3)}function c(){return w.apply(this,arguments)}function w(){w=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){try{var a=(yield (h||(h=b("Promise"))).all([x(),d("WAWebUserPrefsHistorySync").getHistorySyncStatus()])),c=a[0];a=a[1];a=(a==null?void 0:a.recentCompleted)!==!0;d("WAWebBackendApi").frontendFireAndForget("setHistorySyncProgress",{incomplete:a});c!=null&&d("WAWebBackendApi").frontendFireAndForget("setHistorySyncProgress",{progress:c})}catch(a){d("WALogger").ERROR(k())}});return w.apply(this,arguments)}function x(){return y.apply(this,arguments)}function y(){y=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield d("WAWebUserPrefsHistorySync").getChunkCountForEndOfRecentHistorySync());if(a===0){a=(yield d("WAWebUserPrefsHistorySync").getEstimatedChunkCountForEndOfRecentHistorySync());if(a===0)return}var b=(yield d("WAWebUserPrefsHistorySync").getLastHistorySyncedChunk());if(b!=null){b=b.split("_").map(function(a){return parseInt(a,10)});var c=b[0];b=b[1];if(c===d("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.RECENT){c=Math.floor(b/a*100);d("WALogger").LOG(j());return Math.min(100,c)}}return A(a)});return y.apply(this,arguments)}function z(a){d("WAWebBackendApi").frontendFireAndForget("setHistorySyncPaused",{paused:a})}function A(a){return B.apply(this,arguments)}function B(){B=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b;b=(b=(yield d("WAWebUserPrefsHistorySync").getRecentSyncSingleChunkStatus()))==null?void 0:b[1];if(b==null||[d("WAWebUserPrefsTypes").HistorySyncSingleChunkStatusType.RECEIVED,d("WAWebUserPrefsTypes").HistorySyncSingleChunkStatusType.NOTIFICATION_STORED,d("WAWebUserPrefsTypes").HistorySyncSingleChunkStatusType.DOWNLOADING].includes(b))return null;d("WALogger").LOG(i());b=Math.floor(1/a/r*100);return Math.min(100,b)});return B.apply(this,arguments)}d("WAWebCmd").Cmd.on("on_critical_sync_done",function(){d("WALogger").DEV(m()),u()});d("WAWebCmd").Cmd.on("on_recent_chat_history_synced",function(){d("WALogger").DEV(l()),t(),z(!1),d("WAWebBackendApi").frontendFireAndForget("setHistorySyncProgress",{progress:100,incomplete:!1})});g.handleChunkProgress=a;g.updateHistorySyncProgressModel=c}),98); __d("WAWebInboxFiltersGatingUtils",["WAWebABProps","WAWebMobilePlatforms","WAWebPrimaryFeatures"],(function(a,b,c,d,e,f,g){function h(){return d("WAWebMobilePlatforms").isSMB()?d("WAWebABProps").getABPropConfigValue("inbox_filters_smb_enabled"):!0}function a(){return h()&&d("WAWebPrimaryFeatures").primaryFeatureEnabled("primary_favorites_sync_support")}function b(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("inbox_filters_smb_enabled")&&d("WAWebABProps").getABPropConfigValue("inbox_filters_custom_smb_enabled")}g.inboxFiltersEnabled=h;g.inboxFavoritesEnabled=a;g.inboxCustomFiltersEnabled=b}),98); __d("WAWebJestE2ELogUtils",["gkx"],(function(a,b,c,d,e,f,g){function a(a){c("gkx")("26256")}g.maybeLogToJestE2eJSConsole=a}),98); __d("WAWebLid1x1MigrationManager",["Promise","WALogger","WAWebLid1X1MigrationGating","WAWebLid1X1ThreadAccountMigrations","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Lid1x1ThreadMigrationManager: executeMigrationTasks failed: error: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Lid1x1ThreadMigrationManager: executed all {","} dependent migration tasks"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["Lid1x1ThreadMigrationManager: no dependant migration tasks"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["Lid1x1ThreadMigrationManager: register dependant migration task"]);l=function(){return a};return a}a=function(){function a(){this.$1=[]}var c=a.prototype;c.addDependentMigrationTask=function(a){d("WALogger").LOG(l()),this.$1.push(a)};c.executeMigrationIfNeeded=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){d("WAWebLid1X1ThreadAccountMigrations").shouldMigrateNow()&&!d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()&&(yield d("WAWebLid1X1ThreadAccountMigrations").migrate1x1Chats());if(this.$1.length===0){d("WALogger").LOG(k());return}var a=d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated();try{a&&(yield (h||(h=b("Promise"))).all(this.$1.map(function(a){return a()})),d("WALogger").LOG(j(),this.$1.length))}catch(a){d("WALogger").ERROR(i(),a)}});function c(){return a.apply(this,arguments)}return c}();return a}();c=new a();g.ThreadMigrationManager=c}),98); __d("WAWebLid1x1MigrationTimeoutUtils",["WALogger","WASyncAction.pb","WASyncdConst","WATimeUtils","WAWebABProps","WAWebLid1X1MigrationGating","WAWebLid1X1ThreadAccountMigrations","WAWebSyncdDb","WAWebUserPrefsMeUser","asyncToGeneratorRuntime","decodeProtobuf"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[lid][timeout] logout should be in "," seconds.\n allowed delay: ",", primary migration time: ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[lid][timeout] primary did not migrate"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[lid][timeout] already got peer mapping"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[lid][timeout] already migrated"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[lid][timeout] checking if we need to logout due to missing peer message"]);l=function(){return a};return a}function m(){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a='["'+d("WASyncdConst").Actions.DeviceCapabilities+'","'+d("WAWebUserPrefsMeUser").assertGetMe().user+':0@s.whatsapp.net"]';a=(yield d("WAWebSyncdDb").getSyncAction(a));if((a==null?void 0:a.binarySyncData)==null)return null;a=(a=d("decodeProtobuf").decodeProtobuf(d("WASyncAction.pb").SyncActionDataSpec,a.binarySyncData).value)==null?void 0:(a=a.deviceCapabilities)==null?void 0:(a=a.lidMigration)==null?void 0:a.chatDbMigrationTimestamp;return a==null?null:d("WATimeUtils").castLongIntToUnixTime(a)});return n.apply(this,arguments)}function a(){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){d("WALogger").LOG(l());if(d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()){d("WALogger").LOG(k());return{shouldScheduleTimeout:!1}}var a=d("WAWebLid1X1ThreadAccountMigrations").getLidThreadMigrationStatus().state;if([d("WAWebLid1X1ThreadAccountMigrations").LidThreadMigrationStatus.COMPLETE,d("WAWebLid1X1ThreadAccountMigrations").LidThreadMigrationStatus.IN_PROGRESS,d("WAWebLid1X1ThreadAccountMigrations").LidThreadMigrationStatus.READY].includes(a)){d("WALogger").LOG(j());return{shouldScheduleTimeout:!1}}a=(yield m());if(a==null){d("WALogger").LOG(i());return{shouldScheduleTimeout:!1}}var b=d("WAWebABProps").getABPropConfigValue("lid_one_on_one_migration_peer_sync_timeout_in_seconds"),c=d("WATimeUtils").timeoutForAt(d("WATimeUtils").unixTime(),a,b);d("WALogger").LOG(h(),c/1e3,b,a);return{shouldScheduleTimeout:!0,timeoutUntilLogout:c}});return o.apply(this,arguments)}g.getPrimaryMigrationTime=m;g.shouldScheduleTimeoutForMissingPeerMessage=a}),98); __d("WAWebLid1x1MigrationTimeout",["WALogger","WAWebLid1x1MigrationTimeoutUtils","WAWebLogoutReasonConstants","WAWebSocketLogoutJob","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[lid][timeout] will logout"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[lid][timeout] should logout in second check: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[lid][timeout] running logout check"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[lid][timeout] setting logout timeout"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[lid][timeout] start check lid migration timeout. soruce: ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[lid][timeout] already scheduled logout"]);m=function(){return a};return a}var n=null;function a(a){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(n!=null){d("WALogger").LOG(m());return}d("WALogger").LOG(l(),a);a=(yield d("WAWebLid1x1MigrationTimeoutUtils").shouldScheduleTimeoutForMissingPeerMessage());var c=a.shouldScheduleTimeout;a=a.timeoutUntilLogout;if(!c)return;d("WALogger").LOG(k());n=self.setTimeout(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){d("WALogger").LOG(j());var a=(yield d("WAWebLid1x1MigrationTimeoutUtils").shouldScheduleTimeoutForMissingPeerMessage());a=a.shouldScheduleTimeout;d("WALogger").LOG(i(),a);a&&(d("WALogger").LOG(h()),yield d("WAWebSocketLogoutJob").socketLogout(d("WAWebLogoutReasonConstants").LogoutReason.LidMigrationPeerMappingsNotReceived))}),a)});return o.apply(this,arguments)}g.scheduleLogoutIfNeeded=a}),98); __d("WAWebLogoutReason",["WAWebLogoutReasonConstants"],(function(a,b,c,d,e,f,g){var h=null,i=null;function a(a){switch(a){case d("WAWebLogoutReasonConstants").LogoutReason.ClientFatalError:return d("WAWebLogoutReasonConstants").LOGOUT_REASON_CODE.CLIENT_FATAL;case d("WAWebLogoutReasonConstants").LogoutReason.SyncdFailure:case d("WAWebLogoutReasonConstants").LogoutReason.SyncdErrorDuringBootstrap:case d("WAWebLogoutReasonConstants").LogoutReason.AccountSyncError:case d("WAWebLogoutReasonConstants").LogoutReason.SyncdTimeout:case d("WAWebLogoutReasonConstants").LogoutReason.CriticalSyncTimeout:return d("WAWebLogoutReasonConstants").LOGOUT_REASON_CODE.SYNC_FAIL;case d("WAWebLogoutReasonConstants").LogoutReason.HistorySyncTimeout:return d("WAWebLogoutReasonConstants").LOGOUT_REASON_CODE.INITIAL_HISTORY_SYNC_TIMEOUT;case d("WAWebLogoutReasonConstants").LogoutReason.AccountLocked:return d("WAWebLogoutReasonConstants").LOGOUT_REASON_CODE.ACCOUNT_LOCKED;default:return null}}function b(a){h=a}function c(a){i=a}function e(){return h}function f(){return i}g.getErrorCodeFromLogoutReason=a;g.setPrevLogoutReasonCode=b;g.setPrevCustomLogoutMessage=c;g.getPrevLogoutReasonCode=e;g.getPrevCustomLogoutMessage=f}),98); __d("WAWebMediaHost",["WAWebMmsMediaTypes"],(function(a,b,c,d,e,f,g){var h=new Set(d("WAWebMmsMediaTypes").MEDIA_TYPE_VALUES),i=Object.freeze({PRIMARY:"primary",FALLBACK:"fallback"});a=function(){function a(b){this.hostname=b.hostname;this.ips=b.ips||[];this.type=b.type;this["class"]=b["class"];var c=j(b.rules),d=c.downloadBuckets,e=c.supportedDownloadTypes;c=c.supportedUploadTypes;this.downloadBuckets=d;this.$1=e;this.$2=c;this.fallback=b.fallback!=null?new a(babelHelpers["extends"]({},b,b.fallback,{type:"fallback",fallback:void 0})):null}var b=a.prototype;b.equals=function(a){return this.hostname===(a==null?void 0:a.hostname)};b.isFallback=function(){return this.type===i.FALLBACK};b.supportsDownloadMediaType=function(a){return this.$1.has(k(a))};b.supportsUploadMediaType=function(a){return this.$2.has(l(a))};b.setSelectedBucket=function(a){this.selectedBucket=a};return a}();function j(a){a=a||[];var b,c,d;for(a of a){if(a.download){var e;b=(e=b)!=null?e:new Set();for(e of a.download)b.add(e)}if(a.upload){c=(e=c)!=null?e:new Set();for(e of a.upload)c.add(e)}a.downloadBuckets&&(d=a.downloadBuckets.map(function(a){return parseInt(a,10)}))}return{supportedDownloadTypes:(e=b)!=null?e:h,supportedUploadTypes:(a=c)!=null?a:h,downloadBuckets:d}}function k(a){return a==="ptv"||a===d("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_PTV?d("WAWebMmsMediaTypes").MEDIA_TYPES.VIDEO:a}function l(a){switch(a){case"ptv":return d("WAWebMmsMediaTypes").MEDIA_TYPES.VIDEO;case"product-catalog-image":return d("WAWebMmsMediaTypes").MEDIA_TYPES.PRODUCT;default:return a}}g.HOST_TYPE=i;g.MediaHost=a}),98); __d("WAWebMediaHostsErrors",["WACustomError"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}return b}(d("WACustomError").customError("NoMediaHostsError"));g.NoMediaHostsError=a}),98); __d("WAWebMediaHostsRouteSelection",["WABase64Modulo","WAWebABProps"],(function(a,b,c,d,e,f,g){var h={DOWNLOAD:"DOWNLOAD",UPLOAD:"UPLOAD"};function a(a){var b=a.encFilehash,e=a.hosts,f=a.operation,g=a.type;a=a.maxBuckets;if(!e.length)return{selectedHost:null,fallbackHost:null};var j;if(f===h.DOWNLOAD){var k=d("WAWebABProps").getABPropConfigValue("mms_vcache_aggregation_enabled"),l;b==null?l=0:k&&a!=null&&(l=c("WABase64Modulo")(b,a)+100);k=i(e);b=l==null?null:k.get(l);a=k.get(0);(b==null?void 0:b.supportsDownloadMediaType(g))?j=b:(a==null?void 0:a.supportsDownloadMediaType(g))&&(j=a);(k=j)==null?void 0:k.setSelectedBucket(l)}b=e.find(function(a){return a.isFallback()});j=(a=j)!=null?a:e.find(function(a){return f===h.UPLOAD?a.supportsUploadMediaType(g):a.supportsDownloadMediaType(g)});return{selectedHost:(k=j)!=null?k:null,fallbackHost:(a=b)!=null?a:null}}function i(a){var b=new Map();a.forEach(function(a){var c;(c=a.downloadBuckets)==null?void 0:c.forEach(function(c){b.set(c,a)})});return b}g.OPERATIONS=h;g.routeSelection=a}),98); __d("WAWebQueryMediaConnsJob",["WADeprecatedSendIq","WALogger","WAMediaConnParser","WAPromiseRaceAbort","WATimeUtils","WAWap","WAWebBackendErrors","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Assertion failed!"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["backend:queryMediaConnections: hosts.length ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["backend:queryMediaConnections: hosts exists ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["backend:queryMediaConnections: ttl exists ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["backend:queryMediaConnections: auth exists ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["backend:queryMediaConn: got "," hosts"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["response: "," ",""]);n=function(){return a};return a}function o(a){switch(a){case"kyc-id":case"novi-image":case"novi-video":case"thumbnail-gif":case"xma-image":return null;default:return a}}function p(a){return{hostname:a.domain,"class":a["class"],ips:[{ip4:a.ip4,ip6:a.ip6}]}}function q(a){var b=function(a){var b=[],c=a.downloadable.map(o).filter(Boolean);c.length>0&&b.push({download:c});c=a.uploadable.map(o).filter(Boolean);c.length>0&&b.push({upload:c});c=a.downloadBuckets.map(function(a){return a.toString()});c!=null&&c.length>0&&b.push({downloadBuckets:c});return b};return{hosts:a.hosts.map(function(a){return babelHelpers["extends"]({},p(a),{fallback:a.fallback!=null?p(a.fallback):void 0,type:a.isFallback?"fallback":"primary",rules:b(a)})}),auth:a.authToken,authTTL:a.authTokenExpiryTs,ttl:a.routesExpiryTs,maxBuckets:a.maxBuckets}}function a(a){var b,e=new Date(),f=d("WATimeUtils").unixTime();b=(b=d("WAWap")).wap("iq",{to:b.S_WHATSAPP_NET,xmlns:"w:m",type:"set",id:b.generateId()},b.wap("media_conn",null));b=d("WADeprecatedSendIq").deprecatedSendIq(b,d("WAMediaConnParser").mediaConnParser).then(function(a){if(!a.success){d("WALogger").ERROR(n(),a.errorCode,a.errorText).sendLogs("backend:queryMediaConn: fail");if(a.errorCode===507)throw new(d("WAWebBackendErrors").E507)(a.errorText,a.errorBackoff);throw new(d("WAWebBackendErrors").ServerStatusCodeError)(a.errorCode,a.errorText)}else{d("WALogger").LOG(m(),a.result.hosts.length);a=q(a.result);var b=a.auth,g=a.authTTL,o=a.ttl,p=a.hosts;a=a.maxBuckets;if(!b||o==null||!p||p.length===0){d("WALogger").LOG(l(),String(!!b));d("WALogger").LOG(k(),String(!!o));d("WALogger").LOG(j(),String(!!p));p&&d("WALogger").LOG(i(),p.length);d("WALogger").ERROR(h()).sendLogs("backend:queryMediaConnections unexpected mediaConn");throw c("err")("Invalid mediaConn")}return{queryStartTime:e,auth:b,hosts:p,ttl:o-f,maxBuckets:a,authTTL:g-f}}});return c("WAPromiseRaceAbort")(b,a)}g.mapParsedMediaConn=q;g.queryMediaConn=a}),98); __d("WAWebQueryMediaConnsBridge",["WABackoffDelay","WAPromiseBackoffs","WAWebBackendErrors","WAWebQueryMediaConnsJob","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h=1e3;c=15*60*1e3;var i=d("WAPromiseBackoffs").createTimer({algo:{type:"fibonacci",first:0,second:1},max:c,jitter:.25});function a(a){return d("WABackoffDelay").backoff({delay:function(a){a=a.taskDuration;var b=h*i();return Math.max(b-a,0)},signal:a},function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){var c=d("WAWebQueryMediaConnsJob").queryMediaConn(a);try{c=(yield c);var e=c.ttl,f=c.authTTL;f*=1e3;e*=1e3;return babelHelpers["extends"]({},c,{authTTL:f,ttl:e})}catch(a){if(a instanceof d("WAWebBackendErrors").E507)throw a;if(a instanceof d("WAWebBackendErrors").ServerStatusCodeError&&a.status>=500)return b(a);throw a}});return function(a){return c.apply(this,arguments)}}())}g.sendQueryMediaConn=a}),98); __d("WAWebMediaHosts",["Promise","WAAbortError","WALogger","WAMemoizeConcurrent","WAWebBackendErrors","WAWebMediaHost","WAWebMediaHostsErrors","WAWebMediaHostsRouteSelection","WAWebNormalizeStack","WAWebQueryMediaConnsBridge","WAWebUserPrefsMultiDevice","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Failed to init media conn from storage: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Assertion failed!"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["mediaHosts.sendQueryMediaConn error: ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["mediaHosts.sendQueryMediaConn aborted"]);l=function(){return a};return a}a=function(){function a(){var a=this;this._locked=!1;this._fetch=c("WAMemoizeConcurrent")(function(){return"all"},function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(c){var e=c.signal;try{c=(yield d("WAWebQueryMediaConnsBridge").sendQueryMediaConn(e));a._data=a._createMediaConnData(c);d("WAWebUserPrefsMultiDevice").setMms4Conn(c);a._err=null}catch(g){c=g;if(c instanceof d("WAWebBackendErrors").E507){var f;a._data=a._previousData;a._previousData=null;a._locked=!0;self.setTimeout(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield a._refreshIfStale({signal:e}),a._locked=!1}),(f=c.backoff)!=null?f:void 0);return}a._data=null;a._err=c;if(c.name===d("WAAbortError").ABORT_ERROR){d("WALogger").LOG(l());return}d("WALogger").WARN(k(),m(c)).verbose();d("WALogger").ERROR(j()).devConsole(c).sendLogs("Error fetching mms hosts")}});return function(a){return c.apply(this,arguments)}}());this._reset()}var e=a.prototype;e.forceRefresh=function(a){if(this._locked)return(h||(h=b("Promise"))).resolve(!1);a={signal:a,forceRefresh:!0};return this._refreshIfStale(a)};e.getCachedHostsInfo=function(a){var c=this;if(!this._locked){var d={signal:a.signal||new AbortController().signal,forceRefresh:!1};self.setTimeout(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield c._refreshIfStale(d),c._locked=!1}),0)}return this._getPreferredHostsInfo(a)};e.maybeLoadMediaConnFromStorage=function(){var a=d("WAWebUserPrefsMultiDevice").getMms4Conn();if(a==null)return;try{this._data=this._createMediaConnData(a)}catch(a){d("WALogger").ERROR(i(),a).sendLogs("media-conn-failed-to-load")}};e.getHostsInfo=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.directPath,c=a.encFilehash,d=a.operation,e=a.type,f=a.signal;a=a.forceRefresh;a=a===void 0?!1:a;if(!this._locked){f={signal:f||new AbortController().signal,forceRefresh:a};yield this._refreshIfStale(f)}return this._getPreferredHostsInfo({directPath:b,encFilehash:c,operation:d,type:e})});function c(b){return a.apply(this,arguments)}return c}();e.getHostsInfoByBucket=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.preferredBuckets,c=a.signal;a=a.forceRefresh;a=a===void 0?!1:a;if(!this._locked){c={signal:c||new AbortController().signal,forceRefresh:a};yield this._refreshIfStale(c)}if(!this._data)throw new(d("WAWebMediaHostsErrors").NoMediaHostsError)("no fetched data");a=this._data;c=a.auth;a=a.hosts;if(!a.length)throw new(d("WAWebMediaHostsErrors").NoMediaHostsError)("no selected host");var e=new Map(b.map(function(a){return[a,null]}));a.forEach(function(a){var b;b=(b=a.downloadBuckets)==null?void 0:b.find(function(a){return e.has(a)});b!=null&&e.set(b,a)});var f,g;for(b of e.values()){if(b==null)continue;if(!f)f=b;else if(!g){g=b;break}}!f&&!g?(f=a[0],g=a[1]):g||(g=a[0]);if(!f)throw new(d("WAWebMediaHostsErrors").NoMediaHostsError)("no selected host");return{auth:c,selectedHost:f,fallbackHost:g}});function c(b){return a.apply(this,arguments)}return c}();e._createMediaConnData=function(a){var b=new Date(a.queryStartTime);return{auth:a.auth,authExpirationTime:new Date(b.getTime()+a.authTTL),authTTL:a.authTTL,hosts:a.hosts.map(function(a){return new(d("WAWebMediaHost").MediaHost)(a)}),hostsRefreshTime:new Date(b.getTime()+a.ttl),queryStartTime:b,maxBuckets:a.maxBuckets}};e._isExpiredOrMissing=function(){if(!this._data)return!0;var a=this._data;return new Date()>=a.authExpirationTime};e._getPreferredHostsInfo=function(a){if(!this._data)throw new(d("WAWebMediaHostsErrors").NoMediaHostsError)("no fetched data");var b=a.encFilehash,c=a.operation;a=a.type;var e=this._data,f=e.auth,g=e.hosts;e=e.maxBuckets;b=d("WAWebMediaHostsRouteSelection").routeSelection({encFilehash:b,hosts:g,operation:c,type:a,maxBuckets:e});g=b.selectedHost;c=b.fallbackHost;if(!g)throw new(d("WAWebMediaHostsErrors").NoMediaHostsError)("no selected host");return{auth:f,selectedHost:g,fallbackHost:c}};e._needsRefresh=function(){if(!this._data)return!0;var a=this._data;if(new Date()>=a.hostsRefreshTime)return!0;var b=a.authTTL;a=a.queryStartTime;b=Math.floor(b*.8);a=new Date(a.getTime()+b);return new Date()>=a};e._refreshIfStale=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.forceRefresh;a=babelHelpers.objectWithoutPropertiesLoose(a,["forceRefresh"]);if(this._isExpiredOrMissing()||b){this._reset();yield this._fetch(a);return!0}if(this._needsRefresh()){this._fetch(a);return!1}return!1});function a(b){return a.apply(this,arguments)}return a}();e._reset=function(){this._previousData=this._data,this._data=null,this._err=null};return a}();e=new a();function m(a){a.name;a.message;a.stack;var b=babelHelpers.objectWithoutPropertiesLoose(a,["name","message","stack"]),c=d("WAWebNormalizeStack").normalizeStack(a);c=c.slice(c.indexOf("\n")+1);b=Object.keys(b).length===0?"":" "+JSON.stringify(b,function(a,b){return a&&typeof b==="object"?String(b):b});return(a.name||"Error")+": "+a.message+b+"\n"+c}g.mediaHosts=e}),98); __d("WAWebMergeContactRecordsById",["WALogger","WAWebLidAwareContactsDB","WAWebModelStorageUtils","WAWebUserPrefsIndexedDBStorage","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["mergeContactRecordsById: end migration"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["mergeContactRecordsById: start migration"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["mergeContactRecordsById: migration already complete"]);j=function(){return a};return a}function a(){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield d("WAWebModelStorageUtils").getStorage().lock(["contact","user-prefs"],b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.get("WAContactMigrationIdComplete")){d("WALogger").LOG(j());return}d("WALogger").LOG(i());var a=(yield c("WAWebLidAwareContactsDB").all()).filter(function(a){return a.id.endsWith("@c.us")});yield c("WAWebLidAwareContactsDB").bulkCreateOrMerge(a.map(function(a){var b=a.id;a=a.pushname;return{id:d("WAWebWidFactory").createWid(b).toJid(),pushname:a}}));yield c("WAWebLidAwareContactsDB").bulkRemove(a.map(function(a){a=a.id;return a}));yield d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.set("WAContactMigrationIdComplete",!0);d("WALogger").LOG(h())}))});return k.apply(this,arguments)}g.mergeContactRecordsById=a}),98); __d("WAWebBlockingOfflineResumeManager",["WALogger","WAShiftTimer","WAWebApiPendingDeviceSync","WAWebBackendApi","WAWebBrokerGlobalAppState","WAWebChatThreadLogging","WAWebCmd","WAWebHandleMsgTypes.flow","WAWebJSHaltDetector","WAWebMessageQueue","WAWebOfflineResumeConst","WAWebOfflineResumeTypes.flow","WAWebOfflineResumeUtils","WAWebPageLoadLogging","WAWebSignalProtocolStore","WAWebUserPrefsGeneral","WAWebWamEnumWebcScenarioType","WAWebWamMemoryStat","WAWebWamOfflineResumeReporter","WAWebWorkerSafeBackendApi","asyncToGeneratorRuntime","gkx"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume][blocking] _onOfflineComplete: clearOfflineSnapShot done."]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume][blocking] _onOfflineComplete: waitForOfflineMsgThread done, total decryption error: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume][blocking]offline resume finished by timeout"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume][blocking]: offline session completed by timeout"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume][blocking] "," received after offline completion marker. Refreshing window due to potential server issue."]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume][blocking] start handling offline stanza"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume][blocking] Reject multiple offline preview ib during offline resume, delay ","."]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume][blocking] Reject multiple offline preview ibs during offline resume, delay ",""]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume][blocking] Accept multiple offline preview ibs during offline resume, delay ","."]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume][blocking] start handling offline stanza"]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume][blocking] restart client due to exceed the LIMIT, message: ",", receipt: ",""]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume][blocking] Offline session is complete when receiving offline preview ib."]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume][blocking] offline resume stage: "," -> ",""]);t=function(){return a};return a}var u;function a(){u==null&&(u=new v());return u}function e(){u=null}var v=function(){function a(){var a=this;this._offlineCompleteTimer=null;this._progressBarTimer=new(d("WAShiftTimer").ShiftTimer)(function(){d("WAWebCmd").Cmd.handleOfflineProgressUpdate(),a._progressBarTimer.onOrAfter(d("WAWebOfflineResumeConst").UI_UPDATE_TIME_MS)});this._chatsAndMsgsRestored=!1;this.resumeType=d("WAWebOfflineResumeTypes.flow").ResumeType.Blocking;this._initState()}var e=a.prototype;e._initState=function(){this.offlineMessagePreviewCounter=-1,this._decryptedMessageCount=0,this._decryptionErrorCount=0,this._finishedDownloading=!1,this._hasMessagesToDownload=null,this._status=d("WAWebOfflineResumeConst").ResumeStatus.INIT};e._setStatus=function(a){d("WALogger").LOG(t(),this._status,a),this._status=a};e.processOfflinePreview=function(a){d("WAWebWamOfflineResumeReporter").OfflineResumeReporter.logOfflinePreviewT();if(this.isResumeFromRestartComplete())d("WALogger").LOG(s()),d("WAWebOfflineResumeUtils").exceedResumeWithOpenTabLimit(a.message,a.receipt)&&(d("WALogger").LOG(r(),a.message,a.receipt),d("WAWebOfflineResumeUtils").refreshWindow()),d("WAWebJSHaltDetector").jsHaltDetector.restartDetection(),this._setStatus(d("WAWebOfflineResumeConst").ResumeStatus.RESUME_WITH_OPEN_TAB),d("WAWebBackendApi").frontendFireAndForget("updateChatSortListener",{enable:!1}),self.setTimeout(function(){d("WAWebBackendApi").frontendFireAndForget("updateChatSortListener",{enable:!0})},7e3);else if(this._status===d("WAWebOfflineResumeConst").ResumeStatus.INIT)c("WAWebBrokerGlobalAppState").initOrUpdateTracking(d("WAWebWamEnumWebcScenarioType").WEBC_SCENARIO_TYPE.OFFLINE_RESUME),d("WAWebWamOfflineResumeReporter").OfflineResumeReporter.logOfflineCount(a),this._hasMessagesToDownload=a.message>0,this._finishedDownloading=a.message===0,this.offlineMessagePreviewCounter=a.message,this._decryptedMessageCount=0,this._firstPreviewReceivedT=Date.now(),d("WAWebSignalProtocolStore").enableMemSignalStore(),d("WAWebCmd").Cmd.handleOfflineProgressUpdate(),d("WAWebJSHaltDetector").jsHaltDetector.restartDetection(),this._setStatus(d("WAWebOfflineResumeConst").ResumeStatus.RESUME_ON_RESTART),this._startOfflineCompleteTimer(a.message,a.receipt),this._progressBarTimer.onOrAfter(d("WAWebOfflineResumeConst").UI_UPDATE_TIME_MS),d("WAWebCmd").Cmd.readyForProcessOffline(),d("WALogger").LOG(q());else{var b=this._firstPreviewReceivedT;if(b!=null){b=Date.now()-b;b<d("WAWebOfflineResumeConst").OFFLINE_PREVIEW_PERIOD_MS?(d("WALogger").LOG(p(),b),this.offlineMessagePreviewCounter+=a.message,this._hasMessagesToDownload=this.offlineMessagePreviewCounter>0,this._finishedDownloading=this.offlineMessagePreviewCounter===0,d("WAWebWamOfflineResumeReporter").OfflineResumeReporter.logOfflineCount(a),d("WAWebCmd").Cmd.handleOfflineProgressUpdate()):!c("gkx")("26258")?d("WALogger").ERROR(o(),b).sendLogs("offline-multiple-preview"):d("WALogger").LOG(n(),b)}this._refreshOfflineCompleteTimer()}};e.getOfflineDeliveryProgress=function(){if(this._finishedDownloading)return 100;else if(this.offlineMessagePreviewCounter===-1)return 0;else if(this.offlineMessagePreviewCounter===0)return 100;return Math.min(Math.ceil(100*this._decryptedMessageCount/this.offlineMessagePreviewCounter),100)};e.processOfflineSessionComplete=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b,c=this;a=a;self.setTimeout(function(){d("WAWebBackendApi").frontendFireAndForget("updateChatSortListener",{enable:!0})},3e3);(b=this._offlineCompleteTimer)==null?void 0:b.cancel();this._offlineCompleteTimer=null;d("WAWebCmd").Cmd.readyForProcessOffline();d("WALogger").LOG(m());if(this._status===d("WAWebOfflineResumeConst").ResumeStatus.COMPLETE){d("WAWebWamOfflineResumeReporter").OfflineResumeReporter.logLastStanzaT();void d("WAWebWamOfflineResumeReporter").OfflineResumeReporter.commit();return}else if(this._status===d("WAWebOfflineResumeConst").ResumeStatus.RESUME_WITH_OPEN_TAB){yield d("WAWebMessageQueue").waitForOnlineMessageQueue();yield d("WAWebApiPendingDeviceSync").doPendingDeviceSync();this._setStatus(d("WAWebOfflineResumeConst").ResumeStatus.COMPLETE);d("WAWebCmd").Cmd.offlineDeliveryEnd();return}this._hasMessagesToDownload=a>0;this._finishedDownloading=a===0;this._offlineStanzaCountAfterOfflineMarker=0;self.setTimeout(function(){c._offlineStanzaCountAfterOfflineMarker>d("WAWebOfflineResumeConst").OFFLINE_STANZA_COUNT_LIMIT&&(d("WALogger").WARN(l(),c._offlineStanzaCountAfterOfflineMarker),d("WAWebOfflineResumeUtils").refreshWindow())},d("WAWebOfflineResumeConst").OFFLINE_STANZA_COUNT_CHECK_TIMEOUT_MS);d("WAWebCmd").Cmd.handleOfflineProgressUpdate();this._setStatus(d("WAWebOfflineResumeConst").ResumeStatus.COMPLETE);return this._handleOfflineComplete()});function c(b){return a.apply(this,arguments)}return c}();e.isResumeFromRestartComplete=function(){return this._status!==d("WAWebOfflineResumeConst").ResumeStatus.RESUME_ON_RESTART&&this._status!==d("WAWebOfflineResumeConst").ResumeStatus.INIT};e.isResumeOnSocketDisconnectInProgress=function(){return this._status===d("WAWebOfflineResumeConst").ResumeStatus.RESUME_WITH_OPEN_TAB};e.isResumeFromRestartInProgress=function(){return this._status!==d("WAWebOfflineResumeConst").ResumeStatus.INIT&&!d("WAWebCmd").Cmd.isOfflineDeliveryEnd};e.isResumeComplete=function(){return this._status===d("WAWebOfflineResumeConst").ResumeStatus.COMPLETE};e.getHasMessagesToDownload=function(){return this._hasMessagesToDownload};e.getFinishedDownloading=function(){return this.getOfflineDeliveryProgress()===100};e.shouldUseOfflineResumeScreen=function(){return this.offlineMessagePreviewCounter>this._decryptedMessageCount};e.processDecryptResult=function(a){this._refreshOfflineCompleteTimer(),this._decryptedMessageCount+=1,a===d("WAWebHandleMsgTypes.flow").E2EProcessResult.RETRY&&(this._decryptionErrorCount+=1)};e.offlineStanzaReceivedAfterComplete=function(){this.isResumeFromRestartComplete()&&(this._offlineStanzaCountAfterOfflineMarker+=1)};e.newOfflineStanza=function(a,b){this._refreshOfflineCompleteTimer(),d("WAWebWamOfflineResumeReporter").OfflineResumeReporter.logAddOfflineSizeBytes(b),d("WAWebWamOfflineResumeReporter").OfflineResumeReporter.logOldestStanzaTime(a)};e.getResumeUIProgressBarType=function(){return d("WAWebOfflineResumeTypes.flow").ResumeUIProgressBarType.None};e._refreshOfflineCompleteTimer=function(){this._offlineCompleteTimer&&this._offlineCompleteTimer.onOrAfter(d("WAWebOfflineResumeConst").OFFLINE_STANZA_TIMEOUT_MS)};e._startOfflineCompleteTimer=function(a,b){var c,e=this;(c=this._offlineCompleteTimer)==null?void 0:c.cancel();this._offlineCompleteTimer=new(d("WAShiftTimer").ShiftTimer)(function(){e._status!==d("WAWebOfflineResumeConst").ResumeStatus.COMPLETE&&(d("WALogger").LOG(k()),d("WALogger").ERROR(j()).sendLogs("blocking-offline-resume-timeout",{sampling:.01}),e.processOfflineSessionComplete(a+b),e._offlineCompleteTimer=null,d("WAWebWamOfflineResumeReporter").OfflineResumeReporter.logMissedOfflineComplete())});this._offlineCompleteTimer.onOrAfter(d("WAWebOfflineResumeConst").OFFLINE_STANZA_TIMEOUT_MS)};e._handleOfflineComplete=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a;(a=d("WAWebPageLoadLogging")).startPageLoadQplMeasure("waitForOfflineMessageQueue");yield d("WAWebMessageQueue").waitForOfflineMessageQueue();a.endPageLoadQplMeasure("waitForOfflineMessageQueue");this._finishedDownloading=!0;d("WAWebCmd").Cmd.handleOfflineProgressUpdate();d("WAWebWamOfflineResumeReporter").OfflineResumeReporter.logOfflineDecryptionErrorCount(this._decryptionErrorCount);d("WALogger").LOG(i(),this._decryptionErrorCount);this._decryptionErrorCount=0;a.startPageLoadQplMeasure("clearOfflineSnapShot");yield d("WAWebOfflineResumeUtils").clearOfflineSnapShot();a.endPageLoadQplMeasure("clearOfflineSnapShot");d("WALogger").LOG(h());d("WAWebSignalProtocolStore").enablePersistSignalStore();d("WAWebOfflineResumeUtils").runReceiptCleanUpLoop();d("WAWebWamOfflineResumeReporter").OfflineResumeReporter.logLastStanzaT();a.startPageLoadQplMeasure("loadMainScreen");yield d("WAWebOfflineResumeUtils").loadMainScreen({shouldUpdateReceipts:!0,shouldRestoreChatsAndMsgs:!this._chatsAndMsgsRestored});a.endPageLoadQplMeasure("loadMainScreen");d("WAWebCmd").Cmd.offlineDeliveryEnd();d("WAWebUserPrefsGeneral").setOfflinePushCount(0);d("WAWebWamOfflineResumeReporter").OfflineResumeReporter.commit();d("WAWebWorkerSafeBackendApi").workerSafeFireAndForget("processAllOrphanPaymentNotifications");d("WAWebChatThreadLogging").uploadChatThreadLoggingEvents();c("WAWebBrokerGlobalAppState").initOrUpdateTracking(d("WAWebWamEnumWebcScenarioType").WEBC_SCENARIO_TYPE.IDLE);d("WAWebWamMemoryStat").setCurrentMemoryScenario(d("WAWebWamEnumWebcScenarioType").WEBC_SCENARIO_TYPE.IDLE);self.setTimeout(function(){d("WAWebApiPendingDeviceSync").doPendingDeviceSync()},d("WAWebOfflineResumeConst").OFFLINE_DEVICE_SYNC_DELAY)});function a(){return a.apply(this,arguments)}return a}();return a}();g.getOrCreateInstance=a;g.clearInstance=e;g.OfflineBlockingResumeStageManager=v}),98); __d("WAWebMsgSyncTunnelTimeoutUtils",[],(function(a,b,c,d,e,f){function a(a){var b=[],c=null;function d(){c=self.performance.now()}function e(){if(c==null)return b[b.length-1];var d=self.performance.now();d=Math.floor(d-c);c=null;b.length>=a&&b.shift();b.push(d);return d}function f(){if(b.length===0)return 0;var a=b.reduce(function(a,b){return a+b},0);return a/b.length}function g(a){var b=f();return Math.floor(b*(1+a/100))}return{perfStart:d,perfEnd:e,getAverage:f,getAveragePlusNPercent:g,at:function(a){return(a=b.at(a))!=null?a:0}}}f.createPerformanceCache=a}),66); __d("WAWebMsgSyncTunnelJobThrottler",["WALogger","WAWebMsgSyncTunnelTimeoutUtils","asyncToGeneratorRuntime","lodash"],(function(a,b,c,d,e,f,g){function a(){var b=babelHelpers.taggedTemplateLiteralLoose(["[msg-tunnel] "," done in ",""]);a=function(){return b};return b}function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[msg-tunnel] "," failed ",", cache "," items preserved, error ",""]);h=function(){return a};return a}function e(){var a=babelHelpers.taggedTemplateLiteralLoose(["[msg-tunnel] "," start, cache size: ",""]);e=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[msg-tunnel] "," delayMs is ","ms, config: ","ms"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[msg-tunnel] set "," delayMs to ","ms"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[msg-tunnel] switch "," to debounce"]);k=function(){return a};return a}function f(a,e,f){var g=[],l=e.defaultTimeoutMs,m=d("WAWebMsgSyncTunnelTimeoutUtils").createPerformanceCache(3),n=!1;function o(a){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){b===void 0&&(b=!1);if(g.length===0)return;if(n&&!b)return;n=!0;b=g;g=[];m.perfStart();try{yield f(b)}catch(c){g=b.concat(g),d("WALogger").WARN(h(),a,m.perfEnd(),b.length,c).sendLogs("msg-tunnel-"+a+"-failed",{sampling:.01})}n=!1;b=m.perfEnd();if(b==null)return;if(e.defaultTimeoutMs<b){var c=15;if(l>b){var i=m.getAveragePlusNPercent(c);if(i<b)return;r(i);return}b=m.getAveragePlusNPercent(c);if(l+100>=b)return;r(b)}});return p.apply(this,arguments)}var q=c("lodash").throttle(o,l,{leading:!1,trailing:!0,maxWait:e.maxWait});function r(b){var f=l;l=Math.min(b,(b=e.debounceThreshold)!=null?b:15e3);if(l===e.debounceThreshold){if(f===l)return;q.cancel();q=c("lodash").debounce(o,l,{leading:!1,trailing:!0,maxWait:e.maxWait});d("WALogger").LOG(k(),a)}else q.cancel(),q=c("lodash").throttle(o,l,{leading:!1,trailing:!0,maxWait:e.maxWait});d("WALogger").LOG(j(),a,l);l>12e3&&d("WALogger").WARN(i(),a,l,e.defaultTimeoutMs).sendLogs("msg-tunnel-"+a+"-exceeds-12s",{sampling:.01})}return{take:function(a){g.push(a),void q()},forceDrain:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield o(!0),r(e.defaultTimeoutMs)});function c(){return a.apply(this,arguments)}return c}()}}g.createJobThrottler=f}),98); __d("WAWebMsgSyncTunnelBatcher",["Promise","WALogger","WAWebABProps","WAWebAddonLogUtils","WAWebCmd","WAWebMessagePostprocessRenderable","WAWebMessageProcessDBPipeline","WAWebMsgSyncTunnelJobThrottler","WAWebOfflineHandler","WAWebOfflineResumeTypes.flow","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["failed incoming addons processing"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["failed storing messages ",""]);j=function(){return a};return a}function a(){var a,c=d("WAWebMsgSyncTunnelJobThrottler").createJobThrottler("write-db",{defaultTimeoutMs:(a=d("WAWebABProps").getABPropConfigValue("web_msg_sync_update_tunnel_timeout_ms"))!=null?a:500,debounceThreshold:5e3},function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){try{a=a.reduce(function(a,b){return a.concat(b.msgs)},[]);yield d("WAWebMessageProcessDBPipeline").processMsgDataDBPipeline(a,!0)}catch(a){d("WALogger").ERROR(j(),a).tags("messaging").sendLogs("msg-tunnel-storing-failure")}});return function(b){return a.apply(this,arguments)}}()),e=d("WAWebMsgSyncTunnelJobThrottler").createJobThrottler("update-ui",{defaultTimeoutMs:(a=d("WAWebABProps").getABPropConfigValue("web_msg_sync_update_tunnel_timeout_ms"))!=null?a:500,maxWait:5e3},function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield (h||(h=b("Promise"))).allSettled(a.map(d("WAWebMessagePostprocessRenderable").postprocessRenderableMessages)));d("WAWebAddonLogUtils").hasSettledWithError(a)&&d("WALogger").ERROR(i()).tags("messaging").sendLogs("msg-tunnel-renderable-msgs-processing")});return function(b){return a.apply(this,arguments)}}()),f=function(a){e.take(a),c.take(a)},g=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield c.forceDrain(),yield e.forceDrain()});return function(){return a.apply(this,arguments)}}(),k=function(){var a=d("WAWebOfflineHandler").OfflineMessageHandler.getResumeType();return a===d("WAWebOfflineResumeTypes.flow").ResumeType.NonBlocking?d("WAWebABProps").getABPropConfigValue("web_msg_sync_update_tunnel"):!1};return{isEnabled:k,isActive:function(){return d("WAWebCmd").Cmd.isOfflineDeliveryEnd?!1:k()},accept:function(a){f(a)},drain:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield g()});function c(){return a.apply(this,arguments)}return c}()}}c=a();g.nonBlockingMsgsSyncTunnel=c}),98); __d("WAWebNonBlockingOfflineResumeManager",["WALogger","WAShiftTimer","WAWebApiPendingDeviceSync","WAWebBackendApi","WAWebBrokerGlobalAppState","WAWebChatThreadLogging","WAWebCmd","WAWebHandleMsgTypes.flow","WAWebHandleOfflineAbProps","WAWebJSHaltDetector","WAWebMessageQueue","WAWebMsgSyncConfiguratedTunnel","WAWebMsgSyncTunnelBatcher","WAWebOffdStorageUpdateOfflinePeerReceipts","WAWebOfflineResumeConst","WAWebOfflineResumeMsgProcessReporter","WAWebOfflineResumeTypes.flow","WAWebOfflineResumeUtils","WAWebSignalProtocolStore","WAWebThreadMetadata","WAWebUserPrefsGeneral","WAWebWamEnumWebcScenarioType","WAWebWamMemoryStat","WAWebWamOfflineResumeReporter","WAWebWorkerSafeBackendApi","asyncToGeneratorRuntime","gkx"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume][non-blocking] _onOfflineComplete: clearOfflineSnapShot done."]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume][non-blocking] _onOfflineComplete: waitForOfflineMsgThread done, total decryption error: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume][non-blocking] offline resume finished by timeout"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume][non-blocking]: offline session completed by timeout"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume][non-blocking] "," received after offline completion marker. Refreshing window due to potential server issue."]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume][non-blocking] Reject multiple offline preview ib during offline resume, delay ","."]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume][non-blocking] Reject multiple offline preview ibs during offline resume, delay ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume][non-blocking] Accept multiple offline preview ibs during offline resume, delay ","."]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["[resume-from-open-tab] Main screen is loaded"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume][non-blocking] restart client due to exceed the LIMIT, message: ",", receipt: ",""]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume][non-blocking] Offline session is complete when receiving offline preview ib."]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["[resume-from-open-tab] reset offline delivery end to false"]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["[offline-resume][non-blocking] offline resume stage: "," -> ",""]);t=function(){return a};return a}var u=100,v;function a(a){v!=null&&v.updateOptions(a);v==null&&(v=new w(a));return v}function e(){v=null}var w=function(){function a(a){var b=this;this._offlineCompleteTimer=null;this._progressBarTimer=new(d("WAShiftTimer").ShiftTimer)(function(){d("WAWebCmd").Cmd.handleOfflineProgressUpdate(),b._progressBarTimer.onOrAfter(d("WAWebOfflineResumeConst").UI_UPDATE_TIME_MS)});this._maxProgress=95;this.resumeType=d("WAWebOfflineResumeTypes.flow").ResumeType.NonBlocking;(a==null?void 0:a.mainScreenLoaded)&&(this._mainScreenLoaded=!0);this._initState()}var e=a.prototype;e.updateOptions=function(a){this._mainScreenLoaded=(a=a==null?void 0:a.mainScreenLoaded)!=null?a:!1};e._initState=function(){this.offlineMessagePreviewCounter=-1,this._decryptedMessageCount=0,this._decryptionErrorCount=0,this._finishedDownloading=!1,this._hasMessagesToDownload=null,this._status=d("WAWebOfflineResumeConst").ResumeStatus.INIT};e._setStatus=function(a){d("WALogger").LOG(t(),this._status,a),this._status=a};e.processOfflinePreview=function(a){d("WAWebWamOfflineResumeReporter").OfflineResumeReporter.logOfflinePreviewT();this._mainScreenLoaded&&(d("WALogger").LOG(s()),d("WAWebCmd").Cmd.resetOfflineDeliveryState());if(this.isResumeFromRestartComplete())d("WALogger").LOG(r()),d("WAWebOfflineResumeUtils").exceedResumeWithOpenTabLimit(a.message,a.receipt)&&(d("WALogger").LOG(q(),a.message,a.receipt),d("WAWebOfflineResumeUtils").refreshWindow()),d("WAWebJSHaltDetector").jsHaltDetector.restartDetection(),this._setStatus(d("WAWebOfflineResumeConst").ResumeStatus.RESUME_WITH_OPEN_TAB),this._startOfflineCompleteTimer(a.message,a.receipt),d("WAWebBackendApi").frontendFireAndForget("updateChatSortListener",{enable:!1}),self.setTimeout(function(){d("WAWebBackendApi").frontendFireAndForget("updateChatSortListener",{enable:!0})},7e3);else if(this._status===d("WAWebOfflineResumeConst").ResumeStatus.INIT)c("WAWebBrokerGlobalAppState").initOrUpdateTracking(d("WAWebWamEnumWebcScenarioType").WEBC_SCENARIO_TYPE.OFFLINE_RESUME),d("WAWebWamOfflineResumeReporter").OfflineResumeReporter.logOfflineCount(a),d("WAWebOfflineResumeMsgProcessReporter").msgProcessReporter.activate(a),this.offlineMessagePreviewCounter=a.message,this._hasMessagesToDownload=!1,this._finishedDownloading=!0,this._decryptedMessageCount=0,this._firstPreviewReceivedT=Date.now(),d("WAWebSignalProtocolStore").enableMemSignalStore(),d("WAWebCmd").Cmd.handleOfflineProgressUpdate(),d("WAWebJSHaltDetector").jsHaltDetector.restartDetection(),this._progressBarTimer.onOrAfter(d("WAWebOfflineResumeConst").UI_UPDATE_TIME_MS),this._setStatus(d("WAWebOfflineResumeConst").ResumeStatus.RESUME_ON_RESTART),this._startOfflineCompleteTimer(a.message,a.receipt),!this._mainScreenLoaded?this._mainScreenLoadPromise=d("WAWebOfflineResumeUtils").loadMainScreen({}):d("WALogger").LOG(p());else{var b=this._firstPreviewReceivedT;if(b!=null){b=Date.now()-b;b<d("WAWebOfflineResumeConst").OFFLINE_PREVIEW_PERIOD_MS?(d("WALogger").LOG(o(),b),this.offlineMessagePreviewCounter+=a.message,this._hasMessagesToDownload=!1,this._finishedDownloading=!0,d("WAWebWamOfflineResumeReporter").OfflineResumeReporter.logOfflineCount(a)):!c("gkx")("26258")?d("WALogger").ERROR(n(),b).sendLogs("offline-multiple-preview"):d("WALogger").LOG(m(),b)}this._refreshOfflineCompleteTimer()}};e.getOfflineDeliveryProgress=function(){return this.offlineMessagePreviewCounter===0?this._maxProgress:Math.min(Math.ceil(100*this._decryptedMessageCount/this.offlineMessagePreviewCounter),this._maxProgress)};e.processOfflineSessionComplete=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=this;self.setTimeout(function(){d("WAWebBackendApi").frontendFireAndForget("updateChatSortListener",{enable:!0})},3e3);(a=this._offlineCompleteTimer)==null?void 0:a.cancel();this._offlineCompleteTimer=null;if(this._status===d("WAWebOfflineResumeConst").ResumeStatus.COMPLETE){d("WAWebWamOfflineResumeReporter").OfflineResumeReporter.logLastStanzaT();void d("WAWebWamOfflineResumeReporter").OfflineResumeReporter.commit();return}else if(this._status===d("WAWebOfflineResumeConst").ResumeStatus.RESUME_WITH_OPEN_TAB){yield d("WAWebMessageQueue").waitForOnlineMessageQueue();yield d("WAWebApiPendingDeviceSync").doPendingDeviceSync();this._setStatus(d("WAWebOfflineResumeConst").ResumeStatus.COMPLETE);d("WAWebCmd").Cmd.offlineDeliveryEnd();return}else this._status===d("WAWebOfflineResumeConst").ResumeStatus.INIT&&(this._hasMessagesToDownload=!1,this._finishedDownloading=!0,d("WAWebCmd").Cmd.handleOfflineProgressUpdate(),!this._mainScreenLoaded&&!this._mainScreenLoadPromise&&(this._mainScreenLoadPromise=d("WAWebOfflineResumeUtils").loadMainScreen({})));yield this._mainScreenLoadPromise;this._offlineStanzaCountAfterOfflineMarker=0;self.setTimeout(function(){b._offlineStanzaCountAfterOfflineMarker>d("WAWebOfflineResumeConst").OFFLINE_STANZA_COUNT_LIMIT&&(d("WALogger").WARN(l(),b._offlineStanzaCountAfterOfflineMarker),d("WAWebOfflineResumeUtils").refreshWindow())},d("WAWebOfflineResumeConst").OFFLINE_STANZA_COUNT_CHECK_TIMEOUT_MS);this._setStatus(d("WAWebOfflineResumeConst").ResumeStatus.COMPLETE);return this._handleOfflineComplete()});function c(b){return a.apply(this,arguments)}return c}();e.isResumeFromRestartComplete=function(){return this._status!==d("WAWebOfflineResumeConst").ResumeStatus.RESUME_ON_RESTART&&this._status!==d("WAWebOfflineResumeConst").ResumeStatus.INIT};e.isResumeFromRestartInProgress=function(){return this._status!==d("WAWebOfflineResumeConst").ResumeStatus.INIT&&!d("WAWebCmd").Cmd.isOfflineDeliveryEnd};e.isResumeOnSocketDisconnectInProgress=function(){return this._status===d("WAWebOfflineResumeConst").ResumeStatus.RESUME_WITH_OPEN_TAB};e.isResumeComplete=function(){return this._status===d("WAWebOfflineResumeConst").ResumeStatus.COMPLETE};e.getHasMessagesToDownload=function(){return this._hasMessagesToDownload};e.getFinishedDownloading=function(){return this.getOfflineDeliveryProgress()===100};e.shouldUseOfflineResumeScreen=function(){return this.offlineMessagePreviewCounter>this._decryptedMessageCount};e.processDecryptResult=function(a){this._refreshOfflineCompleteTimer(),this._decryptedMessageCount+=1,a===d("WAWebHandleMsgTypes.flow").E2EProcessResult.RETRY&&(this._decryptionErrorCount+=1)};e.offlineStanzaReceivedAfterComplete=function(){this.isResumeFromRestartComplete()&&(this._offlineStanzaCountAfterOfflineMarker+=1)};e.newOfflineStanza=function(a,b){d("WAWebWamOfflineResumeReporter").OfflineResumeReporter.logAddOfflineSizeBytes(b),d("WAWebWamOfflineResumeReporter").OfflineResumeReporter.logOldestStanzaTime(a),this._refreshOfflineCompleteTimer()};e.getResumeUIProgressBarType=function(){return!d("WAWebCmd").Cmd.isOfflineDeliveryEnd&&this.offlineMessagePreviewCounter>=u?d("WAWebOfflineResumeTypes.flow").ResumeUIProgressBarType.Toastbar:d("WAWebOfflineResumeTypes.flow").ResumeUIProgressBarType.None};e._refreshOfflineCompleteTimer=function(){this._offlineCompleteTimer&&this._offlineCompleteTimer.onOrAfter(d("WAWebOfflineResumeConst").OFFLINE_STANZA_TIMEOUT_MS)};e._startOfflineCompleteTimer=function(a,b){var c,e=this;(c=this._offlineCompleteTimer)==null?void 0:c.cancel();this._offlineCompleteTimer=new(d("WAShiftTimer").ShiftTimer)(function(){if(e._status!==d("WAWebOfflineResumeConst").ResumeStatus.COMPLETE){d("WALogger").LOG(k());var c=d("WALogger").ERROR(j());d("WAWebHandleOfflineAbProps").isNonBlockingOfflineResumeExpEnabled()&&(c=c.tags("offline-resume-experimental"));c.sendLogs("non-blocking-offline-resume-timeout",{sampling:.01});void e.processOfflineSessionComplete(a+b);e._offlineCompleteTimer=null;d("WAWebWamOfflineResumeReporter").OfflineResumeReporter.logMissedOfflineComplete()}});this._offlineCompleteTimer.onOrAfter(d("WAWebOfflineResumeConst").OFFLINE_STANZA_TIMEOUT_MS)};e._handleOfflineComplete=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield d("WAWebMessageQueue").waitForOfflineMessageQueue(),d("WAWebMsgSyncTunnelBatcher").nonBlockingMsgsSyncTunnel.isEnabled()&&(yield d("WAWebMsgSyncTunnelBatcher").nonBlockingMsgsSyncTunnel.drain()),d("WAWebMsgSyncConfiguratedTunnel").isMsgSyncTunnelActive()&&d("WAWebMsgSyncConfiguratedTunnel").msgSyncTunnel.completeUIUpdate(),d("WAWebWamOfflineResumeReporter").OfflineResumeReporter.logOfflineDecryptionErrorCount(this._decryptionErrorCount),d("WAWebWamOfflineResumeReporter").OfflineResumeReporter.logLastStanzaT(),d("WAWebThreadMetadata").resetThreadMeta(),d("WALogger").LOG(i(),this._decryptionErrorCount),this._decryptionErrorCount=0,yield d("WAWebOfflineResumeUtils").clearOfflineSnapShot(),this._maxProgress=97,yield this._mainScreenLoadPromise,yield d("WAWebOffdStorageUpdateOfflinePeerReceipts").updatePeerReceipts(),this._maxProgress=99,d("WALogger").LOG(h()),d("WAWebCmd").Cmd.offlineDeliveryEnd(),d("WAWebUserPrefsGeneral").setOfflinePushCount(0),this._progressBarTimer.forceRunNow(),this._progressBarTimer.cancel(),d("WAWebWamOfflineResumeReporter").OfflineResumeReporter.commit(),d("WAWebSignalProtocolStore").enablePersistSignalStore(),void d("WAWebOfflineResumeUtils").runReceiptCleanUpLoop(),d("WAWebWorkerSafeBackendApi").workerSafeFireAndForget("processAllOrphanPaymentNotifications"),d("WAWebChatThreadLogging").uploadChatThreadLoggingEvents(),c("WAWebBrokerGlobalAppState").initOrUpdateTracking(d("WAWebWamEnumWebcScenarioType").WEBC_SCENARIO_TYPE.IDLE),d("WAWebWamMemoryStat").setCurrentMemoryScenario(d("WAWebWamEnumWebcScenarioType").WEBC_SCENARIO_TYPE.IDLE),self.setTimeout(function(){d("WAWebApiPendingDeviceSync").doPendingDeviceSync()},d("WAWebOfflineResumeConst").OFFLINE_DEVICE_SYNC_DELAY)});function a(){return a.apply(this,arguments)}return a}();return a}();g.getOrCreateInstance=a;g.clearInstance=e;g.OfflineNonBlockingResumeStageManager=w}),98); __d("WAWebOfflineResumeMainThread",["WAWebABProps","WAWebBlockingOfflineResumeManager","WAWebNonBlockingOfflineResumeManager"],(function(a,b,c,d,e,f,g){function a(a){a.initState({getBlockingStageManager:function(){if(d("WAWebABProps").getABPropConfigValue("web_offline_stage_manager_singleton_enabled")){d("WAWebNonBlockingOfflineResumeManager").clearInstance();return d("WAWebBlockingOfflineResumeManager").getOrCreateInstance()}return new(d("WAWebBlockingOfflineResumeManager").OfflineBlockingResumeStageManager)()},getNonblockingStageManager:function(a){if(d("WAWebABProps").getABPropConfigValue("web_offline_stage_manager_singleton_enabled")){d("WAWebBlockingOfflineResumeManager").clearInstance();return d("WAWebNonBlockingOfflineResumeManager").getOrCreateInstance(a)}return new(d("WAWebNonBlockingOfflineResumeManager").OfflineNonBlockingResumeStageManager)(a)}})}g.setupMainThreadResume=a}),98); __d("WAWebQplAbpropsConfigValueProvider",["WAWebABProps"],(function(a,b,c,d,e,f,g){function a(){return d("WAWebABProps").getABPropConfigValue("qpl_enabled")}function b(){return d("WAWebABProps").getABPropConfigValue("qpl_upload_delay")*60}function c(){return d("WAWebABProps").getABPropConfigValue("qpl_sampling_as_string")}function e(){return d("WAWebABProps").getABPropConfigValue("qpl_initial_upload_delay")*60}g.isQplEnabled=a;g.getUploadIntervalInSeconds=b;g.getEventSampling=c;g.getInitialUploadDelayInSeconds=e}),98); __d("WAWebQplConfig",["WALogger","WAQplConfigTypes","WAWebQplHealthLogger","WAWebQplQuickPerformanceLoggerModule","gkx"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["QPL Config has already been initialized"]);h=function(){return a};return a}var i={sampleRate:0,samplingMethod:d("WAQplConfigTypes").QplSampleMethod.EVENT_BASED_SAMPLING},j={sampleRate:1,samplingMethod:d("WAQplConfigTypes").QplSampleMethod.EVENT_BASED_SAMPLING},k,l,m;function n(){return m.isQplEnabled()}function o(){return m.getUploadIntervalInSeconds()}function p(){return m.getInitialUploadDelayInSeconds()}function q(a){if(c("gkx")("26256"))return j;a=d("WAWebQplQuickPerformanceLoggerModule").convertMarkerIdOrEvent(a);a=k.get(a);return a?a:i}function r(){try{var a=m.getEventSampling();a.indexOf("json:")===0&&(a=a.slice(5));a=JSON.parse(a);a=a.sampling;a.forEach(function(a){var b=a[0],c=a[1];a=Math.max(a[2],0);k.set(b,{sampleRate:a,samplingMethod:c})})}catch(a){d("WAWebQplHealthLogger").errorParsingConfig(a)}}function a(a,b){b===void 0&&(b=!1);!l||b===!0?(k=new Map(),m=a,r(),l={isQplEnabled:n,uploadInterval:o,getEventDetails:q,uploadDelay:p}):d("WALogger").WARN(h()).tags("qpl");return l}g.config=a}),98); __d("WAWebQplInitMd",["Promise","WALogger","WAQplNetwork","WAQplUploader","WAWebApiQplEvents","WAWebQplAbpropsConfigValueProvider","WAWebQplConfig","WAWebQplHealthLogger","WAWebQplQuickPerformanceLoggerMarkerIds","WAWebQplQuickPerformanceLoggerModule","WAWebQplStorageApi","WAWebQplValuesConfig","WAWebWaUlCookieUtils","WAWebXHR","gkx"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["QPL is disabled, throwing Killswitch, will clear database"]);i=function(){return a};return a}function a(){var b=babelHelpers.taggedTemplateLiteralLoose(["QPL, got event ",", duration: ","ms, ",""]);a=function(){return b};return b}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["QPL is being initialized"]);j=function(){return a};return a}var k={post:c("WAWebXHR").post};function e(){d("WAQplNetwork").defaultQplNetwork({restInterface:k,isDev:0,qplAccessToken:d("WAWebQplValuesConfig").qplConfigs.accessToken,qplAppId:d("WAWebQplValuesConfig").qplConfigs.appId,qplEndpoint:d("WAWebQplValuesConfig").qplConfigs.endpoint,waul_cookie:d("WAWebWaUlCookieUtils").getWaUlCookieIfLoggedOut()});var a=d("WAWebQplConfig").config(d("WAWebQplAbpropsConfigValueProvider"));if(a.isQplEnabled()){d("WALogger").LOG(j());if(c("gkx")("26256")){var e=new URLSearchParams(window.location.search).get("e2etestname");void d("WAQplUploader").start({sendEvents:function(a){a.forEach(function(a){e!=null&&(a.annotations?a.annotations.e2etestname=e:a.annotations={e2etestname:e})});var b=window.__je2e_recordQPLMarker;b!=null&&typeof b==="function"&&a.forEach(b);return d("WAQplNetwork").defaultQplNetwork().sendEventsOverNetwork(a)},isQplEnabled:function(){return!0},intervalInSeconds:a.uploadInterval(),startDelayInSeconds:a.uploadDelay()},{storageApi:new(d("WAWebQplStorageApi").QplStorageApi)(),healthLogger:d("WAWebQplHealthLogger")})}else d("WAQplUploader").start({isQplEnabled:a.isQplEnabled,sendEvents:function(a){return d("WAQplNetwork").defaultQplNetwork().sendEventsOverNetwork(a)},intervalInSeconds:a.uploadInterval(),startDelayInSeconds:a.uploadDelay()},{storageApi:new(d("WAWebQplStorageApi").QplStorageApi)(),healthLogger:d("WAWebQplHealthLogger")});d("WAWebQplQuickPerformanceLoggerModule").QPL.init(function(a,c){d("WAWebApiQplEvents").add([a]);return(h||(h=b("Promise"))).resolve()},a.getEventDetails,a.isQplEnabled)}else d("WALogger").LOG(i()),d("WAWebQplQuickPerformanceLoggerModule").QPL.throwKillswitch(!0),d("WAWebQplQuickPerformanceLoggerModule").QPL.clearStorage()}g.startQPL=e}),98); __d("WAWebStickerDownloadGatingUtils",["WAWebABProps"],(function(a,b,c,d,e,f,g){function a(){return d("WAWebABProps").getABPropConfigValue("web_sticker_download_m1")}g.isStickerDownloadM1Enabled=a}),98); __d("WAWebStoreSpecialAbProps",["WALogger","WAWebABProps","WAWebLocalStorage","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Failed to store special early abprops"]);h=function(){return a};return a}var i=["web_apply_latest_db_schema_optimization_enabled","wa_web_favicons_update_m1","web_ui_refresh_m1"],j="abprops_needed_early";function a(){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){try{var a=i.reduce(function(a,b){var c=d("WAWebABProps").getABPropConfigValue(b);c!=null&&(a[b]=c);return a},{});c("WAWebLocalStorage")==null?void 0:c("WAWebLocalStorage").setItem(j,JSON.stringify(a))}catch(a){d("WALogger").ERROR(h()).sendLogs(a)}});return k.apply(this,arguments)}g.storeSpecialAbProps=a}),98); __d("WAWebAdvMetadataCreationFailureWamEvent",["WAWebWamCodegenUtils"],(function(a,b,c,d,e,f,g){a=d("WAWebWamCodegenUtils").defineEvents({AdvMetadataCreationFailure:[3048,{advMetadataIsMe:[1,d("WAWebWamCodegenUtils").TYPES.BOOLEAN]},[1,1,1],"regular"]},{AdvMetadataCreationFailure:[]});g.AdvMetadataCreationFailureWamEvent=a}),98); __d("WAWebCommunityHomeActionWamEvent",["WAWebWamCodegenUtils"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({CommunityHomeAction:[3494,{communityHomeGroupDiscoveries:[1,a.TYPES.INTEGER],communityHomeGroupJoins:[2,a.TYPES.INTEGER],communityHomeGroupNavigations:[3,a.TYPES.INTEGER],communityHomeId:[4,a.TYPES.STRING],communityHomeViews:[5,a.TYPES.INTEGER]},[1,1,1],"regular"]},{CommunityHomeAction:[]});g.CommunityHomeActionWamEvent=b}),98); __d("WAWebCommunityTabActionWamEvent",["WAWebWamCodegenUtils"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({CommunityTabAction:[3496,{communityNoActionTabViews:[4,a.TYPES.INTEGER],communityTabGroupNavigations:[1,a.TYPES.INTEGER],communityTabToHomeViews:[2,a.TYPES.INTEGER],communityTabViews:[3,a.TYPES.INTEGER],communityTabViewsViaContextMenu:[5,a.TYPES.INTEGER]},[1,1,1],"regular"]},{CommunityTabAction:[]});g.CommunityTabActionWamEvent=b}),98); __d("WAWebWamEnumBackupNetworkSetting",[],(function(a,b,c,d,e,f){a=Object.freeze({WIFI_ONLY:0,WIFI_OR_CELLULAR:1});f.BACKUP_NETWORK_SETTING=a}),66); __d("WAWebWamEnumBackupSchedule",[],(function(a,b,c,d,e,f){a=Object.freeze({OFF:0,DAILY:1,WEEKLY:2,MONTHLY:3,MANUAL:4});f.BACKUP_SCHEDULE=a}),66); __d("WAWebWamEnumContactsPermissionAuthorizationStatusType",[],(function(a,b,c,d,e,f){a=Object.freeze({NOT_DETERMINED:1,RESTRICTED:2,DENIED:3,AUTHORIZED:4,LIMITED:5});f.CONTACTS_PERMISSION_AUTHORIZATION_STATUS_TYPE=a}),66); __d("WAWebWamEnumEmailState",[],(function(a,b,c,d,e,f){a=Object.freeze({NOT_ADDED:1,UNVERIFIED:2,VERIFIED:3});f.EMAIL_STATE=a}),66); __d("WAWebWamEnumGalleryPermissionState",[],(function(a,b,c,d,e,f){a=Object.freeze({FULL:1,PARTIAL:2,NONE:3});f.GALLERY_PERMISSION_STATE=a}),66); __d("WAWebWamEnumMediaQuality",[],(function(a,b,c,d,e,f){a=Object.freeze({AUTO:0,DATA_SAVER:1,HIGH_QUALITY:2,HIGHEST_QUALITY:3});f.MEDIA_QUALITY=a}),66); __d("WAWebWamEnumMetaAiModelTierType",[],(function(a,b,c,d,e,f){a=Object.freeze({BASE:0,PREMIUM:1});f.META_AI_MODEL_TIER_TYPE=a}),66); __d("WAWebWamEnumNotificationSettingType",[],(function(a,b,c,d,e,f){a=Object.freeze({ALLOWED:1,BLOCKED:2,UNKNOWN:3});f.NOTIFICATION_SETTING_TYPE=a}),66); __d("WAWebWamEnumPrivacySettingsContactsBuckets",[],(function(a,b,c,d,e,f){a=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});f.PRIVACY_SETTINGS_CONTACTS_BUCKETS=a}),66); __d("WAWebWamEnumPrivacySettingsValueType",[],(function(a,b,c,d,e,f){a=Object.freeze({NOBODY:1,ONLY_SHARE_WITH:2,MY_CONTACTS:3,MY_CONTACTS_EXCEPT:4,EVERYONE:5,KNOWN:6});f.PRIVACY_SETTINGS_VALUE_TYPE=a}),66); __d("WAWebDailyWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumAndroidKeystoreStateType","WAWebWamEnumBackupNetworkSetting","WAWebWamEnumBackupSchedule","WAWebWamEnumContactsPermissionAuthorizationStatusType","WAWebWamEnumEmailState","WAWebWamEnumGalleryPermissionState","WAWebWamEnumMediaQuality","WAWebWamEnumMetaAiModelTierType","WAWebWamEnumNotificationSettingType","WAWebWamEnumPrivacySettingsContactsBuckets","WAWebWamEnumPrivacySettingsValueType"],(function(a,b,c,d,e,f,g){e=(a=d("WAWebWamCodegenUtils")).defineEvents({Daily:[1158,{accessibilityVoiceover:[108,a.TYPES.BOOLEAN],addressbookSize:[11,a.TYPES.INTEGER],addressbookWhatsappSize:[12,a.TYPES.INTEGER],aiMemorySavedCnt:[223,a.TYPES.INTEGER],aiWidgetInstalled:[210,a.TYPES.BOOLEAN],androidAdvertisingId:[135,a.TYPES.STRING],androidKeystoreState:[139,d("WAWebWamEnumAndroidKeystoreStateType").ANDROID_KEYSTORE_STATE_TYPE],androidXmppWorkersRuntime:[167,a.TYPES.INTEGER],appCodeHash:[103,a.TYPES.STRING],appLastOpenTimestamp:[212,a.TYPES.INTEGER],appStandbyBucket:[121,a.TYPES.INTEGER],autoDlAudioCellular:[90,a.TYPES.BOOLEAN],autoDlAudioRoaming:[91,a.TYPES.BOOLEAN],autoDlAudioWifi:[89,a.TYPES.BOOLEAN],autoDlDocCellular:[96,a.TYPES.BOOLEAN],autoDlDocRoaming:[97,a.TYPES.BOOLEAN],autoDlDocWifi:[95,a.TYPES.BOOLEAN],autoDlImageCellular:[87,a.TYPES.BOOLEAN],autoDlImageRoaming:[88,a.TYPES.BOOLEAN],autoDlImageWifi:[86,a.TYPES.BOOLEAN],autoDlVideoCellular:[93,a.TYPES.BOOLEAN],autoDlVideoRoaming:[94,a.TYPES.BOOLEAN],autoDlVideoWifi:[92,a.TYPES.BOOLEAN],backupNetworkSetting:[10,d("WAWebWamEnumBackupNetworkSetting").BACKUP_NETWORK_SETTING],backupRestoreEncryptionVersion:[138,a.TYPES.INTEGER],backupSchedule:[9,d("WAWebWamEnumBackupSchedule").BACKUP_SCHEDULE],channelsMediaFolderSize:[186,a.TYPES.INTEGER],chatDatabaseSize:[19,a.TYPES.INTEGER],chatLockFolderCount:[168,a.TYPES.INTEGER],contactsCreatedOnWhatsappSize:[200,a.TYPES.INTEGER],contactsPermissionAuthorizationStatus:[201,d("WAWebWamEnumContactsPermissionAuthorizationStatusType").CONTACTS_PERMISSION_AUTHORIZATION_STATUS_TYPE],count1on1Threads:[216,a.TYPES.INTEGER],countEphemeralThreads:[181,a.TYPES.INTEGER],countEphemeralThreadsEnabledByMe:[182,a.TYPES.INTEGER],countGroupThreads:[217,a.TYPES.INTEGER],countLimitSharing1on1Threads:[218,a.TYPES.INTEGER],countLimitSharingGroupThreads:[219,a.TYPES.INTEGER],dbAddressbookTableSize:[206,a.TYPES.INTEGER],defaultDisappearingDuration:[140,a.TYPES.INTEGER],defenseMode:[214,a.TYPES.INTEGER],deviceLanguage:[153,a.TYPES.STRING],emailState:[174,d("WAWebWamEnumEmailState").EMAIL_STATE],entSecurityNotificationsEnabled:[134,a.TYPES.BOOLEAN],experimentTmoPreloadGroupDaily:[166,a.TYPES.INTEGER],favoritedAnimatedStickerCount:[113,a.TYPES.INTEGER],favoritedFirstPartyStickerCount:[112,a.TYPES.INTEGER],favoritedTotalStickerCount:[111,a.TYPES.INTEGER],galleryPermission:[164,d("WAWebWamEnumGalleryPermissionState").GALLERY_PERMISSION_STATE],hasTextstatusEmojiModified24h:[175,a.TYPES.BOOLEAN],hasTextstatusModified24h:[176,a.TYPES.BOOLEAN],hasTextstatusTextModified24h:[177,a.TYPES.BOOLEAN],hasUsername:[187,a.TYPES.BOOLEAN],hasUsernamePin:[222,a.TYPES.BOOLEAN],inNetworkContactsSize:[190,a.TYPES.INTEGER],installedAnimatedStickerPackCount:[116,a.TYPES.INTEGER],installedAnimatedThirdPartyStickerPackCount:[137,a.TYPES.INTEGER],installedFirstPartyStickerPackCount:[115,a.TYPES.INTEGER],installedTotalStickerPackCount:[114,a.TYPES.INTEGER],isContactSyncToOsDefaultOn:[202,a.TYPES.BOOLEAN],isDefaultDisappearingMessagingUser:[183,a.TYPES.BOOLEAN],isEphemeralMessagingUser:[184,a.TYPES.BOOLEAN],isProfilePhotoSet:[195,a.TYPES.BOOLEAN],keyboardLanguage:[154,a.TYPES.STRING],languageCode:[5,a.TYPES.STRING],lastBackupTimestamp:[63,a.TYPES.INTEGER],lastCloudBackupSize:[185,a.TYPES.INTEGER],locationCode:[6,a.TYPES.STRING],lockFolderHidden:[171,a.TYPES.BOOLEAN],lowestAppStandbyBucket:[160,a.TYPES.INTEGER],mdPairTime:[124,a.TYPES.INTEGER],mediaFolderFileCount:[21,a.TYPES.INTEGER],mediaFolderSize:[20,a.TYPES.INTEGER],mediaQualitySetting:[188,d("WAWebWamEnumMediaQuality").MEDIA_QUALITY],metaAiModelActual:[198,d("WAWebWamEnumMetaAiModelTierType").META_AI_MODEL_TIER_TYPE],metaAiModelSelected:[199,d("WAWebWamEnumMetaAiModelTierType").META_AI_MODEL_TIER_TYPE],metaAiVoiceDefaultOn:[220,a.TYPES.BOOLEAN],metaAiVoiceSelection:[221,a.TYPES.STRING],modifiedInternalProps:[155,a.TYPES.BOOLEAN],nativeContactsGlobalSettingEnabled:[205,a.TYPES.BOOLEAN],networkIsRoaming:[7,a.TYPES.BOOLEAN],networkOperatorName:[159,a.TYPES.STRING],numAccounts:[163,a.TYPES.INTEGER],numContactsWithTextstatus24h:[178,a.TYPES.INTEGER],numContactsWithTextstatusEmoji24h:[179,a.TYPES.INTEGER],numContactsWithTextstatusText24h:[180,a.TYPES.INTEGER],osBuildNumber:[4,a.TYPES.STRING],osNotificationSetting:[118,d("WAWebWamEnumNotificationSettingType").NOTIFICATION_SETTING_TYPE],outOfNetworkContactsSize:[191,a.TYPES.INTEGER],packageName:[102,a.TYPES.STRING],passkeyExists:[165,a.TYPES.BOOLEAN],paymentsIsEnabled:[100,a.TYPES.BOOLEAN],peripheralConnected:[209,a.TYPES.STRING],permissionAccessCoarseLocation:[57,a.TYPES.INTEGER],permissionAccessFineLocation:[58,a.TYPES.INTEGER],permissionCamera:[56,a.TYPES.INTEGER],permissionContacts:[104,a.TYPES.BOOLEAN],permissionReadExternalStorage:[53,a.TYPES.INTEGER],permissionRecordAudio:[55,a.TYPES.INTEGER],phoneCores:[156,a.TYPES.INTEGER],phoneyid:[162,a.TYPES.STRING],preloadsAppManagerId:[224,a.TYPES.STRING],privacySettingsAbout:[141,(b=d("WAWebWamEnumPrivacySettingsValueType")).PRIVACY_SETTINGS_VALUE_TYPE],privacySettingsAboutExceptNum:[142,(c=d("WAWebWamEnumPrivacySettingsContactsBuckets")).PRIVACY_SETTINGS_CONTACTS_BUCKETS],privacySettingsGroups:[143,b.PRIVACY_SETTINGS_VALUE_TYPE],privacySettingsGroupsExceptNum:[144,c.PRIVACY_SETTINGS_CONTACTS_BUCKETS],privacySettingsLastSeen:[145,b.PRIVACY_SETTINGS_VALUE_TYPE],privacySettingsLastSeenExceptNum:[146,c.PRIVACY_SETTINGS_CONTACTS_BUCKETS],privacySettingsProfilePhoto:[147,b.PRIVACY_SETTINGS_VALUE_TYPE],privacySettingsProfilePhotoExceptNum:[148,c.PRIVACY_SETTINGS_CONTACTS_BUCKETS],privacySettingsStatus:[150,b.PRIVACY_SETTINGS_VALUE_TYPE],privacySettingsStatusExceptNum:[151,c.PRIVACY_SETTINGS_CONTACTS_BUCKETS],privacySettingsStatusShareNum:[152,c.PRIVACY_SETTINGS_CONTACTS_BUCKETS],profileLinksCount:[211,a.TYPES.INTEGER],receiptsEnabled:[8,a.TYPES.BOOLEAN],secretCodeActive:[172,a.TYPES.BOOLEAN],showMetaAiButtonSetting:[173,a.TYPES.BOOLEAN],simMcc:[2,a.TYPES.INTEGER],simMnc:[3,a.TYPES.INTEGER],storageAvailSize:[31,a.TYPES.INTEGER],storageTotalSize:[32,a.TYPES.INTEGER],supportedDecoders:[169,a.TYPES.STRING],supportedEncoders:[170,a.TYPES.STRING],syncedInNetworkContactsSize:[192,a.TYPES.INTEGER],totalCountInNetworkUniquePhoneNumber:[193,a.TYPES.INTEGER],totalCountSyncedInNetworkUniquePhoneNumber:[194,a.TYPES.INTEGER],trafficAnonymization:[215,a.TYPES.INTEGER],unreadBadgeFrequency:[213,a.TYPES.INTEGER],videoFolderFileCount:[23,a.TYPES.INTEGER],videoFolderSize:[22,a.TYPES.INTEGER],webcContactsTableSize:[207,a.TYPES.INTEGER],webcFilteredContactsSize:[208,a.TYPES.INTEGER]},[1,1,1],"regular"]},{Daily:[]});g.DailyWamEvent=e}),98); __d("WAWebE2eMessageSendWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumAddressingMode","WAWebWamEnumAgentEngagementEnumType","WAWebWamEnumBotType","WAWebWamEnumDeviceType","WAWebWamEnumE2eCiphertextType","WAWebWamEnumE2eDestination","WAWebWamEnumE2eDeviceType","WAWebWamEnumE2eFailureReason","WAWebWamEnumEditType","WAWebWamEnumGroupEncryptionType","WAWebWamEnumInvisibleMessageCategoryType","WAWebWamEnumMediaType","WAWebWamEnumMessageDistributionEnumType","WAWebWamEnumRevokeType","WAWebWamEnumTypeOfGroupEnum"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({E2eMessageSend:[476,{agentEngagementType:[15,d("WAWebWamEnumAgentEngagementEnumType").AGENT_ENGAGEMENT_ENUM_TYPE],botType:[17,d("WAWebWamEnumBotType").BOT_TYPE],e2eBackfill:[18,a.TYPES.BOOLEAN],e2eCiphertextType:[5,d("WAWebWamEnumE2eCiphertextType").E2E_CIPHERTEXT_TYPE],e2eCiphertextVersion:[6,a.TYPES.INTEGER],e2eDestination:[4,d("WAWebWamEnumE2eDestination").E2E_DESTINATION],e2eFailureReason:[2,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON],e2eReceiverDeviceType:[19,d("WAWebWamEnumE2eDeviceType").E2E_DEVICE_TYPE],e2eReceiverType:[8,d("WAWebWamEnumDeviceType").DEVICE_TYPE],e2eSuccessful:[1,a.TYPES.BOOLEAN],editType:[14,d("WAWebWamEnumEditType").EDIT_TYPE],encRetryCount:[9,a.TYPES.INTEGER],groupEncryptionState:[22,d("WAWebWamEnumGroupEncryptionType").GROUP_ENCRYPTION_TYPE],invisibleMessageCategory:[21,d("WAWebWamEnumInvisibleMessageCategoryType").INVISIBLE_MESSAGE_CATEGORY_TYPE],isLid:[12,a.TYPES.BOOLEAN],localAddressingMode:[16,d("WAWebWamEnumAddressingMode").ADDRESSING_MODE],messageDistributionType:[20,d("WAWebWamEnumMessageDistributionEnumType").MESSAGE_DISTRIBUTION_ENUM_TYPE],messageIsInvisible:[10,a.TYPES.BOOLEAN],messageMediaType:[7,d("WAWebWamEnumMediaType").MEDIA_TYPE],retryCount:[3,a.TYPES.INTEGER],revokeType:[11,d("WAWebWamEnumRevokeType").REVOKE_TYPE],typeOfGroup:[13,d("WAWebWamEnumTypeOfGroupEnum").TYPE_OF_GROUP_ENUM]},[1,20,20],"regular"]},{E2eMessageSend:[]});g.E2eMessageSendWamEvent=b}),98); __d("WAWebWamEnumRetryRejectReason",[],(function(a,b,c,d,e,f){a=Object.freeze({OTHER:0,DOUBLE_CHECKMARK:1,IDENTITY_CHANGE:2,MESSAGE_NOT_EXIST:3,HIGH_RETRY_COUNT:4});f.RETRY_REJECT_REASON=a}),66); __d("WAWebE2eRetryRejectWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumDeviceType","WAWebWamEnumInvisibleMessageCategoryType","WAWebWamEnumMediaType","WAWebWamEnumMessageType","WAWebWamEnumRetryRejectReason"],(function(a,b,c,d,e,f,g){a=d("WAWebWamCodegenUtils").defineEvents({E2eRetryReject:[3578,{invisibleMessageCategory:[6,d("WAWebWamEnumInvisibleMessageCategoryType").INVISIBLE_MESSAGE_CATEGORY_TYPE],mediaType:[7,d("WAWebWamEnumMediaType").MEDIA_TYPE],messageType:[1,d("WAWebWamEnumMessageType").MESSAGE_TYPE],msgRetryCount:[2,d("WAWebWamCodegenUtils").TYPES.INTEGER],retryRejectReason:[3,d("WAWebWamEnumRetryRejectReason").RETRY_REJECT_REASON],retryRevoke:[4,d("WAWebWamCodegenUtils").TYPES.BOOLEAN],senderDeviceType:[5,d("WAWebWamEnumDeviceType").DEVICE_TYPE]},[1,1,1],"regular"]},{E2eRetryReject:[]});g.E2eRetryRejectWamEvent=a}),98); __d("WAWebWamEnumForwardPickerOrigin",[],(function(a,b,c,d,e,f){a=Object.freeze({STATUS_VIEWER:1});f.FORWARD_PICKER_ORIGIN=a}),66); __d("WAWebWamEnumMessageBizType",[],(function(a,b,c,d,e,f){a=Object.freeze({NOT_BIZ_MSG:0,API_MARKETING:1,API_UTILITY:2,OTHER_API_BIZ_MSG:3,SMB_BIZ_MSG:4});f.MESSAGE_BIZ_TYPE=a}),66); __d("WAWebForwardSendWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumDisappearingChatInitiatorType","WAWebWamEnumE2eCiphertextType","WAWebWamEnumEphemeralityInitiatorType","WAWebWamEnumEphemeralityTriggerActionType","WAWebWamEnumForwardPickerOrigin","WAWebWamEnumMediaType","WAWebWamEnumMessageBizType","WAWebWamEnumMessageType","WAWebWamEnumTypeOfGroupEnum"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({ForwardSend:[1728,{disappearingChatInitiator:[21,d("WAWebWamEnumDisappearingChatInitiatorType").DISAPPEARING_CHAT_INITIATOR_TYPE],e2eCiphertextType:[12,d("WAWebWamEnumE2eCiphertextType").E2E_CIPHERTEXT_TYPE],e2eCiphertextVersion:[11,a.TYPES.INTEGER],ephemeralityDuration:[18,a.TYPES.INTEGER],ephemeralityInitiator:[24,d("WAWebWamEnumEphemeralityInitiatorType").EPHEMERALITY_INITIATOR_TYPE],ephemeralityTriggerAction:[25,d("WAWebWamEnumEphemeralityTriggerActionType").EPHEMERALITY_TRIGGER_ACTION_TYPE],fastForwardEnabled:[5,a.TYPES.BOOLEAN],forwardPickerOrigin:[27,d("WAWebWamEnumForwardPickerOrigin").FORWARD_PICKER_ORIGIN],isForwardedForward:[22,a.TYPES.BOOLEAN],isFrequentlyForwarded:[14,a.TYPES.BOOLEAN],mediaCaptionPresent:[10,a.TYPES.BOOLEAN],messageBizType:[26,d("WAWebWamEnumMessageBizType").MESSAGE_BIZ_TYPE],messageForwardAgeT:[4,a.TYPES.TIMER],messageIsFanout:[6,a.TYPES.BOOLEAN],messageIsFastForward:[3,a.TYPES.BOOLEAN],messageIsInternational:[9,a.TYPES.BOOLEAN],messageMediaType:[2,d("WAWebWamEnumMediaType").MEDIA_TYPE],messageSendT:[13,a.TYPES.TIMER],messageType:[1,d("WAWebWamEnumMessageType").MESSAGE_TYPE],receiverDefaultDisappearingDuration:[20,a.TYPES.INTEGER],resendCount:[8,a.TYPES.INTEGER],retryCount:[7,a.TYPES.INTEGER],senderDefaultDisappearingDuration:[19,a.TYPES.INTEGER],typeOfGroup:[23,d("WAWebWamEnumTypeOfGroupEnum").TYPE_OF_GROUP_ENUM],wouldBeFrequentlyForwardedAt3:[16,a.TYPES.BOOLEAN],wouldBeFrequentlyForwardedAt4:[17,a.TYPES.BOOLEAN]},[1,1,1],"regular"]},{ForwardSend:[]});g.ForwardSendWamEvent=b}),98); __d("WAWebKeepInChatNotifWamEvent",["WAWebWamCodegenUtils"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({KeepInChatNotif:[3484,{kicGroupNotificationTaps:[3,a.TYPES.INTEGER],kicGroupNotifications:[4,a.TYPES.INTEGER],kicNotificationTaps:[5,a.TYPES.INTEGER],kicNotifications:[6,a.TYPES.INTEGER]},[1,1,1],"regular"]},{KeepInChatNotif:[]});g.KeepInChatNotifWamEvent=b}),98); __d("WAWebMdAppStateDirtyBitsWamEvent",["WAWebWamCodegenUtils"],(function(a,b,c,d,e,f,g){a=d("WAWebWamCodegenUtils").defineEvents({MdAppStateDirtyBits:[2520,{dirtyBitsFalsePositive:[2,d("WAWebWamCodegenUtils").TYPES.BOOLEAN]},[1,20,1e3],"regular"]},{MdAppStateDirtyBits:[]});g.MdAppStateDirtyBitsWamEvent=a}),98); __d("WAWebWamEnumMdAppStateKeyRotationReasonCode",[],(function(a,b,c,d,e,f){a=Object.freeze({APP_STATE_SYNC_KEY_EXPIRY:1,DEVICE_DEREGISTERATION:2,NO_KEYS:3});f.MD_APP_STATE_KEY_ROTATION_REASON_CODE=a}),66); __d("WAWebMdAppStateKeyRotationWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumMdAppStateKeyRotationReasonCode"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({MdAppStateKeyRotation:[2518,{appSessionId:[2,a.TYPES.STRING],companionSessionIds:[3,a.TYPES.STRING],mdAppStateKeyRotationReason:[1,d("WAWebWamEnumMdAppStateKeyRotationReasonCode").MD_APP_STATE_KEY_ROTATION_REASON_CODE],oldSyncdKeyhash:[6,a.TYPES.STRING],oldSyncdKeyid:[7,a.TYPES.STRING],seqNumber:[8,a.TYPES.INTEGER],syncdKeyhashAfterRotation:[9,a.TYPES.STRING],syncdKeyidAfterRotation:[10,a.TYPES.STRING]},[1,20,1e3],"regular"]},{MdAppStateKeyRotation:[]});g.MdAppStateKeyRotationWamEvent=b}),98); __d("WAWebMdAppStateMessageRangeWamEvent",["WAWebWamCodegenUtils"],(function(a,b,c,d,e,f,g){a=d("WAWebWamCodegenUtils").defineEvents({MdAppStateMessageRange:[2522,{additionalMessagesCount:[1,d("WAWebWamCodegenUtils").TYPES.INTEGER]},[1,20,1e3],"regular"]},{MdAppStateMessageRange:[]});g.MdAppStateMessageRangeWamEvent=a}),98); __d("WAWebMdAppStateSyncDailyWamEvent",["WAWebWamCodegenUtils"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({MdAppStateSyncDaily:[2300,{crossIndexConflictCount:[11,a.TYPES.INTEGER],invalidActionCount:[4,a.TYPES.INTEGER],keyRotationRemoveCount:[12,a.TYPES.INTEGER],missingKeyCount:[9,a.TYPES.INTEGER],mutationCount:[1,a.TYPES.INTEGER],storedMutationCount:[7,a.TYPES.INTEGER],unsetActionCount:[8,a.TYPES.INTEGER],unsupportedActionCount:[5,a.TYPES.INTEGER],uploadConflictCount:[10,a.TYPES.INTEGER]},[1,1,1],"regular"]},{MdAppStateSyncDaily:[]});g.MdAppStateSyncDailyWamEvent=b}),98); __d("WAWebWamEnumMutationCountBucket",[],(function(a,b,c,d,e,f){a=Object.freeze({ZERO:1,ONE:2,LT10:3,LT100:4,LT500:5,LT1K:6,LT5K:7,GTE5K:8});f.MUTATION_COUNT_BUCKET=a}),66); __d("WAWebMdAppStateSyncMutationStatsWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumMutationCountBucket"],(function(a,b,c,d,e,f,g){b=d("WAWebWamCodegenUtils").defineEvents({MdAppStateSyncMutationStats:[3180,{applied:[1,(a=d("WAWebWamEnumMutationCountBucket")).MUTATION_COUNT_BUCKET],failed:[2,a.MUTATION_COUNT_BUCKET],invalid:[3,a.MUTATION_COUNT_BUCKET],orphan:[4,a.MUTATION_COUNT_BUCKET],syncdAction:[5,d("WAWebWamCodegenUtils").TYPES.STRING],unsupported:[6,a.MUTATION_COUNT_BUCKET]},[1,1,100],"private",0]},{MdAppStateSyncMutationStats:[]});g.MdAppStateSyncMutationStatsWamEvent=b}),98); __d("WAWebWamEnumBootstrapAppStateDataStageCode",[],(function(a,b,c,d,e,f){a=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});f.BOOTSTRAP_APP_STATE_DATA_STAGE_CODE=a}),66); __d("WAWebWamEnumMdBootstrapPayloadType",[],(function(a,b,c,d,e,f){a=Object.freeze({CRITICAL:1,NON_CRITICAL:2});f.MD_BOOTSTRAP_PAYLOAD_TYPE=a}),66); __d("WAWebMdBootstrapAppStateCriticalDataProcessingWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumBootstrapAppStateDataStageCode","WAWebWamEnumMdBootstrapPayloadType"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({MdBootstrapAppStateCriticalDataProcessing:[3164,{bootstrapAppStateDataStage:[1,d("WAWebWamEnumBootstrapAppStateDataStageCode").BOOTSTRAP_APP_STATE_DATA_STAGE_CODE],mdBootstrapPayloadType:[2,d("WAWebWamEnumMdBootstrapPayloadType").MD_BOOTSTRAP_PAYLOAD_TYPE],mdRegAttemptId:[3,a.TYPES.STRING],mdSessionId:[4,a.TYPES.STRING],mdTimestamp:[5,a.TYPES.INTEGER]},[1,1,1],"regular"]},{MdBootstrapAppStateCriticalDataProcessing:[]});g.MdBootstrapAppStateCriticalDataProcessingWamEvent=b}),98); __d("WAWebWamEnumMdBootstrapHistoryPayloadType",[],(function(a,b,c,d,e,f){a=Object.freeze({INITIAL:1,RECENT_HISTORY:2,FULL_HISTORY:3,PUSHNAME:4,STATUS_V3:5,NON_BLOCKING_DATA:6,ON_DEMAND:7});f.MD_BOOTSTRAP_HISTORY_PAYLOAD_TYPE=a}),66); __d("WAWebWamEnumMdBootstrapStepResult",[],(function(a,b,c,d,e,f){a=Object.freeze({SUCCESS:1,FAILURE:2});f.MD_BOOTSTRAP_STEP_RESULT=a}),66); __d("WAWebMdBootstrapAppStateDataDownloadedWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumApplicationState","WAWebWamEnumMdBootstrapHistoryPayloadType","WAWebWamEnumMdBootstrapPayloadType","WAWebWamEnumMdBootstrapStepResult"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({MdBootstrapAppStateDataDownloaded:[2294,{appContext:[14,a.TYPES.STRING],appContextBitfield:[15,a.TYPES.INTEGER],applicationState:[13,d("WAWebWamEnumApplicationState").APPLICATION_STATE],mdBootstrapContactsCount:[5,a.TYPES.INTEGER],mdBootstrapHistoryPayloadType:[11,d("WAWebWamEnumMdBootstrapHistoryPayloadType").MD_BOOTSTRAP_HISTORY_PAYLOAD_TYPE],mdBootstrapPayloadSize:[4,a.TYPES.INTEGER],mdBootstrapPayloadType:[2,d("WAWebWamEnumMdBootstrapPayloadType").MD_BOOTSTRAP_PAYLOAD_TYPE],mdBootstrapStepDuration:[6,a.TYPES.INTEGER],mdBootstrapStepResult:[7,d("WAWebWamEnumMdBootstrapStepResult").MD_BOOTSTRAP_STEP_RESULT],mdRegAttemptId:[10,a.TYPES.STRING],mdSessionId:[1,a.TYPES.STRING],mdStorageQuotaBytes:[8,a.TYPES.INTEGER],mdStorageQuotaUsedBytes:[9,a.TYPES.INTEGER],mdTimestamp:[3,a.TYPES.INTEGER]},[1,1,1],"regular"]},{MdBootstrapAppStateDataDownloaded:[]});g.MdBootstrapAppStateDataDownloadedWamEvent=b}),98); __d("WAWebWamEnumMdBootstrapSource",[],(function(a,b,c,d,e,f){a=Object.freeze({APP_STATE:1,HISTORY:2});f.MD_BOOTSTRAP_SOURCE=a}),66); __d("WAWebMdBootstrapDataAppliedWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumApplicationState","WAWebWamEnumCollection","WAWebWamEnumMdBootstrapHistoryPayloadType","WAWebWamEnumMdBootstrapPayloadType","WAWebWamEnumMdBootstrapSource","WAWebWamEnumMdBootstrapStepResult"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({MdBootstrapDataApplied:[2298,{appContext:[22,a.TYPES.STRING],appContextBitfield:[23,a.TYPES.INTEGER],applicationState:[21,d("WAWebWamEnumApplicationState").APPLICATION_STATE],chunkChatsApplied:[15,a.TYPES.INTEGER],chunkMsgsApplied:[16,a.TYPES.INTEGER],collection:[5,d("WAWebWamEnumCollection").COLLECTION],historySyncChunkOrder:[14,a.TYPES.INTEGER],historySyncStageProgress:[11,a.TYPES.INTEGER],mdBootstrapChatsCount:[17,a.TYPES.INTEGER],mdBootstrapContactsCount:[8,a.TYPES.INTEGER],mdBootstrapHistoryPayloadType:[10,d("WAWebWamEnumMdBootstrapHistoryPayloadType").MD_BOOTSTRAP_HISTORY_PAYLOAD_TYPE],mdBootstrapMessagesCount:[18,a.TYPES.INTEGER],mdBootstrapPayloadType:[3,d("WAWebWamEnumMdBootstrapPayloadType").MD_BOOTSTRAP_PAYLOAD_TYPE],mdBootstrapSource:[2,d("WAWebWamEnumMdBootstrapSource").MD_BOOTSTRAP_SOURCE],mdBootstrapStepDuration:[6,a.TYPES.INTEGER],mdBootstrapStepResult:[12,d("WAWebWamEnumMdBootstrapStepResult").MD_BOOTSTRAP_STEP_RESULT],mdDroppedMsgType:[19,a.TYPES.STRING],mdRegAttemptId:[9,a.TYPES.STRING],mdSessionId:[1,a.TYPES.STRING],mdSyncFailureReason:[20,a.TYPES.STRING],mdTimestamp:[4,a.TYPES.INTEGER],sentViaMms:[13,a.TYPES.BOOLEAN],usedSnapshot:[7,a.TYPES.BOOLEAN]},[1,1,1],"regular"]},{MdBootstrapDataApplied:[]});g.MdBootstrapDataAppliedWamEvent=b}),98); __d("WAWebMdBootstrapHistoryDataDownloadedWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumApplicationState","WAWebWamEnumMdBootstrapHistoryPayloadType","WAWebWamEnumMdBootstrapPayloadType","WAWebWamEnumMdBootstrapStepResult"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({MdBootstrapHistoryDataDownloaded:[2296,{appContext:[18,a.TYPES.STRING],appContextBitfield:[19,a.TYPES.INTEGER],applicationState:[17,d("WAWebWamEnumApplicationState").APPLICATION_STATE],historySyncChunkOrder:[15,a.TYPES.INTEGER],historySyncStageProgress:[14,a.TYPES.INTEGER],mdBootstrapChatsCount:[6,a.TYPES.INTEGER],mdBootstrapHistoryPayloadType:[13,d("WAWebWamEnumMdBootstrapHistoryPayloadType").MD_BOOTSTRAP_HISTORY_PAYLOAD_TYPE],mdBootstrapMessagesCount:[5,a.TYPES.INTEGER],mdBootstrapPayloadSize:[4,a.TYPES.INTEGER],mdBootstrapPayloadType:[2,d("WAWebWamEnumMdBootstrapPayloadType").MD_BOOTSTRAP_PAYLOAD_TYPE],mdBootstrapStepDuration:[7,a.TYPES.INTEGER],mdBootstrapStepResult:[8,d("WAWebWamEnumMdBootstrapStepResult").MD_BOOTSTRAP_STEP_RESULT],mdHsOldestMessageTimestamp:[11,a.TYPES.INTEGER],mdRegAttemptId:[12,a.TYPES.STRING],mdSessionId:[1,a.TYPES.STRING],mdStorageQuotaBytes:[9,a.TYPES.INTEGER],mdStorageQuotaUsedBytes:[10,a.TYPES.INTEGER],mdSyncFailureReason:[16,a.TYPES.STRING],mdTimestamp:[3,a.TYPES.INTEGER]},[1,1,1],"regular"]},{MdBootstrapHistoryDataDownloaded:[]});g.MdBootstrapHistoryDataDownloadedWamEvent=b}),98); __d("WAWebMdBootstrapHistoryDataStartDownloadingWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumMdBootstrapHistoryPayloadType","WAWebWamEnumMdBootstrapPayloadType"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({MdBootstrapHistoryDataStartDownloading:[4650,{historySyncChunkOrder:[1,a.TYPES.INTEGER],historySyncStageProgress:[2,a.TYPES.INTEGER],mdBootstrapHistoryPayloadType:[3,d("WAWebWamEnumMdBootstrapHistoryPayloadType").MD_BOOTSTRAP_HISTORY_PAYLOAD_TYPE],mdBootstrapPayloadSize:[4,a.TYPES.INTEGER],mdBootstrapPayloadType:[5,d("WAWebWamEnumMdBootstrapPayloadType").MD_BOOTSTRAP_PAYLOAD_TYPE],mdBootstrapStepDuration:[6,a.TYPES.INTEGER],mdSessionId:[7,a.TYPES.STRING],mdTimestamp:[8,a.TYPES.INTEGER]},[1,1,1],"regular"]},{MdBootstrapHistoryDataStartDownloading:[]});g.MdBootstrapHistoryDataStartDownloadingWamEvent=b}),98); __d("WAWebWamEnumActiveTimeAfterPairing",[],(function(a,b,c,d,e,f){a=Object.freeze({MINS_10:1,MINS_20:2,MINS_40:3,MINS_60:4,MINS_5:5});f.ACTIVE_TIME_AFTER_PAIRING=a}),66); __d("WAWebWamEnumMdHistorySyncStatusResult",[],(function(a,b,c,d,e,f){a=Object.freeze({SUCCESS:1,UNFINISHED:2,FAIL_TO_DOWNLOAD:3,MISSING_CHUNK:4,PROTOBUF_ERROR:5,FAIL_TO_STORE:6,OTHER_ERROR:7,IN_PROGRESS:8,FAIL_TO_RECEIVE:9,FAIL_TO_STORE_CHUNK:10,FAIL_TO_FETCH:11,FAIL_TO_PREPROCESS:12,FAIL_TO_ENCRYPT:13});f.MD_HISTORY_SYNC_STATUS_RESULT=a}),66); __d("WAWebMdBootstrapHistorySyncStatusAfterPairingWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumActiveTimeAfterPairing","WAWebWamEnumMdBootstrapHistoryPayloadType","WAWebWamEnumMdHistorySyncStatusResult"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({MdBootstrapHistorySyncStatusAfterPairing:[4652,{activeTimeAfterPairing:[1,d("WAWebWamEnumActiveTimeAfterPairing").ACTIVE_TIME_AFTER_PAIRING],isLoopRunning:[12,a.TYPES.BOOLEAN],lastProcessedNotificationChunkOrder:[2,a.TYPES.INTEGER],lastProcessedNotificationChunkProgress:[3,a.TYPES.INTEGER],mdBootstrapHistoryPayloadType:[4,d("WAWebWamEnumMdBootstrapHistoryPayloadType").MD_BOOTSTRAP_HISTORY_PAYLOAD_TYPE],mdHistorySyncStatusResult:[5,d("WAWebWamEnumMdHistorySyncStatusResult").MD_HISTORY_SYNC_STATUS_RESULT],mdSessionId:[6,a.TYPES.STRING],mdTimestamp:[7,a.TYPES.INTEGER],missingNotificationCount:[8,a.TYPES.INTEGER],nextNotificationChunkOrder:[9,a.TYPES.INTEGER],totalProcessedMessageCount:[10,a.TYPES.INTEGER],unprocessedNotificationCount:[11,a.TYPES.INTEGER]},[1,1,1],"regular"]},{MdBootstrapHistorySyncStatusAfterPairing:[]});g.MdBootstrapHistorySyncStatusAfterPairingWamEvent=b}),98); __d("WAWebMdDeviceSyncAckWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumAddressingMode","WAWebWamEnumInvisibleMessageCategoryType","WAWebWamEnumMessageChatType","WAWebWamEnumTypeOfGroupEnum"],(function(a,b,c,d,e,f,g){a=d("WAWebWamCodegenUtils").defineEvents({MdDeviceSyncAck:[2180,{chatType:[1,d("WAWebWamEnumMessageChatType").MESSAGE_CHAT_TYPE],invisibleMessageCategory:[7,d("WAWebWamEnumInvisibleMessageCategoryType").INVISIBLE_MESSAGE_CATEGORY_TYPE],isLid:[3,d("WAWebWamCodegenUtils").TYPES.BOOLEAN],localAddressingMode:[5,d("WAWebWamEnumAddressingMode").ADDRESSING_MODE],revoke:[2,d("WAWebWamCodegenUtils").TYPES.BOOLEAN],serverAddressingMode:[6,d("WAWebWamEnumAddressingMode").ADDRESSING_MODE],typeOfGroup:[4,d("WAWebWamEnumTypeOfGroupEnum").TYPE_OF_GROUP_ENUM]},[1,1,1],"regular"]},{MdDeviceSyncAck:[]});g.MdDeviceSyncAckWamEvent=a}),98); __d("WAWebWamEnumMdCompanionDeviceAccountType",[],(function(a,b,c,d,e,f){a=Object.freeze({E2EE_DEVICE:1,HOSTED_DEVICE:2});f.MD_COMPANION_DEVICE_ACCOUNT_TYPE=a}),66); __d("WAWebWamEnumMdSyncdFatalErrorCode",[],(function(a,b,c,d,e,f){a=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});f.MD_SYNCD_FATAL_ERROR_CODE=a}),66); __d("WAWebWamEnumMdSyncdFatalErrorSource",[],(function(a,b,c,d,e,f){a=Object.freeze({SNAPSHOT:1,EXTERNAL_PATCH:2,INLINE_PATCH:3});f.MD_SYNCD_FATAL_ERROR_SOURCE=a}),66); __d("WAWebMdFatalErrorWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumCollection","WAWebWamEnumMdCompanionDeviceAccountType","WAWebWamEnumMdSyncdFatalErrorCode","WAWebWamEnumMdSyncdFatalErrorSource"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({MdFatalError:[2304,{appContext:[46,a.TYPES.STRING],appContextBitfield:[47,a.TYPES.INTEGER],appSessionId:[41,a.TYPES.STRING],collection:[2,d("WAWebWamEnumCollection").COLLECTION],companionSessionIds:[42,a.TYPES.STRING],currentPrimaryAppVersion:[14,a.TYPES.STRING],daysSinceLastPeriodicSync:[11,a.TYPES.INTEGER],didBootstrapFromSnapshot:[38,a.TYPES.BOOLEAN],hoursSinceFirstFiniteFailure:[12,a.TYPES.INTEGER],isBootstrap:[3,a.TYPES.BOOLEAN],isFatal:[16,a.TYPES.BOOLEAN],isPatchSenderPrimary:[23,a.TYPES.BOOLEAN],isPreviousPatchAnIncomingPatch:[24,a.TYPES.BOOLEAN],isPreviousPatchSenderPrimary:[25,a.TYPES.BOOLEAN],isSenderIndexSameAsPreviousSenderIndex:[39,a.TYPES.BOOLEAN],isThereAnotherSyncdCompanion:[40,a.TYPES.BOOLEAN],isWebLthashConsistent:[17,a.TYPES.BOOLEAN],macFatalCollectionNameMismatch:[18,a.TYPES.BOOLEAN],macFatalCurrentLthashMismatch:[19,a.TYPES.BOOLEAN],macFatalDidPreviousPatchFailPostSaveValidation:[26,a.TYPES.BOOLEAN],macFatalDidUseMacFetchFallback:[36,a.TYPES.BOOLEAN],macFatalFirstTwoBytesFromAHashOfSnapshotMacKeyMismatch:[20,a.TYPES.BOOLEAN],macFatalHasMissingRemove:[37,a.TYPES.BOOLEAN],macFatalNewLthashMismatch:[21,a.TYPES.BOOLEAN],macFatalNewLthashSubtractMismatch:[27,a.TYPES.BOOLEAN],macFatalNumberAddMismatch:[28,a.TYPES.BOOLEAN],macFatalNumberHasOverrideMutation:[29,a.TYPES.BOOLEAN],macFatalNumberNumAddMutation:[30,a.TYPES.INTEGER],macFatalNumberNumRemoveMutation:[31,a.TYPES.INTEGER],macFatalNumberOverrideMismatch:[32,a.TYPES.BOOLEAN],macFatalNumberRemoveMismatch:[33,a.TYPES.BOOLEAN],macFatalPatchVersionMismatch:[22,a.TYPES.BOOLEAN],macFatalPreviousPatchNewLthashToCurrentPatchCurrentLthash:[34,a.TYPES.BOOLEAN],macFatalSenderCurrentLthashToLocalCalculatedCurrentLthashMismatch:[35,a.TYPES.BOOLEAN],mailboxAgeDays:[13,a.TYPES.INTEGER],mdCompanionDeviceAccountType:[43,d("WAWebWamEnumMdCompanionDeviceAccountType").MD_COMPANION_DEVICE_ACCOUNT_TYPE],mdFatalErrorCode:[1,d("WAWebWamEnumMdSyncdFatalErrorCode").MD_SYNCD_FATAL_ERROR_CODE],mdRegAttemptId:[44,a.TYPES.STRING],patchSnapshotMutationCount:[9,a.TYPES.INTEGER],patchVersion:[5,a.TYPES.INTEGER],seqNumber:[45,a.TYPES.INTEGER],sessionStartPrimaryAppVersion:[15,a.TYPES.STRING],sourceType:[10,d("WAWebWamEnumMdSyncdFatalErrorSource").MD_SYNCD_FATAL_ERROR_SOURCE],timeSincePairingMs:[6,a.TYPES.INTEGER],timeSinceRefreshMs:[7,a.TYPES.INTEGER],timeSinceTabTakeoverMs:[8,a.TYPES.INTEGER]},[1,1,1],"regular"]},{MdFatalError:[]});g.MdFatalErrorWamEvent=b}),98); __d("WAWebWamEnumClientGroupSizeBucket",[],(function(a,b,c,d,e,f){a=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});f.CLIENT_GROUP_SIZE_BUCKET=a}),66); __d("WAWebMdGroupParticipantMissAckWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumClientGroupSizeBucket","WAWebWamEnumTypeOfGroupEnum"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({MdGroupParticipantMissAck:[4146,{groupSizeBucket:[1,d("WAWebWamEnumClientGroupSizeBucket").CLIENT_GROUP_SIZE_BUCKET],isLid:[2,a.TYPES.BOOLEAN],messageIsRevoke:[3,a.TYPES.BOOLEAN],participantAddCount:[4,a.TYPES.INTEGER],participantRemoveCount:[5,a.TYPES.INTEGER],typeOfGroup:[6,d("WAWebWamEnumTypeOfGroupEnum").TYPE_OF_GROUP_ENUM]},[1,1,1],"regular"]},{MdGroupParticipantMissAck:[]});g.MdGroupParticipantMissAckWamEvent=b}),98); __d("WAWebMdRetryFromUnknownDeviceWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumDeviceType"],(function(a,b,c,d,e,f,g){a=d("WAWebWamCodegenUtils").defineEvents({MdRetryFromUnknownDevice:[2178,{offline:[2,d("WAWebWamCodegenUtils").TYPES.BOOLEAN],senderType:[1,d("WAWebWamEnumDeviceType").DEVICE_TYPE]},[1,1,1],"regular"]},{MdRetryFromUnknownDevice:[]});g.MdRetryFromUnknownDeviceWamEvent=a}),98); __d("WAWebWamEnumMdFeatureCode",[],(function(a,b,c,d,e,f){a=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});f.MD_FEATURE_CODE=a}),66); __d("WAWebMdSyncdDogfoodingFeatureUsageWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumMdFeatureCode"],(function(a,b,c,d,e,f,g){a=d("WAWebWamCodegenUtils").defineEvents({MdSyncdDogfoodingFeatureUsage:[3016,{mdSyncdDogfoodingFeature:[1,d("WAWebWamEnumMdFeatureCode").MD_FEATURE_CODE]},[1,1,1],"regular"]},{MdSyncdDogfoodingFeatureUsage:[]});g.MdSyncdDogfoodingFeatureUsageWamEvent=a}),98); __d("WAWebWamEnumLogoutReasonType",[],(function(a,b,c,d,e,f){a=Object.freeze({NETWORK_BLOCKED:1,WRITING_STANZA_ERROR:2,READING_STANZA_ERROR_IO:3,READING_STANZA_READING_IS_OVER:4,READING_STANZA_ERROR_CORRUPT_STREAM:5,PUSH_WITH_SAME_SESSION_ID:6,SCHEDULED_LOGOUT:7,CLIENT_PING_TIMEOUT:8,RECEIPT_TIMEOUT:9,ACTIVE_CONNECTION_TIMEOUT:10,NETWORK_CHANGED:11,SWITCH_ACCOUNT:12,DELETE_ACCOUNT:13,CHANGE_NUMBER:14,MBS_MIGRATION:15,REGISTRATION_RELATED:16,ROADBLOCKED_DETAIL:17,SERVER_ACK_KICK:18,SERVER_PING_KICK:19});f.LOGOUT_REASON_TYPE=a}),66); __d("WAWebWamEnumMediaUploadResultType",[],(function(a,b,c,d,e,f){a=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,ERROR_CRONET:27,ERROR_INCOMPLETE_SERVER_RESPONSE:28,ERROR_TRANSCODING:29,ERROR_CANCEL_PROGRAMMATIC:30,ERROR_NO_ROUTE:31,ERROR_TOO_LARGE:32,ERROR_CANNOT_TRANSCODE:33,ERROR_UNKNOWN_MIMETYPE:34,ERROR_UNSUPPORTED_MIMETYPE:35,ERROR_SERVER_REJECTED_MEDIA:36,ERROR_IO_ENCRYPTION:37,ERROR_NO_ENCRYPTION_ALGORITHM:38,ERROR_HOST_SWITCH_REQUIRED:39,ERROR_WAMSYS:40,ERROR_INVALID_URL:41,INTEGRITY_CHECK_FAILURE:42});f.MEDIA_UPLOAD_RESULT_TYPE=a}),66); __d("WAWebWamEnumMessageSendResultType",[],(function(a,b,c,d,e,f){a=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,ERROR_INVALID_PROTOBUF:13,SERVER_ERROR:14,EPHEMERALLY_EXPIRED:15,MEDIA_UPLOAD_FAILED:16,ERROR_CLIENT_OUT_OF_MEMORY:17,ERROR_UPLOAD_CANCELLED_MANUALLY:18,ERROR_UPLOAD_CANCELLED_AUTOMATIC:19});f.MESSAGE_SEND_RESULT_TYPE=a}),66); __d("WAWebWamEnumMessageSendSource",[],(function(a,b,c,d,e,f){a=Object.freeze({NONE:1,UNANSWERED_CALL_UPSELL:2,UNANSWERED_CALL_UPSELL_REST:3});f.MESSAGE_SEND_SOURCE=a}),66); __d("WAWebMessageSendWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumAddressingMode","WAWebWamEnumAgentEngagementEnumType","WAWebWamEnumBotType","WAWebWamEnumChatOriginsType","WAWebWamEnumDisappearingChatInitiatorType","WAWebWamEnumE2eCiphertextType","WAWebWamEnumE2eFailureReason","WAWebWamEnumEditType","WAWebWamEnumEphemeralityInitiatorType","WAWebWamEnumEphemeralityTriggerActionType","WAWebWamEnumInvisibleMessageCategoryType","WAWebWamEnumLogoutReasonType","WAWebWamEnumMediaType","WAWebWamEnumMediaUploadResultType","WAWebWamEnumMessageDistributionEnumType","WAWebWamEnumMessageSendResultType","WAWebWamEnumMessageSendSource","WAWebWamEnumMessageType","WAWebWamEnumOppositeVisibleIdentificationType","WAWebWamEnumPairedMediaType","WAWebWamEnumRevokeType","WAWebWamEnumSizeBucket","WAWebWamEnumStickerMakerSourceType","WAWebWamEnumTypeOfGroupEnum"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({MessageSend:[854,{agentEngagementType:[49,d("WAWebWamEnumAgentEngagementEnumType").AGENT_ENGAGEMENT_ENUM_TYPE],appContext:[72,a.TYPES.STRING],appContextBitfield:[73,a.TYPES.INTEGER],botType:[55,d("WAWebWamEnumBotType").BOT_TYPE],chatOrigins:[58,d("WAWebWamEnumChatOriginsType").CHAT_ORIGINS_TYPE],chatSessionId:[67,a.TYPES.STRING],deviceCount:[31,a.TYPES.INTEGER],deviceSizeBucket:[25,d("WAWebWamEnumSizeBucket").SIZE_BUCKET],disappearingChatInitiator:[30,d("WAWebWamEnumDisappearingChatInitiatorType").DISAPPEARING_CHAT_INITIATOR_TYPE],e2eBackfill:[23,a.TYPES.BOOLEAN],e2eCiphertextType:[10,d("WAWebWamEnumE2eCiphertextType").E2E_CIPHERTEXT_TYPE],e2eCiphertextVersion:[9,a.TYPES.INTEGER],e2eFailureReason:[46,d("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON],editDuration:[43,a.TYPES.INTEGER],editType:[44,d("WAWebWamEnumEditType").EDIT_TYPE],ephemeralityDuration:[21,a.TYPES.INTEGER],ephemeralityInitiator:[47,d("WAWebWamEnumEphemeralityInitiatorType").EPHEMERALITY_INITIATOR_TYPE],ephemeralityTriggerAction:[48,d("WAWebWamEnumEphemeralityTriggerActionType").EPHEMERALITY_TRIGGER_ACTION_TYPE],excessPayloadKbSize:[40,a.TYPES.INTEGER],fastForwardEnabled:[15,a.TYPES.BOOLEAN],hasUsername:[59,a.TYPES.BOOLEAN],hasUsernamePin:[74,a.TYPES.BOOLEAN],invisibleMessageCategory:[64,d("WAWebWamEnumInvisibleMessageCategoryType").INVISIBLE_MESSAGE_CATEGORY_TYPE],isAComment:[54,a.TYPES.BOOLEAN],isAReply:[35,a.TYPES.BOOLEAN],isFromWamsys:[19,a.TYPES.BOOLEAN],isLid:[39,a.TYPES.BOOLEAN],isPremium:[69,a.TYPES.BOOLEAN],isViewOnce:[22,a.TYPES.BOOLEAN],localAddressingMode:[53,d("WAWebWamEnumAddressingMode").ADDRESSING_MODE],logoutReason:[70,d("WAWebWamEnumLogoutReasonType").LOGOUT_REASON_TYPE],mediaCaptionPresent:[8,a.TYPES.BOOLEAN],mediaUploadError:[61,d("WAWebWamEnumMediaUploadResultType").MEDIA_UPLOAD_RESULT_TYPE],mediaUploadRetryCount:[62,a.TYPES.INTEGER],messageDistributionType:[41,d("WAWebWamEnumMessageDistributionEnumType").MESSAGE_DISTRIBUTION_ENUM_TYPE],messageForwardAgeT:[14,a.TYPES.TIMER],messageIsFanout:[5,a.TYPES.BOOLEAN],messageIsFastForward:[13,a.TYPES.BOOLEAN],messageIsFirstUserMessage:[26,a.TYPES.BOOLEAN],messageIsForward:[4,a.TYPES.BOOLEAN],messageIsInternational:[7,a.TYPES.BOOLEAN],messageIsInvisible:[29,a.TYPES.BOOLEAN],messageIsRevoke:[24,a.TYPES.BOOLEAN],messageKeyHash:[57,a.TYPES.STRING],messageMediaType:[3,d("WAWebWamEnumMediaType").MEDIA_TYPE],messageSendOptUploadEnabled:[12,a.TYPES.BOOLEAN],messageSendResult:[1,d("WAWebWamEnumMessageSendResultType").MESSAGE_SEND_RESULT_TYPE],messageSendResultIsTerminal:[17,a.TYPES.BOOLEAN],messageSendSource:[66,d("WAWebWamEnumMessageSendSource").MESSAGE_SEND_SOURCE],messageSendT:[11,a.TYPES.TIMER],messageType:[2,d("WAWebWamEnumMessageType").MESSAGE_TYPE],networkWasDisconnected:[37,a.TYPES.BOOLEAN],oppositeVisibleIdentification:[60,d("WAWebWamEnumOppositeVisibleIdentificationType").OPPOSITE_VISIBLE_IDENTIFICATION_TYPE],overallMediaSize:[42,a.TYPES.NUMBER],pairedMediaType:[71,d("WAWebWamEnumPairedMediaType").PAIRED_MEDIA_TYPE],participantCount:[32,a.TYPES.INTEGER],receiverDefaultDisappearingDuration:[28,a.TYPES.INTEGER],resendCount:[16,a.TYPES.INTEGER],retryCount:[6,a.TYPES.INTEGER],revokeDuration:[33,a.TYPES.INTEGER],revokeType:[34,d("WAWebWamEnumRevokeType").REVOKE_TYPE],runningTasks:[63,a.TYPES.STRING],sendButtonPressT:[45,a.TYPES.INTEGER],senderDefaultDisappearingDuration:[27,a.TYPES.INTEGER],serverErrorCode:[56,a.TYPES.INTEGER],stickerIsAi:[50,a.TYPES.BOOLEAN],stickerIsAvatar:[38,a.TYPES.BOOLEAN],stickerIsFirstParty:[18,a.TYPES.BOOLEAN],stickerIsFromStickerMaker:[51,a.TYPES.BOOLEAN],stickerMakerSourceType:[52,d("WAWebWamEnumStickerMakerSourceType").STICKER_MAKER_SOURCE_TYPE],thumbSize:[20,a.TYPES.NUMBER],typeOfGroup:[36,d("WAWebWamEnumTypeOfGroupEnum").TYPE_OF_GROUP_ENUM],unifiedSessionId:[68,a.TYPES.STRING],userToDeviceSizeBucket:[65,a.TYPES.STRING]},[1,1,1],"regular"]},{MessageSend:[]});g.MessageSendWamEvent=b}),98); __d("WAWebWamEnumPeerDataRequestType",[],(function(a,b,c,d,e,f){a=Object.freeze({UPLOAD_STICKER:0,SEND_RECENT_STICKER_BOOTSTRAP:1,GENERAL_LINK_PREVIEW:2,HISTORY_SYNC_ON_DEMAND:3,PLACEHOLDER_MESSAGE_RESEND:4,WAFFLE_LINKING_NONCE_FETCH:5});f.PEER_DATA_REQUEST_TYPE=a}),66); __d("WAWebWamEnumPeerDataResponseResultType",[],(function(a,b,c,d,e,f){a=Object.freeze({SUCCESS:1,OTHER_ERROR:2,REQUEST_TARGET_NOT_FOUND:3,REQUEST_INVALID:4,FAIL_TO_UPLOAD:5,FAIL_TO_SEND_RESPONSE:6,REQUEST_TOO_OLD:7});f.PEER_DATA_RESPONSE_RESULT_TYPE=a}),66); __d("WAWebNonMessagePeerDataMediaUploadWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumPeerDataRequestType","WAWebWamEnumPeerDataResponseResultType"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({NonMessagePeerDataMediaUpload:[3902,{peerDataErrorCount:[1,a.TYPES.INTEGER],peerDataExistingDataNoUploadCount:[2,a.TYPES.INTEGER],peerDataNotFoundCount:[3,a.TYPES.INTEGER],peerDataRequestCount:[4,a.TYPES.INTEGER],peerDataRequestSessionId:[5,a.TYPES.STRING],peerDataRequestType:[6,d("WAWebWamEnumPeerDataRequestType").PEER_DATA_REQUEST_TYPE],peerDataResponseResult:[8,d("WAWebWamEnumPeerDataResponseResultType").PEER_DATA_RESPONSE_RESULT_TYPE],peerDataSuccessInlineNoUploadCount:[9,a.TYPES.INTEGER],peerDataSuccessUploadCount:[7,a.TYPES.INTEGER]},[1,1,1],"regular"]},{NonMessagePeerDataMediaUpload:[]});g.NonMessagePeerDataMediaUploadWamEvent=b}),98); __d("WAWebWamEnumPeerDataResponseApplyResultType",[],(function(a,b,c,d,e,f){a=Object.freeze({SUCCESS:1,OTHER_ERROR:2,INVALID_RESPONSE:3,FAIL_TO_DOWNLOAD:4,REQUEST_TIMEOUT:5});f.PEER_DATA_RESPONSE_APPLY_RESULT_TYPE=a}),66); __d("WAWebNonMessagePeerDataOperationResponseWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumPeerDataRequestType","WAWebWamEnumPeerDataResponseApplyResultType"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({NonMessagePeerDataOperationResponse:[3904,{peerDataErrorCount:[1,a.TYPES.INTEGER],peerDataNotFoundCount:[2,a.TYPES.INTEGER],peerDataRequestSessionId:[3,a.TYPES.STRING],peerDataRequestType:[4,d("WAWebWamEnumPeerDataRequestType").PEER_DATA_REQUEST_TYPE],peerDataResponseApplyResult:[8,d("WAWebWamEnumPeerDataResponseApplyResultType").PEER_DATA_RESPONSE_APPLY_RESULT_TYPE],peerDataResponseCount:[5,a.TYPES.INTEGER],peerDataSuccessProcessCount:[6,a.TYPES.INTEGER],peerDataSuccessResponseCount:[7,a.TYPES.INTEGER]},[1,1,1],"regular"]},{NonMessagePeerDataOperationResponse:[]});g.NonMessagePeerDataOperationResponseWamEvent=b}),98); __d("WAWebNonMessagePeerDataRequestWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumPeerDataRequestType"],(function(a,b,c,d,e,f,g){a=d("WAWebWamCodegenUtils").defineEvents({NonMessagePeerDataRequest:[3906,{peerDataRequestCount:[1,d("WAWebWamCodegenUtils").TYPES.INTEGER],peerDataRequestSessionId:[2,d("WAWebWamCodegenUtils").TYPES.STRING],peerDataRequestType:[3,d("WAWebWamEnumPeerDataRequestType").PEER_DATA_REQUEST_TYPE]},[1,1,1],"regular"]},{NonMessagePeerDataRequest:[]});g.NonMessagePeerDataRequestWamEvent=a}),98); __d("WAWebWamEnumNotificationActionType",[],(function(a,b,c,d,e,f){a=Object.freeze({SHOW:1,REMOVE:2});f.NOTIFICATION_ACTION_TYPE=a}),66); __d("WAWebWamEnumNotificationDestinationType",[],(function(a,b,c,d,e,f){a=Object.freeze({INDIVIDUAL:1,GROUP:2,OTHER:3,CHANNEL:4,INTEROP:5,STATUS:6});f.NOTIFICATION_DESTINATION_TYPE=a}),66); __d("WAWebWamEnumNotificationSourceType",[],(function(a,b,c,d,e,f){a=Object.freeze({PUSH_TRIGGERED:1,MAIN_APP:2,IN_APP:3});f.NOTIFICATION_SOURCE_TYPE=a}),66); __d("WAWebWamEnumNotificationTypeEnum",[],(function(a,b,c,d,e,f){a=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,INVITE_JOINED:27,SCHEDULED_CALL_LOCAL_REMINDER:28,PTV_MESSAGE:29,STATUS_MENTION:30,STATUS_REACTION:31,STICKER_PACK_MESSAGE:32,POLL_RESULT_SNAPSHOT_MESSAGE:33,CALL_LINK_CREATOR:34,STATUS_PROMPT_RESPONSE:35,LINK_CREATOR_CALL_STARTED:36,LINK_CREATOR_CALL_CONNECTED:37,LINK_CREATOR_CALL_MISSED:38});f.NOTIFICATION_TYPE_ENUM=a}),66); __d("WAWebNotificationDeliveryWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumNotificationActionType","WAWebWamEnumNotificationDestinationType","WAWebWamEnumNotificationSourceType","WAWebWamEnumNotificationTypeEnum"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({NotificationDelivery:[3748,{clientMessageId:[1,a.TYPES.STRING],notificationAction:[2,d("WAWebWamEnumNotificationActionType").NOTIFICATION_ACTION_TYPE],notificationDeliveryT:[3,a.TYPES.INTEGER],notificationDestination:[4,d("WAWebWamEnumNotificationDestinationType").NOTIFICATION_DESTINATION_TYPE],notificationId:[5,a.TYPES.STRING],notificationSource:[6,d("WAWebWamEnumNotificationSourceType").NOTIFICATION_SOURCE_TYPE],threadId:[7,a.TYPES.STRING],uiNotificationType:[8,d("WAWebWamEnumNotificationTypeEnum").NOTIFICATION_TYPE_ENUM]},[1,1,1],"regular"]},{NotificationDelivery:[]});g.NotificationDeliveryWamEvent=b}),98); __d("WAWebWamEnumGroupTypeClient",[],(function(a,b,c,d,e,f){a=Object.freeze({REGULAR_GROUP:1,SUB_GROUP:2,DEFAULT_SUB_GROUP:3,PARENT_GROUP:4});f.GROUP_TYPE_CLIENT=a}),66); __d("WAWebNotificationEngagementWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumClientGroupSizeBucket","WAWebWamEnumGroupTypeClient"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({NotificationEngagement:[3796,{avgNotifEngagementT:[1,a.TYPES.TIMER],groupSizeBucket:[2,d("WAWebWamEnumClientGroupSizeBucket").CLIENT_GROUP_SIZE_BUCKET],groupTypeClient:[3,d("WAWebWamEnumGroupTypeClient").GROUP_TYPE_CLIENT],isAGroup:[4,a.TYPES.BOOLEAN],isWebBackgroundSyncNotif:[18,a.TYPES.BOOLEAN],threadId:[5,a.TYPES.STRING],totalLinkReshareMessageNotifShown:[19,a.TYPES.INTEGER],totalLinkReshareMessageNotifShownFb:[21,a.TYPES.INTEGER],totalLinkReshareMessageNotifShownIg:[22,a.TYPES.INTEGER],totalLinkReshareMessageNotifTapToOpen:[20,a.TYPES.INTEGER],totalLinkReshareMessageNotifTapToOpenFb:[23,a.TYPES.INTEGER],totalLinkReshareMessageNotifTapToOpenIg:[24,a.TYPES.INTEGER],totalMessageReminderNotifShown:[16,a.TYPES.INTEGER],totalMessageReminderNotifTapToOpen:[17,a.TYPES.INTEGER],totalNotifMarkAsRead:[6,a.TYPES.INTEGER],totalNotifMissedCallVoipCallback:[7,a.TYPES.INTEGER],totalNotifMissedCallVoipMessage:[8,a.TYPES.INTEGER],totalNotifOthers:[9,a.TYPES.INTEGER],totalNotifReply:[10,a.TYPES.INTEGER],totalNotifRtcVoipAccept:[11,a.TYPES.INTEGER],totalNotifRtcVoipDecline:[12,a.TYPES.INTEGER],totalNotifShowPreview:[13,a.TYPES.INTEGER],totalNotifShown:[14,a.TYPES.INTEGER],totalNotifTapToOpen:[15,a.TYPES.INTEGER]},[1,1,1],"regular"]},{NotificationEngagement:[]});g.NotificationEngagementWamEvent=b}),98); __d("WAWebWamEnumPsBufferUploadResult",[],(function(a,b,c,d,e,f){a=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});f.PS_BUFFER_UPLOAD_RESULT=a}),66); __d("WAWebWamEnumPsTokenNotReadyReason",[],(function(a,b,c,d,e,f){a=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});f.PS_TOKEN_NOT_READY_REASON=a}),66); __d("WAWebWamEnumPsUploadReason",[],(function(a,b,c,d,e,f){a=Object.freeze({REASON_PS_PINGER:0,REASON_PS_OFFCYCLE:1});f.PS_UPLOAD_REASON=a}),66); __d("WAWebPsBufferUploadWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumApplicationState","WAWebWamEnumPsBufferUploadResult","WAWebWamEnumPsTokenNotReadyReason","WAWebWamEnumPsUploadReason"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({PsBufferUpload:[2244,{applicationState:[6,d("WAWebWamEnumApplicationState").APPLICATION_STATE],isFromWamsys:[12,a.TYPES.BOOLEAN],isUserSampled:[14,a.TYPES.BOOLEAN],psBufferSequenceNumber:[13,a.TYPES.INTEGER],psBufferUploadHttpResponseCode:[3,a.TYPES.INTEGER],psBufferUploadResult:[1,d("WAWebWamEnumPsBufferUploadResult").PS_BUFFER_UPLOAD_RESULT],psBufferUploadT:[2,a.TYPES.TIMER],psDitheredT:[11,a.TYPES.INTEGER],psForceUpload:[10,a.TYPES.BOOLEAN],psTokenNotReadyReason:[4,d("WAWebWamEnumPsTokenNotReadyReason").PS_TOKEN_NOT_READY_REASON],psUploadReason:[9,d("WAWebWamEnumPsUploadReason").PS_UPLOAD_REASON],waConnectedToChatd:[5,a.TYPES.BOOLEAN]},[1,1,100],"regular"]},{PsBufferUpload:[]});g.PsBufferUploadWamEvent=b}),98); __d("WAWebWamEnumProjectCode",[],(function(a,b,c,d,e,f){a=Object.freeze({DIT:1,DIRECTORY_SEARCH:2});f.PROJECT_CODE=a}),66); __d("WAWebWamEnumSignCredentialResult",[],(function(a,b,c,d,e,f){a=Object.freeze({SUCCESS:1,ERROR_BAD_REQUEST:2,ERROR_SERVER:3,ERROR_OTHER:4,ERROR_CLIENT_NETWORK:5});f.SIGN_CREDENTIAL_RESULT=a}),66); __d("WAWebSignCredentialWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumApplicationState","WAWebWamEnumProjectCode","WAWebWamEnumSignCredentialResult"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({SignCredential:[2242,{applicationState:[6,d("WAWebWamEnumApplicationState").APPLICATION_STATE],isFromWameta:[8,a.TYPES.BOOLEAN],overallT:[4,a.TYPES.TIMER],projectCode:[7,d("WAWebWamEnumProjectCode").PROJECT_CODE],retryCount:[2,a.TYPES.INTEGER],signCredentialResult:[1,d("WAWebWamEnumSignCredentialResult").SIGN_CREDENTIAL_RESULT],signCredentialT:[3,a.TYPES.TIMER],waConnectedToChatd:[5,a.TYPES.BOOLEAN]},[1,1,1],"regular"]},{SignCredential:[]});g.SignCredentialWamEvent=b}),98); __d("WAWebSyncdKeyCountWamEvent",["WAWebWamCodegenUtils"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({SyncdKeyCount:[3978,{keysUsedInSnapshotCount:[1,a.TYPES.INTEGER],p80MuationsPerKey:[2,a.TYPES.INTEGER],p95MuationsPerKey:[3,a.TYPES.INTEGER],syncdSessionLengthDays:[4,a.TYPES.INTEGER],totalKeyCount:[5,a.TYPES.INTEGER]},[1,1,1],"regular"]},{SyncdKeyCount:[]});g.SyncdKeyCountWamEvent=b}),98); __d("WAWebWaOldCodeWamEvent",["WAWebWamCodegenUtils"],(function(a,b,c,d,e,f,g){a=d("WAWebWamCodegenUtils").defineEvents({WaOldCode:[3940,{deviceId:[1,d("WAWebWamCodegenUtils").TYPES.STRING]},[1,1,1],"regular"]},{WaOldCode:[]});g.WaOldCodeWamEvent=a}),98); __d("WAWebWebDbVersionNonAnonymousWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumWebDbNameType"],(function(a,b,c,d,e,f,g){a=d("WAWebWamCodegenUtils").defineEvents({WebDbVersionNonAnonymous:[4816,{webDbName:[1,d("WAWebWamEnumWebDbNameType").WEB_DB_NAME_TYPE],webDbVersionNumber:[2,d("WAWebWamCodegenUtils").TYPES.INTEGER]},[1,1,20],"regular"]},{WebDbVersionNonAnonymous:[]});g.WebDbVersionNonAnonymousWamEvent=a}),98); __d("WAWebWebcLinkPreviewResponseHandleWamEvent",["WAWebWamCodegenUtils"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({WebcLinkPreviewResponseHandle:[3860,{didRespondHqPreview:[5,a.TYPES.BOOLEAN],isPreviewSuccess:[2,a.TYPES.BOOLEAN],previewDurationMs:[4,a.TYPES.INTEGER],previewSessionId:[3,a.TYPES.STRING]},[1,1,1],"regular"]},{WebcLinkPreviewResponseHandle:[]});g.WebcLinkPreviewResponseHandleWamEvent=b}),98); __d("WAWebWebcPageResumeWamEvent",["WAWebWamCodegenUtils"],(function(a,b,c,d,e,f,g){a=d("WAWebWamCodegenUtils").defineEvents({WebcPageResume:[884,{webcResumeCount:[1,d("WAWebWamCodegenUtils").TYPES.INTEGER]},[1,1,1],"regular"]},{WebcPageResume:[]});g.WebcPageResumeWamEvent=a}),98); __d("WAWebWamEnumWebcStreamModeCode",[],(function(a,b,c,d,e,f){a=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});f.WEBC_STREAM_MODE_CODE=a}),66); __d("WAWebWebcStreamModeChangeWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumWebcStreamModeCode"],(function(a,b,c,d,e,f,g){a=d("WAWebWamCodegenUtils").defineEvents({WebcStreamModeChange:[770,{webcStreamMode:[1,d("WAWebWamEnumWebcStreamModeCode").WEBC_STREAM_MODE_CODE]},[1,1,1],"regular"]},{WebcStreamModeChange:[]});g.WebcStreamModeChangeWamEvent=a}),98); __d("WAWebWamProcessWorkerData",["WALogger","WAShiftTimer","WAWebAdvMetadataCreationFailureWamEvent","WAWebAdvStoredTimestampExpiredWamEvent","WAWebChatMessageCountsWamEvent","WAWebClockSkewDifferenceTWamEvent","WAWebCommunityHomeActionWamEvent","WAWebCommunityTabActionWamEvent","WAWebDailyWamEvent","WAWebE2eMessageRecvWamEvent","WAWebE2eMessageSendWamEvent","WAWebE2eRetryRejectWamEvent","WAWebFmxActionWamEvent","WAWebForwardSendWamEvent","WAWebGatedMessageReceivedWamEvent","WAWebGraphqlCatalogRequestWamEvent","WAWebGroupJoinCWamEvent","WAWebIncomingMessageDropWamEvent","WAWebKeepInChatNotifWamEvent","WAWebMdAppStateDirtyBitsWamEvent","WAWebMdAppStateKeyRotationWamEvent","WAWebMdAppStateMessageRangeWamEvent","WAWebMdAppStateSyncDailyWamEvent","WAWebMdAppStateSyncMutationStatsWamEvent","WAWebMdBadDeviceSentMessageWamEvent","WAWebMdBootstrapAppStateCriticalDataProcessingWamEvent","WAWebMdBootstrapAppStateDataDownloadedWamEvent","WAWebMdBootstrapDataAppliedWamEvent","WAWebMdBootstrapHistoryDataDownloadedWamEvent","WAWebMdBootstrapHistoryDataStartDownloadingWamEvent","WAWebMdBootstrapHistorySyncStatusAfterPairingWamEvent","WAWebMdCriticalEventWamEvent","WAWebMdDeviceSyncAckWamEvent","WAWebMdFatalErrorWamEvent","WAWebMdGroupParticipantMissAckWamEvent","WAWebMdRetryFromUnknownDeviceWamEvent","WAWebMdSyncdDogfoodingFeatureUsageWamEvent","WAWebMessageReceiveWamEvent","WAWebMessageSecretErrorsWamEvent","WAWebMessageSendWamEvent","WAWebMexEventV2WamEvent","WAWebMexEventWamEvent","WAWebNonMessagePeerDataMediaUploadWamEvent","WAWebNonMessagePeerDataOperationResponseWamEvent","WAWebNonMessagePeerDataRequestWamEvent","WAWebNotificationDeliveryWamEvent","WAWebNotificationEngagementWamEvent","WAWebOfflineCountTooHighWamEvent","WAWebOfflineResumeWamEvent","WAWebPlaceholderActivityWamEvent","WAWebPsBufferUploadWamEvent","WAWebReceiptStanzaReceiveWamEvent","WAWebSignCredentialWamEvent","WAWebSyncdKeyCountWamEvent","WAWebWaOldCodeWamEvent","WAWebWamStorage","WAWebWebDbLoadFromVersionFailureNonAnonymousWamEvent","WAWebWebDbTableUsageWamEvent","WAWebWebDbVersionNonAnonymousWamEvent","WAWebWebcDbOpenWamEvent","WAWebWebcJobInfoWamEvent","WAWebWebcLinkPreviewResponseHandleWamEvent","WAWebWebcOfflineNotificationProcessWamEvent","WAWebWebcPageResumeWamEvent","WAWebWebcRawPlatformsWamEvent","WAWebWebcStreamModeChangeWamEvent"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Failed to process worker wam data: ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["processWorkerWamData ",""]);i=function(){return a};return a}var j=2e4,k=1e4;function l(a){d("WALogger").LOG(i(),a?"start":"run");m();var b=new(d("WAShiftTimer").ShiftTimer)(function(){c("WAWebWamStorage").processWorkerWamData().then(function(a){a&&l(!1)})["catch"](function(a){d("WALogger").ERROR(h(),a).verbose().devConsole(a)})});b.onOrAfter(a?j:k)}function m(){void b("WAWebOfflineResumeWamEvent").OfflineResumeWamEvent,void b("WAWebMessageSecretErrorsWamEvent").MessageSecretErrorsWamEvent,void b("WAWebMessageSendWamEvent").MessageSendWamEvent,void b("WAWebForwardSendWamEvent").ForwardSendWamEvent,void b("WAWebMexEventV2WamEvent").MexEventV2WamEvent,void b("WAWebWaOldCodeWamEvent").WaOldCodeWamEvent,void b("WAWebChatMessageCountsWamEvent").ChatMessageCountsWamEvent,void b("WAWebNotificationDeliveryWamEvent").NotificationDeliveryWamEvent,void b("WAWebGroupJoinCWamEvent").GroupJoinCWamEvent,void b("WAWebMdAppStateDirtyBitsWamEvent").MdAppStateDirtyBitsWamEvent,void b("WAWebMdBadDeviceSentMessageWamEvent").MdBadDeviceSentMessageWamEvent,void b("WAWebPlaceholderActivityWamEvent").PlaceholderActivityWamEvent,void b("WAWebGatedMessageReceivedWamEvent").GatedMessageReceivedWamEvent,void b("WAWebMessageReceiveWamEvent").MessageReceiveWamEvent,void b("WAWebOfflineCountTooHighWamEvent").OfflineCountTooHighWamEvent,void b("WAWebReceiptStanzaReceiveWamEvent").ReceiptStanzaReceiveWamEvent,void b("WAWebMdRetryFromUnknownDeviceWamEvent").MdRetryFromUnknownDeviceWamEvent,void b("WAWebE2eRetryRejectWamEvent").E2eRetryRejectWamEvent,void b("WAWebMdBootstrapHistoryDataDownloadedWamEvent").MdBootstrapHistoryDataDownloadedWamEvent,void b("WAWebMdBootstrapHistoryDataStartDownloadingWamEvent").MdBootstrapHistoryDataStartDownloadingWamEvent,void b("WAWebClockSkewDifferenceTWamEvent").ClockSkewDifferenceTWamEvent,void b("WAWebGraphqlCatalogRequestWamEvent").GraphqlCatalogRequestWamEvent,void b("WAWebSignCredentialWamEvent").SignCredentialWamEvent,void b("WAWebMdBootstrapHistorySyncStatusAfterPairingWamEvent").MdBootstrapHistorySyncStatusAfterPairingWamEvent,void b("WAWebWebcJobInfoWamEvent").WebcJobInfoWamEvent,void b("WAWebFmxActionWamEvent").FmxActionWamEvent,void b("WAWebE2eMessageSendWamEvent").E2eMessageSendWamEvent,void b("WAWebMdDeviceSyncAckWamEvent").MdDeviceSyncAckWamEvent,void b("WAWebMdGroupParticipantMissAckWamEvent").MdGroupParticipantMissAckWamEvent,void b("WAWebMexEventWamEvent").MexEventWamEvent,void b("WAWebAdvStoredTimestampExpiredWamEvent").AdvStoredTimestampExpiredWamEvent,void b("WAWebSyncdKeyCountWamEvent").SyncdKeyCountWamEvent,void b("WAWebMdAppStateSyncMutationStatsWamEvent").MdAppStateSyncMutationStatsWamEvent,void b("WAWebNonMessagePeerDataMediaUploadWamEvent").NonMessagePeerDataMediaUploadWamEvent,void b("WAWebNonMessagePeerDataOperationResponseWamEvent").NonMessagePeerDataOperationResponseWamEvent,void b("WAWebNonMessagePeerDataRequestWamEvent").NonMessagePeerDataRequestWamEvent,void b("WAWebWebcLinkPreviewResponseHandleWamEvent").WebcLinkPreviewResponseHandleWamEvent,void b("WAWebE2eMessageRecvWamEvent").E2eMessageRecvWamEvent,void b("WAWebIncomingMessageDropWamEvent").IncomingMessageDropWamEvent,void b("WAWebAdvMetadataCreationFailureWamEvent").AdvMetadataCreationFailureWamEvent,void b("WAWebWebcRawPlatformsWamEvent").WebcRawPlatformsWamEvent,void b("WAWebWebcPageResumeWamEvent").WebcPageResumeWamEvent,void b("WAWebWebcStreamModeChangeWamEvent").WebcStreamModeChangeWamEvent,void b("WAWebPsBufferUploadWamEvent").PsBufferUploadWamEvent,void b("WAWebWebDbTableUsageWamEvent").WebDbTableUsageWamEvent,void b("WAWebWebDbVersionNonAnonymousWamEvent").WebDbVersionNonAnonymousWamEvent,void b("WAWebWebDbLoadFromVersionFailureNonAnonymousWamEvent").WebDbLoadFromVersionFailureNonAnonymousWamEvent,void b("WAWebWebcDbOpenWamEvent").WebcDbOpenWamEvent,void b("WAWebMdBootstrapAppStateCriticalDataProcessingWamEvent").MdBootstrapAppStateCriticalDataProcessingWamEvent,void b("WAWebMdCriticalEventWamEvent").MdCriticalEventWamEvent,void b("WAWebMdSyncdDogfoodingFeatureUsageWamEvent").MdSyncdDogfoodingFeatureUsageWamEvent,void b("WAWebMdAppStateMessageRangeWamEvent").MdAppStateMessageRangeWamEvent,void b("WAWebMdBootstrapDataAppliedWamEvent").MdBootstrapDataAppliedWamEvent,void b("WAWebMdBootstrapAppStateDataDownloadedWamEvent").MdBootstrapAppStateDataDownloadedWamEvent,void b("WAWebMdFatalErrorWamEvent").MdFatalErrorWamEvent,void b("WAWebMdAppStateKeyRotationWamEvent").MdAppStateKeyRotationWamEvent,void b("WAWebMdAppStateSyncDailyWamEvent").MdAppStateSyncDailyWamEvent,void b("WAWebCommunityHomeActionWamEvent").CommunityHomeActionWamEvent,void b("WAWebCommunityTabActionWamEvent").CommunityTabActionWamEvent,void b("WAWebDailyWamEvent").DailyWamEvent,void b("WAWebKeepInChatNotifWamEvent").KeepInChatNotifWamEvent,void b("WAWebNotificationEngagementWamEvent").NotificationEngagementWamEvent,void b("WAWebWebcOfflineNotificationProcessWamEvent").WebcOfflineNotificationProcessWamEvent}g.processWorkerWamData=l}),98); __d("WAWebStartBackend",["Promise","WAComms","WAGzip","WALogger","WAPromiseTimeout","WAWebABProps","WAWebABPropsWamGlobals","WAWebAdvDeviceInfoCheckJob","WAWebApiContact","WAWebBackendApi","WAWebBackfillLidOriginCtwa","WAWebBackgroundSyncAction","WAWebBackgroundSyncReporter","WAWebBizAgentAction","WAWebBizChatAssignmentAction","WAWebBizGatingUtils","WAWebBizUpdateContactsWithVerifiedNamesAction","WAWebBootstrapPremiumMessages","WAWebCartDbLidMigration","WAWebChatThreadLogging","WAWebCmd","WAWebCommonCTWADataSharing","WAWebCommsConfig","WAWebCommsHandleStanza","WAWebCrashlog","WAWebDBCreateLidPnMappings","WAWebDBFavoriteDatabaseMigrationToLid","WAWebDBLabelAssociationDatabaseMigrationToLid","WAWebDbEncryptionKey","WAWebDeleteStatusAction","WAWebEventsWaitForMain","WAWebFeatureDetectionSwSupport","WAWebFtsClient","WAWebHistorySyncNotificationUtils","WAWebHistorySyncProgress","WAWebInboxFiltersGatingUtils","WAWebInitFavoritesFromStorage","WAWebInitFromStorage","WAWebInitWaitForEvents","WAWebInitializeBots","WAWebJestE2ELogUtils","WAWebL10NCountryCodes","WAWebLid1X1ThreadAccountMigrations","WAWebLid1x1MigrationManager","WAWebLid1x1MigrationTimeout","WAWebLogoutReason","WAWebLogoutReasonConstants","WAWebMediaHosts","WAWebMergeContactRecordsById","WAWebModelStorage","WAWebNewsletterGatingUtils","WAWebNewsletterMetadataInitFromStorage","WAWebOffdStorage","WAWebOfflineHandler","WAWebOfflineResumeMainThread","WAWebPageLoadLogging","WAWebPassiveModeManager","WAWebPersistedJobManager","WAWebPremiumAccessEngine","WAWebPrimaryFeatures","WAWebPushNotificationsGatingUtils","WAWebQplInitMd","WAWebRegisterPassiveTasks","WAWebSWBus","WAWebSWBusActions","WAWebSignalStoreApi","WAWebSocketModel","WAWebStatusCollection","WAWebStickerDownloadGatingUtils","WAWebStoreSpecialAbProps","WAWebSubscribePushManagerAction","WAWebSubscriptions","WAWebSyncBootstrap","WAWebSyncContactsJob","WAWebSyncdCoreApi","WAWebTasksDefinitions","WAWebTimeSpentLoggingSession","WAWebTos","WAWebUserPrefsGeneral","WAWebUserPrefsIndexedDBStorage","WAWebUserPrefsKeys","WAWebUserPrefsLocales","WAWebUserPrefsMeUser","WAWebUserPrefsMultiDevice","WAWebWamGlobals","WAWebWamOfflineResumeReporter","WAWebWamProcessWorkerData","WAWebWorkerSafeBackendApi","asyncToGeneratorRuntime","cr:10195","cr:10196"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[push-notification] Failed to close existing notifications, error: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[push-notification] Failed to request stopComms for service worker, error: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["init worker: error while calling startIndexer from initialSetup: ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["init worker: startIndexer from initialSetup"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] start backend"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["[bootstrap] need to sync critical data: false"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["[startBackend]: connected as ",""]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["startBackendRegistered: chatd user not registered"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["storage initialization error, logging out"]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["[StartBackend] initial setup failed:"]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["[StartBackend]: complete initial setup"]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["[StartBackend]: start initial setup"]);t=function(){return a};return a}d("WAWebCmd").Cmd.once("offline_delivery_end",b("asyncToGeneratorRuntime").asyncToGenerator(function*(){try{d("WALogger").LOG(t()),yield D(),d("WALogger").LOG(s())}catch(a){d("WALogger").LOG(r()).devConsole(a)}}));d("WAWebCmd").Cmd.on("storage_initialization_error",b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(!d("WAWebUserPrefsMultiDevice").isRegistered()&&d("WAWebLogoutReason").getPrevLogoutReasonCode()===d("WAWebLogoutReasonConstants").LOGOUT_REASON_CODE.CLIENT_FATAL)return;d("WALogger").LOG(q());yield d("WAWebSocketModel").Socket.clearCredentialsAndStoredData(d("WAWebLogoutReasonConstants").LogoutReason.ClientFatalError);d("WAWebJestE2ELogUtils").maybeLogToJestE2eJSConsole("logging out due to storage initialization error");d("WAWebCmd").Cmd.logout()}));d("WAWebCmd").Cmd.on("open_socket_stream",function(){!d("WAWebCmd").Cmd.isOfflineDeliveryEnd?d("WAWebWamOfflineResumeReporter").OfflineResumeReporter.logSocketConnectT():(d("WAWebWamOfflineResumeReporter").OfflineResumeReporter.resetEvent(),d("WAWebWamOfflineResumeReporter").OfflineResumeReporter.logSocketConnectT())});var u=function(){void c("WAWebCommonCTWADataSharing").fetchDataSharingSettingAndUpdateModel()};function a(){return v.apply(this,arguments)}function v(){v=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){d("WAWebPageLoadLogging").startPageLoadQplMeasure("startBackend");var a=(yield w());d("WAWebPageLoadLogging").endPageLoadQplMeasure("startBackend");return a});return v.apply(this,arguments)}function w(){return x.apply(this,arguments)}function x(){x=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=d("WAWebSignalStoreApi").waSignalStore.getRegistrationInfo();if(!a){d("WALogger").LOG(p());return}d("WALogger").LOG(o(),d("WAWebUserPrefsMeUser").assertGetMe());try{yield d("WAWebApiContact").warmUpAllLidPnMappings(),yield d("WAPromiseTimeout").promiseTimeout(d("WAWebModelStorage").initialize(),20*1e3),yield d("WAPromiseTimeout").promiseTimeout(d("WAWebOffdStorage").initialize(),20*1e3),d("WAWebCrashlog").registerCrashlogUploadIsUserInExternalBetaFunction(d("WAWebUserPrefsGeneral").getWhatsAppWebExternalBetaJoinedIdb)}catch(a){d("WAWebCmd").Cmd.storageInitializationError()}d("WAWebLid1X1ThreadAccountMigrations").checkIfMigrationEnabled();d("WAWebInitWaitForEvents").initOfflineResumeWaitForEvents();void d("WAWebWamOfflineResumeReporter").OfflineResumeReporter.setLastPushCompleteTimestamp();void F();yield d("WAWebPrimaryFeatures").loadPrimaryFeatures();d("WAWebMediaHosts").mediaHosts.maybeLoadMediaConnFromStorage();yield H();A();d("WAWebABPropsWamGlobals").setAbPropDependingGlobalWamAttributes();d("WAWebABProps").getABPropConfigValue("language_and_time_web")&&(yield d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.set(d("WAWebUserPrefsKeys").KEYS.LANG_FROM_USER,d("WAWebUserPrefsLocales").getUserLangPref()||"en"));yield d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.set(d("WAWebUserPrefsKeys").KEYS.LANG_FROM_PHONE,d("WAWebUserPrefsLocales").getPhoneLangPref()||"en");d("WAWebTimeSpentLoggingSession").restoreTimeSpentSession();yield d("WAWebChatThreadLogging").initChatThreadLogging();yield d("WAWebPersistedJobManager").startWebPersistedJobManager();d("WAWebOfflineResumeMainThread").setupMainThreadResume(d("WAWebOfflineHandler").OfflineMessageHandler);yield d("WAComms").startHandlingRequests();yield d("WAWebDbEncryptionKey").DbEncKeyStore.waitForFinalDbMsgEncKey();d("WAWebLid1x1MigrationManager").ThreadMigrationManager.addDependentMigrationTask(d("WAWebDBFavoriteDatabaseMigrationToLid").migrateFavoritesDatabaseToLid);d("WAWebLid1x1MigrationManager").ThreadMigrationManager.addDependentMigrationTask(d("WAWebDBLabelAssociationDatabaseMigrationToLid").migrateLabelAssociationsDatabaseToLid);d("WAWebLid1x1MigrationManager").ThreadMigrationManager.addDependentMigrationTask(d("WAWebCartDbLidMigration").migrateCartDbLid);yield d("WAWebLid1x1MigrationManager").ThreadMigrationManager.executeMigrationIfNeeded();yield d("WAWebPassiveModeManager").PassiveTaskManager.waitForPassiveTaskEnd();yield d("WAWebSyncdCoreApi").initialize();a=!(yield c("WAWebSyncBootstrap").isCriticalDataSynced());a?yield c("WAWebSyncBootstrap").syncCriticalData():d("WALogger").LOG(n());d("WAWebBackendApi").frontendFireAndForget("handleDeferredMessages",{});yield B();void d("WAWebTos").TosManager.run();d("WAWebQplInitMd").startQPL();yield d("WAWebPremiumAccessEngine").initialize(d("WAWebBizGatingUtils").getBillingPremiumAccessConfig());void d("WAWebSubscriptions").runSubscriptionsManager();void d("WAWebSubscribePushManagerAction").updatePushManager();void d("WAWebBackgroundSyncAction").updatePeriodicBackgroundSyncRegistration();void d("WAWebMergeContactRecordsById").mergeContactRecordsById();u();void d("WAWebInitializeBots").initializeBots();void d("WAWebStoreSpecialAbProps").storeSpecialAbProps()});return x.apply(this,arguments)}function y(a){return z.apply(this,arguments)}function z(){z=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a===void 0&&(a={passive:!1,pull:!0});d("WAWebPageLoadLogging").startPageLoadQplMeasure("startWebComms");a=d("WAWebCommsConfig").getCommsConfig(a);yield c("WAWebEventsWaitForMain")();d("WAComms").startComms(c("WAWebCommsHandleStanza"),a,function(a){return(h||(h=b("Promise"))).resolve(d("WAGzip").inflate(a))});yield d("WAComms").waitForConnection();d("WAWebPageLoadLogging").endPageLoadQplMeasure("startWebComms")});return z.apply(this,arguments)}function A(){var a;a=(a=d("WAWebUserPrefsMeUser").getMaybeMeUser())==null?void 0:a.user;a!=null&&d("WAWebWamGlobals").Global.set({psCountryCode:d("WAWebL10NCountryCodes").getCountryShortcodeByPhone(a)})}function B(){return C.apply(this,arguments)}function C(){C=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a;void d("WAWebBizUpdateContactsWithVerifiedNamesAction").applyContactBusinessProps();void (a=d("WAWebInitFromStorage")).restoreLabels();void a.restoreQuickReplies();void a.restoreLabelAssociations();void a.restoreCarts();void d("WAWebBootstrapPremiumMessages").restorePremiumMessages();d("WAWebBootstrapPremiumMessages").bindPremiumMessageListeners();yield a.restoreArchiveV2Settings();yield a.restoreAgents().then(d("WAWebBizAgentAction").initializeAgentLog);d("WAWebBizChatAssignmentAction").checkOrphanAssignments();void a.restoreChatAssignments()});return C.apply(this,arguments)}function D(){return E.apply(this,arguments)}function E(){E=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){void d("WAWebDBCreateLidPnMappings").flushLidPnMappingsToDb(),d("WALogger").LOG(m()),void c("WAWebSyncBootstrap").continueProgressiveHistorySyncProcessingV2(d("WAWebHistorySyncNotificationUtils").HistorySyncScheduleSource.BackendStart),d("WALogger").LOG(l()),d("WAWebFtsClient").ftsClient.startIndexer()["catch"](function(a){d("WALogger").WARN(k(),a)}),void d("WAWebStatusCollection").StatusCollection.sync().then(function(){void d("WAWebDeleteStatusAction").clearStatusForRemovedContact()}),d("WAWebTasksDefinitions").registerTasks(),d("WAWebPushNotificationsGatingUtils").canSupportOfflineNotifications()&&(void d("WAWebBackgroundSyncReporter").setPushNotificationInteractionStatus(),d("WAWebWamProcessWorkerData").processWorkerWamData(!0)),void d("WAWebLid1x1MigrationTimeout").scheduleLogoutIfNeeded("offline"),yield d("WAWebSyncContactsJob").runSyncDirtyContactsJob(),void d("WAWebBackfillLidOriginCtwa").maybeBackfillLidOriginCtwa(),void d("WAWebInitFromStorage").restoreRecentStickers(),void d("WAWebInitFromStorage").restoreFavoriteStickers(),void d("WAWebAdvDeviceInfoCheckJob").scheduleAdvDeviceInfoCheck(),void d("WAWebInitFromStorage").restoreCommunityActivity(),void d("WAWebHistorySyncProgress").updateHistorySyncProgressModel(),void d("WAWebInitFromStorage").restoreMediaUploadResult(),void d("WAWebInitFromStorage").restoreUnjoinedSubgroups(),d("WAWebNewsletterGatingUtils").isNewsletterEnabled()&&void d("WAWebNewsletterMetadataInitFromStorage").restoreNewsletterMetadata(),d("WAWebInboxFiltersGatingUtils").inboxFavoritesEnabled()&&void d("WAWebInitFavoritesFromStorage").restoreFavorites(),d("WAWebStickerDownloadGatingUtils").isStickerDownloadM1Enabled()&&void d("WAWebInitFromStorage").restoreStickerDownload(),d("WAWebWorkerSafeBackendApi").workerSafeFireAndForget("restoreCTWASuggestions"),d("WAWebWorkerSafeBackendApi").workerSafeFireAndForget("loadQuickPromotions",{trigger:"app-launch"}),d("WAWebWorkerSafeBackendApi").workerSafeFireAndForget("fetchAdEntryPointsConfiguration",{trigger:"app-launch"})});return E.apply(this,arguments)}function F(){return G.apply(this,arguments)}function G(){G=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(d("WAWebPushNotificationsGatingUtils").canSupportOfflineNotifications()&&c("WAWebFeatureDetectionSwSupport").supported){var a;((a=window.navigator.serviceWorker)==null?void 0:a.controller)&&(yield c("WAWebSWBus").request(window.navigator.serviceWorker.controller,c("WAWebSWBusActions").STOP_COMMS)["catch"](function(a){d("WALogger").WARN(j(),a)}));(a=window.navigator.serviceWorker)==null?void 0:(a=a.ready)==null?void 0:a.then(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(a=(yield a==null?void 0:a.getNotifications==null?void 0:a.getNotifications()))!=null?a:[];a.forEach(function(a){return a.close()})});return function(b){return a.apply(this,arguments)}}())["catch"](function(a){d("WALogger").WARN(i(),a)})}});return G.apply(this,arguments)}function H(){return I.apply(this,arguments)}function I(){I=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a={pull:!0};yield d("WAWebRegisterPassiveTasks").registerPassiveTaskForStartUp();yield y(a)});return I.apply(this,arguments)}g.startBackend=a;g.startWebComms=y}),98); __d("WAWebMexGetUsernameJobQuery.graphql",[],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{alias:null,args:null,concreteType:"XWA2UsernameGetResponse",kind:"LinkedField",name:"xwa2_username_get",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"username",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:[],kind:"Fragment",metadata:null,name:"WAWebMexGetUsernameJobQuery",selections:a,type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[],kind:"Operation",name:"WAWebMexGetUsernameJobQuery",selections:a},params:{id:"7181020378641339",metadata:{},name:"WAWebMexGetUsernameJobQuery",operationKind:"query",text:null}}}();e.exports=a}),null); __d("WAWebMexGetUsernameJob",["WALogger","WAWebMexClient","WAWebMexGetUsernameJobQuery.graphql","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[MEX][USERNAME] Successfully fetched latest username via mex"]);i=function(){return a};return a}function a(){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=h!==void 0?h:h=b("WAWebMexGetUsernameJobQuery.graphql");a=(yield d("WAWebMexClient").fetchQuery(a,{}));d("WALogger").DEV(i()).tags("GQL","MEX").devConsole({response:a});return(a=a.xwa2_username_get)==null?void 0:a.username});return j.apply(this,arguments)}g.mexGetUsernameQueryJob=a}),98); __d("WAWebMexSetUsernamePinJobMutation.graphql",[],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"pin"}],b=[{alias:null,args:[{kind:"Variable",name:"pin",variableName:"pin"}],concreteType:"XWA2UsernamePinSetMutationResponse",kind:"LinkedField",name:"xwa2_username_pin_set",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"result",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"WAWebMexSetUsernamePinJobMutation",selections:b,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"WAWebMexSetUsernamePinJobMutation",selections:b},params:{id:"8444459399003943",metadata:{},name:"WAWebMexSetUsernamePinJobMutation",operationKind:"mutation",text:null}}}();e.exports=a}),null); __d("WAWebMexSetUsernamePinJob",["WALogger","WAWebMexClient","WAWebMexSetUsernamePinJobMutation.graphql","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[MEX][USERNAME] Successfully fetched set username PIN mutation via mex"]);i=function(){return a};return a}function a(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c={pin:a},e=h!==void 0?h:h=b("WAWebMexSetUsernamePinJobMutation.graphql");e=(yield d("WAWebMexClient").fetchQuery(e,a!=null?c:{}));d("WALogger").DEV(i()).tags("GQL","MEX").devConsole({response:e});return((a=e.xwa2_username_pin_set)==null?void 0:a.result)==="SUCCESS"});return j.apply(this,arguments)}g.mexSetUsernamePinQueryJob=a}),98); __d("WAWebSetUsernamePinQueryJob",["WAJobOrchestratorTypes","WAWebBackendApi","WAWebLidAwareContactsDB","WAWebMexSetUsernamePinJob","WAWebModelStorageUtils","WAWebOrchestratorNonPersistedJob","WAWebUserPrefsMeUser","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("setUsernamePinQueryJob",b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var b=(yield d("WAWebMexSetUsernamePinJob").mexSetUsernamePinQueryJob(a));if(b){a!=null?yield h(a):yield j();return!0}return!1}),{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()}function h(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=d("WAWebUserPrefsMeUser").getMeUser(),f=e.toJid();yield d("WAWebModelStorageUtils").getStorage().lock(["contact"],b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var b;return c("WAWebLidAwareContactsDB").createOrMerge(f,{usernamePin:(b=a)!=null?b:void 0})}));yield d("WAWebBackendApi").frontendSendAndReceive("updateUsernamePin",{id:f,usernamePin:(e=a)!=null?e:void 0})});return i.apply(this,arguments)}function j(){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield h(null)});return k.apply(this,arguments)}g.setUsernamePinQueryJob=a;g.setUsernamePinJob=h;g.deleteUsernamePinJob=j}),98); __d("WAWebGetUsernameQueryJob",["WAJobOrchestratorTypes","WAWebMexGetUsernameJob","WAWebMexUsync","WAWebOrchestratorNonPersistedJob","WAWebSetUsernameJob","WAWebSetUsernamePinQueryJob","WAWebUserPrefsMeUser","WAWebUsernameGatingUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(){return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("getUsernameQueryJob",b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a,b;if(d("WAWebUsernameGatingUtils").mexUsyncUsernameQueryEnabled()){var c=(yield h());a=c==null?void 0:c.username;b=c==null?void 0:c.pin}else a=(yield d("WAWebMexGetUsernameJob").mexGetUsernameQueryJob());c=d("WAWebUserPrefsMeUser").getMeUser();yield d("WAWebSetUsernameJob").setUsernamesJob([{userId:c,username:(c=a)!=null?c:void 0}]);b!=null?yield d("WAWebSetUsernamePinQueryJob").setUsernamePinJob(b):yield d("WAWebSetUsernamePinQueryJob").deleteUsernamePinJob();return a}),{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()}function h(){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield d("WAWebMexUsync").mexUsyncQuery({users:[{jid:d("WAWebUserPrefsMeUser").getMeUser().toString()}],telemetry:{context:"INTERACTIVE"},fetch:{username:!0}}));a=a.response;if(a!=null)return a[0].username_info});return i.apply(this,arguments)}g.getUsernameJob=a}),98); __d("WAWebSyncdMdSession",["WABinary","WACryptoSha256","WANullthrows","WAWebCryptoCurve25519","WAWebSignalCommonUtils","WAWebSignalProtocolStore","WAWebUserPrefsMeUser","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){function a(){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=d("WAWebSignalCommonUtils").createSignalAddressForIdentityTable(d("WAWebUserPrefsMeUser").getMeUser()).toString();a=c("WANullthrows")(yield d("WAWebSignalProtocolStore").getPersistSignalProtocolStore().loadIdentityKey(a));a=d("WAWebCryptoCurve25519").toCurveKeyPubKey(d("WAWebSignalCommonUtils").strToBuffer(a));var b=c("WANullthrows")(yield d("WAWebSignalProtocolStore").getPersistSignalProtocolStore().getIdentityKeyPair());b=d("WAWebCryptoCurve25519").toCurveKeyPubKey(b.pubKey);return i(a,b)});return h.apply(this,arguments)}function i(a,b){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if(a.byteLength!==32)throw c("err")("genSessionId: primary identity public key is "+a.byteLength+" bytes, should be 32!");if(b.byteLength!==32)throw c("err")("genSessionId: companion identity public key is "+a.byteLength+" bytes, should be 32!");var e=new(d("WABinary").Binary)();e.writeBuffer(a);e.write("_".charCodeAt(0));e.writeBuffer(b);a=e.readByteArray();b=(yield d("WACryptoSha256").sha256Base64(a));return b});return j.apply(this,arguments)}g.genCurrentSessionId=a;g.genSessionId=i}),98); __d("WAWebSyncdMdSyncFieldstatMeta",["Promise","WAStorageEstimator","WAWebSyncdMdSession","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h,i=-2,j=-1;a=function(){function a(){this._storageEstimation={mdStorageQuotaBytes:-2,mdStorageQuotaUsedBytes:-2},this._mdSessionId=null}var c=a.prototype;c.getStorageEstimation=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(this._storageEstimation.mdStorageQuotaBytes!==i)return(h||(h=b("Promise"))).resolve(this._storageEstimation);var a=(yield d("WAStorageEstimator").estimateStorage());this._storageEstimation={mdStorageQuotaBytes:a.success?a.value.quota:j,mdStorageQuotaUsedBytes:a.success?a.value.usage:j};return this._storageEstimation});function c(){return a.apply(this,arguments)}return c}();c.getMdSessionId=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(this._mdSessionId!=null)return this._mdSessionId;this._mdSessionId=(yield d("WAWebSyncdMdSession").genCurrentSessionId());return this._mdSessionId});function c(){return a.apply(this,arguments)}return c}();return a}();c=new a();g.STORAGE_QUOTA_UNAVAILABLE=j;g.MdSyncFieldStatsMeta=c}),98); __d("WAWebUserPrefsAppStateSync",["WAWebUserPrefsIndexedDBStorage","WAWebUserPrefsKeys","WAWebUserPrefsStore","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.set(d("WAWebUserPrefsKeys").BACKEND_ONLY_KEYS.CRITICAL_DATA_SYNCED,!0);return c("WAWebUserPrefsStore").set(d("WAWebUserPrefsKeys").MD_KEYS.CRITICAL_DATA_SYNCED,!0)});return h.apply(this,arguments)}function e(){var a=d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.get(d("WAWebUserPrefsKeys").BACKEND_ONLY_KEYS.CRITICAL_DATA_SYNCED);return a===!0}function f(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.set(d("WAWebUserPrefsKeys").BACKEND_ONLY_KEYS.LAST_PERIODIC_APP_STATE_SYNC_TS,a);return c("WAWebUserPrefsStore").set(d("WAWebUserPrefsKeys").MD_KEYS.LAST_PERIODIC_APP_STATE_SYNC_TS,a)});return i.apply(this,arguments)}function j(){var a=d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.get(d("WAWebUserPrefsKeys").BACKEND_ONLY_KEYS.RECENT_MAILBOX_AGE_DAYS);return a}function k(){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.set(d("WAWebUserPrefsKeys").BACKEND_ONLY_KEYS.SHOULD_CHECK_CONTACT_SYNC_STATUS,!0);return c("WAWebUserPrefsStore").set(d("WAWebUserPrefsKeys").MD_KEYS.SHOULD_CHECK_CONTACT_SYNC_STATUS,!0)});return l.apply(this,arguments)}function m(){var a=d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.get(d("WAWebUserPrefsKeys").BACKEND_ONLY_KEYS.MD_SYNC_ACTIONS_ACTION_SANITIZED);return a===!0}function n(a){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.set(d("WAWebUserPrefsKeys").BACKEND_ONLY_KEYS.MD_SYNC_ACTIONS_ACTION_SANITIZED,a),c("WAWebUserPrefsStore").set(d("WAWebUserPrefsKeys").MD_KEYS.MD_SYNC_ACTIONS_ACTION_SANITIZED,a)});return o.apply(this,arguments)}function p(){return c("WAWebUserPrefsStore").set(d("WAWebUserPrefsKeys").MD_KEYS.SYNCD_PRIMARY_ALLOWS_ALL_MUTATIONS,!0)}function q(){return!!c("WAWebUserPrefsStore").get(d("WAWebUserPrefsKeys").MD_KEYS.SYNCD_PRIMARY_ALLOWS_ALL_MUTATIONS)}function r(){return d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.get(d("WAWebUserPrefsKeys").BACKEND_ONLY_KEYS.NON_CRITICAL_DATA_SYNC_STATUS)}function s(a){return t.apply(this,arguments)}function t(){t=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b;b=(b=(yield r()))!=null?b:{};yield d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.set(d("WAWebUserPrefsKeys").BACKEND_ONLY_KEYS.NON_CRITICAL_DATA_SYNC_STATUS,babelHelpers["extends"]({},b,a))});return t.apply(this,arguments)}g.setAllCriticalDataSynced=a;g.getAllCriticalDataSynced=e;g.setLastPeriodicAppStateSyncTs=f;g.getLastPeriodicAppStateSyncTs=j;g.setShouldCheckContactSyncStatus=k;g.getMdSyncActionsActionSanitized=m;g.setMdSyncActionsActionSanitized=n;g.setPrimaryAllowsAllMutations=p;g.getPrimaryAllowsAllMutations=q;g.getNonCriticalDataSyncStatus=r;g.setNonCriticalDataSyncStatus=s}),98); __d("WAWebSyncBootstrap",["$InternalEnum","Promise","WAAsyncSleep","WAJobOrchestratorTypes","WALogger","WAPromiseDelays","WASyncdConst","WATimeUtils","WAWebABProps","WAWebAccountSyncJob","WAWebApiHistorySyncNotification","WAWebBootstrapNewsletter","WAWebBrokerGlobalAppState","WAWebClientFeatureFlags","WAWebCmd","WAWebDbEncryptionKey","WAWebEnvironment","WAWebGetUsernameQueryJob","WAWebHandleAccountSyncNotification","WAWebHandleHistorySyncChunk","WAWebHandleWorkerCompatibleRecentSyncChunk","WAWebHistorySyncNotificationUtils","WAWebJestE2ELogUtils","WAWebJobOrchestrator","WAWebLogoutReasonConstants","WAWebMdBootstrapDataAppliedWamEvent","WAWebMiscBrowserUtils","WAWebNonAddressBookContactsJob","WAWebOrchestratorNonPersistedJob","WAWebProtobufsHistorySync.pb","WAWebQueryAndUpdateGroupMetadataJob","WAWebSchemaHistorySyncNotification","WAWebSocketLogoutJob","WAWebSyncContactJob","WAWebSyncDeviceAdvDeviceListJob","WAWebSyncd","WAWebSyncdDb","WAWebSyncdMdSyncFieldstatMeta","WAWebUserPrefsAppStateSync","WAWebUserPrefsHistorySync","WAWebUsernameGatingUtils","WAWebWamEnumMdBootstrapPayloadType","WAWebWamEnumMdBootstrapSource","WAWebWamEnumWebcScenarioType","WAWebWamMemoryStat","WAWebWamUtils","WAWebWorkerSafeBackendApi","asyncToGeneratorRuntime","cr:17219"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] finish full sync, after clearing: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] clearing bucket queue for type ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] finish full sync, before clearing: ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] finish recent sync, after clearing: ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] clearing bucket queue for type ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] finish recent sync, before clearing: ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] error while running job: ",""]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] job is scheduled, source: ",""]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] Skip job scheduling as recent sync is complete when starting backend"]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] Skip job scheduling as initial chat sync is incomplete"]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] init next run"]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] skip scheduling the next run as recent notification with order "," fails too many times"]);t=function(){return a};return a}function u(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] loop detected, unexpected last chunk order"]);u=function(){return a};return a}function v(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] skip scheduling the next run as no recent notifications with correct chunk order"]);v=function(){return a};return a}function w(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] next unprocessed recent notification has chunk order: ",", last chunk order: ",""]);w=function(){return a};return a}function x(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] skip scheduling the next run as first recent notification doesn't have chunk order"]);x=function(){return a};return a}function y(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] skip scheduling the next run as no recent notifications"]);y=function(){return a};return a}function z(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] recent sync is incompleted, check remaining recent sync notifications"]);z=function(){return a};return a}function A(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] skip scheduling the next run as no on full sync notifications"]);A=function(){return a};return a}function B(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] recent sync finishes, check remaining full sync notifications"]);B=function(){return a};return a}function C(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] skip scheduling the next run as no on demand notifications"]);C=function(){return a};return a}function D(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] recent sync finishes, check remaining on demand sync notifications"]);D=function(){return a};return a}function E(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] finish main flow"]);E=function(){return a};return a}function F(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] _progressiveHistorySyncRun failed with ",", stack: ",""]);F=function(){return a};return a}function G(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] job starts"]);G=function(){return a};return a}function H(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] processLoop picked up chunk"]);H=function(){return a};return a}function I(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] no chunk found"]);I=function(){return a};return a}function J(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] Skip processLoop, until main is loaded"]);J=function(){return a};return a}function K(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] initial sync is in progress, use default loop interval"]);K=function(){return a};return a}function L(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] _progressiveHistorySyncRun failed with ",", stack: ",""]);L=function(){return a};return a}function M(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] No remaining iterations but still have unprocessed "," history sync notifications in table with loop interval ",""]);M=function(){return a};return a}function N(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] processLoop picked up the next chunk with order ",""]);N=function(){return a};return a}function O(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Skip processLoop, until main is loaded"]);O=function(){return a};return a}function P(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Skip processLoop, until initial sync is complete"]);P=function(){return a};return a}function Q(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] continueProgressiveHistorySyncProcessing"]);Q=function(){return a};return a}function R(){var a=babelHelpers.taggedTemplateLiteralLoose(["failed to sync default disappearing mode ",""]);R=function(){return a};return a}function S(){var a=babelHelpers.taggedTemplateLiteralLoose(["failed to sync privacy settings ",""]);S=function(){return a};return a}function T(){var a=babelHelpers.taggedTemplateLiteralLoose(["[bootstrap] syncing my device list"]);T=function(){return a};return a}function U(){var a=babelHelpers.taggedTemplateLiteralLoose(["[bootstrap][history sync] ",""]);U=function(){return a};return a}function V(){var a=babelHelpers.taggedTemplateLiteralLoose(["[bootstrap][history sync] need to sync critical data: true"]);V=function(){return a};return a}function W(){var a=babelHelpers.taggedTemplateLiteralLoose(["[bootstrap][history sync] all critical data synced within timeout period"]);W=function(){return a};return a}function X(){var a=babelHelpers.taggedTemplateLiteralLoose(["[bootstrap][history sync] history sync critical data timeout exceeded, logging out"]);X=function(){return a};return a}function Y(){var a=babelHelpers.taggedTemplateLiteralLoose(["[bootstrap] syncd critical data timeout exceeded, logging out"]);Y=function(){return a};return a}function aa(){var a=babelHelpers.taggedTemplateLiteralLoose(["[bootstrap][history sync] setting critical data syncd timeout (",")"]);aa=function(){return a};return a}function ba(){var a=babelHelpers.taggedTemplateLiteralLoose(["[bootstrap][history sync] username creation and 1on1 chat disabled, skipping get username query"]);ba=function(){return a};return a}function ca(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] initial chat history synced."]);ca=function(){return a};return a}function da(){var a=babelHelpers.taggedTemplateLiteralLoose(["Sync device failed"]);da=function(){return a};return a}function ea(){var a=babelHelpers.taggedTemplateLiteralLoose(["sync "," contacts for device info during the initial sync"]);ea=function(){return a};return a}function fa(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncMostRecentDevices has no contact to sync during bootstrap"]);fa=function(){return a};return a}function ga(){var a=babelHelpers.taggedTemplateLiteralLoose(["initial contact sync completes"]);ga=function(){return a};return a}function ha(){var a=babelHelpers.taggedTemplateLiteralLoose(["start contact sync for "," chunks of contacts during the initial sync"]);ha=function(){return a};return a}function ia(){var a=babelHelpers.taggedTemplateLiteralLoose(["[bootstrap][history sync] critical sync done"]);ia=function(){return a};return a}function ja(){var a=babelHelpers.taggedTemplateLiteralLoose(["[bootstrap][history sync] completed sync for ",""]);ja=function(){return a};return a}var ka=(a=b("cr:17219"))==null?void 0:a.getWindowsBridge(),la=40,ma=20,na=60*3,oa=2e4,Z=b("$InternalEnum").Mirrored(["NotStarted","InProcess","Completed"]),pa={initialChatHistory:!1,readReceipts:!1,syncdCritical:!1},qa={initialChatHistoryTotalMsg:-1,initialChatHistoryTotalChats:-1},ra=20,sa=5;e=function(){function a(){this._criticalState={},this._debugOnlyState=qa,this._progressiveHistorySyncRemainingIteration=25,this._progressiveHistorySyncInFlight=!1,this._allCriticalDataSynced=!1,this._syncDCriticalDataTimeout=null,this._isHistorySyncLoopRunning=!1,this.$1=null,this.$2=null,this.$3=!1,this.initState()}var e=a.prototype;e.initState=function(){this._criticalState=babelHelpers["extends"]({},pa),this._debugOnlyState=babelHelpers["extends"]({},qa),this._syncDCriticalDataState=Z.NotStarted,this._syncDNonCriticalDataState=Z.NotStarted,this._syncDGroupMetadataQueryDataState=Z.NotStarted};e._isCriticalSyncDoneThisSession=function(){for(var a in this._criticalState)if(!this._criticalState[a])return!1;return!0};e._setSynced=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){d("WALogger").LOG(ja(),a),this._criticalState[a]=!0,this._isCriticalSyncDoneThisSession()&&(d("WALogger").LOG(ia()),yield d("WAWebUserPrefsAppStateSync").setAllCriticalDataSynced(),d("WAWebCmd").Cmd.criticalSyncDone(),c("WAWebBrokerGlobalAppState").initOrUpdateTracking(d("WAWebWamEnumWebcScenarioType").WEBC_SCENARIO_TYPE.INITIAL_PAIRING),d("WAWebWamMemoryStat").setCurrentMemoryScenario(d("WAWebWamEnumWebcScenarioType").WEBC_SCENARIO_TYPE.IDLE),this.syncNonCriticalData())});function a(b){return a.apply(this,arguments)}return a}();e._syncContactsInChunks=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){d("WALogger").LOG(ha(),a?b.length+1:0).tags("contact-sync");a!=null&&(yield d("WAWebSyncContactJob").syncContactListJob(Array.from(a),!1,"query"));for(a=0;a<b.length;a++){var c=Array.from(b[a]);yield d("WAPromiseDelays").delayMs(ma*1e3);yield d("WAWebSyncContactJob").syncContactListJob(c,!0,"query")}d("WALogger").LOG(ga()).tags("contact-sync")});function a(b,c){return a.apply(this,arguments)}return a}();e._syncDeviceList=function(a){if(a==null){d("WALogger").LOG(fa()).tags("contact-sync");return(h||(h=b("Promise"))).resolve()}d("WALogger").LOG(ea(),a.size).tags("contact-sync");a=Array.from(a);return d("WAWebSyncDeviceAdvDeviceListJob").syncDeviceListJob(a,null,null)["catch"](function(a){d("WALogger").ERROR(da()).verbose().sendLogs("Sync device failed: "+a)})};e.setReadReceiptsSynced=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield this._setSynced("readReceipts")});function c(){return a.apply(this,arguments)}return c}();e.setInitialChatHistorySynced=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield this._setSynced("initialChatHistory"),d("WALogger").LOG(ca()),void $.continueProgressiveHistorySyncProcessingV2(d("WAWebHistorySyncNotificationUtils").HistorySyncScheduleSource.InitialSyncComplete)});function c(){return a.apply(this,arguments)}return c}();e.setSyncDCriticalSynced=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){this._syncDCriticalDataState=Z.Completed;if(this._criticalState.syncdCritical)return;yield this._setSynced("syncdCritical")});function c(){return a.apply(this,arguments)}return c}();e.syncNonCriticalData=function(){var a=this,b=[];this._syncDGroupMetadataQueryDataState=Z.InProcess;d("WAWebQueryAndUpdateGroupMetadataJob").queryAndUpdateAllGroupMetadata(!0).then(function(){b=d("WAWebNonAddressBookContactsJob").getAllContactsFromChatCollectionIntoChunks(),a._syncDeviceList(b[0]),d("WAWebNonAddressBookContactsJob").getAndUpdateNonAddressBookContacts()}).then(function(){self.setTimeout(function(){void a._syncContactsInChunks(b[0],b.slice(1,b.length))},la*1e3)})["finally"](function(){a._syncDGroupMetadataQueryDataState=Z.Completed});d("WAWebHandleAccountSyncNotification").getAndUpdateStatus();d("WAWebAccountSyncJob").getAndUpdateProfilePicture();d("WAWebAccountSyncJob").updateBlocklist();d("WAWebWorkerSafeBackendApi").workerSafeFireAndForget("updateOptOutList");void d("WAWebBootstrapNewsletter").bootstrapNewsletterBackend();d("WAWebUsernameGatingUtils").usernameCreationEnabled()||d("WAWebUsernameGatingUtils").username1on1ChatCreationEnabled()?void d("WAWebGetUsernameQueryJob").getUsernameJob():d("WALogger").LOG(ba());this._syncDNonCriticalDataState=Z.InProcess;d("WAWebSyncd").markCollectionsForSync([d("WASyncdConst").CollectionName.Regular,d("WASyncdConst").CollectionName.RegularLow,d("WASyncdConst").CollectionName.RegularHigh]).then(function(){var b;a._syncDNonCriticalDataState=Z.Completed;void (ka==null?void 0:(b=ka.contacts)==null?void 0:b.initialize())})};e.markInitialHistorySyncCountDebugStats=function(a,b){this._debugOnlyState={initialChatHistoryTotalMsg:a,initialChatHistoryTotalChats:b}};e.isSyncDCriticalDataSyncInProcess=function(){return this._syncDCriticalDataState===Z.InProcess};e.isSyncDBootstrapInProcess=function(){return this._syncDCriticalDataState===Z.InProcess||this._syncDNonCriticalDataState===Z.InProcess};e.isSyncDBootstrapGroupMetadataQueryInProcess=function(){return this._syncDGroupMetadataQueryDataState===Z.InProcess};e._initCriticalDataTimeoutIfNeeded=function(){var a=this;this._syncDCriticalDataTimeout==null&&(d("WALogger").LOG(aa(),na),this._syncDCriticalDataTimeout=self.setTimeout(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){(yield a._isSyncDCriticalDataComplete())||(d("WALogger").LOG(Y()),d("WAWebWamUtils").forceFlushAllWamAndQplBuffers(),d("WAWebJestE2ELogUtils").maybeLogToJestE2eJSConsole("syncd critical data timeout exceeded, logging out"),yield d("WAWebSocketLogoutJob").socketLogout(d("WAWebLogoutReasonConstants").LogoutReason.SyncdTimeout));var b=(yield d("WAWebUserPrefsHistorySync").getInitialHistorySyncComplete());b!==!0&&(d("WALogger").LOG(X()),d("WAWebWamUtils").forceFlushAllWamAndQplBuffers(),d("WAWebJestE2ELogUtils").maybeLogToJestE2eJSConsole("history sync critical data timeout exceeded, logging out"),yield d("WAWebSocketLogoutJob").socketLogout(d("WAWebLogoutReasonConstants").LogoutReason.HistorySyncTimeout));d("WALogger").LOG(W())}),na*1e3))};e._isSyncDCriticalDataComplete=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield d("WAWebSyncdDb").getSyncActionsRows(["action"],[d("WASyncdConst").Actions.SettingPushName]));return a.length>0&&a.find(function(a){return a.actionState===d("WASyncdConst").SyncActionState.Success})!=null});function a(){return a.apply(this,arguments)}return a}();e.setSyncDCriticalDataSyncCompleted=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){this._syncDCriticalDataTimeout!=null&&(yield new(d("WAWebMdBootstrapDataAppliedWamEvent").MdBootstrapDataAppliedWamEvent)({mdBootstrapPayloadType:d("WAWebWamEnumMdBootstrapPayloadType").MD_BOOTSTRAP_PAYLOAD_TYPE.CRITICAL,mdBootstrapSource:d("WAWebWamEnumMdBootstrapSource").MD_BOOTSTRAP_SOURCE.APP_STATE,mdSessionId:yield d("WAWebSyncdMdSyncFieldstatMeta").MdSyncFieldStatsMeta.getMdSessionId(),mdTimestamp:d("WATimeUtils").unixTimeMs()}).commitAndWaitForFlush(!0))});function c(){return a.apply(this,arguments)}return c}();e.getCriticalSyncDebugSummary=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(yield this.isCriticalDataSynced())return"-------\nAll critical data synced\n-------\n\n";var a=(yield d("WAWebUserPrefsHistorySync").getHistorySyncStatus());return"-------\n Initial history sync complete: "+(a?"true":this._criticalState.initialChatHistory.toString())+"\n Initial msgs: "+this._debugOnlyState.initialChatHistoryTotalMsg+", initial chats: "+this._debugOnlyState.initialChatHistoryTotalChats+"\n Receipt sync complete: "+this._criticalState.readReceipts.toString()+" \n "+("Critical collection sync complete: "+this._criticalState.syncdCritical.toString()+" \n-------\n")});function c(){return a.apply(this,arguments)}return c}();e.isCriticalDataSynced=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){this._allCriticalDataSynced=this._allCriticalDataSynced||(yield d("WAWebUserPrefsAppStateSync").getAllCriticalDataSynced());return this._allCriticalDataSynced});function c(){return a.apply(this,arguments)}return c}();e.syncCriticalData=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=this;c("WAWebBrokerGlobalAppState").initOrUpdateTracking(d("WAWebWamEnumWebcScenarioType").WEBC_SCENARIO_TYPE.INITIAL_PAIRING);d("WALogger").LOG(V());var e=(yield this.getCriticalSyncDebugSummary());d("WALogger").LOG(U(),e);d("WALogger").LOG(T()).tags("history-sync");e=d("WAWebSyncDeviceAdvDeviceListJob").syncMyDeviceListJob();var f=new(h||(h=b("Promise")))(function(b,c){d("WAWebAccountSyncJob").updatePrivacySettings().then(function(){return a.setReadReceiptsSynced()}).then(b)["catch"](c)})["catch"](function(a){d("WALogger").ERROR(S(),a.stack).verbose().devConsole(a).sendLogs("failed to update privacy settings from privacy request to server"),d("WAWebJestE2ELogUtils").maybeLogToJestE2eJSConsole("failed to sync privacy settings, logging out"),void d("WAWebSocketLogoutJob").socketLogout(d("WAWebLogoutReasonConstants").LogoutReason.AccountSyncError)});this._initCriticalDataTimeoutIfNeeded();this._syncDCriticalDataState=Z.InProcess;e=e.then(function(){return d("WAWebSyncd").markCollectionsForSync([d("WASyncdConst").CollectionName.CriticalBlock,d("WASyncdConst").CollectionName.CriticalUnblockLow])}).then(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){a._criticalState.syncdCritical||(yield a._isSyncDCriticalDataComplete())&&(yield a.setSyncDCriticalSynced(),yield a.setSyncDCriticalDataSyncCompleted())}));var g=(yield d("WAWebUserPrefsHistorySync").getInitialHistorySyncComplete());g===!0&&(yield this.setInitialChatHistorySynced());g=d("WAWebAccountSyncJob").updateDefaultDisappearingMode()["catch"](function(a){d("WALogger").ERROR(R(),a.stack).verbose().devConsole(a).sendLogs("failed initial sync of default disappearing mode")});yield h.all([f,e,g])});function e(){return a.apply(this,arguments)}return e}();e.continueProgressiveHistorySyncProcessing=function(){d("WALogger").LOG(Q());var a=c("WAWebMiscBrowserUtils").info().name!=="Safari";this._initNextProgressiveHistorySyncRunLoop(a)};e._progressiveHistorySyncRun=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(!this._allCriticalDataSynced&&this._criticalState.initialChatHistory!==!0){d("WALogger").LOG(P());this._progressiveHistorySyncRemainingIteration++;return}if(!d("WAWebCmd").Cmd.isMainStreamReadyMd){d("WALogger").LOG(O()).tags("history-sync");this._progressiveHistorySyncRemainingIteration++;return}var a=(yield d("WAWebApiHistorySyncNotification").fetchNextHistorySyncChunkForProcessing());if(!a)return;d("WALogger").LOG(N(),a.chunkOrder);this._progressiveHistorySyncRemainingIteration++;a.syncType===d("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.RECENT?yield d("WAWebHandleWorkerCompatibleRecentSyncChunk").handleWorkerCompatibleRecentSyncChunk(a):yield d("WAWebHandleHistorySyncChunk").handleHistorySyncChunk(a)});function a(){return a.apply(this,arguments)}return a}();e._initNextProgressiveHistorySyncRunLoop=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a===void 0&&(a=!1);this._isHistorySyncLoopRunning=!0;a&&this._progressiveHistorySyncRemainingIteration++;var c=d("WAWebABProps").getABPropConfigValue("history_sync_loop_interval_ms");this._progressiveHistorySyncRemainingIteration===0&&void d("WAWebSchemaHistorySyncNotification").getHistorySyncNotificationTable().equals(["processed"],0,{shouldDecrypt:!1}).then(function(a){a=a.filter(function(a){return!d("WAWebApiHistorySyncNotification").inFlightChunk.has(a.msgKey)&&!a.reuploadPending});a.length>0&&d("WALogger").WARN(M(),a.length,c)});if(!this._progressiveHistorySyncInFlight&&this._progressiveHistorySyncRemainingIteration>0){this._progressiveHistorySyncRemainingIteration--;this._progressiveHistorySyncInFlight=!0;try{yield d("WAWebDbEncryptionKey").DbEncKeyStore.waitForFinalDbMsgEncKey(),yield this._progressiveHistorySyncRun()}catch(a){d("WALogger").ERROR(L(),a==null?void 0:a.message,a==null?void 0:a.stack)}this._progressiveHistorySyncInFlight=!1;var e=!this._allCriticalDataSynced&&this._criticalState.initialChatHistory!==!0;e&&d("WALogger").LOG(K());yield new(h||(h=b("Promise")))(function(a){return self.setTimeout(a,e?oa:c)});this._initNextProgressiveHistorySyncRunLoop()}this._isHistorySyncLoopRunning=!1});function a(b){return a.apply(this,arguments)}return a}();e.increaseProgressiveHistorySyncRemainingIteration=function(){this._progressiveHistorySyncRemainingIteration+=sa};e._progressiveHistorySyncRunV2=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(!d("WAWebCmd").Cmd.isMainStreamReadyMd){d("WALogger").LOG(J()).tags("history-sync");return}var a=(yield d("WAWebApiHistorySyncNotification").fetchNextHistorySyncChunkForProcessing());if(!a){d("WALogger").LOG(I()).tags("history-sync");return}d("WALogger").LOG(H());if(a.syncType===d("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.RECENT&&a.chunkOrder!=null){var b=a.msgKey;d("WAWebApiHistorySyncNotification").recentSyncChunkHandlingTriedCount[b]!=null?d("WAWebApiHistorySyncNotification").recentSyncChunkHandlingTriedCount[b]++:d("WAWebApiHistorySyncNotification").recentSyncChunkHandlingTriedCount[b]=1}a.syncType===d("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.RECENT?yield d("WAWebHandleWorkerCompatibleRecentSyncChunk").handleWorkerCompatibleRecentSyncChunk(a):yield d("WAWebHandleHistorySyncChunk").handleHistorySyncChunk(a)});function c(){return a.apply(this,arguments)}return c}();e._initNextProgressiveHistorySyncRunLoopV2=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){d("WALogger").LOG(G());try{yield d("WAWebDbEncryptionKey").DbEncKeyStore.waitForFinalDbMsgEncKey(),yield this._progressiveHistorySyncRunV2()}catch(a){d("WALogger").ERROR(F(),a==null?void 0:a.message,a==null?void 0:a.stack)}d("WALogger").LOG(E());var a=(yield d("WAWebUserPrefsHistorySync").getHistorySyncStatus());if((a==null?void 0:a.recentCompleted)===!0){d("WALogger").LOG(D());a=(yield d("WAWebSchemaHistorySyncNotification").getHistorySyncNotificationTable().equals(["processed","syncType"],[0,d("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.ON_DEMAND],{shouldDecrypt:!1}));a.length>0?void this.continueProgressiveHistorySyncProcessingV2(d("WAWebHistorySyncNotificationUtils").HistorySyncScheduleSource.LastProcessedNotification):d("WALogger").LOG(C());if(d("WAWebClientFeatureFlags").isFeatureEnabled("debug_1_year_history_sync")){d("WALogger").LOG(B());a=(yield d("WAWebSchemaHistorySyncNotification").getHistorySyncNotificationTable().equals(["processed","syncType"],[0,d("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.FULL],{shouldDecrypt:!1}));a.length>0?void this.continueProgressiveHistorySyncProcessingV2(d("WAWebHistorySyncNotificationUtils").HistorySyncScheduleSource.LastProcessedNotification):d("WALogger").LOG(A())}return}d("WALogger").LOG(z());a=(yield d("WAWebHistorySyncNotificationUtils").getUnprocessedRecentSyncNotifications());if(a.length===0){d("WALogger").LOG(y());return}var b=a[0].chunkOrder;if(b==null){d("WALogger").LOG(x());return}var e=(yield d("WAWebUserPrefsHistorySync").getLastHistoryRecentSyncedChunk());d("WALogger").LOG(w(),b,e==null?void 0:e.chunkOrder);if(e!=null&&e.chunkOrder+1!==b&&b!==1){d("WALogger").LOG(v());return}if(c("WAWebEnvironment").isWindows===!0&&(e==null?void 0:e.chunkOrder)===this.$1&&b===this.$2){this.$3||(this.$3=!0,d("WALogger").ERROR(u()).sendLogs("history-sync-unexpected-chunk-order"));yield d("WAAsyncSleep").asyncSleep(5e3);return}this.$1=e==null?void 0:e.chunkOrder;this.$2=b;if(d("WAWebApiHistorySyncNotification").recentSyncChunkHandlingTriedCount[a[0].msgKey]>ra){d("WALogger").LOG(t(),b);return}d("WALogger").LOG(s());void this.continueProgressiveHistorySyncProcessingV2(d("WAWebHistorySyncNotificationUtils").HistorySyncScheduleSource.LastProcessedNotification)});function e(){return a.apply(this,arguments)}return e}();e.continueProgressiveHistorySyncProcessingV2=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=this;if(!this._allCriticalDataSynced&&this._criticalState.initialChatHistory!==!0){d("WALogger").LOG(r());return(h||(h=b("Promise"))).resolve()}if(a===d("WAWebHistorySyncNotificationUtils").HistorySyncScheduleSource.BackendStart){var e=(yield d("WAWebUserPrefsHistorySync").getHistorySyncStatus());if((e==null?void 0:e.recentCompleted)===!0){d("WALogger").LOG(q());return(h||(h=b("Promise"))).resolve()}}return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("continueProgressiveHistorySyncProcessingV2",function(){var e=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){d("WALogger").LOG(p(),a);return c._initNextProgressiveHistorySyncRunLoopV2()});return function(a){return e.apply(this,arguments)}}(),{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.HISTORY_SYNC,maxTimeoutMs:1e3*120}).waitUntilCompleted()["catch"](function(a){d("WALogger").ERROR(o(),a)})});function c(b){return a.apply(this,arguments)}return c}();e.getIsHistorySyncRunning=function(){var a=d("WAWebJobOrchestrator").getInstance();a=a.getSnapshot(d("WAJobOrchestratorTypes").JOB_PRIORITY.HISTORY_SYNC);return a!=null&&a.continueProgressiveHistorySyncProcessingV2!=null?a.continueProgressiveHistorySyncProcessingV2>0:!1};return a}();var $=new e();d("WAWebCmd").Cmd.on("on_initial_chat_synced",b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield $.setInitialChatHistorySynced()}));d("WAWebCmd").Cmd.on("logout",function(){$.initState()});d("WAWebCmd").Cmd.on("on_recent_chat_history_synced",function(){var a,b=d("WAWebJobOrchestrator").getInstance();d("WALogger").DEV(n(),JSON.stringify(b.getSnapshot((a=d("WAJobOrchestratorTypes")).JOB_PRIORITY.HISTORY_SYNC)));d("WALogger").LOG(m(),a.JOB_PRIORITY.HISTORY_SYNC);b.clearQueueByPriority(a.JOB_PRIORITY.HISTORY_SYNC);d("WALogger").DEV(l(),JSON.stringify(b.getSnapshot(a.JOB_PRIORITY.HISTORY_SYNC)))});d("WAWebCmd").Cmd.on("on_full_chat_history_synced",function(){var a,b=d("WAWebJobOrchestrator").getInstance();d("WALogger").DEV(k(),JSON.stringify(b.getSnapshot((a=d("WAJobOrchestratorTypes")).JOB_PRIORITY.HISTORY_SYNC)));d("WALogger").LOG(j(),a.JOB_PRIORITY.HISTORY_SYNC);b.clearQueueByPriority(a.JOB_PRIORITY.HISTORY_SYNC);d("WALogger").DEV(i(),JSON.stringify(b.getSnapshot(a.JOB_PRIORITY.HISTORY_SYNC)))});f=$;g["default"]=f}),98); __d("WAWebSyncOnABProps",["WALogger","WAWebABProps","WAWebABPropsWamGlobals","WAWebProtobufsE2E.pb","WAWebSendNonMessageDataRequest","WAWebStoreSpecialAbProps","WAWebUserPrefsAppStateSync","WAWebUserPrefsCTWA","WAWebUserPrefsTypes","WAWebUserPrefsUiRefresh","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Recent Stickers: request peer message for recent sticker bootstrap."]);h=function(){return a};return a}function a(a){a!==d("WAWebABProps").getABPropConfigValue("service_improvement_opt_out_flag")&&d("WAWebABPropsWamGlobals").setAbPropDependingGlobalWamAttributes()}function c(){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield d("WAWebUserPrefsAppStateSync").getNonCriticalDataSyncStatus());(a==null?void 0:a[d("WAWebUserPrefsTypes").NonCriticalDataSyncStatusType.RECENT_STICKER_INITIALIZED])===d("WAWebUserPrefsTypes").RecentStickerInitializedStatusType.NEED_REQUEST_BOOTSTRAP&&(d("WALogger").LOG(h()),yield d("WAWebSendNonMessageDataRequest").sendPeerDataOperationRequest(d("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.SEND_RECENT_STICKER_BOOTSTRAP,{}))});return i.apply(this,arguments)}function e(a){var b=d("WAWebABProps").getABPropConfigValue("ctwa_ad_account_token_storage_kill_switch_web");b===!0&&a===!1&&d("WAWebUserPrefsCTWA").clearAdAccountToken()}function f(a){var b=d("WAWebABProps").getABPropConfigValue("web_ui_refresh_m1");a===!0&&b===!1&&(d("WAWebUserPrefsUiRefresh").resetNuxViewCount(),d("WAWebUserPrefsUiRefresh").setUiRefreshNuxAcked(!1),void d("WAWebStoreSpecialAbProps").storeSpecialAbProps())}g.handleServiceImprovementOptOutFlagABPropConfigValueChange=a;g.ensureNonCriticalDataSyncIsInitialized=c;g.handleAdAccountTokenStorageKillSwitchABPropConfigValueChange=e;g.handleUIRefreshNuxOnABPropConfigValueChange=f}),98); __d("WAWebAltDeviceLinkingBase32Encode",[],(function(a,b,c,d,e,f){var g="123456789ABCDEFGHJKLMNPQRSTVWXYZ";function a(a){a=new DataView(a.buffer,a.byteOffset,a.byteLength);var b=0,c=0,d="";for(var e=0;e<a.byteLength;e++){c=c<<8|a.getUint8(e);b+=8;while(b>=5)d+=g[c>>>b-5&31],b-=5}b>0&&(d+=g[c<<5-b&31]);return d}f.bytesToCrockford=a}),66); __d("WAWebAltDeviceLinkingAlgorithm",["WAArrayBufferUtils","WABinary","WAByteArray","WACryptoHkdf","WALogger","WAWebAltDeviceLinkingApi","WAWebAltDeviceLinkingBase32Encode","WAWebCryptoCurve25519","WAWebSignalStoreApi","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["alt pairing: encrypt key bundle"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["alt pairing: decrypt primary hello"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["alt pairing: encrypt companion hello"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["alt pairing: create adv secret material"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["alt pairing: generate random code"]);l=function(){return a};return a}function m(){d("WALogger").LOG(l());var a=new Uint8Array(5);self.crypto.getRandomValues(a);return d("WAWebAltDeviceLinkingBase32Encode").bytesToCrockford(a)}function n(a,b){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){try{return yield a()}catch(c){(a=d("WAWebAltDeviceLinkingApi").getCurrentMarker())==null?void 0:a.addPoint(b);throw c}});return o.apply(this,arguments)}function p(a,b,c){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){c===void 0&&(c=!1);b=new(d("WABinary").Binary)(b);b=(yield self.crypto.subtle.deriveKey({name:"PBKDF2",hash:"SHA-256",salt:b.readBuffer(),iterations:2<<16},a,{name:"AES-CTR",length:256},c,["encrypt","decrypt"]));return b});return q.apply(this,arguments)}function r(a,b,c){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){d("WALogger").LOG(j());b={name:"AES-CTR",length:64,counter:b};b=(yield self.crypto.subtle.encrypt(b,c,a));return b});return s.apply(this,arguments)}function t(a,b,c){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){d("WALogger").LOG(i());var e={name:"AES-CTR",length:64,counter:b};b=(yield n(function(){return self.crypto.subtle.decrypt(e,c,a)},"fail decrypt primary ephemeral pub"));return b});return u.apply(this,arguments)}function a(){return v.apply(this,arguments)}function v(){v=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=m(),b=d("WAWebCryptoCurve25519").keyPair(),c=new Uint8Array(32);self.crypto.getRandomValues(c);var e=new Uint8Array(16);self.crypto.getRandomValues(e);b=(yield w(a,b,c,e));return babelHelpers["extends"]({},b,{linkCodePairingSecret:a})});return v.apply(this,arguments)}function w(a,b,c,d){return x.apply(this,arguments)}function x(){x=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e){a=(yield self.crypto.subtle.importKey("raw",new TextEncoder().encode(a),{name:"PBKDF2"},!1,["deriveKey"]));var f=(yield p(a,c)),g=(yield n(function(){return r(b.pubKey,e,f)},"fail encrypt companion hello")),h=new(d("WABinary").Binary)();h.writeByteArray(c);h.writeByteArray(e);h.writeByteArray(new Uint8Array(g));c=h.readBuffer();return{linkCodePairingWrappedCompanionEphemeralPub:c,linkCodeKey:a,linkCodePairingCompanionADVEphemeralKeyPair:b}});return x.apply(this,arguments)}function y(a,b){return z.apply(this,arguments)}function z(){z=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=(yield d("WACryptoHkdf").extractWithSaltAndExpand(a,b,"link_code_pairing_key_bundle_encryption_key",32));return a});return z.apply(this,arguments)}function A(a,b,c){return d("WAArrayBufferUtils").concatBuffers([a,b,d("WAByteArray").uint8ArrayToBuffer(c)])}function B(a,b,c){return C.apply(this,arguments)}function C(){C=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){d("WALogger").LOG(h());var e=(yield self.crypto.subtle.importKey("raw",a,{name:"AES-GCM"},!1,["encrypt"])),f={name:"AES-GCM",iv:b};a=(yield n(function(){return self.crypto.subtle.encrypt(f,e,c)},"fail encrypt wrapped key bundle"));return a});return C.apply(this,arguments)}function e(a,b,c){d("WALogger").LOG(k());a=d("WAArrayBufferUtils").concatBuffers([a,b,d("WAByteArray").uint8ArrayToBuffer(c)]);return a}function f(a){return D.apply(this,arguments)}function D(){D=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WACryptoHkdf").extractWithSaltAndExpand(a,null,"adv_secret",32));return a});return D.apply(this,arguments)}function E(a,b,c,d){return F.apply(this,arguments)}function F(){F=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e,f){var g=(yield d("WAWebSignalStoreApi").waSignalStore.getRegistrationInfo());if(g==null)throw c("err")("alt pairing: Did not find registration info");var h=new Uint8Array(32);self.crypto.getRandomValues(h);var i=new Uint8Array(32);self.crypto.getRandomValues(i);var j=new Uint8Array(12);self.crypto.getRandomValues(j);return G(a,b,e,f,g.identityKeyPair.pubKey,g.identityKeyPair.privKey,h,i,j)});return F.apply(this,arguments)}function G(a,b,c,d,e,f,g,h,i){return H.apply(this,arguments)}function H(){H=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e,f,g,h,i,j,k){a=new(d("WABinary").Binary)(a);var l=a.readByteArray(32),m=a.readByteArray(16),o=a.readByteArray(),q=(yield p(e,l)),r=(yield n(function(){return t(o,m,q)},"fail decrypt primary ephemeral pub"));if(r.byteLength===0)throw c("err")("alt pairing: linkCodePairingDecryptedPrimaryEphemeralPub is an empty buffer");a=(yield n(function(){return d("WAWebCryptoCurve25519").sharedSecret(r,f.privKey)},"fail generate ephemeral shared secret"));e=(yield y(a,j));l=A(g,b,i);e=(yield B(e,k,l));l=new(d("WABinary").Binary)();l.writeByteArray(j);l.writeByteArray(k);l.writeBuffer(e);j=(yield n(function(){return d("WAWebCryptoCurve25519").sharedSecret(b,h)},"fail generate identity shared secret"));k=d("WAArrayBufferUtils").concatBuffers([a,j,d("WAByteArray").uint8ArrayToBuffer(i)]);e=(yield d("WACryptoHkdf").extractWithSaltAndExpand(k,null,"adv_secret",32));a=l.readBuffer();return{companionIdentityPublic:g,linkCodePairingWrappedKeyBundle:a,advSecret:e}});return H.apply(this,arguments)}g.generateRandomCode=m;g.deriveKey=p;g.encryptCompanionHello=r;g.decryptPrimaryHello=t;g.companionHello=a;g.companionHelloInternal=w;g.getBundleEncryptionKey=y;g.getKeyBundle=A;g.encryptKeyBundle=B;g.createAdvSecretMaterial=e;g.createAdvSecret=f;g.companionFinish=E;g.companionFinishInternal=G}),98); __d("WAWebCompanionRegClientUtils",["$InternalEnum","WAWebMiscBrowserUtils"],(function(a,b,c,d,e,f,g){var h=b("$InternalEnum")({UNKNOWN:0,CHROME:1,EDGE:2,FIREFOX:3,IE:4,OPERA:5,SAFARI:6,ELECTRON:7,UWP:8,OTHER_WEB_CLIENT:9});d=String(a());function a(){var a=c("WAWebMiscBrowserUtils").info().name;if(!a)return h.UNKNOWN;switch(a){case"Chrome":return h.CHROME;case"Firefox":return h.FIREFOX;case"IE":return h.IE;case"Opera":return h.OPERA;case"Safari":return h.SAFARI;case"Edge":return h.EDGE;default:return h.OTHER_WEB_CLIENT}}g.DEVICE_PLATFORM=d}),98); __d("WAWebAltDeviceLinkingIq",["WASmaxMdCompanionFinishRPC","WASmaxMdCompanionHelloRPC","WAWebCompanionRegClientUtils","WAWebMiscBrowserUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h=function(b){babelHelpers.inheritsLoose(a,b);function a(a,c){a=b.call(this,a)||this;a.name="CompanionHelloError";a.type=c;return a}return a}(babelHelpers.wrapNativeSuper(Error)),i=function(b){babelHelpers.inheritsLoose(a,b);function a(){var a,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(a=c=b.call.apply(b,[this].concat(e))||this,c.name="CompanionFinishError",a)||babelHelpers.assertThisInitialized(c)}return a}(babelHelpers.wrapNativeSuper(Error));function a(a,b,c,d){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e,f){a=(yield d("WASmaxMdCompanionHelloRPC").sendCompanionHelloRPC({linkCodePairingNonceArgs:{linkCodePairingNonceElementValue:new Uint8Array(1)},linkCodeCompanionRegJid:a,linkCodePairingWrappedCompanionEphemeralPubElementValue:new Uint8Array(b),companionServerAuthKeyPubElementValue:new Uint8Array(e),companionPlatformIdElementValue:d("WAWebCompanionRegClientUtils").DEVICE_PLATFORM,companionPlatformDisplayElementValue:c("WAWebMiscBrowserUtils").info().name+" ("+c("WAWebMiscBrowserUtils").info().os+")",linkCodeCompanionRegShouldShowPushNotification:f?"true":"false"}));if(a.name==="CompanionHelloResponseNotifyCompanion")return a.value.linkCodeCompanionRegLinkCodePairingRefElementValue;else if(a.name==="CompanionHelloResponseError")throw new h("alt pairing: Got an error from alt paring: companion hello: "+a.value.errorIqMixinErrors.name,a.value.errorIqMixinErrors);throw new h("alt pairing: Got an unknown error from alt paring: companion hello")});return j.apply(this,arguments)}function e(a,b,c,d){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e){e=(yield d("WASmaxMdCompanionFinishRPC").sendCompanionFinishRPC({linkCodeCompanionRegJid:e,linkCodePairingWrappedKeyBundleElementValue:new Uint8Array(a),companionIdentityPublicElementValue:new Uint8Array(b),linkCodePairingRefElementValue:c}));if(e.name==="CompanionFinishResponseSuccess")return;throw new i("alt pairing: Got an error from alt paring: companion finish")});return k.apply(this,arguments)}g.CompanionHelloError=h;g.CompanionFinishError=i;g.sendCompanionHello=a;g.sendCompanionFinish=e}),98); __d("WAWebAltDeviceLinkingApi",["invariant","$InternalEnum","Promise","WABase64","WAByteArray","WACryptoUtils","WAJids","WALogger","WAQplTypes","WATimeUtils","WAWebAdvSignatureApi","WAWebAltDeviceLinkingAlgorithm","WAWebAltDeviceLinkingIq","WAWebBackendApi","WAWebQplQuickPerformanceLoggerMarkerIds","WAWebQplQuickPerformanceLoggerModule","WAWebUserPrefsInfoStore","WAWebUserPrefsMultiDevice","asyncToGeneratorRuntime","err","gkx"],(function(a,b,c,d,e,f,g,h){var i;function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["alt pairing: sent companion finish to server"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["alt pairing: completed companion finish local algorithm"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["alt pairing: cached companion hello ref: ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["alt pairing: handling primary hello"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["alt pairing: companion hello ref received: ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["alt pairing: sent companion hello"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["alt pairing: completed companion hello generation"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["alt pairing: start linking flow"]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["alt pairing: initialize QR linking"]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["alt pairing: initialize alt linking"]);s=function(){return a};return a}var t=function(b){babelHelpers.inheritsLoose(a,b);function a(){var a,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(a=c=b.call.apply(b,[this].concat(e))||this,c.name="MissingCachedRefError",a)||babelHelpers.assertThisInitialized(c)}return a}(babelHelpers.wrapNativeSuper(Error)),u=function(b){babelHelpers.inheritsLoose(a,b);function a(){var a,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(a=c=b.call.apply(b,[this].concat(e))||this,c.name="NoiseInfoIsNullError",a)||babelHelpers.assertThisInitialized(c)}return a}(babelHelpers.wrapNativeSuper(Error)),v=function(b){babelHelpers.inheritsLoose(a,b);function a(){var a,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(a=c=b.call.apply(b,[this].concat(e))||this,c.name="InvalidRefError",a)||babelHelpers.assertThisInitialized(c)}return a}(babelHelpers.wrapNativeSuper(Error)),w=function(b){babelHelpers.inheritsLoose(a,b);function a(){var a,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(a=c=b.call.apply(b,[this].concat(e))||this,c.name="OldCodeError",a)||babelHelpers.assertThisInitialized(c)}return a}(babelHelpers.wrapNativeSuper(Error)),x=function(b){babelHelpers.inheritsLoose(a,b);function a(){var a,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(a=c=b.call.apply(b,[this].concat(e))||this,c.name="MaxPrimaryHelloError",a)||babelHelpers.assertThisInitialized(c)}return a}(babelHelpers.wrapNativeSuper(Error)),y=b("$InternalEnum").Mirrored(["QR_CODE","ALT_DEVICE_LINKING"]),z=b("$InternalEnum").Mirrored(["NotStarted","Initialized","AfterSendCompanionHello","AfterSendCompanionFinish"]),A=function(){function a(){this.clear()}var b=a.prototype;b.clear=function(){this.helloCached=null,this.ref=null,this.phone=null,this.stage=z.NotStarted,this.codeGenerationTs=null,this.primaryHelloAttemptCount=0,this.marker!=null&&(this.marker.end(d("WAQplTypes").QuickLogActionType.ABORTED),this.marker=null)};return a}(),B=180,C=3,D=new A(),E=y.QR_CODE;function F(){return E}function G(a){E=a}function a(){return D.ref}function H(){return D.marker}function e(){return I.apply(this,arguments)}function I(){I=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){d("WALogger").LOG(s()),D.clear(),D.marker=d("WAWebQplQuickPerformanceLoggerModule").QPL.markerStart(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.ALTERNATIVE_DEVICE_LINKING),yield d("WAWebUserPrefsMultiDevice").setADVSecretKey(),D.stage=z.Initialized,G(y.ALT_DEVICE_LINKING)});return I.apply(this,arguments)}function f(){return J.apply(this,arguments)}function J(){J=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){d("WALogger").LOG(r());if(F()===y.ALT_DEVICE_LINKING){var a;(a=H())==null?void 0:a.addPoint("switch_to_qr")}D.clear();yield d("WAWebAdvSignatureApi").generateADVSecretKey();D.stage=z.NotStarted;G(y.QR_CODE)});return J.apply(this,arguments)}function K(a,b){return L.apply(this,arguments)}function L(){L=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){d("WALogger").LOG(q());var c=(yield d("WAWebUserPrefsInfoStore").waNoiseInfo.get());if(c==null)throw new u("alt pairing: noise info is null");D.phone=a;D.codeGenerationTs=d("WATimeUtils").unixTime();return M(D,c,b)});return L.apply(this,arguments)}function M(a,b,c){return N.apply(this,arguments)}function N(){N=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e){var f;if(!c("gkx")("26258")){var g;(g=D.marker)==null?void 0:g.annotate({string:{phone:a.phone}})}a.stage===z.Initialized||h(0,75727,a.stage);(g=D.marker)==null?void 0:g.addPoint("generate_code_start");g=(yield d("WAWebAltDeviceLinkingAlgorithm").companionHello());a.helloCached=g;(f=D.marker)==null?void 0:f.addPoint("generate_code_end");d("WALogger").LOG(p());(f=D.marker)==null?void 0:f.addPoint("send_companion_hello_start");a.phone!=null||h(0,67482);a.ref=(yield d("WAWebAltDeviceLinkingIq").sendCompanionHello(d("WAJids").toPhoneUserJid(a.phone),g.linkCodePairingWrappedCompanionEphemeralPub,b.staticKeyPair.pubKey,e));(f=D.marker)==null?void 0:f.addPoint("send_companion_hello_end");d("WALogger").LOG(o());if(a.ref==null)throw new t("alt pairing:could not get ref from companion hello");c("gkx")("26258")||d("WALogger").LOG(n(),a.ref);a.stage=z.AfterSendCompanionHello;return g.linkCodePairingSecret});return N.apply(this,arguments)}function O(a){return P.apply(this,arguments)}function P(){P=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){d("WALogger").LOG(m());d("WAWebBackendApi").frontendFireAndForget("primaryHelloReceivedAltLinking",{});try{return yield S(a,D,d("WATimeUtils").unixTime())}catch(a){d("WAWebBackendApi").frontendFireAndForget("errorAltLinking",{});return(i||(i=b("Promise"))).reject(a)}});return P.apply(this,arguments)}function Q(a){return R.apply(this,arguments)}function R(){R=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield d("WAWebAdvSignatureApi").generateADVSecretKey(),a.stage=z.AfterSendCompanionHello});return R.apply(this,arguments)}function S(a,b,c){return T.apply(this,arguments)}function T(){T=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e){var f;(f=D.marker)==null?void 0:f.addPoint("handle_primary_hello_start");b.primaryHelloAttemptCount++;if(b.stage===z.AfterSendCompanionFinish)if(b.primaryHelloAttemptCount<=C)yield Q(b);else throw new x("alt pairing: reached max allowed primary hello attempts per code");b.stage===z.AfterSendCompanionHello||h(0,75728,b.stage);c("gkx")("26258")||d("WALogger").LOG(l(),b.ref);if(b.ref==null)throw new t("alt pairing:could not get ref from companion hello");if(!d("WACryptoUtils").uint8ArraysEqual(b.ref,a.linkCodeCompanionRegLinkCodePairingRefElementValue))throw new v("alt pairing: handle primary hello: received unexpected ref");if(b.helloCached==null)throw c("err")("alt pairing: cannot find cached hello data");if(b.codeGenerationTs==null)throw c("err")("alt pairing: cannot find codeGenerationTs");if(e-b.codeGenerationTs>B)throw new w("alt pairing: cannot process primaryHello for an old code");f=b.helloCached;e=(yield d("WAWebAltDeviceLinkingAlgorithm").companionFinish(d("WAByteArray").uint8ArrayToBuffer(a.linkCodeCompanionRegLinkCodePairingWrappedPrimaryEphemeralPubElementValue),d("WAByteArray").uint8ArrayToBuffer(a.linkCodeCompanionRegPrimaryIdentityPubElementValue),f.linkCodeKey,f.linkCodePairingCompanionADVEphemeralKeyPair));d("WALogger").LOG(k());yield d("WAWebUserPrefsMultiDevice").setADVSecretKey(d("WABase64").encodeB64(e.advSecret));a=b.ref;if(a==null)throw new t("alt pairing: cannot find cached ref");f=b.phone;if(f==null)throw new t("alt pairing: phone is empty");yield d("WAWebAltDeviceLinkingIq").sendCompanionFinish(e.linkCodePairingWrappedKeyBundle,e.companionIdentityPublic,a,d("WAJids").toPhoneUserJid(f));d("WALogger").LOG(j());b.stage=z.AfterSendCompanionFinish;(e=D.marker)==null?void 0:e.addPoint("handle_primary_hello_end")});return T.apply(this,arguments)}g.MissingCachedRefError=t;g.NoiseInfoIsNullError=u;g.InvalidRefError=v;g.OldCodeError=w;g.MaxPrimaryHelloError=x;g.PairingType=y;g.AltPairingStage=z;g.PairingState=A;g.getPairingType=F;g.setPairingType=G;g.getCurrentRef=a;g.getCurrentMarker=H;g.initializeAltDeviceLinking=e;g.initializeQRLinking=f;g.startAltLinkingFlow=K;g.handlePrimaryHello=O;g.handlePrimaryHelloInternal=S}),98); __d("WAWebAltDeviceLinkingHandleNotification",["WACryptoUtils","WASmaxMdPrimaryHelloNotifyCompanionRPC","WASmaxMdRefreshCodeNotifyCompanionRPC","WASmaxOutMessageFallbackDeliverResponseBadStanza","WAWebAltDeviceLinkingApi","WAWebBackendApi","err"],(function(a,b,c,d,e,f,g){var h;function a(){return h}function b(a){var b=a.content;if(!Array.isArray(b)||!b.length)return d("WASmaxOutMessageFallbackDeliverResponseBadStanza").makeDeliverResponseBadStanza({ackError:487},a);b=b[0].attrs;if(b.stage==="primary_hello")return i(a);else if(b.stage==="refresh_code")return j(a);return d("WASmaxOutMessageFallbackDeliverResponseBadStanza").makeDeliverResponseBadStanza({ackError:487},a)}function i(a){a=d("WASmaxMdPrimaryHelloNotifyCompanionRPC").receivePrimaryHelloNotifyCompanionRPC(a);var b=a.parsedRequest;a=a.makePrimaryHelloNotifyCompanionResponseAck;if(!b){d("WAWebBackendApi").frontendFireAndForget("errorAltLinking",{});throw c("err")("alt pairing: could not parse primary hello")}try{h=d("WAWebAltDeviceLinkingApi").handlePrimaryHello(b);return a()}catch(a){(b=d("WAWebAltDeviceLinkingApi").getCurrentMarker())==null?void 0:b.addPoint("primary_hello_error");throw a}}function j(a){a=d("WASmaxMdRefreshCodeNotifyCompanionRPC").receiveRefreshCodeNotifyCompanionRPC(a);var b=a.parsedRequest;a=a.makeRefreshCodeNotifyCompanionResponseAck;if(!b)throw c("err")("alt pairing: could not parse refresh code");var e=d("WAWebAltDeviceLinkingApi").getCurrentRef();if(e!=null&&d("WACryptoUtils").uint8ArraysEqual(e,b.linkCodeCompanionRegLinkCodePairingRefElementValue))if(b.linkCodeCompanionRegForceManualRefresh==="true"){(e=d("WAWebAltDeviceLinkingApi").getCurrentMarker())==null?void 0:e.addPoint("receive_force_refresh_code");d("WAWebBackendApi").frontendFireAndForget("forceManualRefresh",{ref:b.linkCodeCompanionRegLinkCodePairingRefElementValue})}else{(e=d("WAWebAltDeviceLinkingApi").getCurrentMarker())==null?void 0:e.addPoint("receive_refresh_code");d("WAWebBackendApi").frontendFireAndForget("refreshAltLinkingCode",{ref:b.linkCodeCompanionRegLinkCodePairingRefElementValue})}return a()}g.getPrimaryHello=a;g.handleAltDeviceLinkingNotification=b}),98); __d("WAWebBizCreateOrderJob",["WADeprecatedSendIq","WADeprecatedWapParser","WAWap","WAWapDeprecatedSmaxID","WAWebBackendErrors","WAWebCommsWapMd","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h=new(c("WADeprecatedWapParser"))("createOrderResponse",function(a){a.assertTag("iq");a.assertFromServer();a=a.child("order");var b=a.attrString("id"),c=a.attrString("token");a=a.maybeChild("price");var d={},e=a==null?void 0:a.maybeChild("subtotal");e&&(d.subtotal=e.contentString());e=a==null?void 0:a.maybeChild("total");e&&(d.total=e.contentString());e=a==null?void 0:a.maybeChild("currency");e&&(d.currency=e.contentString());e=a==null?void 0:a.maybeChild("price_status");e&&(d.price_status=e.contentString());return{id:b,token:c,price:d}});function i(a){var b=a.priceAmount1000!=null?d("WAWap").wap("price",null,a.priceAmount1000.toString()):void 0,c=a.currency?d("WAWap").wap("currency",null,a.currency):void 0;return d("WAWap").wap("product",null,d("WAWap").wap("id",null,a.id),d("WAWap").wap("name",null,a.name),b,c,d("WAWap").wap("quantity",null,a.quantity.toString()))}function a(a,b,c){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e){e===void 0&&(e=null);a=d("WAWap").wap("iq",{to:d("WAWap").S_WHATSAPP_NET,smax_id:d("WAWap").SMAX_ID(c("WAWapDeprecatedSmaxID").CreateOrder),xmlns:"fb:thrift_iq",id:d("WAWap").generateId(),type:"set"},d("WAWap").wap("order",{op:d("WAWap").CUSTOM_STRING("create"),biz_jid:d("WAWebCommsWapMd").USER_JID(a)},b.map(function(a){return i(a)}).concat(e!=null?d("WAWap").wap("direct_connection_encrypted_info",null,e):[])));b=(yield d("WADeprecatedSendIq").deprecatedSendIq(a,h));if(!b.success){if(b.errorCode===451)throw new(d("WAWebBackendErrors").E451)();throw new(d("WAWebBackendErrors").ServerStatusCodeError)(b.errorCode)}else return b.result});return j.apply(this,arguments)}g.createOrderResponse=h;g.createOrderMD=a}),98); __d("WAWebBizLogQplEvents",["WAWebQplQuickPerformanceLoggerMarkerIds","WAWebQplQuickPerformanceLoggerModule"],(function(a,b,c,d,e,f,g){function a(a){d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.WHATSAPP_CART_VIEW,a)}function b(a){d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.WHATSAPP_PROFILE_CATS_VIEW,a)}function c(a){d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.WHATSAPP_PROFILE_SAVE,a)}function e(a){d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.WHATSAPP_PRODUCT_VIEW,a)}function f(a){d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.WHATSAPP_PLM_DETAILS_VIEW,a)}function h(a){d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.WHATSAPP_ORDER_CREATE,a)}function i(a){d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.WHATSAPP_ORDER_VIEW,a)}g.qplPointCartView=a;g.qplPointProfileCatsView=b;g.qplPointProfileSave=c;g.qplPointProductView=e;g.qplPointPLMDetailsView=f;g.qplPointOrderCreate=h;g.qplPointOrderView=i}),98); __d("WAWebBizQueryOrderJob",["Promise","WADeprecatedSendIq","WADeprecatedWapParser","WAWap","WAWapDeprecatedSmaxID","WAWebBackendErrors","WAWebBizGatingUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h,i=new(c("WADeprecatedWapParser"))("queryOrderResponse",function(a){a.assertTag("iq");a.assertFromServer();a=a.child("order");var b=a.hasAttr("creation_ts")?a.attrTime("creation_ts"):null,c=a.maybeChild("price"),d=c==null?void 0:c.maybeChild("subtotal");d=d?parseInt(d.contentString(),10):null;var e=c==null?void 0:c.maybeChild("currency");e=e?e.contentString():null;var f=c==null?void 0:c.maybeChild("tax");f=f?parseInt(f.contentString(),10):null;c=c==null?void 0:c.maybeChild("total");c=c?parseInt(c.contentString(),10):null;var g=[];a.forEachChildWithTag("product",function(a){var b=a.child("id");b=b.contentString();var c=a.child("name");c=c.contentString();var d=a.maybeChild("price");d=d?parseInt(d.contentString(),10):null;var e=a.maybeChild("quantity");e=e?parseInt(e.contentString(),10):null;var f=a.maybeChild("currency");f=f?f.contentString():null;var h=null,i=null;a=a.maybeChild("image");if(a!=null){var j=a.maybeChild("url");i=j&&j.hasContent()?j.contentString():null;j=a.maybeChild("id");h=j&&j.hasContent()?j.contentString():null}g.push({id:b,price:d,thumbnailId:h,thumbnailUrl:i,currency:f,name:c,quantity:e})});return{currency:e,createdAt:b,products:g,subtotal:d,total:c,tax:f}});function a(a,b,c,d,e){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e,f,g,j){j===void 0&&(j=null);if(d("WAWebBizGatingUtils").commerceFeaturesDisabledBySanctions())return(h||(h=b("Promise"))).reject(new(d("WAWebBackendErrors").E451)());a=d("WAWap").wap("iq",{to:d("WAWap").S_WHATSAPP_NET,smax_id:d("WAWap").SMAX_ID(c("WAWapDeprecatedSmaxID").QueryOrder),xmlns:"fb:thrift_iq",id:d("WAWap").generateId(),type:"get"},d("WAWap").wap("order",{op:d("WAWap").CUSTOM_STRING("get"),id:d("WAWap").CUSTOM_STRING(a)},d("WAWap").wap("image_dimensions",null,d("WAWap").wap("width",null,e.toString()),d("WAWap").wap("height",null,f.toString())),d("WAWap").wap("token",null,g),j!=null?d("WAWap").wap("direct_connection_encrypted_info",null,j):null));e=(yield d("WADeprecatedSendIq").deprecatedSendIq(a,i));if(!e.success){if(e.errorCode===451)throw new(d("WAWebBackendErrors").E451)();throw new(d("WAWebBackendErrors").ServerStatusCodeError)(e.errorCode)}else return e.result});return j.apply(this,arguments)}g.queryOrderResponse=i;g.queryOrder=a}),98); __d("WAWebBizOrderBridge",["Promise","WAWebBackendErrors","WAWebBizCreateOrderJob","WAWebBizGatingUtils","WAWebBizLogQplEvents","WAWebBizQueryOrderJob","WAWebBusinessDirectConnectionBridge"],(function(a,b,c,d,e,f,g){var h;function a(a,c,e,f,g){if(d("WAWebBizGatingUtils").commerceFeaturesDisabledBySanctions())return(h||(h=b("Promise"))).reject(new(d("WAWebBackendErrors").E451)());d("WAWebBizLogQplEvents").qplPointOrderView("datasource_start");a=d("WAWebBusinessDirectConnectionBridge").attemptWithDirectConnectionRetry(a,function(a){return d("WAWebBizQueryOrderJob").queryOrder(c,e,f,g,a)});return a.then(function(a){d("WAWebBizLogQplEvents").qplPointOrderView("datasource_end");return a})}function c(a,c){if(d("WAWebBizGatingUtils").commerceFeaturesDisabledBySanctions())return(h||(h=b("Promise"))).reject(new(d("WAWebBackendErrors").E451)());d("WAWebBizLogQplEvents").qplPointOrderCreate("datasource_start");var e=d("WAWebBusinessDirectConnectionBridge").attemptWithOrderDirectConnectionRetry(a,function(b){return d("WAWebBizCreateOrderJob").createOrderMD(a,c,b)});return e.then(function(a){d("WAWebBizLogQplEvents").qplPointOrderCreate("datasource_end");return a})}g.queryOrder=a;g.createOrder=c}),98); __d("WAWebBizCatalogManagementAddProductMutation_facebookRelayOperation",[],(function(a,b,c,d,e,f){e.exports="24249359867999500"}),null); __d("WAWebBizCatalogManagementAddProductMutation.graphql",["WAWebBizCatalogManagementAddProductMutation_facebookRelayOperation"],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"input"}],c=[{kind:"Variable",name:"request",variableName:"input"}],d={alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},e={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},f={alias:null,args:null,kind:"ScalarField",name:"original_image_url",storageKey:null},g={alias:null,args:null,kind:"ScalarField",name:"request_image_url",storageKey:null},h={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"price",storageKey:null},j={alias:null,args:null,kind:"ScalarField",name:"status",storageKey:null},k={alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null},l=[h,k];i=[{alias:null,args:null,kind:"ScalarField",name:"availability",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:"XFBWhatsAppCatalogProductComplianceInfo",kind:"LinkedField",name:"compliance_info",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"country_code_origin",storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductComplianceInfoImporterAddress",kind:"LinkedField",name:"importer_address",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"city",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"country_code",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"postal_code",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"region",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"street1",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"street2",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"importer_name",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"currency",storageKey:null},d,e,{alias:null,args:null,kind:"ScalarField",name:"is_hidden",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"is_sanctioned",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"max_available",storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductMedia",kind:"LinkedField",name:"media",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductMediaImage",kind:"LinkedField",name:"images",plural:!0,selections:[e,f,g],storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductMediaVideo",kind:"LinkedField",name:"videos",plural:!0,selections:[e,{alias:null,args:null,kind:"ScalarField",name:"original_video_url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"thumbnail_url",storageKey:null}],storageKey:null}],storageKey:null},h,i,{alias:null,args:null,kind:"ScalarField",name:"retailer_id",storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductSalePrice",kind:"LinkedField",name:"sale_price",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"end_date",storageKey:null},i,{alias:null,args:null,kind:"ScalarField",name:"start_date",storageKey:null}],storageKey:null},j,{alias:null,args:null,concreteType:"XFBWhatsAppCatalogStatusInfo",kind:"LinkedField",name:"status_info",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"can_appeal",storageKey:null},j],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"shimmed_url",storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductVariantInfo",kind:"LinkedField",name:"variant_info",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantListingDetails",kind:"LinkedField",name:"listing_details",plural:!1,selections:[d,{alias:null,args:null,kind:"ScalarField",name:"multi_price",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"lowest_price",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantAvailability",kind:"LinkedField",name:"availability",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantAvailabilityListing",kind:"LinkedField",name:"listing",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"is_available",storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantAvailabilityListingOption",kind:"LinkedField",name:"options",plural:!0,selections:l,storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"product_id",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantTypes",kind:"LinkedField",name:"types",plural:!0,selections:[h,{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantTypeOption",kind:"LinkedField",name:"options",plural:!0,selections:[k,{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductMediaImage",kind:"LinkedField",name:"thumbnail_media",plural:!1,selections:[e,{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductMediaImageOriginalDimensions",kind:"LinkedField",name:"original_dimensions",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"height",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"width",storageKey:null}],storageKey:null},f,g],storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantProperties",kind:"LinkedField",name:"variant_properties",plural:!0,selections:l,storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"WAWebBizCatalogManagementAddProductMutation",selections:[{alias:null,args:c,concreteType:"XFBWhatsAppCatalogProductMutationResponse",kind:"LinkedField",name:"xfb_whatsapp_catalog_add_product",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductInfo",kind:"LinkedField",name:"product",plural:!1,selections:[{kind:"InlineDataFragmentSpread",name:"WAWebBizCatalogManagementParseProductGraphql_product",selections:i,args:null,argumentDefinitions:[]}],storageKey:null}],storageKey:null}],type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"WAWebBizCatalogManagementAddProductMutation",selections:[{alias:null,args:c,concreteType:"XFBWhatsAppCatalogProductMutationResponse",kind:"LinkedField",name:"xfb_whatsapp_catalog_add_product",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductInfo",kind:"LinkedField",name:"product",plural:!1,selections:i,storageKey:null}],storageKey:null}]},params:{id:b("WAWebBizCatalogManagementAddProductMutation_facebookRelayOperation"),metadata:{},name:"WAWebBizCatalogManagementAddProductMutation",operationKind:"mutation",text:null}}}();e.exports=a}),null); __d("WAWebBizCatalogManagementAddProduct",["Promise","WALogger","WAWebBizCatalogManagementAddProductMutation.graphql","WAWebBizCatalogManagementParseProductGraphql","WAWebBizGatingUtils","WAWebFetchAdAccountToken","WAWebGraphQLServerError","WAWebNetworkStatus","WAWebRelayClient"],(function(a,b,c,d,e,f,g){var h,i;function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["addProductWithToken: failed with error"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(['addProduct: failed as "','"']);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["addProduct: success"]);l=function(){return a};return a}var m={type:"error"},n=h!==void 0?h:h=b("WAWebBizCatalogManagementAddProductMutation.graphql");function a(a){return!d("WAWebBizGatingUtils").graphQLForAddProductEnabled()?(i||(i=b("Promise"))).resolve({type:"not-enabled"}):o(a).then(function(a){if(a.type==="success"){d("WALogger").LOG(l());return a}a.type;d("WALogger").LOG(k(),a.type);return a})}function o(a){return d("WAWebFetchAdAccountToken").fetchToken().then(function(b){if(b.type==="success")return p(b.token,a).then(function(a){a.type!=="success"?a.type==="auth-failure"?d("WAWebFetchAdAccountToken").markTokenAsInvalid():a.type:a.type;return a});b.type;return b})}function p(a,b){var e;return c("WAWebNetworkStatus").waitIfOffline().then(function(){return d("WAWebRelayClient").commitMutation(n,{input:b},{environmentType:"facebook",accessToken:a,getInlineDataReader:function(a){e=a}})}).then(function(a){if(a==null)return m;a=(a=a.xfb_whatsapp_catalog_add_product)==null?void 0:a.product;if(a==null)return m;a=d("WAWebBizCatalogManagementParseProductGraphql").parseProductGraphQL(e(d("WAWebBizCatalogManagementParseProductGraphql").PARSE_PRODUCT_FRAGMENT,a));return{type:"success",productResult:a}})["catch"](function(a){d("WALogger").LOG(j()).devConsole(a);if(d("WAWebFetchAdAccountToken").hasGraphQLAuthError(a))return{type:"auth-failure"};return a instanceof d("WAWebGraphQLServerError").GraphQLServerError?{type:"graphql-error",error:a}:m})}g.addProduct=a}),98); __d("WAWebCommonParsersCustomErrors",["WADeprecatedWapParser"],(function(a,b,c,d,e,f,g){a=new(c("WADeprecatedWapParser"))("parseErrorFields",function(a){var b=[];a.forEachChildWithTag("field",function(a){var c=a.hasAttr("detail")?a.maybeAttrString("detail"):null;b.push({name:a.attrString("name"),reason:a.attrString("reason"),detail:c})});return b});g.parseErrorFields=a}),98); __d("WAWebBizCatalogAddProductJob",["WADeprecatedSendIq","WADeprecatedWapParser","WAWap","WAWebBackendErrors","WAWebBizCatalogManagementAddProduct","WAWebBizCatalogManagementParseProductGraphql","WAWebBizCatalogParseProduct","WAWebBizGatingUtils","WAWebCommonParsersCustomErrors","WAWebMaybeThrowCatalogErrors","WAWebUserPrefsMeUser","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h=new(c("WADeprecatedWapParser"))("addProductResponse",function(a){a.assertTag("iq");a.assertFromServer();a=a.child("product_catalog_add");a=a.child("product");return d("WAWebBizCatalogParseProduct").parseProductNode(a)});function i(a,b,c){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){var e;a=(e=d("WAWap")).wap("iq",{id:e.generateId(),to:e.S_WHATSAPP_NET,type:"set",xmlns:"w:biz:catalog"},e.wap("product_catalog_add",{v:"1"},d("WAWebBizCatalogParseProduct").productModelToNode(a),e.wap("width",null,b.toString()),e.wap("height",null,c.toString())));b=(yield d("WADeprecatedSendIq").deprecatedSendIqErrorParser(a,h,d("WAWebCommonParsersCustomErrors").parseErrorFields));if(!b.success){if(b.errorCode===451)throw new(d("WAWebBackendErrors").E451)();if(b.customError!=null)throw new(d("WAWebBackendErrors").CatalogEditServerError)(b.errorCode,b.customError);else throw new(d("WAWebBackendErrors").ServerStatusCodeError)(b.errorCode)}else return b.result});return j.apply(this,arguments)}function k(a,b,c){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e){var f=d("WAWebUserPrefsMeUser").getMaybeMeUser();if(f==null)throw c("err")("addProductGraphQL: meUser is null");f=(yield d("WAWebBizCatalogManagementAddProduct").addProduct({product:{biz_jid:f.toJid(),width:b,height:e,product_info:d("WAWebBizCatalogManagementParseProductGraphql").productModelToGraphQLInput(a)}}));if(f.type==="success")return f.productResult;else if(f.type==="graphql-error")d("WAWebMaybeThrowCatalogErrors").maybeThrowLocalErrorForCatalogQuery(f.error);else if(f.type==="recovery-required")return i(a,b,e);else f.type;throw c("err")("addProductGraphQL: error handling flow not implemented for "+JSON.stringify(f))});return l.apply(this,arguments)}function a(a,b,c){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){if(d("WAWebBizGatingUtils").commerceFeaturesDisabledBySanctions())throw new(d("WAWebBackendErrors").E451)();return d("WAWebBizGatingUtils").graphQLForAddProductEnabled()?k(a,b,c):i(a,b,c)});return m.apply(this,arguments)}g.addProductResponse=h;g.addProductMD=a}),98); __d("WAWebBizCatalogManagementAppealProductMutation_facebookRelayOperation",[],(function(a,b,c,d,e,f){e.exports="29276343172013990"}),null); __d("WAWebBizCatalogManagementAppealProductMutation.graphql",["WAWebBizCatalogManagementAppealProductMutation_facebookRelayOperation"],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"input"}],c=[{alias:null,args:[{kind:"Variable",name:"request",variableName:"input"}],concreteType:"XFBWhatsAppCatalogAppealProductResponse",kind:"LinkedField",name:"xfb_whatsapp_catalog_appeal_product",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"success",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"WAWebBizCatalogManagementAppealProductMutation",selections:c,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"WAWebBizCatalogManagementAppealProductMutation",selections:c},params:{id:b("WAWebBizCatalogManagementAppealProductMutation_facebookRelayOperation"),metadata:{},name:"WAWebBizCatalogManagementAppealProductMutation",operationKind:"mutation",text:null}}}();e.exports=a}),null); __d("WAWebBizCatalogManagementAppealProduct",["Promise","WALogger","WAWebBizCatalogManagementAppealProductMutation.graphql","WAWebBizGatingUtils","WAWebFetchAdAccountToken","WAWebGraphQLServerError","WAWebNetworkStatus","WAWebRelayClient"],(function(a,b,c,d,e,f,g){var h,i;function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["appealProductWithToken: failed with error"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(['appealProduct: failed as "','"']);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["appealProduct: success"]);l=function(){return a};return a}var m={type:"error"},n=h!==void 0?h:h=b("WAWebBizCatalogManagementAppealProductMutation.graphql");function a(a){return!d("WAWebBizGatingUtils").graphQLForAppealProductEnabled()?(i||(i=b("Promise"))).resolve({type:"not-enabled"}):o(a).then(function(a){if(a.type==="success"){d("WALogger").LOG(l());return a}a.type;d("WALogger").LOG(k(),a.type);return a})}function o(a){return d("WAWebFetchAdAccountToken").fetchToken().then(function(b){if(b.type==="success")return p(b.token,a).then(function(a){a.type!=="success"?a.type==="auth-failure"?d("WAWebFetchAdAccountToken").markTokenAsInvalid():a.type:a.type;return a});b.type;return b})}function p(a,b){return c("WAWebNetworkStatus").waitIfOffline().then(function(){return d("WAWebRelayClient").commitMutation(n,{input:b},{environmentType:"facebook",accessToken:a})}).then(function(a){if(a==null)return m;a=a.xfb_whatsapp_catalog_appeal_product;return(a==null?void 0:a.success)==null?m:{type:"success",result:a.success}})["catch"](function(a){d("WALogger").LOG(j()).devConsole(a);if(d("WAWebFetchAdAccountToken").hasGraphQLAuthError(a))return{type:"auth-failure"};return a instanceof d("WAWebGraphQLServerError").GraphQLServerError?{type:"graphql-error",error:a}:m})}g.appealProduct=a}),98); __d("WAWebBizCatalogAppealProductJob",["WADeprecatedSendIq","WADeprecatedWapParser","WAWap","WAWebBackendErrors","WAWebBizCatalogManagementAppealProduct","WAWebBizGatingUtils","WAWebMaybeThrowCatalogErrors","WAWebUserPrefsMeUser","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h=new(c("WADeprecatedWapParser"))("appealProductResponse",function(a){a.assertTag("iq");a.assertFromServer();a=a.child("response");a=a.child("success");return a.contentString()==="true"});function i(a,b){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c;b=(c=d("WAWap")).wap("iq",{id:c.generateId(),to:c.S_WHATSAPP_NET,type:"set",xmlns:"fb:thrift_iq"},c.wap("request",{type:"appeal_product"},c.wap("reason",null,b),c.wap("id",null,a)));c=(yield d("WADeprecatedSendIq").deprecatedSendIq(b,h));if(!c.success){if(c.errorCode===451)throw new(d("WAWebBackendErrors").E451)();throw new(d("WAWebBackendErrors").ServerStatusCodeError)(c.errorCode)}else return c.result});return j.apply(this,arguments)}function k(a,b){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e=d("WAWebUserPrefsMeUser").getMaybeMeUser();if(e==null)throw c("err")("appealProductGraphQL: meUser is null");e=(yield d("WAWebBizCatalogManagementAppealProduct").appealProduct({jid:e.toJid(),product_id:a,reason:b}));if(e.type==="success")return e.result;else if(e.type==="graphql-error")d("WAWebMaybeThrowCatalogErrors").maybeThrowLocalErrorForCatalogQuery(e.error);else if(e.type==="recovery-required")return i(a,b);else e.type;throw c("err")("appealProductGraphQL: error handling flow not implemented for "+JSON.stringify(e))});return l.apply(this,arguments)}function a(a,b){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if(d("WAWebBizGatingUtils").commerceFeaturesDisabledBySanctions())throw new(d("WAWebBackendErrors").E451)();return d("WAWebBizGatingUtils").graphQLForAppealProductEnabled()?k(a,b):i(a,b)});return m.apply(this,arguments)}g.appealProductMD=a}),98); __d("WAWebBizCatalogManagementDeleteProductMutation_facebookRelayOperation",[],(function(a,b,c,d,e,f){e.exports="9376108569185474"}),null); __d("WAWebBizCatalogManagementDeleteProductMutation.graphql",["WAWebBizCatalogManagementDeleteProductMutation_facebookRelayOperation"],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"input"}],c=[{alias:null,args:[{kind:"Variable",name:"request",variableName:"input"}],concreteType:"XFBWhatsAppCatalogDeleteProductResponse",kind:"LinkedField",name:"xfb_whatsapp_catalog_delete_product",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"deleted_count",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"WAWebBizCatalogManagementDeleteProductMutation",selections:c,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"WAWebBizCatalogManagementDeleteProductMutation",selections:c},params:{id:b("WAWebBizCatalogManagementDeleteProductMutation_facebookRelayOperation"),metadata:{},name:"WAWebBizCatalogManagementDeleteProductMutation",operationKind:"mutation",text:null}}}();e.exports=a}),null); __d("WAWebBizCatalogManagementDeleteProduct",["Promise","WALogger","WAWebBizCatalogManagementDeleteProductMutation.graphql","WAWebBizGatingUtils","WAWebFetchAdAccountToken","WAWebGraphQLServerError","WAWebNetworkStatus","WAWebRelayClient"],(function(a,b,c,d,e,f,g){var h,i;function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["deleteProductWithToken: failed with error"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(['deleteProduct: failed as "','"']);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["deleteProduct: success"]);l=function(){return a};return a}var m={type:"error"},n=h!==void 0?h:h=b("WAWebBizCatalogManagementDeleteProductMutation.graphql");function a(a){return!d("WAWebBizGatingUtils").graphQLForDeleteProductEnabled()?(i||(i=b("Promise"))).resolve({type:"not-enabled"}):o(a).then(function(a){if(a.type==="success"){d("WALogger").LOG(l());return a}a.type;d("WALogger").LOG(k(),a.type);return a})}function o(a){return d("WAWebFetchAdAccountToken").fetchToken().then(function(b){if(b.type==="success")return p(b.token,a).then(function(a){a.type!=="success"?a.type==="auth-failure"?d("WAWebFetchAdAccountToken").markTokenAsInvalid():a.type:a.type;return a});b.type;return b})}function p(a,b){return c("WAWebNetworkStatus").waitIfOffline().then(function(){return d("WAWebRelayClient").commitMutation(n,{input:b},{environmentType:"facebook",accessToken:a})}).then(function(a){if(a==null)return m;a=(a=a.xfb_whatsapp_catalog_delete_product)==null?void 0:a.deleted_count;return a==null?m:{type:"success",deleteResult:{deletedCount:a}}})["catch"](function(a){d("WALogger").LOG(j()).devConsole(a);if(d("WAWebFetchAdAccountToken").hasGraphQLAuthError(a))return{type:"auth-failure"};return a instanceof d("WAWebGraphQLServerError").GraphQLServerError?{type:"graphql-error",error:a}:m})}g.deleteProduct=a}),98); __d("WAWebBizCatalogDeleteProductsJob",["WADeprecatedSendIq","WADeprecatedWapParser","WAWap","WAWebBackendErrors","WAWebBizCatalogManagementDeleteProduct","WAWebBizGatingUtils","WAWebMaybeThrowCatalogErrors","WAWebUserPrefsMeUser","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h=new(c("WADeprecatedWapParser"))("productDeleteResponse",function(a){a.assertTag("iq");a.assertFromServer();a=a.child("product_catalog_delete");a=a.attrInt("deleted_count");return{deletedCount:a}});function i(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b;b=(b=d("WAWap")).wap("iq",{id:b.generateId(),to:b.S_WHATSAPP_NET,type:"set",xmlns:"w:biz:catalog"},b.wap("product_catalog_delete",{v:"1"},a.map(function(a){return d("WAWap").wap("product",null,d("WAWap").wap("id",null,a))})));a=(yield d("WADeprecatedSendIq").deprecatedSendIq(b,h));if(!a.success){if(a.errorCode===451)throw new(d("WAWebBackendErrors").E451)();throw new(d("WAWebBackendErrors").ServerStatusCodeError)(a.errorCode)}else return a.result});return j.apply(this,arguments)}function k(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=d("WAWebUserPrefsMeUser").getMaybeMeUser();if(b==null)throw c("err")("deleteProductsGraphQL: meUser is null");b=(yield d("WAWebBizCatalogManagementDeleteProduct").deleteProduct({biz_jid:b.toJid(),product_ids:a}));if(b.type==="success")return b.deleteResult;else if(b.type==="graphql-error")d("WAWebMaybeThrowCatalogErrors").maybeThrowLocalErrorForCatalogQuery(b.error);else if(b.type==="recovery-required")return i(a);else b.type;throw c("err")("deleteProductsGraphQL: error handling flow not implemented for "+JSON.stringify(b))});return l.apply(this,arguments)}function a(a){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(d("WAWebBizGatingUtils").commerceFeaturesDisabledBySanctions())throw new(d("WAWebBackendErrors").E451)();return d("WAWebBizGatingUtils").graphQLForDeleteProductEnabled()?k(a):i(a)});return m.apply(this,arguments)}g.deleteProductsMD=a}),98); __d("WAWebBizCatalogManagementEditProductMutation_facebookRelayOperation",[],(function(a,b,c,d,e,f){e.exports="9889773371084956"}),null); __d("WAWebBizCatalogManagementEditProductMutation.graphql",["WAWebBizCatalogManagementEditProductMutation_facebookRelayOperation"],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"input"}],c=[{kind:"Variable",name:"request",variableName:"input"}],d={alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},e={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},f={alias:null,args:null,kind:"ScalarField",name:"original_image_url",storageKey:null},g={alias:null,args:null,kind:"ScalarField",name:"request_image_url",storageKey:null},h={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"price",storageKey:null},j={alias:null,args:null,kind:"ScalarField",name:"status",storageKey:null},k={alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null},l=[h,k];i=[{alias:null,args:null,kind:"ScalarField",name:"availability",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:"XFBWhatsAppCatalogProductComplianceInfo",kind:"LinkedField",name:"compliance_info",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"country_code_origin",storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductComplianceInfoImporterAddress",kind:"LinkedField",name:"importer_address",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"city",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"country_code",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"postal_code",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"region",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"street1",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"street2",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"importer_name",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"currency",storageKey:null},d,e,{alias:null,args:null,kind:"ScalarField",name:"is_hidden",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"is_sanctioned",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"max_available",storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductMedia",kind:"LinkedField",name:"media",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductMediaImage",kind:"LinkedField",name:"images",plural:!0,selections:[e,f,g],storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductMediaVideo",kind:"LinkedField",name:"videos",plural:!0,selections:[e,{alias:null,args:null,kind:"ScalarField",name:"original_video_url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"thumbnail_url",storageKey:null}],storageKey:null}],storageKey:null},h,i,{alias:null,args:null,kind:"ScalarField",name:"retailer_id",storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductSalePrice",kind:"LinkedField",name:"sale_price",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"end_date",storageKey:null},i,{alias:null,args:null,kind:"ScalarField",name:"start_date",storageKey:null}],storageKey:null},j,{alias:null,args:null,concreteType:"XFBWhatsAppCatalogStatusInfo",kind:"LinkedField",name:"status_info",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"can_appeal",storageKey:null},j],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"shimmed_url",storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductVariantInfo",kind:"LinkedField",name:"variant_info",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantListingDetails",kind:"LinkedField",name:"listing_details",plural:!1,selections:[d,{alias:null,args:null,kind:"ScalarField",name:"multi_price",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"lowest_price",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantAvailability",kind:"LinkedField",name:"availability",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantAvailabilityListing",kind:"LinkedField",name:"listing",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"is_available",storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantAvailabilityListingOption",kind:"LinkedField",name:"options",plural:!0,selections:l,storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"product_id",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantTypes",kind:"LinkedField",name:"types",plural:!0,selections:[h,{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantTypeOption",kind:"LinkedField",name:"options",plural:!0,selections:[k,{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductMediaImage",kind:"LinkedField",name:"thumbnail_media",plural:!1,selections:[e,{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductMediaImageOriginalDimensions",kind:"LinkedField",name:"original_dimensions",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"height",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"width",storageKey:null}],storageKey:null},f,g],storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantProperties",kind:"LinkedField",name:"variant_properties",plural:!0,selections:l,storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"WAWebBizCatalogManagementEditProductMutation",selections:[{alias:null,args:c,concreteType:"XFBWhatsAppCatalogProductMutationResponse",kind:"LinkedField",name:"xfb_whatsapp_catalog_edit_product",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductInfo",kind:"LinkedField",name:"product",plural:!1,selections:[{kind:"InlineDataFragmentSpread",name:"WAWebBizCatalogManagementParseProductGraphql_product",selections:i,args:null,argumentDefinitions:[]}],storageKey:null}],storageKey:null}],type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"WAWebBizCatalogManagementEditProductMutation",selections:[{alias:null,args:c,concreteType:"XFBWhatsAppCatalogProductMutationResponse",kind:"LinkedField",name:"xfb_whatsapp_catalog_edit_product",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductInfo",kind:"LinkedField",name:"product",plural:!1,selections:i,storageKey:null}],storageKey:null}]},params:{id:b("WAWebBizCatalogManagementEditProductMutation_facebookRelayOperation"),metadata:{},name:"WAWebBizCatalogManagementEditProductMutation",operationKind:"mutation",text:null}}}();e.exports=a}),null); __d("WAWebBizCatalogManagementEditProduct",["Promise","WALogger","WAWebBizCatalogManagementEditProductMutation.graphql","WAWebBizCatalogManagementParseProductGraphql","WAWebBizGatingUtils","WAWebFetchAdAccountToken","WAWebGraphQLServerError","WAWebNetworkStatus","WAWebRelayClient"],(function(a,b,c,d,e,f,g){var h,i;function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["editProductWithToken: failed with error"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(['editProduct: failed as "','"']);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["editProduct: success"]);l=function(){return a};return a}var m={type:"error"},n=h!==void 0?h:h=b("WAWebBizCatalogManagementEditProductMutation.graphql");function a(a){return!d("WAWebBizGatingUtils").graphQLForEditProductEnabled()?(i||(i=b("Promise"))).resolve({type:"not-enabled"}):o(a).then(function(a){if(a.type==="success"){d("WALogger").LOG(l());return a}a.type;d("WALogger").LOG(k(),a.type);return a})}function o(a){return d("WAWebFetchAdAccountToken").fetchToken().then(function(b){if(b.type==="success")return p(b.token,a).then(function(a){a.type!=="success"?a.type==="auth-failure"?d("WAWebFetchAdAccountToken").markTokenAsInvalid():a.type:a.type;return a});b.type;return b})}function p(a,b){var e;return c("WAWebNetworkStatus").waitIfOffline().then(function(){return d("WAWebRelayClient").commitMutation(n,{input:b},{environmentType:"facebook",accessToken:a,getInlineDataReader:function(a){e=a}})}).then(function(a){if(a==null)return m;a=(a=a.xfb_whatsapp_catalog_edit_product)==null?void 0:a.product;if(a==null)return m;a=d("WAWebBizCatalogManagementParseProductGraphql").parseProductGraphQL(e(d("WAWebBizCatalogManagementParseProductGraphql").PARSE_PRODUCT_FRAGMENT,a));return{type:"success",productResult:a}})["catch"](function(a){d("WALogger").LOG(j()).devConsole(a);if(d("WAWebFetchAdAccountToken").hasGraphQLAuthError(a))return{type:"auth-failure"};return a instanceof d("WAWebGraphQLServerError").GraphQLServerError?{type:"graphql-error",error:a}:m})}g.editProduct=a}),98); __d("WAWebBizCatalogEditProductJob",["WADeprecatedSendIq","WADeprecatedWapParser","WAWap","WAWebBackendErrors","WAWebBizCatalogManagementEditProduct","WAWebBizCatalogManagementParseProductGraphql","WAWebBizCatalogParseProduct","WAWebBizGatingUtils","WAWebCommonParsersCustomErrors","WAWebMaybeThrowCatalogErrors","WAWebUserPrefsMeUser","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h=new(c("WADeprecatedWapParser"))("editProductResponse",function(a){a.assertTag("iq");a.assertFromServer();a=a.child("product_catalog_edit");a=a.child("product");return d("WAWebBizCatalogParseProduct").parseProductNode(a)});function i(a,b,c){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){var e;a=(e=d("WAWap")).wap("iq",{id:e.generateId(),to:e.S_WHATSAPP_NET,type:"set",xmlns:"w:biz:catalog"},e.wap("product_catalog_edit",{v:"1"},d("WAWebBizCatalogParseProduct").productModelToNode(a),e.wap("width",null,b.toString()),e.wap("height",null,c.toString())));b=(yield d("WADeprecatedSendIq").deprecatedSendIqErrorParser(a,h,d("WAWebCommonParsersCustomErrors").parseErrorFields));if(!b.success){if(b.errorCode===451)throw new(d("WAWebBackendErrors").E451)();if(b.customError)throw new(d("WAWebBackendErrors").CatalogEditServerError)(b.errorCode,b.customError);else throw new(d("WAWebBackendErrors").ServerStatusCodeError)(b.errorCode)}else return b.result});return j.apply(this,arguments)}function k(a,b,c){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e){var f=d("WAWebUserPrefsMeUser").getMaybeMeUser();if(f==null)throw c("err")("editProductGraphQL: meUser is null");f=(yield d("WAWebBizCatalogManagementEditProduct").editProduct({product:{biz_jid:f.toJid(),product_id:a.id.toString(),width:b,height:e,product_info:d("WAWebBizCatalogManagementParseProductGraphql").productModelToGraphQLInput(a)}}));if(f.type==="success")return f.productResult;else if(f.type==="graphql-error")d("WAWebMaybeThrowCatalogErrors").maybeThrowLocalErrorForCatalogQuery(f.error);else if(f.type==="recovery-required")return i(a,b,e);else f.type;throw c("err")("editProductGraphQL: error handling flow not implemented for "+JSON.stringify(f))});return l.apply(this,arguments)}function a(a,b,c){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){if(d("WAWebBizGatingUtils").commerceFeaturesDisabledBySanctions())throw new(d("WAWebBackendErrors").E451)();return d("WAWebBizGatingUtils").graphQLForEditProductEnabled()?k(a,b,c):i(a,b,c)});return m.apply(this,arguments)}g["default"]=a}),98); __d("WAWebBizCatalogManagementUpdateProductVisibilityMutation_facebookRelayOperation",[],(function(a,b,c,d,e,f){e.exports="9665162096898581"}),null); __d("WAWebBizCatalogManagementUpdateProductVisibilityMutation.graphql",["WAWebBizCatalogManagementUpdateProductVisibilityMutation_facebookRelayOperation"],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"input"}],c=[{alias:null,args:[{kind:"Variable",name:"request",variableName:"input"}],concreteType:"XFBWhatsAppCatalogProductVisibilityUpdateResponse",kind:"LinkedField",name:"xfb_whatsapp_catalog_product_visibility_update",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"success",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"WAWebBizCatalogManagementUpdateProductVisibilityMutation",selections:c,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"WAWebBizCatalogManagementUpdateProductVisibilityMutation",selections:c},params:{id:b("WAWebBizCatalogManagementUpdateProductVisibilityMutation_facebookRelayOperation"),metadata:{},name:"WAWebBizCatalogManagementUpdateProductVisibilityMutation",operationKind:"mutation",text:null}}}();e.exports=a}),null); __d("WAWebBizCatalogManagementUpdateProductVisibility",["Promise","WALogger","WAWebBizCatalogManagementUpdateProductVisibilityMutation.graphql","WAWebBizGatingUtils","WAWebFetchAdAccountToken","WAWebGraphQLServerError","WAWebNetworkStatus","WAWebRelayClient"],(function(a,b,c,d,e,f,g){var h,i;function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["updateProductVisibilityWithToken: failed with error"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(['updateProductVisibility: failed as "','"']);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["updateProductVisibility: success"]);l=function(){return a};return a}var m={type:"error"},n=h!==void 0?h:h=b("WAWebBizCatalogManagementUpdateProductVisibilityMutation.graphql");function a(a){return!d("WAWebBizGatingUtils").graphQLForUpdateProductVisibilityEnabled()?(i||(i=b("Promise"))).resolve({type:"not-enabled"}):o(a).then(function(a){if(a.type==="success"){d("WALogger").LOG(l());return a}a.type;d("WALogger").LOG(k(),a.type);return a})}function o(a){return d("WAWebFetchAdAccountToken").fetchToken().then(function(b){if(b.type==="success")return p(b.token,a).then(function(a){a.type!=="success"?a.type==="auth-failure"?d("WAWebFetchAdAccountToken").markTokenAsInvalid():a.type:a.type;return a});b.type;return b})}function p(a,b){return c("WAWebNetworkStatus").waitIfOffline().then(function(){return d("WAWebRelayClient").commitMutation(n,{input:b},{environmentType:"facebook",accessToken:a})}).then(function(a){if(a==null)return m;a=a.xfb_whatsapp_catalog_product_visibility_update;if(a==null)return m;return(a==null?void 0:a.success)==null?m:{type:"success",result:a.success}})["catch"](function(a){d("WALogger").LOG(j()).devConsole(a);if(d("WAWebFetchAdAccountToken").hasGraphQLAuthError(a))return{type:"auth-failure"};return a instanceof d("WAWebGraphQLServerError").GraphQLServerError?{type:"graphql-error",error:a}:m})}g.updateProductVisibility=a}),98); __d("WAWebBizCatalogProductVisibilitySetJob",["WADeprecatedSendIq","WADeprecatedWapParser","WAWap","WAWapDeprecatedSmaxID","WAWebBackendErrors","WAWebBizCatalogManagementUpdateProductVisibility","WAWebBizGatingUtils","WAWebMaybeThrowCatalogErrors","WAWebUserPrefsMeUser","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h=new(c("WADeprecatedWapParser"))("visibilitySetResponse",function(a){a.assertTag("iq"),a.assertFromServer()});function i(a,b){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e;e=(e=d("WAWap")).wap("iq",{to:e.S_WHATSAPP_NET,type:"set",xmlns:"w:biz:catalog",smax_id:e.SMAX_ID(c("WAWapDeprecatedSmaxID").SetCatalogVisibility),id:e.generateId()},e.wap("product_visibility_update",{v:"1"},e.wap("product",{is_hidden:b?"true":"false"},d("WAWap").wap("id",null,a))));b=(yield d("WADeprecatedSendIq").deprecatedSendIq(e,h));if(!b.success){if(b.errorCode===451)throw new(d("WAWebBackendErrors").E451)();throw new(d("WAWebBackendErrors").ServerStatusCodeError)(b.errorCode)}else return b.result});return j.apply(this,arguments)}function k(a){throw c("err")("updateProductVisibilityGraphQL: error handling flow not implemented for "+JSON.stringify(a))}function l(a,b){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e=d("WAWebUserPrefsMeUser").getMaybeMeUser();if(e==null)throw c("err")("updateProductVisibilityGraphQL: meUser is null");e=(yield d("WAWebBizCatalogManagementUpdateProductVisibility").updateProductVisibility({jid:e.toJid(),products:[{product_id:a,is_hidden:b}]}));if(e.type==="success"){if(e.result===!0)return;return k(e)}else if(e.type==="graphql-error")d("WAWebMaybeThrowCatalogErrors").maybeThrowLocalErrorForCatalogQuery(e.error);else if(e.type==="recovery-required")return i(a,b);else{e.type;return k(e)}});return m.apply(this,arguments)}function a(a,b){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if(d("WAWebBizGatingUtils").commerceFeaturesDisabledBySanctions())throw new(d("WAWebBackendErrors").E451)();return d("WAWebBizGatingUtils").graphQLForUpdateProductVisibilityEnabled()?l(a,b):i(a,b)});return n.apply(this,arguments)}g["default"]=a}),98); __d("WAWebBizCatalogManagementCreateCatalogMutation_facebookRelayOperation",[],(function(a,b,c,d,e,f){e.exports="29232780583035464"}),null); __d("WAWebBizCatalogManagementCreateCatalogMutation.graphql",["WAWebBizCatalogManagementCreateCatalogMutation_facebookRelayOperation"],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"input"}],c=[{alias:null,args:[{kind:"Variable",name:"request",variableName:"input"}],concreteType:"XFBWhatsAppCatalogCreateResponse",kind:"LinkedField",name:"xfb_whatsapp_catalog_create",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"success",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"WAWebBizCatalogManagementCreateCatalogMutation",selections:c,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"WAWebBizCatalogManagementCreateCatalogMutation",selections:c},params:{id:b("WAWebBizCatalogManagementCreateCatalogMutation_facebookRelayOperation"),metadata:{},name:"WAWebBizCatalogManagementCreateCatalogMutation",operationKind:"mutation",text:null}}}();e.exports=a}),null); __d("WAWebBizCatalogManagementCreateCatalog",["Promise","WALogger","WAWebBizCatalogManagementCreateCatalogMutation.graphql","WAWebBizGatingUtils","WAWebFetchAdAccountToken","WAWebGraphQLServerError","WAWebNetworkStatus","WAWebRelayClient"],(function(a,b,c,d,e,f,g){var h,i;function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["createCatalogWithToken: failed with error"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(['createCatalog: failed as "','"']);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["createCatalog: success"]);l=function(){return a};return a}var m={type:"error"},n=h!==void 0?h:h=b("WAWebBizCatalogManagementCreateCatalogMutation.graphql");function a(a){return!d("WAWebBizGatingUtils").graphQLForCreateProductCatalogEnabled()?(i||(i=b("Promise"))).resolve({type:"not-enabled"}):o(a).then(function(a){if(a.type==="success"){d("WALogger").LOG(l());return a}a.type;d("WALogger").LOG(k(),a.type);return a})}function o(a){return d("WAWebFetchAdAccountToken").fetchToken().then(function(b){if(b.type==="success")return p(b.token,a).then(function(a){a.type!=="success"?a.type==="auth-failure"?d("WAWebFetchAdAccountToken").markTokenAsInvalid():a.type:a.type;return a});b.type;return b})}function p(a,b){return c("WAWebNetworkStatus").waitIfOffline().then(function(){return d("WAWebRelayClient").commitMutation(n,{input:b},{environmentType:"facebook",accessToken:a})}).then(function(a){if(a==null)return m;a=(a=a.xfb_whatsapp_catalog_create)==null?void 0:a.success;return a==null?m:{type:"success",createResult:a}})["catch"](function(a){d("WALogger").LOG(j()).devConsole(a);if(d("WAWebFetchAdAccountToken").hasGraphQLAuthError(a))return{type:"auth-failure"};return a instanceof d("WAWebGraphQLServerError").GraphQLServerError?{type:"graphql-error",error:a}:m})}g.createCatalog=a}),98); __d("WAWebBizCreateProductCatalogJob",["WADeprecatedSendIq","WADeprecatedWapParser","WALogger","WAWap","WAWebBackendErrors","WAWebBizCatalogManagementCreateCatalog","WAWebBizGatingUtils","WAWebMaybeThrowCatalogErrors","WAWebUserPrefsMeUser","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["createProductCatalogGraphQL: error handling flow not implemented for ",""]);h=function(){return a};return a}var i=new(c("WADeprecatedWapParser"))("productCatalogCreateResponse",function(a){a.assertTag("iq"),a.assertFromServer(),a.child("product_catalog_create")});function j(){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a;a=(a=d("WAWap")).wap("iq",{id:a.generateId(),to:a.S_WHATSAPP_NET,type:"set",xmlns:"w:biz:catalog"},a.wap("product_catalog_create",{version:"1"}));a=(yield d("WADeprecatedSendIq").deprecatedSendIq(a,i));if(!a.success){if(a.errorCode===451)throw new(d("WAWebBackendErrors").E451)();throw new(d("WAWebBackendErrors").ServerStatusCodeError)(a.errorCode)}else return a.result});return k.apply(this,arguments)}function l(){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=d("WAWebUserPrefsMeUser").getMaybeMeUser();if(a==null)throw c("err")("createProductCatalogGraphQL: meUser is null");a=(yield d("WAWebBizCatalogManagementCreateCatalog").createCatalog({product_catalog:{biz_jid:a.toJid()},platform:"WEB"}));if(a.type==="success")return;else a.type==="graphql-error"?d("WAWebMaybeThrowCatalogErrors").maybeThrowLocalErrorForCatalogQuery(a.error):a.type;d("WALogger").WARN(h(),JSON.stringify(a));return j()});return m.apply(this,arguments)}function a(){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(d("WAWebBizGatingUtils").commerceFeaturesDisabledBySanctions())throw new(d("WAWebBackendErrors").E451)();return d("WAWebBizGatingUtils").graphQLForCreateProductCatalogEnabled()?l():j()});return n.apply(this,arguments)}g.productCatalogCreateResponse=i;g.createProductCatalog=a}),98); __d("WAWebBizCatalogManagementFetchCatalogQuery_facebookRelayOperation",[],(function(a,b,c,d,e,f){e.exports="9554921834556641"}),null); __d("WAWebBizCatalogManagementFetchCatalogQuery.graphql",["WAWebBizCatalogManagementFetchCatalogQuery_facebookRelayOperation"],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"request"}],c=[{kind:"Variable",name:"request",variableName:"request"}],d={alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},e={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},f={alias:null,args:null,kind:"ScalarField",name:"original_image_url",storageKey:null},g={alias:null,args:null,kind:"ScalarField",name:"request_image_url",storageKey:null},h={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"price",storageKey:null},j={alias:null,args:null,kind:"ScalarField",name:"status",storageKey:null},k={alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null},l=[h,k];i=[{alias:null,args:null,kind:"ScalarField",name:"availability",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:"XFBWhatsAppCatalogProductComplianceInfo",kind:"LinkedField",name:"compliance_info",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"country_code_origin",storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductComplianceInfoImporterAddress",kind:"LinkedField",name:"importer_address",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"city",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"country_code",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"postal_code",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"region",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"street1",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"street2",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"importer_name",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"currency",storageKey:null},d,e,{alias:null,args:null,kind:"ScalarField",name:"is_hidden",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"is_sanctioned",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"max_available",storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductMedia",kind:"LinkedField",name:"media",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductMediaImage",kind:"LinkedField",name:"images",plural:!0,selections:[e,f,g],storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductMediaVideo",kind:"LinkedField",name:"videos",plural:!0,selections:[e,{alias:null,args:null,kind:"ScalarField",name:"original_video_url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"thumbnail_url",storageKey:null}],storageKey:null}],storageKey:null},h,i,{alias:null,args:null,kind:"ScalarField",name:"retailer_id",storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductSalePrice",kind:"LinkedField",name:"sale_price",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"end_date",storageKey:null},i,{alias:null,args:null,kind:"ScalarField",name:"start_date",storageKey:null}],storageKey:null},j,{alias:null,args:null,concreteType:"XFBWhatsAppCatalogStatusInfo",kind:"LinkedField",name:"status_info",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"can_appeal",storageKey:null},j],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"shimmed_url",storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductVariantInfo",kind:"LinkedField",name:"variant_info",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantListingDetails",kind:"LinkedField",name:"listing_details",plural:!1,selections:[d,{alias:null,args:null,kind:"ScalarField",name:"multi_price",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"lowest_price",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantAvailability",kind:"LinkedField",name:"availability",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantAvailabilityListing",kind:"LinkedField",name:"listing",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"is_available",storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantAvailabilityListingOption",kind:"LinkedField",name:"options",plural:!0,selections:l,storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"product_id",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantTypes",kind:"LinkedField",name:"types",plural:!0,selections:[h,{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantTypeOption",kind:"LinkedField",name:"options",plural:!0,selections:[k,{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductMediaImage",kind:"LinkedField",name:"thumbnail_media",plural:!1,selections:[e,{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductMediaImageOriginalDimensions",kind:"LinkedField",name:"original_dimensions",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"height",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"width",storageKey:null}],storageKey:null},f,g],storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantProperties",kind:"LinkedField",name:"variant_properties",plural:!0,selections:l,storageKey:null}],storageKey:null}];j={alias:null,args:null,concreteType:"XFBWhatsAppCatalogPagingInfo",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};return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"WAWebBizCatalogManagementFetchCatalogQuery",selections:[{alias:null,args:c,concreteType:"XFBWhatsAppCatalogGetResponse",kind:"LinkedField",name:"xfb_whatsapp_catalog",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogGetResponseProductCatalog",kind:"LinkedField",name:"product_catalog",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductInfo",kind:"LinkedField",name:"products",plural:!0,selections:[{kind:"InlineDataFragmentSpread",name:"WAWebBizCatalogManagementParseProductGraphql_product",selections:i,args:null,argumentDefinitions:[]}],storageKey:null},j],storageKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"WAWebBizCatalogManagementFetchCatalogQuery",selections:[{alias:null,args:c,concreteType:"XFBWhatsAppCatalogGetResponse",kind:"LinkedField",name:"xfb_whatsapp_catalog",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogGetResponseProductCatalog",kind:"LinkedField",name:"product_catalog",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductInfo",kind:"LinkedField",name:"products",plural:!0,selections:i,storageKey:null},j],storageKey:null}],storageKey:null}]},params:{id:b("WAWebBizCatalogManagementFetchCatalogQuery_facebookRelayOperation"),metadata:{},name:"WAWebBizCatalogManagementFetchCatalogQuery",operationKind:"query",text:null}}}();e.exports=a}),null); __d("WAWebBizCatalogManagementFetchCatalog",["Promise","WALogger","WAWebBizCatalogManagementFetchCatalogQuery.graphql","WAWebBizCatalogManagementParseProductGraphql","WAWebBizGatingUtils","WAWebFetchAdAccountToken","WAWebGraphQLServerError","WAWebNetworkStatus","WAWebRelayClient"],(function(a,b,c,d,e,f,g){var h,i;function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["fetchCatalogWithToken: failed with error"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(['fetchCatalog: failed as "','"']);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["fetchCatalog: success"]);l=function(){return a};return a}var m={type:"error"},n=h!==void 0?h:h=b("WAWebBizCatalogManagementFetchCatalogQuery.graphql");function a(a){return!d("WAWebBizGatingUtils").graphQLForGetProductCatalogEnabled()?(i||(i=b("Promise"))).resolve({type:"not-enabled"}):o(a).then(function(a){if(a.type==="success"){d("WALogger").LOG(l());return a}a.type;d("WALogger").LOG(k(),a.type);return a})}function o(a){return d("WAWebFetchAdAccountToken").fetchToken().then(function(b){if(b.type==="success")return p(b.token,a).then(function(a){a.type!=="success"?a.type==="auth-failure"?d("WAWebFetchAdAccountToken").markTokenAsInvalid():a.type:a.type;return a});b.type;return b})}function p(a,b){var e;return c("WAWebNetworkStatus").waitIfOffline().then(function(){return d("WAWebRelayClient").fetchQuery(n,{request:b},{environmentType:"facebook",accessToken:a,getInlineDataReader:function(a){e=a}})}).then(function(a){var b;if(a==null)return m;a=(a=a.xfb_whatsapp_catalog)==null?void 0:a.product_catalog;if(a==null)return m;var c=a.products;a=a.paging;b=(b=a==null?void 0:a.before)!=null?b:"";a=(a=a==null?void 0:a.after)!=null?a:"";c=c.map(function(a){return e(d("WAWebBizCatalogManagementParseProductGraphql").PARSE_PRODUCT_FRAGMENT,a)}).map(d("WAWebBizCatalogManagementParseProductGraphql").parseProductGraphQL);return{type:"success",catalog:{data:c,paging:{cursors:{before:b,after:a}}}}})["catch"](function(a){d("WALogger").LOG(j()).devConsole(a);if(d("WAWebFetchAdAccountToken").hasGraphQLAuthError(a))return{type:"auth-failure"};return a instanceof d("WAWebGraphQLServerError").GraphQLServerError?{type:"graphql-error",error:a}:m})}g.fetchCatalog=a}),98); __d("WAWebCatalogWapUtils",["WAWap","isStringNullOrEmpty"],(function(a,b,c,d,e,f,g){function a(a){return c("isStringNullOrEmpty")(a)?void 0:d("WAWap").wap("after",null,a)}g.createAfterNode=a}),98); __d("WAWebQueryCatalogQuery.graphql",[],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"request"}],b={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},c={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},d={alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},e={alias:null,args:null,kind:"ScalarField",name:"price",storageKey:null},f={alias:null,args:null,kind:"ScalarField",name:"original_image_url",storageKey:null},g={alias:null,args:null,kind:"ScalarField",name:"request_image_url",storageKey:null},h={alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null},i=[c,h];e=[{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:[b,{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:"is_sanctioned",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"product_availability",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"max_available",storageKey:null},c,d,{alias:null,args:null,kind:"ScalarField",name:"url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"shimmed_url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"currency",storageKey:null},e,{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:[e,{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:[b,f,g],storageKey:null},{alias:null,args:null,concreteType:"XWAProductCatalogProductMediaVideo",kind:"LinkedField",name:"videos",plural:!0,selections:[b,{alias:null,args:null,kind:"ScalarField",name:"original_video_url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"thumbnail_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},{alias:null,args:null,concreteType:"XWACatalogProductVariantInfo",kind:"LinkedField",name:"variant_info",plural:!1,selections:[{alias:null,args:null,concreteType:"XWACatalogVariantListingDetails",kind:"LinkedField",name:"listing_details",plural:!1,selections:[d,{alias:null,args:null,kind:"ScalarField",name:"multi_price",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"lowest_price",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XWACatalogVariantAvailability",kind:"LinkedField",name:"availability",plural:!1,selections:[{alias:null,args:null,concreteType:"XWAVariantAvailabilityListing",kind:"LinkedField",name:"listing",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"is_available",storageKey:null},{alias:null,args:null,concreteType:"XWAVariantAvailabilityListingOption",kind:"LinkedField",name:"options",plural:!0,selections:i,storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"product_id",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XWACatalogVariantTypes",kind:"LinkedField",name:"types",plural:!0,selections:[c,{alias:null,args:null,concreteType:"XWACatalogVariantTypeOption",kind:"LinkedField",name:"options",plural:!0,selections:[h,{alias:null,args:null,concreteType:"XWAProductCatalogProductMediaImage",kind:"LinkedField",name:"thumbnail_media",plural:!1,selections:[b,{alias:null,args:null,concreteType:"XWAProductCatalogProductMediaImageOriginalDimensions",kind:"LinkedField",name:"original_dimensions",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"height",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"width",storageKey:null}],storageKey:null},f,g],storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XWACatalogVariantProperties",kind:"LinkedField",name:"variant_properties",plural:!0,selections:i,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}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"WAWebQueryCatalogQuery",selections:e,type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"WAWebQueryCatalogQuery",selections:e},params:{id:"9628123427275055",metadata:{},name:"WAWebQueryCatalogQuery",operationKind:"query",text:null}}}();e.exports=a}),null); __d("WAWebQueryCatalog",["WADeprecatedSendIq","WADeprecatedWapParser","WALogger","WAWap","WAWebBackendErrors","WAWebBizCatalogManagementFetchCatalog","WAWebBizCatalogParseProduct","WAWebBizGatingUtils","WAWebBizParseProductGraphql","WAWebCatalogEventLogger","WAWebCatalogWapUtils","WAWebCommsWapMd","WAWebGraphQLServerError","WAWebMaybeThrowCatalogErrors","WAWebQueryCatalogQuery.graphql","WAWebRelayClient","WAWebUserPrefsMeUser","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["queryCatalogGraphQLByOwner: error handling flow not implemented for ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["GraphQL: Failed fetching xwa_product_catalog_get_product_catalog query."]);j=function(){return a};return a}var k=new(c("WADeprecatedWapParser"))("catalogResponse",function(a){a.assertTag("iq");a.assertFromServer();a=a.child("product_catalog");var b=[];a.forEachChildWithTag("product",function(a){var c=a.maybeChild("id");if(!c)return;b.push(d("WAWebBizCatalogParseProduct").parseProductNode(a))});a=a.child("paging");var c=a.child("before");c=c.hasContent()?c.contentString():"";a=a.child("after");a=a.hasContent()?a.contentString():"";return{data:b,paging:{cursors:{after:a,before:c}}}});function l(a){return a?"true":"false"}var m=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.catalogWid,c=a.afterCursor,e=a.limit,f=a.width,g=a.height,h=a.checkmarkCollectionId,i=a.allowShopSource;a=a.directConnectionEncryptedInfo;a=a===void 0?null:a;if(d("WAWebBizGatingUtils").commerceFeaturesDisabledBySanctions())throw new(d("WAWebBackendErrors").E451)();c=d("WAWebCatalogWapUtils").createAfterNode(c);h=h!=null?d("WAWap").wap("belongs_to",null,d("WAWap").wap("collection_id",null,h)):void 0;b=d("WAWap").wap("iq",{to:d("WAWap").S_WHATSAPP_NET,type:"get",xmlns:"w:biz:catalog",id:d("WAWap").generateId()},d("WAWap").wap("product_catalog",{jid:d("WAWebCommsWapMd").DEVICE_JID(b),allow_shop_source:l(i)},d("WAWap").wap("limit",null,e.toString()),d("WAWap").wap("width",null,f.toString()),d("WAWap").wap("height",null,g.toString()),c,h,a!=null?d("WAWap").wap("direct_connection_encrypted_info",null,a):null));i=(yield d("WADeprecatedSendIq").deprecatedSendIq(b,k));if(!i.success){if(i.errorCode===451)throw new(d("WAWebBackendErrors").E451)();throw new(d("WAWebBackendErrors").ServerStatusCodeError)(i.errorCode)}else return i.result});return function(b){return a.apply(this,arguments)}}(),n=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(d("WAWebBizGatingUtils").commerceFeaturesDisabledBySanctions())throw new(d("WAWebBackendErrors").E451)();try{var c=a.catalogWid,e=a.afterCursor,f=a.limit,g=a.width,i=a.height,k=a.checkmarkCollectionId,l=a.allowShopSource,m=a.directConnectionEncryptedInfo,n=a.variantInfoFields,o=a.variantThumbnailHeight;a=a.variantThumbnailWidth;c=(yield d("WAWebRelayClient").fetchQuery(h!==void 0?h:h=b("WAWebQueryCatalogQuery.graphql"),{request:{product_catalog:{jid:c.toString(),allow_shop_source:l?"ALLOWSHOPSOURCE_TRUE":"ALLOWSHOPSOURCE_FALSE",width:String(g),height:String(i),direct_connection_encrypted_info:m,limit:String(f),after:e,catalog_session_id:k,variant_info_fields:n,variant_thumbnail_height:o!=null?String(o):null,variant_thumbnail_width:a!=null?String(a):null}}},{eventLogger:d("WAWebCatalogEventLogger").createCatalogEventLogger(d("WAWebCatalogEventLogger").GRAPHQL_CATALOG_ENDPOINT.GET_CATALOG)}));g=c==null?void 0:(l=c.xwa_product_catalog_get_product_catalog)==null?void 0:l.product_catalog;if(g==null)return{data:[],paging:{cursors:{after:"",before:""}}};i=g.paging;m=g.products;return{data:m.map(d("WAWebBizParseProductGraphql").parseProductGraphQL),paging:{cursors:{before:(f=i==null?void 0:i.before)!=null?f:"",after:(e=i==null?void 0:i.after)!=null?e:""}}}}catch(a){a instanceof d("WAWebGraphQLServerError").GraphQLServerError&&d("WAWebMaybeThrowCatalogErrors").maybeThrowLocalErrorForCatalogQuery(a);d("WALogger").WARN(j());throw new(d("WAWebBackendErrors").CatalogUnknownError)()}});return function(b){return a.apply(this,arguments)}}(),o=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.catalogWid,c=a.afterCursor,e=a.limit,f=a.width,g=a.height,h=a.checkmarkCollectionId,j=a.allowShopSource,k=a.directConnectionEncryptedInfo;k=k===void 0?null:k;var l=a.variantInfoFields,m=a.variantThumbnailHeight;a=a.variantThumbnailWidth;if(d("WAWebBizGatingUtils").commerceFeaturesDisabledBySanctions())throw new(d("WAWebBackendErrors").E451)();b=(yield d("WAWebBizCatalogManagementFetchCatalog").fetchCatalog({product_catalog:{jid:b.toJid(),after:c,limit:String(e),width:String(f),height:String(g),belongs_to:{collection_id:h},allow_shop_source:j,direct_connection_encrypted_info:k,variant_info_fields:l,variant_thumbnail_height:m!=null?String(m):null,variant_thumbnail_width:a!=null?String(a):null}}));if(b.type==="success")return b.catalog;else b.type==="graphql-error"?d("WAWebMaybeThrowCatalogErrors").maybeThrowLocalErrorForCatalogQuery(b.error,d("WAWebMaybeThrowCatalogErrors").ErrorSourceForCatalogQuery.GET_PRODUCT_CATALOG_OWNER_GRAPHQL):b.type;if(b.type==="recovery-required"&&d("WAWebBizGatingUtils").catalogTokenRecoveryEnabled())throw new(d("WAWebBackendErrors").AdAccountRecoveryRequiredError)(b.emailMask);if(b.type==="incorrect-nonce"&&d("WAWebBizGatingUtils").catalogTokenRecoveryEnabled())throw new(d("WAWebBackendErrors").CatalogIncorrectNonceError)();d("WALogger").WARN(i(),JSON.stringify(b));throw new(d("WAWebBackendErrors").CatalogUnknownError)()});return function(b){return a.apply(this,arguments)}}();a=function(a){var b=d("WAWebUserPrefsMeUser").getMaybeMeUser();return b!=null&&b.equals(a.catalogWid)?d("WAWebBizGatingUtils").graphQLForGetProductCatalogEnabled()?o(a):m(a):d("WAWebBizGatingUtils").graphQLForCatalogM1Enabled()?n(a):m(a)};e=a;g["default"]=e}),98); __d("WAWebQueryCatalogHasCategoriesQuery.graphql",[],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"request"}],b=[{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}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"WAWebQueryCatalogHasCategoriesQuery",selections:b,type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"WAWebQueryCatalogHasCategoriesQuery",selections:b},params:{id:"9759957480718978",metadata:{},name:"WAWebQueryCatalogHasCategoriesQuery",operationKind:"query",text:null}}}();e.exports=a}),null); __d("WAWebQueryCatalogHasCategories",["errorCode","WALogger","WAWebCatalogEventLogger","WAWebGraphQLServerError","WAWebMaybeThrowCatalogErrors","WAWebQueryCatalogHasCategoriesQuery.graphql","WAWebRelayClient","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g,h){var i;function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["GraphQL: Failed fetching xwa_product_catalog_get_categories query."]);j=function(){return a};return a}a=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=a.catalogWid,e=a.directConnectionEncryptedInfo,f=a.imageDimensions;f=f===void 0?{width:100,height:100}:f;a=a.sessionId;try{c=(yield d("WAWebRelayClient").fetchQuery(i!==void 0?i:i=b("WAWebQueryCatalogHasCategoriesQuery.graphql"),{request:{categories:{biz_jid:c.toString(),direct_connection_encrypted_info:e,image_dimensions:f,catalog_session_id:a}}},{eventLogger:d("WAWebCatalogEventLogger").createCatalogEventLogger(d("WAWebCatalogEventLogger").GRAPHQL_CATALOG_ENDPOINT.GET_CATEGORIES)}));return Boolean(c==null?void 0:(e=c.xwa_product_catalog_get_categories)==null?void 0:e.categories.length)}catch(b){if(b instanceof d("WAWebGraphQLServerError").GraphQLServerError){f=b.source.errors||[];a=f[0];if((a==null?void 0:a.code)===2498052)return!1;d("WAWebMaybeThrowCatalogErrors").maybeThrowLocalErrorForCatalogQuery(b)}d("WALogger").WARN(j());return!1}});return function(b){return a.apply(this,arguments)}}();g.queryCatalogHasCategories=a}),98); __d("WAWebBizCatalogManagementFetchProductQuery_facebookRelayOperation",[],(function(a,b,c,d,e,f){e.exports="9335062363270451"}),null); __d("WAWebBizCatalogManagementFetchProductQuery.graphql",["WAWebBizCatalogManagementFetchProductQuery_facebookRelayOperation"],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"request"}],c=[{kind:"Variable",name:"request",variableName:"request"}],d={alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},e={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},f={alias:null,args:null,kind:"ScalarField",name:"original_image_url",storageKey:null},g={alias:null,args:null,kind:"ScalarField",name:"request_image_url",storageKey:null},h={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"price",storageKey:null},j={alias:null,args:null,kind:"ScalarField",name:"status",storageKey:null},k={alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null},l=[h,k];i=[{alias:null,args:null,kind:"ScalarField",name:"availability",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:"XFBWhatsAppCatalogProductComplianceInfo",kind:"LinkedField",name:"compliance_info",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"country_code_origin",storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductComplianceInfoImporterAddress",kind:"LinkedField",name:"importer_address",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"city",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"country_code",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"postal_code",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"region",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"street1",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"street2",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"importer_name",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"currency",storageKey:null},d,e,{alias:null,args:null,kind:"ScalarField",name:"is_hidden",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"is_sanctioned",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"max_available",storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductMedia",kind:"LinkedField",name:"media",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductMediaImage",kind:"LinkedField",name:"images",plural:!0,selections:[e,f,g],storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductMediaVideo",kind:"LinkedField",name:"videos",plural:!0,selections:[e,{alias:null,args:null,kind:"ScalarField",name:"original_video_url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"thumbnail_url",storageKey:null}],storageKey:null}],storageKey:null},h,i,{alias:null,args:null,kind:"ScalarField",name:"retailer_id",storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductSalePrice",kind:"LinkedField",name:"sale_price",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"end_date",storageKey:null},i,{alias:null,args:null,kind:"ScalarField",name:"start_date",storageKey:null}],storageKey:null},j,{alias:null,args:null,concreteType:"XFBWhatsAppCatalogStatusInfo",kind:"LinkedField",name:"status_info",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"can_appeal",storageKey:null},j],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"shimmed_url",storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductVariantInfo",kind:"LinkedField",name:"variant_info",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantListingDetails",kind:"LinkedField",name:"listing_details",plural:!1,selections:[d,{alias:null,args:null,kind:"ScalarField",name:"multi_price",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"lowest_price",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantAvailability",kind:"LinkedField",name:"availability",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantAvailabilityListing",kind:"LinkedField",name:"listing",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"is_available",storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantAvailabilityListingOption",kind:"LinkedField",name:"options",plural:!0,selections:l,storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"product_id",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantTypes",kind:"LinkedField",name:"types",plural:!0,selections:[h,{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantTypeOption",kind:"LinkedField",name:"options",plural:!0,selections:[k,{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductMediaImage",kind:"LinkedField",name:"thumbnail_media",plural:!1,selections:[e,{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductMediaImageOriginalDimensions",kind:"LinkedField",name:"original_dimensions",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"height",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"width",storageKey:null}],storageKey:null},f,g],storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantProperties",kind:"LinkedField",name:"variant_properties",plural:!0,selections:l,storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"WAWebBizCatalogManagementFetchProductQuery",selections:[{alias:null,args:c,concreteType:"XFBWhatsAppCatalogGetProductResponse",kind:"LinkedField",name:"xfb_whatsapp_catalog_product",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogGetProductResponseProductCatalog",kind:"LinkedField",name:"product_catalog",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductInfo",kind:"LinkedField",name:"product",plural:!1,selections:[{kind:"InlineDataFragmentSpread",name:"WAWebBizCatalogManagementParseProductGraphql_product",selections:i,args:null,argumentDefinitions:[]}],storageKey:null}],storageKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"WAWebBizCatalogManagementFetchProductQuery",selections:[{alias:null,args:c,concreteType:"XFBWhatsAppCatalogGetProductResponse",kind:"LinkedField",name:"xfb_whatsapp_catalog_product",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogGetProductResponseProductCatalog",kind:"LinkedField",name:"product_catalog",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductInfo",kind:"LinkedField",name:"product",plural:!1,selections:i,storageKey:null}],storageKey:null}],storageKey:null}]},params:{id:b("WAWebBizCatalogManagementFetchProductQuery_facebookRelayOperation"),metadata:{},name:"WAWebBizCatalogManagementFetchProductQuery",operationKind:"query",text:null}}}();e.exports=a}),null); __d("WAWebBizCatalogManagementFetchProduct",["Promise","WALogger","WAWebBizCatalogManagementFetchProductQuery.graphql","WAWebBizCatalogManagementParseProductGraphql","WAWebBizGatingUtils","WAWebFetchAdAccountToken","WAWebGraphQLServerError","WAWebNetworkStatus","WAWebRelayClient"],(function(a,b,c,d,e,f,g){var h,i;function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["fetchProductWithToken: failed with error"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(['fetchProduct: failed as "','"']);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["fetchProduct: success"]);l=function(){return a};return a}var m={type:"error"},n=h!==void 0?h:h=b("WAWebBizCatalogManagementFetchProductQuery.graphql");function a(a){return!d("WAWebBizGatingUtils").graphQLForGetProductEnabled()?(i||(i=b("Promise"))).resolve({type:"not-enabled"}):o(a).then(function(a){if(a.type==="success"){d("WALogger").LOG(l());return a}a.type;d("WALogger").LOG(k(),a.type);return a})}function o(a){return d("WAWebFetchAdAccountToken").fetchToken().then(function(b){if(b.type==="success")return p(b.token,a).then(function(a){a.type!=="success"?a.type==="auth-failure"?d("WAWebFetchAdAccountToken").markTokenAsInvalid():a.type:a.type;return a});b.type;return b})}function p(a,b){var e;return c("WAWebNetworkStatus").waitIfOffline().then(function(){return d("WAWebRelayClient").fetchQuery(n,{request:b},{environmentType:"facebook",accessToken:a,getInlineDataReader:function(a){e=a}})}).then(function(a){if(a==null)return m;a=(a=a.xfb_whatsapp_catalog_product)==null?void 0:(a=a.product_catalog)==null?void 0:a.product;if(a==null)return m;a=d("WAWebBizCatalogManagementParseProductGraphql").parseProductGraphQL(e(d("WAWebBizCatalogManagementParseProductGraphql").PARSE_PRODUCT_FRAGMENT,a));return{type:"success",productResult:{data:a}}})["catch"](function(a){d("WALogger").LOG(j()).devConsole(a);if(d("WAWebFetchAdAccountToken").hasGraphQLAuthError(a))return{type:"auth-failure"};return a instanceof d("WAWebGraphQLServerError").GraphQLServerError?{type:"graphql-error",error:a}:m})}g.fetchProduct=a}),98); __d("WAWebQueryCatalogProductQuery.graphql",[],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"request"}],b={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},c={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},d={alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},e={alias:null,args:null,kind:"ScalarField",name:"price",storageKey:null},f={alias:null,args:null,kind:"ScalarField",name:"original_image_url",storageKey:null},g={alias:null,args:null,kind:"ScalarField",name:"request_image_url",storageKey:null},h={alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null},i=[c,h];e=[{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:[b,{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:"is_sanctioned",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"product_availability",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"max_available",storageKey:null},c,d,{alias:null,args:null,kind:"ScalarField",name:"url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"shimmed_url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"currency",storageKey:null},e,{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:[e,{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:[b,f,g],storageKey:null},{alias:null,args:null,concreteType:"XWAProductCatalogProductMediaVideo",kind:"LinkedField",name:"videos",plural:!0,selections:[b,{alias:null,args:null,kind:"ScalarField",name:"original_video_url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"thumbnail_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},{alias:null,args:null,concreteType:"XWACatalogProductVariantInfo",kind:"LinkedField",name:"variant_info",plural:!1,selections:[{alias:null,args:null,concreteType:"XWACatalogVariantListingDetails",kind:"LinkedField",name:"listing_details",plural:!1,selections:[d,{alias:null,args:null,kind:"ScalarField",name:"multi_price",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"lowest_price",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XWACatalogVariantAvailability",kind:"LinkedField",name:"availability",plural:!1,selections:[{alias:null,args:null,concreteType:"XWAVariantAvailabilityListing",kind:"LinkedField",name:"listing",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"is_available",storageKey:null},{alias:null,args:null,concreteType:"XWAVariantAvailabilityListingOption",kind:"LinkedField",name:"options",plural:!0,selections:i,storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"product_id",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XWACatalogVariantTypes",kind:"LinkedField",name:"types",plural:!0,selections:[c,{alias:null,args:null,concreteType:"XWACatalogVariantTypeOption",kind:"LinkedField",name:"options",plural:!0,selections:[h,{alias:null,args:null,concreteType:"XWAProductCatalogProductMediaImage",kind:"LinkedField",name:"thumbnail_media",plural:!1,selections:[b,{alias:null,args:null,concreteType:"XWAProductCatalogProductMediaImageOriginalDimensions",kind:"LinkedField",name:"original_dimensions",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"height",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"width",storageKey:null}],storageKey:null},f,g],storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XWACatalogVariantProperties",kind:"LinkedField",name:"variant_properties",plural:!0,selections:i,storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"WAWebQueryCatalogProductQuery",selections:e,type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"WAWebQueryCatalogProductQuery",selections:e},params:{id:"9636715149709660",metadata:{},name:"WAWebQueryCatalogProductQuery",operationKind:"query",text:null}}}();e.exports=a}),null); __d("WAWebQueryCatalogProduct",["errorCode","WADeprecatedSendIq","WADeprecatedWapParser","WALogger","WANullthrows","WAWap","WAWebBackendErrors","WAWebBizCatalogManagementFetchProduct","WAWebBizCatalogParseProduct","WAWebBizGatingUtils","WAWebBizParseProductGraphql","WAWebCatalogEventLogger","WAWebCommsWapMd","WAWebGraphQLServerError","WAWebMaybeThrowCatalogErrors","WAWebQueryCatalogProductQuery.graphql","WAWebRelayClient","WAWebUserPrefsMeUser","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g,h){var i;function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["queryCatalogProductGraphQLByOwner: error handling flow not implemented for ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["GraphQL: Failed fetching xwa_product_catalog_get_product query."]);k=function(){return a};return a}var l=new(c("WADeprecatedWapParser"))("productResponse",function(a){a.assertTag("iq");a.assertFromServer();a=a.child("product_catalog");a=a.child("product");return d("WAWebBizCatalogParseProduct").parseProductNode(a)}),m=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e,f,g){f===void 0&&(f=!1);g===void 0&&(g=null);if(d("WAWebBizGatingUtils").commerceFeaturesDisabledBySanctions())throw new(d("WAWebBackendErrors").E451)();a=d("WAWap").wap("iq",{to:d("WAWap").S_WHATSAPP_NET,type:"get",xmlns:"w:biz:catalog",id:d("WAWap").generateId()},d("WAWap").wap("product",{jid:d("WAWebCommsWapMd").DEVICE_JID(a)},d("WAWap").wap("product_id",null,b),d("WAWap").wap("width",null,c.toString()),d("WAWap").wap("height",null,e.toString()),f?d("WAWap").wap("fetch_compliance_info",null,f.toString()):void 0,g!=null?d("WAWap").wap("direct_connection_encrypted_info",null,g):null));b=(yield d("WADeprecatedSendIq").deprecatedSendIq(a,l));if(!b.success)if(b.errorCode===404)return{error:"NOT_FOUND"};else if(b.errorCode===451)throw new(d("WAWebBackendErrors").E451)();else throw new(d("WAWebBackendErrors").ServerStatusCodeError)(b.errorCode);else return{data:b.result}});return function(b,c,d,e,f,g){return a.apply(this,arguments)}}(),n=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(d("WAWebBizGatingUtils").commerceFeaturesDisabledBySanctions())throw new(d("WAWebBackendErrors").E451)();for(var a=arguments.length,e=new Array(a),f=0;f<a;f++)e[f]=arguments[f];var g=e[0],h=e[1],j=e[2],l=e[3],m=e[4],n=m===void 0?!1:m,o=e[5],p=o===void 0?null:o,q=e[6],r=e[7],s=e[8];try{var t,u,v=(yield d("WAWebRelayClient").fetchQuery(i!==void 0?i:i=b("WAWebQueryCatalogProductQuery.graphql"),{request:{product:{jid:g.toString(),product_id:h,width:String(j),height:String(l),fetch_compliance_info:String(n),direct_connection_encrypted_info:p,variant_info_fields:q,variant_thumbnail_height:r!=null?String(r):null,variant_thumbnail_width:s!=null?String(s):null}}},{eventLogger:d("WAWebCatalogEventLogger").createCatalogEventLogger(d("WAWebCatalogEventLogger").GRAPHQL_CATALOG_ENDPOINT.GET_PRODUCT)})),w=c("WANullthrows")(v==null?void 0:(t=v.xwa_product_catalog_get_product)==null?void 0:(u=t.product_catalog)==null?void 0:u.product);return{data:d("WAWebBizParseProductGraphql").parseProductGraphQL(w)}}catch(a){if(a instanceof d("WAWebGraphQLServerError").GraphQLServerError){var x,y=((x=a.source)==null?void 0:x.errors)||[],z=y[0];if((z==null?void 0:z.code)===2498052)return{error:"NOT_FOUND"};d("WAWebMaybeThrowCatalogErrors").maybeThrowLocalErrorForCatalogQuery(a)}d("WALogger").WARN(k());throw new(d("WAWebBackendErrors").CatalogUnknownError)()}});return function(){return a.apply(this,arguments)}}(),o=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(d("WAWebBizGatingUtils").commerceFeaturesDisabledBySanctions())throw new(d("WAWebBackendErrors").E451)();for(var a=arguments.length,b=new Array(a),c=0;c<a;c++)b[c]=arguments[c];var e=b[0],f=b[1],g=b[2],h=b[3],i=b[4],k=i===void 0?!1:i,l=b[5],m=l===void 0?null:l,n=b[6],o=b[7],p=b[8],q=(yield d("WAWebBizCatalogManagementFetchProduct").fetchProduct({product:{jid:e.toJid(),product_id:f,width:String(g),height:String(h),direct_connection_encrypted_info:m,fetch_compliance_info:String(k),variant_info_fields:n,variant_thumbnail_height:o!=null?String(o):null,variant_thumbnail_width:p!=null?String(p):null}}));if(q.type==="success")return q.productResult;else if(q.type==="graphql-error"){var r,s=(r=q.error.source)==null?void 0:r.errors,t=s[0];if((t==null?void 0:t.code)===2498052)return{error:"NOT_FOUND"};d("WAWebMaybeThrowCatalogErrors").maybeThrowLocalErrorForCatalogQuery(q.error)}else if(q.type==="recovery-required"){if(d("WAWebBizGatingUtils").catalogTokenRecoveryEnabled())throw new(d("WAWebBackendErrors").AdAccountRecoveryRequiredError)(q.emailMask)}else if(q.type==="incorrect-nonce"){if(d("WAWebBizGatingUtils").catalogTokenRecoveryEnabled())throw new(d("WAWebBackendErrors").CatalogIncorrectNonceError)()}else q.type;d("WALogger").WARN(j(),JSON.stringify(q));throw new(d("WAWebBackendErrors").CatalogUnknownError)()});return function(){return a.apply(this,arguments)}}();a=function(){var a=d("WAWebUserPrefsMeUser").getMaybeMeUser();for(var b=arguments.length,c=new Array(b),e=0;e<b;e++)c[e]=arguments[e];var f=c[0];return a!=null&&a.equals(f)?d("WAWebBizGatingUtils").graphQLForGetProductEnabled()?o.apply(void 0,c):m.apply(void 0,c):d("WAWebBizGatingUtils").graphQLForCatalogM1Enabled()?n.apply(void 0,c):m.apply(void 0,c)};e=a;g["default"]=e}),98); __d("WAWebReportProductJobMutation.graphql",[],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"input"}],b=[{alias:null,args:[{kind:"Variable",name:"request",variableName:"input"}],concreteType:"XWAWhatsAppCatalogReportProductResponse",kind:"LinkedField",name:"xwa_whatsapp_catalog_report_product",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"success",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"WAWebReportProductJobMutation",selections:b,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"WAWebReportProductJobMutation",selections:b},params:{id:"WAWebReportProductJobMutation",metadata:{},name:"WAWebReportProductJobMutation",operationKind:"mutation",text:null}}}();a.hash="a344b224fc28492489aa97287055b47e";e.exports=a}),null); __d("WAWebReportProductJob",["WADeprecatedSendIq","WADeprecatedWapParser","WAWap","WAWebBackendErrors","WAWebBizGatingUtils","WAWebCommsWapMd","WAWebGraphQLServerError","WAWebMaybeThrowCatalogErrors","WAWebRelayClient","WAWebReportProductJobMutation.graphql","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h,i=new(c("WADeprecatedWapParser"))("reportProductResponse",function(a){a.assertTag("iq");a.assertAttr("type","result");return});function j(a,b,c){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){var e;e=(e=d("WAWap")).wap("iq",{to:e.S_WHATSAPP_NET,xmlns:"fb:thrift_iq",type:"set",id:e.generateId()},e.wap("request",{type:"report_product",biz_jid:d("WAWebCommsWapMd").USER_JID(a)},c?d("WAWap").wap("reason",null,c):void 0,d("WAWap").wap("id",null,b)));a=(yield d("WADeprecatedSendIq").deprecatedSendIq(e,i));if(!a.success){if(a.errorCode===451)throw new(d("WAWebBackendErrors").E451)();throw new(d("WAWebBackendErrors").ServerStatusCodeError)(a.errorCode)}});return k.apply(this,arguments)}var l=h!==void 0?h:h=b("WAWebReportProductJobMutation.graphql");function m(a,b,c){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){a={jid:a.toJid(),product_id:b};c!==""&&(a.reason=c);return d("WAWebRelayClient").commitMutation(l,{input:a}).then(function(a){a=a==null?void 0:(a=a.xwa_whatsapp_catalog_report_product)==null?void 0:a.success;if(a!==!0)throw new(d("WAWebBackendErrors").ServerStatusCodeError)(500)})["catch"](function(a){a instanceof d("WAWebGraphQLServerError").GraphQLServerError&&d("WAWebMaybeThrowCatalogErrors").maybeThrowLocalErrorForCatalogQuery(a)})});return n.apply(this,arguments)}function a(a,b,c){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){if(d("WAWebBizGatingUtils").commerceFeaturesDisabledBySanctions())throw new(d("WAWebBackendErrors").E451)();return d("WAWebBizGatingUtils").graphQLForReportProductEnabled()?m(a,b,c):j(a,b,c)});return o.apply(this,arguments)}g["default"]=a}),98); __d("WAWebBizProductCatalogBridge",["Promise","WALogger","WAWeb-moment","WAWebBackendErrors","WAWebBizCatalogAddProductJob","WAWebBizCatalogAppealProductJob","WAWebBizCatalogDeleteProductsJob","WAWebBizCatalogEditProductJob","WAWebBizCatalogProductVisibilitySetJob","WAWebBizCreateProductCatalogJob","WAWebBizGatingUtils","WAWebBizLogQplEvents","WAWebBusinessDirectConnectionBridge","WAWebNoop","WAWebPersistedJobDefinitions","WAWebPersistedJobManager","WAWebProductTypes.flow","WAWebQplQuickPerformanceLoggerMarkerIds","WAWebQplQuickPerformanceLoggerModule","WAWebQueryCatalog","WAWebQueryCatalogHasCategories","WAWebQueryCatalogProduct","WAWebReportProductJob","WAWebWidFactory"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Edit product failed, error: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Add product failed, error: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["Query catalog failed, error: ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["Query catalog failed, error: 451"]);l=function(){return a};return a}function a(a,b,e,f,g,h,i,j,k){h===!0&&d("WAWebBizLogQplEvents").qplPointProductView("datasource_start");var l=d("WAWebBusinessDirectConnectionBridge").attemptWithDirectConnectionRetry(a,function(d){return c("WAWebQueryCatalogProduct")(a,b,e,f,g,d,i,j,k)});l.then(function(){return h===!0&&d("WAWebBizLogQplEvents").qplPointProductView("datasource_end")})["catch"](c("WAWebNoop"));return d("WAWebBackendErrors").attachErrorLogger(l,"Query product failed")}function e(a,e,f,g,i,j,m,n,o,p){if(d("WAWebBizGatingUtils").commerceFeaturesDisabledBySanctions())return(h||(h=b("Promise"))).reject(new(d("WAWebBackendErrors").E451)());var q=d("WAWebBusinessDirectConnectionBridge").attemptWithDirectConnectionRetry(a,function(b){return c("WAWebQueryCatalog")({catalogWid:a,afterCursor:e,limit:f,width:g,height:i,checkmarkCollectionId:j,allowShopSource:m,directConnectionEncryptedInfo:b,variantInfoFields:n,variantThumbnailHeight:o,variantThumbnailWidth:p})});return q["catch"](function(a){if(a instanceof d("WAWebBackendErrors").ServerStatusCodeError&&a.statusCode===404)throw a;if(a.errorCode===451){d("WALogger").ERROR(l()).verbose().sendLogs("Query catalog failed, commerce-features-disabled");throw new(d("WAWebBackendErrors").E451)()}d("WALogger").ERROR(k(),a).verbose().devConsole(a).sendLogs("Query catalog failed");throw a})}function f(a,c,e,f,g){if(d("WAWebBizGatingUtils").commerceFeaturesDisabledBySanctions())return(h||(h=b("Promise"))).reject(new(d("WAWebBackendErrors").E451)());g&&d("WAWebBizLogQplEvents").qplPointPLMDetailsView("datasource_start");var i=d("WAWebBusinessDirectConnectionBridge").attemptWithDirectConnectionRetry(a,function(b){return d("WAWebPersistedJobManager").getJobManager().waitUntilCompleted(d("WAWebPersistedJobDefinitions").jobSerializers.queryProductList(a,c,b,e,f))});i.then(function(){return g&&d("WAWebBizLogQplEvents").qplPointPLMDetailsView("datasource_end")})["catch"](function(a){if(a.errorCode===451)throw new(d("WAWebBackendErrors").E451)()});return i}function m(a){return d("WAWebBusinessDirectConnectionBridge").attemptWithDirectConnectionRetry(a,function(b){return d("WAWebQueryCatalogHasCategories").queryCatalogHasCategories({catalogWid:a,directConnectionEncryptedInfo:b})})}function n(a,b,e){d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.WHATSAPP_PRODUCT_REPORT,"datasource_start");a=c("WAWebReportProductJob")(a,b,e);a.then(function(){return d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.WHATSAPP_PRODUCT_REPORT,"datasource_end")})["catch"](c("WAWebNoop"));return d("WAWebBackendErrors").attachErrorLogger(a,"Report product failed")}function o(a,b){d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.WHATSAPP_PRODUCT_APPEAL,"datasource_start");a=d("WAWebBizCatalogAppealProductJob").appealProductMD(a,b);a.then(function(){return d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.WHATSAPP_PRODUCT_APPEAL,"datasource_end")})["catch"](c("WAWebNoop"));return d("WAWebBackendErrors").attachErrorLogger(a,"Appeal product failed")}function p(){d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.WHATSAPP_CATALOG_CREATE,"datasource_start");var a=d("WAWebBizCreateProductCatalogJob").createProductCatalog();a.then(function(){d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.WHATSAPP_CATALOG_CREATE,"datasource_end")})["catch"](c("WAWebNoop"));return d("WAWebBackendErrors").attachErrorLogger(a,"Create catalog failed")}function q(a,b,e){d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.WHATSAPP_PRODUCT_SAVE,"datasource_start");a=d("WAWebBizCatalogAddProductJob").addProductMD(a,b,e);a.then(function(){return d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.WHATSAPP_PRODUCT_SAVE,"datasource_end")})["catch"](c("WAWebNoop"));return a.then(v)["catch"](function(a){if(a instanceof d("WAWebBackendErrors").ServerStatusCodeError&&a.statusCode===406||a instanceof d("WAWebBackendErrors").CatalogEditServerError&&a.statusCode===406)throw a;d("WALogger").ERROR(j(),a).verbose().devConsole(a).sendLogs("Add product failed");throw a})}function r(a,b,e){d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.WHATSAPP_PRODUCT_SAVE,"datasource_start");a=c("WAWebBizCatalogEditProductJob")(a,b,e);a.then(function(a){return d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.WHATSAPP_PRODUCT_SAVE,"datasource_end")})["catch"](c("WAWebNoop"));return a.then(v)["catch"](function(a){if(a instanceof d("WAWebBackendErrors").ServerStatusCodeError&&a.statusCode===406||a instanceof d("WAWebBackendErrors").CatalogEditServerError&&a.statusCode===406)throw a;d("WALogger").ERROR(i(),a).verbose().devConsole(a).sendLogs("Edit product failed");throw a})}function s(a){d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.WHATSAPP_PRODUCT_DELETE,"datasource_start");a=d("WAWebBizCatalogDeleteProductsJob").deleteProductsMD(a);a=a.then(function(a){d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.WHATSAPP_PRODUCT_DELETE,"datasource_end");return a});return d("WAWebBackendErrors").attachErrorLogger(a,"Delete product failed")}function t(a){return a==null?null:parseInt(a,10)}function u(a){return a!=null&&a!==""?c("WAWeb-moment").utc(a,c("WAWeb-moment").ISO_8601).valueOf():null}function v(a,b){var c;c=((c=a.capability_to_review_status[0])==null?void 0:c.value)||"APPROVED";c={catalogWid:b,id:a.id,isHidden:a.is_hidden||!1,isSanctioned:a.is_sanctioned||!1,url:a.url||"",name:a.name,description:a.description||"",availability:(b=d("WAWebProductTypes.flow").ProductAvailability.cast(a.availability))!=null?b:d("WAWebProductTypes.flow").ProductAvailability.UNKNOWN,maxAvailable:a.max_available,additionalImageCdnUrl:a.additional_image_cdn_urls.map(function(a){return a[1].value}),additionalImageHashes:a.image_hashes_for_whatsapp.slice(1),imageCdnUrl:a.image_cdn_urls[1].value,imageHash:a.image_hashes_for_whatsapp[0],reviewStatus:c,currency:a.currency,priceAmount1000:t(a.price),salePriceAmount1000:t(a.sale_price),salePriceStartDate:u(a.sale_start_date),salePriceEndDate:u(a.sale_end_date),retailerId:a.retailer_id||"",productMsgMediaData:null,imageCount:a.additional_image_cdn_urls.length+1,fetchedFromServer:!0,videos:(b=a.videos)==null?void 0:b.map(function(a){return{thumbnail_url:a.thumbnail_url,original_video_url:a.original_video_url,id:a.id}}),t:Date.now()/1e3,old:!1,canAppeal:a.whatsapp_product_can_appeal,checkmark:a.checkmark,importerInformationExempt:Boolean(a.importer_information_exempt),variantInfo:a.variant_info};a.compliance_info&&(c.complianceInfo=y(a.compliance_info));a.signedShimmedUrl!=null&&(c.signedShimmedUrl=a.signedShimmedUrl);return c}function w(a){var b;a.businessOwnerJid!=null&&a.businessOwnerJid!==""&&(b=d("WAWebWidFactory").createWid(a.businessOwnerJid));return{catalogWid:b,id:a.productId||"",url:a.url,name:a.title,description:a.description,imageCdnUrl:a.mediaData.renderableUrl,reviewStatus:"",currency:a.currencyCode,priceAmount1000:a.priceAmount1000,salePriceAmount1000:a.salePriceAmount1000,retailerId:a.retailerId,productMsgMediaData:a.mediaData,imageCount:a.productImageCount!=null&&a.productImageCount!==0?a.productImageCount:1,fetchedFromServer:!1,t:a.t,isHidden:!1}}function x(a,b){d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.WHATSAPP_PRODUCT_SET_VISIBLE,"datasource_start");a=c("WAWebBizCatalogProductVisibilitySetJob")(a,b);a.then(function(){return d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.WHATSAPP_PRODUCT_SET_VISIBLE,"datasource_end")})["catch"](c("WAWebNoop"));return d("WAWebBackendErrors").attachErrorLogger(a,"Product visibility change failed")}function y(a){var b={countryCodeOrigin:a.country_code_origin};a.importer_name!=null&&a.importer_name!==""&&(b.importerName=a.importer_name);a.importer_address&&(b.importerAddress=z(a.importer_address));return b}function z(a){var b={street1:a.street1,city:a.city,countryCode:a.country_code};a.street2!=null&&a.street2!==""&&(b.street2=a.street2);a.postal_code!=null&&a.postal_code!==""&&(b.postalCode=a.postal_code);a.region!=null&&a.region!=="null"&&(b.region=a.region);a.country_code&&(b.countryCode=a.country_code);return b}g.queryProduct=a;g.queryCatalog=e;g.queryProductList=f;g.queryCatalogHasCategories=m;g.reportProduct=n;g.appealProduct=o;g.createCatalog=p;g.addProduct=q;g.editProduct=r;g.deleteProducts=s;g.parseDateValue=u;g.mapProductResponseToModel=v;g.mapMsgToProductModel=w;g.productVisibilitySet=x}),98); __d("WAWebDirectConnectionX509",["JSResourceForInteraction","Promise","WALogger","WAWebDirectConnectionUtils","asyncToGeneratorRuntime","filterNulls","pvutils-1.0.17","requireDeferred"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[direct-connection] no trusted root certificates could be found for ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[direct-connection] certificate chain parsing from Get Public Key IQ failed with ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[direct-connection] base64 decoding failed with ",""]);k=function(){return a};return a}var l=c("requireDeferred")("asn1js-2.1.1").__setRef("WAWebDirectConnectionX509"),m="-----BEGIN CERTIFICATE-----",n="-----END CERTIFICATE-----",o="(?:"+m+")((?:.|\n)*?)(?:"+n+")",p="2.5.4.3";function q(){return c("JSResourceForInteraction")("pkijs").__setRef("WAWebDirectConnectionX509").load()}function r(a){var b="";try{b=atob(a)}catch(a){d("WALogger").WARN(k(),a.toString())}return t(b)}function s(a){return btoa(u(a))}function t(a){var b=a.length,c=new Uint8Array(b);for(var d=0;d<b;d++)c[d]=a.charCodeAt(d);return c.buffer}function u(a){return String.fromCharCode.apply(String,Array.from(new Uint8Array(a)))}function v(a,b){return w.apply(this,arguments)}function w(){w=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=(yield q());c=c.CertificateChainValidationEngine;return new c({trustedCerts:b,certs:a})});return w.apply(this,arguments)}function x(a,b){return a.flat().reduce(function(a,c){return a.every(function(a){return!d("pvutils-1.0.17").isEqualBuffer(a.tbs,c.tbs)})&&b.includes(c)?[].concat(a,[c]):a},[])}function a(){return y.apply(this,arguments)}function y(){y=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield c("JSResourceForInteraction")("WAWebDirectConnectionCaBundle").__setRef("WAWebDirectConnectionX509").load());a=a.CA_BUNDLE;return z(a)});return y.apply(this,arguments)}function z(a){return A.apply(this,arguments)}function A(){A=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=(yield q()),f=e.Certificate,g=(yield new(h||(h=b("Promise")))(function(a){l.onReady(function(b){a(b().fromBER)})}));return c("filterNulls")(Array.from(a.matchAll(new RegExp(o,"gm"))).map(function(a){a[0];a=a[1];a=g(r(a));a=a.result;var b;try{b=a.error?null:new f({schema:a})}catch(a){d("WALogger").WARN(j(),a.toString())}return b}))});return A.apply(this,arguments)}function e(a,b){return B.apply(this,arguments)}function B(){B=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){return(yield v(a,b)).verify()});return B.apply(this,arguments)}function f(a,b){return C.apply(this,arguments)}function C(){C=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){var e=(yield v(a,c));c=x(yield (h||(h=b("Promise"))).all(a.map(function(a){return e.findIssuer(a,e)})),c);if(c.length===0){d("WALogger").WARN(i(),D(a[0]));return null}return c});return C.apply(this,arguments)}function D(a){return(a=a.issuer.typesAndValues.find(function(a){a=a.type;return a===p}))==null?void 0:a.value.valueBlock.value}function E(a){return d("WAWebDirectConnectionUtils").stringToCertificateString(a.map(function(a){a=s(a.toSchema(!0).toBER(!1)).split(/(.{0,64})/g).filter(function(a){return a!==""}).join("\n");return m+"\n"+a+"\n"+n}).join("\n"))}function F(){return G.apply(this,arguments)}function G(){G=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield q());a=a.getEngine;return a()});return G.apply(this,arguments)}function H(a){return I.apply(this,arguments)}function I(){I=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield q());b=b.getRandomValues;return b(a)});return I.apply(this,arguments)}function J(a,b){return K.apply(this,arguments)}function K(){K=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=(yield a.getPublicKey({algorithm:{algorithm:{name:"RSA-OAEP",hash:{name:"SHA-256"}},usages:["encrypt"]}}));var c=(yield F());c=(yield c.subtle.encrypt({name:"RSA-OAEP"},a,b));return s(c)});return K.apply(this,arguments)}g.base64ToArrayBuffer=r;g.arrayBufferToBase64=s;g.stringToArrayBuffer=t;g.arrayBufferToString=u;g.fetchFromCABundle=a;g.extractCertificates=z;g.validateCertificates=e;g.genRootIssuers=f;g.encodeToString=E;g.getEngine=F;g.getRandomValues=H;g.encryptWithPublicKey=J}),98); __d("WAWebDirectConnectionCypher",["$InternalEnum","WAArrayBufferUtils","WALogger","WAWebDirectConnectionX509","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[direct-connection] cypher creation failed with ",""]);h=function(){return a};return a}var i=b("$InternalEnum").Mirrored(["PhoneNumberAndPostcode","Postcode"]);function a(a){return a}function c(a){return a}function j(a,b,c){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){var e=(yield d("WAWebDirectConnectionX509").getEngine());e=e.subtle;return e.encrypt({name:"AES-GCM",iv:new Uint8Array(d("WAWebDirectConnectionX509").base64ToArrayBuffer(b)),tagLength:128},a,d("WAWebDirectConnectionX509").stringToArrayBuffer(c))});return k.apply(this,arguments)}function l(a,b,c){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){var e=(yield d("WAWebDirectConnectionX509").getEngine());e=e.subtle;a=(yield e.importKey("raw",a,{name:"AES-GCM"},!1,["decrypt"]));return e.decrypt({name:"AES-GCM",iv:new Uint8Array(d("WAWebDirectConnectionX509").base64ToArrayBuffer(c)),tagLength:128},a,d("WAWebDirectConnectionX509").base64ToArrayBuffer(b))});return m.apply(this,arguments)}function e(a,b,c){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){return d("WAArrayBufferUtils").arrayBufferToString(yield l(a,b,c))});return n.apply(this,arguments)}function f(a,b){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=d("WAWebDirectConnectionX509").arrayBufferToBase64(yield d("WAWebDirectConnectionX509").getRandomValues(new Uint8Array(16)));try{var e=(yield d("WAWebDirectConnectionX509").getEngine());e=e.subtle;var f=(yield e.generateKey({name:"AES-GCM",length:256},!0,["encrypt"]));b=d("WAWebDirectConnectionX509").arrayBufferToBase64(yield j(f,c,JSON.stringify(b)));e=(yield e.exportKey("raw",f));f=(yield d("WAWebDirectConnectionX509").encryptWithPublicKey(a,e));return{cypher:"AesKey="+f+";IV="+c+";Data="+b,exportedAesKey:e,iv:c}}catch(a){d("WALogger").WARN(h(),a.toString());return null}});return o.apply(this,arguments)}g.CypherType=i;g.stringToCypherString=a;g.cypherStringToString=c;g.decryptDataWithSymmetricKey=l;g.decryptDataWithSymmetricKeyToString=e;g.genCypher=f}),98); __d("WAWebBusinessDirectConnectionBridge",["Promise","WALogger","WAWebABProps","WAWebBusinessDirectConnectionCollection","WAWebBusinessDirectUtils","WAWebDirectConnectionCypher","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[direct-connection] Received 421 from Direct Connection request. Renewing certificate and retrying."]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[direct-connection] Received 421 from Direct Connection request. Renewing certificate and retrying."]);j=function(){return a};return a}function k(a,b){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){if(!(yield d("WAWebBusinessDirectUtils").isCypherNeeded(a)))return e();var f=function(){var d=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){b===void 0&&(b=!1);b=(yield c("WAWebBusinessDirectConnectionCollection").getCypher(a,{forceRenew:b})).cypher;return e(b)});return function(a){return d.apply(this,arguments)}}();try{return yield f()}catch(a){if(d("WAWebBusinessDirectUtils").errorIsDirectConnectionCypherError421(a)){d("WALogger").LOG(j());return f(!0)}return(h||(h=b("Promise"))).reject(a)}});return l.apply(this,arguments)}function a(a,b){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){if(!d("WAWebABProps").getABPropConfigValue("share_phone_number_on_cart_send_to_direct_connection_biz_enabled"))return k(a,e);if(!(yield d("WAWebBusinessDirectUtils").isCypherNeeded(a)))return e();var f=function(){var f=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var b;b=(b=(yield c("WAWebBusinessDirectConnectionCollection").genNewCypher(a,d("WAWebDirectConnectionCypher").CypherType.PhoneNumberAndPostcode,{forceRenew:!0})))==null?void 0:b.cypher;return e(b)});return function(){return f.apply(this,arguments)}}(),g=function(){var g=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var b=(yield c("WAWebBusinessDirectConnectionCollection").getCypher(a));return b.cypherType===d("WAWebDirectConnectionCypher").CypherType.PhoneNumberAndPostcode?e(b.cypher):f()});return function(){return g.apply(this,arguments)}}();try{return yield g()}catch(a){if(d("WAWebBusinessDirectUtils").errorIsDirectConnectionCypherError421(a)){d("WALogger").LOG(i());return f()}return(h||(h=b("Promise"))).reject(a)}});return m.apply(this,arguments)}g.attemptWithDirectConnectionRetry=k;g.attemptWithOrderDirectConnectionRetry=a}),98); __d("WAWebSyncdGetChat",["WALogger","WASyncdConst","WAWebApiContact","WAWebLid1X1MigrationGating","WAWebSchemaChat","WAWebWidFactory","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: getChatJidMutationIndexForChatImpl: accountLid not found in chat row}"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: getChatJidMutationIndexForChat: chat not found}"]);i=function(){return a};return a}function a(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()&&a.isLid()){var b,c=(yield d("WAWebSchemaChat").getChatTable().equals(["accountLid"],a.toString(),{shouldDecrypt:!1}));c.length>0&&(b=c[0]);return b==null?{success:!1,orphanModel:{modelId:a.toString(),modelType:d("WASyncdConst").SyncModelType.Account}}:{success:!0,chat:b}}c=(yield d("WAWebSchemaChat").getChatTable().get(a.toString(),!1));return c==null?{success:!1,orphanModel:{modelId:a.toString(),modelType:d("WASyncdConst").SyncModelType.Chat}}:{success:!0,chat:c}});return j.apply(this,arguments)}function e(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!a.isRegularUser())return a.toJid();var b=(yield m(a));if(b==null){d("WALogger").ERROR(i()).sendLogs("syncd-missing-chat-outgoing-mutation").devConsole(a.toString());throw c("err")("syncd-missing-chat-outgoing-mutation")}return b});return k.apply(this,arguments)}function f(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!a.isRegularUser())return a.toJid();var b=(yield m(a));if(b!=null)return b;b;b=d("WAWebApiContact").getCurrentLid(d("WAWebWidFactory").toUserWid(a));return b!=null?b.toJid():a.toJid()});return l.apply(this,arguments)}function m(a){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated())return a.toJid();if(a.isLid())return a.toJid();var b=(yield d("WAWebSchemaChat").getChatTable().get(a.toString(),!1));if(b==null)return;b=b.accountLid;if(b==null){d("WALogger").ERROR(h()).sendLogs("syncd-missing-accountLid-outgoing-mutation").devConsole(a.toString());throw c("err")("syncd-missing-accountLid-outgoing-mutation")}return b});return n.apply(this,arguments)}g.resolveChatForMutationIndex=a;g.getChatJidMutationIndexForChat=e;g.getWidMutationIndexForWid=f}),98); __d("WAWebEditLabelAssociationBridge",["Promise","WALogger","WAServerSync.pb","WASyncdConst","WATimeUtils","WAWebBizGatingUtils","WAWebContactModel","WAWebDBLabelAssociationDatabaseApi","WAWebListsGatingUtils","WAWebMsgModel","WAWebSchemaLabelAssociation","WAWebSyncdActionUtils","WAWebSyncdCoreApi","WAWebSyncdGetChat","WAWebSyncdUtils","WAWebWidFactory","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["removeLabelAssociations from label association table failed"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["addOrEditLabelAssociations into label association table failed"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["contact model is invalid for editLabelAssociation"]);k=function(){return a};return a}function a(a,b){var e=b.some(function(a){return a instanceof c("WAWebContactModel")});e&&d("WALogger").ERROR(k()).sendLogs("contact model is invalid for editLabelAssociation");e=l(a,b.map(function(a){return a instanceof d("WAWebMsgModel").Msg?{labelAssociationType:d("WAWebSchemaLabelAssociation").LabelAssociationType.Message,modelId:a.id.toString(),mutationIndexSegments:d("WAWebSyncdUtils").constructMsgKeySegments(a)}:{labelAssociationType:d("WAWebSchemaLabelAssociation").LabelAssociationType.Jid,modelId:a.id.toString(),mutationIndexSegments:[a.id.toString({legacy:!0})]}}));return e}function l(a,b){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){if(!(d("WAWebBizGatingUtils").canEditLabelAssociation()||d("WAWebListsGatingUtils").isListsEnabled()))return(h||(h=b("Promise"))).reject(c("err")("editLabelAssociation is not supported"));var f=(yield p(a,e));return d("WAWebSyncdCoreApi").lockForSync(["label-association","chat"],f,function(){return n(a,e)})});return m.apply(this,arguments)}function n(a,b){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){var f=[],g=[];a.forEach(function(a){var b=a.id,c=a.type;e.map(function(a){var e=a.modelId;a=a.labelAssociationType;c==="add"?f.push({labelId:b,associationId:e,type:a}):(c,g.push(d("WAWebSchemaLabelAssociation").createLabelAssociationPrimaryKey({labelId:b,associationId:e,type:a})))})});yield (h||(h=b("Promise"))).all([d("WAWebDBLabelAssociationDatabaseApi").addOrEditLabelAssociations(f)["catch"](function(a){d("WALogger").ERROR(j()).verbose().devConsole(a).sendLogs("editLocalLabelAssociationMD-add-or-edit-label-associations-failed");throw c("err")("addOrEditLabelAssociations into label association table failed")}),d("WAWebDBLabelAssociationDatabaseApi").removeLabelAssociations(g)["catch"](function(a){d("WALogger").ERROR(i()).verbose().devConsole(a).sendLogs("editLocalLabelAssociationMD-remove-label-associations-failed");throw c("err")("removeLabelAssociations form label association table failed")})])});return o.apply(this,arguments)}function p(a,b){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){var e=d("WATimeUtils").unixTimeMs(),f=[];a.forEach(function(a){var b=a.id,g=a.type;c.forEach(function(a){var c=a.labelAssociationType;a=a.mutationIndexSegments;var h={labelAssociationAction:{labeled:g==="add"}};c=c===d("WAWebSchemaLabelAssociation").LabelAssociationType.Message?d("WASyncdConst").Actions.LabelMessage:d("WASyncdConst").Actions.LabelJid;f.push({timestamp:e,collection:d("WASyncdConst").CollectionName.Regular,operation:d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET,indexArgs:[b].concat(a),version:d("WASyncdConst").LABEL_ASSOCIATION_SYNC_VERSION,value:h,action:c})})});a=(yield (h||(h=b("Promise"))).all(f.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a.action===d("WASyncdConst").Actions.LabelMessage)return a;var c=a.indexArgs,e=c[0];c=c.slice(1);c=(yield (h||(h=b("Promise"))).all(c.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=d("WAWebWidFactory").createWid(a);return d("WAWebSyncdGetChat").getWidMutationIndexForWid(a)});return function(b){return a.apply(this,arguments)}}())));return babelHelpers["extends"]({},a,{indexArgs:[e].concat(c)})});return function(b){return a.apply(this,arguments)}}())));return a.map(d("WAWebSyncdActionUtils").buildPendingMutation)});return q.apply(this,arguments)}g.editLabelAssociation=a;g.editLocalLabelAssociationMD=n;g.createLabelAssociationMutations=p}),98); __d("WAWebChatClearBridge",["Promise","WANullthrows","WASyncAction.pb","WATimeUtils","WAWebApiActiveMessageRanges","WAWebClearChatSync","WAWebDBQueryAndRemoveMessageHistory","WAWebDBReportingTokenUtils","WAWebMessageRangeUtils","WAWebPersistedJobDefinitions","WAWebPersistedJobManager","WAWebUpdateLastAddOnPreviewChatAction","asyncToGeneratorRuntime","decodeProtobuf"],(function(a,b,c,d,e,f,g){var h;function i(a,b,c){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e,f){e=d("WATimeUtils").unixTimeMs();e=(yield (h||(h=b("Promise"))).all([c("WAWebClearChatSync").getClearChatMutation(e,a.id,!f,!1,!1),c("WAWebClearChatSync").getClearChatMutation(e,a.id,!f,!1,!0)]));var g=e[0],i=e[1],j;yield d("WAWebMessageRangeUtils").lockForMessageRangeSync(["message","message-association"],[g],b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield d("WAWebApiActiveMessageRanges").addActiveMessageRange(a.id.toString(),d("WAWebApiActiveMessageRanges").getActiveRangeAction("clearChat",{deleteStarred:!f}),i.binarySyncAction);var b=d("decodeProtobuf").decodeProtobuf(d("WASyncAction.pb").SyncActionValueSpec,i.binarySyncAction);b=c("WANullthrows")((b=b.clearChatAction)==null?void 0:b.messageRange);j=(yield d("WAWebDBQueryAndRemoveMessageHistory").queryAndRemoveMessagesInMessageRange(a.id,b,{skipStarred:f,skipRecentSystemMessages:!1}))}));return{result:j}});return j.apply(this,arguments)}function a(a,c,e){return i(a,c,e).then(function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){if(b.result!=null&&b.result.length>0){var c=b.result;d("WAWebUpdateLastAddOnPreviewChatAction").deleteModelsForLastAddOnPreview(c);yield d("WAWebPersistedJobManager").getJobManager().waitUntilPersisted(d("WAWebPersistedJobDefinitions").jobSerializers.deleteAddOns(a.id.toString(),c));void d("WAWebDBReportingTokenUtils").handleDeleteReportingInfos(c,{removeWholeRow:!0})}return b});return function(a){return c.apply(this,arguments)}}())}g.sendClear=a}),98); __d("WAWebNonMessageDataRequestHistorySyncOnDemandUtils",["WALogger","WAShiftTimer","WATimeUtils","WAWebABProps","WAWebBackendApi","WAWebDBMessageSerialization","WAWebDBMessageUtils","WAWebSchemaMessage","WAWebUserPrefsHistorySync","asyncToGeneratorRuntime","gkx"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[rdu] delete chat "," from initial sync boundary"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[rdu] cannot delete chat "," from initial sync boundary."]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[rdu] re-enable history sync on demand."]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[rdu] disable history sync on demand for ","ms."]);k=function(){return a};return a}var l=new Map(),m={disableRequestSending:!1,failureCount:0};function n(a){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=d("WAWebDBMessageUtils").beginningOfChat(a);a=d("WAWebDBMessageUtils").endOfChat(a);b=(yield d("WAWebSchemaMessage").getMessageTable().between(["internalId"],b,a,{limit:1,reverse:!1,shouldDecrypt:!1}));return b.length===0?null:b[0]});return o.apply(this,arguments)}function a(a){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield n(a));return a!=null?d("WAWebDBMessageSerialization").messageFromDbRow(a):null});return p.apply(this,arguments)}function e(a){d("WAWebBackendApi").frontendFireAndForget("successHistorySyncOd",{chatId:a}),q()}function f(a){d("WAWebBackendApi").frontendFireAndForget("errorHistorySyncOd",{chatId:a});a=d("WATimeUtils").unixTime();var b=m.firstFailureRequestTimeStampSec;b==null&&(m.firstFailureRequestTimeStampSec=a);m.failureCount+=1;var c=d("WAWebABProps").getABPropConfigValue("history_sync_on_demand_failure_limit"),e=d("WAWebABProps").getABPropConfigValue("history_sync_on_demand_cooldown_sec");if(m.failureCount>=c&&b!=null&&a-b<e){m.disableRequestSending=!0;c=1e3*e;d("WALogger").LOG(k(),c);new(d("WAShiftTimer").ShiftTimer)(function(){m.disableRequestSending&&(d("WALogger").LOG(j()),q())}).onOrAfter(c)}}function q(){m.disableRequestSending=!1,m.failureCount=0,m.firstFailureRequestTimeStampSec=void 0}function r(a){var b=d("WAWebUserPrefsHistorySync").getHistoryInitialSyncBoundary();if(b==null||Object.keys(b).length===0||(b==null?void 0:b[a.toJid()])==null){d("WALogger").LOG(i(),c("gkx")("26258")?"":a.toJid());return}d("WALogger").LOG(h(),c("gkx")("26258")?"":a.toJid());delete b[a.toJid()];void d("WAWebUserPrefsHistorySync").setHistoryInitialSyncBoundary(b)}g.inFlightHistorySyncOnDemandRequests=l;g.historySyncOnDemandRequestsFailureRecord=m;g.getOldestMsgInChatFromDB=a;g.handleHistorySyncOnDemandSuccess=e;g.handleHistorySyncOnDemandFailure=f;g.deleteChatFromInitialSyncBoundary=r}),98); __d("WAWebChatDeleteBridge",["Promise","WALogger","WASyncdConst","WATimeUtils","WAWebABProps","WAWebApiActiveMessageRanges","WAWebApiChat","WAWebApiOrphanTcToken","WAWebBizChatAssignmentAction","WAWebBizGatingUtils","WAWebDBLabelAssociationDatabaseApi","WAWebDBQueryAndRemoveMessageHistory","WAWebDeleteChatSync","WAWebEditLabelAssociationBridge","WAWebFtsClient","WAWebListsGatingUtils","WAWebMessageRangeUtils","WAWebModelStorageUtils","WAWebMuteChatSync","WAWebNonMessageDataRequestHistorySyncOnDemandUtils","WAWebPersistedJobDefinitions","WAWebPersistedJobManager","WAWebPinChatSync","WAWebSchemaChat","WAWebSchemaGroupMetadata","WAWebSchemaLabelAssociation","WAWebSyncdDb","WAWebUpdateLastAddOnPreviewChatAction","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["sendConversationDelete: chat boundaries was null"]);i=function(){return a};return a}function a(a){return d("WAWebModelStorageUtils").getStorage().lock(["chat","label-association","message-association","message","chat-assignment","orphan-tc-token","sync-actions"],b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var c=(yield d("WAWebDBQueryAndRemoveMessageHistory").getBoundsForChat(a)),e=(yield d("WAWebSchemaChat").getChatTable().get(a.toString()));e=(yield (h||(h=b("Promise"))).all([d("WAWebSchemaChat").getChatTable().remove(a.toString()),d("WAWebDBQueryAndRemoveMessageHistory").queryAndRemoveMessageHistory(a),j(a),d("WAWebBizChatAssignmentAction").removeChatAssignmentsForChat(a),l(a,e==null?void 0:e.tcToken,e==null?void 0:e.tcTokenTimestamp),t(a,(e==null?void 0:e.accountLid)!=null?d("WAWebWidFactory").createWid(e.accountLid):null)]));e[0];var f=e[1];e[2];return{chatBoundaries:c,deletedMsgIds:f}})).then(function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){var c=b.chatBoundaries;b=b.deletedMsgIds;!c?d("WALogger").WARN(i()):(d("WAWebFtsClient").ftsClient.purgeRange(babelHelpers["extends"]({chatId:a.toString()},c)),d("WAWebUpdateLastAddOnPreviewChatAction").deleteModelsForLastAddOnPreview(b),yield d("WAWebPersistedJobManager").getJobManager().waitUntilPersisted(d("WAWebPersistedJobDefinitions").jobSerializers.deleteAddOns(a.toString(),b)))});return function(a){return c.apply(this,arguments)}}())}function j(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!(d("WAWebBizGatingUtils").canEditLabelAssociation()||d("WAWebListsGatingUtils").isListsEnabled()))return;a=(yield n(a));var b=a.labelsToUpdate;a=a.modelRecords;yield d("WAWebEditLabelAssociationBridge").editLocalLabelAssociationMD(b,a)});return k.apply(this,arguments)}function l(a,b,c){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e){return d("WAWebABProps").getABPropConfigValue("enable_spam_report_iq_with_privacy_token")&&c!=null&&e!=null?d("WAWebApiOrphanTcToken").createOrUpdateOrphanTcToken(a.toString(),{tcToken:c,tcTokenTimestamp:e}):(h||(h=b("Promise"))).resolve()});return m.apply(this,arguments)}function n(a){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield d("WAWebDBLabelAssociationDatabaseApi").queryLocalLabelAssociations([{associationId:a.toString(),type:d("WAWebSchemaLabelAssociation").LabelAssociationType.Jid}]));return{labelsToUpdate:b.map(function(a){a=a.labelId;return{id:a,type:"remove"}}),modelRecords:[{labelAssociationType:d("WAWebSchemaLabelAssociation").LabelAssociationType.Jid,modelId:a.toString(),mutationIndexSegments:[a.toString({legacy:!0})]}]}});return o.apply(this,arguments)}function p(a,b,c,d,e){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e,f,g,i){f===void 0&&(f=!1);var k=d("WATimeUtils").unixTimeMs();k=(yield (h||(h=b("Promise"))).all([c("WAWebDeleteChatSync").getDeleteChatMutation(k,a,!f),d("WAWebPinChatSync").PinChatSync.getPinMutation(k,!1,a),r(a)]));var m=k[0],n=k[1];k=k[2];k=[].concat(k,[n]);e&&k.push(m);var o;yield d("WAWebMessageRangeUtils").lockForMessageRangeSync(["message","chat","label-association","message-association","group-metadata","orphan-tc-token","sync-actions"],k,b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield d("WAWebApiActiveMessageRanges").addActiveMessageRange(a.toString(),d("WAWebApiActiveMessageRanges").getActiveRangeAction("deleteChat",{deleteMedia:!f}),m.binarySyncAction);o=(yield d("WAWebDBQueryAndRemoveMessageHistory").queryAndRemoveMessageHistory(a));var c=(yield d("WAWebApiChat").getChatRecord(a));yield (h||(h=b("Promise"))).all([d("WAWebSchemaChat").getChatTable().remove(a.toString()),d("WAWebSchemaGroupMetadata").getGroupMetadataTable().remove(a.toString()),j(a),l(a,g,i),t(a,(c==null?void 0:c.accountLid)!=null?d("WAWebWidFactory").createWid(c.accountLid):null)])}));return{status:200,result:o}});return q.apply(this,arguments)}function r(a){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!(d("WAWebBizGatingUtils").canEditLabelAssociation()||d("WAWebListsGatingUtils").isListsEnabled()))return[];a=(yield n(a));var b=a.labelsToUpdate;a=a.modelRecords;return d("WAWebEditLabelAssociationBridge").createLabelAssociationMutations(b,a)});return s.apply(this,arguments)}function t(a,b){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){var f=[JSON.stringify([c("WAWebMuteChatSync").getAction(),a.toJid()])];e!=null&&f.push(JSON.stringify([c("WAWebMuteChatSync").getAction(),e.toJid()]));e=(yield (h||(h=b("Promise"))).all(f.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield d("WAWebSyncdDb").getSyncAction(a));if(b==null||b.actionState===d("WASyncdConst").SyncActionState.Orphan)return;return a});return function(b){return a.apply(this,arguments)}}()))).filter(Boolean);yield d("WAWebSyncdDb").updateSyncActionRows(e.map(function(b){return{index:b,actionState:d("WASyncdConst").SyncActionState.Orphan,modelType:d("WASyncdConst").SyncModelType.Chat,modelId:a.toString()}}))});return u.apply(this,arguments)}function e(a,c,e){return p(a,!0,!1,c,e).then(function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){if(b.result!=null&&b.result.length>0){var c=b.result;d("WAWebUpdateLastAddOnPreviewChatAction").deleteModelsForLastAddOnPreview(c);d("WAWebNonMessageDataRequestHistorySyncOnDemandUtils").deleteChatFromInitialSyncBoundary(a);yield d("WAWebPersistedJobManager").getJobManager().waitUntilPersisted(d("WAWebPersistedJobDefinitions").jobSerializers.deleteAddOns(a.toString(),c));return b}return b});return function(a){return c.apply(this,arguments)}}())}g.deleteFromStorage=a;g.sendConversationDelete=e}),98); __d("WAWebChatFindBridge",["WAWebApiHydrateWidsUtil","WAWebSchemaChat","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebSchemaChat").getChatTable().get(a,!1));return a?d("WAWebApiHydrateWidsUtil").hydrateWids(a):null});return h.apply(this,arguments)}g.findLocal=a}),98); __d("WAWebChatGetExistingBridge",["WAWebChatCollection","WAWebChatFindBridge","WAWebNewsletterCollection","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=d("WAWebChatCollection").ChatCollection.get(a);if(b&&!b.stale)return b;b=a.isNewsletter();if(b){var e=c("WAWebNewsletterCollection").get(a);if(e!=null&&!e.stale)return c("WAWebNewsletterCollection").get(a)}e=(yield d("WAWebChatFindBridge").findLocal(a.toString()));return e?b?c("WAWebNewsletterCollection").gadd(e):d("WAWebChatCollection").ChatCollection.gadd(e):null});return h.apply(this,arguments)}g.getExisting=a}),98); __d("WAWebChatMuteBridge",["WAWebMuteChatSync","WAWebSyncdCoreApi","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b,c){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e){e=(yield c("WAWebMuteChatSync").generateMuteMutation(a,b));e=d("WAWebSyncdCoreApi").lockForSync(["chat"],[e],function(c){c=c[0];return c.merge(a.toString(),{muteExpiration:b})}).then(function(){return{status:200}});return e});return h.apply(this,arguments)}g.sendConversationMute=a}),98); __d("WAWebWamEnumActionConducted",[],(function(a,b,c,d,e,f){a=Object.freeze({MUTE:1,UNMUTE:2,EXPIRE:3});f.ACTION_CONDUCTED=a}),66); __d("WAWebWamEnumChatMuteNotificationChoice",[],(function(a,b,c,d,e,f){a=Object.freeze({NO_NOTIFICATIONS_WHEN_MUTED:1,YES_NOTIFICATIONS_WHEN_MUTED:2});f.CHAT_MUTE_NOTIFICATION_CHOICE=a}),66); __d("WAWebWamEnumMuteChatType",[],(function(a,b,c,d,e,f){a=Object.freeze({ONE_ON_ONE:1,GROUP:2,CHANNEL:3,INTEROP:4,INORGANIC_NOTIFICATION:5});f.MUTE_CHAT_TYPE=a}),66); __d("WAWebWamEnumMuteEntryPoint",[],(function(a,b,c,d,e,f){a=Object.freeze({CHAT_LIST_SCREEN:1,CONTACT_INFO:2,CONVERSATION_SCREEN:3,CHAT_MORE_OPTIONS:4,CHAT_LONG_PRESS_OPTIONS:5,INORGANIC_NOTIFICATION:6});f.MUTE_ENTRY_POINT=a}),66); __d("WAWebWamEnumWaOfficialAccountName",[],(function(a,b,c,d,e,f){a=Object.freeze({WHATSAPP_CHATPSA:1});f.WA_OFFICIAL_ACCOUNT_NAME=a}),66); __d("WAWebChatMuteWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumActionConducted","WAWebWamEnumChatMuteNotificationChoice","WAWebWamEnumMuteChatType","WAWebWamEnumMuteEntryPoint","WAWebWamEnumWaOfficialAccountName"],(function(a,b,c,d,e,f,g){a=d("WAWebWamCodegenUtils").defineEvents({ChatMute:[2280,{actionConducted:[3,d("WAWebWamEnumActionConducted").ACTION_CONDUCTED],chatMuteNotificationChoice:[5,d("WAWebWamEnumChatMuteNotificationChoice").CHAT_MUTE_NOTIFICATION_CHOICE],muteChatType:[4,d("WAWebWamEnumMuteChatType").MUTE_CHAT_TYPE],muteDuration:[1,d("WAWebWamCodegenUtils").TYPES.TIMER],muteEntryPoint:[6,d("WAWebWamEnumMuteEntryPoint").MUTE_ENTRY_POINT],muteGroupSize:[2,d("WAWebWamCodegenUtils").TYPES.INTEGER],waOfficialAccountName:[7,d("WAWebWamEnumWaOfficialAccountName").WA_OFFICIAL_ACCOUNT_NAME]},[1,1,1],"regular"]},{ChatMute:[]});g.ChatMuteWamEvent=a}),98); __d("WAWebWamEnumPsaMessageActionType",[],(function(a,b,c,d,e,f){a=Object.freeze({SAVE:1,FORWARD:2,REACT:3,LINK_CLICK:4,MEDIA_PLAY:5,DELETE:6});f.PSA_MESSAGE_ACTION_TYPE=a}),66); __d("WAWebChatPsaActionWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumMediaType","WAWebWamEnumPsaMessageActionType"],(function(a,b,c,d,e,f,g){a=d("WAWebWamCodegenUtils").defineEvents({ChatPsaAction:[3572,{messageMediaType:[1,d("WAWebWamEnumMediaType").MEDIA_TYPE],psaCampaignId:[4,d("WAWebWamCodegenUtils").TYPES.STRING],psaMessageActionType:[2,d("WAWebWamEnumPsaMessageActionType").PSA_MESSAGE_ACTION_TYPE],psaMsgId:[5,d("WAWebWamCodegenUtils").TYPES.STRING]},[1,1,1],"regular"]},{ChatPsaAction:[]});g.ChatPsaActionWamEvent=a}),98); __d("WAWebWamEnumReadEntryPoint",[],(function(a,b,c,d,e,f){a=Object.freeze({CHAT_LIST:1,CHAT:2});f.READ_ENTRY_POINT=a}),66); __d("WAWebChatPsaReadWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumMediaType","WAWebWamEnumReadEntryPoint"],(function(a,b,c,d,e,f,g){a=d("WAWebWamCodegenUtils").defineEvents({ChatPsaRead:[3574,{messageMediaType:[1,d("WAWebWamEnumMediaType").MEDIA_TYPE],psaCampaignId:[4,d("WAWebWamCodegenUtils").TYPES.STRING],psaMsgId:[5,d("WAWebWamCodegenUtils").TYPES.STRING],readEntryPoint:[3,d("WAWebWamEnumReadEntryPoint").READ_ENTRY_POINT]},[1,1,1],"regular"]},{ChatPsaRead:[]});g.ChatPsaReadWamEvent=a}),98); __d("WAWebWamEnumPsaBlockReason",[],(function(a,b,c,d,e,f){a=Object.freeze({OTHER:0,MESSAGES_ARENT_HELPFUL:1,TOO_MANY_MESSAGES:2,IT_LOOKS_SUSPICIOUS:3});f.PSA_BLOCK_REASON=a}),66); __d("WAWebWamEnumPsaMessageRemoveAction",[],(function(a,b,c,d,e,f){a=Object.freeze({BLOCK:1,UNBLOCK:2,ARCHIVE:3,UNARCHIVE:4,CLEAR:5,DELETE_ALL:6});f.PSA_MESSAGE_REMOVE_ACTION=a}),66); __d("WAWebWamEnumPsaMessageRemoveEntryPoint",[],(function(a,b,c,d,e,f){a=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});f.PSA_MESSAGE_REMOVE_ENTRY_POINT=a}),66); __d("WAWebChatPsaRemoveWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumMediaType","WAWebWamEnumPsaBlockReason","WAWebWamEnumPsaMessageRemoveAction","WAWebWamEnumPsaMessageRemoveEntryPoint","WAWebWamEnumWaOfficialAccountName"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({ChatPsaRemove:[3582,{lastReceivedMediaType:[2,d("WAWebWamEnumMediaType").MEDIA_TYPE],lastReceivedMessageTs:[4,a.TYPES.TIMER],lastReceivedMsgId:[8,a.TYPES.STRING],psaBlockReason:[10,d("WAWebWamEnumPsaBlockReason").PSA_BLOCK_REASON],psaCampaignId:[9,a.TYPES.STRING],psaMessageRemoveAction:[5,d("WAWebWamEnumPsaMessageRemoveAction").PSA_MESSAGE_REMOVE_ACTION],psaMessageRemoveEntryPoint:[6,d("WAWebWamEnumPsaMessageRemoveEntryPoint").PSA_MESSAGE_REMOVE_ENTRY_POINT],waOfficialAccountName:[7,d("WAWebWamEnumWaOfficialAccountName").WA_OFFICIAL_ACCOUNT_NAME]},[1,1,1],"regular"]},{ChatPsaRemove:[]});g.ChatPsaRemoveWamEvent=b}),98); __d("WAWebWamChatPSALogger",["WAWebChatMuteWamEvent","WAWebChatPsaActionWamEvent","WAWebChatPsaReadWamEvent","WAWebChatPsaRemoveWamEvent","WAWebWamEnumActionConducted","WAWebWamEnumChatMuteNotificationChoice","WAWebWamEnumMuteChatType","WAWebWamEnumPsaMessageActionType","WAWebWamEnumPsaMessageRemoveAction","WAWebWamEnumPsaMessageRemoveEntryPoint","WAWebWamEnumReadEntryPoint","WAWebWamEnumWaOfficialAccountName","WAWebWamMsgUtils"],(function(a,b,c,d,e,f,g){function a(a){if(a.campaignId!=null){new(d("WAWebChatPsaReadWamEvent").ChatPsaReadWamEvent)({messageMediaType:a.getWamMediaType(),psaMsgId:a.id.id.toString(),psaCampaignId:(a=a.campaignId)==null?void 0:a.toString(),readEntryPoint:d("WAWebWamEnumReadEntryPoint").READ_ENTRY_POINT.CHAT}).commit()}}function b(a,b){new(d("WAWebChatMuteWamEvent").ChatMuteWamEvent)({actionConducted:d("WAWebWamEnumActionConducted").ACTION_CONDUCTED.MUTE,chatMuteNotificationChoice:d("WAWebWamEnumChatMuteNotificationChoice").CHAT_MUTE_NOTIFICATION_CHOICE.NO_NOTIFICATIONS_WHEN_MUTED,muteChatType:d("WAWebWamEnumMuteChatType").MUTE_CHAT_TYPE.ONE_ON_ONE,muteDuration:b,muteEntryPoint:a,waOfficialAccountName:d("WAWebWamEnumWaOfficialAccountName").WA_OFFICIAL_ACCOUNT_NAME.WHATSAPP_CHATPSA}).commit()}function c(a){new(d("WAWebChatMuteWamEvent").ChatMuteWamEvent)({actionConducted:d("WAWebWamEnumActionConducted").ACTION_CONDUCTED.UNMUTE,muteChatType:d("WAWebWamEnumMuteChatType").MUTE_CHAT_TYPE.ONE_ON_ONE,muteEntryPoint:a,waOfficialAccountName:d("WAWebWamEnumWaOfficialAccountName").WA_OFFICIAL_ACCOUNT_NAME.WHATSAPP_CHATPSA}).commit()}function e(a){var b;new(d("WAWebChatPsaActionWamEvent").ChatPsaActionWamEvent)({messageMediaType:a.getWamMediaType(),psaCampaignId:(b=a.campaignId)==null?void 0:b.toString(),psaMessageActionType:d("WAWebWamEnumPsaMessageActionType").PSA_MESSAGE_ACTION_TYPE.SAVE,psaMsgId:a.id.id.toString()}).commit()}function f(a){var b;new(d("WAWebChatPsaActionWamEvent").ChatPsaActionWamEvent)({messageMediaType:d("WAWebWamMsgUtils").getWamMediaType(a),psaCampaignId:(b=a.campaignId)==null?void 0:b.toString(),psaMessageActionType:d("WAWebWamEnumPsaMessageActionType").PSA_MESSAGE_ACTION_TYPE.DELETE,psaMsgId:a.id.id.toString()}).commit()}function h(a){var b;new(d("WAWebChatPsaActionWamEvent").ChatPsaActionWamEvent)({messageMediaType:a.getWamMediaType(),psaCampaignId:(b=a.campaignId)==null?void 0:b.toString(),psaMessageActionType:d("WAWebWamEnumPsaMessageActionType").PSA_MESSAGE_ACTION_TYPE.FORWARD,psaMsgId:a.id.id.toString()}).commit()}function i(a,b,c){new(d("WAWebChatPsaActionWamEvent").ChatPsaActionWamEvent)({messageMediaType:a,psaCampaignId:b==null?void 0:b.toString(),psaMessageActionType:d("WAWebWamEnumPsaMessageActionType").PSA_MESSAGE_ACTION_TYPE.MEDIA_PLAY,psaMsgId:c.toString()}).commit()}function j(a,b,c){a?new(d("WAWebChatPsaRemoveWamEvent").ChatPsaRemoveWamEvent)({lastReceivedMediaType:a.getWamMediaType(),lastReceivedMessageTs:a.t,lastReceivedMsgId:a.id.id.toString(),psaMessageRemoveAction:k(b),psaMessageRemoveEntryPoint:l(c),waOfficialAccountName:d("WAWebWamEnumWaOfficialAccountName").WA_OFFICIAL_ACCOUNT_NAME.WHATSAPP_CHATPSA}).commit():new(d("WAWebChatPsaRemoveWamEvent").ChatPsaRemoveWamEvent)({psaMessageRemoveAction:k(b),psaMessageRemoveEntryPoint:l(c),waOfficialAccountName:d("WAWebWamEnumWaOfficialAccountName").WA_OFFICIAL_ACCOUNT_NAME.WHATSAPP_CHATPSA}).commit()}function k(a){switch(a){case 1:return d("WAWebWamEnumPsaMessageRemoveAction").PSA_MESSAGE_REMOVE_ACTION.BLOCK;case 2:return d("WAWebWamEnumPsaMessageRemoveAction").PSA_MESSAGE_REMOVE_ACTION.UNBLOCK;case 3:return d("WAWebWamEnumPsaMessageRemoveAction").PSA_MESSAGE_REMOVE_ACTION.ARCHIVE;case 4:return d("WAWebWamEnumPsaMessageRemoveAction").PSA_MESSAGE_REMOVE_ACTION.UNARCHIVE;case 5:return d("WAWebWamEnumPsaMessageRemoveAction").PSA_MESSAGE_REMOVE_ACTION.CLEAR;case 6:return d("WAWebWamEnumPsaMessageRemoveAction").PSA_MESSAGE_REMOVE_ACTION.DELETE_ALL}}function l(a){switch(a){case 1:return d("WAWebWamEnumPsaMessageRemoveEntryPoint").PSA_MESSAGE_REMOVE_ENTRY_POINT.BLOCK_FROM_CONTACT_INFO;case 2:return d("WAWebWamEnumPsaMessageRemoveEntryPoint").PSA_MESSAGE_REMOVE_ENTRY_POINT.BLOCK_FROM_CHAT;case 3:return d("WAWebWamEnumPsaMessageRemoveEntryPoint").PSA_MESSAGE_REMOVE_ENTRY_POINT.UNBLOCK_FROM_CONTACT_INFO;case 4:return d("WAWebWamEnumPsaMessageRemoveEntryPoint").PSA_MESSAGE_REMOVE_ENTRY_POINT.UNBLOCK_FROM_CHAT;case 5:return d("WAWebWamEnumPsaMessageRemoveEntryPoint").PSA_MESSAGE_REMOVE_ENTRY_POINT.UNBLOCK_FROM_PRIVACY_SETTINGS;case 6:return d("WAWebWamEnumPsaMessageRemoveEntryPoint").PSA_MESSAGE_REMOVE_ENTRY_POINT.ARCHIVE_FROM_CHAT_LIST;case 7:return d("WAWebWamEnumPsaMessageRemoveEntryPoint").PSA_MESSAGE_REMOVE_ENTRY_POINT.ARCHIVE_FROM_DELETE_OPTION;case 8:return d("WAWebWamEnumPsaMessageRemoveEntryPoint").PSA_MESSAGE_REMOVE_ENTRY_POINT.UNARCHIVE_FROM_ARCHIVED_CHAT_LIST;case 9:return d("WAWebWamEnumPsaMessageRemoveEntryPoint").PSA_MESSAGE_REMOVE_ENTRY_POINT.CLEAR_FROM_CONTACT_INFO;case 10:return d("WAWebWamEnumPsaMessageRemoveEntryPoint").PSA_MESSAGE_REMOVE_ENTRY_POINT.CLEAR_FROM_CHAT_LIST;case 11:return d("WAWebWamEnumPsaMessageRemoveEntryPoint").PSA_MESSAGE_REMOVE_ENTRY_POINT.DELETE_ALL_FROM_CHAT_LIST;case 12:return d("WAWebWamEnumPsaMessageRemoveEntryPoint").PSA_MESSAGE_REMOVE_ENTRY_POINT.DELETE_ALL_FROM_CONTACT_INFO;case 13:return d("WAWebWamEnumPsaMessageRemoveEntryPoint").PSA_MESSAGE_REMOVE_ENTRY_POINT.DELETE_ALL_FROM_CONVERSATION;case 14:return d("WAWebWamEnumPsaMessageRemoveEntryPoint").PSA_MESSAGE_REMOVE_ENTRY_POINT.CLEAR_FROM_CONVERSATION}}g.logChatPSARead=a;g.logChatPSAMute=b;g.logChatPSAUnmute=c;g.logChatPSAStar=e;g.logChatPSADelete=f;g.logChatPSAForward=h;g.logChatPSAMediaPlay=i;g.logChatPSARemove=j}),98); __d("WAWebSendReadReceiptJob",["Promise","WAJids","WALogger","WANullthrows","WATimeUtils","WAWebAck","WAWebApiChat","WAWebDBMsgUtils","WAWebHandlePlaceholderWam","WAWebModelStorageUtils","WAWebMsgKey","WAWebMsgType","WAWebPrivacySettings","WAWebSchemaMessage","WAWebSendReceiptJobCommon","WAWebUserPrefsGeneral","WAWebUserPrefsMeUser","WAWebWamChatPSALogger","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[message-edit/mark-as-read]: marked edits as read"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[message-edit/mark-as-read]: sent bot read-self receipts"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[message-edit/mark-as-read]: sent read receipts"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[message-edit/mark-as-read]: start"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["markStatusRead: message is not a status."]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["markChatRead: chatId: ",", lastKey: ",", pendings: "," "]);n=function(){return a};return a}var o=d("WAWebWidFactory").createWid(d("WAJids").STATUS_JID);function p(a,b){if(a.isNewsletter())return d("WAWebSendReceiptJobCommon").RECEIPT_TYPE.READ_SELF;if(a.isStatus()&&b!=null&&b.isPSA()||c("WAWebWid").isPSA(a))return d("WAWebSendReceiptJobCommon").RECEIPT_TYPE.READ_SELF;return a.isGroup()?d("WAWebSendReceiptJobCommon").RECEIPT_TYPE.READ:d("WAWebUserPrefsGeneral").getUserPrivacySettings().readReceipts===d("WAWebPrivacySettings").ALL_NONE.none?d("WAWebSendReceiptJobCommon").RECEIPT_TYPE.READ_SELF:d("WAWebSendReceiptJobCommon").RECEIPT_TYPE.READ}function a(a,b){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){var f=Date.now().toString(),g=String(a.id),i=(yield d("WAWebApiChat").queryPendingReadReceiptMsgRows(g));d("WALogger").DEV(n(),g,e,i.length);i.sort(function(a,b){a=a.rowId||0;b=b.rowId||0;return a-b});e=e?String(e):null;var j=i.length-1;if(e){for(j;j>=0;j--)if(i[j].id===e)break;j<0&&(j=i.length-1)}e=null;var k=[];for(j;j>=0;j--){var l=i[j],m=a.msgs.get(l.id);m&&c("WAWebWid").isPSA(a.id)&&d("WAWebWamChatPSALogger").logChatPSARead(m);l.rowId!=null&&(e==null||l.rowId>e)&&(e=l.rowId);m=c("WAWebMsgKey").fromString(l.id);if(l.type===d("WAWebMsgType").MSG_TYPE.CIPHERTEXT){void d("WAWebHandlePlaceholderWam").viewPlaceholderWam([l]);continue}var o=l.broadcastId||l.from;l=l.author||l.from;k.push({id:m.id,sender:d("WAWebWidFactory").createWidFromWidLike(l),chat:d("WAWebWidFactory").createWidFromWidLike(o)})}m=t(k);var q=m[0];l=m[1];yield (h||(h=b("Promise"))).all([].concat(Array.from(q.keys()).map(function(b){var c=q.get(b);if(!c)return;var e;!a.trusted?e=d("WAWebSendReceiptJobCommon").RECEIPT_TYPE.READ_SELF:e=p(a.id);return d("WAWebSendReceiptJobCommon").sendAggregateReceipts({to:b,type:e,t:f,groupedReceipt:c})}),Array.from(l.keys()).map(function(a){var b=q.get(a);if(!b)return;return d("WAWebSendReceiptJobCommon").sendAggregateReceipts({to:a,type:d("WAWebSendReceiptJobCommon").RECEIPT_TYPE.READ_SELF,t:f,groupedReceipt:b})})));return d("WAWebApiChat").markMessageAndChatAsRead(e,g,!1)});return q.apply(this,arguments)}function e(a,b){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if(a.remote.user!=="status"){d("WALogger").WARN(m());return}if(a.fromMe)return;yield d("WAWebSendReceiptJobCommon").sendAggregateReceipts({to:o,type:p(o,c("WANullthrows")(a.participant)),t:String(b),groupedReceipt:new Map([[c("WANullthrows")(a.participant),[a.id]]])});var e={ack:d("WAWebAck").ACK.READ};a.participant&&a.participant.isPSA()&&(e.statusPSAReadTimestamp=b);yield d("WAWebSchemaMessage").getMessageTable().merge(a.toString(),e)});return r.apply(this,arguments)}function f(a){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=String(d("WATimeUtils").unixTime());a=t(a.filter(function(a){return!d("WAWebUserPrefsMeUser").isSerializedWidMe(a.sender)}).map(function(a){return{chat:a.msgKey.remote,sender:d("WAWebWidFactory").createWidFromWidLike(a.sender),id:a.msgKey.id}}));var e=a[0];yield (h||(h=b("Promise"))).all(Array.from(e.keys()).map(function(a){var b=e.get(a);if(!b)return;return d("WAWebSendReceiptJobCommon").sendAggregateReceipts({to:a,type:d("WAWebSendReceiptJobCommon").RECEIPT_TYPE.READ_SELF,t:c,groupedReceipt:b})}))});return s.apply(this,arguments)}function t(a){var b=new Map(),c=new Map();a.forEach(function(a){var d,e,f=a.chat,g=a.sender;a=a.id;var h=!f.isBot()&&g.isBot();h=h?c:b;d=(d=h.get(f))!=null?d:new Map();e=(e=d.get(g))!=null?e:[];e.push(a);d.set(g,e);h.set(f,d)});return[b,c]}function u(a,b){return v.apply(this,arguments)}function v(){v=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){var f=String(a),g=(yield w(f));if(!g.length)return;d("WALogger").DEV(l()).devConsole({chatIdString:f,pendingMsgRows:g});var h=[];g.forEach(function(b){var e=c("WAWebMsgKey").fromString(b.latestEditMsgKey);b=b.author||b.from;h.push({id:e.id,sender:d("WAWebWidFactory").createWidFromWidLike(b),chat:d("WAWebWidFactory").createWidFromWidLike(a)})});g=t(h);var m=g[0];g=g[1];m=m.get(a);g=g.get(a);var n=Date.now().toString();if(m){!e.trusted?e=d("WAWebSendReceiptJobCommon").RECEIPT_TYPE.READ_SELF:e=p(a);yield d("WAWebSendReceiptJobCommon").sendAggregateReceipts({to:a,type:e,t:n,groupedReceipt:m});d("WALogger").DEV(k()).devConsole({groupedReceiptsBySender:m})}g&&(yield d("WAWebSendReceiptJobCommon").sendAggregateReceipts({to:a,type:d("WAWebSendReceiptJobCommon").RECEIPT_TYPE.READ_SELF,t:n,groupedReceipt:g}),d("WALogger").DEV(j()).devConsole({botInvokeResponseGroupedReceiptsBySender:g}));return d("WAWebModelStorageUtils").getStorage().lock(["message"],function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a[0];var b=new Set(h.map(function(a){return a.id})),e=(yield w(f)).filter(function(a){return b.has(c("WAWebMsgKey").fromString(a.latestEditMsgKey).id)});e=e.map(function(a){return{id:a.id,pendingReadReceipt:null}});e.length>0&&(yield a.bulkCreateOrMerge(e),d("WALogger").DEV(i()).devConsole({msgUpdates:e}))});return function(b){return a.apply(this,arguments)}}())});return v.apply(this,arguments)}function w(a){return d("WAWebSchemaMessage").getMessageTable().equals(["from","pendingReadReceipt"],[a,d("WAWebDBMsgUtils").PendingReadReceiptType.MessageEdit],{shouldDecrypt:!1})}g.getReadReceiptType=p;g.markChatRead=a;g.markStatusRead=e;g.sendAddOnReadReceipts=f;g.groupMsgIdsByChatThenSender=t;g.markEditedMsgsRead=u}),98); __d("WAWebChatSeenBridge",["WALogger","WATimeUtils","WAWebApiActiveMessageRanges","WAWebApiChat","WAWebMarkChatAsReadSync","WAWebMessageRangeUtils","WAWebMiscErrors","WAWebSchemaChat","WAWebSendReadReceiptJob","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["update chat table failed"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["update chat table failed"]);i=function(){return a};return a}function a(a,b,c){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e){var f=d("WATimeUtils").unixTimeMs();if(e===-1){var g=(yield c("WAWebMarkChatAsReadSync").getMarkChatAsReadMutation(f,!0,a.id));e=a.id.toString();d("WAWebMessageRangeUtils").lockForMessageRangeSync([],[g],function(){return d("WAWebApiActiveMessageRanges").addActiveMessageRange(a.id.toString(),"markChatAsRead",g.binarySyncAction)});yield d("WAWebApiChat").updateChatForMarkAsReadSync(e)}else yield d("WAWebSendReadReceiptJob").markChatRead(a,b)});return j.apply(this,arguments)}function e(a,b){b=d("WATimeUtils").unixTimeMs();return c("WAWebMarkChatAsReadSync").getMarkChatAsReadMutation(b,!1,a).then(function(b){return d("WAWebMessageRangeUtils").lockForMessageRangeSync([],[b],function(){return d("WAWebApiActiveMessageRanges").addActiveMessageRange(a.toString(),"markChatAsRead",b.binarySyncAction)})})}function f(a,b){return d("WAWebSchemaChat").getChatTable().merge(a.toString(),{unreadCount:b,unreadDividerOffset:0})["catch"](function(a){if(a instanceof d("WAWebMiscErrors").DbOnLogoutAbort)throw a;d("WALogger").ERROR(i()).verbose().devConsole(a).sendLogs("update chat table failed when mark conversation seen");throw c("err")("update chat table failed")})}function k(a){return d("WAWebSchemaChat").getChatTable().merge(a.toString(),{unreadCount:-1,unreadDividerOffset:0})["catch"](function(a){if(a instanceof d("WAWebMiscErrors").DbOnLogoutAbort)throw a;d("WALogger").ERROR(h()).verbose().devConsole(a).sendLogs("update chat table failed when mark conversation as unseen");throw c("err")("update chat table failed")})}g.sendConversationSeen=a;g.sendConversationUnseen=e;g.markConversationSeen=f;g.markConversationUnseen=k}),98); __d("WAWebSyncdWamAppState",["WAPREList","WAPREMetrics","WAShiftTimer"],(function(a,b,c,d,e,f,g){"use strict";var h=k(),i=new(d("WAShiftTimer").ShiftTimer)(c),j=1e3*60*5;function a(){i.isScheduled()&&i.forceRunNow()}function k(){return{mutationCount:0,invalidActionCount:0,unsupportedActionCount:0,keyRotationRemoveCount:0,storedMutationCount:0,uploadConflictCount:0,unsetActionCount:0,missingKeyCount:0}}function l(){h=k()}function m(a){return{"int":babelHelpers["extends"]({},a)}}function b(a){var b;return{mutationCount:(a==null?void 0:(b=a["int"])==null?void 0:b.mutationCount)||0,invalidActionCount:(a==null?void 0:(b=a["int"])==null?void 0:b.invalidActionCount)||0,unsupportedActionCount:(a==null?void 0:(b=a["int"])==null?void 0:b.unsupportedActionCount)||0,keyRotationRemoveCount:(a==null?void 0:(b=a["int"])==null?void 0:b.keyRotationRemoveCount)||0,storedMutationCount:(a==null?void 0:(b=a["int"])==null?void 0:b.storedMutationCount)||0,uploadConflictCount:(a==null?void 0:(b=a["int"])==null?void 0:b.uploadConflictCount)||0,unsetActionCount:(a==null?void 0:(b=a["int"])==null?void 0:b.unsetActionCount)||0,missingKeyCount:(a==null?void 0:(b=a["int"])==null?void 0:b.missingKeyCount)||0}}function c(){var a=m(h);l();d("WAPREMetrics").startMetric(d("WAPREList").PRE_METRIC.APP_STATE_SYNC_DAILY).endSuccess(a)}function n(){i.onOrBefore(j)}function e(a){if(a===0)return;h.mutationCount+=a;n()}function f(a){h.invalidActionCount=a,n()}function o(a){h.unsupportedActionCount=a,n()}function p(a){if(a===0)return;h.keyRotationRemoveCount+=a;n()}function q(a){h.storedMutationCount=a,n()}function r(){h.uploadConflictCount++,n()}function s(a){if(a===0)return;h.unsetActionCount+=a;n()}function t(a){h.missingKeyCount=a,n()}g.forceCommitAppState=a;g.clear=l;g.convertAppStateSyncDailyFromAnnotations=b;g.addMutationCount=e;g.setInvalidActionCount=f;g.setUnsupportedActionCount=o;g.addKeyRotationRemoveCount=p;g.setStoredMutationCount=q;g.incConflict=r;g.addUnsetActionCount=s;g.setMissingKeyCount=t}),98); __d("WAWebChatSendStarMsgsBridge",["WALogger","WAWebDBProcessMessage","WAWebStarMessageSync","WAWebSyncdCoreApi","WAWebSyncdWamAppState","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["unstar messages failed"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["star messages failed"]);i=function(){return a};return a}function a(a,b,c){return j(b,c)}function e(a,b){return j(a,!1)}function j(a,b){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b||d("WAWebSyncdWamAppState").addUnsetActionCount(a.length);var e=(yield c("WAWebStarMessageSync").getStarMessageMutations(a.map(function(a){return a.id}),b));return d("WAWebSyncdCoreApi").lockForSync(["message","message-association"],e,function(){return b?d("WAWebDBProcessMessage").starMessages(a.map(function(a){return a.id.toString()}))["catch"](function(a){d("WALogger").ERROR(i()).verbose().devConsole(a).sendLogs("star messages failed");throw c("err")("star messages failed")}):d("WAWebDBProcessMessage").unstarMessages(a.map(function(a){return a.id.toString()}))["catch"](function(a){d("WALogger").ERROR(h()).verbose().devConsole(a).sendLogs("unstar messages failed");throw c("err")("unstar messages failed")})})});return k.apply(this,arguments)}g.sendStarMsgs=a;g.sendUnstarAll=e}),98); __d("WAWebDBBulkPersistProfilePic",["WABatcher","WALogger","WAWebSchemaProfilePicThumb","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["bulkPersistProfilePicChanges persisted "," records"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["bulkPersistProfilePicChanges processing "," records"]);i=function(){return a};return a}var j=d("WABatcher").batch({delayMs:3e3},function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield k(a);return[]});return function(b){return a.apply(this,arguments)}}());function a(a){return j(a)}function k(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){d("WALogger").DEV(i(),a.length);a=Array.from(a.reduce(function(a,b){a.set(b.id,b);return a},new Map()).values());yield d("WAWebSchemaProfilePicThumb").getProfilePicThumbTable().bulkCreateOrMerge(a);d("WALogger").DEV(h(),a.length)});return l.apply(this,arguments)}g.persistProfilePicBatched=a;g.bulkPersistProfilePicChanges=k}),98); __d("WAWebGroupGetProfilePicsJob",["WALogger","WASmaxGroupsGetGroupProfilePicturesRPC","WAWebBackendErrors","WAWebWidFactory","WAWebWidToJid","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["getGroupProfilePics failed: ",":",""]);h=function(){return a};return a}var i=Object.freeze({IMAGE:"image",PREVIEW:"preview"}),j=Object.freeze({BLOB:"blob",URL:"url"});function a(a,b,c){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){var e=c.subgroupHintId,f=c.type;f=f===void 0?i.PREVIEW:f;c=c.query;c=c===void 0?j.URL:c;var g={profilePictureTypeMixinArgs:{pictureType:f},profilePictureQueryMixinArgs:{pictureQuery:c}};f=a.map(function(a){var b=a.groupId,c=a.photoId;a=a.isParentGroup;a=a===void 0?!1:a;a=a?{parentGroup:{anyParentGroupJid:d("WAWebWidToJid").widToGroupJid(b)}}:{subGroup:{anySubGroupJid:d("WAWebWidToJid").widToGroupJid(b)}};return babelHelpers["extends"]({parentOrSubGroupMixinGroupArgs:a,profilePictureIdMixinArgs:c!=null?{pictureId:c}:void 0},g)});c=(yield d("WASmaxGroupsGetGroupProfilePicturesRPC").sendGetGroupProfilePicturesRPC({pictureArgs:f,subGroupHintMixinArgs:e?{anyLinkedGroupsMembershipHint:d("WAWebWidToJid").widToGroupJid(e)}:void 0,baseGetGroupOrServerMixinGroupArgs:{baseGetGroup:{iqTo:d("WAWebWidToJid").widToGroupJid(b)}}}));switch(c.name){case"GetGroupProfilePicturesResponseSuccessGroupPictures":a=c.value.picturesPicture.map(function(a){var b;a.parentOrSubGroupMixinGroup.name==="SubGroup"?b=d("WAWebWidFactory").createWid(a.parentOrSubGroupMixinGroup.value.subGroupJid):b=d("WAWebWidFactory").createWid(a.parentOrSubGroupMixinGroup.value.parentGroupJid);switch(a.getGroupProfilePicturesSuccessOrGetGroupProfilePicturesPartialProfilePictureResponseMixinGroup.name){case"GetGroupProfilePicturesSuccessProfilePictureResponse":var c,e=a.getGroupProfilePicturesSuccessOrGetGroupProfilePicturesPartialProfilePictureResponseMixinGroup.value;return{id:b,tag:e.id,eurl:(c=e.profilePictureUrlOrBlobResponseMixinGroup)==null?void 0:c.value.url,directPath:(c=e.profilePictureUrlOrBlobResponseMixinGroup)==null?void 0:c.value.directPath,type:e.type,updatePicture:!0};case"GetGroupProfilePicturesPartialProfilePictureResponse":c=!1;((e=a.getGroupProfilePicturesSuccessOrGetGroupProfilePicturesPartialProfilePictureResponseMixinGroup.value.pictureDidNotChangeOrPictureNotFoundOrBadServerProfilePictureErrorOrBadLinkedGroupProfilePictureErrorMixinGroup)==null?void 0:e.name)==="PictureNotFound"&&(c=!0);return{id:b,tag:null,eurl:null,directPath:null,type:null,updatePicture:c}}});return a;case"GetGroupProfilePicturesResponseClientError":f=c.value.errorGetGroupProfilePictureClientErrors.value.code;e=c.value.errorGetGroupProfilePictureClientErrors.value.text;return l(f,e);case"GetGroupProfilePicturesResponseServerError":b=c.value.errorServerErrors.value.code;a=c.value.errorServerErrors.value.text;return l(b,a)}});return k.apply(this,arguments)}function l(a,b){d("WALogger").ERROR(h(),a,b).tags("non-sad").sendLogs("pictures-error",{sampling:.01});return Promise.reject(new(d("WAWebBackendErrors").ServerStatusCodeError)(Number(a),b))}g.ProfilePicsTypeEnum=i;g.ProfilePicsQueryEnum=j;g.getProfilePics=a}),98); __d("WAWebFetchCommunityProfilePicAction",["Promise","WAWebGroupGetProfilePicsJob","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function a(a,b,c){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e){var f={id:a};e={groupId:a,photoId:e!=null?String(e):null,isParentGroup:a.equals(c)};a=(yield (h||(h=b("Promise"))).all([d("WAWebGroupGetProfilePicsJob").getProfilePics([e],c,{type:d("WAWebGroupGetProfilePicsJob").ProfilePicsTypeEnum.IMAGE}),d("WAWebGroupGetProfilePicsJob").getProfilePics([e],c,{type:d("WAWebGroupGetProfilePicsJob").ProfilePicsTypeEnum.PREVIEW})]));e=a[0];c=a[1];return!c[0]||!c[0].updatePicture||!e[0]||!e[0].updatePicture?f:babelHelpers["extends"]({},f,{eurl:(a=e[0].eurl)!=null?a:void 0,fullDirectPath:(f=e[0].directPath)!=null?f:void 0,previewEurl:(a=c[0].eurl)!=null?a:void 0,previewDirectPath:(f=c[0].directPath)!=null?f:void 0,tag:(a=e[0].tag)!=null?a:void 0,timestamp:Date.now(),eurlStale:!1,stale:!1})});return i.apply(this,arguments)}g.fetchCommunityProfilePic=a}),98); __d("WAWebProfilePicPrivacyTokenGating",[],(function(a,b,c,d,e,f){function a(){return!1}f.isProfilePicIQPrivacyTokenEnabled=a}),66); __d("WAWebGetProfilePicJob",["Promise","WAJids","WALogger","WASmaxProfilePictureGetRPC","WAWebBackendErrors","WAWebProfilePicPrivacyTokenGating","WAWebWidToJid","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["getProfilePic failed: ",":",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["getProfilePic: "," ",", ",", ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["getProfilePic failed with an invalid WID: ",""]);k=function(){return a};return a}function a(a,b){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){if(a.isStatus()||a.isBroadcast()){d("WALogger").ERROR(k(),a.toString()).verbose();return(h||(h=b("Promise"))).reject(new(d("WAWebBackendErrors").ServerStatusCodeError)(401,"getProfilePic failed with an invalid WID: "+a.toString()))}var e=c.preview;e=e===void 0?!0:e;var f=c.invite,g=c.photoId,l=c.tcToken;c=c.commonGid;e=(yield d("WASmaxProfilePictureGetRPC").sendGetRPC({iqTarget:d("WAWebWidToJid").widToChatJid(a),pictureType:e?"preview":"image",pictureId:g!=null?String(g):void 0,pictureQuery:"url",pictureInvite:f,tCTokenMixinArgs:m(l),pictureCommonGid:n(c)}));switch(e.name){case"GetResponseSuccessPictureURL":g=e.value;f=g.pictureId;l=g.pictureType;c=g.pictureUrl;var o=g.pictureDirectPath;g=g.pictureHash;d("WALogger").DEV(j(),a.toString(),f,l,c);return{tag:f,type:l,eurl:c,directPath:o,filehash:g};case"GetResponseError":a=e.value.errorProfilePictureGetErrors.value;d("WALogger").DEV(i(),a.code,a.text);return(h||(h=b("Promise"))).reject(new(d("WAWebBackendErrors").ServerStatusCodeError)(Number(a.code),a.text));case"GetResponseSuccessAvatarURLs":case"GetResponseSuccessNoData":case"GetResponseSuccessPictureBlob":return(h||(h=b("Promise"))).reject(e.value.type)}});return l.apply(this,arguments)}function m(a){var b;d("WAWebProfilePicPrivacyTokenGating").isProfilePicIQPrivacyTokenEnabled()&&a!=null&&(b={privacyTokenContentsMixinArgs:{anyElementValue:new Uint8Array(a)}});return b}function n(a){return d("WAWebProfilePicPrivacyTokenGating").isProfilePicIQPrivacyTokenEnabled()&&a!=null?d("WAJids").toGroupJid(a.toString()):null}g.getProfilePic=a;g.getTcTokenMixinArgs=m}),98); __d("WAWebSendProfilePictureJob",["Promise","WADeprecatedSendIq","WADeprecatedWapParser","WAWap","WAWebBackendErrors","WAWebCommsWapMd","WAWebWid","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h,i=new(c("WADeprecatedWapParser"))("photoResponseParser",function(a){a.assertAttr("type","result");if(a.hasChild("picture")){a=a.child("picture");return{id:a.attrInt("id")}}return{id:null}});function a(a,b){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){a=(yield d("WADeprecatedSendIq").deprecatedSendIq(d("WAWap").wap("iq",{to:d("WAWap").S_WHATSAPP_NET,target:c("WAWebWid").isGroup(a)?d("WAWebCommsWapMd").CHAT_JID(a):d("WAWap").DROP_ATTR,type:"set",xmlns:"w:profile:picture",id:d("WAWap").generateId()},e?d("WAWap").wap("picture",{type:"image"},e):null),i));return!a.success?(h||(h=b("Promise"))).reject(new(d("WAWebBackendErrors").ServerStatusCodeError)(a.errorCode,a.errorText)):{id:a.result.id}});return j.apply(this,arguments)}g["default"]=a}),98); __d("WAWebContactProfilePicThumbBridge",["Promise","WABase64","WAFilteredCatch","WALogger","WAWebBackendErrors","WAWebChangeProfilePicThumb","WAWebDBBulkPersistProfilePic","WAWebFetchCommunityProfilePicAction","WAWebFetchNewsletterProfilePicAction","WAWebGetProfilePicJob","WAWebProfilePicConstants","WAWebSendProfilePictureJob","WAWebURLUtils","WAWebUserPrefsMeUser","WAWebUserPrefsMultiDevice","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["persistProfilePicToDB failed with error ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["persistProfilePicToDB failed with error ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["profilePicFind failed with serverCode: ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["ProfilePicFind:Catch persistProfilePicToDB failed with error ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["persistProfilePicToDB failed with error ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["ProfilePicThumb:resyncPictures error - ",", ",""]);n=function(){return a};return a}function a(a){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=c("WAWebSendProfilePictureJob")(a,null).then(function(){return{status:200}});b=(yield b);d("WAWebChangeProfilePicThumb").changeProfilePicThumb(a,d("WAWebProfilePicConstants").ProfilePicCommand.Remove);return b});return o.apply(this,arguments)}function e(a,b,c){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e,f){e=c("WAWebURLUtils").parseDataURL(f).data;f=d("WABase64").decodeB64(e);e=c("WAWebSendProfilePictureJob")(a,f).then(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var b=(yield d("WAWebGetProfilePicJob").getProfilePic(a,{preview:!1}));return{tag:b.tag,eurl:b.eurl,fullDirectPath:b.directPath,filehash:b.filehash,status:200}}));f=(yield e);d("WAWebChangeProfilePicThumb").changeProfilePicThumb(a,d("WAWebProfilePicConstants").ProfilePicCommand.Set);return f});return p.apply(this,arguments)}function q(a,b){return{id:a.toString(),eurl:(a=b==null?void 0:b.eurl)!=null?a:null,previewEurl:(a=b==null?void 0:b.previewEurl)!=null?a:null,tag:(a=b==null?void 0:b.tag)!=null?a:null,previewDirectPath:(a=b==null?void 0:b.previewDirectPath)!=null?a:null,fullDirectPath:(a=b==null?void 0:b.fullDirectPath)!=null?a:null,filehash:(a=b==null?void 0:b.filehash)!=null?a:null,timestamp:Date.now()}}function r(a,b){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=q(a,b);yield d("WAWebDBBulkPersistProfilePic").persistProfilePicBatched(a)});return s.apply(this,arguments)}function t(a,b){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){c=(h||(h=b("Promise"))).all([d("WAWebGetProfilePicJob").getProfilePic(a,babelHelpers["extends"]({},c,{preview:!1})),d("WAWebGetProfilePicJob").getProfilePic(a,babelHelpers["extends"]({},c,{preview:!0}))]).then(function(a){var b=a[0];a=a[1];var c={eurl:b.eurl,tag:b.tag,previewEurl:a.eurl,previewDirectPath:a.directPath,fullDirectPath:b.directPath};a=(a=a.filehash)!=null?a:b.filehash;a!=null&&(c.filehash=a);return c});try{var e=(yield c);r(a,e)["catch"](function(a){d("WALogger").WARN(m(),a.message).devConsole(a)});x(a,e.eurl)}catch(b){x(a),v(a,b)["catch"](function(a){d("WALogger").WARN(l(),a.message).devConsole(a)})}return c});return u.apply(this,arguments)}function v(a,b){return w.apply(this,arguments)}function w(){w=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if(b instanceof d("WAWebBackendErrors").ServerStatusCodeError){b=b.status;b===500||b===501||b===503?d("WALogger").WARN(k(),b):b===404?yield r(a):b===401&&!a.isGroup()&&(yield r(a))}});return w.apply(this,arguments)}function x(a,b){if(a.equals(d("WAWebUserPrefsMeUser").getMaybeMeUser())){d("WAWebUserPrefsMultiDevice").setCachedProfilePicEURL((a=b)!=null?a:"")}}function f(a){return(h||(h=b("Promise"))).all(a.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){try{var b=(yield t(a.id));return{id:a.id,eurl:b.eurl,tag:b.tag,previewEurl:b.previewEurl,previewDirectPath:b.previewDirectPath,fullDirectPath:b.fullDirectPath,filehash:b.filehash,stale:!1,eurlStale:!1,timestamp:Date.now()}}catch(b){if(b instanceof d("WAWebBackendErrors").ServerStatusCodeError)switch(b.status){case 401:case 404:return{tag:"",id:a.id,stale:!1,eurlStale:!1,timestamp:Date.now()};default:d("WALogger").WARN(n(),b.status,b.message);return{id:a.id,stale:!1,eurlStale:!1,timestamp:Date.now()}}throw b}});return function(b){return a.apply(this,arguments)}}()))}function y(a,b,c,d){return z.apply(this,arguments)}function z(){z=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e,f){try{if(a.isNewsletter()){var g=(yield d("WAWebFetchNewsletterProfilePicAction").fetchNewsletterProfilePic(d("WAWebWidFactory").toNewsletterWid(a)));r(a,g)["catch"](function(a){d("WALogger").WARN(j(),a.message).devConsole(a)});return g}if(c!=null){g=(yield d("WAWebFetchCommunityProfilePicAction").fetchCommunityProfilePic(a,c));r(a,g)["catch"](function(a){d("WALogger").WARN(i(),a.message).devConsole(a)});return g}c=(yield t(a,{tcToken:e,commonGid:f}));g=babelHelpers["extends"]({},c,{id:a,timestamp:Date.now(),eurlStale:!1,stale:!1});return g}catch(c){return d("WAFilteredCatch").filteredCatch(d("WAWebBackendErrors").ServerStatusCodeError,function(c){var d={id:a};switch(c.status){case 401:case 404:d.tag="";d.timestamp=Date.now();d.eurlStale=!1;d.stale=!1;break;case 423:d.stale=!0;break;case 429:d.stale=!0;break;default:d.eurlStale=!1;break}return(h||(h=b("Promise"))).resolve(d)})(c)}});return z.apply(this,arguments)}g.requestDeletePicture=a;g.sendSetPicture=e;g.mapProfilePictureToProfilePicThumbRowType=q;g.persistProfilePicToDB=r;g.profilePicResync=f;g.requestProfilePicFromServer=y}),98); __d("WAWebMexFetchAboutStatusJobQuery.graphql",[],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"user_id"}],b=[{kind:"Literal",name:"updates",value:["STATUS"]},{items:[{fields:[{kind:"Variable",name:"user_id",variableName:"user_id"}],kind:"ObjectValue",name:"users.0"}],kind:"ListValue",name:"users"}],c={alias:null,args:null,kind:"ScalarField",name:"jid",storageKey:null},d={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};return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"WAWebMexFetchAboutStatusJobQuery",selections:[{alias:null,args:b,concreteType:"XWA2UserUpdate",kind:"LinkedField",name:"xwa2_users_updates_since",plural:!0,selections:[c,{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"updates",plural:!0,selections:[d],storageKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"WAWebMexFetchAboutStatusJobQuery",selections:[{alias:null,args:b,concreteType:"XWA2UserUpdate",kind:"LinkedField",name:"xwa2_users_updates_since",plural:!0,selections:[c,{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"updates",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},d],storageKey:null}],storageKey:null}]},params:{id:"6556393721124826",metadata:{},name:"WAWebMexFetchAboutStatusJobQuery",operationKind:"query",text:null}}}();e.exports=a}),null); __d("WAWebMexFetchAboutStatusJob",["Promise","WALogger","WAWebBackendErrors","WAWebMexClient","WAWebMexFetchAboutStatusJobQuery.graphql","WAWebWid","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h,i;function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[mex][about_status] empty return list"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[mex][about_status] this method should only take user wid, instead it received: ",""]);k=function(){return a};return a}function a(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!c("WAWebWid").isWid(a)||!a.isUser()){d("WALogger").ERROR(k(),a).tags("mex","about_status").devConsole({wid:a}).sendLogs("mex-about-status-wrong-wid");return(i||(i=b("Promise"))).resolve({id:a})}var e=h!==void 0?h:h=b("WAWebMexFetchAboutStatusJobQuery.graphql"),f={user_id:a.user};try{e=(yield d("WAWebMexClient").fetchQuery(e,f));f=(f=e.xwa2_users_updates_since)==null?void 0:f[0];f==null&&d("WALogger").ERROR(j()).tags("mex","about_status").devConsole({response:e}).sendLogs("mex-about-status-empty-return-list");e=f==null?void 0:(e=f.updates)==null?void 0:(f=e[0])==null?void 0:f.text;return{id:a,status:e}}catch(b){if(b instanceof d("WAWebBackendErrors").ServerStatusCodeError){f=b.statusCode;return f===401?{id:a,status:""}:{id:a,error:{errorCode:f,errorText:b.message}}}throw b}});return l.apply(this,arguments)}g.mexGetAbout=a}),98); __d("WAWebGetAboutQueryJob",["Promise","WALogger","WAWebMexFetchAboutStatusJob","WAWebUsync","WAWebUsyncUser","WAWebWid","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["getAbout: failed "," : ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["getAbout: this method should only take user wid, instead it received: ",""]);j=function(){return a};return a}function a(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!a.isLid()){var b=(yield d("WAWebMexFetchAboutStatusJob").mexGetAbout(a));return b}return l(a)});return k.apply(this,arguments)}function l(a){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!c("WAWebWid").isWid(a)||!a.isUser()){d("WALogger").WARN(j(),a);return(h||(h=b("Promise"))).resolve({id:a})}var e=new(d("WAWebUsync").USyncQuery)().withContext("interactive").withMode("query").withStatusProtocol().withUser(new(d("WAWebUsyncUser").USyncUser)().withId(a));e=(yield e.execute());if(e.error.all||e.error.status){var f=e.error.all||e.error.status;d("WALogger").WARN(i(),f.errorCode,f.errorText);return{id:a,error:f}}f=e.list;return!f.length?(h||(h=b("Promise"))).reject(c("err")("no status data returned for user")):{id:a,status:f[0].status}});return m.apply(this,arguments)}g.getAbout=a}),98); __d("WAWebMexUsersGetAboutStatus",["$InternalEnum","WAWebMexUsync","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h=b("$InternalEnum").Mirrored(["EMPTY","NOT_ALLOWED","NO_CHANGE"]);function a(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebMexUsync").mexUsyncQuery({users:[{jid:a.toJid()}],telemetry:{context:"INTERACTIVE"},fetch:{about_status:!0}}));a=a.response;if(a!=null){var b;b=(b=a[0].about_status_info)==null?void 0:b.text;a=h.cast((a=a[0].about_status_info)==null?void 0:a.status);if(a==null)return{status:b,state:null};else if(a===h.NOT_ALLOWED)return{status:"",state:null};else if(a===h.EMPTY)return{status:null,state:null};return{state:a}}return{state:h.EMPTY}});return i.apply(this,arguments)}g.getMexUsersAboutStatus=a}),98); __d("WAWebContactStatusBridge",["WALogger","WAWebABProps","WAWebAck","WAWebApiStatus","WAWebGetAboutQueryJob","WAWebMexUsersGetAboutStatus","WAWebPersistedJobDefinitions","WAWebPersistedJobManager","WAWebSendReadReceiptJob","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["getStatus: failed "," : ",""]);h=function(){return a};return a}function a(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(d("WAWebABProps").getABPropConfigValue("mex_usync_about_status")){var b=(yield d("WAWebMexUsersGetAboutStatus").getMexUsersAboutStatus(a)),c=b.status;b=b.state;return b==null?{id:a,status:c}:{id:a,stale:!0,status:null}}return d("WAWebGetAboutQueryJob").getAbout(a).then(function(a){if(a.error){d("WALogger").WARN(h(),a.error.errorCode,a.error.errorText);return{id:a.id,stale:!0,status:""}}return{id:a.id,status:a.status}})});return i.apply(this,arguments)}function c(a){return d("WAWebPersistedJobManager").getJobManager().waitUntilCompleted(d("WAWebPersistedJobDefinitions").jobSerializers.setAbout(a))}function e(){return d("WAWebApiStatus").getAllStatuses()}function f(a,b){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=a.id;try{yield d("WAWebSendReadReceiptJob").markStatusRead(c,b);a.ack=d("WAWebAck").ACK.READ;return!0}catch(a){return!1}});return j.apply(this,arguments)}g.getStatus=a;g.setMyStatus=c;g.queryStatusAll=e;g.sendReadStatus=f}),98); __d("WAWebContactSyncBridge",["WAWebLidAwareContactsDB","WAWebSyncContactJob","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield c("WAWebLidAwareContactsDB").all());if(b.length>0){b=b.map(function(a){return d("WAWebWidFactory").createWid(a.id)}).filter(function(a){return a.isEligibleForUSync()});return d("WAWebSyncContactJob").syncContactListInChunksJob(b,a,"full")}});return h.apply(this,arguments)}g.doFullContactSync=a}),98); __d("WAWebRequestMediaReuploadBridge",["WAWebProtobufsMmsRetry.pb","WAWebRequestMediaReuploadManager"],(function(a,b,c,d,e,f,g){function h(a){if(a!=null)switch(a){case d("WAWebProtobufsMmsRetry.pb").MediaRetryNotification$ResultType.SUCCESS:return 200;case d("WAWebProtobufsMmsRetry.pb").MediaRetryNotification$ResultType.NOT_FOUND:case d("WAWebProtobufsMmsRetry.pb").MediaRetryNotification$ResultType.DECRYPTION_ERROR:return 404;case d("WAWebProtobufsMmsRetry.pb").MediaRetryNotification$ResultType.GENERAL_ERROR:return 500}return 500}function a(a){return d("WAWebRequestMediaReuploadManager").RequestMediaReuploadManager.requestMediaReupload(a).then(function(a){var b=a.result;a=a.directPath;return{status:h(b),directPath:a,isMD:!0}})}g["default"]=a}),98); __d("WAWebDBUpdateMessageTable",["WALogger","WAWebSchemaMessage"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["updateMessageTable: failed to update in storage"]);h=function(){return a};return a}function a(a,b){return d("WAWebSchemaMessage").getMessageTable().merge(a.toString(),b)["catch"](function(a){d("WALogger").ERROR(h()).verbose().devConsole(a).sendLogs("updateMessageTable failed");throw a})}g.updateMessageTable=a}),98); __d("WAWebMsgReactionsBridge",["Promise","WALogger","WAWebAck","WAWebDBGetReactions","WAWebDBUpdateMessageTable","WAWebMsgCollection","WAWebMsgKey","WAWebReactionGatingUtils","WAWebUserPrefsMeUser","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["getReactions: failed with error: "," message: ",""]);i=function(){return a};return a}function j(a,b){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){var e;d("WAWebReactionGatingUtils").isFlattenedReactionsEnabled()?e=(yield d("WAWebMsgCollection").MsgCollection.hydrateOrGetMessages([a]))[0]:e=d("WAWebMsgCollection").MsgCollection.get(a);if(e&&e.hasReaction!==c){a={hasReaction:c};yield d("WAWebDBUpdateMessageTable").updateMessageTable(e.id,a);e.set(a)}return(h||(h=b("Promise"))).resolve()});return k.apply(this,arguments)}function a(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b;try{b=(yield d("WAWebDBGetReactions").getReactions(a.id.toString()))}catch(a){d("WALogger").ERROR(i(),a.name,a.message).verbose().devConsole(a).sendLogs("getReactions failed");throw a}var e=b.reactions.map(function(a){var b=a.senders.map(function(a){return babelHelpers["extends"]({},a,{id:c("WAWebMsgKey").fromString(a.msgKey),isSendFailure:d("WAWebUserPrefsMeUser").isSerializedWidMe(a.senderUserJid)&&a.ack===d("WAWebAck").ACK.CLOCK})});return babelHelpers["extends"]({},a,{hasReactionByMe:a.hasReactionByMe,id:a.aggregateEmoji,senders:b})}),f=e.length>0;yield j(a.id.toString(),f);return babelHelpers["extends"]({},b,{id:a.id,reactions:e})});return l.apply(this,arguments)}g.updateHasReactionInParent=j;g.sendQueryReactions=a}),98); __d("WAWebMsgUtilsBridge",["WATimeUtils","WAWebABProps","WAWebBackendApi","WAWebChatThreadLogging","WAWebChatThreadLoggingUtils","WAWebContactCollection","WAWebEphemeralityResolver","WAWebForwardSendWamEvent","WAWebMsgGetters","WAWebMsgType","WAWebWamGroupMetadataMetricUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=Boolean(a.caption);a.type===d("WAWebMsgType").MSG_TYPE.DOCUMENT&&(b=a.isCaptionByUser);b={messageType:a.getWamMessageType(),messageMediaType:a.getWamMediaType(),mediaCaptionPresent:b,fastForwardEnabled:!0,messageIsFanout:!0,isFrequentlyForwarded:Boolean(d("WAWebMsgGetters").getIsFrequentlyForwarded(a)),isForwardedForward:Boolean(d("WAWebMsgGetters").getNumTimesForwarded(a)>1)};a.ephemeralDuration!=null&&(b.ephemeralityDuration=a.ephemeralDuration);if(d("WAWebABProps").getABPropConfigValue("dm_initiator_trigger")){var c=d("WAWebMsgGetters").getWamDisappearingModeTrigger(a);c!=null&&(b.ephemeralityTriggerAction=c);c=d("WAWebMsgGetters").getWamDisappearingModeInitiatedByMe(a);c!=null&&(b.ephemeralityInitiator=c)}if(!d("WAWebMsgGetters").getIsGroupMsg(a)){c=d("WAWebEphemeralityResolver").getEphemeralDurationForUser(d("WAWebContactCollection").ContactCollection.getMeContact());c!=null&&(b.senderDefaultDisappearingDuration=c);c=d("WAWebEphemeralityResolver").getEphemeralDurationForUser(d("WAWebContactCollection").ContactCollection.get(a.to));c!=null&&(b.receiverDefaultDisappearingDuration=c)}c=a.getWamDisappearingModeInitiator();c!=null&&(b.disappearingChatInitiator=c);c=(yield d("WAWebWamGroupMetadataMetricUtils").getGroupTypeFromChatWid(a.to));c!=null&&(b.typeOfGroup=c);return new(d("WAWebForwardSendWamEvent").ForwardSendWamEvent)(b)});return h.apply(this,arguments)}function i(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b;return((b=a.quotedMsg)==null?void 0:b.type)!==d("WAWebMsgType").MSG_TYPE.PRODUCT||!d("WAWebMsgGetters").getIsSentByMe(a)?!1:d("WAWebBackendApi").frontendSendAndReceive("isMessageSentToBusiness",{msgKey:a.id})});return j.apply(this,arguments)}function c(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!d("WAWebChatThreadLoggingUtils").shouldIncrementMsgSendAndReceive(a))return;d("WAWebChatThreadLogging").handleActivitiesForChatThreadLogging([{activityType:"msgSend",chatId:a.id.remote,ts:d("WATimeUtils").unixTime(),isViewOnce:Boolean(a.isViewOnce),isReaction:d("WAWebMsgGetters").getIsReaction(a),isForwarded:d("WAWebMsgGetters").getIsForwarded(a),isCommerceMessage:d("WAWebChatThreadLoggingUtils").isCommerceMessage(a),isPdpInquiry:yield i(a),isReply:d("WAWebMsgGetters").getIsReply(a),isEdit:d("WAWebMsgGetters").getIsEditProtocolMsg(a),isBot:d("WAWebMsgGetters").getIsBotQuery(a),isEventCreation:a.type===d("WAWebMsgType").MSG_TYPE.EVENT_CREATION,isEventResponse:a.type===d("WAWebMsgType").MSG_TYPE.EVENT_RESPONSE}])});return k.apply(this,arguments)}function e(a){a.markMessageSendT(),a.commit()}g.createMessageForwardMetric=a;g.logMessageSendForChatThreadLogging=c;g.logMessageMetric=e}),98); __d("WAWebSendMsgRecordBridge",["WALogger","WAWebAck","WAWebAddOnsUpdateSendStatesAction","WAWebDBUpdateMessageTable","WAWebHandleMsgError","WAWebMsgUtilsBridge","WAWebSendMsgJob","WAWebSendMsgTypes","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["sendMsgRecord: send failure, msg: ",""]);h=function(){return a};return a}function a(a,b){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c;a.isForwarded&&(c=d("WAWebMsgUtilsBridge").createMessageForwardMetric(a));try{b=(yield d("WAWebSendMsgJob").encryptAndSendMsg({type:d("WAWebSendMsgTypes").SendMessageRecordType.Message,data:a},b));c&&c.then(d("WAWebMsgUtilsBridge").logMessageMetric);if(b.error!=null)throw new(d("WAWebHandleMsgError").MessageSentAckError)(b.error);return{t:parseInt(b.t,10),count:b.count}}catch(c){d("WALogger").WARN(h(),a.id.toString()).tags("messaging").devConsole(a.type);b={isSendFailure:!0};c instanceof d("WAWebHandleMsgError").MessageSentAckError&&(b=babelHelpers["extends"]({},b,{ack:d("WAWebAck").ACK.FAILED}));d("WAWebDBUpdateMessageTable").updateMessageTable(a.id,b);a.set(b);d("WAWebAddOnsUpdateSendStatesAction").updateAddOnSendStatesForMsgAction(a,b);throw c}});return i.apply(this,arguments)}g.sendMsgRecord=a}),98); __d("WAWebSocketConstants",[],(function(a,b,c,d,e,f){a={OPENING:"OPENING",PAIRING:"PAIRING",UNPAIRED:"UNPAIRED",UNPAIRED_IDLE:"UNPAIRED_IDLE",CONNECTED:"CONNECTED",CONFLICT:"CONFLICT",UNLAUNCHED:"UNLAUNCHED",PROXYBLOCK:"PROXYBLOCK",TOS_BLOCK:"TOS_BLOCK",SMB_TOS_BLOCK:"SMB_TOS_BLOCK",DEPRECATED_VERSION:"DEPRECATED_VERSION",SCREEN_LOCKED:"SCREEN_LOCKED"};b={DISCONNECTED:"DISCONNECTED",SYNCING:"SYNCING",RESUMING:"RESUMING",CONNECTED:"CONNECTED"};f.SOCKET_STATE=a;f.SOCKET_STREAM=b}),66); __d("WAWebCommsConfig",["WALogger","WANullthrows","WAWapJid","WAWebABProps","WAWebCmd","WAWebCommsProcessAck","WAWebCommsSendPing","WAWebEnvironment","WAWebNoop","WAWebOfflineResumePreAckHandler","WAWebOpenChatSocket","WAWebSocketConstants","WAWebUserPrefsMultiDevice","cr:7907","gkx"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["ack.to is a "," not a WapJid: ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[comms] getCommsConfig:onSocketLoopIteration"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[comms] getCommsConfig:onSocketOpen"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[comms] getCommsConfig:onDisconnect"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[comms] getCommsConfig:openChatSocket"]);l=function(){return a};return a}var m=60*15*1e3;function n(){return{jitter:.1,max:m,algo:{type:"fibonacci",first:1e3,second:1e3},relativeDelay:!1}}function a(a){var e=a?a:{passive:!1,pull:!1};return{maxRetries:Number.MAX_SAFE_INTEGER,openChatSocket:function(a,b){d("WAWebABProps").getABPropConfigValue("web_comms_socket_reconnect_enabled")?e.signal=c("WANullthrows")(b):e.signal=new AbortController().signal;return c("WAWebOpenChatSocket")(e).then(function(b){d("WALogger").DEV(l()).devConsole(b);a();e.passive=!1;return b})},healthCheckInterval:15,deadSocketTime:2e4,maxSocketLoopWaitTime:m,shouldCloseStaleSocket:!0,socketReconnectBackoffAlgo:n(),shouldBlockReceivingUntilSuccess:!0,handlers:{onConnect:function(){d("WAWebUserPrefsMultiDevice").isRegistered()&&(d("WAWebCmd").Cmd.setSocketState(d("WAWebSocketConstants").SOCKET_STATE.CONNECTED),d("WAWebCmd").Cmd.openSocketStream())},onDisconnect:function(){d("WALogger").DEV(k()),d("WAWebABProps").getABPropConfigValue("web_reset_offline_state_ondisconnect_enabled")&&d("WAWebCmd").Cmd.resetOfflineDeliveryState(),d("WAWebCmd").Cmd.socketStreamDisconnected()},onSocketOpen:function(){d("WALogger").DEV(j()),d("WAWebCmd").Cmd.setSocketState(d("WAWebSocketConstants").SOCKET_STATE.PAIRING)},onSocketLoopIteration:function(a){d("WALogger").DEV(i()),d("WAWebCmd").Cmd.setSocketState(d("WAWebSocketConstants").SOCKET_STATE.OPENING)},onConnectionChange:c("WAWebNoop"),onOptimisticConnectionChange:c("WAWebNoop"),onBeforeCastStanzaForE2E:function(a,b){a.tag==="ack"&&!(b==null?void 0:b.preAck)&&!d("WAWebCmd").Cmd.isOfflineDeliveryEnd&&void d("WAWebOfflineResumePreAckHandler").parseAndSerializeOfflinePreAck(a)},onCastStanza:function(a){c("gkx")("26259")&&(a.tag==="ack"&&!(a.attrs.to instanceof d("WAWapJid").WapJid)&&d("WALogger").ERROR(h(),typeof a.attrs.to,a).sendLogs("send-string-jid")),c("gkx")("26258")||(b("cr:7907")==null?void 0:b("cr:7907").sendNewStanzaToDevTool(a,!0))},onHandleAck:function(a){c("WAWebCommsProcessAck")(a)},onHandleStanza:function(a){c("gkx")("26258")||(b("cr:7907")==null?void 0:b("cr:7907").sendNewStanzaToDevTool(a,!1))},onSendIq:c("WAWebNoop"),onClockSkewUpdate:function(a){d("WAWebCommsSendPing").updateClockSkew(a)}},isPauseEnabled:c("WAWebEnvironment").isWindows}}g.getCommsConfig=a}),98); __d("WAWebHandleDeviceNotification",["Promise","WADeprecatedWapParser","WAJids","WALogger","WAWap","WAWebAdvHandlerApi","WAWebApiPendingDeviceSync","WAWebCommsWapMd","WAWebDBCreateLidPnMappings","WAWebJidToWid","WAWebLidAwareContactsDB","WAWebOfflineDeviceCache","WAWebOfflineHandler","WAWebSyncDeviceAdvDeviceListJob","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleDevicesNotification - unknown notification type ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleDevicesNotification - update error: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["could not find side contact hash for device update operation"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleDevicesNotification - remove error: ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleDevicesNotification - add error: ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["Parsing Error: ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["error while parsing: ",""]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(['Unknown Devices Notification: Devices notification without "remove" and "add" nodes']);p=function(){return a};return a}var q={add:"add",remove:"remove",update:"update"},r=new(c("WADeprecatedWapParser"))("incomingDevicesNotification",function(a){a.assertTag("notification");a.assertTag("notification");a.assertAttr("type","devices");var b,c,e,f=[],g=null;if(a.hasChild("remove"))c=q.remove,b=a.child("remove");else if(a.hasChild("add"))c=q.add,b=a.child("add");else if(a.hasChild("update"))c=q.update,b=a.child("update");else{d("WALogger").WARN(p());throw a.createParseError("Failed to parse devices notification")}if(c===q.add||c===q.remove){var h=b.maybeChild("key-index-list");if(!h)throw a.createParseError("key index node is required to handle device add or remove notification");var i=h.attrTime("ts");if(c===q.remove&&!i)throw a.createParseError("timestamp is required to handle device remove notification");e={ts:i,signedKeyIndexBytes:c===q.add?h.contentBytes():null};i=b.child("device");h=d("WAJids").extractDeviceId(i.attrDeviceJid("jid"));var j=i.hasAttr("lid")?d("WAJids").extractDeviceId(i.attrDeviceJid("lid")):null;i=i.hasAttr("key-index")?i.attrInt("key-index"):null;f=[{id:h,keyIndex:i}];j!=null&&(g=[{id:j,keyIndex:i}])}return{type:c,stanzaId:a.attrString("id"),hash:b.attrString(c===q.update?"hash":"device_hash"),lidHash:b.hasAttr("device_lid_hash")?b.attrString(c===q.update?"hash":"device_lid_hash"):null,user:d("WAWebJidToWid").deviceJidToUserWid(a.attrDeviceJid("from")),lidUser:a.hasAttr("lid")?d("WAWebJidToWid").lidDeviceJidToUserLid(a.attrLidDeviceJid("lid")):null,deviceList:f,lidDeviceList:g,keyIndex:e}});function a(a){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=r.parse(a);if(e.error){d("WALogger").DEV(o(),a.toString());d("WALogger").ERROR(n(),e.error.toString());throw e.error}var f=e.success,g=d("WAWap").wap("ack",{to:d("WAWebCommsWapMd").USER_JID(f.user),id:d("WAWap").CUSTOM_STRING(f.stanzaId),"class":"notification"});a={wid:f.user,devices:{deviceList:f.deviceList,keyIndex:f.keyIndex},type:f.type,hash:f.hash};e=f.lidUser!=null&&f.lidHash!=null&&f.lidDeviceList!=null?{wid:f.lidUser,devices:{deviceList:f.lidDeviceList,keyIndex:f.keyIndex},type:f.type,hash:f.lidHash}:null;a=[a,e].filter(Boolean);e=[];f.lidUser!=null&&f.user!=null&&e.push({lid:f.lidUser,pn:f.user});if(!d("WAWebOfflineHandler").OfflineMessageHandler.isResumeFromRestartComplete()){e.length>0&&(yield d("WAWebDBCreateLidPnMappings").createLidPnMappings({mappings:e,flushImmediately:!1,learningSource:"other"}));a.forEach(function(a){a=a.wid;return d("WAWebOfflineDeviceCache").OfflinePendingDeviceCache.addOfflinePendingDevice(a.toString(),g)});return"NO_ACK"}e.length>0&&(yield d("WAWebDBCreateLidPnMappings").createLidPnMappings({mappings:e,flushImmediately:!0,learningSource:"other"}));yield (h||(h=b("Promise"))).all(a.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.wid,e=a.devices,g=a.type;a=a.hash;if(d("WAWebOfflineHandler").OfflineMessageHandler.isResumeOnSocketDisconnectInProgress())yield d("WAWebApiPendingDeviceSync").addUserToPendingDeviceSync([b.toString()]);else if(f.type===q.add)try{yield d("WAWebAdvHandlerApi").handleADVDeviceNotification({wid:b,devices:e,type:g})}catch(a){d("WALogger").WARN(m(),a)}else if(f.type===q.remove)try{yield d("WAWebAdvHandlerApi").handleADVDeviceNotification({wid:b,devices:e,type:g})}catch(a){d("WALogger").WARN(l(),a)}else if(f.type===q.update){b=(yield c("WAWebLidAwareContactsDB").equals(["contactHash"],a));if(b.length===0)d("WALogger").WARN(k());else try{yield d("WAWebSyncDeviceAdvDeviceListJob").syncDeviceListJob([d("WAWebWidFactory").createWid(b[0].id)],"notification",null)}catch(a){d("WALogger").WARN(j(),a)}}else d("WALogger").WARN(i(),f.type)});return function(b){return a.apply(this,arguments)}}()));return g});return s.apply(this,arguments)}g.handleDevicesNotification=a}),98); __d("WAWebHandleDeviceSwitchingNotification",["WADeprecatedWapParser","WALogger","WATimeUtils","WAWap","WAWebABProps","WAWebBackendApi","WAWebUserPrefsMeUser","WAWebWaOldCodeWamEvent","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["OTP code has expired, expiry time: "," and current time: ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Parsing Error: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["error while parsing: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["DeviceSwitching notification received, node: ",""]);k=function(){return a};return a}var l=new(c("WADeprecatedWapParser"))("incomingDeviceSwitchingNotificationParser",function(a){a.assertTag("notification");var b=a.attrString("id"),c=a.attrWapJid("from");a=a.child("wa_old_registration");var d=a.attrString("code"),e=a.attrTime("expiry_t"),f=a.attrTime("ts");a=a.attrString("device_id");return{stanzaId:b,from:c,code:d,expiryTime:e,ts:f,deviceId:a}});function a(a){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){d("WALogger").DEV(k(),a);var b=l.parse(a);if(b.error){d("WALogger").DEV(j(),a.toString());d("WALogger").ERROR(i(),b.error.toString());throw b.error}a=b.success;b=d("WAWap").wap("ack",{id:d("WAWap").CUSTOM_STRING(a.stanzaId),"class":"notification",type:"registration",to:a.from});if(!d("WAWebABProps").getABPropConfigValue("web_device_switching"))return b;var c=a.expiryTime,e=d("WATimeUtils").unixTime();if(e>c){d("WALogger").LOG(h(),c,e);return b}c=a.code;d("WAWebBackendApi").frontendFireAndForget("showDeviceSwitchOtp",{otpCode:c});e=d("WAWebUserPrefsMeUser").assertGetMe().getDeviceId().toString();new(d("WAWebWaOldCodeWamEvent").WaOldCodeWamEvent)({deviceId:e}).commit();return b});return m.apply(this,arguments)}g["default"]=a}),98); __d("WAWebHandleDigestKey",["Promise","WADeprecatedWapParser","WALogger","WAWap","WAWebDigestKeyJob"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Parsing Error: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["error while parsing: ",""]);j=function(){return a};return a}var k=new(c("WADeprecatedWapParser"))("digestKeyParser",function(a){a.assertTag("notification");a.assertAttr("type","encrypt");a.assertFromServer();a.child("digest").assertTag("digest");return{stanzaId:a.attrString("id")}});function a(a){var c=k.parse(a);if(c.error){d("WALogger").DEV(j(),a.toString());d("WALogger").ERROR(i(),c.error.toString());return(h||(h=b("Promise"))).reject(c.error)}a=c.success;var e=d("WAWap").wap("ack",{to:d("WAWap").S_WHATSAPP_NET,id:d("WAWap").CUSTOM_STRING(a.stanzaId),"class":"notification"});return d("WAWebDigestKeyJob").digestKey().then(function(){return e})}g["default"]=a}),98); __d("WAWebDBUpdateContactTable",["WAJids","WAWebLidAwareContactsDB"],(function(a,b,c,d,e,f,g){function a(a,b){a=a.isLid()?d("WAJids").toLidUserJid(a.user):d("WAJids").toPhoneUserJid(a.user);return c("WAWebLidAwareContactsDB").merge(a,b)}g.updateContactTable=a}),98); __d("WAWebUpdateDisappearingModeForContact",["WALogger","WAWebApiContact","WAWebBackendApi","WAWebDBUpdateContactTable","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["updateDisappearingMode: Contact="," updated, new duration="," t=","."]);h=function(){return a};return a}function a(a,b,c){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){a=d("WAWebWidFactory").createUserWid(a.user,a.server);var e=(yield d("WAWebApiContact").getContactRecord(a)),f,g;if(a.isLid()){var i=d("WAWebApiContact").getPhoneNumber(a);i!=null&&(f=i)}else a.isUser()&&(g=d("WAWebApiContact").getCurrentLid(a));if(e){i=e.disappearingModeSettingTimestamp;if(i==null&&c!==0||i!=null&&i<c){e={disappearingModeDuration:b,disappearingModeSettingTimestamp:c};yield d("WAWebDBUpdateContactTable").updateContactTable(a,e);d("WAWebBackendApi").frontendFireAndForget("updateDisappearingMode",babelHelpers["extends"]({},e,{contactId:a}));f&&(yield d("WAWebDBUpdateContactTable").updateContactTable(f,e),d("WAWebBackendApi").frontendFireAndForget("updateDisappearingMode",babelHelpers["extends"]({},e,{contactId:f})));g&&d("WAWebBackendApi").frontendFireAndForget("updateDisappearingMode",babelHelpers["extends"]({},e,{contactId:g}));d("WALogger").LOG(h(),a.toLogString(),b,c).tags("DM","DDM")}}});return i.apply(this,arguments)}g.updateDisappearingModeForContact=a}),98); __d("WAWebHandleDisappearingModeNotification",["WADeprecatedWapParser","WAJobOrchestratorTypes","WALogger","WAWap","WAWebCommsWapMd","WAWebJidToWid","WAWebOrchestratorNonPersistedJob","WAWebUpdateDisappearingModeForContact","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleDisappearingModeNotification: received d=",":t=","\n for ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Parsing Error: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["error while parsing: ",""]);j=function(){return a};return a}var k=new(c("WADeprecatedWapParser"))("disappearingModeNotification",function(a){a.assertTag("notification");var b=a.child("disappearing_mode");return{stanzaId:a.attrString("id"),from:d("WAWebJidToWid").deviceJidToDeviceWid(a.attrDeviceJid("from")),duration:b.attrInt("duration",0),ts:b.attrTime("t")}});function l(a){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.duration,c=a.from,e=a.stanzaId;a=a.ts;d("WALogger").LOG(h(),b,a,c.toString()).tags("DM","DDM");yield d("WAWebUpdateDisappearingModeForContact").updateDisappearingModeForContact(c,b,a);return d("WAWap").wap("ack",{id:d("WAWap").CUSTOM_STRING(e),to:d("WAWebCommsWapMd").JID(c),"class":"notification",type:"disappearing_mode"})});return m.apply(this,arguments)}function a(a){var b=d("WAJobOrchestratorTypes").JOB_PRIORITY.LOW;return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("handleDisappearingModeNotification",function(){var b=k.parse(a);if(b.error){d("WALogger").DEV(j(),a.toString()).tags("DM","DDM");d("WALogger").ERROR(i(),b.error.toString());return Promise.reject(b.error)}return l(b.success)},{priority:b}).waitUntilCompleted({node:a})}g.handleDisappearingModeNotificationJob=a}),98); __d("WAWebHandleGrowthNotification",["WADeprecatedWapParser","WALogger","WATimeUtils","WAWap","WAWebChatFindBridge","WAWebChatMessageCountsWamEvent","WAWebChatThreadLogging","WAWebCreateChat","WAWebHandleSingleMsg","WAWebJidToWid","WAWebMsgKey","WAWebMsgType","WAWebNotificationDeliveryWamEvent","WAWebUserPrefsMeUser","WAWebViewMode.flow","WAWebWamEnumNotificationTypeEnum","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Unable to create new chat thread with receiver - {receiverId}"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Unable to create new chat thread with receiver - {receiverId}"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Invalid receiver id"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["Invalid receiver id"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["Parsing Error: ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["error while parsing: ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["Growth notification received, node: ",""]);n=function(){return a};return a}var o={contacts:"contacts","w:growth":"w:growth"},p=new(c("WADeprecatedWapParser"))("incomingGrowthNotificationParser",function(a){a.assertTag("notification");var b=a.attrString("id"),c=a.attrWapJid("from"),d=a.attrEnum("type",o);b={stanzaId:b,from:c,type:d};if(a.hasChild("invite")){c=a.child("invite");if(c.hasChild("receiver")){d=c.child("receiver");return babelHelpers["extends"]({receiverId:d.hasAttr("user")?d.attrUserJid("user"):null,reason:d.hasAttr("reason")?d.attrString("reason"):""},b)}}return b});function a(a){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){d("WALogger").DEV(n(),a);var b=p.parse(a);if(b.error){d("WALogger").DEV(m(),a.toString());d("WALogger").ERROR(l(),b.error.toString());throw b.error}a=b.success;b=a.type;if(b==="contacts"){if(!("receiverId"in a)||a.receiverId==null){d("WALogger").DEV(k());d("WALogger").ERROR(j());return}var c=d("WAWebJidToWid").userJidToUserWid(a.receiverId),e="reason"in a&&a.reason==="clicked_invite_link";yield r(c,e)}return d("WAWap").wap("ack",{id:d("WAWap").CUSTOM_STRING(a.stanzaId),"class":"notification",type:b,to:a.from})});return q.apply(this,arguments)}function r(a,b){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=(yield d("WAWebChatFindBridge").findLocal(a.toString()));if(c==null){yield d("WAWebCreateChat").createChat({chatId:a},"createChatOnInviteAccept");c=(yield d("WAWebChatFindBridge").findLocal(a.toString()));if(c==null){d("WALogger").DEV(i());d("WALogger").ERROR(h());return}a=c.id;b=(yield t(a,b));c=(yield d("WAWebChatThreadLogging").getChatThreadID(c.id.toJid()));new(d("WAWebNotificationDeliveryWamEvent").NotificationDeliveryWamEvent)({threadId:c,uiNotificationType:d("WAWebWamEnumNotificationTypeEnum").NOTIFICATION_TYPE_ENUM.INVITE_JOINED}).commit();yield d("WAWebHandleSingleMsg").handleSingleMsg(a,b,"processInviteDeepLinkSenderNotification");new(d("WAWebChatMessageCountsWamEvent").ChatMessageCountsWamEvent)({isInviteCreatedThread:!0}).commit()}return});return s.apply(this,arguments)}function t(a,b){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){return{id:new(c("WAWebMsgKey"))({remote:a,fromMe:!1,id:yield c("WAWebMsgKey").newId()}),from:a,subtype:"sender_invite",to:d("WAWebUserPrefsMeUser").getMeUser(),type:"notification_template",kind:d("WAWebMsgType").MsgKind.NotificationTemplate,viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE,t:d("WATimeUtils").unixTime(),templateParams:[b.toString()]}});return u.apply(this,arguments)}g["default"]=a}),98); __d("WAWebHandlePreKeyLow",["WADeprecatedWapParser","WALogger","WAWap","WAWebEventsWaitForOfflineDeliveryEnd","WAWebSignalStoreApi","WAWebUploadPreKeysJob","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["handlePreKeyLow: Parsing Error: ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["handlePreKeyLow: error while parsing: ",""]);i=function(){return a};return a}var j=new Set(),k=new(c("WADeprecatedWapParser"))("lowKeyParser",function(a){a.assertTag("notification");a.assertAttr("type","encrypt");a.assertFromServer();return{stanzaId:a.attrString("id"),numRemaining:a.child("count").attrInt("value")}});function a(a,b){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=k.parse(a);if(c.error){d("WALogger").DEV(i(),a.toString());d("WALogger").ERROR(h(),c.error.toString());throw c.error}else{a=c.success;var e=d("WAWap").wap("ack",{to:d("WAWap").S_WHATSAPP_NET,id:d("WAWap").CUSTOM_STRING(a.stanzaId),"class":"notification"});if(j.has(b))return e;j.add(b);d("WAWebSignalStoreApi").waSignalStore.setServerHasPreKeys(!1);yield d("WAWebEventsWaitForOfflineDeliveryEnd").waitForOfflineDeliveryEnd();return d("WAWebUploadPreKeysJob").uploadPreKeys().then(function(){return e})["finally"](function(){return void j["delete"](b)})}});return l.apply(this,arguments)}g["default"]=a}),98); __d("WAWebHandleQPPrefetchTimestampNotification",["WASmaxPsaResetSmbLastQpPrefetchTimestampRPC","WAWebBizGatingUtils","WAWebWorkerSafeBackendApi"],(function(a,b,c,d,e,f,g){function a(a){a=d("WASmaxPsaResetSmbLastQpPrefetchTimestampRPC").receiveResetSmbLastQpPrefetchTimestampRPC(a);a=a.makeResetSmbLastQpPrefetchTimestampResponseAck;a=a();d("WAWebBizGatingUtils").qpGraphQLEnabled()&&d("WAWebWorkerSafeBackendApi").workerSafeFireAndForget("fetchQuickPromotionsNow");return a}g.handleQPPrefetchTimestampNotification=a}),98); __d("WAWebCommsHandleStanza",["WABackendHandleError","WACreateHandleChatState","WAHandleDecisionTreeResult","WAJids","WALogger","WAParsableWapNode","WAWap","WAWebABProps","WAWebAltDeviceLinkingHandleNotification","WAWebCommsHandleWorkerCompatibleStanza","WAWebCreateNackFromStanza","WAWebHandleAboutNotification","WAWebHandleAccountSyncNotification","WAWebHandleBusinessNotification","WAWebHandleChatState","WAWebHandleContactNotification","WAWebHandleDeviceNotification","WAWebHandleDeviceSwitchingNotification","WAWebHandleDigestKey","WAWebHandleDisappearingModeNotification","WAWebHandleFailure","WAWebHandleGrowthNotification","WAWebHandleInfoBulletin","WAWebHandleMediaRetryNotification","WAWebHandleMexNotification","WAWebHandleNewsletterNotification","WAWebHandlePairDevice","WAWebHandlePairSuccess","WAWebHandlePreKeyLow","WAWebHandlePresence","WAWebHandlePrivacyTokensNotification","WAWebHandleProfilePicNotification","WAWebHandlePsa","WAWebHandleQPPrefetchTimestampNotification","WAWebHandleQPSurfacesNotification","WAWebHandleRetryRequest","WAWebHandleServerNotification","WAWebHandleServerSyncNotification","WAWebHandleStreamError","WAWebHandleSuccess","WAWebHandleVoipCall","WAWebHandleWaChat","WAWebOfflineHandler","WAWebPaymentNotificationHandler","WAWebPostUnknownStanzaMetric","asyncToGeneratorRuntime","err","gkx"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[handleStanza] ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[handleStanza] exception for tag:"," type:"," id:",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Comms.handleStanza unrecognized stanza ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["Comms.handleStanza received xmlstreamend, return NO_ACK"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["Failed to parse notification "," stanza: ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["Failed to parse receipt "," stanza: ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["Comms.handleStanza unrecognized stanza ",""]);n=function(){return a};return a}var o=d("WACreateHandleChatState").createHandleChatState({groupMessage:{handleGroupChatState:d("WAWebHandleChatState").handleGroupChatState},individualMessage:{handleIndividualChatState:d("WAWebHandleChatState").handleIndividualChatState}});function p(a,b,c){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e){var f=a.attrs;if(f.offline){var g=parseInt(f.t,10),h=parseInt(f.offline,10);d("WAWebOfflineHandler").OfflineMessageHandler.newOfflineStanza(g,e,h)}g=d("WAWebCommsHandleWorkerCompatibleStanza").handleWorkerCompatibleStanza(a);if(g!=null)return g;switch(a.tag){case"iq":return s(a);case"receipt":try{if(f.type==="retry"||f.type==="enc_rekey_retry")return yield d("WAWebHandleRetryRequest").handleMessageRetryRequest(a);break}catch(b){if(b instanceof d("WAParsableWapNode").XmppParsingFailure){d("WAWebPostUnknownStanzaMetric").postUnknownStanzaMetric(a);d("WALogger").ERROR(m(),f.type,b).sendLogs("failed-to-parse-receipt-stanza",{sampling:c("gkx")("26259")?1:.1});return d("WAWebCreateNackFromStanza").createNackFromStanza(a,d("WAWebCreateNackFromStanza").NackReason.ParsingError)}return d("WAWebCreateNackFromStanza").createNackFromStanza(a,d("WAWebCreateNackFromStanza").NackReason.UnhandledError)}case"notification":try{switch(f.type){case"server_sync":return yield d("WAWebHandleServerSyncNotification").handleServerSyncNotification(a);case"picture":return yield d("WAWebHandleProfilePicNotification").handleProfilePicNotificationJob(a);case"business":return yield d("WAWebHandleBusinessNotification").handleBusinessNotificationJob(a);case"contacts":e=a.content;if(!Array.isArray(e)||!e.length)break;h=e[0].tag;if(h==="invite")break;return yield c("WAWebHandleContactNotification")(a);case"devices":return yield d("WAWebHandleDeviceNotification").handleDevicesNotification(a);case"disappearing_mode":return yield d("WAWebHandleDisappearingModeNotification").handleDisappearingModeNotificationJob(a);case"mediaretry":g=(yield c("WAWebHandleMediaRetryNotification")(a));return g;case"encrypt":e=a.content;if(!Array.isArray(e)||!e.length)break;h=e[0].tag;switch(h){case"count":return yield c("WAWebHandlePreKeyLow")(a,b);case"digest":return yield c("WAWebHandleDigestKey")(a)}break;case"server":return yield d("WAWebHandleServerNotification").handleServerNotification(a);case"status":return yield d("WAWebHandleAboutNotification").handleAboutNotification(a);case"account_sync":return yield d("WAWebHandleAccountSyncNotification").handleAccountSyncNotification(a);case"pay":return yield d("WAWebPaymentNotificationHandler").handlePaymentNotification(a);case"psa":if(f.from!=null&&f.from.toString()===d("WAJids").PSA_JID){g=a.content;if(!Array.isArray(g)||!g.length)break;e=g[0].tag;if(e==="surfaces")return yield d("WAWebHandleQPSurfacesNotification").handleQPSurfacesNotification(a);if(e==="reset_smb_last_qp_prefetch_timestamp")return d("WAWebHandleQPPrefetchTimestampNotification").handleQPPrefetchTimestampNotification(a);if(d("WAWebABProps").getABPropConfigValue("enable_client_chat_psa"))return yield c("WAWebHandleWaChat")(a);break}return yield c("WAWebHandlePsa")(a);case"privacy_token":return yield c("WAWebHandlePrivacyTokensNotification")(a);case"link_code_companion_reg":return yield d("WAWebAltDeviceLinkingHandleNotification").handleAltDeviceLinkingNotification(a);case"newsletter":return yield c("WAWebHandleNewsletterNotification")(a);case"w:growth":return yield c("WAWebHandleGrowthNotification")(a);case"registration":return yield c("WAWebHandleDeviceSwitchingNotification")(a);case"mex":return yield d("WAWebHandleMexNotification").handleMexNotification(a)}}catch(c){if(c instanceof d("WAParsableWapNode").XmppParsingFailure){d("WAWebPostUnknownStanzaMetric").postUnknownStanzaMetric(a);g=(b=(h=f.type)==null?void 0:h.toString())!=null?b:"[empty]";d("WALogger").ERROR(l(),g,c).sendLogs("failed-to-parse-notification-stanza-"+g,{sampling:.01});return d("WAWebCreateNackFromStanza").createNackFromStanza(a,d("WAWebCreateNackFromStanza").NackReason.ParsingError)}return c instanceof d("WAWebHandleMexNotification").MissingMEXNotificationHandler?t(a):d("WAWebCreateNackFromStanza").createNackFromStanza(a,d("WAWebCreateNackFromStanza").NackReason.UnhandledError)}return t(a);case"chatstate":return d("WAHandleDecisionTreeResult").handleDecisionTreeResult(a,o(a));case"presence":return c("WAWebHandlePresence")(a);case"ib":return c("WAWebHandleInfoBulletin")(a);case"stream:error":return c("WAWebHandleStreamError")(a);case"failure":return c("WAWebHandleFailure")(a);case"success":return c("WAWebHandleSuccess")(a);case"call":return d("WAWebHandleVoipCall").handleCall(a);case"error":return d("WABackendHandleError").handleError(a);case"xmlstreamend":d("WALogger").LOG(k());return"NO_ACK"}d("WALogger").DEV_XMPP(j(),a);return d("WAWebCreateNackFromStanza").createNackFromStanza(a,d("WAWebCreateNackFromStanza").NackReason.UnrecognizedStanza)});return q.apply(this,arguments)}function a(a,b,c){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){c===void 0&&(c=0);try{b=(yield p(a,b,c));if(b!=null)return b}catch(e){d("WALogger").LOG(i(),a.tag,(c=a.attrs)==null?void 0:c.type,(b=a.attrs)==null?void 0:b.id);d("WALogger").ERROR(h(),e.stack).sendLogs("handle-stanza")}return"NO_ACK"});return r.apply(this,arguments)}function s(a){var b=a.attrs,e=a.content;if(b.xmlns==="urn:xmpp:ping")return d("WAWap").wap("iq",{type:"result",to:b.from});else if(b.xmlns==="md"){if(!Array.isArray(e)||!e.length)return;b=e[0].tag;switch(b){case"pair-device":return c("WAWebHandlePairDevice")(a);case"pair-success":return c("WAWebHandlePairSuccess")(a)}}else throw c("err")("handleIq unrecognized "+a.toString())}function t(a){d("WALogger").DEV_XMPP(n(),a);return d("WAWebCreateNackFromStanza").createNackFromStanza(a,d("WAWebCreateNackFromStanza").NackReason.UnrecognizedStanza)}g["default"]=a}),98); __d("WAWebCommsProcessAck",["WALogger","WAWebActiveMessageRanges","WAWebDBMessageUtils","WAWebMsgCollection","WAWebMsgKey","WAWebMsgType","WAWebSchemaMessage","WAWebUserPrefsMeUser","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["processAckForOutgoingMessage: failed to update in storage"]);h=function(){return a};return a}function a(a){var b=a.attrs,c=b.id,e=b.from;b=b.t;if(a.attrs["class"]==="message"){e=d("WAWebWidFactory").createWid(String(e));a=i(a);l(String(c),e,parseInt(b,10),a);k(a,String(c),e)}}function i(a){var b;a=a.content;if(!Array.isArray(a)||((b=a[0])==null?void 0:b.tag)!=="rcat")return null;a=(b=a[0])==null?void 0:b.content;return Array.isArray(a)?null:a}function j(a,b){return b.isGroup()?new(c("WAWebMsgKey"))({fromMe:!0,remote:b,id:a,participant:d("WAWebUserPrefsMeUser").getMeUser()}):new(c("WAWebMsgKey"))({fromMe:!0,remote:b,id:a})}function k(a,b,c){if(a==null)return;b=d("WAWebMsgCollection").MsgCollection.get(j(b,c));b!=null&&(b.rcat=a)}function l(a,b,c,d){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e){a=j(a,b);var f=String(a);try{var g=(yield d("WAWebSchemaMessage").getMessageTable().get(f));if((g==null?void 0:g.type)===d("WAWebMsgType").MSG_TYPE.REACTION)return;g=d("WAWebDBMessageUtils").MessagePropertyType.cast(g==null?void 0:g.messageRangeIndex.split("_")[1]);d("WAWebSchemaMessage").getMessageTable().merge(f,{messageRangeIndex:d("WAWebDBMessageUtils").craftMessageRangeIndex(b.toString(),!1,g===d("WAWebDBMessageUtils").MessagePropertyType.SystemMessage,c),rcat:e})}catch(a){d("WALogger").ERROR(h()).verbose().devConsole(a).sendLogs("message processAckForOutgoingMessage failed");throw a}d("WAWebActiveMessageRanges").checkAndRemoveActiveMessageRanges(a,c)});return m.apply(this,arguments)}g["default"]=a}),98); __d("WAWebDBGetEventMessagesForChat",["Promise","WAWebDBMessageSerialization","WAWebDBMessageUtils","WAWebSchemaMessage"],(function(a,b,c,d,e,f,g){var h;function a(a,c,e){return(h||(h=b("Promise"))).resolve().then(function(){if(e!=null)return d("WAWebSchemaMessage").getMessageTable().get(e.toString())}).then(function(b){b=b==null?[d("WAWebDBMessageUtils").endOfChat(a),Infinity]:[b.internalId,b.isEventMsg];var e=[d("WAWebDBMessageUtils").beginningOfChat(a),0];return d("WAWebSchemaMessage").getMessageTable().between(["internalId","isEventMsg"],e,b,{lowerInclusive:!1,upperInclusive:!1,reverse:!0,limit:c}).then(function(a){return a.map(function(a){return d("WAWebDBMessageSerialization").messageFromDbRow(a)})})})}g.getEventMessagesForChat=a}),98); __d("WAWebDBMessageFindLocal",["Promise","WAFilteredCatch","WALogger","WAWebDBGetEventMessagesForChat","WAWebDBGetStarredMessagesForChat","WAWebDBMessageSerialization","WAWebDBMessageStoreUtils","WAWebDBMessageUtils","WAWebFtsClient","WAWebModelStorageUtils","WAWebMsgKey","WAWebSchemaMessage","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Anchor message "," does not exist in message table"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Anchor message "," does not exist in message table"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["Anchor message "," does not exist in message table"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["Message query type "," not implemented."]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["msgFindQuery: id:"," chat:"," type:",""]);m=function(){return a};return a}var n=20,o=function(b){babelHelpers.inheritsLoose(a,b);function a(){var a,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(a=c=b.call.apply(b,[this].concat(e))||this,c.name="NoAnchorMessageError",a)||babelHelpers.assertThisInitialized(c)}return a}(babelHelpers.wrapNativeSuper(Error));function a(a,e){d("WALogger").DEV(m(),e.id,e.chat,a).devConsole(e);var f=function(){return e.msgKey instanceof c("WAWebMsgKey")?e.msgKey:e.id==null?void 0:new(c("WAWebMsgKey"))(e)};if(e.label!=null)return(h||(h=b("Promise"))).resolve([]);if(a==="before")return F(e,e.count)["catch"](d("WAFilteredCatch").filteredCatch(o,function(){return{status:404}}));else if(a==="after")return H(e,e.count)["catch"](d("WAFilteredCatch").filteredCatch(o,function(){return{status:404}}));else if(a==="star"){var g=e.id==null?void 0:new(c("WAWebMsgKey"))(e);return e.chat!=null?d("WAWebDBGetStarredMessagesForChat").getStarredMessagesForChat(e.chat,e.count,g):r(e.count,g)}else if(a==="call_log"){g=e.id==null?void 0:new(c("WAWebMsgKey"))(e);return v(e.count,g)}else if(a==="event"){g=e.id==null?void 0:new(c("WAWebMsgKey"))(e);var i=d("WAWebModelStorageUtils").getStorage();return e.chat!=null&&i.doesLocalSchemaIncludeVersion(i.versions.version(152))?d("WAWebDBGetEventMessagesForChat").getEventMessagesForChat(e.chat,e.count,g):D(e.count,g)}else if(a==="search"){i={};e.remote&&(i.remote=e.remote.toString());e.count&&e.page>=0&&(i.limit=e.count,i.page=e.page);return d("WAWebFtsClient").ftsClient.search(e.searchTerm,i)}else if(a==="media"){var j=e.remote,k=f();g=e.media;switch(g){case"allDocs":return B(e.count,k);case"allLinks":return z(e.count,k);case"allMedia":return x(e.count,k);case"url":return q(j,e.count,e.direction,"hasLink",k).then(function(a){return a.map(function(a){return d("WAWebDBMessageSerialization").messageFromDbRow(a)})});case"document":return q(j,e.count,e.direction,"isDocMsg",k).then(function(a){return a.map(function(a){return d("WAWebDBMessageSerialization").messageFromDbRow(a)})});default:return(h||(h=b("Promise"))).all(["isMediaMsg","isDocMsg","hasLink","isCarouselMsg"].map(function(a){return q(j,e.count,e.direction,a,k).then(function(a){return a.map(function(a){return d("WAWebDBMessageSerialization").messageFromDbRow(a)})})})).then(function(a){var b=a[0],c=a[1],d=a[2];a=a[3];a=[b,d,c,a].flat();return{docCount:c.length,linkCount:d.length,mediaCount:b.length,messages:a}})}}d("WALogger").WARN(l(),a);return(h||(h=b("Promise"))).reject(c("err")("Message query type "+a+" not implemented."))}function e(a){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){return d("WAWebSchemaMessage").getMessageTable().equals(["vcardWAids"],a.toString()).then(function(a){return a.map(function(a){return d("WAWebDBMessageSerialization").messageFromDbRow(a)})})});return p.apply(this,arguments)}function q(a,c,e,f,g){var i=g==null?(h||(h=b("Promise"))).resolve(void 0):d("WAWebSchemaMessage").getMessageTable().equals(["id"],g.toString());return i.then(function(b){if(g&&b!=null&&b.length===0){d("WALogger").WARN(k(),g&&g.toString());throw new o()}b=b==null?void 0:b[0];var h,i,j=!1;e==="before"?(h=d("WAWebDBMessageUtils").beginningOfChat(a),i=b==null?d("WAWebDBMessageUtils").endOfChat(a):d("WAWebDBMessageUtils").craftInternalId(a.toString(),d("WAWebDBMessageUtils").getInChatMsgId(b.internalId||"")),j=!0):(h=b==null?d("WAWebDBMessageUtils").beginningOfChat(a):d("WAWebDBMessageUtils").craftInternalId(a.toString(),d("WAWebDBMessageUtils").getInChatMsgId(b.internalId||"")),i=d("WAWebDBMessageUtils").endOfChat(a));return d("WAWebSchemaMessage").getMessageTable().between(["internalId",f],[h,0],[i,Infinity],{lowerInclusive:!1,upperInclusive:!1,limit:c,reverse:j})})}function r(a,b){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=(yield t(b,function(a){return a==null?void 0:a.isStarred}));b[0];b=b[1];var c=0;return d("WAWebSchemaMessage").getMessageTable().between(["isStarred"],c,b,{lowerInclusive:!1,upperInclusive:!1,reverse:!0,limit:a}).then(function(a){return a.map(function(a){return d("WAWebDBMessageSerialization").messageFromDbRow(a)})})});return s.apply(this,arguments)}function t(a,b){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=null;a!=null&&(c=(yield d("WAWebSchemaMessage").getMessageTable().get(a.toString())));a=c==null?Infinity:b(c);b=-Infinity;return[b,a]});return u.apply(this,arguments)}function v(a,b){return w.apply(this,arguments)}function w(){w=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=(yield t(b,function(a){return a==null?void 0:a.isCallLogMsg}));var c=b[0];b=b[1];c=(yield d("WAWebSchemaMessage").getMessageTable().between(["isCallLogMsg"],c,b,{lowerInclusive:!1,upperInclusive:!0,reverse:!0,limit:a}));return c.map(function(a){return d("WAWebDBMessageSerialization").messageFromDbRow(a)})});return w.apply(this,arguments)}function x(a,b){return y.apply(this,arguments)}function y(){y=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=(yield t(b,function(a){return a==null?void 0:a.isMediaMsg}));var c=b[0];b=b[1];c=(yield d("WAWebSchemaMessage").getMessageTable().between(["internalId","isMediaMsg"],["0",c],["_g",b],{lowerInclusive:!1,upperInclusive:!0,reverse:!0,limit:a}));return c.map(function(a){return d("WAWebDBMessageSerialization").messageFromDbRow(a)})});return y.apply(this,arguments)}function z(a,b){return A.apply(this,arguments)}function A(){A=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=(yield t(b,function(a){return a==null?void 0:a.hasLink}));var c=b[0];b=b[1];c=(yield d("WAWebSchemaMessage").getMessageTable().between(["internalId","hasLink"],["0",c],["_g",b],{lowerInclusive:!1,upperInclusive:!0,reverse:!0,limit:a}));return c.map(function(a){return d("WAWebDBMessageSerialization").messageFromDbRow(a)})});return A.apply(this,arguments)}function B(a,b){return C.apply(this,arguments)}function C(){C=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=(yield t(b,function(a){return a==null?void 0:a.isDocMsg}));var c=b[0];b=b[1];c=(yield d("WAWebSchemaMessage").getMessageTable().between(["internalId","isDocMsg"],["0",c],["_g",b],{lowerInclusive:!1,upperInclusive:!0,reverse:!0,limit:a}));return c.map(function(a){return d("WAWebDBMessageSerialization").messageFromDbRow(a)})});return C.apply(this,arguments)}function D(a,b){return E.apply(this,arguments)}function E(){E=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=(yield t(b,function(a){return a==null?void 0:a.isEventMsg}));b[0];b=b[1];var c=0;return d("WAWebSchemaMessage").getMessageTable().between(["isEventMsg"],c,b,{lowerInclusive:!1,upperInclusive:!1,reverse:!0,limit:a}).then(function(a){return a.map(function(a){return d("WAWebDBMessageSerialization").messageFromDbRow(a)})})});return E.apply(this,arguments)}function F(a,b){return G.apply(this,arguments)}function G(){G=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){e===void 0&&(e=n);if(!a.remote)return(h||(h=b("Promise"))).resolve([]);var f=a.remote.toString(),g=void 0;if(a instanceof c("WAWebMsgKey")){var j=(yield d("WAWebSchemaMessage").getMessageTable().equals(["id"],a.toString()));if(j.length===0){d("WALogger").WARN(i(),a.toString());throw new o()}g=j[0]}j=d("WAWebDBMessageUtils").beginningOfChat(a.remote);var k=d("WAWebDBMessageUtils").endOfChat(a.remote);if(g){g=d("WAWebDBMessageUtils").getInChatMsgId(g.internalId||"");var l=Math.max(0,g-e);k=d("WAWebDBMessageUtils").craftInternalId(f,g);j=d("WAWebDBMessageUtils").craftInternalId(f,l)}g={lowerInclusive:!0,upperInclusive:!1};j=d("WAWebDBMessageUtils").beginningOfChat(a.remote);f=(yield d("WAWebDBMessageStoreUtils").queryChatVisibleMessageHelper(j,k,babelHelpers["extends"]({},g,{reverse:!0}),e));return f.reverse().map(function(a){return d("WAWebDBMessageSerialization").messageFromDbRow(a)})});return G.apply(this,arguments)}function H(a,e){e===void 0&&(e=n);if(a instanceof c("WAWebMsgKey")){var f=a.remote.toString();return d("WAWebSchemaMessage").getMessageTable().equals(["id"],a.toString()).then(function(b){if(b.length===0){d("WALogger").WARN(j(),a.toString());throw new o()}b=b[0];b=d("WAWebDBMessageUtils").getInChatMsgId(b.internalId||"");var c=b+e;b=d("WAWebDBMessageUtils").craftInternalId(f,b);c=d("WAWebDBMessageUtils").craftInternalId(f,c);var g={lowerInclusive:!1,upperInclusive:!0};c=d("WAWebDBMessageUtils").endOfChat(a.remote);return d("WAWebDBMessageStoreUtils").queryChatVisibleMessageHelper(b,c,g,e).then(function(a){return a.map(function(a){return d("WAWebDBMessageSerialization").messageFromDbRow(a)})})})}return(h||(h=b("Promise"))).resolve([])}g.msgFindQuery=a;g.queryVcard=e;g.queryMessageType=q}),98); __d("WAWebDBMessageRange",["Promise","WALogger","WALongInt","WANullthrows","WATimeUtils","WAWebDBDeleteAssociatedMsgsByMsgKey","WAWebDBMessageStoreUtils","WAWebDBMessageUtils","WAWebE2EProtoUtils","WAWebLidMigrationUtils","WAWebMessageAssociationGatingUtils","WAWebModelStorageUtils","WAWebMsgKey","WAWebMsgType","WAWebSchemaMessage","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: error reporting logMaybeMillisecondTimestamp for ",": ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: large timestamp: "," returned a large timestamp: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: additionalMessages length: ",""]);k=function(){return a};return a}var l=1e3;function a(a){return d("WAWebSchemaMessage").getMessageTable().between(["messageRangeIndex"],d("WAWebDBMessageStoreUtils").beginningOfMessageRange(a,d("WAWebDBMessageUtils").MessagePropertyType.IncomingChatMessage),d("WAWebDBMessageStoreUtils").endOfMessageRange(a,d("WAWebDBMessageUtils").MessagePropertyType.IncomingChatMessage),{lowerInclusive:!0,reverse:!0,limit:1,shouldDecrypt:!1}).then(function(a){return d("WAWebDBMessageStoreUtils").extractC2STimestampFromMessageRangeIndex((a=a[0])==null?void 0:a.messageRangeIndex)})}function e(a){return d("WAWebSchemaMessage").getMessageTable().between(["messageRangeIndex"],d("WAWebDBMessageStoreUtils").beginningOfMessageRange(a,d("WAWebDBMessageUtils").MessagePropertyType.SystemMessage),d("WAWebDBMessageStoreUtils").endOfMessageRange(a,d("WAWebDBMessageUtils").MessagePropertyType.SystemMessage),{lowerInclusive:!0,reverse:!0,limit:1,shouldDecrypt:!1}).then(function(a){return d("WAWebDBMessageStoreUtils").extractC2STimestampFromMessageRangeIndex((a=a[0])==null?void 0:a.messageRangeIndex)})}function f(a){return d("WAWebSchemaMessage").getMessageTable().between(["messageRangeIndex"],d("WAWebDBMessageStoreUtils").beginningOfMessageRange(a,d("WAWebDBMessageUtils").MessagePropertyType.SystemMessage),d("WAWebDBMessageStoreUtils").endOfMessageRange(a,d("WAWebDBMessageUtils").MessagePropertyType.SystemMessage),{lowerInclusive:!0,reverse:!1,limit:1,shouldDecrypt:!1}).then(function(a){return d("WAWebDBMessageStoreUtils").extractC2STimestampFromMessageRangeIndex((a=a[0])==null?void 0:a.messageRangeIndex)})}function m(a,b){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){var f,g,i=d("WAWebSchemaMessage").getMessageTable().between(["messageRangeIndex"],(f=d("WAWebDBMessageStoreUtils")).beginningOfMessageRange(a,(g=d("WAWebDBMessageUtils")).MessagePropertyType.Outgoing,e),f.endOfMessageRange(a,g.MessagePropertyType.Outgoing),{reverse:!0,shouldDecrypt:!1});e=d("WAWebSchemaMessage").getMessageTable().anyOf(["messageRangeIndex"],[f.beginningOfMessageRange(a,g.MessagePropertyType.IncomingChatMessage,e),f.beginningOfMessageRange(a,g.MessagePropertyType.Outgoing,e),f.beginningOfMessageRange(a,g.MessagePropertyType.Outgoing)],{reverse:!0,shouldDecrypt:!1});f=(yield (h||(h=b("Promise"))).all([i,e]).then(function(a){var b=a[0];a=a[1];var e=function(a){if(a.ack===-1&&a.isSendFailure===!0)return!1;return a.type===d("WAWebMsgType").MSG_TYPE.AUTOMATED_GREETING_MESSAGE?!1:!0};b=b.concat(a).filter(e);a=function(a){var b=c("WAWebMsgKey").fromString(a.id);a=(a=d("WAWebDBMessageStoreUtils").extractC2STimestampFromMessageRangeIndex(a.messageRangeIndex))!=null?a:void 0;b={key:d("WAWebE2EProtoUtils").msgKeyToProtobuf(b),timestamp:a};return b};return b.map(a)}));a=o(f,l);g=a.messages;i=a.newLastMessageTimestamp;return{messages:g,newLastMessageTimestamp:i}});return n.apply(this,arguments)}function o(a,b){var e=[],f=[];a.forEach(function(a){a.timestamp!=null?e.push(a):f.push(a)});if(e.length<b)return{messages:a};a=e.sort(p).slice(0,b);b=a[a.length-1];w(b.timestamp,"smallestTimestampMessage");return{messages:a.concat(f),newLastMessageTimestamp:d("WALongInt").numberOrThrowIfTooLarge(c("WANullthrows")(b.timestamp))}}function p(a,b){a=[a,b].map(function(a){return d("WALongInt").numberOrThrowIfTooLarge(c("WANullthrows")(a.timestamp))});b=a[0];a=a[1];return a-b}function q(a,b,c,d){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e){a=(yield d("WAWebSchemaMessage").getMessageTable().between(["messageRangeIndex"],d("WAWebDBMessageStoreUtils").beginningOfMessageRange(a,c),d("WAWebDBMessageStoreUtils").beginningOfMessageRange(a,c,d("WALongInt").numberOrThrowIfTooLarge(b)),{lowerInclusive:!0,upperInclusive:!0,shouldDecrypt:!1}));c===d("WAWebDBMessageUtils").MessagePropertyType.SystemMessage&&(a=a.filter(function(a){return!d("WAWebDBMessageStoreUtils").isInitialEncryptionMessage(a)}));if((e==null?void 0:e.forceDeleteAllMessagesExceptInitialEncryption)===!0)return a.map(function(a){return a.id});c===d("WAWebDBMessageUtils").MessagePropertyType.SystemMessage&&(e==null?void 0:e.skipRecentSystemMessages)!==!1&&(a=a.filter(function(a){return!(d("WAWebDBMessageStoreUtils").isSecuritySensitiveMessage(a)&&a.t>d("WATimeUtils").unixTime()-d("WATimeUtils").DAY_SECONDS)}));(e==null?void 0:e.skipStarred)!==!1&&(a=a.filter(function(a){return a.isStarred===void 0}));if(c===d("WAWebDBMessageUtils").MessagePropertyType.SystemMessage){var f;for(b=a.length-1;b>=0;b--)if(d("WAWebDBMessageStoreUtils").isBizBotDisclosureMessage(a[b])){f=a[b].id;break}f!=null&&(a=a.filter(function(a){return a.id!==f}))}return a.map(function(a){return a.id})});return r.apply(this,arguments)}function s(a,b,c){return t.apply(this,arguments)}function t(){t=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e){b=b.map(function(a){return d("WAWebE2EProtoUtils").protobufToMsgKey(c("WANullthrows")(a.key)).toString()});var f=[];a.isGroup()&&b.forEach(function(a){a=c("WAWebMsgKey").fromString(a);if(a.fromMe){a=d("WAWebLidMigrationUtils").getAlternateMsgKey(a);a&&f.push(a.toString())}});a=(yield d("WAWebSchemaMessage").getMessageTable().bulkGet(b.concat(f)));var g=[];a.forEach(function(a){a!=null&&((e==null?void 0:e.skipStarred)!==!1&&a.isStarred!=null||g.push(a.id))});return g});return t.apply(this,arguments)}function u(a,c,e){var f=c.lastMessageTimestamp,g=c.lastSystemMessageTimestamp,i=c.messages;return d("WAWebModelStorageUtils").getStorage().lock(["message","message-association"],function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(c){var j;c=c[0];var k=[],l=[];f!=null&&(l.push(q(a,f,d("WAWebDBMessageUtils").MessagePropertyType.IncomingChatMessage,e)),l.push(q(a,f,d("WAWebDBMessageUtils").MessagePropertyType.Outgoing,e)));j=(j=g)!=null?j:f;j!=null&&l.push(q(a,j,d("WAWebDBMessageUtils").MessagePropertyType.SystemMessage,e));l.push(s(a,i,e));j=(yield (h||(h=b("Promise"))).all(l));k=(l=k).concat.apply(l,j);var m=e==null?void 0:e.skipMessages;m&&(k=k.filter(function(a){return!m.has(a)}));l=[c.bulkRemove(k)];d("WAWebMessageAssociationGatingUtils").isMessageAssociationInfraEnabled()&&l.push(d("WAWebDBDeleteAssociatedMsgsByMsgKey").bulkDeleteMessagesByMsgKeys(k));yield h.all(l);return k});return function(a){return c.apply(this,arguments)}}())}function v(a){var b=a.messages,c={messages:b,lastMessageTimestamp:a.lastMessageTimestamp};d("WALogger").LOG(k(),b.length);if(b.length>l){b=o(b,l);var e=b.messages;b=b.newLastMessageTimestamp;b!=null&&(c.lastMessageTimestamp=b,w(c.lastMessageTimestamp,"resultantRange"));c.messages=e}d("WALongInt").numberOrThrowIfTooLarge((b=a.lastSystemMessageTimestamp)!=null?b:0)>d("WALongInt").numberOrThrowIfTooLarge((e=c.lastMessageTimestamp)!=null?e:0)&&(c.lastSystemMessageTimestamp=a.lastSystemMessageTimestamp);return c}function w(a,b){try{var c;d("WALongInt").numberOrThrowIfTooLarge((c=a)!=null?c:0)/d("WATimeUtils").unixTime()>10&&d("WALogger").ERROR(j(),b,a).sendLogs("syncd: "+b+" returned a large timestamp")}catch(b){d("WALogger").ERROR(i(),a,b)}}var x={limitAdditionalMessages:o};g.getLastMessageTimestamp=a;g.getLastSystemMessageTimestamp=e;g.getFirstSystemMessageTimestamp=f;g.getAdditionalMessages=m;g.timestampComparison=p;g.deleteMessagesInMessageRange=u;g.fixMessageRange=v;g.logMaybeMillisecondTimestamp=w;g._test=x}),98); __d("WAWebReparseRichResponseMsgs",["Promise","WAWebBackendApi","WAWebBotGating","WAWebCmd","WAWebDBMessageSerialization","WAWebMessageProcessDBPipeline","WAWebRichResponse.flow","WAWebRichResponseParseUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";var h;function a(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!d("WAWebBotGating").isRichStructuredResponseReceiverEnabled())return;a=a.map(function(a){a=d("WAWebDBMessageSerialization").messageFromDbRow(a);var b=a.richResponse;if(b==null||b.parseState===d("WAWebRichResponse.flow").RichResponseParseState.Parsed)return null;b=d("WAWebRichResponseParseUtils").parseRichResponse(b);return b.parseState===d("WAWebRichResponse.flow").RichResponseParseState.Unparsed?null:babelHelpers["extends"]({},a,{richResponse:b})}).filter(Boolean);if(a.length===0)return;yield d("WAWebMessageProcessDBPipeline").processMsgDataDBPipeline(a,!0);d("WAWebCmd").Cmd.isMainStreamReadyMd&&(yield (h||(h=b("Promise"))).all(a.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){return d("WAWebBackendApi").frontendSendAndReceive("updateMessageUI",{chatId:a.id.remote,msg:a})});return function(b){return a.apply(this,arguments)}}())))});return i.apply(this,arguments)}g.reparseRichResponseMsgs=a}),98); __d("WAWebDBMessageStoreUtils",["WALogger","WAWebABProps","WAWebAck","WAWebAddonGatingUtils","WAWebApiMessageInfoStore","WAWebBotGating","WAWebDBAddOnProviders","WAWebDBMessageSerialization","WAWebDBMessageUtils","WAWebFutureproofReparseMsgsAction","WAWebMsgGetters","WAWebMsgKey","WAWebMsgType","WAWebReparseRichResponseMsgs","WAWebRichResponse.flow","WAWebSchemaMessage","WAWebViewMode.flow","WAWebViewModeUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["maybeUpdateMsgAck: storing ack updates ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["queryChatVisibleMessageHelper: starting process "," unparsedRichResponseMessages"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["queryChatVisibleMessageHelper: starting process "," futureproofedMessages"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["queryChatVisibleMessageHelper: took ",", visit ",", visiable ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["queryChatVisibleMessageHelper: visibleMsgsCount exceeds the threshold"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[init-from-storage] getKeyMsgsFromChatHistory: ","ms, chatId: ",", isActiveChat: ",", count: ",", chatUnread: ",", unreadMsgCounter: ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["[init-from-storage] getKeyMsgsFromChatHistory: Exceeded limit "," to find a non futureproof reaction message"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["getMsgMayNeedAckUpdate: skip update for history group message ",""]);o=function(){return a};return a}var p=10,q=1e9;function r(a){a=a.toString(16);return(a.length-1).toString(16)+a}function a(a){if(a==null||a.length<3)return null;a=a.split("_")[2];return a?d("WAWebDBMessageUtils").undoOrderPreservingHex(a):null}function e(a,b,c){c=c!=null?r(c):"";return a.toString()+"_"+b+"_"+c}function f(a,b){return a.toString()+"_"+b+"_g"}function s(a,b,c){return t.apply(this,arguments)}function t(){t=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){a=(yield d("WAWebSchemaMessage").getMessageTable().between(["internalId"],a,b,c));b=a.filter(function(a){return y(a)});yield z(b);return b});return t.apply(this,arguments)}function u(a,b,c,d,e){return v.apply(this,arguments)}function v(){v=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e,f){f===void 0&&(f=[]);c.limit;c=babelHelpers.objectWithoutPropertiesLoose(c,["limit"]);var g=d("WAWebABProps").getABPropConfigValue("web_init_chat_max_unread_message_count"),h=[],m=[],n=0,o=0,p=function(a){o++;if(e!=null&&n===e)return!0;if(!y(a,f))return!1;d("WAWebViewModeUtils").isViewModeVisibleInSurface(d("WAWebViewMode.flow").ViewModeSurface.CHAT,a.viewMode)&&n++;n>g&&d("WALogger").WARN(l());return!1},q=self.performance.now();a=(yield d("WAWebSchemaMessage").getMessageTable().between(["internalId"],a,b,c,p));d("WALogger").DEV(k(),self.performance.now()-q,o,n);b=a.filter(function(a){if(w(a)){var b=d("WAWebDBMessageSerialization").messageFromDbRow(a),c=d("WAWebDBAddOnProviders").getAddOnProviderForFutureproofMsg(b);a.futureproofReparsed!==!0&&(!c||(c==null?void 0:c.canRenderInUi(b))&&!f.includes(a.id.toString()))&&h.push(a)}else x(a)&&m.push(a);return!y(a,f)?!1:!0});yield z(b);h.length&&(d("WALogger").DEV(j(),h.length),void d("WAWebFutureproofReparseMsgsAction").processFutureproof(h));m.length&&(d("WALogger").DEV(i(),m.length),void d("WAWebReparseRichResponseMsgs").reparseRichResponseMsgs(m));return b});return v.apply(this,arguments)}function w(a){return a.type===d("WAWebMsgType").MSG_TYPE.UNKNOWN}function x(a){return a.type===d("WAWebMsgType").MSG_TYPE.RICH_RESPONSE&&((a=a.richResponse)==null?void 0:a.parseState)!==d("WAWebRichResponse.flow").RichResponseParseState.Parsed}function y(a,b){b===void 0&&(b=[]);var c=d("WAWebDBMessageSerialization").messageFromDbRow(a),e=D(a),f=d("WAWebDBAddOnProviders").getAddOnProviderForFutureproofMsg(c);if(e)return!1;if(w(a)&&a.futureproofReparsed===!0)return!1;if(f&&f.canRenderInUi(c)&&!b.includes(a.id.toString()))return!1;if(a.type===d("WAWebMsgType").MSG_TYPE.DEBUG)return!1;return!d("WAWebBotGating").isBizBot1pEnabled()&&a.type===d("WAWebMsgType").MSG_TYPE.NOTIFICATION_TEMPLATE&&a.subtype==="biz_bot_1p_disclosure"?!1:!0}function z(a){return A.apply(this,arguments)}function A(){A=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=B(a);if(a.length===0)return;var b=(yield d("WAWebApiMessageInfoStore").getHighestMsgAcks(a.map(function(a){return c("WAWebMsgKey").from(a.id)}))),e=[];a.forEach(function(a){var c=a.ack,f=a.id,g=b.get(f);if(g==null)return;g>c&&(e.push({id:f,ack:g}),a.ack=g);e.length>0&&(d("WALogger").LOG(h(),JSON.stringify(e)).tags("message-store"),void d("WAWebSchemaMessage").getMessageTable().bulkCreateOrMerge(e))})});return A.apply(this,arguments)}function B(a){return a.filter(function(a){if(!d("WAWebMsgGetters").getIsUnreadType(a))return!1;if(a.type===d("WAWebMsgType").MSG_TYPE.CIPHERTEXT||a.type===d("WAWebMsgType").MSG_TYPE.UNKNOWN||a.ack<=d("WAWebAck").ACK.CLOCK)return!1;var b=c("WAWebMsgKey").fromString(a.id);if(!b.fromMe)return!1;if(b.remote.isGroup()&&(a.rowId!=null&&a.rowId<q||a.count==null)){d("WALogger").LOG(o(),a.id).tags("message-store");return!1}if(d("WAWebMsgGetters").getIsAckPlayable(a)){if(a.ack===d("WAWebAck").ACK.PLAYED)return!1}else if(a.ack===d("WAWebAck").ACK.READ)return!1;return!0})}function C(a,b){var c,e=self.performance.now(),f=d("WAWebABProps").getABPropConfigValue("web_init_chat_max_unread_message_count"),g,h=a.unreadCount,i=(c=a.unreadDividerOffset)!=null?c:0,j=void 0,k=void 0,l=void 0,o=0,q=[],r=0;c=function(c){o++;if(c.type===d("WAWebMsgType").MSG_TYPE.PROTOCOL)return!1;var e=d("WAWebDBMessageSerialization").messageFromDbRow(c),m=D(c);if(m)return!1;if(w(c)){var s=d("WAWebDBAddOnProviders").getAddOnProviderForFutureproofMsg(e);if(c.futureproofReparsed===!0)return!1;if(!m&&!b)q.push(c);else if(s==null?void 0:s.canRenderInUi(e)){if(f!==0&&r>=f){l==null&&(l=c.id);k||(d("WALogger").WARN(n(),f),k=c);return!0}b||q.push(c);r++;return!1}}l==null&&(l=c.id);k||(k=c);!j&&!m&&c.botPluginReferenceIndex==null&&d("WAWebViewModeUtils").isViewModeVisibleInSurface(d("WAWebViewMode.flow").ViewModeSurface.CHAT_LIST,c.viewMode)&&![d("WAWebMsgType").MSG_TYPE.E2E_NOTIFICATION,d("WAWebMsgType").MSG_TYPE.PROTOCOL,d("WAWebMsgType").MSG_TYPE.DEBUG].includes(c.type)&&(j=c);if(!b&&(j!=null||o>p))return!0;if(h===0&&i>0)if(c.type===d("WAWebMsgType").MSG_TYPE.REVOKED){i-=1;if(i===0){g=c.id.toString();return!0}}else return!0;if((h===0&&i===0||f!==0&&a.unreadCount>=f)&&j)return!0;if(h>0&&d("WAWebMsgGetters").getIsUnreadType(c)){h-=1;if(h===0){g=c.id.toString();if(i===0)return!0}}return!1};return d("WAWebSchemaMessage").getMessageTable().between(["internalId"],a.id+"_/",a.id+"_g",{reverse:!0},c).then(function(){d("WALogger").DEV(m(),self.performance.now()-e,a.id,b,o,a.unreadCount,h);q.length&&d("WAWebFutureproofReparseMsgsAction").processFutureproof(q);return{anchor:g,previewMsg:j||k,lastReceivedKey:l}})}function D(a){if(a.type===d("WAWebMsgType").MSG_TYPE.KEEP_IN_CHAT)return!0;var b=a.futureproofType;return b!=null?d("WAWebAddonGatingUtils").isUnifiedInfraEnabledForType(b):d("WAWebAddonGatingUtils").isUnifiedInfraEnabledForType(a.type)}function E(a){var b=new Map([[d("WAWebMsgType").MSG_TYPE.GP2,["remove","add","ephemeral","invite","leave"]],[d("WAWebMsgType").MSG_TYPE.E2E_NOTIFICATION,["encrypt","encrypt_now","e2e_identity_unavailable","identity","device","chat_psa"]],[d("WAWebMsgType").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","biz_bot_1p_disclosure","biz_bot_3p_disclosure","bot_init"]]]);return((b=b.get(a.type))==null?void 0:b.includes(a.subtype))||!1}function F(a,b){return d("WAWebSchemaMessage").getMessageTable().between(["internalId"],a+"_/",a+"_g",{reverse:!0},b)}function G(a){return a.type===d("WAWebMsgType").MSG_TYPE.E2E_NOTIFICATION&&a.subtype==="encrypt"||a.type===d("WAWebMsgType").MSG_TYPE.NOTIFICATION_TEMPLATE&&a.subtype==="biz_privacy_mode_init_fb"||a.type===d("WAWebMsgType").MSG_TYPE.NOTIFICATION_TEMPLATE&&a.subtype==="biz_me_account_type_is_hosted"||a.type===d("WAWebMsgType").MSG_TYPE.NOTIFICATION_TEMPLATE&&a.subtype==="biz_me_account_type_is_hosted_transition"||a.type===d("WAWebMsgType").MSG_TYPE.NOTIFICATION_TEMPLATE&&a.subtype==="biz_account_type_is_hosted"||a.type===d("WAWebMsgType").MSG_TYPE.NOTIFICATION_TEMPLATE&&a.subtype==="biz_account_type_changed_to_hosted"}function H(a){return a.type===d("WAWebMsgType").MSG_TYPE.NOTIFICATION_TEMPLATE&&(a.subtype==="biz_bot_1p_disclosure"||a.subtype==="biz_bot_3p_disclosure")}g.extractC2STimestampFromMessageRangeIndex=a;g.beginningOfMessageRange=e;g.endOfMessageRange=f;g.queryChatMessageHelper=s;g.queryChatVisibleMessageHelper=u;g.shouldRenderInUI=y;g.getKeyMsgsFromChatHistory=C;g.isSecuritySensitiveMessage=E;g.getMessagesBefore=F;g.isInitialEncryptionMessage=G;g.isBizBotDisclosureMessage=H}),98); __d("WAWebGroupUnreadMessageType",["$InternalEnum"],(function(a,b,c,d,e,f){a=b("$InternalEnum").Mirrored(["NEW_MESSAGE","PERSISTANCE_LOAD","HISTORYC_SYNC_CHUNK"]);f.UnreadMessageType=a}),66); __d("WAWebUnreadMentionModel",["WAWebBaseModel"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.timestamp=d("WAWebBaseModel").prop(),b)||babelHelpers.assertThisInitialized(c)}return b}(d("WAWebBaseModel").BaseModel);a.Proxy="unreadMention";b=d("WAWebBaseModel").defineModel(a);g["default"]=b}),98); __d("WAWebDBProcessInitialHistorySyncMessage",["Promise","WALogger","WAPromiseReduce","WATimeUtils","WAWeb-dexie","WAWebApiChat","WAWebApiGroupInviteV4Store","WAWebChatCollection","WAWebDBEncryptMultipleMsgs","WAWebDBReportingTokenUtils","WAWebDBStoreMessage","WAWebDbEncryptionKey","WAWebFtsClient","WAWebGroupUnreadMessageType","WAWebLinkify","WAWebMessageAssociationGatingUtils","WAWebMsgGetters","WAWebMsgType","WAWebNoop","WAWebSchemaFtsIndexingQueue","WAWebSchemaMessage","WAWebSchemaMessageAssociation","WAWebUnreadMentionModel","WAWebWidFactory","asyncToGeneratorRuntime","lodash"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] additional information: messages length: ",", ids: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Error storing initial sync messages with error "," after retry"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Retrying initial sync bulk add on error"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Error storing initial sync messages with error "," with optimization"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["storeInitialSyncMessages failed with error: ",", message: ",", stack: ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["storeInitialSyncMessages failed for msg: "," from ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] start storing initial sync messages."]);o=function(){return a};return a}var p=1e9;function a(a){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield d("WAWebDbEncryptionKey").DbEncKeyStore.waitForFinalDbMsgEncKey();var e=0;c("lodash").forOwn(a,function(a){a=a.msgs;return e+=a.length});var f=new Map(),g=new Map();d("WALogger").LOG(o());var q=(yield d("WAPromiseReduce").promiseReduce(Object.keys(a),function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b,c){var e=b.nextRowId,g=p-a[c].msgs.length,h=(yield r(a[c].chatInfo.unreadCount||0,a[c].msgs)),i=h.pendingUnreadIds;h=h.unreadMentions;h.length&&f.set(c,h);h=[];for(var j=0;j<a[c].msgs.length;j++){var k=a[c].msgs[j];try{var l=(yield d("WAWebDBEncryptMultipleMsgs").processAndEncryptSingleMsgRow(k));e++;g++;k.isMdHistoryMsg=!0;l=d("WAWebDBStoreMessage").addMsgMetadataToMsgRow({msg:l[0],chatId:d("WAWebWidFactory").createWid(c).toString(),hasLink:d("WAWebLinkify").hasHttpLink(k),rowId:e,inChatMsgId:g,pendingReadReceipt:i.has(String(k.id))});h.push(l)}catch(a){if(a instanceof d("WAWebDBEncryptMultipleMsgs").DroppingMsgRowDueToLogout)throw a;d("WALogger").WARN(n(),(l=k.id)==null?void 0:l.id,(l=k.id)==null?void 0:l.remote).tags("message-store-optimized");d("WALogger").ERROR(m(),a.name,a.message,a.stack).tags("message-store-optimized").devConsole(a)}}return{nextRowId:e,messages:b.messages.concat(h)}});return function(a,b){return c.apply(this,arguments)}}(),{nextRowId:p-e,messages:[]})),s=[];q.messages.forEach(function(a){a.type===d("WAWebMsgType").MSG_TYPE.GROUPS_V4_INVITE&&d("WAWebApiGroupInviteV4Store").persistGroupInviteV4Msg(a.id.toString(),{id:a.id.toString(),from:a.from.toString(),to:a.to.toString(),groupId:a.inviteGrp,expiration:parseInt(a.inviteCodeExp,10),expired:d("WATimeUtils").unixTime()>=parseInt(a.inviteCodeExp,10)}),a.associationType!=null&&d("WAWebMessageAssociationGatingUtils").isMessageAssociationInfraEnabled()&&s.push({msgKey:a.id.toString(),parentMsgKey:a.parentMsgKey.toString(),associationType:a.associationType,msgKeyInternalId:a.internalId})});var t=[d("WAWebSchemaMessage").getMessageTable().bulkCreateWith_ALREADY_ENCRYPTED_RECORDS_ONLY(q.messages)];s.length&&t.push(d("WAWebSchemaMessageAssociation").getMessageAssociationTable().bulkCreate(s));void d("WAWebDBReportingTokenUtils").handleHistorySyncedReportingInfo(q.messages);f.size&&(f.forEach(function(a,b){var e,f=d("WAWebChatCollection").ChatCollection.get(d("WAWebWidFactory").createWid(b));a=a.map(function(a){var b=a.id;a=a.timestamp;return new(c("WAWebUnreadMentionModel"))({id:b,timestamp:a})});f=f==null?void 0:(f=f.groupMetadata)==null?void 0:f.unreadMentionMetadata;e=(e=f==null?void 0:f.pendingUnreadMentionCount)!=null?e:0;(f==null?void 0:f.pendingUnreadMentionCount)&&(f.pendingUnreadMentionCount=Math.max(e-a.length,0),g.set(b,f.pendingUnreadMentionCount));f==null?void 0:f.addUnreadMentions(a,d("WAWebGroupUnreadMessageType").UnreadMessageType.HISTORYC_SYNC_CHUNK)}),void d("WAWebApiChat").addUnreadMentionChat(f,g));return(h||(h=b("Promise"))).all(t)["catch"](function(a){d("WALogger").WARN(l(),a);if(a instanceof c("WAWeb-dexie").BulkError||a instanceof c("WAWeb-dexie").ConstraintError){d("WALogger").LOG(k()).tags("history-sync-initial-sync-optimized");return d("WAWebSchemaMessage").getMessageTable().bulkCreateOrMerge(q.messages)}throw a}).then(function(){c("WAWeb-dexie").ignoreTransaction(function(){d("WAWebSchemaFtsIndexingQueue").getFtsIndexingQueueTable().bulkCreateOrReplace(q.messages.map(function(a){return{id:String(a.rowId)}})).then(function(){d("WAWebFtsClient").ftsClient.index()["catch"](c("WAWebNoop"))})})})["catch"](function(a){d("WALogger").WARN(j(),a).devConsole(a);var b=q.messages.map(function(a){return a.id.toString()});d("WALogger").DEV(i(),b.length,b).devConsole(a)})});return q.apply(this,arguments)}function r(a,b){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=a;var c=new Set(),e=[];for(var f=b.length-1;f>=0;f--){if(a<=0)break;var g=b[f],h=d("WAWebDBStoreMessage").isPendingUnreadReceipt(g.id,g);if(h){a--;c.add(String(g.id));if(d("WAWebMsgGetters").getIsImportantMessage(g)){h={id:String(g.id),timestamp:g.t};e.push(h)}}}return{pendingUnreadIds:c,unreadMentions:e}});return s.apply(this,arguments)}g.storeInitialSyncMessages=a}),98); __d("WAWebDBQueryAndRemoveMessageHistory",["Promise","WAWebDBDeleteAssociatedMsgsByMsgKey","WAWebDBMessageRange","WAWebDBMessageUtils","WAWebFtsClient","WAWebMessageAssociationGatingUtils","WAWebNoop","WAWebSchemaMessage","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function a(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=d("WAWebDBMessageUtils").beginningOfChat(a);a=d("WAWebDBMessageUtils").endOfChat(a);var c=(yield d("WAWebSchemaMessage").getMessageTable().between(["internalId"],b,a,{lowerInclusive:!1,upperInclusive:!1,limit:1}));if(c.length===0)return null;c=c[0].rowId;b=(yield d("WAWebSchemaMessage").getMessageTable().between(["internalId"],b,a,{lowerInclusive:!1,upperInclusive:!1,limit:1,reverse:!0}));if(b.length===0)return null;a=b[0].rowId;b=b[0].t;return c==null||a==null?null:{startRowId:c,endRowId:a,tsOfLastMessage:b}});return i.apply(this,arguments)}function e(a,b,c){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e){a=(yield d("WAWebDBMessageRange").deleteMessagesInMessageRange(a,b,e));d("WAWebFtsClient").ftsClient.purge(a)["catch"](c("WAWebNoop"));return a});return j.apply(this,arguments)}function f(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=d("WAWebDBMessageUtils").beginningOfChat(a);a=d("WAWebDBMessageUtils").endOfChat(a);c=(yield d("WAWebSchemaMessage").getMessageTable().between(["internalId"],c,a,{lowerInclusive:!1,upperInclusive:!1,returnKeyType:"primary_key"}));a=[d("WAWebSchemaMessage").getMessageTable().bulkRemove(c)];d("WAWebMessageAssociationGatingUtils").isMessageAssociationInfraEnabled()&&a.push(d("WAWebDBDeleteAssociatedMsgsByMsgKey").bulkDeleteMessagesByMsgKeys(c));yield (h||(h=b("Promise"))).all(a);return c});return k.apply(this,arguments)}g.getBoundsForChat=a;g.queryAndRemoveMessagesInMessageRange=e;g.queryAndRemoveMessageHistory=f}),98); __d("WAWebHandleAboutNotification",["Promise","WADeprecatedWapParser","WALogger","WAWap","WAWebApiContact","WAWebCommsWapMd","WAWebJidToWid","WAWebLidAwareContactsDB","WAWebStatusContactAction","WAWebTextStatusCollection","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleAboutNotification: unhandled notification of\n type ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleAboutNotification: get status update for unknown contact ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["could not find side contact hash for status update operation"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleAboutNotification: received ","\n for ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["Parsing Error: ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["error while parsing: ",""]);n=function(){return a};return a}var o=new(c("WADeprecatedWapParser"))("incomingAboutNotification",function(a){a.assertTag("notification");var b={stanzaId:a.attrString("id")},c=a.hasChild("set")&&a.child("set");if(c&&!c.hasAttr("hash"))return babelHelpers["extends"]({type:"change",from:d("WAWebJidToWid").userJidToUserWid(a.attrUserJid("from")),pushname:a.attrString("notify"),content:c.contentString(),ts:a.attrTime("t")},b);return c&&c.hasAttr("hash")?babelHelpers["extends"]({type:"sideListChange",from:d("WAWebJidToWid").userJidToUserWid(a.attrUserJid("from")),hash:c.attrString("hash")},b):babelHelpers["extends"]({type:"unknown",from:a.attrString("from")},b)});function p(a){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){d("WALogger").LOG(l(),a.type,a.from.toString());switch(a.type){case"sideListChange":var b=(yield c("WAWebLidAwareContactsDB").equals(["contactHash"],a.hash));if(b.length===0)d("WALogger").WARN(k());else{b=d("WAWebWidFactory").createUserWid(b[0].id);var e=d("WAWebTextStatusCollection").TextStatusCollection.get(b);b=e==null?null:d("WAWebStatusContactAction").getStatus(b).then(function(a){e.set({status:a.status})});yield b}break;case"change":b=a.from;var f=[b];b=d("WAWebApiContact").getAlternateUserWid(d("WAWebWidFactory").toUserWid(b));b&&f.push(b);for(b of f){f=d("WAWebTextStatusCollection").TextStatusCollection.get(b);f&&a.content!=null?f.status=a.content:d("WALogger").WARN(j(),b.toLogString())}break;default:a.type;d("WALogger").WARN(i(),a.type);break}return d("WAWap").wap("ack",{id:d("WAWap").CUSTOM_STRING(a.stanzaId),to:a.from instanceof c("WAWebWid")?d("WAWebCommsWapMd").JID(a.from):d("WAWap").CUSTOM_STRING(a.from),"class":"notification",type:"status"})});return q.apply(this,arguments)}function a(a){var c=o.parse(a);if(c.error){d("WALogger").DEV(n(),a.toString());d("WALogger").ERROR(m(),c.error.toString());return(h||(h=b("Promise"))).reject(c.error)}return p(c.success)}g.handleAboutNotification=a}),98); __d("WAWebMexFetchTextStatusListJobQuery.graphql",[],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"input"}],b=[{alias:null,args:[{kind:"Variable",name:"input",variableName:"input"}],concreteType:"XWA2TextStatus",kind:"LinkedField",name:"xwa2_text_status_list",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"jid",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"text",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"last_update_time",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"ephemeral_duration_sec",storageKey:null},{alias:null,args:null,concreteType:"XWA2TextStatusEmoji",kind:"LinkedField",name:"emoji",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"content",storageKey:null}],storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"WAWebMexFetchTextStatusListJobQuery",selections:b,type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"WAWebMexFetchTextStatusListJobQuery",selections:b},params:{id:"6657242354369052",metadata:{},name:"WAWebMexFetchTextStatusListJobQuery",operationKind:"query",text:null}}}();e.exports=a}),null); __d("WAWebMexFetchTextStatusListJob",["Promise","WALogger","WAWebMexClient","WAWebMexFetchTextStatusListJobQuery.graphql","WAWebTextStatusParseUtils","WAWebWid","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h,i;function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[MEX][TEXT-STATUS] fetched text status for ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[MEX][TEXT-STATUS] this method should only take user wid, instead it received: ",""]);k=function(){return a};return a}function a(a,b){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){if(!c("WAWebWid").isWid(a)||!a.isUser()){d("WALogger").LOG(k(),a);return(i||(i=b("Promise"))).resolve({id:a})}var f=h!==void 0?h:h=b("WAWebMexFetchTextStatusListJobQuery.graphql");a=d("WAWebTextStatusParseUtils").createTextStatusObjectForGetRequest({id:a,textStatusLastUpdateTime:e});e={input:[{jid:a.jid,last_update_time:a.last_update_time}]};a=(yield d("WAWebMexClient").fetchQuery(f,e));f=a.xwa2_text_status_list;e=f[0];f=e==null?void 0:e.text;d("WALogger").LOG(j(),e.jid).tags("GQL","MEX").devConsole(f,a);f=d("WAWebTextStatusParseUtils").parseTextStatusServerResponse(e);return{id:f.id,text:f.textStatusString,emoji:f.textStatusEmoji,lastUpdateTime:f.textStatusLastUpdateTime,ephemeralDurationSeconds:f.textStatusEphemeralDuration}});return l.apply(this,arguments)}g.mexGetTextStatusList=a}),98); __d("WAWebGetTextStatusQueryJob",["WALogger","WAWebMexFetchTextStatusListJob","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["getTextStatus:",""]);h=function(){return a};return a}function a(a,b){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=(yield d("WAWebMexFetchTextStatusListJob").mexGetTextStatusList(a,b));d("WALogger").LOG(h(),a.toString()).devConsole(b);return b});return i.apply(this,arguments)}g.getTextStatus=a}),98); __d("WAWebContactTextStatusBridge",["WALogger","WAWebGetTextStatusQueryJob","WAWebPersistedJobDefinitions","WAWebPersistedJobManager","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["getTextStatus: failed "," : ",""]);h=function(){return a};return a}function a(a,b){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){try{b=(yield d("WAWebGetTextStatusQueryJob").getTextStatus(a,b));return{id:b.id,text:b.text,emoji:b.emoji,lastUpdateTime:b.lastUpdateTime,ephemeralDurationSeconds:b.ephemeralDurationSeconds}}catch(b){d("WALogger").WARN(h(),b.statusCode,b.message);return{id:a,error:b,text:""}}});return i.apply(this,arguments)}function c(a,b,c,e){return d("WAWebPersistedJobManager").getJobManager().waitUntilCompleted(d("WAWebPersistedJobDefinitions").jobSerializers.setTextStatus(a,b,c,e))}g.getTextStatus=a;g.setTextStatus=c}),98); __d("WAWebGetDisappearingModeJob",["Promise","WALogger","WAWebUsync","WAWebUsyncUser","WAWebWid","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["getDisappearingMode: failed "," : ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["getDisappearingMode: this method should only take user wid, instead it received: ",""]);j=function(){return a};return a}function a(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!c("WAWebWid").isWid(a)||!a.isUser()){d("WALogger").WARN(j(),a);return(h||(h=b("Promise"))).resolve({id:a})}var e=new(d("WAWebUsync").USyncQuery)().withContext("interactive").withMode("query").withDisappearingModeProtocol().withUser(new(d("WAWebUsyncUser").USyncUser)().withId(a));e=(yield e.execute());if(e.error.all||e.error.status){var f=e.error.all||e.error.status;d("WALogger").WARN(i(),f.errorCode,f.errorText);return{id:a,error:f}}f=e.list;if(f.length===0||f[0].disappearing_mode==null)return(h||(h=b("Promise"))).reject(c("err")("no disappearing_mode data returned for user"));e=f[0].disappearing_mode;f=e.duration;e=e.t;return{id:a,disappearingModeDuration:f,disappearingModeSettingTimestamp:e}});return k.apply(this,arguments)}g.getDisappearingMode=a}),98); __d("WAWebPDFNTypes",[],(function(a,b,c,d,e,f){a=Object.freeze({PDFN_ACCEPTED:"5"});b=Object.freeze({ACCEPTED:"ACCEPTED"});f.NOTICE_STAGES=a;f.NOTICE_STATUS=b}),66); __d("WAWebTextStatusGatingUtils",["WAWebABProps","WAWebPrimaryFeatures"],(function(a,b,c,d,e,f,g){function h(){return d("WAWebABProps").getABPropConfigValue("evolve_about_m1_receiver_enabled")}function a(){return h()&&d("WAWebABProps").getABPropConfigValue("evolve_about_m1_receiver_for_new_surfaces_enabled")}function b(){return d("WAWebABProps").getABPropConfigValue("web_evolve_about_send_enabled")&&d("WAWebPrimaryFeatures").primaryFeatureEnabled("text_status_creation_support")}g.receiveTextStatusEnabled=h;g.receiveTextStatusForNewSurfacesEnabled=a;g.sendTextStatusEnabled=b}),98); __d("WAWebTextStatusUtils",["WATimeUtils","WAWebTextStatusGatingUtils","fbs"],(function(a,b,c,d,e,f,g){var h=-1;f=5;var i=0,j=null,k=null,l=null,m=-1;function n(a,b,c,e,f){f=f===m||e!=null&&d("WATimeUtils").unixTime()<e;e=Boolean(a)||Boolean(b);a=c!==i;return a&&f&&e}function a(a,b,c,e,f){if(!d("WAWebTextStatusGatingUtils").receiveTextStatusEnabled())return!1;if(c===h)return!1;return!n(a,b,c,e,f)?!1:!0}var o="",p=" ";function b(a){return a.status===void 0}function e(a){var b=c("fbs")._(/*BTDS*/"__JHASH___HFqOsV3qQe__JHASH__").toString();return a.status!==o&&a.status!==void 0&&a.status!==p&&a.status!==b}g.TEXT_STATUS_NOT_FETCHED=h;g.SUGGESTIONS_MAX_COUNT=f;g.CLEAR_TEXT_STATUS_LAST_UPDATE_TIME_VAL=i;g.CLEAR_TEXT_STATUS_STRING_VAL=j;g.CLEAR_TEXT_STATUS_EMOJI_VAL=k;g.CLEAR_TEXT_STATUS_EPHEMERAL_DURATION_VAL=l;g.TEXT_STATUS_DURATION_INFINITE=m;g.hasTextStatusSet=n;g.shouldDisplayTextStatus=a;g.EMPTY_ABOUT=o;g.EMPTY_MIGRATED_ABOUT=p;g.isLegacyAboutNotFetched=b;g.hasCustomAboutSet=e}),226); __d("WAWebUpdateTextStatusForContact",["WAWebApiContact","WAWebBackendApi","WAWebDBUpdateContactTable","WAWebTextStatusUtils","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b,c,d,e){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e,f){a=d("WAWebWidFactory").createUserWid(a.user,a.server);var g=(yield d("WAWebApiContact").getContactRecord(a)),h,i;if(a.isLid()){var j=d("WAWebApiContact").getPhoneNumber(a);j!=null&&(h=j)}else a.isUser()&&(i=d("WAWebApiContact").getCurrentLid(a));if(g){j=g.textStatusLastUpdateTime;if(f==null||j!=null&&f!==d("WAWebTextStatusUtils").CLEAR_TEXT_STATUS_LAST_UPDATE_TIME_VAL&&f<j)return;var k;e!=null&&e>0&&f!==d("WAWebTextStatusUtils").CLEAR_TEXT_STATUS_LAST_UPDATE_TIME_VAL&&(k=Number(f)+Number(e));g={textStatusString:b,textStatusEmoji:c,textStatusEphemeralDuration:e,textStatusLastUpdateTime:f,textStatusExpiryTs:k};yield d("WAWebDBUpdateContactTable").updateContactTable(a,g);d("WAWebBackendApi").frontendFireAndForget("updateTextStatus",babelHelpers["extends"]({},g,{contactId:a}));h&&(yield d("WAWebDBUpdateContactTable").updateContactTable(h,g),d("WAWebBackendApi").frontendFireAndForget("updateTextStatus",babelHelpers["extends"]({},g,{contactId:h})));i&&d("WAWebBackendApi").frontendFireAndForget("updateTextStatus",babelHelpers["extends"]({},g,{contactId:i}))}});return h.apply(this,arguments)}g.updateTextStatusForContact=a}),98); __d("WAWebHandleAccountSyncNotification",["Promise","WADeprecatedWapParser","WAJids","WALogger","WATimeUtils","WAWap","WAWebABProps","WAWebAccountSyncJob","WAWebAdvHandlerApi","WAWebApiPendingDeviceSync","WAWebBackendApi","WAWebBizCoexGatingUtils","WAWebBizCoexUtils","WAWebCmd","WAWebCommsWapMd","WAWebContactTextStatusBridge","WAWebGetAboutQueryJob","WAWebGetDisappearingModeJob","WAWebJidToWid","WAWebMarketingMessagesUserFeedbackGatingUtils","WAWebMexUsersGetAboutStatus","WAWebOfflineDeviceCache","WAWebOfflineHandler","WAWebPDFNTypes","WAWebSetUsernameJob","WAWebSignalCommonUtils","WAWebSignalStoreApi","WAWebTextStatusGatingUtils","WAWebTextStatusParseUtils","WAWebUpdateDisappearingModeForContact","WAWebUpdateTextStatusForContact","WAWebUserDisclosureCollection","WAWebUserPrefsMeUser","WAWebUserPrefsMultiDevice","WAWebUsernameGatingUtils","WAWebWidFactory","WAWebWorkerSafeBackendApi","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Receieved account sync notification for Ai Available"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Parsing Error: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["error while parsing: ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["wid-is-not-self"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["getStatus failed for ",": failed "," : ",""]);m=function(){return a};return a}var n=function(a){var b=a.maybeChild("key-index-list");b=b==null?null:{ts:b.attrTime("ts"),signedKeyIndexBytes:b.hasContent()?b.contentBytes():null,expectedTs:b.hasAttr("expected_ts")?b.attrTime("expected_ts"):void 0};var c=a.mapChildrenWithTag("device",function(b){var c=b.attrDeviceJid("jid");if(d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&((c==null?void 0:c.endsWith("@hosted"))||(c==null?void 0:c.endsWith("@hosted.lid")))){c=(c=d("WAWebWidFactory").createHostedDeviceWid(c))==null?void 0:c.device;if(c==null)throw a.createParseError("invalid hosted device jid");if(c!==d("WAWebBizCoexUtils").HOSTED_DEVICE_ID)throw a.createParseError("invalid hosted device jid");return{id:c,keyIndex:b.hasAttr("key-index")?b.attrInt("key-index"):null,isHosted:!0}}return{id:(c=d("WAWebWidFactory").createWid(b.attrDeviceJid("jid")).device)!=null?c:d("WAJids").DEFAULT_DEVICE_ID,keyIndex:b.hasAttr("key-index")?b.attrInt("key-index"):null}});d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()||(c=c.filter(function(a){return a.id===d("WAWebBizCoexUtils").HOSTED_DEVICE_ID?!1:!0}));return c.length===0?null:{deviceList:c,keyIndex:b}},o=new(c("WADeprecatedWapParser"))("incomingAccountSyncNotification",function(a){a.assertTag("notification");var b={stanzaId:a.attrString("id"),ts:a.attrTime("t"),from:d("WAWebJidToWid").deviceJidToDeviceWid(a.attrDeviceJid("from"))};if(a.hasChild("status")){var c=a.child("status");c=c.hasAttr("action")?c.attrString("action"):void 0;return babelHelpers["extends"]({type:d("WAWebAccountSyncJob").AccountSyncType.STATUS,action:c},b)}else if(a.hasChild("text_status")){c=a.child("text_status");var e=c.hasAttr("action")?c.attrString("action"):void 0,f=c.hasAttr("text")?c.attrString("text"):void 0,g=c.hasChild("emoji")?c.child("emoji"):void 0;g=(g==null?void 0:g.hasAttr("content"))?g==null?void 0:g.attrString("content"):void 0;var h=c.hasAttr("ephemeral_duration_sec")?c.attrInt("ephemeral_duration_sec"):void 0;c=c.hasAttr("last_update_time")?c.attrString("last_update_time"):void 0;return babelHelpers["extends"]({type:d("WAWebAccountSyncJob").AccountSyncType.TEXT_STATUS,action:e,text:f,emoji:g,ephemeralDurationSeconds:h,lastUpdateTime:c},b)}else if(a.hasChild("privacy"))return babelHelpers["extends"]({type:d("WAWebAccountSyncJob").AccountSyncType.PRIVACY},b);else if(a.hasChild("devices"))return babelHelpers["extends"]({type:d("WAWebAccountSyncJob").AccountSyncType.DEVICES,devices:n(a.child("devices"))},b);else if(a.hasChild("blocklist")){e=a.child("blocklist");var i=[];d("WAWebUsernameGatingUtils").usernameDisplayedEnabled()&&e.forEachChildWithTag("item",function(a){var b=a.maybeAttrString("username");a=d("WAWebJidToWid").userJidToUserWid(a.attrUserJid("jid"));b!=null&&i.push({userId:a,username:b})});return babelHelpers["extends"]({type:d("WAWebAccountSyncJob").AccountSyncType.BLOCKLIST,usernames:i},b)}else if(a.hasChild("picture"))return babelHelpers["extends"]({type:d("WAWebAccountSyncJob").AccountSyncType.PICTURE},b);else if(a.hasChild("tos")){f=a.child("tos");var j=[];f.forEachChildWithTag("notice",function(a){var b=a.maybeAttrString("state")!=="false";a=a.attrString("id");j.push({id:a,state:b})});return babelHelpers["extends"]({type:d("WAWebAccountSyncJob").AccountSyncType.TOS,notices:j},b)}else if(a.hasChild("disappearing_mode")){g=a.child("disappearing_mode");var k,l,m;g.hasAttr("action")?k=g.attrString("action"):(l=g.attrInt("duration"),m=g.attrInt("t"));return babelHelpers["extends"]({},b,{type:d("WAWebAccountSyncJob").AccountSyncType.DISAPPEARING_MODE,action:k,disappearingModeDuration:l,disappearingModeSettingTimestamp:m})}else if(a.hasChild("notice")){h=a.child("notice");return babelHelpers["extends"]({type:d("WAWebAccountSyncJob").AccountSyncType.NOTICE,noticeId:h.attrString("id"),noticeStage:h.maybeAttrString("stage"),noticeVersion:h.maybeAttrString("version"),noticeTimestamp:h.attrInt("t")},b)}else if(a.hasChild("user")){c=a.child("user");e=c.maybeAttrString("state")==="AI available";return babelHelpers["extends"]({type:d("WAWebAccountSyncJob").AccountSyncType.USER,isAiAvailable:e},b)}else if(a.hasChild("biz_opt_out_list")){f=a.child("biz_opt_out_list");g=f.mapChildren(function(a){return{action:a.attrString("action"),biz_jid:a.attrUserJid("biz_jid")}});h=f.maybeAttrString("dhash");c=f.maybeAttrString("prev_dhash");return babelHelpers["extends"]({type:d("WAWebAccountSyncJob").AccountSyncType.OPTOUTLIST,list:g,dhash:h,prevDhash:c},b)}throw a.createParseError("notification type not supported")});function p(){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=d("WAWebUserPrefsMeUser").getMeUser(),c;if(d("WAWebABProps").getABPropConfigValue("mex_usync_about_status")){var e=(yield d("WAWebMexUsersGetAboutStatus").getMexUsersAboutStatus(a)),f=e.status;e=e.state;e==null&&(c=f)}else{e=(yield d("WAWebGetAboutQueryJob").getAbout(a));if(e.error){d("WALogger").WARN(m(),a,e.error.errorCode,e.error.errorText);return(h||(h=b("Promise"))).reject(e.error.errorText)}c=e.status}c!==""&&(yield d("WAWebBackendApi").frontendSendAndReceive("setMyStatus",{status:c}))});return q.apply(this,arguments)}function r(){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=d("WAWebUserPrefsMeUser").assertGetMe();a=(yield d("WAWebContactTextStatusBridge").getTextStatus(a));if(a.error)return(h||(h=b("Promise"))).reject(a.error.message);var c=a.id,e=a.text,f=a.emoji,g=a.ephemeralDurationSeconds;a=a.lastUpdateTime;e=d("WAWebTextStatusParseUtils").parseTextStatusServerResponse({text:e,emoji:f!=null?{content:f}:null,ephemeral_duration_sec:g,last_update_time:a==null?void 0:a.toString(),jid:c.toJid()});return d("WAWebUpdateTextStatusForContact").updateTextStatusForContact(e.id,e.textStatusString,e.textStatusEmoji,e.textStatusEphemeralDuration,e.textStatusLastUpdateTime)});return s.apply(this,arguments)}function t(a){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.wid;a=a.devices;var c=d("WAWebUserPrefsMeUser").getMaybeMeLidUser(),e={wid:b,devices:a};if(c==null)return[e];var f=d("WAWebUserPrefsMeUser").getMeUser();if(!b.isSameAccountAndAddressingMode(f)){d("WALogger").ERROR(l()).sendLogs("wid-is-not-self");return[e]}b=(yield d("WAWebSignalStoreApi").waSignalStore.bulkGetIdentity([d("WAWebSignalCommonUtils").createSignalAddressForIdentityTable(f),d("WAWebSignalCommonUtils").createSignalAddressForIdentityTable(c)]));f=b[0];b=b[1];b==null&&f!=null&&(yield d("WAWebSignalStoreApi").waSignalStore.putIdentity(d("WAWebSignalCommonUtils").createSignalAddressForIdentityTable(c).toString(),f));return[e,{wid:c,devices:a}]});return u.apply(this,arguments)}function a(a){return v.apply(this,arguments)}function v(){v=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=o.parse(a);if(c.error){d("WALogger").DEV(k(),a.toString());d("WALogger").ERROR(j(),c.error.toString());return(h||(h=b("Promise"))).reject(c.error)}a=c.success;c=d("WAWap").wap("ack",{id:d("WAWap").CUSTOM_STRING(a.stanzaId),to:d("WAWebCommsWapMd").JID(a.from),"class":"notification",type:"account_sync"});switch(a.type){case d("WAWebAccountSyncJob").AccountSyncType.STATUS:yield p();break;case d("WAWebAccountSyncJob").AccountSyncType.TEXT_STATUS:if(!d("WAWebTextStatusGatingUtils").receiveTextStatusEnabled())break;if(a.action==="modify")yield r();else{var e=a.text,f=a.emoji,g=a.ephemeralDurationSeconds,l=a.lastUpdateTime,m=d("WAWebWidFactory").toUserWid(a.from);yield d("WAWebUpdateTextStatusForContact").updateTextStatusForContact(m,e,f,g,l!=null?Number(l):void 0)}break;case d("WAWebAccountSyncJob").AccountSyncType.DEVICES:if(!d("WAWebOfflineHandler").OfflineMessageHandler.isResumeFromRestartComplete()){d("WAWebOfflineDeviceCache").OfflinePendingDeviceCache.addOfflinePendingDevice(a.from.toString(),c);return"NO_ACK"}else if(d("WAWebOfflineHandler").OfflineMessageHandler.isResumeOnSocketDisconnectInProgress()){yield d("WAWebApiPendingDeviceSync").addUserToPendingDeviceSync([a.from.toString()]);return c}m=a.devices;if(m){e=(yield t({wid:d("WAWebWidFactory").toUserWid(a.from),devices:m}));yield d("WAWebAdvHandlerApi").handleADVDeviceSyncResult(e)}else yield d("WAWebAccountSyncJob").getDevices("notification");break;case d("WAWebAccountSyncJob").AccountSyncType.PICTURE:yield d("WAWebAccountSyncJob").getAndUpdateProfilePicture();break;case d("WAWebAccountSyncJob").AccountSyncType.PRIVACY:d("WAWebCmd").Cmd.onAccountSyncForPrivacy(yield d("WAWebAccountSyncJob").updatePrivacySettings());break;case d("WAWebAccountSyncJob").AccountSyncType.BLOCKLIST:d("WAWebUsernameGatingUtils").usernameDisplayedEnabled()&&a.usernames!=null&&(yield d("WAWebSetUsernameJob").setUsernamesJob(a.usernames));d("WAWebAccountSyncJob").updateBlocklist();break;case d("WAWebAccountSyncJob").AccountSyncType.OPTOUTLIST:f=d("WAWebUserPrefsMultiDevice").getOptOutListHash();g=a.dhash;l=a.prevDhash;m=a.list;if(d("WAWebMarketingMessagesUserFeedbackGatingUtils").isMMOptOutListServerSyncEnabled()&&f!==l){d("WAWebWorkerSafeBackendApi").workerSafeFireAndForget("updateOptOutList");break}else g!=null&&(m==null?void 0:m.forEach(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.action;a=a.biz_jid;b=b==="block";a=d("WAWebJidToWid").userJidToUserWid(a);yield d("WAWebWorkerSafeBackendApi").workerSafeFireAndForget("updateOptOutListModelInCollection",{targetWid:a,isBlocked:b})});return function(b){return a.apply(this,arguments)}}()),yield d("WAWebUserPrefsMultiDevice").setOptOutlistHash(g));break;case d("WAWebAccountSyncJob").AccountSyncType.TOS:a.notices&&d("WAWebAccountSyncJob").updateTosStateFromAccountSync(a.notices);break;case d("WAWebAccountSyncJob").AccountSyncType.DISAPPEARING_MODE:e=a.action;f=a.from;l=a.disappearingModeDuration;m=a.disappearingModeSettingTimestamp;if(e==="modify"){g=(yield d("WAWebGetDisappearingModeJob").getDisappearingMode(f));g.error==null&&g.disappearingModeDuration!=null&&g.disappearingModeSettingTimestamp!=null&&(l=g.disappearingModeDuration,m=g.disappearingModeSettingTimestamp)}l!=null&&m!=null&&(yield d("WAWebUpdateDisappearingModeForContact").updateDisappearingModeForContact(f,l,m));break;case d("WAWebAccountSyncJob").AccountSyncType.NOTICE:e=a.noticeId;g=a.noticeStage;f=a.noticeVersion;l=a.noticeTimestamp;if(e!=null&&e!==""&&g!=null&&f!=null&&l!=null){m=g===d("WAWebPDFNTypes").NOTICE_STAGES.PDFN_ACCEPTED;yield d("WAWebUserDisclosureCollection").UserDisclosureCollection.updateNoticeStage({id:e,accepted:m,policyVersion:f});d("WAWebAccountSyncJob").updateTosStateFromAccountSync([{id:e,state:m,timestamp:d("WATimeUtils").castToUnixTime(l)}])}break;case d("WAWebAccountSyncJob").AccountSyncType.USER:a.isAiAvailable===!0&&d("WALogger").LOG(i());break}return c});return v.apply(this,arguments)}g.getAndUpdateStatus=p;g.getDeviceSyncInputs=t;g.handleAccountSyncNotification=a}),98); __d("WAWebHandleChatState",["WAWebApiChat","WAWebApiContact","WAWebChangePresenceHandlerAction","WAWebJidToWid","WAWebLid1X1MigrationGating","WAWebLidMigrationUtils","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){a=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.jid;a=a.status;b=d("WAWebJidToWid").userJidToUserWid(b);var e;if(d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()){var f=d("WAWebLidMigrationUtils").toUserLid(b);if(f){f=(yield d("WAWebApiChat").getChatRecordByAccountLid(f));f[0]&&(e=d("WAWebWidFactory").createWid(f[0].id))}}else{e=b;if(b.isLid()&&!d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()){f=(yield d("WAWebApiContact").getPhoneNumber(b));f&&(yield c("WAWebChangePresenceHandlerAction")({id:f,type:a}))}}e&&(yield c("WAWebChangePresenceHandlerAction")({id:e,type:a}));return"NO_ACK"});return function(b){return a.apply(this,arguments)}}();e=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.jid,e=a.status;a=a.participant;b=d("WAWebJidToWid").chatJidToChatWid(b);a=d("WAWebJidToWid").userJidToUserWid(a);yield c("WAWebChangePresenceHandlerAction")({id:b,type:e,participant:a});return"NO_ACK"});return function(b){return a.apply(this,arguments)}}();g.handleIndividualChatState=a;g.handleGroupChatState=e}),98); __d("WAWebProcessPhoneNumberChange",["WAJids","WAWebBackendApi","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=d("WAJids").validateChatJid(a.toJid());b=d("WAJids").validateChatJid(b.toJid());if(a==null||b==null)return;return d("WAWebBackendApi").frontendFireAndForget("updateNoteJidAction",{oldJid:a,newJid:b})});return h.apply(this,arguments)}g["default"]=a}),98); __d("WAWebHandleContactNotification",["Promise","WADeprecatedWapParser","WALogger","WANullthrows","WAWap","WAWebApiChat","WAWebBackendJobsCommon","WAWebChangeProfilePicThumb","WAWebChatCollection","WAWebContactCollection","WAWebContactGetters","WAWebContactSyncBridge","WAWebContactTextStatusBridge","WAWebDBCreateLidPnMappings","WAWebHandleSingleMsg","WAWebJidToWid","WAWebLid1X1MigrationGating","WAWebMessageProcessUtils","WAWebMsgKey","WAWebMsgType","WAWebOrchestratorNonPersistedJob","WAWebPresenceCollection","WAWebProcessPhoneNumberChange","WAWebProfilePicConstants","WAWebSchemaChat","WAWebStatusContactAction","WAWebTextStatusCollection","WAWebTextStatusGatingUtils","WAWebUpdateTextStatusForContact","WAWebUserPrefsMeUser","WAWebViewMode.flow","WAWebWidFactory","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleContactsNotification: unhandled notification of type ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["received contact sync notification"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleContactsNotification: an update command does not include jid"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["Parsing Error: ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["error while parsing: ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["notification.oldJid is null"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(['Unexpected "contacts" notification']);o=function(){return a};return a}var p=new(c("WADeprecatedWapParser"))("incomingContactsNotification",function(a){a.assertTag("notification");var b=a.attrString("id"),c=a.attrWapJid("from"),e=a.attrTime("t"),f=a.attrString("t");c={from:c,ts:e,rawTs:f,stanzaId:b};if(a.hasChild("update")){var g=a.child("update");if(g.hasAttr("jid"))return babelHelpers["extends"]({type:"update",jid:d("WAWebJidToWid").userJidToUserWid(g.attrUserJid("jid"))},c);else if(g.hasAttr("hash")){e=d("WAWebContactCollection").ContactCollection.findFirst(function(a){return((a=d("WAWebContactGetters").getUserhash(a))==null?void 0:a.slice(0,4))===g.attrString("hash")});return e==null?babelHelpers["extends"]({type:"empty",jid:null},c):babelHelpers["extends"]({type:"update",jid:e.id},c)}return babelHelpers["extends"]({type:"empty",jid:null},c)}else if(a.hasChild("add")){f=a.child("add");return babelHelpers["extends"]({type:"add",hash:f.hasContent()?f.contentBytes():null,jid:null},c)}else if(a.hasChild("remove")){b=a.child("remove");return babelHelpers["extends"]({type:"remove",jid:d("WAWebJidToWid").userJidToUserWid(b.attrUserJid("jid"))},c)}else if(a.hasChild("modify")){e=a.child("modify");return babelHelpers["extends"]({type:"modify",jid:d("WAWebJidToWid").userJidToUserWid(e.attrUserJid("new")),oldJid:d("WAWebJidToWid").userJidToUserWid(e.attrUserJid("old")),lid:e.maybeAttrUserJid("new_lid")?d("WAWebJidToWid").lidUserJidToUserLid(e.attrLidUserJid("new_lid")):null,oldLid:e.maybeAttrUserJid("old_lid")?d("WAWebJidToWid").lidUserJidToUserLid(e.attrLidUserJid("old_lid")):null},c)}else if(a.hasChild("sync")){f=a.child("sync");return babelHelpers["extends"]({type:"sync",after:f.attrTime("after"),jid:null},c)}d("WALogger").WARN(o());return babelHelpers["extends"]({type:"empty",jid:null},c)});function q(a,b){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if(b.type!=="modify")throw c("err")("Error: genContactChangeNotificationMsg invalid type");else{var e=d("WAWebUserPrefsMeUser").getMeUser(),f=c("WANullthrows")(b.oldJid),g=c("WANullthrows")(b.jid);if(b.lid!=null&&b.oldLid!=null){var h=b.oldLid,i=b.lid;h=[f,g,h,i]}else h=[f,g];return{id:new(c("WAWebMsgKey"))({remote:a,fromMe:!1,id:yield c("WAWebMsgKey").newId()}),from:a,subtype:"change_number",viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE,t:b.ts,to:e,type:"notification_template",kind:d("WAWebMsgType").MsgKind.NotificationTemplate,templateParams:h}}});return r.apply(this,arguments)}function s(a,b){return t.apply(this,arguments)}function t(){t=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b.oldJid!=null&&b.jid!=null&&(yield c("WAWebProcessPhoneNumberChange")(b.oldJid,b.jid));b=(yield q(a,b));yield d("WAWebHandleSingleMsg").handleSingleMsg(a,b,"changeNumberNotification")});return t.apply(this,arguments)}function u(a,b){return v.apply(this,arguments)}function v(){v=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if(b&&d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()){b=(yield d("WAWebMessageProcessUtils").selectChatForOneOnOneMessage({lid:b}));return b.chatId}return a});return v.apply(this,arguments)}function w(a){return x.apply(this,arguments)}function x(){x=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a.oldJid){var c=a.oldJid,e=a.jid,f=a.oldLid,g=a.lid,i=[],j=(yield u(c,f)),k=(yield d("WAWebApiChat").getChatRecord(j));k&&i.push({id:k.id,changeNumberNewJid:e.toString(),changeNumberOldJid:void 0});k=(yield u(e,g));var l=(yield d("WAWebApiChat").getChatRecord(k));l&&i.push({id:l.id,changeNumberNewJid:void 0,changeNumberOldJid:c.toString()});yield d("WAWebSchemaChat").getChatTable().bulkCreateOrMerge(i).then(function(){i.forEach(function(a){var b=d("WAWebChatCollection").ChatCollection.get(a.id);if(b){var c=a.changeNumberNewJid;a=a.changeNumberOldJid;b.changeNumberNewJid=c!=null?d("WAWebWidFactory").createWid(c):void 0;b.changeNumberOldJid=a!=null?d("WAWebWidFactory").createWid(a):void 0}})});f!=null&&g!=null&&(yield d("WAWebDBCreateLidPnMappings").createLidPnMappings({mappings:[{lid:f,pn:c},{lid:g,pn:e}],flushImmediately:!0,learningSource:"other"}));yield (h||(h=b("Promise"))).all([s(j,a),s(k,a)])}else d("WALogger").LOG(n()).devConsole(a)});return x.apply(this,arguments)}function y(a){return z.apply(this,arguments)}function z(){z=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=p.parse(a);if(c.error){d("WALogger").DEV(m(),a.toString());d("WALogger").ERROR(l(),c.error.toString());throw c.error}a=c.success;c=a.jid;switch(a.type){case"update":if(!c){d("WALogger").WARN(k());return n(a)}var e=d("WAWebPresenceCollection").PresenceCollection.get(c);e&&e.reset();var f=d("WAWebTextStatusCollection").TextStatusCollection.get(c);e=f==null?null:d("WAWebStatusContactAction").getStatus(d("WAWebWidFactory").toUserWid(c)).then(function(a){f.set({status:a.status})});c=d("WAWebContactCollection").ContactCollection.get(c);var g;c&&d("WAWebTextStatusGatingUtils").receiveTextStatusEnabled()&&(g=d("WAWebContactTextStatusBridge").getTextStatus(c.id,c.textStatusLastUpdateTime).then(function(a){var b=a.text,c=a.emoji,e=a.ephemeralDurationSeconds,f=a.lastUpdateTime;a=a.id;return d("WAWebUpdateTextStatusForContact").updateTextStatusForContact(a,b,c,e,f!=null?Number(f):void 0)}));c=d("WAWebChangeProfilePicThumb").changeProfilePicThumb(a.jid,d("WAWebProfilePicConstants").ProfilePicCommand.Set);yield (h||(h=b("Promise"))).all([c,e,g]);return n(a);case"modify":yield w(a);return n(a);case"sync":d("WALogger").LOG(j()).tags("contact-sync");yield d("WAWebContactSyncBridge").doFullContactSync();return n(a);default:d("WALogger").LOG(i(),a.type);return n(a)}function n(a,b){return d("WAWap").wap("ack",{id:d("WAWap").CUSTOM_STRING(a.stanzaId),to:a.from,"class":"notification",type:"contacts"},b)}});return z.apply(this,arguments)}function a(a){var b=d("WAWebBackendJobsCommon").getNonCriticalNotificationPriority(Boolean(a.attrs.offline));return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("handleContactNotification",function(a){return y(a.node)},{priority:b}).waitUntilCompleted({node:a})}g["default"]=a}),98); __d("WAWebE2ETestPairingConstants",[],(function(a,b,c,d,e,f){a="jest_e2e_pairing_attempt_ongoing";b="jest_e2e_first_read_done";f.PAIRING_ATTEMPT_ONGOING_KEY=a;f.FIRST_QRCODE_READ_DONE=b}),66); __d("WAWebHandleFailure",["Promise","WAComms","WADeprecatedWapParser","WALogger","WAWebCmd","WAWebE2ETestPairingConstants","WAWebFailureErrorCodes","WAWebJestE2ELogUtils","WAWebL10N","WAWebLocalStorage","WAWebLogoutReasonConstants","WAWebSocketModel","WAWebUpdater","WAWebUpdaterUpdatePoll","WAWebUpdaterVersion","WAWebWamPlatform","asyncToGeneratorRuntime","err","gkx"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["failure reason "," not implemented yet"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleFailure: got failure code ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleFailure: got failure code ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["Incorrect temporary ban data "," ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["Client too old or bad user agent, attempting to update the app"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["received failure stanza, reason: ",", logging out"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["received failure stanza, reason: ",", logging out"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose([""," parsing ",""]);p=function(){return a};return a}var q=new(c("WADeprecatedWapParser"))("failureParser",function(a){a.assertTag("failure");return{reason:a.attrInt("reason",400,599),location:a.attrString("location"),code:a.hasAttr("code")?a.attrInt("code"):null,expire:a.hasAttr("expire")?a.attrInt("expire"):null,message:a.maybeAttrString("message"),url:a.maybeAttrString("url"),logoutMessageHeader:a.maybeAttrString("logout_message_header"),logoutMessageSubtext:a.maybeAttrString("logout_message_subtext"),logoutMessageLocale:a.maybeAttrString("logout_message_locale")}});function a(a){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){c("gkx")("26256")&&(d("WAWebJestE2ELogUtils").maybeLogToJestE2eJSConsole("received failure stanza, "+a.toString()),c("WAWebLocalStorage")==null?void 0:c("WAWebLocalStorage").removeItem(d("WAWebE2ETestPairingConstants").PAIRING_ATTEMPT_ONGOING_KEY));var e=q.parse(a);if(e.error){d("WALogger").ERROR(p(),e.error.toString(),a.toString());return(h||(h=b("Promise"))).reject(e.error)}switch(e.success.reason){case d("WAWebFailureErrorCodes").FAILURE_REASON.REASON_LOCKED:d("WALogger").LOG(o(),e.success.reason);a=e.success;var f=a.logoutMessageHeader,g=a.logoutMessageSubtext;a=a.logoutMessageLocale;var r=null;a===c("WAWebL10N").getNormalizedLocale()&&(f!=null||g!=null)&&(r={logoutMessageHeader:f,logoutMessageSubtext:g});yield d("WAWebSocketModel").Socket.clearCredentialsAndStoredData(d("WAWebLogoutReasonConstants").LogoutReason.AccountLocked,r);d("WAWebCmd").Cmd.logout();break;case d("WAWebFailureErrorCodes").FAILURE_REASON.REASON_NOT_AUTHORIZED:case d("WAWebFailureErrorCodes").FAILURE_REASON.REASON_BANNED:d("WALogger").LOG(n(),e.success.reason);yield d("WAWebSocketModel").Socket.clearCredentialsAndStoredData();d("WAWebCmd").Cmd.logout();break;case d("WAWebFailureErrorCodes").FAILURE_REASON.REASON_CLIENT_TOO_OLD:case d("WAWebFailureErrorCodes").FAILURE_REASON.REASON_BAD_USER_AGENT:d("WALogger").LOG(m());a=d("WAWebUpdaterVersion").SANITIZED_VERSION_STR;f=d("WAWebUpdaterUpdatePoll").PLATFORMS[d("WAWebWamPlatform").getWamPlatform()];f==="web"?d("WAWebUpdater").Updater.update(a,!1,0):d("WAWebUpdater").Updater.update(void 0,!1,0);d("WAComms").stopComms();break;case d("WAWebFailureErrorCodes").FAILURE_REASON.REASON_TEMP_BANNED:g=e.success;r=g.code;f=g.expire;a=g.message;g=g.url;if(r!=null&&f!=null)d("WAWebCmd").Cmd.onTemporaryBan({banned:!0,code:r,message:a,url:g,expire:f});else{d("WALogger").ERROR(l(),r,f);throw c("err")("handleFailure: wrong temp ban data")}break;case d("WAWebFailureErrorCodes").FAILURE_REASON.REASON_GENERIC_FAILURE:case d("WAWebFailureErrorCodes").FAILURE_REASON.REASON_INTERNAL_SERVER_ERROR:case d("WAWebFailureErrorCodes").FAILURE_REASON.REASON_EXPERIMENTAL:d("WALogger").WARN(k(),e.success.reason);break;case d("WAWebFailureErrorCodes").FAILURE_REASON.REASON_SERVICE_UNAVAILABLE:d("WALogger").WARN(j(),e.success.reason);d("WAWebCmd").Cmd.showServiceUnavailableError();break;default:d("WALogger").WARN(i(),e.success.reason);return(h||(h=b("Promise"))).reject(c("err")("failure reason "+e.success.reason+" not implemented yet"))}});return r.apply(this,arguments)}g["default"]=a}),98); __d("WAWebCryptoMediaRetry",["WABinary","WACryptoAesGcm","WACryptoHkdf","WALogger","WAWebProtobufsMmsRetry.pb","asyncToGeneratorRuntime","decodeProtobuf","encodeProtobuf"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["encodeServerErrorReceipt"]);h=function(){return a};return a}function i(a){d("WALogger").LOG(h()).devConsole(a);var b=new(d("WABinary").Binary)();d("encodeProtobuf").encodeProtobuf(d("WAWebProtobufsMmsRetry.pb").ServerErrorReceiptSpec,a,b);return b.readByteArray()}function a(a,b,c){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){a=(yield n(a));c=(c==null?void 0:c.slice())||o();var e=i({stanzaId:b});a=(yield d("WACryptoAesGcm").gcmEncrypt(a,c,e,b));return{ciphertext:a,iv:c}});return j.apply(this,arguments)}function c(a,b,c,d){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e){a=(yield n(a));a=(yield d("WACryptoAesGcm").gcmDecrypt(a,c,e,b));return d("decodeProtobuf").decodeProtobuf(d("WAWebProtobufsMmsRetry.pb").MediaRetryNotificationSpec,a)});return k.apply(this,arguments)}var l=12,m="WhatsApp Media Retry Notification";function n(a){return d("WACryptoHkdf").extractAndExpand(a,m,32)}function o(){var a=new Uint8Array(l);self.crypto.getRandomValues(a);return a}g.encryptServerErrorReceipt=a;g.decryptMediaRetryNotification=c;g.ENC_IV_SIZE=l}),98); __d("WAWebHandleMediaRetryNotification",["WABase64","WADeprecatedWapParser","WALogger","WANullthrows","WAWap","WAWebCommsWapMd","WAWebCryptoMediaRetry","WAWebProtobufsMmsRetry.pb","WAWebRequestMediaReuploadManager","WAWebUserPrefsMeUser","WAWebWidFactory","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleMediaRetryNotification: ",": id mismatch"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleMediaRetryNotification: ",": mediaKey is not found"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleMediaRetryNotification: ",": received error code: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleMediaRetryNotification: received from not self-primary"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleMediaRetryNotification: received from not self-primary: ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleMediaRetryNotification: parsing error: ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleMediaRetryNotification: error while parsing: ",""]);n=function(){return a};return a}var o=new(c("WADeprecatedWapParser"))("mediaRetryNotification",function(a){a.assertTag("notification");var b=a.maybeChild("error"),c=a.attrWapJid("from"),e;a.hasAttr("participant")&&(e=a.attrWapJid("participant"));if(b)return{from:c,participant:e,msgId:a.attrString("id"),ciphertext:null,iv:null,errorCode:d("WAWebProtobufsMmsRetry.pb").MediaRetryNotification$ResultType.cast(b.attrInt("code"))};b=a.child("encrypt");return{from:c,participant:e,msgId:a.attrString("id"),ciphertext:b.child("enc_p").contentBytes(),iv:b.child("enc_iv").contentBytes(d("WAWebCryptoMediaRetry").ENC_IV_SIZE),errorCode:null}});function a(a){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=o.parse(a);if(b.error){d("WALogger").DEV(n(),a.toString());d("WALogger").ERROR(m(),b.error.toString());throw b.error}a=b.success;var e=a.from,f=a.participant,g=a.msgId;a=a.errorCode;(e==null||!d("WAWebUserPrefsMeUser").isMeAccount(d("WAWebWidFactory").createDeviceWid(e.toString())))&&(d("WALogger").LOG(l(),e),d("WALogger").WARN(k()).sendLogs("media-retry-notification-not-from-self-primary"));e=d("WAWap").wap("ack",{id:d("WAWap").CUSTOM_STRING(g),"class":"notification",type:"mediaretry",to:e!=null?e:d("WAWebCommsWapMd").USER_JID(d("WAWebUserPrefsMeUser").getMeUser()),participant:f||d("WAWap").DROP_ATTR});if(a!=null){d("WALogger").LOG(j(),g,a);d("WAWebRequestMediaReuploadManager").RequestMediaReuploadManager.resolveMediaReupload({msgId:g,result:a});return e}f=b.success;a=f.ciphertext;b=f.iv;f=d("WAWebRequestMediaReuploadManager").RequestMediaReuploadManager.getMediaKey(g);if(!f){d("WALogger").WARN(i(),g);return e}f=(yield d("WAWebCryptoMediaRetry").decryptMediaRetryNotification(d("WABase64").decodeB64(f),g,c("WANullthrows")(b),c("WANullthrows")(a)));b=f.stanzaId;a=f.directPath;f=f.result;if(b!==g){d("WALogger").LOG(h(),g);throw c("err")("handleMediaRetryNotification: msg id does not match")}d("WAWebRequestMediaReuploadManager").RequestMediaReuploadManager.resolveMediaReupload({msgId:g,result:f,directPath:a});return e});return p.apply(this,arguments)}g["default"]=a}),98); __d("WAWebHandlePairDevice",["Promise","WABinary","WALogger","WAShiftTimer","WASmaxMdSetToCompanionRPC","WAWebAdvSignatureApi","WAWebConnModel","WAWebNetworkStatus","WAWebSocketConstants","WAWebSocketModel","WAWebUserPrefsMultiDevice","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["handlePairDevice: error: ",""]);i=function(){return a};return a}var j=60*1e3,k=20*1e3,l=[],m=null;function a(a){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c;try{c=d("WASmaxMdSetToCompanionRPC").receiveSetToCompanionRPC(a)}catch(a){d("WALogger").ERROR(i(),a.toString());return(h||(h=b("Promise"))).reject(a)}a=c;var e=a.parsedRequest;a=a.makeSetToCompanionResponseClientResponse;e=e.pairDeviceRef.map(function(a){a=new(d("WABinary").Binary)(a.elementValue);return a.readString(a.size())});void o(e);return a()});return n.apply(this,arguments)}function o(a){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield d("WAWebAdvSignatureApi").generateADVSecretKey(),l=a,m||(m=new(d("WAShiftTimer").ShiftTimer)(function(){if(d("WAWebUserPrefsMultiDevice").isRegistered()||!c("WAWebNetworkStatus").online)m&&m.cancel(),m=null;else if(!l||!l.length)m&&m.cancel(),m=null,d("WAWebSocketModel").Socket.state=d("WAWebSocketConstants").SOCKET_STATE.UNPAIRED_IDLE;else{var a=l.length===6?j:k,b=l.shift();d("WAWebConnModel").Conn.set({ref:b,refTTL:a});d("WAWebSocketModel").Socket.state=d("WAWebSocketConstants").SOCKET_STATE.UNPAIRED;m&&m.onOrAfter(a)}})),m.forceRunNow()});return p.apply(this,arguments)}g["default"]=a}),98); __d("WAWebSingleSignalSession",["WAWebUserPrefsIndexedDBStorage","WAWebUserPrefsKeys","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){return d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.set(d("WAWebUserPrefsKeys").BACKEND_ONLY_KEYS.USING_ACCOUNT_IDENTIFIER_FOR_SIGNAL_STORAGE,a)});return h.apply(this,arguments)}function c(){var a;a=(a=d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.get(d("WAWebUserPrefsKeys").BACKEND_ONLY_KEYS.USING_ACCOUNT_IDENTIFIER_FOR_SIGNAL_STORAGE))!=null?a:!1;return a===!0}g.setIsUsingAccountIdentifierForSignalStorage=a;g.isUsingAccountIdentifierForSignalStorage=c}),98); __d("WAWebHandlePairSuccess",["invariant","Promise","WABase64","WABinary","WACryptoHmac","WALogger","WANullthrows","WAQplTypes","WASmaxMdSetRegRPC","WATimeUtils","WAWebAdvSignatureApi","WAWebAltDeviceLinkingApi","WAWebBizAgentAction","WAWebBizCoexGatingUtils","WAWebCompanionRegUtils","WAWebConnModel","WAWebCryptoCurve25519","WAWebE2ETestPairingConstants","WAWebEnvironment","WAWebFtsClient","WAWebJidToWid","WAWebLid11MigrationLifecycleWamEvent","WAWebLid1X1MigrationGating","WAWebLocalStorage","WAWebLogoutReasonConstants","WAWebMobilePlatforms","WAWebProtobufsAdv.pb","WAWebProtobufsCompanionReg.pb","WAWebSignalCommonUtils","WAWebSignalStoreApi","WAWebSingleSignalSession","WAWebSocketLogoutJob","WAWebUserPrefsHistorySync","WAWebUserPrefsInfoStore","WAWebUserPrefsMeUser","WAWebUserPrefsMultiDevice","WAWebWamDeviceLinkReporter","WAWebWamEnumMdLinkDeviceCompanionStage","WAWebWamEnumMigrationStageEnum","WAWebWidFactory","asyncToGeneratorRuntime","cr:17219","decodeProtobuf","encodeProtobuf","gkx"],(function(a,b,c,d,e,f,g,h){var i;function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["error in handlePairSuccess, ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["Parsing Error: ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["error while parsing: ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["WAWebHandlePairSuccess - isUsingAccountIdentifierForSignalStorage: true"]);m=function(){return a};return a}var n=!1;function a(a){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){c("gkx")("26256")&&(c("WAWebLocalStorage")==null?void 0:c("WAWebLocalStorage").removeItem(d("WAWebE2ETestPairingConstants").PAIRING_ATTEMPT_ONGOING_KEY));if(n||d("WAWebUserPrefsMultiDevice").isRegistered())return;d("WALogger").WARN(m());yield d("WAWebSingleSignalSession").setIsUsingAccountIdentifierForSignalStorage(!0);n=!0;var e=d("WATimeUtils").unixTimeWithoutClockSkewCorrection(),f=null;try{f=d("WASmaxMdSetRegRPC").receiveSetRegRPC(a)}catch(c){d("WALogger").DEV(l(),a.toString());d("WALogger").ERROR(k(),c.toString());n=!1;return(i||(i=b("Promise"))).reject(c)}a=f;f=a.parsedRequest;var g=a.makeSetRegResponseClientResponse;a=a.makeSetRegResponseError;try{d("WAWebCompanionRegUtils").resetCompanionReg();d("WAWebUserPrefsMultiDevice").setPairingTimestamp(e);if(d("WAWebAltDeviceLinkingApi").getPairingType()===d("WAWebAltDeviceLinkingApi").PairingType.ALT_DEVICE_LINKING){var o;(o=d("WAWebAltDeviceLinkingApi").getCurrentMarker())==null?void 0:o.addPoint("alt_linking_pair_success");(o=d("WAWebAltDeviceLinkingApi").getCurrentMarker())==null?void 0:o.end(d("WAQplTypes").QuickLogActionType.SUCCESS)}o=f.pairSuccessDeviceJid;var q=f.pairSuccessDeviceIdentityElementValue,r=f.pairSuccessPlatformName,s=f.pairSuccessDeviceLid;f=f.pairSuccessClientProps;d("WAWebConnModel").Conn.blockStoreAdds=!1;d("WAWebConnModel").Conn.platform=r;yield d("WAWebMobilePlatforms").setMobilePlatform(r);d("WAWebUserPrefsMeUser").setMe(d("WAWebJidToWid").deviceJidToDeviceWid(o));s!=null&&d("WAWebUserPrefsMeUser").setMeLid(d("WAWebJidToWid").deviceJidToDeviceWid(s));f&&(yield p(f));r=d("decodeProtobuf").decodeProtobuf(d("WAWebProtobufsAdv.pb").ADVSignedDeviceIdentityHMACSpec,q);s=r.details;f=r.hmac;s!=null&&f!=null||h(0,56299);q=new(d("WABinary").Binary)(s).readByteArray();d("WAWebBizCoexGatingUtils").smbHostedPrimaryPairingAllowed()&&(r.accountType===d("WAWebProtobufsAdv.pb").ADVEncryptionType.HOSTED&&(yield d("WAWebUserPrefsMultiDevice").setIsHostedMeAccount(),q=d("WABinary").Binary.build(d("WAWebAdvSignatureApi").ADV_HOSTED_PREFIX_DEVICE_IDENTITY_ACCOUNT_SIGNATURE,c("WANullthrows")(s)).readByteArray()));r=(yield d("WAWebAdvSignatureApi").getADVSecretKey());r=(yield d("WACryptoHmac").hmacSha256(r,q));q=d("WABase64").encodeB64(r);r=d("WABase64").encodeB64(f);if(q!==r){d("WAWebCompanionRegUtils").logoutAfterValidationFail();n=!1;return a()}f=d("decodeProtobuf").decodeProtobuf(d("WAWebProtobufsAdv.pb").ADVSignedDeviceIdentitySpec,s);q=f.accountSignatureKey;q!=null||h(0,56344);r=f.accountSignature;r!=null||h(0,56295);s=(yield d("WAWebSignalStoreApi").waSignalStore.getRegistrationInfo());s!=null||h(0,56296);yield d("WAWebWamDeviceLinkReporter").initDeviceLinkEvent(q,s.identityKeyPair.pubKey,e);yield d("WAWebWamDeviceLinkReporter").setDeviceLinkPairStage(d("WAWebWamEnumMdLinkDeviceCompanionStage").MD_LINK_DEVICE_COMPANION_STAGE.PAIR_SUCCESS_RECEIVED);d("WAWebCompanionRegUtils").initDevicePairingLatencyMeasurement();r=d("WAWebAdvSignatureApi").verifyDeviceIdentityAccountSignature(f,s.identityKeyPair.pubKey,null);if(!r){yield d("WAWebWamDeviceLinkReporter").commitDeviceLinkEvent(401);d("WAWebCompanionRegUtils").logoutAfterValidationFail();n=!1;return a()}f.deviceSignature=(yield d("WAWebAdvSignatureApi").generateDeviceSignature(f,s.identityKeyPair,q));yield d("WAWebSignalStoreApi").waSignalStore.putIdentity(d("WAWebSignalCommonUtils").createSignalAddressForIdentityTable(d("WAWebWidFactory").toUserWid(d("WAWebJidToWid").deviceJidToDeviceWid(o))).toString(),d("WAWebSignalCommonUtils").bufferToStr(d("WAWebCryptoCurve25519").toSignalCurvePubKey(q)));yield d("WAWebAdvSignatureApi").setADVSignedIdentity(f);r=d("decodeProtobuf").decodeProtobuf(d("WAWebProtobufsAdv.pb").ADVDeviceIdentitySpec,f.details);a=r.keyIndex;a!=null||h(0,56297);f.accountSignatureKey=void 0;s=d("encodeProtobuf").encodeProtobuf(d("WAWebProtobufsAdv.pb").ADVSignedDeviceIdentitySpec,f).readByteArray();o=g({deviceIdentityElementValue:s,deviceIdentityKeyIndex:a});if(c("WAWebEnvironment").isWindows){q=(yield d("WAWebUserPrefsInfoStore").waNoiseInfo.get());f=q==null?void 0:(r=q.staticKeyPair)==null?void 0:r.privKey;g=f!=null?d("WABase64").encodeB64(f):"";yield b("cr:17219")==null?void 0:(s=b("cr:17219").getWindowsBridge())==null?void 0:(a=s.getClientKeyBridge())==null?void 0:a.setClientKey(g);yield d("WAWebFtsClient").ftsClient.initExternalStorage()}yield d("WAWebWamDeviceLinkReporter").setDeviceLinkPairStage(d("WAWebWamEnumMdLinkDeviceCompanionStage").MD_LINK_DEVICE_COMPANION_STAGE.PAIR_DEVICE_SIGN_SENT);q=(yield d("WAWebUserPrefsHistorySync").getInitialHistorySyncComplete());q!==!0&&d("WAWebCompanionRegUtils").startInitialHistorySyncTimeout();n=!1;d("WAWebBizAgentAction").setShouldLogAgentLogin({loginTimestamp:e});return o}catch(a){d("WALogger").ERROR(j(),a).verbose().devConsole(a).sendLogs("error in handlePairSuccess"),yield d("WAWebWamDeviceLinkReporter").commitDeviceLinkEvent(-1),yield d("WAWebSocketLogoutJob").socketLogout(d("WAWebLogoutReasonConstants").LogoutReason.UnknownCompanion)}});return o.apply(this,arguments)}function p(a){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=d("decodeProtobuf").decodeProtobuf(d("WAWebProtobufsCompanionReg.pb").ClientPairingPropsSpec,a.elementValue);a=a.isChatDbLidMigrated;a===!0&&(new(d("WAWebLid11MigrationLifecycleWamEvent").Lid11MigrationLifecycleWamEvent)({migrationStage:d("WAWebWamEnumMigrationStageEnum").MIGRATION_STAGE_ENUM.COMPANION_MIGRATED_ON_NEW_PAIRING}).commit(),yield d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.setIsLidMigrated(!0))});return q.apply(this,arguments)}g["default"]=a}),98); __d("WAWebHandlePresence",["Promise","WALogger","WASmaxPresenceServerUpdateRPC","WATimeUtils","WAWebApiContact","WAWebChangePresenceHandlerAction","WAWebChatCollection","WAWebJidToWid","WAWebLid1X1MigrationGating","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Parsing Error: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["error while parsing: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[presence] Migrated client has a PN presence"]);k=function(){return a};return a}function l(a){if(a!=null){if(!["deny","none","error"].includes(a))return d("WATimeUtils").castToUnixTime(Number(a))}else return d("WATimeUtils").unixTime()}function a(a){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){try{var e=d("WASmaxPresenceServerUpdateRPC").receiveServerUpdateRPC(a);e=e.parsedRequest.presenceUpdates;var f=d("WAWebJidToWid").chatJidToChatWid(e.value.from),g=f.isLid(),m=d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated();if(!m&&g){var n=d("WAWebApiContact").getPhoneNumber(d("WAWebWidFactory").toUserWid(f));if(n==null)return;f=n}if(m&&!g){d("WALogger").ERROR(k());return}n=f;if(m){m=g?d("WAWebChatCollection").ChatCollection.getChatByAccountLid(f):null;if(!m)return;n=d("WAWebWidFactory").toChatWid(m.id)}g={id:n,type:e.value.type||"available",deny:e.value.last==="deny"||void 0,t:e.value.type==="unavailable"?l(e.value.last):void 0};return c("WAWebChangePresenceHandlerAction")(g)}catch(c){d("WALogger").DEV(j(),a.toString());d("WALogger").ERROR(i(),c.toString());return(h||(h=b("Promise"))).reject(c)}});return m.apply(this,arguments)}g["default"]=a}),98); __d("WAWebHandlePrivacyTokensNotification",["Promise","WAByteArray","WADeprecatedWapParser","WALogger","WAWap","WAWebEventsWaitForOfflineDeliveryEnd","WAWebJidToWid","WAWebPresenceCollection","WAWebSetTcTokenChatAction","asyncToGeneratorRuntime","cr:20405"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Parsing Error: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["error while parsing: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["incomingPrivacyTokensParser - receiving an unknown type: ",""]);k=function(){return a};return a}var l=function(a){var b=d("WAByteArray").uint8ArrayToBuffer(a.contentBytes());return{type:"trusted_contact",content:b,ts:a.attrTime("t")}},m=new(c("WADeprecatedWapParser"))("incomingPrivacyTokensParser",function(a){a.assertTag("notification");var b=a.attrString("id"),c=a.attrUserJid("from");a=a.child("tokens");var e=[];a.forEachChildWithTag("token",function(a){var b=a.attrString("type");switch(b){case"trusted_contact":e.push(l(a));break;default:d("WALogger").LOG(k(),b)}});return{id:b,from:c,privacyTokens:e}});function n(a,b){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=b.ts;a=d("WAWebJidToWid").userJidToUserWid(a.from);b.type==="trusted_contact"&&(yield d("WAWebSetTcTokenChatAction").handleIncomingTcToken(a,c,b.content),yield d("WAWebPresenceCollection").PresenceCollection.reSubscribeWhenActive(a))});return o.apply(this,arguments)}function a(a){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=m.parse(a);if(c.error){d("WALogger").LOG(j(),a.toString());d("WALogger").ERROR(i(),c.error.toString());throw c.error}var e=c.success;a=d("WAWap").wap("ack",{id:d("WAWap").CUSTOM_STRING(e.id),"class":"notification",to:d("WAWap").JID(e.from),type:"privacy_token"});(b("cr:20405")==null||b("cr:20405").isTCTokenFeatureDisabled()===!1)&&(yield d("WAWebEventsWaitForOfflineDeliveryEnd").waitForOfflineDeliveryEnd(),yield (h||(h=b("Promise"))).all(e.privacyTokens.map(function(a){return n(e,a)})));return a});return p.apply(this,arguments)}g["default"]=a}),98); __d("WAWebHandlePsa",["$InternalEnum","Promise","WAByteArray","WADeprecatedWapParser","WAJids","WALogger","WAWap","WAWebABProps","WAWebBackendJobs.flow","WAWebCommsWapMd","WAWebHandleMsgProcess","WAWebHandleMsgTypes.flow","WAWebJidToWid","WAWebRevokeStatusPsaMsgAction","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Parsing Error: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["error while parsing: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["PSA notification received, node: ",""]);k=function(){return a};return a}var l=b("$InternalEnum")({Image:"image",Video:"video",Text:"text"}),m=new(c("WADeprecatedWapParser"))("incomingCampaignParser",function(a){a.assertTag("notification");a.assertAttr("from",d("WAJids").STATUS_JID);var b=a.attrString("id"),c=d("WAWebJidToWid").userJidToUserWid(a.attrUserJid("participant")),e=a.attrTime("t");a=a.child("campaign");var f=a.hasChild("revoke"),g=a.attrString("id"),h=a.maybeAttrInt("duration");a=a.mapChildrenWithTag("message",function(a){var b=a.child("media");b.attrEnumValues("mediatype",l.members());a={id:a.attrString("id"),ts:e,body:d("WAByteArray").uint8ArrayToBuffer(b.contentBytes())};return a});return{participant:c,stanzaId:b,campaignId:g,campaignDuration:h,revoke:f,ts:e,messages:a}});function n(a,b){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=a.participant,e=a.campaignId;a=a.campaignDuration;var f=b.id,g=b.ts;b=b.body;f={type:d("WAWebHandleMsgTypes.flow").MESSAGE_TYPE.OTHER_STATUS,externalId:f,ts:g,edit:-1,isHsm:!1,count:null,chat:d("WAWebWidFactory").createWid(d("WAJids").STATUS_JID),author:c,pushname:null,isDirect:!1,campaignId:e,campaignDuration:a};g={retryCount:0,e2eType:d("WAWebBackendJobs.flow").CiphertextType.Msg,encMediaType:d("WAWebBackendJobs.flow").EncMediaType.Image,hideFail:!1};c={nativeFlowName:null,verifiedNameSerial:null,verifiedLevel:null,verifiedNameCert:null,privacyMode:null,campaignId:null};yield d("WAWebHandleMsgProcess").processDecryptedMessageProto({decrypted:b,info:f,e2eInfo:g,bizInfo:c,hsmInfo:null,isPadded:!1})});return o.apply(this,arguments)}function a(a){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){d("WALogger").DEV(k(),a);var c=m.parse(a);if(c.error){d("WALogger").LOG(j(),a.toString());d("WALogger").ERROR(i(),c.error.toString());throw c.error}var e=c.success;a=d("WAWap").wap("ack",{id:d("WAWap").CUSTOM_STRING(e.stanzaId),participant:d("WAWebCommsWapMd").JID(e.participant),"class":"notification",type:"psa",to:d("WAWebCommsWapMd").JID(d("WAWebWidFactory").createWid(d("WAJids").STATUS_JID))});if(!d("WAWebABProps").getABPropConfigValue("web_status_psa"))return a;e.revoke?yield d("WAWebRevokeStatusPsaMsgAction").revokeStatusPSA(e.campaignId):yield (h||(h=b("Promise"))).all(e.messages.map(function(a){return n(e,a)}));return a});return p.apply(this,arguments)}g["default"]=a}),98); __d("WAWebHandleServerNotification",["$InternalEnum","Promise","WADeprecatedWapParser","WALogger","WAWap","WAWebAbPropsSyncJob","WAWebCrashlog"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Parsing Error: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["error while parsing: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["Server props notification from server. No longer supported in Web"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(['Unsupported notification with type "server",\n blindly ack-ing it and doing nothing']);l=function(){return a};return a}var m=b("$InternalEnum")({LOG:"log",PROPS:"props",ABPROPS:"abprops"}),n=new(c("WADeprecatedWapParser"))("incomingServerNotificationParser",function(a){a.assertTag("notification");var b=a.attrString("id"),c=a.attrWapJid("from");if(a.hasChild(m.LOG))return{type:m.LOG,stanzaId:b,from:c};if(a.hasChild(m.PROPS))return{type:m.PROPS,stanzaId:b,from:c};return a.hasChild(m.ABPROPS)?{type:m.ABPROPS,stanzaId:b,from:c}:{type:null,stanzaId:b,from:c}});function o(a){var c=d("WAWap").wap("ack",{id:d("WAWap").CUSTOM_STRING(a.stanzaId),"class":"notification",type:"server",to:a.from});if(a.type==null){d("WALogger").WARN(l());return(h||(h=b("Promise"))).resolve(c)}switch(a.type){case m.LOG:void d("WAWebCrashlog").upload({reason:d("WAWebCrashlog").SERVER_REQUESTED,immediate:!0,isHighPri:!0});return(h||(h=b("Promise"))).resolve(c);case m.PROPS:d("WALogger").WARN(k());return(h||(h=b("Promise"))).resolve(c);case m.ABPROPS:return d("WAWebAbPropsSyncJob").syncABPropsTask(!1).then(function(){return c})}}function a(a){var c=n.parse(a);if(c.error){d("WALogger").DEV(j(),a.toString());d("WALogger").ERROR(i(),c.error.toString());return(h||(h=b("Promise"))).reject(c.error)}return o(c.success)}g.handleServerNotification=a}),98); __d("WAWebMdAppStateOfflineNotificationsWamEvent",["WAWebWamCodegenUtils"],(function(a,b,c,d,e,f,g){a=d("WAWebWamCodegenUtils").defineEvents({MdAppStateOfflineNotifications:[2602,{redundantCount:[1,d("WAWebWamCodegenUtils").TYPES.INTEGER]},[1,20,1e3],"regular"]},{MdAppStateOfflineNotifications:[]});g.MdAppStateOfflineNotificationsWamEvent=a}),98); __d("WAWebSyncdCollectionUtils",["WASyncdConst"],(function(a,b,c,d,e,f,g){"use strict";function a(a){return a==null}function b(a){switch(a){case d("WASyncdConst").CollectionName.CriticalBlock:return!0;case d("WASyncdConst").CollectionName.CriticalUnblockLow:return!0;case d("WASyncdConst").CollectionName.Regular:return!1;case d("WASyncdConst").CollectionName.RegularHigh:return!1;case d("WASyncdConst").CollectionName.RegularLow:return!1}}g.isBootstrap=a;g.isCriticalCollection=b}),98); __d("WAWebHandleServerSyncNotification",["Promise","WADeprecatedWapParser","WALogger","WASyncdConst","WAWap","WAWebMdAppStateOfflineNotificationsWamEvent","WAWebSyncBootstrap","WAWebSyncd","WAWebSyncdCollectionUtils"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Parsing Error: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["error while parsing: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: filtered non critical collections during bootstrap. new collections: ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: incoming sync notification for collections\n ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: unknown collection name in notification: ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(['handleServerSyncNotification: "from" is not domain jid "s.whatsapp.net"']);n=function(){return a};return a}var o=new Map(),p=new(c("WADeprecatedWapParser"))("serverSyncNotification",function(a){a.assertTag("notification");if(!a.hasChild("collection"))throw a.createParseError("Server sync notification does not contain any collections");var b=a.attrString("id"),c=new Map(a.mapChildrenWithTag("collection",function(a){return[a.attrString("name"),a.attrInt("version")]})),e=a.hasAttr("offline");a=a.attrString("from");a!==d("WAWap").S_WHATSAPP_NET.toString()&&d("WALogger").ERROR(n());return{changedCollections:c,stanzaId:b,offline:e}});function q(a){if(a.changedCollections){var e=new Map();for(var f of a.changedCollections){var g=f[0],i=f[1],j=d("WASyncdConst").CollectionName.cast(g);j!=null?e.set(j,i):d("WALogger").WARN(m(),g)}j=Array.from(e.keys());a.offline&&j.forEach(function(a){var b=o.get(a);b!=null?o.set(a,b+1):o.set(a,1)});d("WALogger").LOG(l(),Array.from(e.entries()).map(function(b){var a=b[0];b=b[1];return a+" v"+b}).join("\n"));c("WAWebSyncBootstrap").isSyncDCriticalDataSyncInProcess()&&(j=j.filter(function(a){return d("WAWebSyncdCollectionUtils").isCriticalCollection(a)}),d("WALogger").LOG(k(),j));void d("WAWebSyncd").markCollectionsForSync(j,e)}return(h||(h=b("Promise"))).resolve(d("WAWap").wap("ack",{id:d("WAWap").CUSTOM_STRING(a.stanzaId),"class":"notification",type:"server_sync",to:d("WAWap").S_WHATSAPP_NET}))}function a(){if(o.size<1)return;var a=0;Array.from(o.entries()).forEach(function(b){b=b[1];a+=b-1});new(d("WAWebMdAppStateOfflineNotificationsWamEvent").MdAppStateOfflineNotificationsWamEvent)({redundantCount:a}).commit();o.clear()}function e(a){var c=p.parse(a);if(c.error){d("WALogger").DEV(j(),a.toString());d("WALogger").ERROR(i(),c.error.toString());return(h||(h=b("Promise"))).reject(c.error)}return q(c.success)}g.reportOfflineNotifications=a;g.handleServerSyncNotification=e}),98); __d("WAWebUserPrefsTabMutex",["WANullthrows","WAWebLocalStorage","WAWebPermanentStorage","WAWebUserPrefsKeys","WAWebUserPrefsStore"],(function(a,b,c,d,e,f,g){var h="x"+Math.round(Math.random()*1e9);function i(){return c("WAWebUserPrefsStore").getPSIgnoringCache(d("WAWebUserPrefsKeys").KEYS.WHATSAPP_MUTEX)}function a(a){a=a?h+":"+a:a;c("WAWebUserPrefsStore").set(d("WAWebUserPrefsKeys").KEYS.WHATSAPP_MUTEX,a,{storage:c("WAWebPermanentStorage")})}function b(){c("WAWebUserPrefsStore").set(d("WAWebUserPrefsKeys").KEYS.WHATSAPP_MUTEX,null,{storage:c("WAWebPermanentStorage")})}function e(a){a=a?JSON.parse(a):"";return a?a.toString().split(/:/).pop():a}function f(a){if(a.key!==d("WAWebUserPrefsKeys").KEYS.WHATSAPP_MUTEX)return!1;a=a.newValue||"";return!a.includes(h)?!0:!1}function j(){return(i()||"").includes(h)}function k(){var a={};a.wa_tab_src=h;c("WANullthrows")(c("WAWebLocalStorage")).setItem(d("WAWebUserPrefsKeys").KEYS.LOCAL_TAKEOVER_OK,JSON.stringify(a));c("WANullthrows")(c("WAWebLocalStorage")).removeItem(d("WAWebUserPrefsKeys").KEYS.LOCAL_TAKEOVER_OK)}function l(a){if(a.key!==d("WAWebUserPrefsKeys").KEYS.LOCAL_TAKEOVER_OK)return!1;a=a.newValue||"";return!a.includes(h)?!0:!1}function m(a){c("WAWebUserPrefsStore").setTS(d("WAWebUserPrefsKeys").KEYS.NO_TAKEOVER,a)}function n(){return!!c("WAWebUserPrefsStore").getTS(d("WAWebUserPrefsKeys").KEYS.NO_TAKEOVER)}g.THIS_TAB=h;g.getMutex=i;g.setMutex=a;g.removeMutex=b;g.parseMutex=e;g.mutexFilter=f;g.currentTabHasMutex=j;g.localTakeoverSuccess=k;g.takeoverFilter=l;g.setNoTakeover=m;g.getNoTakeover=n}),98); __d("WAWebHandleStreamError",["Promise","WAComms","WADeprecatedWapParser","WALogger","WAWebCmd","WAWebCompanionRegUtils","WAWebJestE2ELogUtils","WAWebSocketModel","WAWebStartBackend","WAWebUserPrefsTabMutex","WAWebWamDeviceLinkReporter","asyncToGeneratorRuntime","gkx"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleStreamError: sent xml not well formed, closing the socket:"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleStreamError: sent xml not well formed, closing the socket"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleStreamError: session replaced while we have a mutex, closing the socket"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["stream error due to device removed, logging out"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["Parsing Error: ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["error while parsing: ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["Unrecognized stream:error: ",""]);o=function(){return a};return a}var p=new(c("WADeprecatedWapParser"))("streamErrorParser",function(a){a.assertTag("stream:error");if(a.hasChild("conflict")){var b=a.child("conflict");b=b.attrString("type");switch(b){case"replaced":return{type:"replaced"};case"device_removed":default:return{type:"device_removed"}}}else if(a.hasAttr("code"))return{type:"code",code:a.attrInt("code")};else if(a.hasChild("ack"))return{type:"ack",id:a.child("ack").hasAttr("id")?a.child("ack").attrString("id"):null};else if(a.hasChild("xml-not-well-formed"))return{type:"xml-not-well-formed"};else{d("WALogger").WARN(o(),a.toString());return{type:"other"}}});function a(a){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=p.parse(a);if(e.error){d("WALogger").DEV(n(),a.toString());d("WALogger").ERROR(m(),e.error.toString());return(h||(h=b("Promise"))).reject(e.error)}e=e.success;if(e.type==="code"&&e.code>=500&&e.code<600){if(e.code===515){d("WAComms").stopComms();yield d("WAWebCompanionRegUtils").startLogin();void d("WAWebStartBackend").startBackend();return(h||(h=b("Promise"))).resolve("NO_ACK")}else if(e.code===516){d("WAComms").stopComms();yield d("WAWebWamDeviceLinkReporter").commitDeviceLinkEvent(516);yield d("WAWebCompanionRegUtils").startLogout();void d("WAWebStartBackend").startBackend();return(h||(h=b("Promise"))).resolve("NO_ACK")}d("WAComms").onStreamErrorReceived()}else if(e.type==="device_removed"){d("WAWebCmd").Cmd.onStartingLogout();d("WAComms").stopComms();yield d("WAWebSocketModel").Socket.clearCredentialsAndStoredData();d("WALogger").LOG(l());d("WAWebJestE2ELogUtils").maybeLogToJestE2eJSConsole("stream error due to device removed, logging out");d("WAWebCmd").Cmd.logout();return(h||(h=b("Promise"))).resolve("NO_ACK")}else if(e.type==="replaced"){d("WAWebUserPrefsTabMutex").currentTabHasMutex()&&d("WALogger").ERROR(k()).sendLogs("invalid-session-replacement",{sampling:.01});d("WAComms").stopComms();return(h||(h=b("Promise"))).resolve("NO_ACK")}else e.type==="xml-not-well-formed"&&(c("gkx")("26258")?d("WALogger").WARN(j()):d("WALogger").WARN(i()).devConsole(a.toString()).sendLogs("sent-xml-not-well-formed"));return(h||(h=b("Promise"))).resolve("CLOSE_SOCKET")});return q.apply(this,arguments)}g["default"]=a}),98); __d("WAWebCryptoEncryptionSaltHelper",["Promise","WALogger","WAWebLogoutReasonConstants","WAWebSocketLogoutJob","WAWebUserPrefsMeUser","WAWebUserPrefsMultiDevice","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[DB ENC CRITICAL ERROR] null returned for local enc salt"]);i=function(){return a};return a}function a(){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=128,c=!!d("WAWebUserPrefsMeUser").getMaybeMeUser(),e=null;c||(e=new Uint8Array(a),self.crypto.getRandomValues(e),e=btoa(String.fromCharCode.apply(String,Array.from(new Uint8Array(e)))),yield d("WAWebUserPrefsMultiDevice").setWebEncSalt(e));e=d("WAWebUserPrefsMultiDevice").getWebEncSalt();e==null&&(d("WALogger").ERROR(i()),void d("WAWebSocketLogoutJob").socketLogout(d("WAWebLogoutReasonConstants").LogoutReason.MissingEncSalt));e=Uint8Array.from(atob(e),function(a){return a.charCodeAt(0)});return(h||(h=b("Promise"))).resolve(e)});return j.apply(this,arguments)}function c(){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield d("WAWebUserPrefsMultiDevice").setWebEncSalt(null)});return k.apply(this,arguments)}g.getOrGenSalt=a;g.deleteSalt=c}),98); __d("WAWebCryptoEncKeyHelper",["Promise","WAWebCmd","WAWebCryptoEncryptionSaltHelper","WAWebDbEncryptionKey","WAWebInvocationInterface","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h,i=null;function a(){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){i==null&&(i=d("WAWebCryptoEncryptionSaltHelper").getOrGenSalt());var a=(yield i);if(!a||a.constructor!==Uint8Array)return;return d("WAWebDbEncryptionKey").DbEncKeyStore.init(a)});return j.apply(this,arguments)}function c(){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){i==null&&(i=d("WAWebCryptoEncryptionSaltHelper").getOrGenSalt());var a=(yield i);if(!a||a.constructor!==Uint8Array)return;d("WAWebInvocationInterface").get().initDatabaseEncnKey(a)});return k.apply(this,arguments)}function e(a){return d("WAWebInvocationInterface").get().generateFinalDbEncryptionAndFtsKey(a)}function f(){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield (h||(h=b("Promise"))).all([d("WAWebDbEncryptionKey").DbEncKeyStore.deleteKeys(),d("WAWebInvocationInterface").get().deleteDbEncKeyCache()])});return l.apply(this,arguments)}d("WAWebCmd").Cmd.on("logout",function(){i=(h||(h=b("Promise"))).resolve(null)});g.initEncSalt=a;g.initEncSaltForInvoker=c;g.generateFinalDbEncryptionAndFtsKeyForInvoker=e;g.deleteEncKeysAndCache=f}),98); __d("WAWebHandleSuccess",["Promise","WACustomError","WADeprecatedWapParser","WALogger","WAPromiseTimeout","WAWebABPropsLocalStorage","WAWebAbPropsSyncJob","WAWebCmd","WAWebCryptoEncKeyHelper","WAWebDbEncryptionKey","WAWebMediaHosts","WAWebPageLoadLogging","WAWebPassiveModeManager","WAWebQplQuickPerformanceLoggerMarkerIds","WAWebQplQuickPerformanceLoggerModule","WAWebUpdateClockSkewUtils","WAWebUpdateMeLidUtils","WAWebUserPrefsGeneral","WAWebUserPrefsMeUser","WAWebWidFactory","asyncToGeneratorRuntime","cr:17219","justknobx"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["fetching mms4 hosts on startup failed: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["fetching mms4 hosts on startup exceeded timeout"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleSuccess: failed to parse ",""]);k=function(){return a};return a}var l=(e=b("cr:17219"))==null?void 0:e.getWindowsBridge(),m=new(c("WADeprecatedWapParser"))("successParser",function(a){a.assertTag("success");return{ts:a.attrTime("t"),propsVersion:a.attrInt("props"),companionEncStatic:a.maybeAttrString("companion_enc_static")||"NULL",lid:a.maybeAttrString("lid"),displayName:a.maybeAttrString("display_name"),abpropsRefreshId:a.maybeAttrInt("abprops")}});function a(a){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){d("WAWebPageLoadLogging").addPageLoadQplPoint("success_received");d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.OFFLINE_RESUME,"SuccessReceived");a=m.parse(a);if(a.error){d("WALogger").ERROR(k(),a.error);return(h||(h=b("Promise"))).reject(a.error)}a=a.success;d("WAWebUpdateClockSkewUtils").updateClockSkew(a.ts);d("WAWebUpdateMeLidUtils").updateMeLid(a.lid!=null?d("WAWebWidFactory").createWid(a.lid):null);a.displayName!=null&&d("WAWebUserPrefsMeUser").setMeDisplayName(a.displayName);d("WAWebCmd").Cmd.onTemporaryBan({banned:!1});d("WAWebPassiveModeManager").PassiveTaskManager.executePassiveTasks();void d("WAWebUserPrefsGeneral").setOfflinePushDisabled(!1);var e=a.companionEncStatic;void d("WAWebDbEncryptionKey").DbEncKeyStore.generateFinalDbEncryptionAndFtsKey(e);void d("WAWebCryptoEncKeyHelper").generateFinalDbEncryptionAndFtsKeyForInvoker(e);void (l==null?void 0:(e=l.contacts)==null?void 0:e.initialize());a=(e=a.abpropsRefreshId)!=null?e:0;e=d("WAWebABPropsLocalStorage").getRefreshId();var f=c("justknobx")._("2086"),g=d("WAWebABPropsLocalStorage").getWebRefreshId();if(e<a||g<f){g<f&&d("WAWebABPropsLocalStorage").setWebRefreshId(f);e=d("WAWebABPropsLocalStorage").isABPropsAfterFirstSync();e&&(yield d("WAWebAbPropsSyncJob").syncABPropsTask())}yield o(1e3)});return n.apply(this,arguments)}function o(a){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){try{yield d("WAPromiseTimeout").promiseTimeout(d("WAWebMediaHosts").mediaHosts.forceRefresh(new AbortController().signal),a)}catch(a){a instanceof d("WACustomError").TimeoutError?d("WALogger").LOG(j()).sendLogs("mms4-fetch-host-timeout",{sampling:0}):d("WALogger").ERROR(i(),a).sendLogs("mms4-fetch-host-failed")}});return p.apply(this,arguments)}g["default"]=a}),98); __d("WAWebHandleWaChat",["Promise","WAByteArray","WADeprecatedWapParser","WAJids","WALogger","WAWap","WAWebBackendJobs.flow","WAWebCommsWapMd","WAWebDBMessageDelete","WAWebHandleMsgProcess","WAWebHandleMsgTypes.flow","WAWebMsgCollection","WAWebMsgKey","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Parsing Error: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["error while parsing: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["WA Chat notification received, node: ",""]);k=function(){return a};return a}var l=new(c("WADeprecatedWapParser"))("incomingWAChatNotificationParser",function(a){a.assertTag("notification");a.assertAttr("from",d("WAJids").PSA_JID);var b=a.attrString("id"),e=a.attrTime("t");if(a.hasChild("messages")){var f=a.child("messages"),g=f.attrString("campaign_id");f=f.mapChildrenWithTag("message",function(a){var b=a.attrString("id");if(a.hasAttr("type")){var c=a.attrString("type");c=c==="text"?a:a.child("media")}else c=a;a={id:b,body:d("WAByteArray").uint8ArrayToBuffer(c.contentBytes())};return a});return{type:"messages",stanzaId:b,ts:e,campaignId:g,messages:f}}g=a.child("revoke");g.attrString("campaign_id");f=g.mapChildrenWithTag("message",function(a){a=new(c("WAWebMsgKey"))({fromMe:!1,remote:d("WAWebWidFactory").createWid(d("WAJids").PSA_JID),id:a.attrString("id")});return a.toString()});return{type:"revoke",stanzaId:b,ts:e,revokeMessageIds:f}});function m(a,b){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=a.campaignId;a=a.ts;var e=b.id;b=b.body;var f=d("WAWebWidFactory").createWid(d("WAJids").PSA_JID);e={type:d("WAWebHandleMsgTypes.flow").MESSAGE_TYPE.OTHER_STATUS,externalId:e,ts:a,edit:-1,isHsm:!1,count:null,chat:f,author:f,pushname:null,isDirect:!1,campaignId:c};a={retryCount:0,e2eType:d("WAWebBackendJobs.flow").CiphertextType.Msg,encMediaType:d("WAWebBackendJobs.flow").EncMediaType.Image,hideFail:!1};f={nativeFlowName:null,verifiedNameSerial:null,verifiedLevel:null,verifiedNameCert:null,privacyMode:null,campaignId:null,verifiedHsmEnvelope:!0};yield d("WAWebHandleMsgProcess").processDecryptedMessageProto({decrypted:b,info:e,e2eInfo:a,bizInfo:f,hsmInfo:null,isPadded:!1})});return n.apply(this,arguments)}function a(a){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){d("WALogger").DEV(k(),a);var c=l.parse(a);if(c.error){d("WALogger").LOG(j(),a.toString());d("WALogger").ERROR(i(),c.error.toString());throw c.error}var e=c.success;a=d("WAWap").wap("ack",{id:d("WAWap").CUSTOM_STRING(e.stanzaId),"class":"notification",type:"psa",to:d("WAWebCommsWapMd").JID(d("WAWebWidFactory").createWid(d("WAJids").PSA_JID))});switch(e.type){case"revoke":c=e.revokeMessageIds;c.length>0&&(yield d("WAWebDBMessageDelete").removeMessagesFromHistory(c),c.forEach(function(a){a=d("WAWebMsgCollection").MsgCollection.get(a);a&&a["delete"]()}));break;default:e.type;yield (h||(h=b("Promise"))).all(e.messages.map(function(a){return m(e,a)}));break}return a});return o.apply(this,arguments)}g["default"]=a}),98); __d("WAWebHandleBusinessNameChange",["Promise","WADeprecatedSendIq","WADeprecatedWapParser","WALogger","WAWap","WAWebApiVerifiedBusinessName","WAWebBackendApi","WAWebBizGatingUtils","WAWebBizUpdateContactsWithVerifiedNamesAction","WAWebCommonParsersVerifiedName","WAWebCommsWapMd","WAWebContactCollection","WAWebHandleBusinessRemoval","WAWebLidAwareContactsDB","WAWebLidMigrationUtils","WAWebModelStorageUtils","WAWebWidFactory","asyncToGeneratorRuntime","err","isStringNullOrEmpty"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["verified name notification not found"]);i=function(){return a};return a}function j(a,c,e,f,g,i){var j=d("WAWebContactCollection").ContactCollection.get(a);j!=null&&d("WAWebBizUpdateContactsWithVerifiedNamesAction").updateContactsWithVerifiedNames([{id:a,name:e,level:c,isApi:f,isSmb:g,privacyMode:i}],[j]);return(h||(h=b("Promise"))).resolve()}function k(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield d("WAWebModelStorageUtils").getStorage().lock(["verified-business-name"],function(){return d("WAWebApiVerifiedBusinessName").createOrUpdateVerifiedBusinessName(a.wid,{level:a.level,serial:parseInt(a.serial||"0",10),name:a.verifiedName,isApi:a.isApi,isSmb:a.isSmb,privacyMode:a.privacyMode?{actualActors:a.privacyMode.actualActors,hostStorage:a.privacyMode.hostStorage,privacyModeTs:a.privacyMode.privacyModeTs}:null})});var c=[],e=d("WAWebContactCollection").ContactCollection.get(a.wid);e!=null&&d("WAWebBackendApi").frontendFireAndForget("generateAndUpdatePrivacySystemMessages",{wid:a.wid,previousState:{isBusiness:e.isBusiness,privacyMode:e.privacyMode},currentState:{isBusiness:!0,privacyMode:a.privacyMode},shouldRunMATonWid:!1});c.push(j(a.wid,a.level,a.verifiedName,a.isApi,a.isSmb,a.privacyMode));yield (h||(h=b("Promise"))).all(c)});return l.apply(this,arguments)}var m=new(c("WADeprecatedWapParser"))("verifiedNameParser",function(a){return c("WAWebCommonParsersVerifiedName")(a.child("verified_name"))});function n(a){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b;b=(b=d("WAWap")).wap("iq",{to:b.S_WHATSAPP_NET,type:"get",xmlns:"w:biz",id:b.generateId()},b.wap("verified_name",{jid:d("WAWebCommsWapMd").DEVICE_JID(a)}));a=(yield d("WADeprecatedSendIq").deprecatedSendIq(b,m));if(!a.success){if(a.errorCode===404){d("WALogger").WARN(i());return}throw c("err")("Could not send IQ in retrieveBusinessDetails")}return a.result});return o.apply(this,arguments)}function a(a){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a.type!=="verified_name_hash")throw c("err")("Invalid notification type");var e=(yield c("WAWebLidAwareContactsDB").equals(["contactHash"],a.hash));e=e.map(function(a){return d("WAWebWidFactory").createUserWid(a.id)});if(e.length===0)return!1;e=(yield (h||(h=b("Promise"))).all(e.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield n(a));return{wid:a,verifiedName:b}});return function(b){return a.apply(this,arguments)}}())));e.length&&(yield (h||(h=b("Promise"))).all(e.map(function(b){var c=b.wid;b=b.verifiedName;if(b){var e=b.name,f=b.level,g=b.serial,h=b.isApi,i=b.isSmb,j=b.privacyMode;return r({wid:c,verifiedName:e,level:f,stanzaId:a.stanzaId,ts:a.ts,serial:g,isApi:h,isSmb:i,privacyMode:j})}else if(b===void 0)return d("WAWebHandleBusinessRemoval").handleBusinessRemoval(c,a.stanzaId,a.ts)})));return!0});return p.apply(this,arguments)}function e(a){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.jid,e=a.stanzaId,f=a.ts;a=a.verifiedName;var g=a.serial;g=g===void 0?"":g;var h=a.level,i=a.isApi,j=a.isSmb,k=a.privacyMode;a=a.name;if(c("isStringNullOrEmpty")(a)){var l;l=(l=d("WAWebContactCollection").ContactCollection.get(b))==null?void 0:l.verifiedName;if(l!=null)a=l;else{l=(yield n(b));if(!l)return;a=l.name}}return r({verifiedName:a,level:h,stanzaId:e,ts:f,wid:b,serial:g,isApi:i,isSmb:j,privacyMode:k})});return q.apply(this,arguments)}function r(a){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=d("WAWebBizGatingUtils").isLidMigrationForVnameEnabled()?d("WAWebLidMigrationUtils").getPnAndLidToUpdate(a.wid):[a.wid];yield (h||(h=b("Promise"))).all(c.map(function(b){return k(babelHelpers["extends"]({},a,{wid:b}))}))});return s.apply(this,arguments)}g.handleVerifiedBusinessNameNotificationHash=a;g.handleVerifiedBusinessNameNotificationContact=e;g.processDetailsChangeLidAware=r}),98); __d("WAWebHandleBusinessNameChangeLidHelpers",["Promise","WAWebBizGatingUtils","WAWebHandleBusinessRemoval","WAWebLidMigrationUtils","WAWebModelStorageUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function a(a){return a.map(function(a){var b=d("WAWebBizGatingUtils").isLidMigrationForVnameEnabled()?d("WAWebLidMigrationUtils").getPnAndLidToUpdate(a.id):[a.id];return b.map(function(b){return babelHelpers["extends"]({},a,{id:b})})}).reduce(function(a,b){return a.concat(b)},[])}function c(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){return d("WAWebModelStorageUtils").getStorage().lock(["contact","verified-business-name"],function(c){c[0];var e=c[1];c=d("WAWebBizGatingUtils").isLidMigrationForVnameEnabled()?d("WAWebLidMigrationUtils").getPnAndLidToUpdate(a):[a];return(h||(h=b("Promise"))).all([].concat(c.map(d("WAWebHandleBusinessRemoval").removeBusinessPropsFromContact),c.map(function(a){return d("WAWebHandleBusinessRemoval").removeVerifiedName(e,a)})))})});return i.apply(this,arguments)}g.getVerifiedNamesToUpdateLidAware=a;g.removeVerifiedNameFromTableLidAware=c}),98); __d("WAWebCTWAParsePrivacy",["WALogger","WASmaxBizSettingsSyncPrivacySettingRPC"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["parseCTWAPrivacy: Could not parse RPC response"]);h=function(){return a};return a}function a(a){try{a=d("WASmaxBizSettingsSyncPrivacySettingRPC").receiveSyncPrivacySettingRPC(a.node());a=a.parsedRequest;a=(a=a.privacySmbDataSharingSettingMixin)==null?void 0:a.value;return a==null?null:{smbDataSharingSetting:a}}catch(a){d("WALogger").ERROR(h());return null}}g.parseCTWAPrivacy=a}),98); __d("WAWebWamEnumPreferredLinkType",[],(function(a,b,c,d,e,f){a=Object.freeze({LOCAL:0,UNIVERSAL:1});f.PREFERRED_LINK_TYPE=a}),66); __d("WAWebCtwaActionBannerUnderstandWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumPreferredLinkType"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({CtwaActionBannerUnderstand:[3586,{bannerIdentifier:[1,a.TYPES.STRING],bannerLocale:[2,a.TYPES.STRING],clientLocale:[3,a.TYPES.STRING],hasLocalLink:[4,a.TYPES.BOOLEAN],hasUniversalLink:[5,a.TYPES.BOOLEAN],invalidLink:[6,a.TYPES.STRING],lwiFlowIdentifier:[7,a.TYPES.STRING],preferredLink:[8,d("WAWebWamEnumPreferredLinkType").PREFERRED_LINK_TYPE],validLocale:[9,a.TYPES.BOOLEAN],validNotification:[10,a.TYPES.BOOLEAN]},[1,1,1],"private",0]},{CtwaActionBannerUnderstand:[]});g.CtwaActionBannerUnderstandWamEvent=b}),98); __d("WAWebCTWAParseSuggestion",["WALogger","WASmaxBizCtwaActionBannerSuggestionRPC","WATimeUtils","WAWebApiParse","WAWebBizGatingUtils","WAWebCtwaActionBannerUnderstandWamEvent","WAWebL10N","WAWebUpdaterVersion"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["parseCTWASuggestion: invalid deep link (",", ",")"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["parseCTWASuggestion: manage ads not enabled (",")"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["parseCTWASuggestion: invalid link (",")"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["parseCTWASuggestion: app version too old (",")"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["parseCTWASuggestion: too many actions (",")"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose([""," (",")"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose([""," (",")"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["parseCTWASuggestion: locale mismatch (",")"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["parseCTWASuggestion: missing banner data (",")"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["parseCTWASuggestion: metric failed"]);q=function(){return a};return a}var r="recreate_ad",s="manage_ads",t="parseCTWASuggestion: missing action link";function u(a){if(!d("WAWebBizGatingUtils").adsActionBannersLoggingEnabled())return;var b=new(d("WAWebCtwaActionBannerUnderstandWamEvent").CtwaActionBannerUnderstandWamEvent)();b.bannerIdentifier=a.bannerIdentifier;b.validNotification=a.validNotification;a.clientLocale!=null&&(b.clientLocale=a.clientLocale);a.bannerLocale!=null&&(b.bannerLocale=a.bannerLocale);a.validLocale!=null&&(b.validLocale=a.validLocale);b.commitAndWaitForFlush()["catch"](function(a){d("WALogger").ERROR(q()).devConsole(a)})}function v(a){a=a.split("-");return a[1]}function a(a){a=d("WASmaxBizCtwaActionBannerSuggestionRPC").receiveBannerSuggestionRPC(a.node());a=a.parsedRequest;var b=a.ctwaSuggestionTargetEntityId,e=a.ctwaSuggestionBanner;a=a.t;var f=v(b);if(e==null){u({bannerIdentifier:b,validNotification:!1});d("WALogger").ERROR(p(),f).sendLogs("parseCTWASuggestion-missing-banner-data-"+f);return}if(e.configRevoked==="true")return{type:"revokedBanner",id:b};var g=e.contentLocale,q=c("WAWebL10N").getNormalizedLocale(),w=function(a){var c=a.validNotification;a=a.validLocale;u({bannerIdentifier:b,validNotification:c,clientLocale:q,bannerLocale:g,validLocale:a})};if(c("WAWebL10N").normalizeLocaleToWajsLocale(g)!==q){w({validNotification:!1,validLocale:!1});d("WALogger").WARN(o(),f);return}var x=e.configExpiresAt,y=e.contentHeadingElementValue,z=e.contentBodyElementValue,A=e.contentHighlightElementValue,B=e.configDisplay;e=e.nativeAction;e=e.filter(function(a){return a.platform==="web"});if(e.length===0){w({validNotification:!1,validLocale:!0});b.endsWith(r)||b.includes(s)?d("WALogger").ERROR(n(),t,f).sendLogs("parseCTWASuggestion-missing-action-link-${bannerType}"):d("WALogger").WARN(m(),t,f);return}else if(e.length>1){w({validNotification:!1,validLocale:!0});d("WALogger").ERROR(l(),f).sendLogs("parseCTWASuggestion-too-many-actions-${bannerType}");return}e=e[0];var C=e.minAppVersion;C=new(d("WAWebUpdaterVersion").Version)(C);var D=new(d("WAWebUpdaterVersion").Version)(d("WAWebUpdaterVersion").SANITIZED_VERSION_STR);if(D.lt(C)){d("WALogger").WARN(k(),f);return}D=e.localLink;C=d("WAWebApiParse").parseAPICmd(D);if(C.resultType==="INVALID"){if(!D.startsWith("https://")){w({validNotification:!1,validLocale:!0});d("WALogger").ERROR(j(),f).sendLogs("parseCTWASuggestion-invalid-link-${bannerType}");return}}else if(C.resultType==="MANAGE_ADS"){if(!d("WAWebBizGatingUtils").adsActionManageAdsBannerEnabled()){w({validNotification:!1,validLocale:!0});d("WALogger").WARN(i(),f);return}}else{C.resultType;w({validNotification:!1,validLocale:!0});d("WALogger").ERROR(h(),f,C.resultType).sendLogs("parseCTWASuggestion-invalid-deep-link-${bannerType}");return}w({validNotification:!0,validLocale:!0});return{type:"banner",id:b,expiresAt:d("WATimeUtils").castToUnixTime(x),heading:y,body:z,highlight:A,actionLink:D,display:B,ts:d("WATimeUtils").castToUnixTime(a)}}g.parseCTWASuggestion=a}),98); __d("WAWebHandleCTWASuggestion",["WALogger","WATimeUtils","WAWebBackendApi","WAWebBizGatingUtils","WAWebSchemaCTWASuggestion","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleCTWASuggestion: suggestion de-duped"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleCTWASuggestion: expired"]);i=function(){return a};return a}function a(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a.type==="banner"?yield k(a):(a.type,yield m(a))});return j.apply(this,arguments)}function k(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!d("WAWebBizGatingUtils").adsActionBannersEnabled())return;if(!d("WATimeUtils").isInFuture(a.expiresAt)){d("WALogger").WARN(i()).devConsole(a);return}try{yield d("WAWebSchemaCTWASuggestion").getCTWASuggestionTable().create(a)}catch(b){d("WALogger").WARN(h()).devConsole(a);return}d("WAWebBackendApi").frontendFireAndForget("newCTWASuggestion",{suggestion:a})});return l.apply(this,arguments)}function m(a){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield d("WAWebSchemaCTWASuggestion").getCTWASuggestionTable().remove(a.id),d("WAWebBackendApi").frontendFireAndForget("revokeCTWASuggestion",{suggestion:a})});return n.apply(this,arguments)}g.handleCTWASuggestion=a}),98); __d("WAWebHandlePrivacySettingsNotification",["WAWebBackendApi"],(function(a,b,c,d,e,f,g){function a(a){d("WAWebBackendApi").frontendFireAndForget("smbDataSharingSettingUpdate",{smbDataSharingSettingValue:a})}g.handleSmbDataSharingSettingNotification=a}),98); __d("WAWebHandleBusinessNotification",["WADeprecatedWapParser","WALogger","WASmaxBizCtwaAdAccountNonceNotificationRPC","WAWap","WAWebBackendJobsCommon","WAWebBizGatingUtils","WAWebCTWABizAccessTokenNonceManager","WAWebCTWAParsePrivacy","WAWebCTWAParseSuggestion","WAWebCommonParsersVerifiedName","WAWebHandleBusinessNameChange","WAWebHandleBusinessProductCatalogNotification","WAWebHandleBusinessProfile","WAWebHandleBusinessRemoval","WAWebHandleCTWASuggestion","WAWebHandlePrivacySettingsNotification","WAWebJidToWid","WAWebOrchestratorNonPersistedJob","WAWebProductTypes.flow","WAWebSubscriptions","asyncToGeneratorRuntime","isStringNullOrEmpty"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Parsing Error: ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["error while parsing: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["business notification received, node: ",""]);j=function(){return a};return a}var k=new(c("WADeprecatedWapParser"))("businessNotificationParser",function(a){a.assertTag("notification");var b=a.attrString("id"),e=a.attrWapJid("from"),f=a.attrTime("t");b={stanzaId:b,from:e,ts:f};if(a.hasChild("remove")){e=a.child("remove");return e.hasAttr("jid")?babelHelpers["extends"]({type:"remove_jid",jid:d("WAWebJidToWid").chatJidToChatWid(e.attrChatJid("jid"))},b):babelHelpers["extends"]({type:"remove_hash",hash:e.attrString("hash")},b)}else if(a.hasChild("verified_name")){e=a.child("verified_name");return e.hasAttr("jid")?babelHelpers["extends"]({type:"verified_name_jid",jid:d("WAWebJidToWid").chatJidToChatWid(e.attrChatJid("jid")),verifiedName:c("WAWebCommonParsersVerifiedName")(e)},b):babelHelpers["extends"]({type:"verified_name_hash",hash:e.attrString("hash")},b)}else if(a.hasChild("profile")){f=a.child("profile");e=f.maybeAttrString("hash");return!c("isStringNullOrEmpty")(e)?babelHelpers["extends"]({type:"profile_hash",hash:e},b):babelHelpers["extends"]({type:"profile"},b)}else if(a.hasChild("product_catalog")){f=a.child("product_catalog");if(f.hasChild("product")){var g=[];f.forEachChildWithTag("product",function(a){a=a.child("id").contentString();g.push(a)});return babelHelpers["extends"]({type:"product",productsIds:g},b)}else if(f.hasChild("collection")){var h=[],i=[];f.forEachChildWithTag("collection",function(a){if(a.hasChild("status_info")){var b;b={reviewStatus:(b=d("WAWebProductTypes.flow").asProductReviewType(a.child("status_info").child("status").contentString()))!=null?b:"APPROVED",rejectReason:(b=a.child("status_info").maybeChild("reject_reason"))==null?void 0:b.contentString(),commerceUrl:(b=a.child("status_info").maybeChild("commerce_url"))==null?void 0:b.contentString()};h.push(a.attrString("id"));i.push(b)}});return babelHelpers["extends"]({type:"collection",collectionIds:h,reviewStatuses:i},b)}}else if(a.hasChild("subscriptions")){e=a.child("subscriptions");var j=[];e.forEachChildWithTag("subscription",function(a){var b=a.attrString("status"),c=a.maybeAttrInt("subscription_end_time");a=a.attrString("id");j.push({id:a,status:b,expirationDate:c})});return babelHelpers["extends"]({type:"subscriptions",subscriptions:j},b)}else if(a.hasChild("ctwa_suggestion")){if(d("WAWebBizGatingUtils").adsActionBannersEnabled()){f=d("WAWebCTWAParseSuggestion").parseCTWASuggestion(a);if(f!=null)return babelHelpers["extends"]({type:"ctwa_suggestion",suggestion:f},b)}}else if(a.hasChild("privacy")){if(d("WAWebBizGatingUtils").smbDataSharingConsentEnabled()){e=d("WAWebCTWAParsePrivacy").parseCTWAPrivacy(a);if(e!=null)return babelHelpers["extends"]({type:"privacy",privacy:e},b)}}else if(a.hasChild("wa_ad_account_nonce")){f=d("WASmaxBizCtwaAdAccountNonceNotificationRPC").receiveNonceNotificationRPC(a.node());return babelHelpers["extends"]({type:"wa_ad_account_nonce",nonce:d("WAWebCTWABizAccessTokenNonceManager").castToNonce(f.parsedRequest.waAdAccountNonceElementValue)},b)}return babelHelpers["extends"]({type:"unknown"},b)});function l(a,b,c){return c?d("WAWap").wap("ack",{id:d("WAWap").CUSTOM_STRING(a),to:b,"class":"notification",type:"business"},d("WAWap").wap("user",{side_list:"out"})):d("WAWap").wap("ack",{id:d("WAWap").CUSTOM_STRING(a),to:b,"class":"notification",type:"business"})}function m(a){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){d("WALogger").DEV(j(),a);var b=k.parse(a);if(b.error){d("WALogger").DEV(i(),a.toString());d("WALogger").ERROR(h(),b.error.toString());throw b.error}a=b.success;switch(a.type){case"verified_name_hash":b=(yield d("WAWebHandleBusinessNameChange").handleVerifiedBusinessNameNotificationHash(a));return l(a.stanzaId,a.from,!b);case"verified_name_jid":yield d("WAWebHandleBusinessNameChange").handleVerifiedBusinessNameNotificationContact(a);return l(a.stanzaId,a.from,!1);case"remove_hash":b=(yield d("WAWebHandleBusinessRemoval").handleBusinessRemovalNotificationHash(a));return l(a.stanzaId,a.from,!b);case"remove_jid":yield d("WAWebHandleBusinessRemoval").handleBusinessRemovalNotificationContact(a);return l(a.stanzaId,a.from,!1);case"profile":yield d("WAWebHandleBusinessProfile").handleBusinessProfile(a);return l(a.stanzaId,a.from,!1);case"profile_hash":b=(yield d("WAWebHandleBusinessProfile").handleBusinessProfileHash(a));return l(a.stanzaId,a.from,!b);case"product":yield d("WAWebHandleBusinessProductCatalogNotification").handleProductNotification(a.productsIds);return l(a.stanzaId,a.from,!1);case"collection":yield d("WAWebHandleBusinessProductCatalogNotification").handleCollectionNotification(a);return l(a.stanzaId,a.from,!1);case"subscriptions":yield d("WAWebSubscriptions").applySubscriptions(a.subscriptions);return l(a.stanzaId,a.from,!1);case"ctwa_suggestion":yield d("WAWebHandleCTWASuggestion").handleCTWASuggestion(a.suggestion);return l(a.stanzaId,a.from,!1);case"privacy":d("WAWebHandlePrivacySettingsNotification").handleSmbDataSharingSettingNotification(a.privacy.smbDataSharingSetting);return l(a.stanzaId,a.from,!1);case"wa_ad_account_nonce":d("WAWebCTWABizAccessTokenNonceManager").setNonceFromPushNotification(a.nonce);return l(a.stanzaId,a.from,!1);default:a.type;return l(a.stanzaId,a.from,!1)}});return n.apply(this,arguments)}function a(a){var b=d("WAWebBackendJobsCommon").getNonCriticalNotificationPriority(Boolean(a.attrs.offline));return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("handleBusinessNotification",function(a){return m(a.node)},{priority:b}).waitUntilCompleted({node:a})}g.handleBusinessNotification=m;g.handleBusinessNotificationJob=a}),98); __d("WAWebHandleBusinessProductCatalogNotification",["Promise","WAWebCatalogCollection","WAWebUserPrefsMeUser","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function a(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=d("WAWebCatalogCollection").CatalogCollection.get(d("WAWebUserPrefsMeUser").getMeUser().toString());if(c){var e=[];a.forEach(function(a){e.push(c.refreshProduct(a))});yield (h||(h=b("Promise"))).all(e)}});return i.apply(this,arguments)}function c(a){var c=d("WAWebCatalogCollection").CatalogCollection.get(d("WAWebUserPrefsMeUser").getMeUser().toString());if(c==null?void 0:c.collections)for(var e=0;e<a.collectionIds.length;e++){var f=c.collections.get(a.collectionIds[e]);f&&f.set(a.reviewStatuses[e])}return(h||(h=b("Promise"))).resolve()}g.handleProductNotification=a;g.handleCollectionNotification=c}),98); __d("WAWebHandleBusinessProfile",["Promise","WAWebBusinessProfileCollection","WAWebLidAwareContactsDB","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function a(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a.from;a=d("WAWebWidFactory").createWidFromWidLike(a.toString());yield k([a])});return i.apply(this,arguments)}function e(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a.hash;a=(yield c("WAWebLidAwareContactsDB").equals(["contactHash"],a));a=a.map(function(a){return d("WAWebWidFactory").createWid(a.id)});if(a.length===0)return!1;yield k(a);return!0});return j.apply(this,arguments)}function k(a){a=a.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=Boolean(d("WAWebBusinessProfileCollection").BusinessProfileCollection.getValid(a));a=(yield d("WAWebBusinessProfileCollection").BusinessProfileCollection.update(a));a=Array.isArray(a)?a:[a];for(a of a)b||(a.stale=!0)});return function(b){return a.apply(this,arguments)}}());return(h||(h=b("Promise"))).all(a)}g.handleBusinessProfile=a;g.handleBusinessProfileHash=e}),98); __d("WAWebHandleBusinessRemoval",["Promise","WAWebBackendApi","WAWebContactCollection","WAWebHandleBusinessNameChangeLidHelpers","WAWebLidAwareContactsDB","WAWebWidFactory","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h;function a(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a.toString();var b=(yield c("WAWebLidAwareContactsDB").get(a));if(b==null)return;b.isBusiness=!1;b.verifiedLevel=0;b.verifiedName="";return c("WAWebLidAwareContactsDB").merge(a,b)});return i.apply(this,arguments)}function e(a,b){return a.remove(b.isLid()?b.toString():b.user)}var j={isBusiness:!1};function k(a,b,c){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){b=d("WAWebContactCollection").ContactCollection.get(a);c=b?{isBusiness:b.isBusiness,privacyMode:b.privacyMode}:j;yield d("WAWebHandleBusinessNameChangeLidHelpers").removeVerifiedNameFromTableLidAware(a);b=d("WAWebContactCollection").ContactCollection.get(a);b!=null&&b.set({isBusiness:!1,verifiedLevel:null,verifiedName:null});d("WAWebBackendApi").frontendFireAndForget("generateAndUpdatePrivacySystemMessages",{wid:a,previousState:c,currentState:j})});return l.apply(this,arguments)}function f(a){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a.type!=="remove_hash")throw c("err")("Invalid notification type");var e=(yield c("WAWebLidAwareContactsDB").equals(["contactHash"],a.hash));e=e.map(function(a){return d("WAWebWidFactory").createUserWid(a.id)});if(e.length===0)return!1;yield (h||(h=b("Promise"))).all(e.map(function(b){return k(b,a.stanzaId,a.ts)}));return!0});return m.apply(this,arguments)}function n(a){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a.type!=="remove_jid")throw c("err")("Invalid notification type");yield k(a.jid,a.stanzaId,a.ts)});return o.apply(this,arguments)}g.removeBusinessPropsFromContact=a;g.removeVerifiedName=e;g.handleBusinessRemoval=k;g.handleBusinessRemovalNotificationHash=f;g.handleBusinessRemovalNotificationContact=n}),98); __d("WAWebHistorySyncWorkerCompatibleNotificationUtils",["WALogger","WAWebBackendApi","WAWebChatConstants","WAWebProtobufsHistorySync.pb","WAWebSchemaChat","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] update chat "," end of history transfer type to ",""]);h=function(){return a};return a}function a(a,b,c){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){c===void 0&&(c=!1);b=j(b);var e={id:a,endOfHistoryTransferType:b};d("WALogger").DEV(h(),a.toString(),b);c&&(e.t=0);yield d("WAWebBackendApi").frontendSendAndReceive("chatCollectionAdd",{things:[e],options:{merge:!0}});yield d("WAWebSchemaChat").getChatTable().merge(a.toString(),{endOfHistoryTransferType:b})});return i.apply(this,arguments)}function j(a){switch(a){case d("WAWebProtobufsHistorySync.pb").Conversation$EndOfHistoryTransferType.COMPLETE_BUT_MORE_MESSAGES_REMAIN_ON_PRIMARY:return d("WAWebChatConstants").ConversationEndOfHistoryTransferModelPropType.COMPLETE_BUT_MORE_MESSAGES_REMAIN_ON_PRIMARY;case d("WAWebProtobufsHistorySync.pb").Conversation$EndOfHistoryTransferType.COMPLETE_AND_NO_MORE_MESSAGE_REMAIN_ON_PRIMARY:return d("WAWebChatConstants").ConversationEndOfHistoryTransferModelPropType.COMPLETE_AND_NO_MORE_MESSAGE_REMAIN_ON_PRIMARY;case d("WAWebProtobufsHistorySync.pb").Conversation$EndOfHistoryTransferType.COMPLETE_ON_DEMAND_SYNC_BUT_MORE_MSG_REMAIN_ON_PRIMARY:return d("WAWebChatConstants").ConversationEndOfHistoryTransferModelPropType.COMPLETE_ON_DEMAND_SYNC_BUT_MORE_MSG_REMAIN_ON_PRIMARY}}g.updateEndOfHistorySync=a}),98); __d("WAWebMmsClientErrors",["WAWebHttpErrors"],(function(a,b,c,d,e,f,g){b=function(a){babelHelpers.inheritsLoose(b,a);function b(b,c){c=a.call(this,404,b)||this;c.name="MediaNotFoundError";return c}return b}((a=d("WAWebHttpErrors")).HttpStatusCodeError);c=function(a){babelHelpers.inheritsLoose(b,a);function b(b,c){c=a.call(this,413,b)||this;c.name="MediaTooLargeError";return c}return b}(a.HttpStatusCodeError);e=function(a){babelHelpers.inheritsLoose(b,a);function b(b,c){c=a.call(this,415,b)||this;c.name="MediaInvalidError";return c}return b}(a.HttpStatusCodeError);f=function(a){babelHelpers.inheritsLoose(b,a);function b(b,c){c=a.call(this,401,b)||this;c.name="MMSUnauthorizedError";return c}return b}(a.HttpStatusCodeError);d=function(a){babelHelpers.inheritsLoose(b,a);function b(b,c){c=a.call(this,403,b)||this;c.name="MMSForbiddenError";return c}return b}(a.HttpStatusCodeError);a=function(a){babelHelpers.inheritsLoose(b,a);function b(b,c){c=a.call(this,507,b)||this;c.name="MMSThrottleError";return c}return b}(a.HttpStatusCodeError);g.MediaNotFoundError=b;g.MediaTooLargeError=c;g.MediaInvalidError=e;g.MMSUnauthorizedError=f;g.MMSForbiddenError=d;g.MMSThrottleError=a}),98); __d("WAWebMmsClientIsErrorRetryable",["WAWebHttpErrors","WAWebMediaHostsErrors","WAWebMmsClientErrors"],(function(a,b,c,d,e,f,g){function a(a){if(a===408)return!0;if(a===507)return!1;return a>=500?!0:!1}function b(a){return a instanceof d("WAWebMmsClientErrors").MMSThrottleError?!1:a instanceof d("WAWebMediaHostsErrors").NoMediaHostsError||a instanceof d("WAWebHttpErrors").HttpNetworkError||a instanceof d("WAWebMmsClientErrors").MMSUnauthorizedError||a instanceof d("WAWebHttpErrors").HttpStatusCodeError&&a.status>=500}g.isRetriableStatusCode=a;g.isErrorRetryable=b}),98); __d("WAWebMmsClientMmsBackoffOptions",[],(function(a,b,c,d,e,f){a={minTimeout:1e3,retries:3};b=a;f["default"]=b}),66); __d("WAWebMmsClientFormatHashUrl",["WABase64UrlSafe","WANullthrows","WAWebMmsMediaTypes","WAWebPonyfillsUrlSearchParams"],(function(a,b,c,d,e,f,g){var h=(b={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","md-msg-hist":"/mms/md-msg-hist","product-catalog-image":"/product/image","biz-cover-photo":"/pps/biz-cover-photo","thumbnail-image":"/mms/thumbnail-image","thumbnail-video":"/mms/thumbnail-video"},b[(e=d("WAWebMmsMediaTypes")).MEDIA_TYPES.NEWSLETTER_AUDIO]="/newsletter/newsletter-audio",b[e.MEDIA_TYPES.NEWSLETTER_IMAGE]="/newsletter/newsletter-image",b[e.MEDIA_TYPES.NEWSLETTER_DOCUMENT]="/newsletter/newsletter-document",b[e.MEDIA_TYPES.NEWSLETTER_IMAGE]="/newsletter/newsletter-image",b[e.MEDIA_TYPES.NEWSLETTER_GIF]="/newsletter/newsletter-gif",b[e.MEDIA_TYPES.NEWSLETTER_PTT]="/newsletter/newsletter-ptt",b[e.MEDIA_TYPES.NEWSLETTER_PTV]="/newsletter/newsletter-ptv",b[e.MEDIA_TYPES.NEWSLETTER_STICKER]="/newsletter/newsletter-sticker",b[e.MEDIA_TYPES.NEWSLETTER_THUMBNAIL_LINK]="/newsletter/newsletter-thumbnail-link",b[e.MEDIA_TYPES.NEWSLETTER_VIDEO]="/newsletter/newsletter-video",b[e.MEDIA_TYPES.NATIVE_AD_IMAGE]="/mms/ads-image",b[e.MEDIA_TYPES.STICKER_PACK]="/mms/sticker-pack",b[e.MEDIA_TYPES.THUMBNAIL_STICKER_PACK]="/mms/thumbnail-sticker-pack",b[e.MEDIA_TYPES.MUSIC_ARTWORK]="/mms/music-artwork",b);function a(a){var b=a.hostname,d=a.type,e=a.encFilehash,f=a.query;a=c("WANullthrows")(h[d]);d=new URL("https://"+b+a+"/"+c("WABase64UrlSafe")(e));var g={};f&&Object.keys(f).forEach(function(a){f[a]!=null&&(g[a]=f[a])});b=new(c("WAWebPonyfillsUrlSearchParams"))(g).toString();b&&(b="?"+b);return"https://"+d.host+d.pathname+b}g["default"]=a}),98); __d("WAWebMmsClientFormatUploadUrl",["WABase64UrlSafe","WAWebMmsClientFormatHashUrl"],(function(a,b,c,d,e,f,g){function a(a){var b=a.auth,d=a.encFilehash,e=a.hostname,f=a.query,g=a.type,h=a.byteRange,i=a.mediaId;a=a.token;var j=f==null?void 0:f.final_hash;return c("WAWebMmsClientFormatHashUrl")({encFilehash:d,hostname:e,type:g,query:{auth:b,token:c("WABase64UrlSafe")(a),resume:f==null?void 0:(d=f.resume)==null?void 0:d.toString(10),stream:f==null?void 0:(e=f.stream)==null?void 0:e.toString(10),final_hash:j!=null?c("WABase64UrlSafe")(j):void 0,bytestart:h==null?void 0:h.start.toString(10),byteend:h==null?void 0:h.end.toString(10),media_id:i.toString(10),server_thumb_gen:f==null?void 0:(g=f.server_thumb_gen)==null?void 0:g.toString(10)}})}g["default"]=a}),98); __d("WAWebMmsClientMmsLogError",["WAAbortError","WALogger","WAWebMmsClientErrors"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["",": ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["",": canceled"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["",": expected error"]);j=function(){return a};return a}function a(a,b,c,e){e===void 0&&(e=!0),b instanceof d("WAWebMmsClientErrors").MediaNotFoundError&&e?d("WALogger").LOG(j(),a).devConsole(c,b):typeof b==="object"&&(b==null?void 0:b.name)===d("WAAbortError").ABORT_ERROR?d("WALogger").LOG(i(),a).devConsole(c,b):d("WALogger").WARN(h(),a,b).devConsole(c,b)}g.mmsLogError=a}),98); __d("WAWebMmsClientMmsGetUploadProgress",["WALogger","WAWebHttpErrors","WAWebHttpExtendedFetch","WAWebMmsClientErrors","WAWebMmsClientFormatUploadUrl","WAWebMmsClientMmsLogError","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["mmsGetUploadProgress: success"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["mmsGetUploadProgress: start"]);i=function(){return a};return a}function a(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.auth,e=a.encFilehash,f=a.hostname,g=a.signal,j=a.type,k=a.onProgress,l=a.mediaId,m=a.token;a=a.generateThumbnailOnServer;b=c("WAWebMmsClientFormatUploadUrl")({auth:b,encFilehash:e,hostname:f,query:{resume:1,server_thumb_gen:a===!0?1:void 0},type:j,mediaId:l,token:m});f={encFilehash:e,type:j,url:b};d("WALogger").LOG(i()).devConsole(f);try{a=(yield d("WAWebHttpExtendedFetch").extendedFetch(b,{method:"post",signal:g,onProgress:k}));if(!a.ok)switch(a.status){case 401:throw new(d("WAWebMmsClientErrors").MMSUnauthorizedError)("mmsGetUploadProgress",{url:b});case 404:throw new(d("WAWebMmsClientErrors").MediaNotFoundError)("mmsGetUploadProgress",{url:b});default:throw new(d("WAWebHttpErrors").HttpStatusCodeError)(a.status,"mmsGetUploadProgress",{url:b})}l=(yield a.json());if(!l.resume)throw new(d("WAWebHttpErrors").HttpInvalidResponseError)("mmsGetUploadProgress: missing resume",{url:b});d("WALogger").LOG(h()).devConsole(f);return{directPath:l.direct_path,resume:l.resume,url:l.url,handle:l.handle}}catch(a){d("WAWebMmsClientMmsLogError").mmsLogError("mmsUpload",a,f);throw a}});return j.apply(this,arguments)}g["default"]=a}),98); __d("WAWebMmsClientMmsCheckIfUploadExists",["WALogger","WAWebHttpErrors","WAWebMmsClientErrors","WAWebMmsClientMmsGetUploadProgress","WAWebMmsClientMmsLogError","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["mmsCheckIfUploadExists: resume is NaN, resume=",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["mmsCheckIfUploadExists: success"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["mmsCheckIfUploadExists: start"]);j=function(){return a};return a}var k="complete";function a(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b={encFilehash:a.encFilehash,type:a.type};d("WALogger").LOG(j()).devConsole(b);try{a=(yield c("WAWebMmsClientMmsGetUploadProgress")(a));var e=a.directPath,f=a.url,g=a.handle;a=a.resume;if(a===k){if(e==null||e==="")throw new(d("WAWebHttpErrors").HttpInvalidResponseError)("mmsCheckIfUploadExists: missing directPath");if(f==null||f==="")throw new(d("WAWebHttpErrors").HttpInvalidResponseError)("mmsCheckIfUploadExists: missing url");d("WALogger").LOG(i()).devConsole(b);return{directPath:e,url:f,handle:g,complete:!0}}e=parseInt(a,10);if(e===0)throw new(d("WAWebMmsClientErrors").MediaNotFoundError)("mmsCheckIfUploadExists");if(Number.isNaN(e)){d("WALogger").ERROR(h(),e).sendLogs("upload-offset-is-NaN");throw new(d("WAWebHttpErrors").HttpInvalidResponseError)("mmsCheckIfUploadExists: invalid resume")}return{complete:!1,resume:e}}catch(a){d("WAWebMmsClientMmsLogError").mmsLogError("mmsCheckIfUploadExists",a,b);throw a}});return l.apply(this,arguments)}g["default"]=a}),98); __d("WAWebPonyfillsFetch",["WAWebHttpExtendedFetch"],(function(a,b,c,d,e,f,g){var h=function(){};b="fetch"in self?self.fetch:a;function a(a,b){b===void 0&&(b={});return d("WAWebHttpExtendedFetch").sharedFetch(a,babelHelpers["extends"]({},b,{onProgress:h}))}g["default"]=b}),98); __d("WAWebMmsClientMmsDeleteMdHistorySyncBlob",["WABase64","WABase64UrlSafe","WAWebHttpErrors","WAWebMmsClientFormatHashUrl","WAWebMmsMediaTypes","WAWebPonyfillsFetch","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.directPath,e=a.encFilehash,f=a.hostname,g=a.auth,h=a.encHandle;a=a.companionUserSecret;b=b.split("?")[0];b=new TextEncoder().encode(b);b=d("WABase64").encodeB64UrlSafe(b);var i=d("WAWebMmsMediaTypes").MEDIA_TYPES.HISTORY_SYNC;f=c("WAWebMmsClientFormatHashUrl")({encFilehash:e,hostname:f,type:i,query:{token:c("WABase64UrlSafe")(e),d_md:b,auth:g,e_handle:h}});i={};h!=null&&a!=null&&(i.Companion_User_Secret=a);e=(yield c("WAWebPonyfillsFetch")(f,{method:"DELETE",headers:i}));if(!e.ok)throw new(d("WAWebHttpErrors").HttpStatusCodeError)(e.status,"MMS Delete error")});return h.apply(this,arguments)}g["default"]=a}),98); __d("WAWebMmsCdnUrlValidationUtils",["WATimeUtils"],(function(a,b,c,d,e,f,g){var h={OE:"oe"};function a(a){a=a instanceof URL?a.searchParams:new URL(a).searchParams;a=a.get(h.OE);a=a==null?void 0:d("WATimeUtils").convertHexToDate(a);return{expirationDate:a}}g.parseCdnUrlParams=a}),98); __d("WAWebMmsClientFormatDownloadUrl",["WABase64UrlSafe","WALogger","WAWebABProps","WAWebMmsClientFormatHashUrl","WAWebPonyfillsUrlSearchParams","WAWebSharedConstants","err","isStringNullOrEmpty"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["url.hostname: ",", hostname: ",", directPath: ",""]);h=function(){return a};return a}function a(a){var b=a.directPath,e=a.encFilehash,f=a.hostname,g=a.type,h=a.mode,j=a.byteRange;a=a.downloadBucket;if(!c("isStringNullOrEmpty")(b)){return i({encFilehash:e,hostname:f,directPath:b,query:(b={mode:h,bytestart:j==null?void 0:j.start.toString(),byteend:j==null?void 0:j.end.toString()},b[d("WAWebSharedConstants").MMS_URL_MEDIA_TYPE_SEARCH_PARAM]=g,b[d("WAWebSharedConstants").IS_MMS_URL_SEARCH_PARAM]="",b),downloadBucket:a,type:g})}if(d("WAWebABProps").getABPropConfigValue("web_deprecate_mms4_hash_based_download"))throw c("err")("No direct path is available for download, abort");return c("WAWebMmsClientFormatHashUrl")({hostname:f,type:g,encFilehash:e,query:(j={mode:h},j[d("WAWebSharedConstants").IS_MMS_URL_SEARCH_PARAM]="",j)})}function i(a){var b=a.directPath,e=a.encFilehash,f=a.hostname,g=a.query,i=a.downloadBucket;a=a.type;var j=new URL(b,"https://"+f);if(j.hostname!==f){d("WALogger").ERROR(h(),j.hostname,f,b).sendLogs("malicious directPath");throw c("err")("malicious directPath")}var k=j.searchParams||new(c("WAWebPonyfillsUrlSearchParams"))(j.search);k.set("hash",c("WABase64UrlSafe")(e));i!=null&&k.set("_nc_cat",i.toString());f=d("WAWebABProps").getABPropConfigValue("low_cache_hit_rate_media_types");if(f!=null){b=f.split(",");b.includes(a)&&k.set("_nc_map","whatsapp-nofna")}Object.keys(g).forEach(function(a){var b=g[a];b!=null&&k.set(a,b)});return"https://"+j.host+j.pathname+"?"+k.toString()}g["default"]=a}),98); __d("WAWebMmsClientMmsDownload",["WALogger","WAMediaCalculateFilehash","WATimeUtils","WAWebHttpErrors","WAWebHttpExtendedFetch","WAWebMiscErrors","WAWebMmsCdnUrlValidationUtils","WAWebMmsClientErrors","WAWebMmsClientFormatDownloadUrl","WAWebMmsClientMmsLogError","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["mmsDownload: [","] success"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["download hash mismatch error. downloaded size: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["mmsDownload: [","] start"]);j=function(){return a};return a}function k(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.url,c=a.signal,e=a.onHeadersReceived,f=a.onProgress,g=a.onData,k=a.debug,l=a.debugString;a=a.ciphertextValidator;d("WALogger").LOG(j(),l).devConsole(k);try{c=(yield d("WAWebHttpExtendedFetch").extendedFetch(b,{signal:c,onProgress:f,onData:g,onHeadersReceived:e}));yield o({response:c,functionName:"mmsDownload",url:b});f=(yield c.arrayBuffer());if(a&&!(yield a(f))){d("WALogger").WARN(i(),f.byteLength);throw new(d("WAWebHttpErrors").MmsDownloadFilehashMismatchError)({url:b})}d("WALogger").LOG(h(),l).devConsole(k);return f}catch(a){d("WAWebMmsClientMmsLogError").mmsLogError("mmsDownload",a,k);if(a instanceof TypeError)throw new(d("WAWebHttpErrors").HttpNetworkError)(a.message);throw a}});return l.apply(this,arguments)}function a(a){var e=a.directPath,f=a.encFilehash,g=a.staticUrl,h=a.hostname,i=a.type,j=a.signal,l=a.onProgress,m=a.onData,n=a.onHeadersReceived,o=a.mode,p=a.byteRange,q=a.debugString;a=a.downloadBucket;g=g?g:c("WAWebMmsClientFormatDownloadUrl")({directPath:e,encFilehash:f,hostname:h,type:i,mode:o,byteRange:p,downloadBucket:a});e=p?null:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){return(yield d("WAMediaCalculateFilehash").calculateFilehash(a))===f});return function(b){return a.apply(this,arguments)}}();return k({url:g,signal:j,onHeadersReceived:n,onProgress:l,onData:m,ciphertextValidator:e,debugString:q,debug:{encFilehash:f,type:i,url:g}})}function e(a){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.directPath,c=a.encFilehash,d=a.hostname,e=a.type;a=a.signal;yield q({directPath:b,encFilehash:c,hostname:d,type:e,signal:a,functionName:"mmsCheckExistence"})});return m.apply(this,arguments)}function f(a){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.directPath,c=a.encFilehash,e=a.hostname,f=a.type;a=a.signal;b=(yield q({directPath:b,encFilehash:c,hostname:e,type:f,signal:a,functionName:"mmsGetEncryptedMediaSize"}));c=b.headers.get("content-length");if(!c)throw new(d("WAWebMiscErrors").UnableToGetContentLengthError)();return parseInt(c,10)});return n.apply(this,arguments)}function o(a){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.response,c=a.url;a=a.functionName;if(!b.ok)switch(b.status){case 401:throw new(d("WAWebMmsClientErrors").MMSUnauthorizedError)(a,{url:c});case 403:var e=(yield b.text());if(e.includes("URL signature expired"))throw new(d("WAWebMmsClientErrors").MediaNotFoundError)(a,{url:c,status:b.status});e=d("WAWebMmsCdnUrlValidationUtils").parseCdnUrlParams(c);e=e.expirationDate;if(e!=null&&d("WATimeUtils").toDate(d("WATimeUtils").unixTime())>=e)throw new(d("WAWebMmsClientErrors").MediaNotFoundError)(a,{url:c,status:b.status});throw new(d("WAWebMmsClientErrors").MMSForbiddenError)(a,{url:c});case 404:case 410:throw new(d("WAWebMmsClientErrors").MediaNotFoundError)(a,{url:c,status:b.status});case 507:throw new(d("WAWebMmsClientErrors").MMSThrottleError)(a,{url:c});default:throw new(d("WAWebHttpErrors").HttpStatusCodeError)(b.status,a,{url:c})}});return p.apply(this,arguments)}function q(a){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.directPath,e=a.encFilehash,f=a.hostname,g=a.type,h=a.signal;a=a.functionName;b=c("WAWebMmsClientFormatDownloadUrl")({directPath:b,encFilehash:e,hostname:f,type:g,mode:"auto"});e=(yield d("WAWebHttpExtendedFetch").extendedFetch(b,{method:"HEAD",signal:h}));yield o({response:e,functionName:a,url:b});return e});return r.apply(this,arguments)}g.mms4Download=a;g.mmsCheckExistence=e;g.mmsGetEncryptedMediaSize=f;g.validateMmsResponse=o}),98); __d("WAWebMmsClientMmsUpload",["WALogger","WAWebHttpErrors","WAWebHttpExtendedFetch","WAWebMmsClientErrors","WAWebMmsClientFormatUploadUrl","WAWebMmsClientMmsLogError","WAWebMmsMediaTypes","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["mmsUpload: success"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["mmsUpload: start"]);i=function(){return a};return a}function j(a){var b;if(a.direct_path==null||a.direct_path==="")throw new(d("WAWebHttpErrors").HttpInvalidResponseError)("mmsUpload: missing direct_path");if(a.url==null||a.url==="")throw new(d("WAWebHttpErrors").HttpInvalidResponseError)("mmsUpload: missing url");return{directPath:a.direct_path,url:a.url,handle:a.handle,thumbnailDirectPath:(b=a.thumbnail_info)==null?void 0:b.thumbnail_direct_path,thumbnailSha256:(b=a.thumbnail_info)==null?void 0:b.thumbnail_sha256}}function k(a){if(a.ts==null)throw new(d("WAWebHttpErrors").HttpInvalidResponseError)("mmsUpload: missing ts (timestamp)");if(a.meta_hmac==null)throw new(d("WAWebHttpErrors").HttpInvalidResponseError)("mmsUpload: missing meta_hmac");if(a.fbid==null)throw new(d("WAWebHttpErrors").HttpInvalidResponseError)("mmsUpload: missing fbid");return{directPath:"",url:"",ts:a.ts,metaHmac:a.meta_hmac,fbid:a.fbid}}function l(a){if(a.direct_path==null||a.direct_path==="")throw new(d("WAWebHttpErrors").HttpInvalidResponseError)("mmsUpload: missing direct_path");if(a.url==null||a.url==="")throw new(d("WAWebHttpErrors").HttpInvalidResponseError)("mmsUpload: missing url");if(a.fbid==null)throw new(d("WAWebHttpErrors").HttpInvalidResponseError)("mmsUpload: missing fbid");return{directPath:a.direct_path,url:a.url,fbid:a.fbid}}function a(a){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.auth,e=a.ciphertextHmac,f=a.encFilehash,g=a.hostname,m=a.type,n=a.signal,o=a.onProgress,p=a.byteRange,q=a.mediaId,r=a.generateThumbnailOnServer,s=c("WAWebMmsClientFormatUploadUrl")({auth:b,encFilehash:f,hostname:g,type:m,byteRange:p,mediaId:q,token:a.token,query:{server_thumb_gen:r===!0?1:void 0}});b={encFilehash:f,type:m,url:s};d("WALogger").LOG(i()).devConsole(b);try{var t;switch(m){case d("WAWebMmsMediaTypes").MEDIA_TYPES.NATIVE_AD_IMAGE:t=l;break;case d("WAWebMmsMediaTypes").MEDIA_TYPES.BIZ_COVER_PHOTO:t=k;break;default:t=j;break}g=(yield d("WAWebHttpExtendedFetch").extendedFetch(s,{method:"post",body:e,signal:n,onProgress:o}).then(function(a){if(!a.ok)switch(a.status){case 401:throw new(d("WAWebMmsClientErrors").MMSUnauthorizedError)("mmsUpload",{url:s});case 413:throw new(d("WAWebMmsClientErrors").MediaTooLargeError)("mmsUpload",{url:s});case 415:throw new(d("WAWebMmsClientErrors").MediaInvalidError)("mmsUpload: hash mismatch",{url:s});case 507:throw new(d("WAWebMmsClientErrors").MMSThrottleError)("mmsUpload",{url:s});default:throw new(d("WAWebHttpErrors").HttpStatusCodeError)(a.status,"mmsUpload",{url:s})}return a.json()}).then(t));d("WALogger").LOG(h()).devConsole(b);return g}catch(a){d("WAWebMmsClientMmsLogError").mmsLogError("mmsUpload",a,b,!1);throw a}});return m.apply(this,arguments)}g["default"]=a}),98); __d("WAWebMediaHostsMaybeSwitchHost",["WAWebMediaHost"],(function(a,b,c,d,e,f,g){var h=50*1024*1024;function i(a,b,c){return a.equals(b)&&c!=null&&b!=null&&!b.equals(c)}function a(a,b,c,e){var f=b.selectedHost;b=b.fallbackHost;var g=c.selectedHost;c=c.fallbackHost;if(e<h)return{changed:!1,host:a};switch(a.type){case d("WAWebMediaHost").HOST_TYPE.PRIMARY:if(!a.equals(g))return{changed:!0,host:g};break;case d("WAWebMediaHost").HOST_TYPE.FALLBACK:if(!f.equals(g))return{changed:!0,host:g};else if(i(a,b,c)||i(a,f.fallback,g.fallback))return{changed:!0,host:f};break}return{changed:!1,host:a}}g.THRESHOLD=h;g.maybeSwitchHost=a}),98); __d("WAWebMmsClientPollMediaHosts",["Promise","WAPromiseDelays","WARetryPromise","WAWebMediaHostsMaybeSwitchHost","WAWebMmsMediaTypes","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h,i=5*60*1e3;function a(a,b){return a===d("WAWebMmsMediaTypes").MEDIA_TYPES.DOCUMENT&&b>d("WAWebMediaHostsMaybeSwitchHost").THRESHOLD}function e(a,b){return a===d("WAWebMmsMediaTypes").MEDIA_TYPES.DOCUMENT&&((a=b)!=null?a:0)>d("WAWebMediaHostsMaybeSwitchHost").THRESHOLD}function f(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=a.connectionBlock;yield d("WAPromiseDelays").delayMs(i,a.signal);return c("WARetryPromise")(function(c){var f=c.retry;return new(h||(h=b("Promise")))(function(b){return a.getMediaHosts().then(function(c){var g=c.selectedHost;c=c.fallbackHost;g={selectedHost:g,fallbackHost:c};c=a.getRemainingBytes();if(c==null)return f(i);c=d("WAWebMediaHostsMaybeSwitchHost").maybeSwitchHost(a.getHost(),e,g,c);var h=c.changed;c=c.host;e=g;return h?b(c):f(i)})})},a.signal)});return j.apply(this,arguments)}g.SERVER_POLLING_INTERVAL=i;g.shouldPollUploadHosts=a;g.shouldPollDownloadHosts=e;g.pollMediaHosts=f}),98); __d("WAWebMmsClientSelectHost",[],(function(a,b,c,d,e,f){var g=4;function a(a){var b=a.selectedHost,c=a.fallbackHost,d=a.attemptCount,e=a.lastHostUsed;a=a.lastFetchMadeProgress;if(a&&e)return e;if(d<=1)return b;if(d===g-1&&c)return c;return(e==null?void 0:e.equals(b))&&b.fallback!=null?b.fallback:(a=c)!=null?a:b}f["default"]=a}),66); __d("WAWebMmsClientMmsUploadStream",["WALogger","WAWebHttpErrors","WAWebHttpExtendedFetch","WAWebMmsClientErrors","WAWebMmsClientFormatUploadUrl","WAWebMmsClientMmsLogError","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["mmsUploadStreamFinalize: success"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["mmsUploadStreamFinalize: start"]);i=function(){return a};return a}function j(a,b,c){switch(a){case 401:throw new(d("WAWebMmsClientErrors").MMSUnauthorizedError)(b,{url:c});case 413:throw new(d("WAWebMmsClientErrors").MediaTooLargeError)(b,{url:c});case 415:throw new(d("WAWebMmsClientErrors").MediaInvalidError)(b+": hash mismatch",{url:c});case 507:throw new(d("WAWebMmsClientErrors").MMSThrottleError)("mmsUploadStreamFinalize",{url:c});default:throw new(d("WAWebHttpErrors").HttpStatusCodeError)(a,b,{url:c})}}function a(a){var b=a.auth,e=a.encFilehash,f=a.type,g=a.hostname,h=a.byteStart,i=a.byteEnd,k=a.chunk,l=a.signal,m=a.onProgress,n=a.mediaId,o=a.token;a=a.generateThumbnailOnServer;var p=c("WAWebMmsClientFormatUploadUrl")({auth:b,encFilehash:e,type:f,hostname:g,query:{stream:1,server_thumb_gen:a===!0?1:void 0},byteRange:{start:h,end:i},mediaId:n,token:o});return d("WAWebHttpExtendedFetch").extendedFetch(p,{method:"post",body:k,signal:l,onProgress:m}).then(function(a){a.ok||j(a.status,"mmsUploadStream",p)})}function e(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.auth,e=a.encFilehash,f=a.type,g=a.hostname,k=a.finalHash,l=a.signal,m=a.mediaId;a=a.generateThumbnailOnServer;var n=c("WAWebMmsClientFormatUploadUrl")({auth:b,encFilehash:e,type:f,hostname:g,query:{stream:1,final_hash:k,server_thumb_gen:a===!0?1:void 0},mediaId:m,token:e});b={encFilehash:e,type:f,url:n};d("WALogger").LOG(i()).devConsole(b);try{g=(yield d("WAWebHttpExtendedFetch").extendedFetch(n,{method:"post",signal:l}).then(function(a){a.ok||j(a.status,"mmsUploadStreamFinalize",n);return a.json()}).then(function(a){if(a.direct_path==null||a.direct_path==="")throw new(d("WAWebHttpErrors").HttpInvalidResponseError)("mmsUploadStreamFinalize: missing direct_path");if(a.url==null||a.url==="")throw new(d("WAWebHttpErrors").HttpInvalidResponseError)("mmsUploadStreamFinalize: missing url");return{directPath:a.direct_path,url:a.url,handle:a.handle}}));d("WALogger").LOG(h()).devConsole(b);return g}catch(a){d("WAWebMmsClientMmsLogError").mmsLogError("mmsUpload",a,b,!1);throw a}});return k.apply(this,arguments)}g.mmsUploadStream=a;g.mmsUploadStreamFinalize=e}),98); __d("WAWebWamEnumOverallLastUploadRetryPhaseType",[],(function(a,b,c,d,e,f){a=Object.freeze({RESUME_CHECK:1,UPLOAD:2,FINALIZE:3});f.OVERALL_LAST_UPLOAD_RETRY_PHASE_TYPE=a}),66); __d("WAWebMmsClientUploadStreamer",["Promise","WAExponentialBackoff","WALogger","WARaceSignal","WARetryPromise","WAWebHttpErrors","WAWebMediaHosts","WAWebMediaHostsRouteSelection","WAWebMmsClientIsErrorRetryable","WAWebMmsClientMmsBackoffOptions","WAWebMmsClientMmsUploadStream","WAWebMmsClientPollMediaHosts","WAWebMmsClientSelectHost","WAWebMmsMediaTypes","WAWebNetworkStatus","WAWebWamEnumOverallLastUploadRetryPhaseType","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["uploadStreamer: [","] finalizing"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["uploadStreamer: [","] uploading chunk ","/",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["uploadStreamer: [","] start upload"]);k=function(){return a};return a}function a(a,b){var c=n(b);return b===d("WAWebMmsMediaTypes").MEDIA_TYPES.DOCUMENT&&c>0&&a>c}e=function(){function a(a){var c;this.$2=Date.now();this.$3=0;this.$4=0;this.$9=(h||(h=b("Promise"))).resolve();this.$6=a.encFilehash;this.$5=a.type;this.$7=a.signal;this.$3=(c=a.byteOffset)!=null?c:0;this.$1=a.encFilehash.slice(0,10);this.$11=a.token;this.$12=(c=a.generateThumbnailOnServer)!=null?c:!1;this.$13=a.onUploadHostFound;this.$14=a.onUploadAttemptSuccess;this.$15=a.onUploadAttemptError;this.$16=a.onProgress;this.$17=a.onFinalize;this.$18=a.onStreamUploadStart;this.$10=a.mediaId}var e=a.prototype;e.uploadCompleteFile=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a.ciphertextHmac;a=new Uint8Array(a);this.$8=a.byteLength;var b=n(this.$5);b=b===0?a.byteLength:b;this.$18==null?void 0:this.$18();d("WALogger").LOG(k(),this.$1);yield c("WAWebNetworkStatus").waitIfOffline();var e=Math.ceil((a.byteLength-this.$3)/b);for(var f=0;f<e;f++){this.$19(f,e);var g=this.$3+f*b,h=g+b;h=a.subarray(g,h);yield this.$20(h,g);this.$4+=h.byteLength}g=(yield this.$21(this.$6));this.$14==null?void 0:this.$14(Date.now()-this.$2);return g});function e(b){return a.apply(this,arguments)}return e}();e.startUploadFromClient=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield c("WAWebNetworkStatus").waitIfOffline(),this.$18==null?void 0:this.$18()});function d(){return a.apply(this,arguments)}return d}();e.uploadChunkFromClient=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=this;this.$9=this.$9.then(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield c.$20(a,c.$3),c.$4+=a.byteLength,c.$3+=a.byteLength}));yield this.$9});function c(b){return a.apply(this,arguments)}return c}();e.finalizeUploadFromClient=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=this,c=(yield this.$9.then(function(){return b.$21(a)}));this.$14==null?void 0:this.$14(Date.now()-this.$2);return c});function c(b){return a.apply(this,arguments)}return c}();e.$22=function(){this.$2=Date.now()};e.$23=function(){return Date.now()-this.$2};e.$24=function(){if(this.$8==null)return;return this.$8-this.$4};e.$19=function(a,b){d("WALogger").LOG(j(),this.$1,a+1,b)};e.$20=function(a,e){var f=this;return d("WAExponentialBackoff").exponentialBackoff(babelHelpers["extends"]({},c("WAWebMmsClientMmsBackoffOptions"),{signal:this.$7}),function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b,c){try{yield f.$25(a,e,c)}catch(a){if(l(a,c)){f.$15==null?void 0:f.$15(a,f.$23(),c,d("WAWebWamEnumOverallLastUploadRetryPhaseType").OVERALL_LAST_UPLOAD_RETRY_PHASE_TYPE.UPLOAD);f.$22();return b(a)}throw a}});return function(a,b){return c.apply(this,arguments)}}())};e.$21=function(a){var e=this;return d("WAExponentialBackoff").exponentialBackoff(babelHelpers["extends"]({},c("WAWebMmsClientMmsBackoffOptions"),{signal:this.$7}),function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b,c){try{e.$17==null?void 0:e.$17();return yield e.$26(a,c)}catch(a){if(m(a,c)){e.$15==null?void 0:e.$15(a,e.$23(),c,d("WAWebWamEnumOverallLastUploadRetryPhaseType").OVERALL_LAST_UPLOAD_RETRY_PHASE_TYPE.FINALIZE);e.$22();return b(a)}throw a}});return function(a,b){return c.apply(this,arguments)}}())};e.$25=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e,f){var g=this,i=null,j=!1;yield c("WAWebNetworkStatus").waitIfOffline();var k=(yield this.$27(f)),l=k.auth,m=babelHelpers.objectWithoutPropertiesLoose(k,["auth"]),n=i=c("WAWebMmsClientSelectHost")({selectedHost:m.selectedHost,fallbackHost:m.fallbackHost,lastHostUsed:i,lastFetchMadeProgress:j,attemptCount:f}),o=function(a){j=!0,g.$16==null?void 0:g.$16(a,e)};return c("WARetryPromise")(function(){var j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(j){j=j.retry;var k=new AbortController(),p=k.signal;p=(yield c("WARaceSignal")([p,g.$7],function(c){var i=g.$8!=null&&d("WAWebMmsClientPollMediaHosts").shouldPollUploadHosts(g.$5,g.$8)?d("WAWebMmsClientPollMediaHosts").pollMediaHosts({connectionBlock:m,signal:c,getHost:function(){return n},getMediaHosts:function(){return g.$27(f,!0)},getRemainingBytes:function(){return g.$24()}}).then(function(a){return{host:a,kind:"host-changed"}}):null;c=d("WAWebMmsClientMmsUploadStream").mmsUploadStream({auth:l,encFilehash:g.$6,type:g.$5,hostname:n.hostname,byteStart:e,byteEnd:e+a.byteLength,chunk:a,signal:c,onProgress:o,mediaId:g.$10,token:g.$11,generateThumbnailOnServer:g.$12}).then(function(){return{kind:"upload-completed"}});return(h||(h=b("Promise"))).race([c,i].filter(Boolean))["finally"](function(){return k.abort()})}));if(p.kind==="host-changed"){i=n;n=p.host;return j()}});return function(a){return j.apply(this,arguments)}}())});function e(b,c,d){return a.apply(this,arguments)}return e}();e.$26=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){yield c("WAWebNetworkStatus").waitIfOffline();b=(yield this.$27(b));var e=b.auth;b=b.selectedHost;d("WALogger").LOG(i(),this.$1);return d("WAWebMmsClientMmsUploadStream").mmsUploadStreamFinalize({auth:e,hostname:b.hostname,encFilehash:this.$6,finalHash:a,type:this.$5,signal:this.$7,mediaId:this.$10,generateThumbnailOnServer:this.$12})});function e(b,c){return a.apply(this,arguments)}return e}();e.$27=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b===void 0&&(b=!1);b=(yield d("WAWebMediaHosts").mediaHosts.getHostsInfo({operation:d("WAWebMediaHostsRouteSelection").OPERATIONS.UPLOAD,encFilehash:this.$6,type:this.$5,signal:this.$7,forceRefresh:b}));this.$13==null?void 0:this.$13({failCount:a,hostName:b.selectedHost.hostname,hostClass:b.selectedHost["class"]});return b});function c(b,c){return a.apply(this,arguments)}return c}();return a}();function l(a,b){return d("WAWebMmsClientIsErrorRetryable").isErrorRetryable(a)&&b<c("WAWebMmsClientMmsBackoffOptions").retries}function m(a,b){return a instanceof d("WAWebHttpErrors").HttpStatusCodeError&&a.status>=500?!1:l(a,b)}function n(a){return a===d("WAWebMmsMediaTypes").MEDIA_TYPES.DOCUMENT?50*1024*1024:0}g.shouldUseStreamingUpload=a;g.UploadStreamer=e}),98); __d("WAWebMmsOperationsConst",[],(function(a,b,c,d,e,f){a={DOWNLOAD:"DOWNLOAD",UPLOAD:"UPLOAD"};b=a;f["default"]=b}),66); __d("WAWebMmsClient",["Promise","WAExponentialBackoff","WALogger","WANullthrows","WARaceSignal","WARetryPromise","WAWebMediaHosts","WAWebMmsClientIsErrorRetryable","WAWebMmsClientMmsBackoffOptions","WAWebMmsClientMmsCheckIfUploadExists","WAWebMmsClientMmsDeleteMdHistorySyncBlob","WAWebMmsClientMmsDownload","WAWebMmsClientMmsLogError","WAWebMmsClientMmsUpload","WAWebMmsClientPollMediaHosts","WAWebMmsClientSelectHost","WAWebMmsClientUploadStreamer","WAWebMmsMediaTypes","WAWebMmsOperationsConst","WAWebNetworkStatus","WAWebWamEnumOverallLastUploadRetryPhaseType","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["mmsClient.upload: switch to new host"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["mmsClient.upload: attempt #",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["Failed to compute upload offset"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["mmsClient.download: [","] switch to new host"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["mmsClient.download: [","] Content-Length "," bytes"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["mmsClient.download: [","] attempt #",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["mmsClient.download: [","] success"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["mmsClient.download: [","] start"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["mmsClient.upload: success"]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["mmsClient.upload: start"]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["mmsClient.checkIfUploadExists: success"]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["mmsClient.checkIfUploadExists: attempt #",""]);t=function(){return a};return a}function u(){var a=babelHelpers.taggedTemplateLiteralLoose(["mmsClient.checkIfUploadExists: start"]);u=function(){return a};return a}function v(){var a=babelHelpers.taggedTemplateLiteralLoose(["runMmsTaskWithBackoff: attempt #",""]);v=function(){return a};return a}function w(){var a=babelHelpers.taggedTemplateLiteralLoose(["runTaskWithBackoff: start"]);w=function(){return a};return a}function x(){var a=babelHelpers.taggedTemplateLiteralLoose(["runMmsTaskWithBackoff: attempt #",""]);x=function(){return a};return a}function y(){var a=babelHelpers.taggedTemplateLiteralLoose(["runTaskWithBackoff: start"]);y=function(){return a};return a}function a(a){return z.apply(this,arguments)}function z(){z=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=a.encFilehash,f=a.signal,g=a.type,h=a.mediaId,i=a.generateThumbnailOnServer,j=!1,k={encFilehash:a.encFilehash,type:a.type};d("WALogger").LOG(u()).devConsole(k);try{var l=null,m=(yield d("WAExponentialBackoff").exponentialBackoff(babelHelpers["extends"]({},c("WAWebMmsClientMmsBackoffOptions"),{signal:f}),function(){var m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b,m){d("WALogger").LOG(t(),m+1).devConsole(k);yield c("WAWebNetworkStatus").waitIfOffline();try{var n=(yield d("WAWebMediaHosts").mediaHosts.getHostsInfo({operation:c("WAWebMmsOperationsConst").UPLOAD,encFilehash:e,type:g,signal:f})),o=n.auth,p=n.selectedHost;n=n.fallbackHost;p=c("WAWebMmsClientSelectHost")({selectedHost:p,fallbackHost:n,lastHostUsed:l,attemptCount:m,lastFetchMadeProgress:j});l=p;return yield c("WAWebMmsClientMmsCheckIfUploadExists")({auth:o,encFilehash:e,hostname:p.hostname,type:g,signal:f,onProgress:function(){j=!0},mediaId:h,token:a.token,generateThumbnailOnServer:i})}catch(a){if(d("WAWebMmsClientIsErrorRetryable").isErrorRetryable(a))return b(a);throw a}});return function(a,b){return m.apply(this,arguments)}}()));d("WALogger").LOG(s()).devConsole(k);return m}catch(a){d("WAWebMmsClientMmsLogError").mmsLogError("mmsClient.checkIfUploadExists",a,k);throw a}});return z.apply(this,arguments)}function e(a){return A.apply(this,arguments)}function A(){A=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.encFilehash,e=a.type,f=a.onUploadAttemptSuccess;b={encFilehash:b,type:e};d("WALogger").LOG(r()).devConsole(b);try{if(d("WAWebMmsClientUploadStreamer").shouldUseStreamingUpload(a.ciphertextHmac.byteLength,a.type)){e=a.ciphertextHmac;var g=babelHelpers.objectWithoutPropertiesLoose(a,["ciphertextHmac"]);g=new(d("WAWebMmsClientUploadStreamer").UploadStreamer)(g);return yield g.uploadCompleteFile({ciphertextHmac:e})}g=(yield L(a));e=g.response;a=g.retryStartTime;f(Date.now()-a);d("WALogger").LOG(q()).devConsole(b);return c("WANullthrows")(e)}catch(a){d("WAWebMmsClientMmsLogError").mmsLogError("mmsClient.upload",a,b,!1);throw a}});return A.apply(this,arguments)}function f(a){return B.apply(this,arguments)}function B(){B=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.directPath,c=a.filehash,e=a.type,f=a.debugString,g=a.staticUrl,h=a.onDownloadAttemptSuccess;b={directPath:b,filehash:c,type:e,staticUrl:g};d("WALogger").LOG(p(),f).devConsole(b);try{c=(yield H(a));e=c.response;g=c.retryStartTime;h(Date.now()-g);d("WALogger").LOG(o(),f).devConsole(b);return e}catch(a){d("WAWebMmsClientMmsLogError").mmsLogError("mmsClient.download",a,b);throw a}});return B.apply(this,arguments)}function C(a){return E(function(b){return d("WAWebMmsClientMmsDownload").mmsCheckExistence(babelHelpers["extends"]({},a,{hostname:b}))},a)}function D(a){return E(function(b){return d("WAWebMmsClientMmsDownload").mmsGetEncryptedMediaSize(babelHelpers["extends"]({},a,{hostname:b}))},a)}function E(a,e){var f=e.directPath,g=e.encFilehash,h=e.type,i=e.signal,j={directPath:f,type:h};d("WALogger").LOG(y()).devConsole(j);return d("WAExponentialBackoff").exponentialBackoff(babelHelpers["extends"]({},c("WAWebMmsClientMmsBackoffOptions"),{signal:i}),function(){var e=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b,e){d("WALogger").LOG(x(),e+1).devConsole(j);try{e=(yield F({operation:c("WAWebMmsOperationsConst").DOWNLOAD,directPath:f,encFilehash:g,type:h,signal:i,failCount:e}));e=(yield a(e));return e}catch(a){if(d("WAWebMmsClientIsErrorRetryable").isErrorRetryable(a))return b(a);throw a}});return function(a,b){return e.apply(this,arguments)}}())}function F(a){return G.apply(this,arguments)}function G(){G=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.failCount,c=a.operation,e=a.directPath,f=a.encFilehash,g=a.type;a=a.signal;c=(yield d("WAWebMediaHosts").mediaHosts.getHostsInfo({operation:c,directPath:e,encFilehash:f,type:g,signal:a}));e=c.selectedHost;f=c.fallbackHost;g=b>=2&&f?f:e;return g.hostname});return G.apply(this,arguments)}function H(a){return I.apply(this,arguments)}function I(){I=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=a.debugString,f=a.signal,g=a.directPath,i=a.filehash,j=a.staticUrl,k=a.type,o=a.onDownloadHostFound,p=a.mode,q=a.byteRange,r=a.onDownloadAttemptError,s=a.onData,t=a.onProgress;a=Date.now();var u=!1,v={directPath:g,filehash:i,type:k,staticUrl:j},w=null,x=(yield d("WAExponentialBackoff").exponentialBackoff(babelHelpers["extends"]({},c("WAWebMmsClientMmsBackoffOptions"),{signal:f}),function(){var x=b("asyncToGeneratorRuntime").asyncToGenerator(function*(x,y){a=Date.now();d("WALogger").LOG(n(),e,y+1).devConsole(v);var z=function(a){return d("WAWebMediaHosts").mediaHosts.getHostsInfo({operation:c("WAWebMmsOperationsConst").DOWNLOAD,directPath:g,encFilehash:i,type:k,signal:f,forceRefresh:a})};try{var A=(yield z()),B=A.selectedHost;A=A.fallbackHost;var C=c("WAWebMmsClientSelectHost")({selectedHost:B,fallbackHost:A,attemptCount:y,lastHostUsed:w,lastFetchMadeProgress:u});w=C;o({hostName:C.hostname,hostClass:C["class"],failCount:y});var D=0,E=null,F={selectedHost:B,fallbackHost:A},G=function(a){if(a!=null&&E==null){a=a.get("Content-Length");a=parseInt(a,10);E=Number.isNaN(a)?null:a;d("WALogger").DEV(m(),e,E)}};return yield c("WARetryPromise")(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var m=a.retry;a.failCount;var n=function(a){t==null?void 0:t(a),u=!0,a.lengthComputable&&(D=a.loaded)};D=0;var o=new AbortController();a=o.signal;a=(yield c("WARaceSignal")([f,a],function(a){var c=d("WAWebMmsClientMmsDownload").mms4Download({directPath:g,encFilehash:i,staticUrl:j,hostname:C.hostname,type:k,signal:a,mode:p,byteRange:q,debugString:e,onHeadersReceived:G,onProgress:n,onData:s,downloadBucket:C.selectedBucket}).then(function(a){return{kind:"download-completed",arrayBuffer:a}});a=d("WAWebMmsClientPollMediaHosts").shouldPollDownloadHosts(k,E)?d("WAWebMmsClientPollMediaHosts").pollMediaHosts({connectionBlock:F,getHost:function(){return C},getMediaHosts:function(){return z(!0)},getRemainingBytes:function(){return E!=null?E-D:null},signal:a}).then(function(a){return{kind:"host-changed",host:a}}):null;return(h||(h=b("Promise"))).race([c,a].filter(Boolean))["finally"](function(){return o.abort()})}));if(a.kind==="host-changed"){C=a.host;w=C;d("WALogger").DEV(l(),e).devConsole(C);return m()}return a.arrayBuffer});return function(b){return a.apply(this,arguments)}}())}catch(b){u=!1;B=d("WAWebMmsClientIsErrorRetryable").isErrorRetryable(b);A=!B||y===c("WAWebMmsClientMmsBackoffOptions").retries;A||r({error:b,overallT:Date.now()-a,failCount:y});if(B)return x(b);throw b}});return function(a,b){return x.apply(this,arguments)}}()));return{response:c("WANullthrows")(x),retryStartTime:a}});return I.apply(this,arguments)}function J(a){return K.apply(this,arguments)}function K(){K=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.auth,e=a.encFilehash,f=a.hostname,g=a.type,h=a.signal,i=a.byteLength,j=a.byteOffset,l=a.failCount,m=a.mediaId,n=a.token;a=a.generateThumbnailOnServer;if(j!=null&&l===0)return j;if(!d("WAWebMmsClientPollMediaHosts").shouldPollUploadHosts(g,i))return 0;try{l=(yield c("WAWebMmsClientMmsCheckIfUploadExists")({auth:b,encFilehash:e,hostname:f,type:g,signal:h,mediaId:m,token:n,generateThumbnailOnServer:a}));if(l.complete)return 0;j=l.resume;return j>=i?0:j}catch(a){d("WALogger").ERROR(k()).verbose().devConsole(a).sendLogs("upload-offset-failed");return 0}});return K.apply(this,arguments)}function L(a){return M.apply(this,arguments)}function M(){M=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=a.ciphertextHmac,f=a.encFilehash,g=a.type,k=a.signal,l=a.onUploadHostFound,m=a.onUploadAttemptError,n=a.onProgress,o=a.byteOffset,p=a.mediaId,q=a.generateThumbnailOnServer,r=!1,s=Date.now(),t={encFilehash:f,type:g},u=null,v=(yield d("WAExponentialBackoff").exponentialBackoff(babelHelpers["extends"]({},c("WAWebMmsClientMmsBackoffOptions"),{signal:k}),function(){var v=b("asyncToGeneratorRuntime").asyncToGenerator(function*(v,w){var x=function(a){return d("WAWebMediaHosts").mediaHosts.getHostsInfo({operation:c("WAWebMmsOperationsConst").UPLOAD,encFilehash:f,type:g,signal:k,forceRefresh:a})};s=Date.now();d("WALogger").LOG(j(),w+1).devConsole(t);try{yield c("WAWebNetworkStatus").waitIfOffline();var y=(yield x()),z=y.auth,A=y.selectedHost;y=y.fallbackHost;var B={selectedHost:A,fallbackHost:y},C=c("WAWebMmsClientSelectHost")({selectedHost:A,fallbackHost:y,attemptCount:w,lastHostUsed:u,lastFetchMadeProgress:r});u=C;l({hostName:C.hostname,hostClass:C["class"],failCount:w});return yield c("WARetryPromise")(function(){var j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(j){j=j.retry;var l=(yield J({auth:z,encFilehash:f,byteLength:e.byteLength,hostname:C.hostname,type:g,signal:k,byteOffset:o,failCount:w,mediaId:p,token:a.token,generateThumbnailOnServer:q})),m=new AbortController(),s=m.signal;s=(yield c("WARaceSignal")([k,s],function(i){i=d("WAWebMmsClientPollMediaHosts").shouldPollUploadHosts(g,e.byteLength)?d("WAWebMmsClientPollMediaHosts").pollMediaHosts({connectionBlock:B,getHost:function(){return C},getMediaHosts:function(){return x(!0)},getRemainingBytes:function(){return e.byteLength},signal:i}).then(function(a){return{kind:"host-changed",host:a}}):null;var j=c("WAWebMmsClientMmsUpload")({auth:z,ciphertextHmac:l>0?new Uint8Array(e).subarray(l):e,hostname:C.hostname,encFilehash:f,type:g,signal:k,onProgress:function(a){r=!0,n(a,l)},byteRange:l>0?{start:l,end:e.byteLength}:void 0,mediaId:p,token:a.token,generateThumbnailOnServer:q}).then(function(a){return{kind:"upload-completed",value:a}});return(h||(h=b("Promise"))).race([j,i].filter(Boolean))["finally"](function(){return m.abort()})}));if(s.kind==="host-changed"){C=s.host;u=C;d("WALogger").DEV(i()).devConsole(C);return j()}return s.value});return function(a){return j.apply(this,arguments)}}())}catch(a){r=!1;A=d("WAWebMmsClientIsErrorRetryable").isErrorRetryable(a);y=!A||w===c("WAWebMmsClientMmsBackoffOptions").retries;y||m(a,Date.now()-s,w,d("WAWebWamEnumOverallLastUploadRetryPhaseType").OVERALL_LAST_UPLOAD_RETRY_PHASE_TYPE.UPLOAD);if(A)return v(a);throw a}});return function(a,b){return v.apply(this,arguments)}}()));return{response:v,retryStartTime:s}});return M.apply(this,arguments)}function N(a){var b=a.directPath,e=a.encFilehash,f=a.encHandle,g=a.companionUserSecret;return O(function(a,d){return c("WAWebMmsClientMmsDeleteMdHistorySyncBlob")({directPath:b,hostname:a,encFilehash:e,auth:d,encHandle:f,companionUserSecret:g})},babelHelpers["extends"]({},a,{type:d("WAWebMmsMediaTypes").MEDIA_TYPES.IMAGE,operation:c("WAWebMmsOperationsConst").UPLOAD}))}function O(a,e){var f=e.directPath,g=e.encFilehash,h=e.type,i=e.signal,j=e.operation,k={directPath:f,type:h};d("WALogger").LOG(w()).devConsole(k);return d("WAExponentialBackoff").exponentialBackoff(babelHelpers["extends"]({},c("WAWebMmsClientMmsBackoffOptions"),{signal:i}),function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b,c){d("WALogger").LOG(v(),c+1).devConsole(k);try{c=(yield P({operation:j,directPath:f,encFilehash:g,type:h,signal:i,failCount:c}));var e=c.hostname;c=c.auth;e=(yield a(e,c));return e}catch(a){if(d("WAWebMmsClientIsErrorRetryable").isErrorRetryable(a))return b(a);throw a}});return function(a,b){return c.apply(this,arguments)}}())}function P(a){return Q.apply(this,arguments)}function Q(){Q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.failCount,c=a.operation,e=a.directPath,f=a.encFilehash,g=a.type;a=a.signal;c=(yield d("WAWebMediaHosts").mediaHosts.getHostsInfo({operation:c,directPath:e,encFilehash:f,type:g,signal:a}));e=c.selectedHost;f=c.fallbackHost;g=c.auth;a=b>=2&&f?f:e;return{hostname:a.hostname,auth:g}});return Q.apply(this,arguments)}f={download:f,upload:e,checkExistence:C,getEncryptedMediaSize:D,checkIfUploadExists:a,deleteMdHistorySyncBlob:N};e=f;g["default"]=e}),98); __d("WAWebNonMessageDataRequestLoggingUtils",["WALogger","WATimeUtils","WAWebNonMessagePeerDataMediaUploadWamEvent","WAWebNonMessagePeerDataOperationResponseWamEvent","WAWebNonMessagePeerDataRequestWamEvent","WAWebProtobufsE2E.pb","WAWebWamEnumPeerDataRequestType","WAWebWebcLinkPreviewResponseHandleWamEvent","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["link preview: session id: ",", is success: ",", durationMs: ",""]);h=function(){return a};return a}var i=new Map();function a(a,b,c){var e=void 0,f=d("WATimeUtils").unixTimeMs();if(a!=null){var g=i.get(a);g!=null&&(e=f-g)}d("WALogger").LOG(h(),a,b,e);new(d("WAWebWebcLinkPreviewResponseHandleWamEvent").WebcLinkPreviewResponseHandleWamEvent)({previewSessionId:a,isPreviewSuccess:b,previewDurationMs:(f=e)!=null?f:void 0,didRespondHqPreview:c}).commit();a!=null&&i["delete"](a)}function b(a,b){var c=k(a);new(d("WAWebNonMessagePeerDataRequestWamEvent").NonMessagePeerDataRequestWamEvent)({peerDataRequestCount:j(a,b),peerDataRequestType:c,peerDataRequestSessionId:b.id.id}).commit()}function j(a,b){switch(a){case d("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.SEND_RECENT_STICKER_BOOTSTRAP:return 1;case d("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.WAFFLE_LINKING_NONCE_FETCH:return 1;case d("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.FULL_HISTORY_SYNC_ON_DEMAND:return 1;case d("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.UPLOAD_STICKER:a=(a=b.peerDataOperationRequestMessage)==null?void 0:a.requestStickerReupload;return(a=a==null?void 0:a.length)!=null?a:0;case d("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.GENERATE_LINK_PREVIEW:a=(a=b.peerDataOperationRequestMessage)==null?void 0:a.requestStickerReupload;return(a=a==null?void 0:a.length)!=null?a:0;case d("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.HISTORY_SYNC_ON_DEMAND:return 1;case d("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.PLACEHOLDER_MESSAGE_RESEND:b=(a=b.peerDataOperationRequestMessage)==null?void 0:a.placeholderMessageResendRequest;return(a=b==null?void 0:b.length)!=null?a:0;case d("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.COMPANION_META_NONCE_FETCH:return 1;case d("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.COMPANION_SYNCD_SNAPSHOT_FATAL_RECOVERY:return 1}}function k(a){switch(a){case d("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.UPLOAD_STICKER:return d("WAWebWamEnumPeerDataRequestType").PEER_DATA_REQUEST_TYPE.UPLOAD_STICKER;case d("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.SEND_RECENT_STICKER_BOOTSTRAP:return d("WAWebWamEnumPeerDataRequestType").PEER_DATA_REQUEST_TYPE.SEND_RECENT_STICKER_BOOTSTRAP;case d("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.GENERATE_LINK_PREVIEW:return d("WAWebWamEnumPeerDataRequestType").PEER_DATA_REQUEST_TYPE.GENERAL_LINK_PREVIEW;case d("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.HISTORY_SYNC_ON_DEMAND:return d("WAWebWamEnumPeerDataRequestType").PEER_DATA_REQUEST_TYPE.HISTORY_SYNC_ON_DEMAND;case d("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.PLACEHOLDER_MESSAGE_RESEND:return d("WAWebWamEnumPeerDataRequestType").PEER_DATA_REQUEST_TYPE.PLACEHOLDER_MESSAGE_RESEND;case d("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.WAFFLE_LINKING_NONCE_FETCH:return d("WAWebWamEnumPeerDataRequestType").PEER_DATA_REQUEST_TYPE.WAFFLE_LINKING_NONCE_FETCH;case d("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.FULL_HISTORY_SYNC_ON_DEMAND:throw c("err")("full history sync on demand is not supported in web");case d("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.COMPANION_META_NONCE_FETCH:throw c("err")("companion meta nonce fetch is not supported in web");case d("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.COMPANION_SYNCD_SNAPSHOT_FATAL_RECOVERY:throw c("err")("companion syncd snapshot fatal recovery is not supported in web")}}function e(a,b,c,e,f,g,h){a=k(a);new(d("WAWebNonMessagePeerDataOperationResponseWamEvent").NonMessagePeerDataOperationResponseWamEvent)({peerDataResponseCount:c,peerDataSuccessResponseCount:e,peerDataSuccessProcessCount:f,peerDataErrorCount:g,peerDataNotFoundCount:h,peerDataRequestType:a,peerDataRequestSessionId:b}).commit()}function f(a,b,c,e,f,g,h){if(a!==d("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.UPLOAD_STICKER)return;a=k(a);new(d("WAWebNonMessagePeerDataMediaUploadWamEvent").NonMessagePeerDataMediaUploadWamEvent)({peerDataRequestCount:c,peerDataSuccessUploadCount:e,peerDataExistingDataNoUploadCount:f,peerDataErrorCount:g,peerDataNotFoundCount:h,peerDataRequestType:a,peerDataRequestSessionId:b}).commit()}function l(a,b){new(d("WAWebNonMessagePeerDataOperationResponseWamEvent").NonMessagePeerDataOperationResponseWamEvent)({peerDataRequestType:d("WAWebWamEnumPeerDataRequestType").PEER_DATA_REQUEST_TYPE.HISTORY_SYNC_ON_DEMAND,peerDataResponseApplyResult:a,peerDataRequestSessionId:b}).commit()}function m(a,b,c,e,f,g){a=k(a);new(d("WAWebNonMessagePeerDataOperationResponseWamEvent").NonMessagePeerDataOperationResponseWamEvent)({peerDataResponseCount:e,peerDataSuccessResponseCount:f,peerDataErrorCount:g,peerDataResponseApplyResult:c,peerDataRequestType:a,peerDataRequestSessionId:b}).commit()}g.sendTimes=i;g.logLinkPreviewResponse=a;g.logNonMessagePeerDataRequest=b;g.logNonMessagePeerDataResponse=e;g.logMediaUpload=f;g.logHistorySyncOnDemandResponse=l;g.logPlaceholderMessageResendResponse=m}),98); __d("WAWebSendHistSyncServerErrorReceiptJob",["WABase64","WADeprecatedSendIq","WAWap","WAWebCommsAckParser","WAWebCommsWapMd","WAWebCryptoMediaRetry","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b,c){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){var e;c=d("WABase64").decodeB64(c);c=(yield d("WAWebCryptoMediaRetry").encryptServerErrorReceipt(c,b));var f=c.ciphertext;c=c.iv;f=(e=d("WAWap")).wap("receipt",{type:"server-error",to:d("WAWebCommsWapMd").USER_JID(a),id:e.CUSTOM_STRING(b),category:"peer"},e.wap("encrypt",null,e.wap("enc_p",null,f),e.wap("enc_iv",null,c)));return d("WADeprecatedSendIq").deprecatedSendStanzaAndWaitForAck(f,d("WAWebCommsAckParser").toCoreAckTemplate({id:b,"class":"receipt",type:"server-error",from:a,participant:null}))});return h.apply(this,arguments)}g["default"]=a}),98); __d("WAWebHandleHistorySyncChunk",["Promise","WAAsyncSleep","WABinary","WAGzip","WALogger","WALongInt","WATimeUtils","WAWebAddonProcessMsgsUtils","WAWebApiChat","WAWebApiHistorySyncNotification","WAWebChatConstants","WAWebCmd","WAWebCurrentUser","WAWebDBCreateLidPnMappings","WAWebDBMessageUtils","WAWebDownloadManager","WAWebHandleHistorySyncMsg","WAWebHistoryMsgHandlerAction","WAWebHistorySyncNotificationUtils","WAWebHistorySyncProgress","WAWebHistorySyncWorkerCompatibleNotificationUtils","WAWebHttpErrors","WAWebMessageAssociation.flow","WAWebMessageAssociationGatingUtils","WAWebMmsClient","WAWebMsgKey","WAWebNetworkStatus","WAWebNonMessageDataRequestHistorySyncOnDemandUtils","WAWebNonMessageDataRequestLoggingUtils","WAWebProtobufsE2E.pb","WAWebProtobufsHistorySync.pb","WAWebSchemaMessage","WAWebSendHistSyncServerErrorReceiptJob","WAWebSendReceiptJobCommon","WAWebSetUsernameJob","WAWebSyncGatingUtils","WAWebUpdateLidMetadataApi","WAWebUserPrefsAppStateSync","WAWebUserPrefsHistorySync","WAWebUserPrefsIndexedDBStorage","WAWebUserPrefsTypes","WAWebUsernameGatingUtils","WAWebWamEnumMdBootstrapStepResult","WAWebWamEnumPeerDataResponseApplyResultType","WAWebWidFactory","asyncToGeneratorRuntime","decodeProtobuf","gkx"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] On demand history sync complete for chat ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] set history initial sync boundary to empty"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Full history sync complete"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Recent history sync complete"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Initial bootstrap history sync complete"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["MMS client delete error"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] storing recent/full/on-demand chunk complete, ",""]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] no messages from history sync need to handle"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Dropping memu onboarding message"]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Dropping request welcome message"]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Dropping chat "," due to the chat in sync payload "," is already marked as complete locally"]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Dropping chat ","$ due to chat is not enabled for sync"]);t=function(){return a};return a}function u(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] dropping chat "," due to null entry in initial sync boundary, but it exists as chatJid ",""]);u=function(){return a};return a}function v(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Dropping chat ","$ due to null entry in initial sync boundary"]);v=function(){return a};return a}function w(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] boundary data is null or empty"]);w=function(){return a};return a}function x(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] start processing non initial status messages"]);x=function(){return a};return a}function y(){var a=babelHelpers.taggedTemplateLiteralLoose(['[history sync] handleHistorySyncChunk: failed to create wid from "','": ',""]);y=function(){return a};return a}function z(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] chunk downloaded, ",""]);z=function(){return a};return a}function A(){var a=babelHelpers.taggedTemplateLiteralLoose(["completed learning lid mappings for history sync. count: ",". ","..."]);A=function(){return a};return a}function B(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][rdu] history sync on demand chunk fails to download."]);B=function(){return a};return a}function C(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Initial sync download failed due to network error retry download"]);C=function(){return a};return a}function D(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] history sync download failed"]);D=function(){return a};return a}function E(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] start downloading chunk, ",""]);E=function(){return a};return a}function F(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] get inline payload in chunk, ",""]);F=function(){return a};return a}function G(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] history_sync_notification_handler: sending Status receipt failed"]);G=function(){return a};return a}function H(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Skip duplicate initial sync chunk ",""]);H=function(){return a};return a}function I(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] handleHistorySyncChunk started for ",""]);I=function(){return a};return a}function J(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][rdu] dropping history sync on demand response as its conversation length "," is not 1."]);J=function(){return a};return a}var aa=10,ba=100;function ca(a,b){return K.apply(this,arguments)}function K(){K=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){e===void 0&&(e=aa);d("WALogger").LOG(I(),d("WAWebHistorySyncNotificationUtils").getHistorySyncLogDetailsString(a)).tags("history-sync");if(a.syncType===d("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.INITIAL_BOOTSTRAP){var f=(yield d("WAWebUserPrefsHistorySync").getInitialHistorySyncComplete());if(f===!0){d("WALogger").LOG(H(),d("WAWebHistorySyncNotificationUtils").getHistorySyncLogDetailsString(a)).tags("history-sync");return}}if(a.syncType===d("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.INITIAL_STATUS_V3)try{f=c("WAWebMsgKey").fromString(a.msgKey);void d("WAWebSendReceiptJobCommon").sendAggregateReceipts({to:f.remote,type:d("WAWebSendReceiptJobCommon").RECEIPT_TYPE.HISTORY_SYNC_COMPLETION,groupedReceipt:new Map().set(f.remote,[f.id])})}catch(a){d("WALogger").WARN(G()).tags("history-sync").devConsole(a)}f=(yield d("WAWebHistorySyncNotificationUtils").getHistorySyncProgress(a));var g=d("WAWebHistorySyncNotificationUtils").maybeGetInlinePayload(a),i=(yield d("WAWebHistorySyncNotificationUtils").getHistorySyncMetrics(a,g==null)),j=i.historySyncStartDownloadingMetric,k=i.historySyncDownloadedMetric;i=i.historySyncDataAppliedMetric;void d("WAWebUserPrefsHistorySync").setRecentSyncSingleChunkStatus(a.syncType,d("WAWebUserPrefsTypes").HistorySyncSingleChunkStatusType.DOWNLOADING,a.chunkOrder);d("WAWebHistorySyncNotificationUtils").commitHistoryStartDownloadingMetric(j,a.historySyncStepStartedTs,d("WATimeUtils").unixTimeMs());j=null;if(g!=null)d("WALogger").LOG(F(),d("WAWebHistorySyncNotificationUtils").getHistorySyncLogDetailsString(a)).tags("history-sync"),j=g;else try{d("WALogger").LOG(E(),d("WAWebHistorySyncNotificationUtils").getHistorySyncLogDetailsString(a)).tags("history-sync"),j=(yield d("WAWebDownloadManager").downloadManager.downloadAndMaybeDecrypt(babelHelpers["extends"]({signal:new AbortController().signal},a.downloadOptions)))}catch(b){d("WALogger").WARN(D()).devConsole(b);if(b instanceof d("WAWebHttpErrors").HttpNetworkError){if(a.syncType===d("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.INITIAL_BOOTSTRAP&&e>0){yield c("WAWebNetworkStatus").waitIfOffline();d("WALogger").WARN(C()).tags("history-sync");g=e-1;return ca(a,g)}d("WAWebApiHistorySyncNotification").removeLocalFailureFromInFlightChunk(a.msgKey);return}e=c("WAWebMsgKey").fromString(a.msgKey);d("WAWebHistorySyncNotificationUtils").commitHistoryDownloadedMetric(k,a.historySyncStepStartedTs,!1,d("WATimeUtils").unixTimeMs());if(a.syncType===d("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.ON_DEMAND){d("WALogger").LOG(B());d("WAWebNonMessageDataRequestHistorySyncOnDemandUtils").handleHistorySyncOnDemandFailure((g=a.peerDataRequestChatId)!=null?g:"");d("WAWebNonMessageDataRequestLoggingUtils").logHistorySyncOnDemandResponse(d("WAWebWamEnumPeerDataResponseApplyResultType").PEER_DATA_RESPONSE_APPLY_RESULT_TYPE.FAIL_TO_DOWNLOAD,(g=a.peerDataRequestSessionId)!=null?g:"")}c("WAWebSendHistSyncServerErrorReceiptJob")(e.remote,e.id,a.downloadOptions.mediaKey);yield d("WAWebApiHistorySyncNotification").markChunkForReuploadPending(a.msgKey);return}void d("WAWebUserPrefsHistorySync").setRecentSyncSingleChunkStatus(a.syncType,d("WAWebUserPrefsTypes").HistorySyncSingleChunkStatusType.DOWNLOADED,a.chunkOrder);a.downloadOptions.mediaKey="";k.mdBootstrapStepResult=d("WAWebWamEnumMdBootstrapStepResult").MD_BOOTSTRAP_STEP_RESULT.SUCCESS;g=new(d("WABinary").Binary)(j);e=(yield d("WAGzip").inflate(g.readByteArray()));j=d("decodeProtobuf").decodeProtobuf(d("WAWebProtobufsHistorySync.pb").HistorySyncSpec,e);var l=[];j.phoneNumberToLidMappings.forEach(function(a){var b=a.lidJid;a=a.pnJid;b!=null&&a!=null&&l.push({lid:d("WAWebWidFactory").toUserLidOrThrow(d("WAWebWidFactory").createUserWid(b)),pn:d("WAWebWidFactory").createUserWid(a)})});yield d("WAWebDBCreateLidPnMappings").createLidPnMappingsInBatches({mappings:l,flushImmediately:!0,learningSource:"other"});g=d("WAWebHistorySyncNotificationUtils").getLidMappingAsStringSet(l);d("WAWebCurrentUser").isEmployee()&&d("WALogger").LOG(A(),g==null?void 0:g.size,d("WAWebHistorySyncNotificationUtils").getLidsForLogging(g)).verbose();e=new Map();void d("WAWebUserPrefsHistorySync").setRecentSyncSingleChunkStatus(a.syncType,d("WAWebUserPrefsTypes").HistorySyncSingleChunkStatusType.DECODED,a.chunkOrder);d("WALogger").LOG(z(),d("WAWebHistorySyncNotificationUtils").getHistorySyncLogDetailsString(a,void 0,j.conversations.length));var m=d("WATimeUtils").unixTimeMs();a.syncType===d("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.RECENT&&a.chunkOrder!=null&&d("WAWebHistorySyncProgress").updateHistorySyncProgressModel();a.syncType===d("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.INITIAL_STATUS_V3&&j.statusV3Messages&&j.statusV3Messages.length>0?yield d("WAWebHistoryMsgHandlerAction").handleStatusMessages(j,a,k,i,m):a.syncType===d("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.NON_BLOCKING_DATA?yield d("WAWebHistoryMsgHandlerAction").handleNonBlockingData(j,a,k,i,m):a.syncType!==d("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.PUSH_NAME&&(j.conversations=j.conversations.reduce(function(a,b){var c=null;try{c=d("WAWebWidFactory").createWid(b.id)}catch(a){d("WALogger").WARN(y(),b.id,a).tags("history-sync")}return c?a.concat(b):a},[]));var J=[],K=[],L=[];if(a.syncType===d("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.INITIAL_BOOTSTRAP)yield d("WAWebHistoryMsgHandlerAction").handleInitialSyncMsgs(j,a,J,k,i,m,L,l);else if(a.syncType===d("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.PUSH_NAME)yield d("WAWebHistoryMsgHandlerAction").handlePushName(j,a,k,i,m);else if(![d("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.INITIAL_STATUS_V3,d("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.NON_BLOCKING_DATA].includes(a.syncType)){d("WALogger").LOG(x());yield new(h||(h=b("Promise")))(function(a){return self.setTimeout(a,0)});if(!da(a,j)){var M=[],N=new Set(),ga=[],O=[],P=new Set(),ha=[],Q=d("WAWebUserPrefsHistorySync").getHistoryInitialSyncBoundary(),R=0,ia=0,ja=!1,ka=d("WAWebSyncGatingUtils").getRecentSyncMessageProcessingBreakIteration(),la=(yield d("WAWebUserPrefsAppStateSync").getAllCriticalDataSynced());(Q==null||Object.keys(Q).length===0)&&d("WALogger").LOG(w());for(var S=0;S<j.conversations.length;S++){var T=!1,U=j.conversations[S],V=Q==null?void 0:Q[U.id];if(V==null){d("WALogger").LOG(v(),c("gkx")("26258")?"-":U.id).tags("history-sync");var W=d("WAWebWidFactory").createWid(U.id).toJid();(Q==null?void 0:Q[W])!=null&&d("WALogger").LOG(u(),c("gkx")("26258")?"-":U.id,c("gkx")("26258")?"-":W).sendLogs("history-sync-unexpected-conversation-drop");T=!0}W=d("WAWebWidFactory").createWid(U.id);W.isNewsletter()&&(d("WALogger").LOG(t(),c("gkx")("26258")?"-":U.id),T=!0);var X=(yield d("WAWebApiChat").getChatRecord(W)),Y=(X==null?void 0:X.endOfHistoryTransferType)===d("WAWebChatConstants").ConversationEndOfHistoryTransferModelPropType.COMPLETE_AND_NO_MORE_MESSAGE_REMAIN_ON_PRIMARY;(!X&&V!=null||X&&X.endOfHistoryTransferType==null||Y)&&(d("WALogger").LOG(s(),c("gkx")("26258")?"-":U.id,d("WAWebHistorySyncNotificationUtils").getHistorySyncLogDetailsString(a)).tags("history-sync"),T=!0);if(!T)for(Y=0;Y<U.messages.length;Y++){R++;T=U.messages[Y];var Z=d("WALongInt").maybeNumberOrThrowIfTooLarge(T.msgOrderId);if(V!=null&&V!==-1&&Z!=null&&Z>=V)continue;Z=(T==null?void 0:(Z=T.message)==null?void 0:(Z=Z.message)==null?void 0:(Z=Z.protocolMessage)==null?void 0:Z.type)===d("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.REQUEST_WELCOME_MESSAGE;if(Z===!0){d("WALogger").LOG(r());continue}Z=(T==null?void 0:(Z=T.message)==null?void 0:(Z=Z.message)==null?void 0:(Z=Z.protocolMessage)==null?void 0:Z.type)===d("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.BOT_MEMU_ONBOARDING_MESSAGE;if(Z){d("WALogger").LOG(q());continue}P.add(U.id);Z=d("WAWebHistorySyncNotificationUtils").parseWebMsgInfoAndReturnNullOnFailure(W,T.message,a,g,e);Z&&Z.id.remote.toString()!==U.id&&P.add(Z.id.remote.toString());if(Y===0&&Z&&X){var $=(yield d("WAWebSchemaMessage").getMessageTable().betweenCount(["internalId"],d("WAWebDBMessageUtils").beginningOfChat(W),d("WAWebDBMessageUtils").endOfChat(W)));$===0&&ha.push(Z)}O=O.concat(d("WAWebAddonProcessMsgsUtils").parseHistorySyncMsg({webMsgInfo:T.message,parsedWebMsgInfo:Z,isFromCag:($=U.isDefaultSubgroup)!=null?$:!1}));Z!=null&&(($=T.message)==null?void 0:(T=$.commentMetadata)==null?void 0:T.commentParentKey)==null&&(N.has(Z.id.toString())&&d("WAWebMessageAssociationGatingUtils").isMessageAssociationInfraEnabled()&&N["delete"](Z==null?void 0:Z.id.toString()),M.push(Z));if(Z!=null&&d("WAWebMessageAssociation.flow").isAssociatedMsg(Z)&&d("WAWebMessageAssociationGatingUtils").isMessageAssociationInfraEnabled()){$=Z.parentMsgKey.toString();N.add($);ga.push(Z)}yield d("WAAsyncSleep").asyncSleepAfterGivenLoopIteration(ia++,la?ka:ba)}else a.syncType===d("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.ON_DEMAND&&(ja=!0)}k.mdBootstrapMessagesCount=R;k.mdBootstrapChatsCount=j.conversations.length;d("WAWebHistorySyncNotificationUtils").commitHistoryDownloadedMetric(k,a.historySyncStepStartedTs,!0,m);void d("WAWebUserPrefsHistorySync").setRecentSyncSingleChunkStatus(a.syncType,d("WAWebUserPrefsTypes").HistorySyncSingleChunkStatusType.MESSAGE_PREPROCESSED,a.chunkOrder);M.length!==0?yield d("WAWebHandleHistorySyncMsg").handleProgressiveHistorySyncMsgs(M,Array.from(P),O,ha,a.syncType,a.chunkOrder,ga,N):d("WALogger").LOG(p());yield d("WAWebUserPrefsHistorySync").setLastHistorySyncedChunk(a.syncType,a.chunkOrder,f);d("WAWebHistorySyncProgress").updateHistorySyncProgressModel();yield d("WAWebApiHistorySyncNotification").updateCurrentlyProcessed(a.msgKey,a.syncType,a.chunkOrder);var ma=new Set();j.conversations.forEach(function(a){var b=d("WAWebWidFactory").createWid(a.id);ma.add(b.toString());var c=(Q==null?void 0:Q[a.id])!=null,e=null;c&&(e=a.endOfHistoryTransferType);if(e!=null)return d("WAWebHistorySyncWorkerCompatibleNotificationUtils").updateEndOfHistorySync(b,e)});ea(a,j,ja);d("WAWebCmd").Cmd.onHistorySyncChunkProcessed(ma);d("WAWebHistorySyncNotificationUtils").commitHistoryDataAppliedMetric(i,a.historySyncStepStartedTs,!0);void d("WAWebUserPrefsHistorySync").setRecentSyncSingleChunkStatus(a.syncType,d("WAWebUserPrefsTypes").HistorySyncSingleChunkStatusType.APPLIED,a.chunkOrder);d("WALogger").LOG(o(),d("WAWebHistorySyncNotificationUtils").getHistorySyncLogDetailsString(a,R,P.size))}}T=c("WAWebMsgKey").fromString(a.msgKey);$=new Map();$.set(T.remote,[T.id]);a.syncType!==d("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.INITIAL_STATUS_V3&&void d("WAWebSendReceiptJobCommon").sendAggregateReceipts({to:T.remote,type:d("WAWebSendReceiptJobCommon").RECEIPT_TYPE.HISTORY_SYNC_COMPLETION,groupedReceipt:$});yield d("WAWebDBCreateLidPnMappings").createLidPnMappingsInBatches({mappings:K,flushImmediately:!0,learningSource:"other"});yield d("WAWebUpdateLidMetadataApi").updateLidMetadata({updates:J});d("WAWebUsernameGatingUtils").usernameDisplayedEnabled()&&(yield d("WAWebSetUsernameJob").setUsernamesJob(L));yield d("WAWebApiHistorySyncNotification").updateCurrentlyProcessed(a.msgKey,a.syncType,a.chunkOrder);a.downloadOptions.encFilehash!=null&&c("WAWebMmsClient").deleteMdHistorySyncBlob({directPath:a.downloadOptions.directPath,encFilehash:a.downloadOptions.encFilehash,signal:new AbortController().signal,encHandle:a.encHandle,companionUserSecret:d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.get("WAWebCompanionMetaNonce")})["catch"](function(a){d("WALogger").WARN(n()).devConsole(a)});Z=j.conversations.length===1?j.conversations[0].id:null;yield fa(a.syncType,j.progress,Z);d("WAWebHistorySyncNotificationUtils").reportMissingMapping(e)});return K.apply(this,arguments)}function da(a,b){if(a.syncType===d("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.ON_DEMAND&&b.conversations.length!==1){d("WALogger").LOG(J(),c("gkx")("26258")?"":b.conversations.length);d("WAWebNonMessageDataRequestHistorySyncOnDemandUtils").handleHistorySyncOnDemandFailure((b=a.peerDataRequestChatId)!=null?b:"");d("WAWebNonMessageDataRequestLoggingUtils").logHistorySyncOnDemandResponse(d("WAWebWamEnumPeerDataResponseApplyResultType").PEER_DATA_RESPONSE_APPLY_RESULT_TYPE.INVALID_RESPONSE,(b=a.peerDataRequestSessionId)!=null?b:"");return!0}return!1}function ea(a,b,c){if(a.syncType===d("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.ON_DEMAND&&b.conversations.length===1){b=b.conversations[0].id;!c?d("WAWebNonMessageDataRequestHistorySyncOnDemandUtils").handleHistorySyncOnDemandSuccess(b):d("WAWebNonMessageDataRequestHistorySyncOnDemandUtils").handleHistorySyncOnDemandFailure(b);d("WAWebNonMessageDataRequestLoggingUtils").logHistorySyncOnDemandResponse(c?d("WAWebWamEnumPeerDataResponseApplyResultType").PEER_DATA_RESPONSE_APPLY_RESULT_TYPE.OTHER_ERROR:d("WAWebWamEnumPeerDataResponseApplyResultType").PEER_DATA_RESPONSE_APPLY_RESULT_TYPE.SUCCESS,(b=a.peerDataRequestSessionId)!=null?b:"")}}function fa(a,b,c){return L.apply(this,arguments)}function L(){L=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e){var f=d("WAWebSyncGatingUtils").isHistorySyncOnDemandEnabled();if(a===d("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.INITIAL_BOOTSTRAP)d("WALogger").LOG(m()).tags("history-sync"),yield d("WAWebUserPrefsHistorySync").setInitialHistorySyncComplete(),yield d("WAWebUserPrefsHistorySync").setHistorySyncStatus({initialCompleted:!0}),d("WAWebCmd").Cmd.onInitialChatHistorySynced();else if(a===d("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.RECENT&&b===100)d("WALogger").LOG(l()).tags("history-sync"),yield d("WAWebUserPrefsHistorySync").setHistorySyncStatus({recentCompleted:!0}),d("WAWebCmd").Cmd.onRecentChatHistorySynced();else if(a===d("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.FULL&&b===100)d("WALogger").LOG(k()).tags("history-sync"),f||(d("WALogger").LOG(j()),void d("WAWebUserPrefsHistorySync").setHistoryInitialSyncBoundary({})),yield d("WAWebUserPrefsHistorySync").setHistorySyncStatus({fullCompleted:!0}),d("WAWebCmd").Cmd.onFullChatHistorySynced();else if(f&&a===d("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.ON_DEMAND&&b===100){d("WALogger").LOG(i(),c("gkx")("26258")?"-":e).tags("history-sync");a="onDemandCompleted_"+((f=e)!=null?f:"");yield d("WAWebUserPrefsHistorySync").setHistorySyncStatus((b={},b[a]=!0,b))}});return L.apply(this,arguments)}g.handleHistorySyncChunk=ca}),98); __d("WAWebDBProcessRecentAndFullHistorySyncMessage",["WALogger","WATimeUtils","WAWebApiChat","WAWebApiFilterAndReplaceMessages","WAWebApiGroupInviteV4Store","WAWebBackendApi","WAWebDBEncryptMultipleMsgs","WAWebDBStoreEncryptedMsgs","WAWebMessageAssociationGatingUtils","WAWebMsgGetters","WAWebMsgType","WAWebProcessMessageAssociationMessages","WAWebRuntimeEnvironmentUtils","WAWebSchemaChat","WAWebSyncGatingUtils","WAWebUserPrefsHistorySync","WAWebUserPrefsTypes","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Error storing MD recent or full sync messages"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] recent or full sync or on demand starts storing encrypted messages, ## isHistory: ",", msgCount: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] recent or full or on demand sync starts encrypting messages, ## isHistory: ",", msgCount: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["filterAndReplaceMessages failed with error ",""]);k=function(){return a};return a}function a(a,b,c,d,e,f,g,h){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e,f,g,l,n,p){e===void 0&&(e=!1);f===void 0&&(f=!1);var q=a,r;if(n.length&&d("WAWebMessageAssociationGatingUtils").isMessageAssociationInfraEnabled()){n=d("WAWebProcessMessageAssociationMessages").classifyAssociatedMsgsFromHistorySyncUsingMissingParentsCache(n,p);if((p=n)==null?void 0:p.validAssociatedMsgs){r=d("WAWebApiFilterAndReplaceMessages").validateMsgFn((p=n)==null?void 0:p.validAssociatedMsgs)}}try{n=(yield d("WAWebApiFilterAndReplaceMessages").filterAndReplaceMessages(a,r));p=n.newMsgs;q=p}catch(a){d("WALogger").ERROR(k(),a).tags("history-sync")}var s=new Map();q.forEach(function(a){a.type===d("WAWebMsgType").MSG_TYPE.GROUPS_V4_INVITE&&d("WAWebApiGroupInviteV4Store").persistGroupInviteV4Msg(a.id.toString(),{id:a.id.toString(),from:a.from.toString(),to:a.to.toString(),groupId:a.inviteGrp,expiration:parseInt(a.inviteCodeExp,10),expired:d("WATimeUtils").unixTime()>=parseInt(a.inviteCodeExp,10)});var b=a.id.remote.toString();if(d("WAWebMsgGetters").getIsImportantMessage(a))if(s.has(b)){var c;(c=s.get(b))==null?void 0:c.push(a)}else s.set(b,[a])});var t=d("WAWebSyncGatingUtils").isRecentSyncWorkerComaptibleHandlingEnabled()||d("WAWebSyncGatingUtils").isRecentSyncChunkDataHandlingInWorkerEnabled();a=t&&d("WAWebRuntimeEnvironmentUtils").isWorker()?yield m(s):yield d("WAWebBackendApi").frontendSendAndReceive("processAndGetUnreadMentionsInfo",{filteredMsgs:q});var u=a.unreadMentionsToAdd,v=a.pendingUnreadMentionsMap;d("WALogger").DEV(j(),f,q.length);n=(yield d("WAWebDBEncryptMultipleMsgs").encryptMultipleDBMsgs(q,e));void d("WAWebUserPrefsHistorySync").setRecentSyncSingleChunkStatus(g,d("WAWebUserPrefsTypes").HistorySyncSingleChunkStatusType.ENCRYPTED,l);d("WALogger").DEV(i(),f,n.length);return d("WAWebDBStoreEncryptedMsgs").storeEncryptedDBMessages(n,c,f).then(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(u.size>0){var a=t&&d("WAWebRuntimeEnvironmentUtils").isWorker()?yield o(u,v):yield d("WAWebBackendApi").frontendSendAndReceive("getChatIdsNeedToBeDeletedFromUnreadMentionInfo",{unreadMentionsToAdd:u,pendingUnreadMentionsMap:v});a.forEach(function(a){u["delete"](a)});u.size>0&&void d("WAWebApiChat").addUnreadMentionChat(u,v)}}))["catch"](function(a){d("WALogger").WARN(h()).devConsole(a)})});return l.apply(this,arguments)}function m(a){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=new Map(),c=new Map(),e=Array.from(a.keys()),f=(yield d("WAWebSchemaChat").getChatTable().bulkGet(e)).reduce(function(a,b){b&&b.id&&a.set(b.id,b);return a},new Map());a.forEach(function(a,d){var e=f.get(d);a.forEach(function(a){var f=0;if(!c.has(d)){var g;f=(g=e==null?void 0:e.unreadMentionCount)!=null?g:0;c.set(d,f)}else{f=(g=c.get(d))!=null?g:0}if(f>0){c.set(d,f-1);g={id:a.id.toString(),timestamp:a.t};if(b.has(d)){(f=b.get(d))==null?void 0:f.push(g)}else b.set(d,[g])}})});return{unreadMentionsToAdd:b,pendingUnreadMentionsMap:c}});return n.apply(this,arguments)}function o(a,b){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=Array.from(a.keys()),e=(yield d("WAWebSchemaChat").getChatTable().bulkGet(c)).reduce(function(a,b){b&&b.id&&a.set(b.id,b);return a},new Map()),f=[];a.forEach(function(a,c){var g,h=e.get(c);g=(g=b.get(c))!=null?g:0;if((h==null?void 0:h.unreadMentionCount)===0){f.push(c);return}(h==null?void 0:h.unreadMentionCount)!=null&&(h==null?void 0:h.unreadMentionCount)>0&&d("WAWebBackendApi").frontendFireAndForget("updateUnreadMentionMetadataByAdding",{chatId:c,newUnreadMentions:a,pendingUnreadMentionCount:g})});return f});return p.apply(this,arguments)}g.storeRecentAndFullHistSyncMessages=a}),98); __d("WAWebHandleHistorySyncMsg",["Promise","WAFilteredCatch","WALogger","WAWebAddonProcessMsgs","WAWebBackendErrors","WAWebCheckUpdateOrphanReactions","WAWebDBProcessRecentAndFullHistorySyncMessage","WAWebNoop","WAWebSyncdOrphan","WAWebWorkerSafeBackendApi","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Error: ",", message: ",", stack: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] starts handling recent/full/on-demand sync progressive history messages"]);j=function(){return a};return a}function a(a,b,c,d,e,f,g,h){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e,f,g,k,l,m,n){d("WALogger").LOG(j());yield (h||(h=b("Promise"))).resolve();return d("WAWebDBProcessRecentAndFullHistorySyncMessage").storeRecentAndFullHistSyncMessages(a,e,!0,!0,k,l,m,n).then(function(){var b=e.map(function(a){return a}),c=a.map(function(a){return a.id.toString()});d("WAWebCheckUpdateOrphanReactions").checkUpdateForOrphanReactions(c);return d("WAWebSyncdOrphan").checkOrphanMutations(c,b)}).then(function(){return(h||(h=b("Promise"))).all(f).then(function(a){var b;return d("WAWebAddonProcessMsgs").processHistoryMsgs((b=[]).concat.apply(b,a))})}).then(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){for(var a of g){if(!a||!a.id||!a.id.remote)return;var b=a.id.remote;if(b.isNewsletter())return;yield d("WAWebWorkerSafeBackendApi").workerSafeSendAndReceive("processLastMsgs",{chatId:b,msgObjs:[a],meta:{add:"last",isHistory:!0},processMessagesOrigin:"historyMsgHandlerAction",chatMsgsCollection:null})}}))["catch"](d("WAFilteredCatch").filteredCatch(d("WAWebBackendErrors").LogoutDrop,c("WAWebNoop")))["catch"](function(a){d("WALogger").ERROR(i(),a.name,a.message,a.stack).devConsole(a).sendLogs("handleProgressiveHistorySyncMsgs: error storing/processing multiple messages")})});return k.apply(this,arguments)}g.handleProgressiveHistorySyncMsgs=a}),98); __d("WAWebHandleWorkerCompatibleRecentSyncChunk",["Promise","WABinary","WAGzip","WALogger","WATimeUtils","WAWebApiHistorySyncNotification","WAWebCmd","WAWebDBCreateLidPnMappings","WAWebDownloadManager","WAWebHandleHistorySyncMsg","WAWebHistorySyncNotificationUtils","WAWebHistorySyncProgress","WAWebHistorySyncWorkerCompatibleNotificationUtils","WAWebHttpErrors","WAWebMmsClient","WAWebMsgKey","WAWebPreprocessHistorySyncProto","WAWebProtobufsHistorySync.pb","WAWebSendHistSyncServerErrorReceiptJob","WAWebSendReceiptJobCommon","WAWebSetUsernameJob","WAWebSyncGatingUtils","WAWebUpdateLidMetadataApi","WAWebUserPrefsHistorySync","WAWebUserPrefsIndexedDBStorage","WAWebUserPrefsTypes","WAWebUsernameGatingUtils","WAWebWidFactory","asyncToGeneratorRuntime","decodeProtobuf"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][recent sync] Recent history sync complete"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["MMS client delete error"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][recent sync] storing recent chunk complete, ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][recent sync] no messages from history sync need to handle"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][recent sync] start processing recent sync messages"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(['[history sync][recent sync] handleWorkerCompatibleRecentSyncChunk: failed to create wid from "','": ',""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][recent sync] chunk decoded, ",""]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][recent sync] learned "," mappings"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][recent sync] chunk downloaded, ",""]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][recent sync] history sync download failed"]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][recent sync] start downloading chunk, ",""]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][recent sync] get downloaded payload in chunk, ",""]);t=function(){return a};return a}function u(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][recent sync] handleHistorySyncChunk started for ",""]);u=function(){return a};return a}function a(a){return v.apply(this,arguments)}function v(){v=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){d("WALogger").LOG(u(),d("WAWebHistorySyncNotificationUtils").getHistorySyncLogDetailsString(a)).tags("history-sync");var e=(yield d("WAWebHistorySyncNotificationUtils").getHistorySyncProgress(a)),f=d("WAWebSyncGatingUtils").isRecentSyncDownloadOptimizationEnabled(),g=f?a.downloadedHistorySyncPayload:null,v=(yield d("WAWebHistorySyncNotificationUtils").getHistorySyncMetrics(a,!0)),w=v.historySyncStartDownloadingMetric,x=v.historySyncDownloadedMetric;v=v.historySyncDataAppliedMetric;var y=null;if(g!=null)d("WALogger").LOG(t(),d("WAWebHistorySyncNotificationUtils").getHistorySyncLogDetailsString(a)).tags("history-sync"),y=g;else{void d("WAWebUserPrefsHistorySync").setRecentSyncSingleChunkStatus(a.syncType,d("WAWebUserPrefsTypes").HistorySyncSingleChunkStatusType.DOWNLOADING,a.chunkOrder);d("WAWebHistorySyncNotificationUtils").commitHistoryStartDownloadingMetric(w,a.historySyncStepStartedTs,d("WATimeUtils").unixTimeMs());try{d("WALogger").LOG(s(),d("WAWebHistorySyncNotificationUtils").getHistorySyncLogDetailsString(a)).tags("history-sync"),y=(yield d("WAWebDownloadManager").downloadManager.downloadAndMaybeDecrypt(babelHelpers["extends"]({signal:new AbortController().signal},a.downloadOptions)))}catch(b){d("WALogger").WARN(r()).devConsole(b);if(b instanceof d("WAWebHttpErrors").HttpNetworkError){d("WAWebApiHistorySyncNotification").removeLocalFailureFromInFlightChunk(a.msgKey);return}g=c("WAWebMsgKey").fromString(a.msgKey);d("WAWebHistorySyncNotificationUtils").commitHistoryDownloadedMetric(x,a.historySyncStepStartedTs,!1,d("WATimeUtils").unixTimeMs());void c("WAWebSendHistSyncServerErrorReceiptJob")(g.remote,g.id,a.downloadOptions.mediaKey);yield d("WAWebApiHistorySyncNotification").markChunkForReuploadPending(a.msgKey);return}void d("WAWebUserPrefsHistorySync").setRecentSyncSingleChunkStatus(a.syncType,d("WAWebUserPrefsTypes").HistorySyncSingleChunkStatusType.DOWNLOADED,a.chunkOrder);a.downloadOptions.mediaKey="";d("WALogger").LOG(q(),d("WAWebHistorySyncNotificationUtils").getHistorySyncLogDetailsString(a))}w=new(d("WABinary").Binary)(y);g=(yield d("WAGzip").inflate(w.readByteArray()));y=d("decodeProtobuf").decodeProtobuf(d("WAWebProtobufsHistorySync.pb").HistorySyncSpec,g);var z=[];y.phoneNumberToLidMappings.forEach(function(a){var b=a.lidJid;a=a.pnJid;b!=null&&a!=null&&z.push({lid:d("WAWebWidFactory").toUserLidOrThrow(d("WAWebWidFactory").createUserWid(b)),pn:d("WAWebWidFactory").createUserWid(a)})});yield d("WAWebDBCreateLidPnMappings").createLidPnMappingsInBatches({mappings:z,flushImmediately:!0,identityChangeHandlingEnabled:!1,learningSource:"other"});d("WALogger").LOG(p(),z.length);void d("WAWebUserPrefsHistorySync").setRecentSyncSingleChunkStatus(a.syncType,d("WAWebUserPrefsTypes").HistorySyncSingleChunkStatusType.DECODED,a.chunkOrder);d("WALogger").LOG(o(),d("WAWebHistorySyncNotificationUtils").getHistorySyncLogDetailsString(a,void 0,y.conversations.length));w=d("WATimeUtils").unixTimeMs();a.chunkOrder!=null&&void d("WAWebHistorySyncProgress").updateHistorySyncProgressModel();y.conversations=y.conversations.reduce(function(a,b){var c=null;try{c=d("WAWebWidFactory").createWid(b.id)}catch(a){d("WALogger").WARN(n(),b.id,a).tags("history-sync")}return c?a.concat(b):a},[]);g=[];var A=[],B=[];d("WALogger").LOG(m());yield new(h||(h=b("Promise")))(function(a){return self.setTimeout(a,0)});var C=(yield d("WAWebPreprocessHistorySyncProto").preprocessHistorySyncProto(y,z)),D=C.recentOrFullSyncMsgs,E=C.chatsWithRecentOrFullSyncMsgs,F=C.unifiedAddons,G=C.lastMsgs,H=C.totalChunkMsgCount,I=C.associatedMsgs;C=C.missingParentsCache;f||(x.mdBootstrapMessagesCount=H,x.mdBootstrapChatsCount=y.conversations.length,d("WAWebHistorySyncNotificationUtils").commitHistoryDownloadedMetric(x,a.historySyncStepStartedTs,!0,w));void d("WAWebUserPrefsHistorySync").setRecentSyncSingleChunkStatus(a.syncType,d("WAWebUserPrefsTypes").HistorySyncSingleChunkStatusType.MESSAGE_PREPROCESSED,a.chunkOrder);D.length!==0?yield d("WAWebHandleHistorySyncMsg").handleProgressiveHistorySyncMsgs(D,Array.from(E),F,G,a.syncType,a.chunkOrder,I,C):d("WALogger").LOG(l());void d("WAWebUserPrefsHistorySync").setHistorySyncTotalProcessedMessageCount(H);yield d("WAWebUserPrefsHistorySync").setLastHistorySyncedChunk(a.syncType,a.chunkOrder,e);void d("WAWebHistorySyncProgress").updateHistorySyncProgressModel();yield d("WAWebApiHistorySyncNotification").updateCurrentlyProcessed(a.msgKey,a.syncType,a.chunkOrder);var J=d("WAWebUserPrefsHistorySync").getHistoryInitialSyncBoundary(),K=new Set();y.conversations.forEach(function(a){var b=d("WAWebWidFactory").createWid(a.id);K.add(b.toString());var c=(J==null?void 0:J[a.id])!=null,e=null;c&&(e=a.endOfHistoryTransferType);if(e!=null)return d("WAWebHistorySyncWorkerCompatibleNotificationUtils").updateEndOfHistorySync(b,e)});d("WAWebCmd").Cmd.onHistorySyncChunkProcessed(K);d("WAWebHistorySyncNotificationUtils").commitHistoryDataAppliedMetric(v,a.historySyncStepStartedTs,!0);void d("WAWebUserPrefsHistorySync").setRecentSyncSingleChunkStatus(a.syncType,d("WAWebUserPrefsTypes").HistorySyncSingleChunkStatusType.APPLIED,a.chunkOrder);d("WALogger").LOG(k(),d("WAWebHistorySyncNotificationUtils").getHistorySyncLogDetailsString(a,H,E.length));f=c("WAWebMsgKey").fromString(a.msgKey);x=new Map();x.set(f.remote,[f.id]);a.syncType!==d("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.INITIAL_STATUS_V3&&void d("WAWebSendReceiptJobCommon").sendAggregateReceipts({to:f.remote,type:d("WAWebSendReceiptJobCommon").RECEIPT_TYPE.HISTORY_SYNC_COMPLETION,groupedReceipt:x});yield d("WAWebDBCreateLidPnMappings").createLidPnMappingsInBatches({mappings:A,flushImmediately:!0,identityChangeHandlingEnabled:!1,learningSource:"other"});yield d("WAWebUpdateLidMetadataApi").updateLidMetadata({updates:g});d("WAWebUsernameGatingUtils").usernameDisplayedEnabled()&&(yield d("WAWebSetUsernameJob").setUsernamesJob(B));yield d("WAWebApiHistorySyncNotification").updateCurrentlyProcessed(a.msgKey,a.syncType,a.chunkOrder);a.downloadOptions.encFilehash!=null&&c("WAWebMmsClient").deleteMdHistorySyncBlob({directPath:a.downloadOptions.directPath,encFilehash:a.downloadOptions.encFilehash,signal:new AbortController().signal,encHandle:a.encHandle,companionUserSecret:d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.get("WAWebCompanionMetaNonce")})["catch"](function(a){d("WALogger").WARN(j()).devConsole(a)});e===100&&(d("WALogger").LOG(i()).tags("history-sync"),yield d("WAWebUserPrefsHistorySync").setHistorySyncStatus({recentCompleted:!0}),d("WAWebCmd").Cmd.onRecentChatHistorySynced())});return v.apply(this,arguments)}g.handleWorkerCompatibleRecentSyncChunk=a}),98); __d("WAWebPreprocessHistorySyncProto",["WAAsyncSleep","WALogger","WALongInt","WAWebAddonProcessMsgsUtils","WAWebApiChat","WAWebChatConstants","WAWebCurrentUser","WAWebDBMessageUtils","WAWebHistorySyncNotificationUtils","WAWebMessageAssociation.flow","WAWebMessageAssociationGatingUtils","WAWebProtobufsE2E.pb","WAWebSchemaMessage","WAWebSyncGatingUtils","WAWebUserPrefsAppStateSync","WAWebUserPrefsHistorySync","WAWebWidFactory","asyncToGeneratorRuntime","gkx"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Dropping memu onboarding message"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][recent sync] Dropping request welcome message"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][recent sync] Dropping chat ","$ due to chat is not enabled for sync"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][recent sync] dropping chat "," due to null entry in initial sync boundary, but it exists as chatJid ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][recent sync] Dropping chat ","$ due to null entry in initial sync boundary"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] boundary data is null or empty"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["first lid mappings for recent sync preprocess: ","..."]);n=function(){return a};return a}var o=100;function a(a,b){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=d("WAWebHistorySyncNotificationUtils").getLidMappingAsStringSet(b);d("WAWebCurrentUser").isEmployee()&&d("WALogger").LOG(n(),d("WAWebHistorySyncNotificationUtils").getLidsForLogging(b)).verbose();var e=new Map(),f=[],g=[],p=new Set(),q=[],r=new Set(),s=[],t=d("WAWebUserPrefsHistorySync").getHistoryInitialSyncBoundary(),u=0,v=0,w=d("WAWebSyncGatingUtils").getRecentSyncMessageProcessingBreakIteration(),x=(yield d("WAWebUserPrefsAppStateSync").getAllCriticalDataSynced());(t==null||Object.keys(t).length===0)&&d("WALogger").LOG(m());for(var y=0;y<a.conversations.length;y++){var z=!1,A=a.conversations[y],B=t==null?void 0:t[A.id];if(B==null){d("WALogger").LOG(l(),c("gkx")("26258")?"-":A.id).tags("history-sync");var C=d("WAWebWidFactory").createWid(A.id).toJid();(t==null?void 0:t[C])!=null&&d("WALogger").LOG(k(),c("gkx")("26258")?"-":A.id,c("gkx")("26258")?"-":C).sendLogs("history-sync-unexpected-conversation-drop");z=!0}C=d("WAWebWidFactory").createWid(A.id);C.isNewsletter()&&(d("WALogger").LOG(j(),c("gkx")("26258")?"-":A.id),z=!0);var D=(yield d("WAWebApiChat").getChatRecord(C)),E=(D==null?void 0:D.endOfHistoryTransferType)===d("WAWebChatConstants").ConversationEndOfHistoryTransferModelPropType.COMPLETE_AND_NO_MORE_MESSAGE_REMAIN_ON_PRIMARY;(!D&&B!=null||D&&D.endOfHistoryTransferType==null||E)&&(z=!0);if(!z)for(E=0;E<A.messages.length;E++){u++;z=A.messages[E];var F=d("WALongInt").maybeNumberOrThrowIfTooLarge(z.msgOrderId);if(B!=null&&B!==-1&&F!=null&&F>=B)continue;F=(z==null?void 0:(F=z.message)==null?void 0:(F=F.message)==null?void 0:(F=F.protocolMessage)==null?void 0:F.type)===d("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.REQUEST_WELCOME_MESSAGE;if(F===!0){d("WALogger").LOG(i());continue}F=(z==null?void 0:(F=z.message)==null?void 0:(F=F.message)==null?void 0:(F=F.protocolMessage)==null?void 0:F.type)===d("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.BOT_MEMU_ONBOARDING_MESSAGE;if(F){d("WALogger").LOG(h());continue}r.add(A.id);F=d("WAWebHistorySyncNotificationUtils").parseWebMsgInfoAndReturnNullOnFailure(C,z.message,void 0,b,e);F&&F.id.remote.toString()!==A.id&&r.add(F.id.remote.toString());if(E===0&&F&&D){var G=(yield d("WAWebSchemaMessage").getMessageTable().betweenCount(["internalId"],d("WAWebDBMessageUtils").beginningOfChat(C),d("WAWebDBMessageUtils").endOfChat(C)));G===0&&s.push(F)}q=q.concat(d("WAWebAddonProcessMsgsUtils").parseHistorySyncMsg({webMsgInfo:z.message,parsedWebMsgInfo:F,isFromCag:(G=A.isDefaultSubgroup)!=null?G:!1}));F!=null&&((G=z.message)==null?void 0:(z=G.commentMetadata)==null?void 0:z.commentParentKey)==null&&(p.has(F.id.toString())&&d("WAWebMessageAssociationGatingUtils").isMessageAssociationInfraEnabled()&&p["delete"](F==null?void 0:F.id.toString()),f.push(F));if(F!=null&&d("WAWebMessageAssociation.flow").isAssociatedMsg(F)&&d("WAWebMessageAssociationGatingUtils").isMessageAssociationInfraEnabled()){G=F.parentMsgKey.toString();p.add(G);g.push(F)}yield d("WAAsyncSleep").asyncSleepAfterGivenLoopIteration(v++,x?w:o)}}d("WAWebHistorySyncNotificationUtils").reportMissingMapping(e);return{recentOrFullSyncMsgs:f,chatsWithRecentOrFullSyncMsgs:Array.from(r),unifiedAddons:q,lastMsgs:s,totalChunkMsgCount:u,associatedMsgs:g,missingParentsCache:p}});return p.apply(this,arguments)}g.preprocessHistorySyncProto=a}),98); __d("WAWebClearDirtyBitsJob",["WADeprecatedSendIq","WADeprecatedWapParser","WALogger","WAWap","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["clearDirtyBits: failed with error"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["clearDirtyBits: success for type: ",""]);i=function(){return a};return a}var j=new(c("WADeprecatedWapParser"))("cleanDirtyReplyParser",function(a){a.assertAttr("type","result");return{}});function a(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a.length===0)return;var b=a.map(function(a){return d("WAWap").wap("clean",{type:d("WAWap").CUSTOM_STRING(a.type),timestamp:d("WAWap").INT(a.timestamp)})});b=d("WAWap").wap("iq",{to:d("WAWap").S_WHATSAPP_NET,type:"set",xmlns:"urn:xmpp:whatsapp:dirty",id:d("WAWap").generateId()},b);try{yield d("WADeprecatedSendIq").deprecatedSendIq(b,j),d("WALogger").LOG(i(),a.map(function(a){return a.type}).join(","))}catch(a){d("WALogger").WARN(h()).devConsole(a)}});return k.apply(this,arguments)}g.clearDirtyBits=a}),98); __d("WAWebHandleDirtyBits",["Promise","WALogger","WASyncdConst","WAWebAccountSyncJob","WAWebApiPendingDeviceSync","WAWebBackendApi","WAWebClearDirtyBitsJob","WAWebCmd","WAWebEventsWaitForOfflineDeliveryEnd","WAWebMdAppStateDirtyBitsWamEvent","WAWebNewsletterGatingUtils","WAWebOfflineDeviceCache","WAWebOfflineHandler","WAWebPDFNTypes","WAWebQueryAndUpdateGroupMetadataJob","WAWebQueryAndUpdateNewslettersMetadataAction","WAWebSyncd","WAWebTos","WAWebUserPrefsMeUser","WAWebWamoNewsletterGatingUtils","WAWebWorkerSafeBackendApi","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleDirtyBits: handle dirty bits, supported: ",", unsupported: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleDeviceDirtyBit: offline resume manager not initialized"]);j=function(){return a};return a}var k={groups:"groups",account_sync:"account_sync",syncd_app_state:"syncd_app_state",newsletter_metadata:"newsletter_metadata"};c={devices:"devices",picture:"picture",privacy:"privacy",blocklist:"blocklist",notice:"notice"};function l(a){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a===void 0&&(a=[]);a=a.map(function(a){return d("WAWebAccountSyncJob").AccountSyncType.cast(a)}).filter(Boolean);a.length===0&&(a=Array.from(d("WAWebAccountSyncJob").AccountSyncType.members()));yield (h||(h=b("Promise"))).all(a.map(function(a){if(a===d("WAWebAccountSyncJob").AccountSyncType.DEVICES)return p();else if(a===d("WAWebAccountSyncJob").AccountSyncType.PICTURE)return d("WAWebAccountSyncJob").getAndUpdateProfilePicture();else a===d("WAWebAccountSyncJob").AccountSyncType.PRIVACY?d("WAWebAccountSyncJob").updatePrivacySettings():a===d("WAWebAccountSyncJob").AccountSyncType.BLOCKLIST?d("WAWebAccountSyncJob").updateBlocklist():a===d("WAWebAccountSyncJob").AccountSyncType.OPTOUTLIST?d("WAWebWorkerSafeBackendApi").workerSafeFireAndForget("updateOptOutList"):a===d("WAWebAccountSyncJob").AccountSyncType.NOTICE&&void q()}))});return m.apply(this,arguments)}function n(a){return a.patches!=null&&a.patches.length>0||a.snapshot!=null}function o(){d("WAWebCmd").Cmd.once(d("WAWebCmd").APP_STATE_SYNC_COMPLETED,function(a){a=a.some(n);new(d("WAWebMdAppStateDirtyBitsWamEvent").MdAppStateDirtyBitsWamEvent)({dirtyBitsFalsePositive:!a}).commit()});return d("WAWebSyncd").markCollectionsForSync(Array.from(d("WASyncdConst").CollectionName.members()))}function p(){if(!d("WAWebOfflineHandler").OfflineMessageHandler.hasInitOfflineResumeManager()){d("WALogger").ERROR(j()).tags("non-sad").sendLogs("handleDeviceDirtyBit: offline resume manager not initialized");return d("WAWebAccountSyncJob").getDevices("notification")}var a=String(d("WAWebUserPrefsMeUser").getMeUser());if(!d("WAWebOfflineHandler").OfflineMessageHandler.isResumeFromRestartComplete()){d("WAWebOfflineDeviceCache").OfflinePendingDeviceCache.addOfflinePendingDevice(a,null);return(h||(h=b("Promise"))).resolve()}else if(d("WAWebOfflineHandler").OfflineMessageHandler.isResumeOnSocketDisconnectInProgress())return d("WAWebApiPendingDeviceSync").addUserToPendingDeviceSync([a]);return d("WAWebAccountSyncJob").getDevices("notification")}function q(){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield d("WAWebTos").TosManager.run();var a=[d("WAWebNewsletterGatingUtils").getNewsletterProducerTos(),d("WAWebNewsletterGatingUtils").getNewsletterConsumerTos(),d("WAWebNewsletterGatingUtils").getNewsletterAdminInviteTos()].concat(d("WAWebWamoNewsletterGatingUtils").getWamoNotices()),b=[];a.map(function(a){a={id:a,accepted:d("WAWebTos").TosManager.getState(a)===d("WAWebPDFNTypes").NOTICE_STATUS.ACCEPTED};b.push(a)});return d("WAWebBackendApi").frontendFireAndForget("updateUserDisclosures",{userDisclosures:b})});return r.apply(this,arguments)}function a(a){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=a.supported,e=a.unsupported,f=a.protocols;d("WALogger").LOG(i(),c.map(function(a){return a.type}).join(","),e.map(function(a){return a.type}).join(","));a=[].concat(e,c);yield (h||(h=b("Promise"))).all(c.map(function(a){a=a.type;if(a===k.groups)return d("WAWebEventsWaitForOfflineDeliveryEnd").waitForOfflineDeliveryEnd().then(function(){return d("WAWebQueryAndUpdateGroupMetadataJob").queryAndUpdateAllGroupMetadata()});else if(a===k.newsletter_metadata)return d("WAWebEventsWaitForOfflineDeliveryEnd").waitForOfflineDeliveryEnd().then(function(){return d("WAWebQueryAndUpdateNewslettersMetadataAction").queryAndUpdateAllNewsletterMetadataAction(d("WAWebQueryAndUpdateNewslettersMetadataAction").NewsletterMetadataUpdateEntryPoint.DirtyBit,{messageCount:1})});else if(a===k.account_sync)return l(f);else if(a===k.syncd_app_state)return o()}));return d("WAWebClearDirtyBitsJob").clearDirtyBits(a)});return s.apply(this,arguments)}g.SUPPORTED_DIRTY_TYPE=k;g.SUPPORTED_DIRTY_PROTOCOLS=c;g.handleDirtyBits=a}),98); __d("WAWebUpdaterHardExpireTime",[],(function(a,b,c,d,e,f){a=document.getElementById("hard_expire_time");c=parseInt(a==null?void 0:(b=a.dataset)==null?void 0:b.time,10);Number.isNaN(c)&&(c=1572566400);d=c;f["default"]=d}),66); __d("WAWebHandleServerClientExpiration",["WATimeUtils","WAWebBuildConstants","WAWebCmd","WAWebUpdaterHardExpireTime","WAWebUserPrefsMultiDevice"],(function(a,b,c,d,e,f,g){function a(a){var b=parseInt(c("WAWebUpdaterHardExpireTime"),10);if(a==null)d("WAWebUserPrefsMultiDevice").clearServerClientExpirationOverride();else{var e;e=(e=d("WAWebUserPrefsMultiDevice").getServerClientExpirationOverride())==null?void 0:e.timestamp;if(e!=null&&a>=e||a>=b)return;e=d("WATimeUtils").futureUnixTime(3*d("WATimeUtils").DAY_SECONDS);e=Math.max(e,Math.min(a,b));d("WAWebUserPrefsMultiDevice").setServerClientExpirationOverride(""+e,d("WAWebBuildConstants").VERSION_BASE);d("WAWebCmd").Cmd.serverUpdatedClientExpiration()}}g.handleServerClientExpiration=a}),98); __d("WAWebParseThreadMetadata",["WAWebHandleInfoBulletinTypes.flow"],(function(a,b,c,d,e,f,g){function a(a){a=a.child(d("WAWebHandleInfoBulletinTypes.flow").INFO_TYPE.THREAD_META);var b={};a.forEachChildWithTag("item",function(a){var c=a.attrChatJid("from");a=a.attrTime("t");b[String(c)]=a});return{chatTimestamp:b}}g.parseThreadMetadata=a}),98); __d("WAWebHandleInfoBulletin",["WADeprecatedWapParser","WALogger","WASmaxClientExpirationClientExpirationRPC","WATimeUtils","WAWebHandleDirtyBits","WAWebHandleInfoBulletinTypes.flow","WAWebHandleRoutingInfo","WAWebHandleServerClientExpiration","WAWebHandleServerSyncNotification","WAWebMessageDedupUtils","WAWebOfflineHandler","WAWebParseThreadMetadata","WAWebThreadMetadata","WAWebTos","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleInfoBulletin unrecognized info bulletin"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Parsing Error: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["error while parsing: ",""]);j=function(){return a};return a}var k=new(c("WADeprecatedWapParser"))("infoBulletinParser",function(a){a.assertTag("ib");a.assertFromServer();if(a.hasChild(d("WAWebHandleInfoBulletinTypes.flow").INFO_TYPE.DIRTY)){var b=[],c=[],e=[];a.forEachChildWithTag(d("WAWebHandleInfoBulletinTypes.flow").INFO_TYPE.DIRTY,function(a){var f={type:a.attrString("type"),timestamp:a.attrInt("timestamp")};if(f.type==="account_sync"){a=a.mapChildren(function(a){return a.tag()});a.forEach(function(a){Object.prototype.hasOwnProperty.call(d("WAWebHandleDirtyBits").SUPPORTED_DIRTY_PROTOCOLS,a)&&e.push(a)});c.push(f)}else Object.prototype.hasOwnProperty.call(d("WAWebHandleDirtyBits").SUPPORTED_DIRTY_TYPE,f.type)?c.push(f):b.push(f)});return{type:d("WAWebHandleInfoBulletinTypes.flow").INFO_TYPE.DIRTY,supported:c,unsupported:b,protocols:e}}else if(a.hasChild(d("WAWebHandleInfoBulletinTypes.flow").INFO_TYPE.ROUTING)){var f=a.child(d("WAWebHandleInfoBulletinTypes.flow").INFO_TYPE.ROUTING);return{type:d("WAWebHandleInfoBulletinTypes.flow").INFO_TYPE.ROUTING,edgeRouting:f.child("routing_info").contentBytes(),domain:f.hasChild("dns_domain")?f.child("dns_domain").contentEnum(d("WAWebHandleRoutingInfo").DOMAINS):null}}else if(a.hasChild(d("WAWebHandleInfoBulletinTypes.flow").INFO_TYPE.OFFLINE))return{count:a.child(d("WAWebHandleInfoBulletinTypes.flow").INFO_TYPE.OFFLINE).attrInt("count"),type:d("WAWebHandleInfoBulletinTypes.flow").INFO_TYPE.OFFLINE};else if(a.hasChild(d("WAWebHandleInfoBulletinTypes.flow").INFO_TYPE.OFFLINE_PRIORITY_COMPLETE))return{type:d("WAWebHandleInfoBulletinTypes.flow").INFO_TYPE.OFFLINE_PRIORITY_COMPLETE};else if(a.hasChild(d("WAWebHandleInfoBulletinTypes.flow").INFO_TYPE.OFFLINE_PREVIEW)){return{count:{count:a.child((f=d("WAWebHandleInfoBulletinTypes.flow")).INFO_TYPE.OFFLINE_PREVIEW).attrInt("count"),message:a.child(f.INFO_TYPE.OFFLINE_PREVIEW).attrInt("message"),receipt:a.child(f.INFO_TYPE.OFFLINE_PREVIEW).attrInt("receipt"),notification:a.child(f.INFO_TYPE.OFFLINE_PREVIEW).attrInt("notification"),call:a.child(f.INFO_TYPE.OFFLINE_PREVIEW).attrInt("call")},type:f.INFO_TYPE.OFFLINE_PREVIEW}}else if(a.hasChild(d("WAWebHandleInfoBulletinTypes.flow").INFO_TYPE.TOS)){var g=[];a.child("tos").forEachChildWithTag("notice",function(a){g.push(a.attrString("id"))});return{type:d("WAWebHandleInfoBulletinTypes.flow").INFO_TYPE.TOS,noticeIds:g}}else if(a.hasChild(d("WAWebHandleInfoBulletinTypes.flow").INFO_TYPE.THREAD_META))return{type:d("WAWebHandleInfoBulletinTypes.flow").INFO_TYPE.THREAD_META,threadMeta:d("WAWebParseThreadMetadata").parseThreadMetadata(a)};else if(a.hasChild(d("WAWebHandleInfoBulletinTypes.flow").INFO_TYPE.CLIENT_EXPIRATION)){f=d("WASmaxClientExpirationClientExpirationRPC").receiveClientExpirationRPC(a.getNode());a=f.parsedRequest.clientExpirationT;f=a!=null?d("WATimeUtils").castToUnixTime(a):null;return{type:d("WAWebHandleInfoBulletinTypes.flow").INFO_TYPE.CLIENT_EXPIRATION,newClientExpirationTime:f}}return null});function a(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=k.parse(a);if(b.error){d("WALogger").DEV(j(),a.toString());d("WALogger").ERROR(i(),b.error.toString());throw b.error}a=b.success;if(!a){d("WALogger").WARN(h());return}switch(a.type){case d("WAWebHandleInfoBulletinTypes.flow").INFO_TYPE.DIRTY:yield d("WAWebHandleDirtyBits").handleDirtyBits(a);return"NO_ACK";case d("WAWebHandleInfoBulletinTypes.flow").INFO_TYPE.ROUTING:yield d("WAWebHandleRoutingInfo").handleRoutingInfo(a);return"NO_ACK";case d("WAWebHandleInfoBulletinTypes.flow").INFO_TYPE.OFFLINE:d("WAWebOfflineHandler").OfflineMessageHandler.processOfflineIb(a.count);d("WAWebHandleServerSyncNotification").reportOfflineNotifications();d("WAWebMessageDedupUtils").maybeClearPendingMessages(a.count);return"NO_ACK";case d("WAWebHandleInfoBulletinTypes.flow").INFO_TYPE.OFFLINE_PREVIEW:yield d("WAWebOfflineHandler").OfflineMessageHandler.processOfflinePreviewIb(a.count);return"NO_ACK";case d("WAWebHandleInfoBulletinTypes.flow").INFO_TYPE.TOS:d("WAWebTos").TosManager.maybeUpdateServer(a.noticeIds);return"NO_ACK";case d("WAWebHandleInfoBulletinTypes.flow").INFO_TYPE.THREAD_META:d("WAWebThreadMetadata").setOfflineThreadMeta(a.threadMeta);return"NO_ACK";case d("WAWebHandleInfoBulletinTypes.flow").INFO_TYPE.CLIENT_EXPIRATION:d("WAWebHandleServerClientExpiration").handleServerClientExpiration(a.newClientExpirationTime);return"NO_ACK";default:return}});return l.apply(this,arguments)}g["default"]=a}),98); __d("WAWebHandleBrigadingUpdateNotification",["WALogger","WAWebCmd","WAWebUserPrefsGeneral","WAWebUserPrefsIndexedDBStorage","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){"use strict";function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["setWABrigadingState: failed to set to indexedDB, state: ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[mex][notification][handleBrigadingNotification] unhandled state: ",""]);i=function(){return a};return a}function a(a,b){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=(a=b.xwa2_notify_brigading)==null?void 0:a.state;if(b==null)throw c("err")("[mex][notification][handleBrigadingNotification] state is null");try{switch(b){case"ENFORCED":case"NOT_ENFORCED":case"DETECTED":yield d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.set("WABrigadingState",b);d("WAWebCmd").Cmd.onBrigadingStateChange(b);break;case"NOT_DETECTED":yield d("WAWebUserPrefsGeneral").clearBrigadingstate();d("WAWebCmd").Cmd.onBrigadingStateChange(null);break;default:d("WALogger").WARN(i(),b)}}catch(a){d("WALogger").ERROR(h(),b).devConsole(a).sendLogs("setWABrigadingState-failed")}});return j.apply(this,arguments)}g.mexHandleBrigadingNotification=a}),98); __d("WAWebMexCommunityOwnerUpdateNotificationHandler",["WALogger","WATimeUtils","WAWebGroupType","WAWebHandleGroupNotification","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[mex][community][notification][owner-update] Failed to update community owner"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[mex][community][notification][owner-update] Community owner notification received with invalid role ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[mex][community][notification][owner-update] Failed to process xwa2_notify_group_on_participants_roles_change notification, null ",""]);j=function(){return a};return a}function k(a){d("WALogger").ERROR(j(),a).tags("mex").sendLogs("mex-communitynotification-owner-update-fail")}function l(a){if(a!=null&&a.id!=null){var b=a.id,c=a.notify_name;a=a.pn;return{authorWid:d("WAWebWidFactory").createWid(b),notifyName:c,authorPhoneNumber:a!=null?d("WAWebWidFactory").createWid(a):null}}return{authorWid:null,notifyName:null,authorPhoneNumber:null}}function a(a,b){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=b.xwa2_notify_group_on_participants_roles_change;var c=b.id,e=b.update_time,f=b.updated_by;b=b.role_updates;if(c==null){k("id");return}if(e==null){k("update_time");return}f=l(f);var g=f.authorWid,j=f.notifyName;f=f.authorPhoneNumber;b=b[0];var m=b.user_jid;b=b.new_role;c=d("WAWebWidFactory").createWid(c);m=d("WAWebWidFactory").createWid(m);if(b!=="SUPERADMIN_MEMBER"){d("WALogger").ERROR(i(),b).tags("mex").sendLogs("mex-communitynotification-owner-update-fail");return}b={actionType:d("WAWebGroupType").GROUP_ACTIONS.COMMUNITY_OWNER_UPDATE,oldOwner:g,newOwner:m};m={chatId:c,ts:d("WATimeUtils").castMilliSecondsToUnixTime(Number(e)),actions:[b],author:g,authorPhoneNumber:f,isLidAddressingMode:null,pushname:j,externalId:a.stanzaId,offline:a.offline};try{yield d("WAWebHandleGroupNotification").handleParsedGroupNotification(m)}catch(a){d("WALogger").ERROR(h()).tags("mex").devConsole(a).sendLogs("mex-communitynotification-owner-update-fail")}});return m.apply(this,arguments)}g.mexHandleCommunityOwnerUpdate=a}),98); __d("WAWebMexGroupPropertyUpdateNotificationHandler",["WALogger","WATimeUtils","WAWebGroupType","WAWebHandleGroupNotification","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[mex][group-property-update][notification] Failed to update group property"]);h=function(){return a};return a}function a(a,b){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c;b=b.xwa2_notify_group_on_prop_change;var e=b.id,f=b.lid_migration_state,g=b.update_time,i=b.updated_by,j=i.id,k=i.pn;i=i.notify_name;b=b.properties;var l;switch(a.OperationName){case"NotificationGroupPropertyUpdate":b.allow_non_admin_sub_group_creation!=null&&(l={actionType:d("WAWebGroupType").GROUP_ACTIONS.ALLOW_NON_ADMIN_SUB_GROUP_CREATION,value:b.allow_non_admin_sub_group_creation});break;case"NotificationGroupHiddenPropertyUpdate":l={actionType:d("WAWebGroupType").GROUP_ACTIONS.HIDDEN_GROUP,value:(c=b.hidden_group)!=null?c:!1};break;case"NotificationGroupSafetyCheckPropertyUpdate":l={actionType:d("WAWebGroupType").GROUP_ACTIONS.GROUP_SAFETY_CHECK,value:(c=b.group_safety_check)!=null?c:!1};break}if(l==null)return;b={chatId:d("WAWebWidFactory").createWid(e),ts:d("WATimeUtils").castMilliSecondsToUnixTime(Number(g)),actions:[l],author:j!=null?d("WAWebWidFactory").createWid(j):null,authorPhoneNumber:k!=null?d("WAWebWidFactory").createWid(k):null,isLidAddressingMode:(f==null?void 0:f.addressing_mode)==="LID",pushname:i,externalId:a.stanzaId,offline:a.offline};try{yield d("WAWebHandleGroupNotification").handleParsedGroupNotification(b)}catch(a){d("WALogger").ERROR(h()).tags("mex").devConsole(a).sendLogs("mex-group-property-update-notification-fail")}});return i.apply(this,arguments)}g.mexHandleGroupPropertyUpdate=a}),98); __d("WAWebMexLimitSharingUpdateHandler",["WAWebLimitSharingModelUtils","WAWebLimitSharingPropMappingUtils","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c;b=b.xwa2_notify_group_on_prop_change;a=(yield d("WAWebLimitSharingModelUtils").getChat(a.from.toString()));if(a==null)return;b={initiatedBy:d("WAWebWidFactory").createWid(b.updated_by.id),sharingLimited:(c=(c=b.properties.limit_sharing)==null?void 0:c.limit_sharing_enabled)!=null?c:!1,trigger:d("WAWebLimitSharingPropMappingUtils").getLimitSharingTriggerFromGroupSettingsChange((c=b.properties.limit_sharing)==null?void 0:c.limit_sharing_trigger)};c=d("WAWebWidFactory").createWid(a.id);yield d("WAWebLimitSharingModelUtils").genLimitSharingSystemMessage(c,b);yield d("WAWebLimitSharingModelUtils").updateChat(c,b)});return h.apply(this,arguments)}g.mexHandleLimitSharingUpdate=a}),98); __d("WAWebMexNewsletterAdminInviteRevokeNotificationHandler",["WAJids","WALogger","WATimeUtils","WAWebApiContact","WAWebBackendApi","WAWebDBProcessMessage","WAWebJidToWid","WAWebNewsletterDBUtils","WAWebUserPrefsMeUser","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[handleNewsletterAdminInviteRevoke] actor or user lid not mapped"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[handleNewsletterAdminInviteRevoke] actor or user is null"]);i=function(){return a};return a}function a(a,b){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=b.xwa2_notify_newsletter_admin_invite_revoke;b=a.id;var c=a.actor;a=a.user;a=a.id;c=c.id;if(c==null||a==null){d("WALogger").ERROR(i()).tags("mex","newsletter").sendLogs("newsletter-mex-admin-invite-revoke-null-actor-or-user");return}b=d("WAJids").toNewsletterJid(b);b=d("WAWebJidToWid").newsletterJidToWid(b);a=d("WAWebWidFactory").toUserWid(d("WAWebWidFactory").createWid(a));c=d("WAWebWidFactory").toUserWid(d("WAWebWidFactory").createWid(c));var e=d("WAWebApiContact").getPhoneNumber(a);c=d("WAWebApiContact").getPhoneNumber(c);if(e==null||c==null){d("WALogger").ERROR(h()).tags("mex","newsletter").sendLogs("newsletter-mex-admin-invite-revoke-actor-or-user-lid-unmapped");return}a=d("WAWebUserPrefsMeUser").isMeAccount(a)?c:e;e=(yield d("WAWebNewsletterDBUtils").getUnexpiredNewsletterAdminInviteMessageRecordsFromChat(d("WAWebWidFactory").toNewsletterWid(b),a,c));e.forEach(function(a){var b;if(((b=a.newsletterAdminInviteInfo)==null?void 0:b.inviteExpiration)==null)return;a.newsletterAdminInviteInfo.inviteExpiration=d("WATimeUtils").castToUnixTime(0)});yield d("WAWebDBProcessMessage").updateExistingMessages(e,a);d("WAWebBackendApi").frontendFireAndForget("expireNewsletterAdminInvites",{expiredMsgData:e});return});return j.apply(this,arguments)}g.handleNewsletterAdminInviteRevoke=a}),98); __d("WAWebMexNewsletterParseUtils",["WAJids","WAWebCommonNewsletterEnums","WAWebNewsletterGatingUtils"],(function(a,b,c,d,e,f,g){function a(a){if(a!=null&&(a==null?void 0:a.id)!=null){var b,c,e,f,g,u,v,w,x,y,z,A,B,C;b=(b=a.thread_metadata)==null?void 0:b.creation_time;c=(c=a.thread_metadata)==null?void 0:c.invite;e=(e=a.thread_metadata)==null?void 0:e.name;f=(f=a.thread_metadata)==null?void 0:f.subscribers_count;g=(g=a.viewer_metadata)==null?void 0:g.mute;u=(u=a.thread_metadata)==null?void 0:u.verification;v=(v=a.state)==null?void 0:v.type;w=(w=a.thread_metadata)==null?void 0:w.description;x=(x=a.viewer_metadata)==null?void 0:x.role;y=(y=a.thread_metadata)==null?void 0:y.picture;z=(z=a.thread_metadata)==null?void 0:z.preview;A=(A=a.thread_metadata)==null?void 0:(A=A.settings)==null?void 0:(A=A.reaction_codes)==null?void 0:A.value;B=(B=a.thread_metadata)==null?void 0:(B=B.wamo_sub)==null?void 0:B.plan_id;C=(C=a.viewer_metadata)==null?void 0:C.wamo_sub_status;b=babelHelpers["extends"]({idJid:d("WAJids").toNewsletterJid(a.id),newsletterCreationTimeMetadataMixin:(a=h(b))!=null?a:null,newsletterInviteLinkMetadataMixin:(b=i(c))!=null?b:null,newsletterNameMetadataMixin:(a=j(e))!=null?a:null,newsletterSubscribersMetadataMixin:(c=k(f))!=null?c:null,newsletterMutedMetadataMixin:(b=l(g))!=null?b:null,newsletterVerificationMetadataMixin:(e=m(u))!=null?e:null,newsletterStateMetadataMixin:(a=n(v))!=null?a:null,newsletterDescriptionMetadataMixin:(f=o(w))!=null?f:null,newsletterMembershipMetadataMixin:(c=p(x))!=null?c:null,newsletterPictureMetadataMixin:(g=r([y,z]))!=null?g:null,hasNewsletterLinkedAccountsMetadataMixin:!1,newsletterPrivacyMetadataMixin:null},A!=null&&{newsletterReactionCodesSettingMetadataMixin:q(A)});d("WAWebNewsletterGatingUtils").isWamoSubExperienceEnabled()&&(b.newsletterWamoSubPlanIdMetadataMixin=s(B),b.newsletterWamoSubStatusMetadataMixin=t(C));return b}return null}function h(a){if(a!=null)return{creationTimeValue:Number(a)}}function i(a){if(a!=null)return{inviteCode:a}}function j(a){if(a!=null){return{nameId:a.id,nameUpdateTime:Number(a==null?void 0:a.update_time),nameElementValue:(a=a==null?void 0:a.text)!=null?a:""}}}function k(a){if(a!=null)return{subscribersCount:Number(a)}}function l(a){if(a!=null){var b="undefined";a.toLowerCase()==="off"?b="off":a.toLowerCase()==="on"&&(b="on");return{mutedState:b}}}function m(a){if(a!=null){a=a.toLowerCase()==="unverified"?"unverified":"verified";return{verificationState:a}}}function n(a){var b;(a==null?void 0:a.toLowerCase())==="active"?b="active":(a==null?void 0:a.toLowerCase())==="suspended"?b="suspended":(a==null?void 0:a.toLowerCase())==="geosuspended"&&(b="geosuspended");if(b!=null)return{stateType:b}}function o(a){var b=a==null?void 0:a.text,c=a==null?void 0:a.update_time;if(a!=null&&b!=null&&c!=null)return{descriptionQueryDescriptionResponseMixin:{id:a.id,updateTime:Number(c),elementValue:b}}}function p(a){if(a!=null){var b;switch(a.toLowerCase()){case"admin":b="admin";break;case"guest":b="guest";break;case"owner":b="owner";break;case"subscriber":b="subscriber";break}if(b!=null)return{membershipType:b}}}function q(a){switch(a){case"ALL":return d("WAWebCommonNewsletterEnums").NewsletterReactionCodesSetting.All;case"BLOCKLIST":return d("WAWebCommonNewsletterEnums").NewsletterReactionCodesSetting.Blocklist;case"NONE":return d("WAWebCommonNewsletterEnums").NewsletterReactionCodesSetting.None;case"BASIC":return d("WAWebCommonNewsletterEnums").NewsletterReactionCodesSetting.Basic;default:return null}}function r(a){var b=[];for(a of a)if(a==null)continue;else if(a!=null&&a.type!=null){var c=a.type.toLowerCase()==="image"?"image":"preview";a.direct_path!=null&&a.direct_path!==""&&a.id!=null&&a.type!=null?b.push({queryPictureDirectPathOrEmptyResponseMixinGroup:{name:"QueryPictureDirectPathResponse",value:{directPath:a.direct_path,type:c,id:a.id}}}):(a.direct_path===""||a.direct_path==null)&&b.push({queryPictureDirectPathOrEmptyResponseMixinGroup:{name:"QueryPictureEmptyResponse",value:{type:"image"}}})}return{picture:[].concat(b)}}function s(a){if(a!=null)return a}function t(a){if(a!=null)switch(a.toLowerCase()){case"active":return d("WAWebCommonNewsletterEnums").WamoSubStatus.ACTIVE;case"inactive":return d("WAWebCommonNewsletterEnums").WamoSubStatus.INACTIVE;default:return}}g.parseMexNewsletterResponse=a;g.toReactionCodesSettingMixin=q}),98); __d("WAWebNewsletterAdminNotificationJob",["Promise","WAJobOrchestratorTypes","WAWebOrchestratorNonPersistedJob","WAWebSchemaNewsletterMetadata","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function a(a,c,e,f){f===void 0&&(f=d("WAJobOrchestratorTypes").JOB_PRIORITY.LOW);return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("updateGeosuspendedCountry",b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var f=(yield d("WAWebSchemaNewsletterMetadata").getNewsletterMetadataTable().get(a));if(f==null)return(h||(h=b("Promise"))).resolve();var g=f.geosuspendedCountries,i=g===void 0?new Map():g;e?c.forEach(function(a){i==null?void 0:i.set(a,{geosuspended:!0})}):c.forEach(function(a){i==null?void 0:i["delete"](a)});f.geosuspendedCountries=i;return d("WAWebSchemaNewsletterMetadata").getNewsletterMetadataTable().merge(a,f)}),{priority:f}).waitUntilCompleted()}function c(a){return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("updateProfilePictureDeletion",function(){return d("WAWebSchemaNewsletterMetadata").getNewsletterMetadataTable().merge(a,{id:a,hasProfilePictureDeletionAlerts:!0})},{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.HIGH}).waitUntilCompleted()}g.updateGeosuspendedCountry=a;g.updateProfilePictureDeletionAlertState=c}),98); __d("WAWebMexNewsletterOwnerNotificationHandler",["WAJids","WALogger","WAWebBackendApi","WAWebJidToWid","WAWebMexNewsletterParseUtils","WAWebNewsletterAdminNotificationJob","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["no updates were found in xwa2_notify_newsletter_owner_on_metadata_update"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["reaction setting did not contain updated value in xwa2_notify_newsletter_owner_on_metadata_update"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["description did not contain updated value in xwa2_notify_newsletter_owner_on_metadata_update"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["name did not contain updated value in xwa2_notify_newsletter_owner_on_metadata_update"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["no user found to be making this change in xwa2_notify_newsletter_owner_on_metadata_update"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["no changes found in xwa2_notify_newsletter_owner_on_metadata_update"]);m=function(){return a};return a}function a(a,b){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=b.xwa2_notify_newsletter_owner_on_metadata_update;b=a.id;var c=a.thread_metadata;a=a.actor;if(c==null){d("WALogger").ERROR(m()).tags("mex","newsletter").sendLogs("newsletter-mex-owner-metadata-notification-no-metadata-updates");return}yield o(b,c,a);a=a==null?void 0:a.id;if(a==null){d("WALogger").ERROR(l()).tags("mex","newsletter").sendLogs("newsletter-mex-owner-metadata-notification-no-actor");return}var e=[],f=c.name,g=c.description,n=c.picture,p=c.preview;c=c.settings;(n!=null||p!=null)&&e.push({item:"profile_picture"});if(f!=null){n=f.text;n==null?d("WALogger").ERROR(k()).tags("mex","newsletter").devConsole(f).sendLogs("newsletter-mex-owner-metadata-notification-no-updated-name-value"):e.push({item:"name",value:n})}if(g!=null){p=g.text;p==null?d("WALogger").ERROR(j()).tags("mex","newsletter").devConsole(g).sendLogs("newsletter-mex-owner-metadata-notification-no-updated-name-value"):e.push({item:"description",value:p})}f=c==null?void 0:c.reaction_codes;if(c!=null&&f!=null){n=d("WAWebMexNewsletterParseUtils").toReactionCodesSettingMixin(f.value);n==null?d("WALogger").ERROR(i()).tags("mex","newsletter").devConsole(f).sendLogs("newsletter-mex-owner-metadata-notification-no-updated-name-value"):e.push({item:"reaction_setting",value:n})}if(e.length===0){d("WALogger").ERROR(h()).tags("mex","newsletter").sendLogs("newsletter-mex-owner-metadata-notification-no-updates");return}g=d("WAJids").toNewsletterJid(b);p=d("WAWebJidToWid").newsletterJidToWid(g);c=d("WAWebWidFactory").createWid(a);f={newsletterId:d("WAWebWidFactory").toNewsletterWid(p),actorId:d("WAWebWidFactory").toUserWid(c),updates:e};d("WAWebBackendApi").frontendFireAndForget("displayNewsletterMetadataUpdateNotification",{notification:f})});return n.apply(this,arguments)}function o(a,b,c){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){if(((b=b.preview)==null?void 0:b.direct_path)!==""||c!=null)return;b=d("WAJids").toNewsletterJid(a);c=d("WAWebJidToWid").newsletterJidToWid(b);yield d("WAWebNewsletterAdminNotificationJob").updateProfilePictureDeletionAlertState(b);d("WAWebBackendApi").frontendFireAndForget("updateProfilePictureDeletionAlertState",{newsletterWid:d("WAWebWidFactory").toNewsletterWid(c)})});return p.apply(this,arguments)}g.mexHandleNewsletterOwnerNotification=a}),98); __d("WAWebReachoutTimelockGatingUtils",["WAWebABProps"],(function(a,b,c,d,e,f,g){function a(){return d("WAWebABProps").getABPropConfigValue("enable_reachout_timelocks_web")}g.isReachoutTimelockEnabled=a}),98); __d("WAWebReachoutTimelockUtils",["WAWebReachoutTimelockGatingUtils","WAWebUserPrefsIndexedDBStorage","WAWebUserPrefsTypes"],(function(a,b,c,d,e,f,g){var h="WAReachoutTimelockState";function a(){return!d("WAWebReachoutTimelockGatingUtils").isReachoutTimelockEnabled()?!1:d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.get(h)!=null}function b(){if(!d("WAWebReachoutTimelockGatingUtils").isReachoutTimelockEnabled())return!1;var a=d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.get(h);return(a==null?void 0:a.state)===d("WAWebUserPrefsTypes").ReachoutTimelockState.VISIBLE}g.REACHOUT_TIMELOCK_IDB_KEY=h;g.isUserReachoutTimelocked=a;g.isUserReachoutTimelockedAndVisible=b}),98); __d("WAWebMexReachoutTimelockNotificationHandler",["WALogger","WAWebBackendApi","WAWebReachoutTimelockGatingUtils","WAWebReachoutTimelockUtils","WAWebUserPrefsIndexedDBStorage","WAWebUserPrefsTypes","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[mex][reachout-timelock] handle reachout timelock notification failed"]);h=function(){return a};return a}function a(a,b){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if(!d("WAWebReachoutTimelockGatingUtils").isReachoutTimelockEnabled())return;try{a=b.xwa2_notify_account_reachout_timelock;b=a.is_active;a=a.time_enforcement_ends;if(!b){yield d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.remove(d("WAWebReachoutTimelockUtils").REACHOUT_TIMELOCK_IDB_KEY);void d("WAWebBackendApi").frontendFireAndForget("reachoutTimelockEnforcementLifted",{});return}b=a!=null?new Date(parseInt(a,10)*1e3).getTime():new Date().getTime()+60*1e3;a=(yield d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.get(d("WAWebReachoutTimelockUtils").REACHOUT_TIMELOCK_IDB_KEY));yield d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.set(d("WAWebReachoutTimelockUtils").REACHOUT_TIMELOCK_IDB_KEY,{state:a!=null?a.state:d("WAWebUserPrefsTypes").ReachoutTimelockState.HIDDEN,time_enforcement_ends:b})}catch(a){d("WALogger").ERROR(h()).devConsole(a).sendLogs("mex-handle-reachout-timelock-notification-failed")}});return i.apply(this,arguments)}g.mexHandleReachoutTimelockNotification=a}),98); __d("WAWebMexTextStatusUpdateNotificationHandler",["WALogger","WAWebContactTextStatusBridge","WAWebLidAwareContactsDB","WAWebTextStatusGatingUtils","WAWebTextStatusParseUtils","WAWebUpdateTextStatusForContact","WAWebWidFactory","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[mex][textStatus][notification][side-sub] Could not find side contact hash for text status update side sub operation"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[mex][textStatus][notification][text-status-update] Failed to update text status change"]);i=function(){return a};return a}function a(a,b){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=b.xwa2_notify_text_status_on_update;b=a.jid;if(!d("WAWebTextStatusGatingUtils").receiveTextStatusEnabled())return;if(b==null)throw c("err")("unexpected null id in xwa2_notify_text_status_on_update");a=d("WAWebTextStatusParseUtils").parseTextStatusServerResponse(a);try{void d("WAWebUpdateTextStatusForContact").updateTextStatusForContact(d("WAWebWidFactory").createWid(b),a.textStatusString,a.textStatusEmoji,a.textStatusEphemeralDuration,a.textStatusLastUpdateTime)}catch(a){d("WALogger").ERROR(i()).tags("mex").devConsole(a).sendLogs("mex-text-status-notification-update-fail")}});return j.apply(this,arguments)}function e(a,b){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=b.xwa2_notify_text_status_on_update_side_sub;b=(yield c("WAWebLidAwareContactsDB").equals(["contactHash"],a.hash));if(b.length===0)d("WALogger").WARN(h());else{a=d("WAWebWidFactory").createWid(b[0].id);b=b[0].textStatusLastUpdateTime;return d("WAWebContactTextStatusBridge").getTextStatus(a,b).then(function(a){var b=a.text,c=a.emoji,e=a.ephemeralDurationSeconds,f=a.lastUpdateTime;a=a.id;return d("WAWebUpdateTextStatusForContact").updateTextStatusForContact(a,b,c,e,f)})}});return k.apply(this,arguments)}g.mexHandleTextStatusUpdate=a;g.mexHandleTextStatusUpdateSideSub=e}),98); __d("WAWebMexUsernameAccountSyncNotificationHandler",["WALogger","WAWebGetUsernameQueryJob","WAWebSetUsernameJob","WAWebUserPrefsMeUser","WAWebUsernameGatingUtils","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[mex][username][notification][username-account-sync] wrong LID is sent for self user"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[mex][username][notification][username-account-sync] lid is null"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[mex][username][notification][username-account-sync] received username account sync notification"]);j=function(){return a};return a}function a(a,b){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c;if(!d("WAWebUsernameGatingUtils").usernameSupported())return;d("WALogger").LOG(j());a=b.xwa2_notify_wa_user;b=a.lid_jid;if(b==null){d("WALogger").WARN(i());return}b=d("WAWebWidFactory").createUserWid(b);var e=d("WAWebUserPrefsMeUser").getMeUser();if(b!==d("WAWebUserPrefsMeUser").getMeLidUser()){d("WALogger").WARN(h());return}c=(c=a.username_info)==null?void 0:c.username;c!=null?yield d("WAWebSetUsernameJob").setUsernamesJob([{userId:e,username:c},{userId:b,username:c}]):a.username_info!=null&&c==null?yield d("WAWebSetUsernameJob").setUsernamesJob([{userId:e,username:void 0},{userId:b,username:void 0}]):a.username_info==null&&(yield d("WAWebGetUsernameQueryJob").getUsernameJob())});return k.apply(this,arguments)}g.mexHandleUsernameAccountSync=a}),98); __d("WAWebHandleMexNotification",["Promise","WADeprecatedWapParser","WALogger","WAParsableWapNode","WAWap","WAWebHandleBrigadingUpdateNotification","WAWebMexCommunityOwnerUpdateNotificationHandler","WAWebMexGroupPropertyUpdateNotificationHandler","WAWebMexLimitSharingUpdateHandler","WAWebMexNewsletterAdminInviteRevokeNotificationHandler","WAWebMexNewsletterAdminNotificationHandler","WAWebMexNewsletterJoinHandler","WAWebMexNewsletterLeaveHandler","WAWebMexNewsletterMetadataUpdateNotificationHandler","WAWebMexNewsletterMutedChangeHandler","WAWebMexNewsletterOwnerNotificationHandler","WAWebMexNewsletterRoleChangeNotificationHandler","WAWebMexNewsletterStateChangeHandler","WAWebMexNewsletterWamoSubStatusChangeNotificationHandler","WAWebMexReachoutTimelockNotificationHandler","WAWebMexRelayEnvironment","WAWebMexTextStatusUpdateNotificationHandler","WAWebMexUsernameAccountSyncNotificationHandler","WAWebMexUsernameUpdateNotificationHandler","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[mex][notification] handle MexNotificationEvent"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleMexNotification: "," is an unknown operation & unsupported. Returning nack unrecognized stanza"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[mex][notification] handled ",""]);k=function(){return a};return a}var l="mexNotificationParser",m=new(c("WADeprecatedWapParser"))(l,function(a){a.assertTag("notification");a.assertAttr("type","mex");var b=a.child("update"),c=a.attrString("id"),e=a.attrWapJid("from");a=a.maybeAttrString("offline");var f=b.attrString("op_name");b=b.contentString();var g;try{g=JSON.parse(b)}catch(a){throw new(d("WAParsableWapNode").XmppParsingFailure)(l,"JSON parsing error: "+a)}return{stanzaId:c,from:e,offline:a,OperationName:f,mexResponse:g}});function a(a){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=m.parseOrThrow(a);try{var c=(yield o(b));d("WALogger").DEV(k(),b.OperationName).tags("mex").devConsole(c,b);return c}catch(b){if(b instanceof d("WAParsableWapNode").XmppParsingFailure)throw b;if(b instanceof p){d("WALogger").ERROR(j(),b.operationName).tags("mex","notification").sendLogs("mex-notification-error-"+b.operationName,{sampling:.01}).devConsole(a,b);throw b}throw new(d("WAParsableWapNode").XmppParsingFailure)(l,"unexpected error: "+String(b))}});return n.apply(this,arguments)}function o(a){switch(a.OperationName){case"MexNotificationEvent":return q(a,t);case"NotificationNewsletterMuteChange":return q(a,d("WAWebMexNewsletterMutedChangeHandler").mexHandleNewsletterMutedChange);case"NotificationNewsletterJoin":return q(a,d("WAWebMexNewsletterJoinHandler").mexHandleNewsletterJoin);case"NotificationNewsletterLeave":return q(a,d("WAWebMexNewsletterLeaveHandler").mexHandleNewsletterLeave);case"NotificationNewsletterStateChange":return q(a,d("WAWebMexNewsletterStateChangeHandler").mexHandleNewsletterStateChange);case"NotificationNewsletterAdminMetadataUpdate":return q(a,d("WAWebMexNewsletterAdminNotificationHandler").mexHandleNewsletterAdminNotification);case"NotificationNewsletterOwnerUpdate":return q(a,d("WAWebMexNewsletterOwnerNotificationHandler").mexHandleNewsletterOwnerNotification);case"NotificationNewsletterUpdate":return q(a,d("WAWebMexNewsletterMetadataUpdateNotificationHandler").mexHandleNewsletterMetadataUpdate);case"NotificationNewsletterAdminPromote":return q(a,d("WAWebMexNewsletterRoleChangeNotificationHandler").mexHandleNewsletterRoleChange);case"NotificationNewsletterAdminDemote":return q(a,d("WAWebMexNewsletterRoleChangeNotificationHandler").mexHandleNewsletterRoleChange);case"NotificationNewsletterAdminInviteRevoke":return q(a,d("WAWebMexNewsletterAdminInviteRevokeNotificationHandler").handleNewsletterAdminInviteRevoke);case"NotificationNewsletterWamoSubStatusChange":return q(a,d("WAWebMexNewsletterWamoSubStatusChangeNotificationHandler").mexHandleNewsletterWamoSubStatusChange);case"TextStatusUpdateNotification":return q(a,d("WAWebMexTextStatusUpdateNotificationHandler").mexHandleTextStatusUpdate);case"TextStatusUpdateNotificationSideSub":return q(a,d("WAWebMexTextStatusUpdateNotificationHandler").mexHandleTextStatusUpdateSideSub);case"NotificationGroupPropertyUpdate":case"NotificationGroupHiddenPropertyUpdate":case"NotificationGroupSafetyCheckPropertyUpdate":return q(a,d("WAWebMexGroupPropertyUpdateNotificationHandler").mexHandleGroupPropertyUpdate);case"NotificationCommunityOwnerUpdate":return q(a,d("WAWebMexCommunityOwnerUpdateNotificationHandler").mexHandleCommunityOwnerUpdate);case"UsernameSetNotification":return q(a,d("WAWebMexUsernameUpdateNotificationHandler").mexHandleUsernameChange);case"UsernameDeleteNotification":return q(a,d("WAWebMexUsernameUpdateNotificationHandler").mexHandleUsernameDelete);case"UsernameUpdateNotification":return q(a,d("WAWebMexUsernameUpdateNotificationHandler").mexHandleUsernameChangeForSideSub);case"AccountSyncUsernameNotification":return q(a,d("WAWebMexUsernameAccountSyncNotificationHandler").mexHandleUsernameAccountSync);case"NotificationUserBrigadingUpdate":return q(a,d("WAWebHandleBrigadingUpdateNotification").mexHandleBrigadingNotification);case"NotificationGroupLimitSharingPropertyUpdate":return q(a,d("WAWebMexLimitSharingUpdateHandler").mexHandleLimitSharingUpdate);case"NotificationUserReachoutTimelockUpdate":return q(a,d("WAWebMexReachoutTimelockNotificationHandler").mexHandleReachoutTimelockNotification);default:return(h||(h=b("Promise"))).reject(new p(a.OperationName))}}var p=function(b){babelHelpers.inheritsLoose(a,b);function a(c){var d;d=b.call(this,a.name+": "+c)||this;d.name="MissingMEXNotificationHandler";d.operationName=c;return d}var c=a.prototype;c.toString=function(){return a.name+": "+this.operationName};return a}(babelHelpers.wrapNativeSuper(Error));function q(a,b){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=a.mexResponse,e=d("WAWebMexRelayEnvironment").parseFatalExtensionError(c.errors);if(e!=null)throw new(d("WAParsableWapNode").XmppParsingFailure)(l,"errors list in parsed json has fatal error");if(c.data!=null){yield b(a,c.data);return s(a.stanzaId,a.from)}throw new(d("WAParsableWapNode").XmppParsingFailure)(l,"null data in parsed json")});return r.apply(this,arguments)}function s(a,b){return d("WAWap").wap("ack",{id:d("WAWap").CUSTOM_STRING(a),to:b,"class":"notification",type:"mex"})}function t(a,b){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){d("WALogger").DEV(i()).tags("mex").devConsole(a.from,b)});return u.apply(this,arguments)}g.handleMexNotification=a;g.MissingMEXNotificationHandler=p}),98); __d("WAWebRetryRequestParser",["WADeprecatedWapParser","WAWebJidToWid","WAWebUserPrefsMeUser"],(function(a,b,c,d,e,f,g){a=new(c("WADeprecatedWapParser"))("retryRequestParser",function(a){a.assertTag("receipt");var b=a.attrString("type");if(b!=="retry"&&b!=="enc_rekey_retry")throw a.createParseError('to have type "retry" or "enc_rekey_retry", got "'+b+'"');a.hasAttr("to")&&a.assertAttr("to",d("WAWebUserPrefsMeUser").assertGetMe().toJid());var c=d("WAWebJidToWid").jidWithTypeToWid(a.attrJidWithType("from")),e=a.hasAttr("participant")?d("WAWebJidToWid").deviceJidToDeviceWid(a.attrDeviceJid("participant")):null,f=!1;(e==null?void 0:e.isBot())&&a.hasAttr("is_lid")&&(f=a.attrString("is_lid")==="true");var g=a.hasAttr("recipient")?d("WAWebJidToWid").deviceJidToUserWid(a.attrDeviceJid("recipient")):null,h=a.child("retry"),i=a.maybeChild("keys"),j=null;if(i!=null){var k,l=i.child("skey");k={identity:i.child("identity").contentBytes(32),deviceIdentity:(k=i.maybeChild("device-identity"))==null?void 0:k.contentBytes(),skey:{id:l.child("id").contentUint(3),pubkey:l.child("value").contentBytes(32),signature:l.child("signature").contentBytes(64)}};if(c.isFbidBot()||c.isGroup()&&(e==null?void 0:e.isFbidBot())){l=null;var m=i.maybeChild("key");m!=null&&(l={id:m.child("id").contentUint(3),pubkey:m.child("value").contentBytes(32)});j=babelHelpers["extends"]({type:"bot_retry"},k,{key:l})}else{m=i.child("key");j=babelHelpers["extends"]({type:"regular_retry"},k,{key:{id:m.child("id").contentUint(3),pubkey:m.child("value").contentBytes(32)}})}}return{stanzaId:a.attrString("id"),originalMsgId:h.attrString("id"),ts:a.attrTime("t"),retryCount:h.hasAttr("count")?h.attrInt("count"):0,regId:a.child("registration").contentUint(4),offline:a.hasAttr("offline"),from:c,participant:e,isLid:f,recipient:g,keyBundle:j,type:b}});b=a;g["default"]=b}),98); __d("WAWebSendMsgQueueMap",["WAPromiseQueue"],(function(a,b,c,d,e,f,g){a=new(d("WAPromiseQueue").PromiseQueueMap)();g.sendMsgQueueMap=a}),98); __d("WAWebHandleRetryRequest",["Promise","WAJids","WALogger","WAWap","WAWebApiDeviceList","WAWebCommsWapMd","WAWebLid1X1MigrationGating","WAWebLidMigrationUtils","WAWebManageE2ESessionsJob","WAWebMdRetryFromUnknownDeviceWamEvent","WAWebMessageQueue","WAWebMsgKey","WAWebPostMessageHighRetryCountMetric","WAWebProcessRetryKeyBundle","WAWebRetryRequestParser","WAWebSchemaChat","WAWebSchemaMessage","WAWebSendMsgQueueMap","WAWebSendRetryMsgJob","WAWebSignalCommonUtils","WAWebSignalProtocolStore","WAWebSimpleSignalPNToFBIDMigration","WAWebUserPrefsMeUser","WAWebWamEnumDeviceType","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime","cr:10198","cr:17219","err","gkx"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["getActualChatInfo: retryInfo.from=",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["getActualChatInfo: multiple messages found"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["getActualChatInfo: could not find messages"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["getActualChatInfo: possible msg keys=",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["getActualChatInfo: in migrated/pre-migrated flow"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["getActualChatInfo: this is a user chat"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["getActualChatInfo: no target chat found"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["getActualChatInfo: target chat=",""]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleRetryRequest error: ",""]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleRetryRequest: no device found for isUser:"," lid:"," isLidBot:",""]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleRetryRequest: device "," not found for ",""]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleRetryRequest: no requester found for incoming retry request."]);t=function(){return a};return a}function u(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleRetryRequest refusing retry attempt #",""]);u=function(){return a};return a}function v(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleMessageRetryRequest error: ",""]);v=function(){return a};return a}function w(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleMessageRetryRequest "," retry not authorized"]);w=function(){return a};return a}function x(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleMessageRetryRequest: no chat info found for incoming retry request."]);x=function(){return a};return a}function y(){var a=babelHelpers.taggedTemplateLiteralLoose(["Received null stanzaID when handling message retry request"]);y=function(){return a};return a}function z(){var a=babelHelpers.taggedTemplateLiteralLoose(["Parsing Error: ",""]);z=function(){return a};return a}function A(){var a=babelHelpers.taggedTemplateLiteralLoose(["getTargetChat: from is a peer device, but without recipient, isLid: ",", peer device: ",", retryCount: ",", hasKeyBundle: ",""]);A=function(){return a};return a}f=(e=b("cr:17219"))!=null?e:{};var B=f.getWindowsBridge;function a(a){return C.apply(this,arguments)}function C(){C=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=c("WAWebRetryRequestParser").parse(a);if(a.error){d("WALogger").ERROR(z(),a.error.toString());return(h||(h=b("Promise"))).reject(a.error)}a=a.success;var e=a.from,f=a.participant,g=a.stanzaId;if(g==null){d("WALogger").WARN(y());return(h||(h=b("Promise"))).reject(c("err")("Received null stanzaID when handling message retry request"))}g=d("WAWap").wap("ack",{id:d("WAWap").CUSTOM_STRING(g),to:d("WAWebCommsWapMd").JID(e),participant:f?d("WAWebCommsWapMd").DEVICE_JID(f):d("WAWap").DROP_ATTR,"class":"receipt",type:"retry"});yield D(a);return g});return C.apply(this,arguments)}function D(a){return E.apply(this,arguments)}function E(){E=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=(yield H(a));if(!e){d("WALogger").WARN(x()).sendLogs("handle-message-retry-request-no-chat-info");return}var f=e.chat,g=e.from,h=e.lidOrigin,i=e.accountLid,j=a.from;a.from=g;var k=a.participant,l=a.recipient,m=a.retryCount,n=a.type;return d("WAWebMessageQueue").onMessageQueue(f,!1,b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=(yield F(f,a));if(e==null)return;var o=e.originalMsgId,p=e.requester,q=e.isLidBot;e=e.identity;c("gkx")("26258")||(b("cr:10198")==null?void 0:b("cr:10198").injectDebug(f,"RetryReceiptReceived","originalMsgId:"+o+" - requester:"+p.toString()));try{if(n==="enc_rekey_retry"){var r;B==null?void 0:(r=B())==null?void 0:(r=r.voip)==null?void 0:r.resendEncRekeyRetry(g.toString({legacy:!0}),m)}else if(n!=="voip_1x1_retry"){r=(yield d("WAWebProcessRetryKeyBundle").getMsgIfAuthorized(o,f,p,q,m,e));if(!r){d("WALogger").WARN(w(),r==null?void 0:r.type);return}yield d("WAWebSendRetryMsgJob").sendRetry(j,k,l,r,m,h,q,i)}}catch(a){d("WALogger").WARN(v(),a)}return}))});return E.apply(this,arguments)}function F(a,b){return G.apply(this,arguments)}function G(){G=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){var e=c.originalMsgId,f=c.isLid,g=f===void 0?!1:f;f=c.from;var h=c.participant,i=c.retryCount,j=c.offline;if(i>=d("WAWebPostMessageHighRetryCountMetric").MAX_RETRY){d("WALogger").LOG(u(),i);return}var k=a.isUser()?f:h;if(!k){d("WALogger").WARN(t());return}i=k.device||0;try{f=(yield d("WAWebApiDeviceList").hasDevice(k,i));if(!f){d("WALogger").WARN(s(),i,k.user);d("WALogger").WARN(r(),a.isUser(),k.isLid(),g).sendLogs("no-device-found-for-retry-request",{sampling:.001});new(d("WAWebMdRetryFromUnknownDeviceWamEvent").MdRetryFromUnknownDeviceWamEvent)({offline:j,senderType:i===d("WAJids").DEFAULT_DEVICE_ID?d("WAWebWamEnumDeviceType").DEVICE_TYPE.PRIMARY:d("WAWebWamEnumDeviceType").DEVICE_TYPE.COMPANION}).commit();return}return yield d("WAWebSendMsgQueueMap").sendMsgQueueMap.enqueue(a.toString(),b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield d("WAWebProcessRetryKeyBundle").updateLocalSession(a,c);yield d("WAWebManageE2ESessionsJob").ensureE2ESessions([k]);var b=(yield d("WAWebSignalProtocolStore").getPersistSignalProtocolStore().getIdentityWithRowId(d("WAWebSignalCommonUtils").createSignalAddressForIdentityTable(k).toString()));return{originalMsgId:e,chat:a,requester:k,isLidBot:g,identity:b}}))}catch(a){d("WALogger").WARN(q(),a)}});return G.apply(this,arguments)}function H(a){return I.apply(this,arguments)}function I(){I=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=J(a);d("WALogger").DEV(p(),b);if(b==null){d("WALogger").LOG(o());return}b=d("WAWebSimpleSignalPNToFBIDMigration").maybeReplaceFbidWithDeprecatedBotPn(b);if(c("WAWebWid").isUserWid(b)){d("WALogger").LOG(n());var e=!d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()&&b.isLid();if(d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()||e){d("WALogger").LOG(m());e=new(c("WAWebMsgKey"))({fromMe:!0,remote:b,id:a.originalMsgId});e=[e,d("WAWebLidMigrationUtils").getAlternateMsgKey(e)].filter(Boolean).map(function(a){return a.toString()});d("WALogger").DEV(l(),e.join(","));if(a.type==="retry"){e=(yield d("WAWebSchemaMessage").getMessageTable().bulkGet(e,!1)).filter(Boolean);if(e.length===0){d("WALogger").LOG(k());return}e.length>1&&d("WALogger").WARN(j()).devConsole(a.originalMsgId);e=d("WAWebWidFactory").createWidFromWidLike(e[0].to)}else a.type,e=a.from;d("WALogger").DEV(i(),a.from);var f;a.from.isBot()?f=a.from:f=e.isLid()?d("WAWebLidMigrationUtils").toLid(a.from):d("WAWebLidMigrationUtils").toPn(a.from);if(f==null)return;f=d("WAWebWidFactory").createDeviceWidFromUserAndDevice(f.user,f.server,(f=a.from.device)!=null?f:0);var g=(yield d("WAWebSchemaChat").getChatTable().get(e.toString())),h=g==null?void 0:g.lidOriginType;g=(g==null?void 0:g.accountLid)!=null?d("WAWebWidFactory").createWidFromWidLike(g.accountLid):void 0;return{chat:e,from:f,lidOrigin:h,accountLid:g}}}return{chat:b,from:a.from}});return I.apply(this,arguments)}function J(a){var b=a.from,c=a.recipient;if(b.isBot()&&c!=null)return c;if(b.isUser()){var e=d("WAWebWidFactory").toUserWid(b);if(d("WAWebUserPrefsMeUser").isMeAccount(e)){if(!c){var f;d("WALogger").WARN(A(),b.isLid(),(f=b.device)!=null?f:"primary",a.retryCount,a.keyBundle!=null);return null}return c}return d("WAWebWidFactory").toUserWid(e)}return b}g.handleMessageRetryRequest=a;g.handleRetryRequest=D}),98); __d("WAWebProcessRetryKeyBundle",["WALogger","WAWebAddonRetryRequestUtils","WAWebApiMessageInfoStore","WAWebApiParticipantStore","WAWebChatCollection","WAWebDBMessageSerialization","WAWebE2eRetryRejectWamEvent","WAWebLidFoundationalGatingUtils","WAWebMsgKey","WAWebMsgModel","WAWebMsgType","WAWebSchemaMessage","WAWebSendMsgTypes","WAWebSignal","WAWebUserPrefsMeUser","WAWebUserPrefsStatus","WAWebWamEnumDeviceType","WAWebWamEnumRetryRejectReason","WAWebWamMsgUtils","WAWebWidFactory","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["updateLocalSession: delete local session due to same base key"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["updateLocalSession: delete session because reg does not match, saved: ",", received: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["updateLocalSession: retryCount: ",", offline: ",", has keyBundle: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["processKeyBundle: update local session with the retry key bundle"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["processKeyBundle: update local session with the retry key bundle (offline)"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["processKeyBundle: delete session because reg does not match, saved: ",", received: ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["processKeyBundle: missing session for retry"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["processKeyBundle: skip due to missing key bundle"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["getMsgIfAuthorized: ",", "," retry eligibility ",""]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["getMsgIfAuthorized: msg missing rowId ","."]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["getMsgIfAuthorized: can not find msg ","."]);r=function(){return a};return a}function a(a,b,c,d,e,f){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e,f,g,h){var i=d("WAWebUserPrefsMeUser").getMaybeMeLidUser(),j=d("WAWebUserPrefsMeUser").getMeUser();(e.isLid()||f)&&i!=null?f=i:f=j;i=new(c("WAWebMsgKey"))({id:a,remote:b,fromMe:!0,participant:b.isUser()?void 0:f});j=(yield d("WAWebAddonRetryRequestUtils").getSentAddonMsgRecord(i));if(j!=null)b=h==null?void 0:h.sentAddonRowId,f=j.selfMsgRow.rowId,j={type:d("WAWebSendMsgTypes").SendMessageRecordType.Addon,data:j.msgData};else{var k=(yield d("WAWebSchemaMessage").getMessageTable().get(String(i)));if(!k){d("WALogger").WARN(r(),i.toString());return null}b=h==null?void 0:h.rowId;f=k.type===d("WAWebMsgType").MSG_TYPE.REVOKED?k.protocolMessageRowId:k.rowId;h=new(d("WAWebMsgModel").Msg)(d("WAWebDBMessageSerialization").messageFromDbRow(k));j={type:d("WAWebSendMsgTypes").SendMessageRecordType.Message,data:h}}if(f==null){d("WALogger").WARN(q(),i.toString());return null}k=(yield d("WAWebApiMessageInfoStore").isRetryEligible(i,e,b,f));j.type===d("WAWebSendMsgTypes").SendMessageRecordType.Message&&(yield j.data.waitForPrep());d("WALogger").LOG(p(),a,String(e),k).tags("messaging");h=d("WAWebWamEnumRetryRejectReason").RETRY_REJECT_REASON.OTHER;i=!1;j.data.type===d("WAWebMsgType").MSG_TYPE.REVOKED&&(i=!0,j.data.type="protocol",j.data.subtype=j.data.subtype==="admin"?"admin_revoke":"sender_revoke");switch(k){case d("WAWebApiMessageInfoStore").RetryEligibilityResult.ELIGIBLE:return j;case d("WAWebApiMessageInfoStore").RetryEligibilityResult.INELIGIBLE_ALREADY_DELIVERED:h=d("WAWebWamEnumRetryRejectReason").RETRY_REJECT_REASON.DOUBLE_CHECKMARK;break;case d("WAWebApiMessageInfoStore").RetryEligibilityResult.INELIGIBLE_CHANGED_IDENTITY:h=d("WAWebWamEnumRetryRejectReason").RETRY_REJECT_REASON.IDENTITY_CHANGE;break;default:h=d("WAWebWamEnumRetryRejectReason").RETRY_REJECT_REASON.OTHER;break}new(d("WAWebE2eRetryRejectWamEvent").E2eRetryRejectWamEvent)({senderDeviceType:e.isCompanion()?d("WAWebWamEnumDeviceType").DEVICE_TYPE.COMPANION:d("WAWebWamEnumDeviceType").DEVICE_TYPE.PRIMARY,messageType:d("WAWebWamMsgUtils").getWamMessageType(j.data),msgRetryCount:g,retryRevoke:i,retryRejectReason:h}).commit();return null});return s.apply(this,arguments)}function t(a,b,c,d,e){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e,f){if(c==null||!a||a.type==="regular_retry"&&!a.key){d("WALogger").LOG(o());return!1}if(f){if(e==null){d("WALogger").LOG(n());yield d("WAWebSignal").Session.deleteRemoteInfo(b);return!1}else if(e!==c){d("WALogger").LOG(m(),e,c);yield d("WAWebSignal").Session.deleteRemoteInfo(b);return!1}d("WALogger").LOG(l())}else d("WALogger").LOG(k());yield d("WAWebSignal").Session.createSignalSession({wid:b,regId:c,identity:a.identity,deviceIdentity:a.deviceIdentity,key:a.key,skey:a.skey},d("WAWebLidFoundationalGatingUtils").shouldUseDeprecatedSessionWhenCreatingNewSessions(b));return!0});return u.apply(this,arguments)}function e(a,b){return v.apply(this,arguments)}function v(){v=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e=b.from,f=b.keyBundle,g=b.offline,k=b.originalMsgId,l=b.participant,m=b.regId;b=b.retryCount;l=l||e;d("WALogger").LOG(j(),b,g.toString(),(!!f).toString());if(a.isGroup()){e=d("WAWebChatCollection").ChatCollection.get(a);e&&(l&&d("WAWebApiParticipantStore").markForgetSenderKey(e.id,[l]))}a.isStatus()&&(l&&void c("WAWebUserPrefsStatus").markForgetStatusSenderKey([l]));e=(yield d("WAWebSignal").Session.getRemoteRegId(l));if(d("WAWebUserPrefsMeUser").isMeAccount(d("WAWebWidFactory").toUserWid(l))&&e!==m)throw c("err")("updateLocalSession: detect registration Id change remote: "+m+", local: "+String(e)+" for peer device");a=(yield t(f,l,m,e,g));a||e!=null&&e!==m&&(d("WALogger").LOG(i(),e,m),yield d("WAWebSignal").Session.deleteRemoteSession(l));f=2;if(b===f)return d("WAWebSignal").Session.saveSessionBaseKey(l,k);else if(b>f){g=(yield d("WAWebSignal").Session.hasSameBaseKey(l,k));if(g){d("WALogger").LOG(h());return d("WAWebSignal").Session.deleteRemoteSession(l)}}});return v.apply(this,arguments)}g.getMsgIfAuthorized=a;g.processKeyBundle=t;g.updateLocalSession=e}),98); __d("WAWebGetMetricHistorySyncPayloadType",["WAWebWamEnumMdBootstrapHistoryPayloadType"],(function(a,b,c,d,e,f,g){function a(a){switch(a){case 0:return d("WAWebWamEnumMdBootstrapHistoryPayloadType").MD_BOOTSTRAP_HISTORY_PAYLOAD_TYPE.INITIAL;case 1:return d("WAWebWamEnumMdBootstrapHistoryPayloadType").MD_BOOTSTRAP_HISTORY_PAYLOAD_TYPE.STATUS_V3;case 2:return d("WAWebWamEnumMdBootstrapHistoryPayloadType").MD_BOOTSTRAP_HISTORY_PAYLOAD_TYPE.FULL_HISTORY;case 3:return d("WAWebWamEnumMdBootstrapHistoryPayloadType").MD_BOOTSTRAP_HISTORY_PAYLOAD_TYPE.RECENT_HISTORY;case 4:return d("WAWebWamEnumMdBootstrapHistoryPayloadType").MD_BOOTSTRAP_HISTORY_PAYLOAD_TYPE.PUSHNAME;case 5:return d("WAWebWamEnumMdBootstrapHistoryPayloadType").MD_BOOTSTRAP_HISTORY_PAYLOAD_TYPE.NON_BLOCKING_DATA;case 6:return d("WAWebWamEnumMdBootstrapHistoryPayloadType").MD_BOOTSTRAP_HISTORY_PAYLOAD_TYPE.ON_DEMAND;default:return d("WAWebWamEnumMdBootstrapHistoryPayloadType").MD_BOOTSTRAP_HISTORY_PAYLOAD_TYPE.PUSHNAME}}g.getMetricHistorySyncPayloadType=a}),98); __d("WAWebHistorySyncNotificationUtils",["$InternalEnum","Promise","WALogger","WALongInt","WANullthrows","WATimeUtils","WAWebApiHistorySyncNotification","WAWebChatCollection","WAWebChatThreadLogging","WAWebCurrentUser","WAWebDBGroupParticipant","WAWebDBGroupsGroupMetadata","WAWebEphemeralityUtils","WAWebGetMetricHistorySyncPayloadType","WAWebGroupMetadataCollection","WAWebGroupParticipantModel","WAWebGroupParticipantsJob","WAWebLeaveReasonType","WAWebMdBootstrapDataAppliedWamEvent","WAWebMdBootstrapHistoryDataDownloadedWamEvent","WAWebMdBootstrapHistoryDataStartDownloadingWamEvent","WAWebParseWebMessageInfoApi","WAWebProtobufsHistorySync.pb","WAWebSchemaHistorySyncNotification","WAWebSignalProtocolStore","WAWebSyncdMdSyncFieldstatMeta","WAWebUserPrefsHistorySync","WAWebUserPrefsMeUser","WAWebUserPrefsNotifications","WAWebWamEnumMdBootstrapPayloadType","WAWebWamEnumMdBootstrapSource","WAWebWamEnumMdBootstrapStepResult","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime","gkx"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] get changed self identity key from history sync,\n existing length: ",", new length: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Past Participants completed, ",""]);j=function(){return a};return a}function a(){var b=babelHelpers.taggedTemplateLiteralLoose(["[history] could not check missing mapping: ",""]);a=function(){return b};return b}function e(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history] additional info:\n wid: ","\n key: ","_","_","",".\n type: ",", sub type: ",""]);e=function(){return a};return a}function f(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history] missing mapping for ",". is group? ",". message type: ",", sub type: ",""]);f=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history] could not parse participant wid"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history] could not parse mention wid"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history] end to report missing mapping"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history] could not calculate missing mapping: ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["missing Lid mapping in history Sync"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["total missing mapping for type ",": ",""]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history] start to report missing mapping. is sw enabled: ",""]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history] could not create allLidMapping ",""]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] handleChatThreadLoggingMetadata: missing threadDsTimeframeOffset"]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] handleChatThreadLoggingMetadata: missing threadIdUserSecret"]);t=function(){return a};return a}function u(){var a=babelHelpers.taggedTemplateLiteralLoose(["updateParticipantsJob: failed: ",""]);u=function(){return a};return a}function v(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] msg invalid because chat id is PN and msgKey.remote is lid"]);v=function(){return a};return a}function w(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] msg invalid because chat id is PN and msgKey.remote is lid. chatId: ",", msg key: ",""]);w=function(){return a};return a}function x(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] parseWebMessageInfo failed on msg key ",", msg type: "," in chunk ",""]);x=function(){return a};return a}function y(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] parseWebMessageInfo failed with error "," "," and stack ",""]);y=function(){return a};return a}var z=b("$InternalEnum").Mirrored(["NewRecentSyncNotification","NewOnDemandSyncNotification","LastProcessedNotification","InitialSyncComplete","BackendStart","HistorySyncStatusCheck","ManualRestart"]);function A(a,b){return B.apply(this,arguments)}function B(){B=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=a.pastParticipants.map(function(a){return{groupId:c("WANullthrows")(a.groupJid),pastParticipants:a.pastParticipants.map(function(a){return{id:d("WAWebWidFactory").createWid(c("WANullthrows")(a.userJid)),leaveReason:a.leaveReason===d("WAWebProtobufsHistorySync.pb").PastParticipant$LeaveReason.LEFT?d("WAWebLeaveReasonType").LeaveReason.Left:d("WAWebLeaveReasonType").LeaveReason.Removed,leaveTs:d("WALongInt").numberOrThrowIfTooLarge(c("WANullthrows")(a.leaveTs))}})}});yield d("WAWebDBGroupParticipant").addPastParticipants(a);a.forEach(function(a){var b=d("WAWebChatCollection").ChatCollection.gadd(d("WAWebWidFactory").createWid(a.groupId));b=b.groupMetadata;b==null?void 0:b.pastParticipants.add(a.pastParticipants,{merge:!0})});d("WALogger").LOG(j(),C(b))});return B.apply(this,arguments)}function C(a,b,c){var d;if(a==null)return"";var e=(a.msgKey||"").split("_")[2],f=D(a.syncType,a.chunkOrder,a.isReupload);a=(d=(d=a.downloadOptions.filehash)==null?void 0:d.slice(0,10))!=null?d:(d=a.filehash)==null?void 0:d.slice(0,10);return" "+f+", id: "+e+" ## msgCount: "+((d=b)!=null?d:"-")+", ## chatCount: "+((f=c)!=null?f:"-")+", ## downloadStr: "+((e=a)!=null?e:"")+" "}function D(a,b,c){return"type_"+((a=a)!=null?a:"none")+"_order_"+((a=b)!=null?a:"none")+"_isReupload_"+(c||0)}function E(a,b,e,f,g){var h=null;try{b!=null&&(h=d("WAWebParseWebMessageInfoApi").parseWebMessageInfo(b)),X(b,f,g,h)}catch(a){d("WALogger").ERROR(y(),a==null?void 0:a.name,a==null?void 0:a.code,a==null?void 0:a.stack),c("gkx")("26258")||d("WALogger").ERROR(x(),b==null?void 0:b.key.id,b==null?void 0:b.messageStubType,C(e)).sendLogs("parseWebMessageInfo failed during history sync")}if(F(a,h))return;return h}function F(a,b){if(b==null)return!1;var c=a.isUser()&&!a.isLid();if(!c)return!1;c=(c=b.id)==null?void 0:c.remote;c=c!=null&&c.isLid();if(c){if(d("WAWebCurrentUser").isEmployee()){var e;d("WALogger").LOG(w(),a,(e=b.id)==null?void 0:e.toString())}d("WALogger").ERROR(v()).sendLogs("history-sync-invalid-msg").devConsole(a,b.id.remote)}return c}function G(a,b){return H.apply(this,arguments)}function H(){H=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=(yield d("WAWebSignalProtocolStore").getPersistSignalProtocolStore().loadIdentityKey(a));a!=null&&a!==b&&d("WALogger").ERROR(i(),a.length,b.length).tags("history-sync").sendLogs("self-identity-change-from-history-sync")});return H.apply(this,arguments)}function I(a,b){var e;if(!b.isGroup())return;e=(e=a.disappearingMode)==null?void 0:e.trigger;var f;if(e!=null){e=d("WAWebEphemeralityUtils").getDisappearingModeTriggerFromProtobuf(e);e!=null&&(f=e)}if(a.suspended!=null||a.terminated!=null||a.createdBy!=null||a.createdAt!=null||a.description!=null||a.support!=null||a.isParentGroup!=null||a.isDefaultSubgroup!=null||a.parentGroupId!=null||a.disappearingMode!=null){var g;e={id:b,subject:a.name,suspended:a.suspended,terminated:a.terminated,owner:a.createdBy!=null?d("WAWebWidFactory").createWid(a.createdBy):void 0,creation:a.createdAt,desc:a.description,support:a.support,isParentGroup:a.isParentGroup,defaultSubgroup:a.isDefaultSubgroup,parentGroup:a.parentGroupId!=null?d("WAWebWidFactory").createWid(a.parentGroupId):void 0,disappearingModeInitiatedByMe:(e=a.disappearingMode)==null?void 0:e.initiatedByMe,disappearingModeTrigger:f};d("WAWebDBGroupsGroupMetadata").persistGroupMetadata(b,babelHelpers["extends"]({},e,{id:e.id.toString(),owner:e.owner!==void 0?e.owner.toString():void 0,creation:e.creation!==void 0?Number(e.creation):void 0,parentGroup:e.parentGroup!==void 0?String(e.parentGroup):void 0}));e=c("WAWebGroupMetadataCollection").add(e,{merge:!0})[0];g=(g=a.participant)==null?void 0:g.map(function(a){var b=a.rank===d("WAWebProtobufsHistorySync.pb").GroupParticipant$Rank.SUPERADMIN,e=a.rank===d("WAWebProtobufsHistorySync.pb").GroupParticipant$Rank.ADMIN;return new(c("WAWebGroupParticipantModel"))({id:d("WAWebWidFactory").createWid(a.userJid),isAdmin:e||b,isSuperAdmin:b})});e==null?void 0:e.participants.add(g,{merge:!0});(a.readOnly===!0||g.length>0)&&d("WAWebGroupParticipantsJob").updateParticipantsJob({group:b,participants:g.map(function(a){return{id:a.id,isAdmin:a.isAdmin,isSuperAdmin:a.isSuperAdmin}}),skipDeviceSync:a.readOnly})["catch"](function(a){d("WALogger").WARN(u(),a)})}}function J(a){var c=(h||(h=b("Promise"))).resolve(),e=h.resolve();a.threadIdUserSecret!=null?c=d("WAWebChatThreadLogging").setThreadIdUserSecret(a.threadIdUserSecret):d("WALogger").ERROR(t()).sendLogs("ctl-missing-secret-history-sync");a.threadDsTimeframeOffset!=null?e=d("WAWebChatThreadLogging").setThreadDsTimeframeOffset(a.threadDsTimeframeOffset):d("WALogger").ERROR(s()).sendLogs("ctl-missing-offset-history-sync");return h.all([c,e])}function K(a,b){return L.apply(this,arguments)}function L(){L=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=a.syncType===d("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.INITIAL_BOOTSTRAP?d("WAWebWamEnumMdBootstrapPayloadType").MD_BOOTSTRAP_PAYLOAD_TYPE.CRITICAL:d("WAWebWamEnumMdBootstrapPayloadType").MD_BOOTSTRAP_PAYLOAD_TYPE.NON_CRITICAL,e=d("WAWebGetMetricHistorySyncPayloadType").getMetricHistorySyncPayloadType(a.syncType),f=(yield d("WAWebSyncdMdSyncFieldstatMeta").MdSyncFieldStatsMeta.getMdSessionId()),g=(yield P(a)),h=new(d("WAWebMdBootstrapHistoryDataStartDownloadingWamEvent").MdBootstrapHistoryDataStartDownloadingWamEvent)({mdBootstrapPayloadType:c,mdBootstrapPayloadSize:a.historySyncPayloadSize,mdBootstrapHistoryPayloadType:e,mdSessionId:f,historySyncStageProgress:g}),i=new(d("WAWebMdBootstrapHistoryDataDownloadedWamEvent").MdBootstrapHistoryDataDownloadedWamEvent)({mdBootstrapPayloadType:c,mdBootstrapPayloadSize:a.historySyncPayloadSize,mdBootstrapHistoryPayloadType:e,mdSessionId:f,historySyncStageProgress:g});c=new(d("WAWebMdBootstrapDataAppliedWamEvent").MdBootstrapDataAppliedWamEvent)({mdBootstrapPayloadType:c,mdBootstrapSource:d("WAWebWamEnumMdBootstrapSource").MD_BOOTSTRAP_SOURCE.HISTORY,mdBootstrapHistoryPayloadType:e,mdSessionId:f,sentViaMms:b,historySyncStageProgress:g});a.chunkOrder!=null&&(h.historySyncChunkOrder=a.chunkOrder,i.historySyncChunkOrder=a.chunkOrder,c.historySyncChunkOrder=a.chunkOrder);e=(yield d("WAWebSyncdMdSyncFieldstatMeta").MdSyncFieldStatsMeta.getStorageEstimation());e.mdStorageQuotaBytes!==d("WAWebSyncdMdSyncFieldstatMeta").STORAGE_QUOTA_UNAVAILABLE&&(i.mdStorageQuotaUsedBytes=e.mdStorageQuotaUsedBytes,i.mdStorageQuotaBytes=e.mdStorageQuotaBytes);return{historySyncStartDownloadingMetric:h,historySyncDownloadedMetric:i,historySyncDataAppliedMetric:c}});return L.apply(this,arguments)}function M(a,b,c){a.mdTimestamp=c,a.mdBootstrapStepDuration=c-b,a.commit()}function N(a,b,c,e){a.mdTimestamp=e,a.mdBootstrapStepDuration=e-b,a.mdBootstrapStepResult=c?d("WAWebWamEnumMdBootstrapStepResult").MD_BOOTSTRAP_STEP_RESULT.SUCCESS:d("WAWebWamEnumMdBootstrapStepResult").MD_BOOTSTRAP_STEP_RESULT.FAILURE,a.commit()}function O(a,b,c,e){e===void 0&&(e=!1);var f=d("WATimeUtils").unixTimeMs();a.mdTimestamp=f;a.mdBootstrapStepDuration=f-b;a.mdBootstrapStepResult=c?d("WAWebWamEnumMdBootstrapStepResult").MD_BOOTSTRAP_STEP_RESULT.SUCCESS:d("WAWebWamEnumMdBootstrapStepResult").MD_BOOTSTRAP_STEP_RESULT.FAILURE;a.commitAndWaitForFlush(e)}function P(a){return Q.apply(this,arguments)}function Q(){Q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.progress,c=(yield d("WAWebUserPrefsHistorySync").getChunkCountForEndOfRecentHistorySync());(a.syncType===d("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.FULL||a.syncType===d("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.RECENT&&a.chunkOrder===c)&&(b=100);return(a=b)!=null?a:0});return Q.apply(this,arguments)}function R(a){return[d("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.INITIAL_BOOTSTRAP,d("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.INITIAL_STATUS_V3,d("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.PUSH_NAME].includes(a.syncType)&&a.initialHistBootstrapInlinePayload!=null&&(a==null?void 0:a.initialHistBootstrapInlinePayload.byteLength)>0?a.initialHistBootstrapInlinePayload:null}function S(){return T.apply(this,arguments)}function T(){T=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){return d("WAWebSchemaHistorySyncNotification").getHistorySyncNotificationTable().equals(["processed","syncType"],[0,d("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.RECENT],{shouldDecrypt:!1}).then(function(a){return a.filter(function(a){return!d("WAWebApiHistorySyncNotification").inFlightChunk.has(a.msgKey)&&!a.reuploadPending}).sort(function(a,b){return((a=a.chunkOrder)!=null?a:0)-((a=b.chunkOrder)!=null?a:0)})})});return T.apply(this,arguments)}function U(a){var b=null;if(d("WAWebCurrentUser").isEmployee())try{b=new Set(a.map(function(a){a=a.lid;return a.toString()}))}catch(a){d("WALogger").ERROR(r(),a)}return b}function V(a){if(a==null)return"N/A";var b=0,c=[];for(a of a){c.push(a);if(b++===50)break}return c.join(",")}function W(a){d("WALogger").LOG(q(),d("WAWebUserPrefsNotifications").getGlobalOfflineNotifications().toString());try{var b=!1;a.forEach(function(a,c){a>0&&(b=!0,d("WALogger").ERROR(p(),c,a))});b&&d("WALogger").ERROR(o()).sendLogs("missing Lid mapping in history Sync")}catch(a){d("WALogger").ERROR(n(),a)}d("WALogger").LOG(m())}function X(a,b,c,d){}g.HistorySyncScheduleSource=z;g.processPastParticipants=A;g.getHistorySyncLogDetailsString=C;g.getHistorySyncBasicChunkInfoString=D;g.parseWebMsgInfoAndReturnNullOnFailure=E;g.isInvalidMsg=F;g.checkSelfHistorySyncIdentity=G;g.saveGroupMetadataForLeftGroup=I;g.handleChatThreadLoggingMetadata=J;g.getHistorySyncMetrics=K;g.commitHistoryStartDownloadingMetric=M;g.commitHistoryDownloadedMetric=N;g.commitHistoryDataAppliedMetric=O;g.getHistorySyncProgress=P;g.maybeGetInlinePayload=R;g.getUnprocessedRecentSyncNotifications=S;g.getLidMappingAsStringSet=U;g.getLidsForLogging=V;g.reportMissingMapping=W}),98); __d("WAWebEncryptedRid",["WABase64","WAWebUserPrefsIndexedDBStorage","WAWebUserPrefsMultiDevice"],(function(a,b,c,d,e,f,g){function a(a){return d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.set("WAWebEncryptedRid",d("WABase64").encodeB64(a))}function b(){return!d("WAWebUserPrefsMultiDevice").isRegistered()?null:d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.get("WAWebEncryptedRid")}g.setEncryptedRid=a;g.getEncryptedRid=b}),98); __d("WAWebAbPropsSyncJob",["Promise","WAGetAbPropsProtocol","WALogger","WAPromiseDelays","WAWebABProps","WAWebABPropsGlobals","WAWebABPropsLocalStorage","WAWebABPropsUpdateFromStorage","WAWebAbPropsParsingJob","WAWebApiAbPropConfig","WAWebApiAbPropEventSamplingConfig","WAWebCmd","WAWebEncryptedRid","WAWebEventSamplingCache","WAWebSyncOnABProps","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["failed to sync ABProps"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["update ABProps config table failed"]);j=function(){return a};return a}d("WAWebCmd").Cmd.on("on_ab_props_update",function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b,c=a.service_improvement_opt_out_flag,e=a.ctwa_ad_account_token_storage_kill_switch_web;a=a.web_ui_refresh_m1;yield (b=d("WAWebSyncOnABProps")).ensureNonCriticalDataSyncIsInitialized();b.handleServiceImprovementOptOutFlagABPropConfigValueChange(c);b.handleAdAccountTokenStorageKillSwitchABPropConfigValueChange(e);b.handleUIRefreshNuxOnABPropConfigValueChange(a)});return function(b){return a.apply(this,arguments)}}());function k(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c;a===void 0&&(a=!0);var e;a&&(e=d("WAWebABPropsLocalStorage").getHash());a=(yield d("WAGetAbPropsProtocol").getAbPropsProtocol(e));if(!a.success)return!1;a=a.value;var f=a.abKey,g=a.hash,i=a.refresh,k=a.refreshId,l=a.props,m=a.samplingConfigs;a=a.erid;a=a==null?(h||(h=b("Promise"))).resolve():d("WAWebEncryptedRid").setEncryptedRid(a);var n=Date.now();d("WAWebABPropsGlobals").updateGlobalABKey((c=f)!=null?c:"");d("WAWebABPropsLocalStorage").updateAttributesLocalStorage(f,e,i,n);k!=null&&d("WAWebABPropsLocalStorage").setRefreshId(k);if(g==null)return!1;try{yield (h||(h=b("Promise"))).all([d("WAWebApiAbPropEventSamplingConfig").updateEventSamplingConfigs(m),d("WAWebApiAbPropConfig").updateABPropConfigs(d("WAWebAbPropsParsingJob").parseABProps(l)),a]);return!0}catch(a){d("WALogger").ERROR(j()).verbose().devConsole(a).sendLogs("update ABProps config table failed when syncing ABProps")}return!1});return l.apply(this,arguments)}function a(a){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a===void 0&&(a=!0);var c=d("WAWebABPropsLocalStorage").isABPropsAfterFirstSync(),e=3;while(e-->0)try{var f;f={service_improvement_opt_out_flag:(f=d("WAWebABProps")).getABPropConfigValue("service_improvement_opt_out_flag"),ctwa_ad_account_token_storage_kill_switch_web:f.getABPropConfigValue("ctwa_ad_account_token_storage_kill_switch_web"),web_ui_refresh_m1:f.getABPropConfigValue("web_ui_refresh_m1"),single_e2ee_session_migration_state_outgoing:f.getABPropConfigValue("single_e2ee_session_migration_state_outgoing")};var g=(yield k(c&&a));if(g){yield (h||(h=b("Promise"))).all([d("WAWebABPropsUpdateFromStorage").updateABPropsFromStorage(),d("WAWebEventSamplingCache").updateEventSamplingFromStorage()]);d("WAWebCmd").Cmd.onAbPropsUpdate(f);return}}catch(a){e===0&&d("WALogger").ERROR(i()).verbose().devConsole(a).sendLogs("failed to sync ABProps"),yield d("WAPromiseDelays").delayMs(10*1e3*Math.random())}});return m.apply(this,arguments)}g.syncABProps=k;g.syncABPropsTask=a}),98); __d("WAWebLogDailyStatsJob",["WAJobOrchestratorTypes","WAWebOrchestratorNonPersistedJob","WAWebTasksDailyStatsTask"],(function(a,b,c,d,e,f,g){function a(){return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("logDailyStats",function(a){return d("WAWebTasksDailyStatsTask").logDailyStats()},{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.BEST_EFFORT}).waitUntilCompleted()}g.logDailyStatsJob=a}),98); __d("WAWebLogHistorySyncStatusAfterPairingJob",["Promise","WAJobOrchestratorTypes","WALogger","WATimeUtils","WAWebApiHistorySyncNotification","WAWebHistorySyncNotificationUtils","WAWebMdBootstrapHistorySyncStatusAfterPairingWamEvent","WAWebOrchestratorNonPersistedJob","WAWebSyncBootstrap","WAWebSyncdMdSyncFieldstatMeta","WAWebUserPrefsHistorySync","WAWebUserPrefsTypes","WAWebWamEnumActiveTimeAfterPairing","WAWebWamEnumMdBootstrapHistoryPayloadType","WAWebWamEnumMdHistorySyncStatusResult","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] do not log status as no requirment meets"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] log status for 5 minutes after pairing"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] log status for 10 minutes after pairing"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] log status for 20 minutes after pairing"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] log status for 40 minutes after pairing"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] log status for 60 minutes after pairing"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] skip sync status logging as we've logged for more than 5 times"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] skip sync status logging as it's too soon after pairing"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] log history sync status with time after pairing "," mins and logging count ",""]);q=function(){return a};return a}function a(a,c){a=(d("WATimeUtils").unixTime()-a)/60;d("WALogger").DEV(q(),a,c);if(a<5){d("WALogger").LOG(p());return(h||(h=b("Promise"))).resolve()}return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("logHistorySyncStatusAfterPairing",function(a){return r(a.timeAfterPairingMins,a.loggingCount)},{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.LOW}).waitUntilCompleted({timeAfterPairingMins:a,loggingCount:c})}function r(a,b){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if(b>=5){d("WALogger").LOG(o());return}if(a>=60){d("WALogger").LOG(n());yield t(d("WAWebWamEnumActiveTimeAfterPairing").ACTIVE_TIME_AFTER_PAIRING.MINS_60);void d("WAWebUserPrefsHistorySync").setHistorySyncStatusAfterPairingLoggingCount(5);return}if(b<4&&a>=40){d("WALogger").LOG(m());yield t(d("WAWebWamEnumActiveTimeAfterPairing").ACTIVE_TIME_AFTER_PAIRING.MINS_40);void d("WAWebUserPrefsHistorySync").setHistorySyncStatusAfterPairingLoggingCount(4);return}if(b<3&&a>=20){d("WALogger").LOG(l());yield t(d("WAWebWamEnumActiveTimeAfterPairing").ACTIVE_TIME_AFTER_PAIRING.MINS_20);void d("WAWebUserPrefsHistorySync").setHistorySyncStatusAfterPairingLoggingCount(3);return}if(b<2&&a>=10){d("WALogger").LOG(k());yield t(d("WAWebWamEnumActiveTimeAfterPairing").ACTIVE_TIME_AFTER_PAIRING.MINS_10);void d("WAWebUserPrefsHistorySync").setHistorySyncStatusAfterPairingLoggingCount(2);return}if(b<1&&a>=5){d("WALogger").LOG(j());yield t(d("WAWebWamEnumActiveTimeAfterPairing").ACTIVE_TIME_AFTER_PAIRING.MINS_5);void d("WAWebUserPrefsHistorySync").setHistorySyncStatusAfterPairingLoggingCount(1);return}d("WALogger").LOG(i())});return s.apply(this,arguments)}function t(a){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield v(a)});return u.apply(this,arguments)}function v(a){return w.apply(this,arguments)}function w(){w=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield d("WAWebSyncdMdSyncFieldstatMeta").MdSyncFieldStatsMeta.getMdSessionId());b=new(d("WAWebMdBootstrapHistorySyncStatusAfterPairingWamEvent").MdBootstrapHistorySyncStatusAfterPairingWamEvent)({mdBootstrapHistoryPayloadType:d("WAWebWamEnumMdBootstrapHistoryPayloadType").MD_BOOTSTRAP_HISTORY_PAYLOAD_TYPE.RECENT_HISTORY,mdSessionId:b,mdTimestamp:d("WATimeUtils").unixTimeMs(),activeTimeAfterPairing:a,isLoopRunning:c("WAWebSyncBootstrap").getIsHistorySyncRunning()});a=(yield d("WAWebUserPrefsHistorySync").getLastHistoryRecentSyncedChunk());var e=a!=null?a.chunkOrder:-1,f=a!=null?a.progress:-1;b.lastProcessedNotificationChunkOrder=e;b.lastProcessedNotificationChunkProgress=f;f=(f=(yield d("WAWebUserPrefsHistorySync").getHistorySyncTotalProcessedMessageCount()))!=null?f:0;b.totalProcessedMessageCount=f;f=(yield d("WAWebUserPrefsHistorySync").getHistorySyncStatus());if((f==null?void 0:f.recentCompleted)===!0){b.mdHistorySyncStatusResult=d("WAWebWamEnumMdHistorySyncStatusResult").MD_HISTORY_SYNC_STATUS_RESULT.SUCCESS;b.commit();return}f=(yield d("WAWebHistorySyncNotificationUtils").getUnprocessedRecentSyncNotifications());var g=f.length;b.unprocessedNotificationCount=g;f=g>0?(g=f[0].chunkOrder)!=null?g:0:-1;b.nextNotificationChunkOrder=f;if(d("WAWebApiHistorySyncNotification").inFlightChunk.size>0){b.mdHistorySyncStatusResult=d("WAWebWamEnumMdHistorySyncStatusResult").MD_HISTORY_SYNC_STATUS_RESULT.IN_PROGRESS;b.commit();return}g=a?e+1:1;f=(yield d("WAWebUserPrefsHistorySync").getRecentSyncSingleChunkStatus());a=x(f,g);b.mdHistorySyncStatusResult=a;b.commit()});return w.apply(this,arguments)}function x(a,b){if(a==null||a[b]==null)return d("WAWebWamEnumMdHistorySyncStatusResult").MD_HISTORY_SYNC_STATUS_RESULT.FAIL_TO_RECEIVE;switch(a[b]){case d("WAWebUserPrefsTypes").HistorySyncSingleChunkStatusType.RECEIVED:return d("WAWebWamEnumMdHistorySyncStatusResult").MD_HISTORY_SYNC_STATUS_RESULT.FAIL_TO_STORE_CHUNK;case d("WAWebUserPrefsTypes").HistorySyncSingleChunkStatusType.NOTIFICATION_STORED:return d("WAWebWamEnumMdHistorySyncStatusResult").MD_HISTORY_SYNC_STATUS_RESULT.FAIL_TO_FETCH;case d("WAWebUserPrefsTypes").HistorySyncSingleChunkStatusType.DOWNLOADING:return d("WAWebWamEnumMdHistorySyncStatusResult").MD_HISTORY_SYNC_STATUS_RESULT.FAIL_TO_DOWNLOAD;case d("WAWebUserPrefsTypes").HistorySyncSingleChunkStatusType.DOWNLOADED:return d("WAWebWamEnumMdHistorySyncStatusResult").MD_HISTORY_SYNC_STATUS_RESULT.PROTOBUF_ERROR;case d("WAWebUserPrefsTypes").HistorySyncSingleChunkStatusType.DECODED:return d("WAWebWamEnumMdHistorySyncStatusResult").MD_HISTORY_SYNC_STATUS_RESULT.FAIL_TO_PREPROCESS;case d("WAWebUserPrefsTypes").HistorySyncSingleChunkStatusType.MESSAGE_PREPROCESSED:return d("WAWebWamEnumMdHistorySyncStatusResult").MD_HISTORY_SYNC_STATUS_RESULT.FAIL_TO_ENCRYPT;case d("WAWebUserPrefsTypes").HistorySyncSingleChunkStatusType.ENCRYPTED:return d("WAWebWamEnumMdHistorySyncStatusResult").MD_HISTORY_SYNC_STATUS_RESULT.FAIL_TO_STORE;default:return d("WAWebWamEnumMdHistorySyncStatusResult").MD_HISTORY_SYNC_STATUS_RESULT.OTHER_ERROR}}g.logHistorySyncStatusAfterPairingJob=a;g.logHistorySyncStatusAfterPairing=r;g.commitHistorySyncStatusData=t}),98); __d("WAWebNewsletterReportUtils",["Promise","WAJids","WALogger","WASmaxSpamNewsletterReportRPC","WAWebDBMsgUtils","WAWebMessageAssociation.flow","WAWebMessageAssociationUIUtils","WAWebMsgType","WAWebPollCreationUtils","WAWebReportSpamJob","WAWebReportUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["parseNewsletterReportResponse: server response with ",", ",""]);i=function(){return a};return a}function j(a){switch(a.name){case"NewsletterReportResponseError":var b=parseInt(a.value.errorSpamIqErrors.value,10),c=a.value.errorSpamIqErrors.name;d("WALogger").WARN(i(),b,c);return{errorCode:b,errorText:c};default:a.name;return a.value}}function k(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){return a.parentMsgKey!=null?d("WAWebDBMsgUtils").getMsgByMsgKey(a.parentMsgKey):null});return l.apply(this,arguments)}function m(a,b){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if(a==null)return d("WAWebReportSpamJob").loadMsgsForSpamReport(b,d("WAWebReportSpamJob").SPAM_REPORT_MESSAGE_COUNT,null);b=[a];if(a.type===d("WAWebMsgType").MSG_TYPE.POLL_CREATION&&a.pollContentType===d("WAWebPollCreationUtils").PollContentType.IMAGE)b.push.apply(b,d("WAWebMessageAssociationUIUtils").getHiddenAssociatedMessages(a.id));else if(a.associationType===d("WAWebMessageAssociation.flow").MessageAssociationType.MEDIA_POLL){a=(yield k(a));a!=null&&b.push.apply(b,d("WAWebMessageAssociationUIUtils").getHiddenAssociatedMessages(a.id))}return b});return n.apply(this,arguments)}function a(a,b,c){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e){c=(yield m(c,a));var f;c=(yield (h||(h=b("Promise"))).all(c.map(function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){b=(yield d("WAWebReportUtils").getMessageMixinArgs(b));b!=null&&(f=babelHelpers["extends"]({messageFrom:d("WAJids").toNewsletterJid(a.id.toJid())},b));return f});return function(a){return c.apply(this,arguments)}}())));e={spamListJid:d("WAJids").toNewsletterJid(a.id.toJid()),spamListSpamFlow:e,spamListSubject:a.name,messageArgs:c.filter(Boolean)};c=(yield d("WASmaxSpamNewsletterReportRPC").sendNewsletterReportRPC(e));return j(c)});return o.apply(this,arguments)}g["default"]=a}),98); __d("WAWebSpamConstants",["WAWebMsgType"],(function(a,b,c,d,e,f,g){a=Object.freeze({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",ChatListNoInsubBlock:"chat_list_noinsub_block",NotificationBlock:"notification_block",StatusPostReport:"status_post_report",NewsletterInfoReport:"newsletter_info_report",ChatFmxCardSafetyToolsReport:"chat_fmx_card_safety_tools_report",ChatFmxCardSafetyToolsReportSuspicious:"chat_fmx_card_safety_tools_report_suspicious",GroupFmxCardLeave:"group_fmx_card_leave",GroupFmxCardLeaveNonSuspicious:"group_fmx_card_leave_non_suspicious",GroupInfoLeaveReportUpsell:"group_info_leave_report_upsell",GroupChatlistLeaveReportUpsell:"group_chatlist_leave_report_upsell",GroupOverflowMenuLeaveReportUpsell:"group_overflow_menu_leave_report_upsell",GroupSafetyCheckModalUpsell:"group_safety_check_bottom_sheet"});c=new Set([(b=d("WAWebMsgType")).MSG_TYPE.CHAT,b.MSG_TYPE.AUDIO,b.MSG_TYPE.IMAGE,b.MSG_TYPE.PTT,b.MSG_TYPE.PTV,b.MSG_TYPE.VIDEO,b.MSG_TYPE.VCARD,b.MSG_TYPE.LIST,b.MSG_TYPE.LIST_RESPONSE,b.MSG_TYPE.BUTTONS_RESPONSE,b.MSG_TYPE.NATIVE_FLOW,b.MSG_TYPE.DOCUMENT,b.MSG_TYPE.STICKER,b.MSG_TYPE.LOCATION,b.MSG_TYPE.POLL_CREATION,b.MSG_TYPE.POLL_RESULT_SNAPSHOT,b.MSG_TYPE.STATUS,b.MSG_TYPE.EVENT_CREATION,b.MSG_TYPE.STICKER_PACK]);e=new Set([].concat(Array.from(c),[b.MSG_TYPE.UNKNOWN,b.MSG_TYPE.REVOKED,b.MSG_TYPE.CIPHERTEXT,b.MSG_TYPE.INTERACTIVE]));g.SpamFlow=a;g.SUPPORTED_MESSAGE_TYPES_FOR_MESSAGE_LEVEL_REPORTING=c;g.SPAM_REPORT_SUPPORTED_MESSAGE_TYPES=e}),98); __d("WAWebIsSpamSupportedForMessageType",["WAWebSpamConstants"],(function(a,b,c,d,e,f,g){function a(a){return d("WAWebSpamConstants").SUPPORTED_MESSAGE_TYPES_FOR_MESSAGE_LEVEL_REPORTING.has(a)}function b(a){return d("WAWebSpamConstants").SPAM_REPORT_SUPPORTED_MESSAGE_TYPES.has(a)}g.isMsgTypeSupportedForMsgLevelReporting=a;g.isSpamSupportedForMessageType=b}),98); __d("WAWebReportSpamJob",["Promise","WAJids","WALogger","WASmaxGroupsAcknowledgeGroupRPC","WASmaxSpamGroupReportRPC","WASmaxSpamIndividualReportRPC","WASmaxSpamStatusReportRPC","WAWebABProps","WAWebChatGetters","WAWebIsSpamSupportedForMessageType","WAWebMessageAssociationUIUtils","WAWebMsgGetters","WAWebMsgType","WAWebNewsletterReportUtils","WAWebNoop","WAWebPollCreationUtils","WAWebReportUtils","WAWebSchemaChat","WAWebUserPrefsMeUser","WAWebViewMode.flow","WAWebViewModeUtils","WAWebWidToJid","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["reportStatus: server response with ",", ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["get chat table merge failed"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[callp] acknowledging group ",""]);k=function(){return a};return a}var l=5;function m(a,b,c){var e=[],f=a.msgs.toArray().reverse(),g=b;for(var h=0;h<f.length;h++){if(e.length>=b)break;var i=f[h];if(!d("WAWebIsSpamSupportedForMessageType").isSpamSupportedForMessageType(i.type)&&i.type!==d("WAWebMsgType").MSG_TYPE.ALBUM||d("WAWebMsgGetters").getIsBotResponse(i)||i.from.equals(d("WAWebUserPrefsMeUser").getMaybeMeUser())||!d("WAWebViewModeUtils").isViewModeVisibleInSurface(d("WAWebViewMode.flow").ViewModeSurface.CHAT_SPAM_REPORT,i.viewMode))continue;if(c){if(d("WAWebChatGetters").getIsGroup(a)&&!c.equals(i.author))continue;if(d("WAWebChatGetters").getIsUser(a)&&!c.equals(i.from))continue}if(i.type===d("WAWebMsgType").MSG_TYPE.ALBUM)e.push.apply(e,d("WAWebMessageAssociationUIUtils").getHiddenAssociatedMessages(i.id).slice(0,4));else if(i.type===d("WAWebMsgType").MSG_TYPE.POLL_CREATION&&i.pollContentType===d("WAWebPollCreationUtils").PollContentType.IMAGE){e.push(i);var j=d("WAWebMessageAssociationUIUtils").getHiddenAssociatedMessages(i.id);e.push.apply(e,j);g+=j.length}else e.push(i)}return e.slice(0,g)}function a(a){var b;((b=a.buttonsMessage)==null?void 0:b.buttons)!=null&&(a.buttonsMessage=babelHelpers["extends"]({},a.buttonsMessage,{buttons:a.buttonsMessage.buttons.map(function(a){if(a.nativeFlowInfo){var b;b=JSON.parse((b=a.nativeFlowInfo.paramsJson)!=null?b:"{}");delete b.reference_id;delete b.total_amount;return babelHelpers["extends"]({},a,{nativeFlowInfo:babelHelpers["extends"]({},a.nativeFlowInfo,{paramsJson:JSON.stringify(b)})})}return a})}));((b=a.messageContextInfo)==null?void 0:b.messageSecret)!=null&&(a.messageContextInfo=babelHelpers["extends"]({},a.messageContextInfo,{messageSecret:null}));return a}function e(a,b){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e=(yield d("WAWebReportUtils").getMessageMixinArgs(b));if(e==null)throw c("err")("report status failed due to unsupported msg type");var f=d("WAWebMsgGetters").getSender(b);if(f==null)throw c("err")("report status failed due to missing sender");e=babelHelpers["extends"]({},e,{messageParticipantMixinArgs:{messageParticipant:d("WAWebWidToJid").widToUserJid(f)}});f={spamListSpamFlow:a,spamListJid:d("WAJids").STATUS_JID,messageFrom:d("WAJids").STATUS_JID,messageRecipientMixinArgs:{messageTo:d("WAWebWidToJid").widToUserJid(b.to)},messageMixinArgs:e};a=(yield d("WASmaxSpamStatusReportRPC").sendStatusReportRPC(f));switch(a.name){case"StatusReportResponseError":b=parseInt(a.value.errorSpamIqErrors.value.code,10);e=a.value.errorSpamIqErrors.value.text;d("WALogger").WARN(i(),b,e);return{errorCode:b,errorText:e};default:a.name;return a.value}});return n.apply(this,arguments)}function f(a){d("WAWebChatGetters").getIsGroup(a)&&(d("WALogger").LOG(k(),a.id.toLogString()),d("WASmaxGroupsAcknowledgeGroupRPC").sendAcknowledgeGroupRPC({iqTo:d("WAWebWidToJid").widToGroupJid(a.id)})["catch"](c("WAWebNoop")));return d("WAWebSchemaChat").getChatTable().merge(a.id.toString(),{notSpam:!0})["catch"](function(a){d("WALogger").ERROR(j()).verbose().devConsole(a).sendLogs("get chat table merge failed when sending spam report");throw c("err")("get chat table merge failed")})}function o(a,b,c){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e){var f,g=(yield d("WAWebReportUtils").getMessageMixinArgs(b));g!=null&&(f=babelHelpers["extends"]({messageSenderOrRecipientMixinGroupArgs:{messageSender:{messageFrom:d("WAWebWidToJid").widToUserJid(b.from)}}},g));g=d("WAWebMsgGetters").getSender(b);if(g==null)throw c("err")("report status failed due to missing sender");b={spamListSpamFlow:e,spamListJid:d("WAWebWidToJid").widToUserJid(g),messageArgs:f!=null?[f]:[],tCTokenMixinArgs:y(a)};e=(yield d("WASmaxSpamIndividualReportRPC").sendIndividualReportRPC(b));return d("WAWebReportUtils").parseIndividualReportResponse(e)});return p.apply(this,arguments)}function q(a,b){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b={spamListJid:d("WAWebWidToJid").widToGroupJid(a.id),spamListSpamFlow:b,spamListSubject:a.formattedTitle};a=(yield d("WASmaxSpamGroupReportRPC").sendGroupReportRPC(b));return d("WAWebReportUtils").parseGroupReportResponse(a)});return r.apply(this,arguments)}function s(a,b,c){return t.apply(this,arguments)}function t(){t=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e){var f=[];c!=null?f=[c]:f=m(a,l,null);var g,i;c=(yield (h||(h=b("Promise"))).all(f.map(function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){var c=(yield d("WAWebReportUtils").getMessageMixinArgs(b));b.author?i=d("WAWebWidToJid").widToUserJid(b.author):b.from.isUser()&&(i=d("WAWebWidToJid").widToUserJid(b.from));c!=null&&(g=babelHelpers["extends"]({messageFrom:d("WAWebWidToJid").widToGroupJid(a.id)},c,i!=null&&{messageParticipantMixinArgs:{messageParticipant:i}}));return g});return function(a){return c.apply(this,arguments)}}())));f={spamListJid:d("WAWebWidToJid").widToGroupJid(a.id),spamListSpamFlow:e,spamListSubject:a.formattedTitle,messageArgs:c.filter(Boolean)};e=(yield d("WASmaxSpamGroupReportRPC").sendGroupReportRPC(f));return d("WAWebReportUtils").parseGroupReportResponse(e)});return t.apply(this,arguments)}function u(a,b,c){return v.apply(this,arguments)}function v(){v=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e){var f=[];c!=null?f=[c]:f=m(a,l,a.id);var g;c=(yield (h||(h=b("Promise"))).all(f.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield d("WAWebReportUtils").getMessageMixinArgs(a));b!=null&&(g=babelHelpers["extends"]({messageSenderOrRecipientMixinGroupArgs:{messageSender:{messageFrom:d("WAWebWidToJid").widToUserJid(a.from)}}},b));return g});return function(b){return a.apply(this,arguments)}}())));f={spamListSpamFlow:e,messageArgs:c.filter(Boolean),tCTokenMixinArgs:y(a)};e=(yield d("WASmaxSpamIndividualReportRPC").sendIndividualReportRPC(f));return d("WAWebReportUtils").parseIndividualReportResponse(e)});return v.apply(this,arguments)}function w(a,b,c){return x.apply(this,arguments)}function x(){x=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e){var f;d("WAWebChatGetters").getIsNewsletter(a)?f=(yield c("WAWebNewsletterReportUtils")==null?void 0:c("WAWebNewsletterReportUtils")(a,e,b)):e!=null&&!d("WAWebChatGetters").getIsGroup(a)?f=(yield o(a,e,b)):a.isParentGroup===!0?f=(yield q(a,b)):d("WAWebChatGetters").getIsGroup(a)?f=(yield s(a,e,b)):f=(yield u(a,e,b));return f});return x.apply(this,arguments)}function y(a){var b,c=a.tcToken;a=a.tcTokenTimestamp;d("WAWebABProps").getABPropConfigValue("enable_spam_report_iq_with_privacy_token")&&c!=null&&(d("WAWebABProps").getABPropConfigValue("enable_privacy_token_with_timestamp")&&a!=null?b={tctokenT:a,privacyTokenContentsMixinArgs:{anyElementValue:new Uint8Array(c)}}:b={privacyTokenContentsMixinArgs:{anyElementValue:new Uint8Array(c)}});return b}g.SPAM_REPORT_MESSAGE_COUNT=l;g.loadMsgsForSpamReport=m;g.getSpamMessageProtobuf=a;g.reportStatus=e;g.sendNotSpamJob=f;g.reportSpam=w}),98); __d("WAWebReportUtils",["Promise","WALogger","WAStanzaUtils","WAWebBackendJobsCommon","WAWebDBReportingTokenUtils","WAWebE2EProtoUtils","WAWebIsSpamSupportedForMessageType","WAWebMessagingGatingUtils","WAWebMsgGetters","WAWebMsgType","WAWebOTPHelper","WAWebOutgoingMessage","WAWebPollCreationUtils","WAWebProtobufsE2E.pb","WAWebReportSpamJob","WAWebReportingTokenUtils","WAWebViewOnceState","WAWebWidToJid","asyncToGeneratorRuntime","encodeProtobuf"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[WA-ICE][Reporting] getMessageMixinArgs failed for type: ",", subtype: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["parseIndividualReportResponse: server response with ",", ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["parseGroupReportResponse: server response with ",", ",""]);k=function(){return a};return a}function a(a){switch(a.name){case"GroupReportResponseError":var b=parseInt(a.value.errorSpamIqErrors.value.code,10),c=a.value.errorSpamIqErrors.value.text;d("WALogger").WARN(k(),b,c);return{errorCode:b,errorText:c};default:a.name;return a.value}}function c(a){switch(a.name){case"IndividualReportResponseError":var b=parseInt(a.value.errorSpamIqErrors.value.code,10),c=a.value.errorSpamIqErrors.value.text;d("WALogger").WARN(j(),b,c);return{errorCode:b,errorText:c};default:a.name;return a.value}}function l(a,b){var c=a.conversation;if(!b.isFromTemplate||c==null)return a;b=b.buttons;b==null?void 0:b.forEach(function(a){a=d("WAWebOTPHelper").getOTPCodeFromButton(a);if(a!=null){var b;c=(b=c)==null?void 0:b.replace(a,"<code>")}});a.conversation=c;return a}function m(a){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a.type===d("WAWebMsgType").MSG_TYPE.CIPHERTEXT||a.type===d("WAWebMsgType").MSG_TYPE.UNKNOWN)return{deletedReason:null,messagePayloadTypesArgs:{messageWithType:{contentTypeTextOrMediaMixinGroupArgs:{isContentTypeText:!0}}},hsmTemplateMixin:null,rawArgs:null};var b,c=a.isViewOnce&&!d("WAWebViewOnceState").isUnviewed(a.safe());c&&(b=d("WAWebViewOnceState").isViewed(a.safe())?"view_once_opened":"view_once_expired");var e=d("WAWebReportSpamJob").getSpamMessageProtobuf(d("WAWebOutgoingMessage").createOutgoingMsgModelProtobuf(d("WAWebOutgoingMessage").OutgoingMessageOriginType.Report,a));e=l(e,a);var f=d("WAWebBackendJobsCommon").mediaTypeFromProtobuf(e);c=c?null:d("encodeProtobuf").encodeProtobuf(d("WAWebProtobufsE2E.pb").MessageSpec,e).readByteArray();e=d("WAWebE2EProtoUtils").typeAttributeFromProtobuf(e);var g;switch(e){case"poll":g={messageWithPoll:{metaContenttype:a.pollContentType===d("WAWebPollCreationUtils").PollContentType.IMAGE?"image":"text"}};break;case"text":g={messageWithType:{contentTypeTextOrMediaMixinGroupArgs:{isContentTypeText:!0}}};break;default:g={messageWithType:{contentTypeTextOrMediaMixinGroupArgs:{isContentTypeMedia:!0}}};break}e=c!=null?babelHelpers["extends"]({rawElementValue:c,rawMixinsArgs:d("WAWebBackendJobsCommon").CIPHERTEXT_VERSION===2?{isRawV2:!0}:{rawV3:{rawProtocolV:d("WAWebBackendJobsCommon").CIPHERTEXT_VERSION}}},f&&{rawMediatype:f}):null;c=a.isFromTemplate&&a.templateId!=null?{hsmTid:a.templateId}:null;return{deletedReason:b,messagePayloadTypesArgs:g,hsmTemplateMixin:c,rawArgs:e}});return n.apply(this,arguments)}function o(a,b){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){if(!d("WAWebMessagingGatingUtils").isReportingTokenReceivingEnabled())return null;a=(yield d("WAWebDBReportingTokenUtils").getReportingInfosFromMsgKeys([a.toString()]));if(a.length===0)return null;var e=d("WAWebMsgGetters").getSender(c),f=c.messageSecret,g=d("WAWebReportingTokenUtils").getRemoteJidOnReceiverSide(c);c=a.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.version;b=b===void 0?-1:b;var c=a.reportingTokenContentOpaqueData,h=a.reportingToken,i=a.reportingTokenKey;c=c!=null?{reportingContentElementValue:c}:null;var j;i!=null?j=i:f!=null&&e!=null&&(j=(yield d("WAWebReportingTokenUtils").genReportingTokenKeyFromMessageSecret({messageSecret:f,stanzaId:a.stanzaId,senderJid:d("WAWebWidToJid").widToUserJid(e),remoteJid:g})));i=j!=null?new Uint8Array(j):new Uint8Array(d("WAWebReportingTokenUtils").REPORTING_TOKEN_KEY_SIZE);b=b!=null&&h!=null?{reportingTokenV:b,reportingTokenElementValue:h,reportingTokenKeyElementValue:i}:null;return{reportingTagElementValue:a.reportingTag,reportingTagTsS:a.msgTs,reportingTagId:d("WAStanzaUtils").toStanzaId(a.stanzaId),reportingContentArgs:c,contentValidationArgs:b}});return function(b){return a.apply(this,arguments)}}());return{reportingValidationArgs:yield (h||(h=b("Promise"))).all(c)}});return p.apply(this,arguments)}function e(a){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!d("WAWebIsSpamSupportedForMessageType").isSpamSupportedForMessageType(a.type))return null;var b=a.id;if(a.type==="revoked"){var c;b=(c=a.protocolMessageKey)!=null?c:a.id}try{c=(yield m(a));var e=c.deletedReason,f=c.messagePayloadTypesArgs,g=c.hsmTemplateMixin;c=c.rawArgs;f={messagePayloadTypesArgs:f,messageT:a.t,messageId:d("WAStanzaUtils").toStanzaId(b.id),rawArgs:c,messageDeletedReason:e,messageWithHsmTemplateMixinArgs:g};d("WAWebMsgGetters").getIsEdited(a)&&(f=babelHelpers["extends"]({},f,{hasMessageEdit:!0}));a.type==="revoked"&&(f=babelHelpers["extends"]({},f,a.subtype==="sender"?{hasRevoke:!0}:{hasAdminRevoke:!0}));d("WAWebMsgGetters").getIsMarketingMessage(a)&&(f=babelHelpers["extends"]({},f,{sMBBroadcastSourceMixinArgs:{metaBizSource:"smb_promo"}}));c=(yield o(b,a));c!=null&&(f=babelHelpers["extends"]({waMessageReportingMixinArgs:{hasRaw:!1,clientReportingContentValidationMixinArgs:c}},f));return f}catch(b){d("WALogger").ERROR(i(),a.type,a.subtype).tags("wa-ice","reporting").devConsole(b).sendLogs("reporting-get-message-failed");throw b}});return q.apply(this,arguments)}g.parseGroupReportResponse=a;g.parseIndividualReportResponse=c;g.getMessageMixinArgs=e}),98); __d("WAWebSendServerErrorReceiptJob",["Promise","WABase64","WADeprecatedSendIq","WALogger","WAWap","WAWebChatGetters","WAWebCommsAckParser","WAWebCommsWapMd","WAWebCryptoMediaRetry","WAWebFrontendMsgGetters","WAWebMsgGetters","WAWebUserPrefsMeUser","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[media][rmr] Called RMR with null mediaKey"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletter] Called RMR on newsletter media, which has null mediaKey"]);j=function(){return a};return a}function a(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=a.id.id;if(d("WAWebMsgGetters").getIsNewsletterMsg(a)){d("WALogger").ERROR(j()).tags("newsletter").sendLogs("newsletter-called-rmr");return(h||(h=b("Promise"))).resolve()}if(a.mediaKey==null){d("WALogger").ERROR(i()).tags("media","non-sad").sendLogs("rmr-called-with-null-media-key",{sampling:.01});return(h||(h=b("Promise"))).resolve()}var e=d("WABase64").decodeB64(a.mediaKey);e=(yield d("WAWebCryptoMediaRetry").encryptServerErrorReceipt(e,c));var f=e.ciphertext;e=e.iv;var g=d("WAWebFrontendMsgGetters").getChat(a),k=d("WAWap").CUSTOM_STRING(g.id.toString({legacy:!0}));g=d("WAWebChatGetters").getIsGroup(g)||d("WAWebChatGetters").getIsBroadcast(g)?d("WAWap").CUSTOM_STRING(d("WAWebMsgGetters").getSender(a).toString({legacy:!0})):d("WAWap").DROP_ATTR;var l=d("WAWebUserPrefsMeUser").getMeUser();f=d("WAWap").wap("receipt",{type:"server-error",to:d("WAWebCommsWapMd").USER_JID(l),id:d("WAWap").CUSTOM_STRING(c)},d("WAWap").wap("encrypt",null,d("WAWap").wap("enc_p",null,f),d("WAWap").wap("enc_iv",null,e)),d("WAWap").wap("rmr",{jid:k,from_me:d("WAWap").CUSTOM_STRING(String(d("WAWebMsgGetters").getIsSentByMe(a))),participant:g}));return d("WADeprecatedSendIq").deprecatedSendStanzaAndWaitForAck(f,d("WAWebCommsAckParser").toCoreAckTemplate({id:c,"class":"receipt",type:"server-error",from:l,participant:null}))});return k.apply(this,arguments)}g["default"]=a}),98); __d("WAWebDBDeviceListFanout",["WALogger","WAWebApiDeviceList","WAWebBizCoexGatingUtils","WAWebUserPrefsMeUser","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["getFanOutList: no device is found for ",", just send to the primary device"]);h=function(){return a};return a}function a(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.wids,c=a.chatWidSetToIncludeHostedInFanoutOneToOneChatOnly;a=(yield d("WAWebApiDeviceList").getDeviceIds(b));var e=new Map();a.forEach(function(a,f){if(a){var g=a.devices;g.forEach(function(b){var f=b.id===99||b.isHosted===!0,g=!1;d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&c!=null&&(g=(c==null?void 0:c.isUser())===!0);if(f&&!g)return;f=d("WAWebWidFactory").createDeviceWidFromDeviceListPk(a.id,b.id,b.isHosted);d("WAWebUserPrefsMeUser").isMeDevice(f)||e.set(f.toString(),f)})}else{g=d("WAWebWidFactory").toUserWid(b[f]);d("WALogger").LOG(h(),g.toString()).tags("messaging");d("WAWebUserPrefsMeUser").isMeAccount(g)||e.set(g.toString(),g)}});return Array.from(e.values())});return i.apply(this,arguments)}g.getFanOutList=a}),98); __d("WAWebMsgFanoutTypes",[],(function(a,b,c,d,e,f){a=Object.freeze({CHAT:"chat",GROUP_DIRECT:"groupDirect"});f.FANOUT_TYPE=a}),66); __d("WAWebResendUserMsg",["WALogger","WATimeUtils","WAWebDBDeviceListFanout","WAWebMsgFanoutTypes","WAWebMsgUtilsBridge","WAWebSendMsgCommonApi","WAWebSendMsgToDeviceList","WAWebSyncDeviceAdvDeviceListJob","WAWebUserPrefsMeUser","WAWebWamEnumMessageSendResultType","asyncToGeneratorRuntime","cr:10198","lodash"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["resendUserMsg: ",": got phash during the resend"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["resendUserMsg: ",": skip resending because this message has been overwritten by a revoke"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["resendUserMsg: ",": resending to devices: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["resendUserMsg: ",": skip resending to the empty list"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["resendUserMsg: ",": skip resending due to "," min timeout"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["resendUserMsg: "," to ",""]);m=function(){return a};return a}function a(a,b,c,d,e){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e,f,g){var n=a.data.to,o=a.data.id.id;d("WALogger").LOG(m(),o,n.toString()).tags("messaging");var p=d("WAWebSendMsgCommonApi").getResendTimeoutInSeconds();if(d("WATimeUtils").unixTime()-f>p){d("WALogger").LOG(l(),o,p/60).tags("messaging");(f=g.sendReporter)==null?void 0:f.postFailure({result:d("WAWebWamEnumMessageSendResultType").MESSAGE_SEND_RESULT_TYPE.ERROR_EXPIRED,isTerminal:!1});g.sendReporter=null;return}try{f=n.isLid()?(p=d("WAWebUserPrefsMeUser").getMaybeMeLid())!=null?p:d("WAWebUserPrefsMeUser").assertGetMe():d("WAWebUserPrefsMeUser").assertGetMe();p=(yield d("WAWebDBDeviceListFanout").getFanOutList({wids:[n,f]}));p=c("lodash").differenceBy(p,e,String);if(p.length===0){d("WALogger").LOG(k(),o).tags("messaging");(e=g.sendReporter)==null?void 0:e.postFailure({result:d("WAWebWamEnumMessageSendResultType").MESSAGE_SEND_RESULT_TYPE.ERROR_BACKFILL_USYNC_FAILED,isTerminal:!1});g.sendReporter=null;return}d("WALogger").LOG(j(),o,p.join(",")).tags("messaging");if(a.data.isOverwrittenByRevoke===!0){d("WALogger").LOG(i(),o).tags("messaging");return}e=(yield d("WAWebSendMsgToDeviceList").sendMsgToDeviceList(a,b,p,{fanoutType:d("WAWebMsgFanoutTypes").FANOUT_TYPE.CHAT,isResendingMsg:!0},g));b=e.phash;b!=null&&(d("WALogger").LOG(h(),o).tags("messaging"),void d("WAWebSyncDeviceAdvDeviceListJob").syncDeviceListJob([n,f],"message",b))}catch(a){(p=g.sendReporter)==null?void 0:p.postFailure({result:d("WAWebWamEnumMessageSendResultType").MESSAGE_SEND_RESULT_TYPE.ERROR_UNKNOWN,isTerminal:!1});g.sendReporter=null;throw a}yield d("WAWebMsgUtilsBridge").logMessageSendForChatThreadLogging(a.data)});return n.apply(this,arguments)}g.resendUserMsg=a}),98); __d("WAWebSendAppStateSyncMsgJob",["WADeprecatedSendIq","WALogger","WAWebCommsAckParser","WAWebE2EProtoGenerator","WAWebEventsWaitForOfflineDeliveryEnd","WAWebSendMsgCreateDeviceStanza","WAWebSendMsgTypes","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendKeyMsg: sending ",""]);h=function(){return a};return a}function a(a,b){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){yield d("WAWebEventsWaitForOfflineDeliveryEnd").waitForOfflineDeliveryEnd();d("WALogger").LOG(h(),a.id.toString()).tags("messaging");var c=a.to,e=d("WAWebE2EProtoGenerator").createPeerMsgProtobuf(a);e=(yield d("WAWebSendMsgCreateDeviceStanza").createUserDeviceMsgStanza({type:d("WAWebSendMsgTypes").SendMessageRecordType.Message,data:a},e,{to:c,recipient:null,option:{type:d("WAWebSendMsgCreateDeviceStanza").MsgType.AppStateSync,pushPriority:b}}));return d("WADeprecatedSendIq").deprecatedSendStanzaAndWaitForAck(e,d("WAWebCommsAckParser").toCoreAckTemplate({id:a.id.id,"class":"message",from:c,participant:null}))});return i.apply(this,arguments)}g.encryptAndSendKeyMsg=a}),98); __d("WAWebGroupMsgSendUtils",["WALogger","WAWebAddonGatingUtils","WAWebGroupType","WAWebMsgGetters","WAWebSchemaGroupMetadata","WAWebSchemaParticipant","WAWebUserPrefsMeUser","WAWebWamGroupMetricUtils","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["_getParticipantRecord: no participants record found for: ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["_getGroupData: no group metadata record found for: ",""]);i=function(){return a};return a}function a(a,b,c){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){var e=(yield d("WAWebSchemaGroupMetadata").getGroupMetadataTable().get(a));e==null&&d("WALogger").WARN(i(),a);a={groupId:a,amIAdmin:null,isCag:null,isLid:null,isLidAddressingMode:null,wamTypeOfGroup:null,participantCount:null,deviceCount:null,deviceSizeBucket:null,isCapiGroup:null};var f=(e==null?void 0:e.isLidAddressingMode)===!0;if(e!=null){var g=d("WAWebGroupType").getGroupTypeFromGroupMetadata(e);a.wamTypeOfGroup=d("WAWebGroupType").groupTypeToWamEnum(g);g=g===d("WAWebGroupType").GroupType.LINKED_ANNOUNCEMENT_GROUP;a.isLid=g&&(c==null?void 0:c.type)==="addon";a.isCag=g;a.isLidAddressingMode=f;a.isCapiGroup=e.hasCapi===!0}if(b!=null){c=b.admins.some(function(a){a=d("WAWebWidFactory").createWid(a);return f?d("WAWebUserPrefsMeUser").isMeAccount(a):d("WAWebUserPrefsMeUser").isMeAccountNonLid(a)});a.amIAdmin=c;Object.assign(a,d("WAWebWamGroupMetricUtils").getGroupMetricsFromDbRecord(b))}return a});return j.apply(this,arguments)}function c(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield d("WAWebSchemaParticipant").getParticipantTable().get(a));b==null&&d("WALogger").WARN(h(),a);return b});return k.apply(this,arguments)}function e(a,b){return b.isCag===!0?d("WAWebMsgGetters").getIsReaction(a)||d("WAWebAddonGatingUtils").isUnifiedInfraEnabledForType(a.type):!1}function f(a){var b=a.filter(function(a){return a.isLid()});a=a.length-b.length;return b.length+" lid participants & "+a+" pn participants"}function l(a){var b=a.isLidAddressingMode===!0?"lid":"pn";a=a.isCag===!0?"cag":"nonCag";return"group type: "+b+", "+a}g.getGroupData=a;g.getParticipantRecord=c;g.isCagAddon=e;g.formatWidTypeCountsForLog=f;g.formatGroupTypeForLog=l}),98); __d("WAWebPostE2eMessageSendMetric",["WAWebBackendJobsCommon","WAWebE2eMessageSendWamEvent","WAWebWamEnumAgentEngagementEnumType","WAWebWamEnumEditType","WAWebWamMsgUtils"],(function(a,b,c,d,e,f,g){function h(a){var b=a.to,c=a.retryCount,e=a.type,f=a.msg;a=a.editType;a=a===void 0?d("WAWebWamEnumEditType").EDIT_TYPE.NOT_EDITED:a;c=new(d("WAWebE2eMessageSendWamEvent").E2eMessageSendWamEvent)({e2eCiphertextVersion:d("WAWebBackendJobsCommon").CIPHERTEXT_VERSION,isLid:b.isLid(),retryCount:c,editType:a,botType:d("WAWebWamMsgUtils").getWamBotType(b,f==null?void 0:f.bizBotType)});a=d("WAWebBackendJobsCommon").getMetricE2eDestination(b);a!=null&&(c.e2eDestination=a);e!=null&&(c.e2eCiphertextType=d("WAWebBackendJobsCommon").getMetricE2eCiphertextType(e));f&&(c.messageMediaType=d("WAWebWamMsgUtils").getWamMediaType(f),b.isBot()&&(f.id.remote.isBot()?c.agentEngagementType=d("WAWebWamEnumAgentEngagementEnumType").AGENT_ENGAGEMENT_ENUM_TYPE.DIRECT_CHAT:c.agentEngagementType=d("WAWebWamEnumAgentEngagementEnumType").AGENT_ENGAGEMENT_ENUM_TYPE.INVOKED));return c}function a(a){a=h(a);a.e2eSuccessful=!0;a.commit()}function b(a){a=h(a);a.e2eSuccessful=!1;a.weight=1;a.commit()}g.postSuccessDirectE2eMessageSendMetric=a;g.postFailureDirectE2eMessageSendMetric=b}),98); __d("WAWebEncryptMsgProtobuf",["Promise","WALogger","WAWebBackendJobs.flow","WAWebBackendJobsCommon","WAWebE2eMessageSendWamEvent","WAWebGroupMsgSendUtils","WAWebLidFoundationalGatingUtils","WAWebMsgGetters","WAWebPostE2eMessageSendMetric","WAWebSendMsgCommonApi","WAWebSignal","WAWebSignalSessionApi","WAWebUserPrefsMeUser","WAWebWamAddressingModeUtils","WAWebWamEnumE2eDestination","WAWebWamEnumEditType","WAWebWamMsgUtils","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["encryptMsgSenderKey: encryption fail for ",", ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["encryptMsgProtobuf: encryption fail for ",", ",""]);j=function(){return a};return a}function a(a,b,c,d,e){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e,f,g,i){i===void 0&&(i=d("WAWebWamEnumEditType").EDIT_TYPE.NOT_EDITED);var k=d("WAWebLidFoundationalGatingUtils").shouldUseDeprecatedSessionForOutgoingMessage(a);try{f=(yield d("WAWebSignal").Cipher.encryptSignalProto(a,d("WAWebSendMsgCommonApi").encodeAndPad(f),k));var l=f.type;f=f.ciphertext;d("WAWebPostE2eMessageSendMetric").postSuccessDirectE2eMessageSendMetric({to:a,retryCount:e,type:l,msg:g,editType:i});return{type:l,ciphertext:f,isUsingDeprecatedLidSession:k}}catch(f){d("WALogger").WARN(j(),a.toString(),f).tags("messaging");d("WAWebSignalSessionApi").maybeDeleteUnconvertedSession(a);d("WAWebPostE2eMessageSendMetric").postFailureDirectE2eMessageSendMetric({to:a,retryCount:e,msg:g,editType:i});return(h||(h=b("Promise"))).reject(c("err")("[messaging] encryptMsgProtobuf: encryption fail for "+a.toString()+", "+f))}});return k.apply(this,arguments)}function e(a,b,c,d){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e,f,g){var j;j=new(d("WAWebE2eMessageSendWamEvent").E2eMessageSendWamEvent)(babelHelpers["extends"]({e2eSuccessful:!0,e2eCiphertextType:d("WAWebBackendJobsCommon").getMetricE2eCiphertextType(d("WAWebBackendJobs.flow").CiphertextType.Skmsg),e2eCiphertextVersion:d("WAWebBackendJobsCommon").CIPHERTEXT_VERSION,e2eDestination:d("WAWebWamEnumE2eDestination").E2E_DESTINATION.GROUP,messageMediaType:d("WAWebWamMsgUtils").getWamMediaType(a),retryCount:0,isLid:(j=g.isLid)!=null?j:void 0,typeOfGroup:(j=g.wamTypeOfGroup)!=null?j:void 0,editType:d("WAWebMsgGetters").getWamEditType(a)},d("WAWebWamAddressingModeUtils").getAddressingModeMetricsFromGroupMetadata(g)));var k=d("WAWebWamMsgUtils").getWamAgentEngagementType(a);k!=null&&(j.agentEngagementType=k);k=d("WAWebUserPrefsMeUser").assertGetMeLid();var l=d("WAWebUserPrefsMeUser").assertGetMe();a=d("WAWebGroupMsgSendUtils").isCagAddon(a,g)||g.isLidAddressingMode===!0?k:l;g=d("WAWebLidFoundationalGatingUtils").shouldUseDeprecatedSessionForOutgoingMessage(a);try{return babelHelpers["extends"]({},yield d("WAWebSignal").Cipher.encryptSenderKeyMsgSignalProto(e,a,f,g),{isUsingDeprecatedSenderKey:g})}catch(a){j.e2eSuccessful=!1;j.weight=1;d("WALogger").WARN(i(),e.toString(),a).tags("messaging");return(h||(h=b("Promise"))).reject(c("err")("[messaging] encryptMsgSenderKey: encryption fail for "+e.toString()+", "+a))}finally{j.commit()}});return l.apply(this,arguments)}g.encryptMsgProtobuf=a;g.encryptMsgSenderKey=e}),98); __d("WAWebSendMsgMetaNode",["WAWap","WAWebABProps","WAWebCommonMsgSubtypeTypes","WAWebCommsWapMd","WAWebE2EProtoUtils","WAWebHandleMsgCommon","WAWebLidFoundationalGatingUtils","WAWebMsgType","WAWebPollsGatingUtils","WAWebProtobufsE2E.pb","WAWebUsernameTypes","WAWebVerifyProtobufMsgObjectKeys","err"],(function(a,b,c,d,e,f,g){function h(a,b){b=b==null?void 0:b.origin;return a.isLid()&&b!=null&&b===d("WAWebUsernameTypes").LidOriginType.PNH_CTWA?b:null}function a(a,b,e,f,g){var l;l=(l=d("WAWebVerifyProtobufMsgObjectKeys").getUnwrappedProtobufMessage(e))!=null?l:e;e=i(l);l=j(l);var m;b.type==="addon"&&(m=d("WAWebE2EProtoUtils").extractCommentTargetIdAndSenderLid(b.data));f=a.isUser()&&a.isLid()||a.isGroup()&&((f==null?void 0:f.isLidAddressingMode)===!0||(f==null?void 0:f.isCag)===!0&&b.type==="addon");f=d("WAWebLidFoundationalGatingUtils").getSingleE2eeSessionOutgoingState()===d("WAWebLidFoundationalGatingUtils").SingleE2EESessionOutgoingState.FEATURE_ENABLED&&f;var n=g==null?void 0:g.isUsingDeprecatedLidSession;if(f&&n==null)throw c("err")("isUsingDeprecatedLidSession is required for LIDs");a=h(a,g);var o=k(b,g),p=!1;if(d("WAWebABProps").getABPropConfigValue("view_once_meta_tag_sending_enabled")){p=((b=b.data.mediaData)==null?void 0:b.isViewOnce)===!0}b=e!=null||l!=null||m!=null||a!=null||f||(g==null?void 0:g.appendHostedSenderIntent)===!0||o!=null||p;if(b){return d("WAWap").wap("meta",{origin:a!=null?d("WAWap").CUSTOM_STRING(a):d("WAWap").DROP_ATTR,sender_intent:(g==null?void 0:g.appendHostedSenderIntent)===!0?d("WAWap").CUSTOM_STRING("hosted"):d("WAWap").DROP_ATTR,polltype:(b=e)!=null?b:d("WAWap").DROP_ATTR,event_type:(a=l)!=null?a:d("WAWap").DROP_ATTR,thread_msg_id:((g=m)==null?void 0:g.threadMsgId)!=null?d("WAWap").CUSTOM_STRING(m.threadMsgId):d("WAWap").DROP_ATTR,thread_msg_sender_jid:((e=m)==null?void 0:e.threadMsgSenderLid)?d("WAWebCommsWapMd").USER_JID(m.threadMsgSenderLid):d("WAWap").DROP_ATTR,deprecated_lid_session:f&&n!=null?d("WAWap").CUSTOM_STRING(n===!0?"true":"false"):d("WAWap").DROP_ATTR,appdata:o!=null?d("WAWap").CUSTOM_STRING(o):d("WAWap").DROP_ATTR,view_once:p?d("WAWap").CUSTOM_STRING("true"):d("WAWap").DROP_ATTR})}}function i(a){var b;if(a.pollCreationMessage!=null||a.pollCreationMessageV2!=null||a.pollCreationMessageV3!=null)return d("WAWebHandleMsgCommon").POLL_TYPES.creation;if(((b=a.pollUpdateMessage)==null?void 0:b.vote)!=null)return d("WAWebHandleMsgCommon").POLL_TYPES.vote;return a.pollResultSnapshotMessage!=null&&d("WAWebPollsGatingUtils").isPollResultSnapshotPollTypeEnvelopeEnabled()?d("WAWebHandleMsgCommon").POLL_TYPES.result_snapshot:null}function j(a){if(a.eventMessage!=null)return d("WAWebHandleMsgCommon").EVENT_TYPES.creation;if(a.encEventResponseMessage!=null)return d("WAWebHandleMsgCommon").EVENT_TYPES.response;return((a=a.secretEncryptedMessage)==null?void 0:a.secretEncType)===d("WAWebProtobufsE2E.pb").Message$SecretEncryptedMessage$SecretEncType.EVENT_EDIT?d("WAWebHandleMsgCommon").EVENT_TYPES.edit:null}function k(a,b){a=a.data.type===d("WAWebMsgType").MSG_TYPE.PROTOCOL&&a.data.subtype===d("WAWebCommonMsgSubtypeTypes").MsgSubtype.EphemeralSyncResponse;b=(b==null?void 0:b.isCategoryPeerMessage)===!0;return a||b?"default":null}g.getOriginAttribute=h;g.genMetaNode=a}),98); __d("WAWebSendMsgCreateDeviceStanza",["invariant","$InternalEnum","Promise","WAWap","WAWebAdvSignatureApi","WAWebApiContact","WAWebBackendJobs.flow","WAWebBackendJobsCommon","WAWebBizCoexGatingUtils","WAWebCommsWapMd","WAWebDeviceSentMessageProtoUtils","WAWebE2EProtoGenerator","WAWebE2EProtoUtils","WAWebEncryptMsgProtobuf","WAWebGroupMsgSendUtils","WAWebHandleMsgCommon","WAWebICDCMetaApi","WAWebLid1X1MigrationGating","WAWebLidMigrationUtils","WAWebManageE2ESessionsJob","WAWebMsgType","WAWebReportingTokenUtils","WAWebSendMsgCommonApi","WAWebSendMsgMetaNode","WAWebSignalProtocolStore","WAWebUserPrefsMeUser","WAWebWidFactory","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g,h){var i,j=b("$InternalEnum").Mirrored(["Retry","AppStateSync"]);function a(a,b,c,d){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e){var f=c.to,g=c.recipient,i=c.option,k=b;yield d("WAWebManageE2ESessionsJob").ensureE2ESessions([f]);d("WAWebUserPrefsMeUser").isMeAccount(f)&&i.type!==j.AppStateSync?(g!=null||h(0,56363),k=d("WAWebDeviceSentMessageProtoUtils").wrapDeviceSentMessage(b,g),yield d("WAWebICDCMetaApi").populateICDCMeta(d("WAWebWidFactory").toUserWid(g),k)):yield d("WAWebICDCMetaApi").populateICDCMeta(d("WAWebWidFactory").toUserWid(f),k);return m(a,k,babelHelpers["extends"]({type:"user"},c),e)});return k.apply(this,arguments)}function e(a,b,c){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e,f){var g=f.to,h=f.participant,k=f.option;yield d("WAWebManageE2ESessionsJob").ensureE2ESessions([h]);if(k.type===j.AppStateSync)return(i||(i=b("Promise"))).reject(c("err")("[messaging] createGroupDeviceMsgStanza: not expect for App State Sync message"));k=a.data.id.remote;if(!k.isGroup())return(i||(i=b("Promise"))).reject(c("err")("[messaging] createGroupDeviceMsgStanza: function called for non group WID"));var l=(yield d("WAWebGroupMsgSendUtils").getParticipantRecord(k.toString()));k=(yield d("WAWebGroupMsgSendUtils").getGroupData(k.toString(),l,a));l=d("WAWebUserPrefsMeUser").isMeAccount(h)?d("WAWebDeviceSentMessageProtoUtils").wrapDeviceSentMessage(e,g):e;yield d("WAWebICDCMetaApi").populateICDCMeta(d("WAWebWidFactory").toUserWid(h),l);return m(a,l,babelHelpers["extends"]({type:"group",groupData:k},f))});return l.apply(this,arguments)}function m(a,b,c,d){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e){var f,g,i=a.data,k=c.to,l=c.option,m=c.botMessageSecret,n=c.isLidBot,o,p;c.type==="user"?o=c.recipient:p=c.participant;var q=p||k;f=(f=l.retryCount)!=null?f:0;var r=d("WAWebBackendJobsCommon").mediaTypeFromProtobuf(b),s=i.id,t=d("WAWebBackendJobsCommon").getMetricEditTypeFromMsg(b,i),u=!1;if(d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&f>0){var v;((v=a.data)==null?void 0:v.senderOrRecipientAccountTypeHosted)===!0&&(u=!0)}v=k.isBot()&&o!=null&&!o.isBot();g=Boolean(((g=p)==null?void 0:g.isBot())||v);m=(yield d("WAWebEncryptMsgProtobuf").encryptMsgProtobuf(q,f,g&&m?d("WAWebE2EProtoGenerator").updateBotInvokeMsgProtoCopyForCapi(b,m):b,i,t));t=m.type;var w=m.ciphertext;m=m.isUsingDeprecatedLidSession;var x=null;if(t===d("WAWebBackendJobs.flow").CiphertextType.Pkmsg){var y=(yield d("WAWebAdvSignatureApi").getADVEncodedIdentity());x=d("WAWap").wap("device-identity",null,y)}l.type!==j.Retry&&(yield d("WAWebSendMsgCommonApi").updateIdentityRange(a,[q]));yield d("WAWebSignalProtocolStore").getSignalProtocolStore().flushBufferToDiskIfNotMemOnlyMode();l.pushPriority!=null?y=d("WAWap").CUSTOM_STRING(l.pushPriority):y=l.type===j.AppStateSync?d("WAWap").CUSTOM_STRING("high"):d("WAWap").DROP_ATTR;q=null;c.type==="group"&&(q=c.groupData.isLidAddressingMode===!0?d("WAWebHandleMsgCommon").STANZA_MSG_ADDRESSING_MODE.lid:d("WAWebHandleMsgCommon").STANZA_MSG_ADDRESSING_MODE.pn);u=d("WAWebSendMsgMetaNode").genMetaNode(k,a,b,c.type==="group"?c.groupData:void 0,{appendHostedSenderIntent:u,isUsingDeprecatedLidSession:m,isCategoryPeerMessage:l.type===j.AppStateSync,origin:e});m=o&&v?o:k;e=d("WAWap").wap("enc",{v:d("WAWap").CUSTOM_STRING(d("WAWebBackendJobsCommon").CIPHERTEXT_VERSION.toString()),type:d("WAWap").CUSTOM_STRING(t),count:f===0?d("WAWap").DROP_ATTR:d("WAWap").INT(f),mediatype:d("WAWebBackendJobsCommon").encodeMaybeMediaType(r),"decrypt-fail":d("WAWebBackendJobsCommon").encodeMaybeDecryptFail(d("WAWebE2EProtoUtils").decryptFailAttributeFromProtobuf(b))},w);if(g){v=k.isBot()?k:p;v!=null&&v.isBot()||h(0,75934);e=d("WAWap").wap("bot",{is_lid:n===!0?d("WAWap").CUSTOM_STRING("true"):d("WAWap").DROP_ATTR},d("WAWap").wap("to",{jid:d("WAWebCommsWapMd").DEVICE_JID(v)},e))}t=!d("WAWebUserPrefsMeUser").isMeAccount(k)&&a.data.kind!==d("WAWebMsgType").MsgKind.PeerMessage?yield d("WAWebReportingTokenUtils").genReportingTokenBody(a.data,b):null;f=d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated();var z,A;if(f&&d("WAWebUserPrefsMeUser").isMeAccount(m)&&o!=null&&o.isRegularUser())if(o.isLid())z=d("WAWebApiContact").getPhoneNumber(d("WAWebWidFactory").toUserWid(o));else{A=(r=c.peerRecipientLid)!=null?r:d("WAWebLidMigrationUtils").toLid(o)}return d("WAWap").wap("message",{id:d("WAWap").CUSTOM_STRING(s.id),to:d("WAWebCommsWapMd").JID(m),participant:p&&!g?d("WAWebCommsWapMd").DEVICE_JID(p):d("WAWap").DROP_ATTR,recipient:o&&!g?d("WAWebCommsWapMd").USER_JID(o):d("WAWap").DROP_ATTR,type:d("WAWebE2EProtoUtils").typeAttributeFromProtobuf(b),peer_recipient_pn:z?d("WAWebCommsWapMd").USER_JID(z):d("WAWap").DROP_ATTR,peer_recipient_lid:A?d("WAWebCommsWapMd").USER_JID(A):d("WAWap").DROP_ATTR,edit:d("WAWebSendMsgCommonApi").editAttribute(b,i.subtype),category:l.type===j.AppStateSync?d("WAWap").CUSTOM_STRING("peer"):d("WAWap").DROP_ATTR,push_priority:y,addressing_mode:q!=null?d("WAWap").CUSTOM_STRING(q):d("WAWap").DROP_ATTR},e,x,u,t)});return n.apply(this,arguments)}g.MsgType=j;g.createUserDeviceMsgStanza=a;g.createGroupDeviceMsgStanza=e}),98); __d("WAWebWamEnumPrekeysFetchContext",[],(function(a,b,c,d,e,f){a=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});f.PREKEYS_FETCH_CONTEXT=a}),66); __d("WAWebPrekeysDepletionWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumMessageType","WAWebWamEnumPrekeysFetchContext","WAWebWamEnumSizeBucket"],(function(a,b,c,d,e,f,g){a=d("WAWebWamCodegenUtils").defineEvents({PrekeysDepletion:[3014,{deviceSizeBucket:[3,d("WAWebWamEnumSizeBucket").SIZE_BUCKET],messageType:[2,d("WAWebWamEnumMessageType").MESSAGE_TYPE],prekeysFetchReason:[1,d("WAWebWamEnumPrekeysFetchContext").PREKEYS_FETCH_CONTEXT]},[1,20,20],"regular"]},{PrekeysDepletion:[]});g.PrekeysDepletionWamEvent=a}),98); __d("WAWebPostPrekeysDepletionMetric",["WALogger","WAWebPrekeysDepletionWamEvent"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["maybePostPrekeysDepletionMetric: depletion prekey count: ",""]);h=function(){return a};return a}function a(a){var b=a.count,c=a.prekeysFetchReason,e=a.messageType;a=a.deviceSizeBucket;if(b==null||b===0)return;var f={};c!=null&&(f.prekeysFetchReason=c);e!=null&&(f.messageType=e);a!=null&&(f.deviceSizeBucket=a);d("WALogger").DEV(h(),b);self.setTimeout(function(){for(var a=0;a<b;a++)new(d("WAWebPrekeysDepletionWamEvent").PrekeysDepletionWamEvent)(f).commit()},0)}g.maybePostPrekeysDepletionMetric=a}),98); __d("WAWebExternalEntryPointPrefs",["WALogger","WATimeUtils","WAWebUserPrefsKeys","WAWebUserPrefsStore"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[external_ctx] failed to load entry points"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[external_ctx] failed to persist entry points"]);i=function(){return a};return a}function j(a){var b=Date.now();return b-a.addedTime>d("WATimeUtils").WEEK_MILLISECONDS}function k(a){try{Object.keys(a).forEach(function(b){j(a[b])&&delete a[b]}),c("WAWebUserPrefsStore").setUser(d("WAWebUserPrefsKeys").KEYS.EXTERNAL_ENTRY_POINT,a)}catch(a){d("WALogger").ERROR(i()).devConsole(a)}}function l(){try{var a=c("WAWebUserPrefsStore").getUser(d("WAWebUserPrefsKeys").KEYS.EXTERNAL_ENTRY_POINT);return a==null?{}:a}catch(a){d("WALogger").ERROR(h()).devConsole(a);return{}}}function a(a,b,c,d){var e=l(),f=Date.now();e[a.toString()]={addedTime:f,deepLinkType:b,authSuccess:c,partnerName:(a=d)!=null?a:null};k(e)}function b(a){var b=l(),c=b[a.toString()];c!=null&&(delete b[a.toString()],k(b))}function e(a){var b=l();b=b[a.toString()];return b==null||j(b)?null:b}g.saveExternalEntryPoint=a;g.deleteExternalEntryPoint=b;g.getExternalEntryPoint=e}),98); __d("WAWebSendMsgCtwaAttributionNode",["WASmaxOutMessagePublishCtwaAttributionMixin","WAWebExternalCtxConfig","WAWebExternalEntryPointPrefs","WAWebMsgType"],(function(a,b,c,d,e,f,g){function h(a){a=a.getAllCMCs();var b=0;for(var c=0;c<a.length;c++){var e=a[c].getModelsArray();for(var f=0;f<e.length;f++){var g=e[f];if(!d("WAWebMsgType").SYSTEM_MESSAGE_TYPES.includes(g.type)&&g.isSendFailure!==!0){++b;if(b>1)return!0}}}return!1}function i(a,b){var c=d("WAWebExternalCtxConfig").getFirstMessageLoggingOption();switch(c){case"NEW_CHATS_OR_EXISTING_CHATS_WITH_PARTNER_LINKS":return b!=null||!h(a);case"ALL_CHATS":return!0;default:c;return!h(a)}}function a(a){if(a==null||!d("WAWebExternalCtxConfig").isCtxLoggingEnabled())return null;var b=d("WAWebExternalEntryPointPrefs").getExternalEntryPoint(a.id);if(b==null)return null;if(!i(a,b.partnerName))return null;a={lt:"WEB_"+b.deepLinkType};b.authSuccess||(a.s=0);b.partnerName!=null&&(a.p=b.partnerName);b=new TextEncoder().encode(JSON.stringify(a));return d("WASmaxOutMessagePublishCtwaAttributionMixin").makeCtwaAttributionCtwaAttribution({ctwaAttributionElementValue:b})}g.getCtwaAttributionNode=a}),98); __d("WAWebSendMsgCreateFanoutStanza",["Promise","WALogger","WAWap","WAWebABProps","WAWebAdvSignatureApi","WAWebApiContact","WAWebApiMessageInfoStore","WAWebBackendJobs.flow","WAWebBackendJobsCommon","WAWebBotGating","WAWebBotTypes","WAWebChatCollection","WAWebCommsAckParser","WAWebCommsWapMd","WAWebContactCollection","WAWebDeviceSentMessageProtoUtils","WAWebE2EProtoGenerator","WAWebE2EProtoUtils","WAWebEncryptMsgProtobuf","WAWebHandleMsgCommon","WAWebICDCMetaApi","WAWebLid1X1MigrationGating","WAWebManageE2ESessionsJob","WAWebMsgFanoutTypes","WAWebMsgGetters","WAWebMsgRcatUtils","WAWebPostPrekeysDepletionMetric","WAWebReportingTokenUtils","WAWebSchemaChat","WAWebSendMsgCommonApi","WAWebSendMsgCtwaAttributionNode","WAWebSendMsgMetaNode","WAWebSignalProtocolStore","WAWebSimpleSignalPNToFBIDMigration","WAWebTrustedContactsUtils","WAWebUserPrefsMeUser","WAWebUsernameTypes","WAWebWamEnumMessageType","WAWebWamEnumPrekeysFetchContext","WAWebWamNumberToSizeBucket","WAWebWidFactory","WAWebWidToJid","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[bot] outgoing voice message is not supported"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["createFanoutMsgStanza: create fanout for a message. found chat: ",". found contact: ",".\n is lid: ",". lid origin: ",". isLidMigrated: ","\n contact has phone number: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["createFanoutMsgStanza: create fanout for ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["ensureE2ESessions with error"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendUserMsg: encryption fail for primary device ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendUserMsg: encryption fail for ",": ",""]);n=function(){return a};return a}function o(a,b,c,d,e,f,g){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e,f,g,i,j,k){var l,o,p=d("WAWebBackendJobsCommon").mediaTypeFromProtobuf(g),q=d("WAWebBackendJobsCommon").nativeFlowNameTypeFromProtobuf(g),r=d("WAWebBotGating").isBotEnabled()&&((l=a.invokedBotWid)==null?void 0:l.isBot())===!0;l=d("WAWebBotGating").isBotEnabled()&&d("WAWebMsgGetters").getIsBotFeedbackMessage(a);o=l&&Boolean(a.bizBotType&&((o=a.protocolMessageKey)==null?void 0:o.remote.equals(e)));var s=l&&e.isBot()||o,t=l&&!e.isBot()&&!o,u=d("WAWebMsgGetters").getIsRevokeForMsgFromOrDeliveredToBot(a);o=d("WAWebSimpleSignalPNToFBIDMigration").getFbidBotPersonaType(e);if(i.fanoutType===d("WAWebMsgFanoutTypes").FANOUT_TYPE.CHAT&&f.length===1&&d("WAWebSendMsgCommonApi").isPrimaryDevice(f[0])&&!t){var v=f[0],w=d("WAWebUserPrefsMeUser").isMeAccount(v)?d("WAWebDeviceSentMessageProtoUtils").wrapDeviceSentMessage(g,e):g,x=w;v.isBot()&&s&&(x=d("WAWebE2EProtoGenerator").updateBotInvokeMsgProtoCopyForCapi(w));w=(yield d("WAWebEncryptMsgProtobuf").encryptMsgProtobuf(v,0,x,a,k));v=w.type;x=w.ciphertext;w=w.isUsingDeprecatedLidSession;var y=null;(s||o!=null)&&(y=d("WAWap").wap("bot",{type:s?"feedback":d("WAWap").DROP_ATTR,persona_type:o?d("WAWap").CUSTOM_STRING(o):d("WAWap").DROP_ATTR}));return{shouldHaveIdentity:v===d("WAWebBackendJobs.flow").CiphertextType.Pkmsg,isUsingDeprecatedLidSessionForAnyEncNode:w,body:d("WAWap").wap("enc",{v:d("WAWap").CUSTOM_STRING(d("WAWebBackendJobsCommon").CIPHERTEXT_VERSION.toString()),type:d("WAWap").CUSTOM_STRING(v),mediatype:d("WAWebBackendJobsCommon").encodeMaybeMediaType(p),"decrypt-fail":d("WAWebBackendJobsCommon").encodeMaybeDecryptFail(d("WAWebE2EProtoUtils").decryptFailAttributeFromProtobuf(g)),native_flow_name:d("WAWebBackendJobsCommon").encodeMaybeNativeFlowName(q)},x),botBody:y}}o=!1;x=!1;w=f.map(function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){var c=d("WAWebUserPrefsMeUser").isMeAccount(b)?d("WAWebDeviceSentMessageProtoUtils").wrapDeviceSentMessage(g,e):g,f=i.fanoutType===d("WAWebMsgFanoutTypes").FANOUT_TYPE.GROUP_DIRECT?d("WAWebWidFactory").toUserWid(b):d("WAWebWidFactory").toUserWid(e);yield d("WAWebICDCMetaApi").populateICDCMeta(f,c);f=j==null?void 0:j.get(d("WAWebWidToJid").widToUserJid(f));f=f!=null?d("WAWap").wap("content_binding",null,f):null;try{var h=c,l=b.isBot()&&(r||t||u);l&&(h=d("WAWebE2EProtoGenerator").updateBotInvokeMsgProtoCopyForCapi(c,a.botMessageSecret));b.isFbidBot()&&(h=d("WAWebE2EProtoGenerator").updateFbidBotProtobuf(h));b.isBot()&&(h=d("WAWebE2EProtoGenerator").updateBotProtobuf(h));c=(yield d("WAWebEncryptMsgProtobuf").encryptMsgProtobuf(b,0,h,a,k));h=c.type;var s=c.ciphertext;c=c.isUsingDeprecatedLidSession;h===d("WAWebBackendJobs.flow").CiphertextType.Pkmsg&&(o=!0);c===!0&&(x=!0);return{shouldFanoutToBot:l,node:d("WAWap").wap("to",{jid:d("WAWebCommsWapMd").DEVICE_JID(b)},d("WAWap").wap("enc",{v:d("WAWap").CUSTOM_STRING(d("WAWebBackendJobsCommon").CIPHERTEXT_VERSION.toString()),type:d("WAWap").CUSTOM_STRING(h),mediatype:d("WAWebBackendJobsCommon").encodeMaybeMediaType(p),"decrypt-fail":d("WAWebBackendJobsCommon").encodeMaybeDecryptFail(d("WAWebE2EProtoUtils").decryptFailAttributeFromProtobuf(g)),native_flow_name:d("WAWebBackendJobsCommon").encodeMaybeNativeFlowName(q)},s),f)}}catch(a){d("WALogger").WARN(n(),String(b),a);d("WAWebSendMsgCommonApi").isPrimaryDevice(b)&&d("WALogger").ERROR(m(),String(b)).tags("messaging").sendLogs("encryption-fail-for-primary-device");return null}});return function(a){return c.apply(this,arguments)}}());v=(yield (h||(h=b("Promise"))).all(w));var z=[],A=[];v.forEach(function(a){if((a==null?void 0:a.node)==null)return;(a==null?void 0:a.shouldFanoutToBot)?A.push(a.node):z.push(a.node)});return z.length>0||A.length>0?{body:z.length>0?d("WAWap").wap("participants",null,z):null,botBody:A.length>0||s?d("WAWap").wap("bot",{type:l?"feedback":d("WAWap").DROP_ATTR},A):null,shouldHaveIdentity:o,isUsingDeprecatedLidSessionForAnyEncNode:x}:h.reject(c("err")("[messaging] encryptAndSendUserMsg: encryption fail for all devices"))});return p.apply(this,arguments)}function a(a,b,c,d,e,f){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e,f,g,h){var m=a.data,n=m.to,p=m.id,q=m.from,t=m.subtype;try{var u;(u=g.sendPerfReporter)==null?void 0:u.startPrekeysFetchStage();u=(yield d("WAWebManageE2ESessionsJob").ensureE2ESessions(e));var v=u==null?void 0:u.missedPrekeyCount;if(v!=null){var w;(w=g.sendPerfReporter)==null?void 0:w.setFetchedPrekeyCount(v)}(w=g.sendPerfReporter)==null?void 0:w.postPrekeysFetchStage();d("WAWebPostPrekeysDepletionMetric").maybePostPrekeysDepletionMetric({count:u==null?void 0:u.depletedPrekeyCount,prekeysFetchReason:d("WAWebWamEnumPrekeysFetchContext").PREKEYS_FETCH_CONTEXT.SEND_MESSAGE,messageType:f.fanoutType===d("WAWebMsgFanoutTypes").FANOUT_TYPE.GROUP_DIRECT?d("WAWebWamEnumMessageType").MESSAGE_TYPE.GROUP:d("WAWebWamEnumMessageType").MESSAGE_TYPE.INDIVIDUAL,deviceSizeBucket:f.fanoutType===d("WAWebMsgFanoutTypes").FANOUT_TYPE.GROUP_DIRECT?c("WAWebWamNumberToSizeBucket")(e.length):null})}catch(a){d("WALogger").ERROR(l()).tags("messaging").devConsole(a)}w=d("WAWebMsgGetters").getIsBotFeedbackMessage(m)&&Boolean(m.bizBotType&&((v=m.protocolMessageKey)==null?void 0:v.remote.equals(n)));u=d("WAWebBotGating").isBotEnabled()&&d("WAWebMsgGetters").getIsBotFeedbackMessage(m)&&n.isBot()||w;v=e;f.isResendingMsg&&(v=(yield d("WAWebSendMsgCommonApi").filterDeviceWithChangedIdentity(a,e)));e=v.map(function(a){return{msgKey:p,receiverId:a}});yield d("WAWebApiMessageInfoStore").createOrMergeReceiptRecords(e);(e=g.sendPerfReporter)==null?void 0:e.startClientEncryptStage();e=(yield d("WAWebMsgRcatUtils").genContentBindingForMsg(m,r(q,v)));var x=d("WAWebMsgGetters").getWamEditType(m);x=(yield o(m,n,v,b,f,e,x));(g=g.sendPerfReporter)==null?void 0:g.postClientEncryptStage();g=null;if(f.fanoutType===d("WAWebMsgFanoutTypes").FANOUT_TYPE.GROUP_DIRECT){var y=d("WAWebBackendJobsCommon").mediaTypeFromProtobuf(b);g=d("WAWap").wap("enc",{v:d("WAWap").CUSTOM_STRING(d("WAWebBackendJobsCommon").CIPHERTEXT_VERSION.toString()),type:d("WAWap").CUSTOM_STRING(d("WAWebBackendJobs.flow").CiphertextType.Skmsg),mediatype:d("WAWebBackendJobsCommon").encodeMaybeMediaType(y)})}y=null;if(x.shouldHaveIdentity){var z=(yield d("WAWebAdvSignatureApi").getADVEncodedIdentity());y=d("WAWap").wap("device-identity",null,z)}z=d("WAWebE2EProtoUtils").getBizNativeFlowName(b);var A=m.nativeFlowInteractiveMsg,B,C=d("WAWebContactCollection").ContactCollection.get(n),D=d("WAWebChatCollection").ChatCollection.get(n),E=C==null?void 0:C.privacyMode;if(E!=null){var F;B=(F=d("WAWap")).wap("biz",{host_storage:F.INT(E.hostStorage),actual_actors:F.INT(E.actualActors),privacy_mode_ts:F.INT(E.privacyModeTs),native_flow_name:F.MAYBE_CUSTOM_STRING(z)})}var G,H,I;E=d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated();d("WALogger").DEV(k(),p.id);d("WALogger").LOG(j(),D!=null,C!=null,n.isLid(),D==null?void 0:D.lidOriginType,E,(C==null?void 0:C.phoneNumber)!=null).devConsole(p.id);n.isLid()?(((D==null?void 0:D.lidOriginType)==null||(D==null?void 0:D.lidOriginType)===d("WAWebUsernameTypes").LidOriginType.PNH_CTWA)&&(C==null?void 0:C.shareOwnPn)!==!0&&(C==null?void 0:C.phoneNumber)!=null&&(G=C==null?void 0:C.phoneNumber),E&&(D==null?void 0:D.lidOriginType)!==d("WAWebUsernameTypes").LidOriginType.PNH_CTWA&&(I=d("WAWebApiContact").getPhoneNumber(d("WAWebWidFactory").toUserWid(n)))):n.isUser()&&((D==null?void 0:D.accountLid)&&(H=D==null?void 0:D.accountLid));if(B==null&&z!=null&&A===!0){var F;B=(F=d("WAWap")).wap("biz",null,F.wap("interactive",{v:"1",type:F.CUSTOM_STRING("native_flow")},F.wap("native_flow",{name:F.CUSTOM_STRING(z)})))}else B==null&&z!=null&&(B=d("WAWap").wap("biz",{native_flow_name:d("WAWap").CUSTOM_STRING(z)}));f.isResendingMsg||(yield d("WAWebSendMsgCommonApi").updateIdentityRange(a,v));yield d("WAWebSignalProtocolStore").getSignalProtocolStore().flushBufferToDiskIfNotMemOnlyMode();C=d("WAWebSendMsgMetaNode").genMetaNode(n,a,b,h,{origin:D==null?void 0:D.lidOriginType,isUsingDeprecatedLidSession:x.isUsingDeprecatedLidSessionForAnyEncNode});E=e==null?void 0:e.get(d("WAWebWidToJid").widToUserJid(d("WAWebWidFactory").toUserWid(q)));A=E!=null?d("WAWap").wap("sender_content_binding",null,E):null;var J;if(m.subtype==="bot_request_welcome")J="request_welcome";else if(m.botMsgBodyType!=null)switch(m.botMsgBodyType){case d("WAWebBotTypes").BotMsgBodyType.PROMPT:J="prompt";break;case d("WAWebBotTypes").BotMsgBodyType.COMMAND:J="command";break;case d("WAWebBotTypes").BotMsgBodyType.VOICE:d("WALogger").ERROR(i());break}var K;if(m.bizBotType&&!w)switch(m.bizBotType){case d("WAWebBotTypes").BizBotType.BIZ_1P:K="1p_partial";break;case d("WAWebBotTypes").BizBotType.BIZ_3P:K="3p_full";break}var L;(J!=null||K!=null)&&(L=d("WAWap").wap("bot",{type:J!=null?d("WAWap").CUSTOM_STRING(J):d("WAWap").DROP_ATTR,local_automated_type:K!=null?d("WAWap").CUSTOM_STRING(K):d("WAWap").DROP_ATTR}));F=(yield d("WAWebReportingTokenUtils").genReportingTokenBody(m,b));z=(yield s(n));var M;h!=null&&(M=(h==null?void 0:h.isLidAddressingMode)===!0?d("WAWebHandleMsgCommon").STANZA_MSG_ADDRESSING_MODE.lid:d("WAWebHandleMsgCommon").STANZA_MSG_ADDRESSING_MODE.pn);v=d("WAWebSendMsgCtwaAttributionNode").getCtwaAttributionNode(D);a=d("WAWap").wap("message",{id:d("WAWap").CUSTOM_STRING(p.id),to:d("WAWebCommsWapMd").CHAT_JID(n),type:d("WAWebE2EProtoUtils").typeAttributeFromProtobuf(b),peer_recipient_lid:H?d("WAWebCommsWapMd").USER_JID(H):d("WAWap").DROP_ATTR,peer_recipient_pn:I?d("WAWebCommsWapMd").USER_JID(I):d("WAWap").DROP_ATTR,edit:d("WAWebSendMsgCommonApi").editAttribute(b,t),device_fanout:f.isResendingMsg===!0||u?d("WAWap").CUSTOM_STRING("false"):d("WAWap").DROP_ATTR,recipient_pn:G?d("WAWebCommsWapMd").USER_JID(G):d("WAWap").DROP_ATTR,addressing_mode:M!=null?d("WAWap").CUSTOM_STRING(M):d("WAWap").DROP_ATTR},x.body,x.botBody,g,y,B,C,A,L,F,z,v);e=d("WAWebCommsAckParser").toCoreAckTemplate({id:p.id,"class":"message",from:m.to,participant:null});return{stanza:a,ackTemplate:e}});return q.apply(this,arguments)}function r(a,b){var c=new Map();c.set(a.user,d("WAWebWidFactory").toUserWid(a));for(a of b)c.has(a.user)||c.set(a.user,d("WAWebWidFactory").toUserWid(a));return Array.from(c.values())}function s(a){return t.apply(this,arguments)}function t(){t=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!d("WAWebABProps").getABPropConfigValue("privacy_token_sending_on_all_1_on_1_messages"))return null;a=(yield d("WAWebSchemaChat").getChatTable().get(a.toString()));if(a==null)return null;var b=a.tcToken;a=a.tcTokenTimestamp;return b==null||a==null||d("WAWebTrustedContactsUtils").isTokenExpired(a,d("WAWebTrustedContactsUtils").TcTokenMode.Receiver)?null:d("WAWap").wap("tctoken",null,b)});return t.apply(this,arguments)}g.createFanoutMsgStanza=a}),98); __d("WAWebWamEnumClientMessageSendStage",[],(function(a,b,c,d,e,f){a=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});f.CLIENT_MESSAGE_SEND_STAGE=a}),66); __d("WAWebAndroidMessageSendPerfWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumAgentEngagementEnumType","WAWebWamEnumClientGroupSizeBucket","WAWebWamEnumClientMessageSendStage","WAWebWamEnumEditType","WAWebWamEnumInvisibleMessageCategoryType","WAWebWamEnumMediaType","WAWebWamEnumMessageType","WAWebWamEnumSizeBucket","WAWebWamEnumTypeOfGroupEnum"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({AndroidMessageSendPerf:[1994,{agentEngagementType:[47,d("WAWebWamEnumAgentEngagementEnumType").AGENT_ENGAGEMENT_ENUM_TYPE],appRestart:[16,a.TYPES.BOOLEAN],bucketedSenderKeyDistributionCountPercentage:[32,a.TYPES.INTEGER],bucketedSenderKeyDistributionHashTime:[35,a.TYPES.INTEGER],deviceCount:[36,a.TYPES.INTEGER],deviceSizeBucket:[26,d("WAWebWamEnumSizeBucket").SIZE_BUCKET],durationAbs:[11,a.TYPES.TIMER],durationRelative:[12,a.TYPES.TIMER],durationT:[1,a.TYPES.TIMER],editType:[42,d("WAWebWamEnumEditType").EDIT_TYPE],fetchPrekeys:[15,a.TYPES.BOOLEAN],fetchPrekeysPercentage:[21,a.TYPES.INTEGER],groupSizeBucket:[17,d("WAWebWamEnumClientGroupSizeBucket").CLIENT_GROUP_SIZE_BUCKET],invisibleMessageCategory:[45,d("WAWebWamEnumInvisibleMessageCategoryType").INVISIBLE_MESSAGE_CATEGORY_TYPE],isDirectedMessage:[33,a.TYPES.BOOLEAN],isE2eBackfill:[27,a.TYPES.BOOLEAN],isLid:[41,a.TYPES.BOOLEAN],isMessageFanout:[9,a.TYPES.BOOLEAN],isMessageForward:[8,a.TYPES.BOOLEAN],isRevokeMessage:[24,a.TYPES.BOOLEAN],isViewOnce:[29,a.TYPES.BOOLEAN],jobsInQueue:[18,a.TYPES.INTEGER],mediaType:[3,d("WAWebWamEnumMediaType").MEDIA_TYPE],messageIsFirstUserMessage:[30,a.TYPES.BOOLEAN],messageIsInvisible:[31,a.TYPES.BOOLEAN],messageType:[4,d("WAWebWamEnumMessageType").MESSAGE_TYPE],networkWasDisconnected:[14,a.TYPES.BOOLEAN],participantCount:[37,a.TYPES.INTEGER],phoneCores:[34,a.TYPES.INTEGER],prekeysEligibleForPrallelProcessing:[28,a.TYPES.BOOLEAN],receiverDeviceCount:[39,a.TYPES.INTEGER],runningTasks:[44,a.TYPES.STRING],sendCount:[13,a.TYPES.INTEGER],sendRetryCount:[10,a.TYPES.INTEGER],sendStage:[2,d("WAWebWamEnumClientMessageSendStage").CLIENT_MESSAGE_SEND_STAGE],senderDeviceCount:[40,a.TYPES.INTEGER],senderKeyDistributionCountPercentage:[23,a.TYPES.INTEGER],sessionsMissingWhenComposing:[25,a.TYPES.BOOLEAN],targetDeviceGroupSizeBucket:[20,d("WAWebWamEnumClientGroupSizeBucket").CLIENT_GROUP_SIZE_BUCKET],threadsInExecution:[19,a.TYPES.INTEGER],typeOfGroup:[38,d("WAWebWamEnumTypeOfGroupEnum").TYPE_OF_GROUP_ENUM],userToDeviceSizeBucket:[46,a.TYPES.STRING]},[1,1,2e3],"regular"]},{AndroidMessageSendPerf:[]});g.AndroidMessageSendPerfWamEvent=b}),98); __d("WAWebMessageSendPerfReporter",["WAWebAndroidMessageSendPerfWamEvent","WAWebMessagingGatingUtils","WAWebWamEnumClientMessageSendStage","WAWebWamEnumMessageType","WAWebWamEnumSizeBucket","gkx"],(function(a,b,c,d,e,f,g){a=function(){function a(a){var b=a.chatWid,c=a.mediaType;a=a.messageType;this.$7=!1;this.$8=!1;this.$9=null;this.$11=!1;this.$12=!1;this.$1=Date.now();this.$2=new Map();this.$5=c;this.$6=a;this.$10=b}var b=a.prototype;b.setFetchedPrekeyCount=function(a){this.$3=a};b.setSenderKeyDistributionCount=function(a){this.$4=a};b.setMessageIsInvisible=function(a){this.$11=a};b.setMessageIsFirstUserMessage=function(a){this.$12=a};b.setIsRevokeMessage=function(a){this.$7=a};b.setIsDirectedMessage=function(a){this.$8=a};b.setGroupData=function(a){this.$9=a};b.startRenderedStage=function(){this.$13(d("WAWebWamEnumClientMessageSendStage").CLIENT_MESSAGE_SEND_STAGE.CLIENT_RENDERED)};b.postRenderedStage=function(){this.$14(d("WAWebWamEnumClientMessageSendStage").CLIENT_MESSAGE_SEND_STAGE.CLIENT_RENDERED)};b.startSavedStage=function(){this.$13(d("WAWebWamEnumClientMessageSendStage").CLIENT_MESSAGE_SEND_STAGE.CLIENT_SAVED)};b.postSavedStage=function(){this.$14(d("WAWebWamEnumClientMessageSendStage").CLIENT_MESSAGE_SEND_STAGE.CLIENT_SAVED)};b.startPrekeysFetchStage=function(){this.$13(d("WAWebWamEnumClientMessageSendStage").CLIENT_MESSAGE_SEND_STAGE.CLIENT_PREKEYS_FETCH)};b.postPrekeysFetchStage=function(){this.$14(d("WAWebWamEnumClientMessageSendStage").CLIENT_MESSAGE_SEND_STAGE.CLIENT_PREKEYS_FETCH)};b.startWrittenWireStage=function(){this.$13(d("WAWebWamEnumClientMessageSendStage").CLIENT_MESSAGE_SEND_STAGE.CLIENT_WRITTEN_WIRE)};b.postWrittenWireStage=function(){this.$14(d("WAWebWamEnumClientMessageSendStage").CLIENT_MESSAGE_SEND_STAGE.CLIENT_WRITTEN_WIRE)};b.startWaitingToEncryptStage=function(){this.$13(d("WAWebWamEnumClientMessageSendStage").CLIENT_MESSAGE_SEND_STAGE.CLIENT_WAITING_TO_ENCRYPT)};b.postWaitingToEncryptStage=function(){this.$14(d("WAWebWamEnumClientMessageSendStage").CLIENT_MESSAGE_SEND_STAGE.CLIENT_WAITING_TO_ENCRYPT)};b.startReadyToSendStage=function(){this.$13(d("WAWebWamEnumClientMessageSendStage").CLIENT_MESSAGE_SEND_STAGE.CLIENT_READY_TO_SEND)};b.postReadyToSendStage=function(){this.$14(d("WAWebWamEnumClientMessageSendStage").CLIENT_MESSAGE_SEND_STAGE.CLIENT_READY_TO_SEND)};b.startClientEncryptStage=function(){this.$13(d("WAWebWamEnumClientMessageSendStage").CLIENT_MESSAGE_SEND_STAGE.CLIENT_ENCRYPT)};b.postClientEncryptStage=function(){this.$14(d("WAWebWamEnumClientMessageSendStage").CLIENT_MESSAGE_SEND_STAGE.CLIENT_ENCRYPT)};b.$13=function(a){var b=new(d("WAWebAndroidMessageSendPerfWamEvent").AndroidMessageSendPerfWamEvent)({sendStage:a});this.$2.set(a,b);return b};b.$14=function(a){var b;a=this.$2.get(a)||this.$13(a);a.mediaType=this.$5;a.messageType=this.$6;a.messageIsInvisible=this.$11;a.messageIsFirstUserMessage=this.$12;a.durationRelative=Date.now()-this.$1;a.fetchPrekeys=this.$3!=null&&this.$3>0;a.isRevokeMessage=this.$7;a.isDirectedMessage=this.$8;((b=this.$9)==null?void 0:b.isLid)!=null?a.isLid=this.$9.isLid:this.$6===d("WAWebWamEnumMessageType").MESSAGE_TYPE.INDIVIDUAL&&(a.isLid=this.$10.isLid());((b=this.$9)==null?void 0:b.wamTypeOfGroup)!=null&&(a.typeOfGroup=this.$9.wamTypeOfGroup);((b=this.$9)==null?void 0:b.participantCount)!=null&&(a.participantCount=this.$9.participantCount);((b=this.$9)==null?void 0:b.deviceSizeBucket)!=null&&(a.deviceSizeBucket=this.$9.deviceSizeBucket);if(((b=this.$9)==null?void 0:b.deviceCount)!=null){b=this.$9.deviceCount;a.deviceCount=b;this.$3!=null&&b>0&&(a.fetchPrekeysPercentage=Math.round(this.$3/b*100));this.$4!=null&&b>0&&(a.senderKeyDistributionCountPercentage=Math.round(this.$4/b*100))}a.participantCount!=null&&a.participantCount>d("WAWebMessagingGatingUtils").getGroupSizeBypassingSampling()?a.weight=0:a.fetchPrekeysPercentage!=null&&a.fetchPrekeysPercentage>=50||a.messageIsFirstUserMessage?a.weight=0:a.senderKeyDistributionCountPercentage!=null&&a.senderKeyDistributionCountPercentage>=50?!c("gkx")("26258")?a.weight=1:a.weight=20:(a.deviceSizeBucket===d("WAWebWamEnumSizeBucket").SIZE_BUCKET.LT5000||a.deviceSizeBucket===d("WAWebWamEnumSizeBucket").SIZE_BUCKET.LARGEST_BUCKET)&&(!c("gkx")("26258")?a.weight=1:a.weight=100);a.markDurationAbs();a.commit()};return a}();g.MessageSendPerfReporter=a}),98); __d("WAWebSendMsgJob",["Promise","WALogger","WAWebABProps","WAWebABPropsSaga","WAWebE2EProtoGenerator","WAWebEventsWaitForOfflineDeliveryEnd","WAWebMessageSendPerfReporter","WAWebMessageSendReporter","WAWebOutgoingMessage","WAWebPrimaryFeatures","WAWebSendGroupKeyDistributionMsgJob","WAWebSendGroupMsgJob","WAWebSendTcTokenChatAction","WAWebSendUserMsgJob","WAWebSimpleSignalPNToFBIDMigration","WAWebWamEnumMediaType","WAWebWamEnumMessageType","WAWebWid","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[messaging] waiting for offline delivery end before sending "," message"]);i=function(){return a};return a}function a(a,b){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){var f=a.data,g=f.id;f=f.to;if(d("WAWebSimpleSignalPNToFBIDMigration").isDeprecatedPnBotChat(f)&&d("WAWebABProps").getABPropConfigValue("ai_fbid_migration_sending")&&d("WAWebPrimaryFeatures").primaryFeatureEnabled("ai_fbid_migration_receiving_enabled")){var j=d("WAWebSimpleSignalPNToFBIDMigration").getFBidForDeprecatedPnChatThread(f);j!=null&&(a.type==="message"?a.data.to=j:a.type==="addon"&&(a.data=babelHelpers["extends"]({},a.data,{to:j})))}d("WAWebSimpleSignalPNToFBIDMigration").maybeReplaceWidWithFbIdForInvoke(a,"invokedBotWid");d("WAWebSimpleSignalPNToFBIDMigration").maybeReplaceWidWithFbIdForInvoke(a,"botRespOrInvocationRevokeBotWid");d("WAWebEventsWaitForOfflineDeliveryEnd").isOfflineDeliveryEnd()||(d("WALogger").LOG(i(),g),yield d("WAWebEventsWaitForOfflineDeliveryEnd").waitForOfflineDeliveryEnd());if(!g||!g.id)return(h||(h=b("Promise"))).reject(c("err")("[messaging] sending message without an id"));if(!f)return(h||(h=b("Promise"))).reject(c("err")("[messaging] sending message without an remote id"));j=d("WAWebOutgoingMessage").createOutgoingMessageProtobuf(d("WAWebOutgoingMessage").OutgoingMessageOriginType.Chat,a);if(f.isUser()){c("WAWebWid").isCAPISupportAccount(f)&&d("WAWebABPropsSaga").getIsSagaV1Enabled()&&d("WAWebABPropsSaga").getIsSagaV1ReengagementEnabled()&&(yield d("WAWebE2EProtoGenerator").addDebugInfoSupportPayload(j));g=d("WAWebSendUserMsgJob").encryptAndSendUserMsg(a,j,e);a.data.type!=="protocol"&&d("WAWebSendTcTokenChatAction").sendTcToken(f);return g}else if(f.isGroup())return d("WAWebSendGroupMsgJob").encryptAndSendGroupMsg(a,j,e);return(h||(h=b("Promise"))).reject(c("err")("[messaging] unsupported remote jid type"))});return j.apply(this,arguments)}function e(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield d("WAWebEventsWaitForOfflineDeliveryEnd").waitForOfflineDeliveryEnd();if(!a.id)return(h||(h=b("Promise"))).reject(c("err")("[messaging] sending message without an id"));else if(!a.remote)return(h||(h=b("Promise"))).reject(c("err")("[messaging] sending message without an remote id"));if(a.remote.isGroup()){var e=d("WAWebMessageSendReporter").createMessageSendMetricReporter({messageIsInvisible:!0}),f=new(d("WAWebMessageSendPerfReporter").MessageSendPerfReporter)({chatWid:a.remote,mediaType:d("WAWebWamEnumMediaType").MEDIA_TYPE.NONE,messageType:d("WAWebWamEnumMessageType").MESSAGE_TYPE.GROUP});f.setMessageIsInvisible(!0);return d("WAWebSendGroupKeyDistributionMsgJob").encryptAndSendGroupKeyDistributionMsg(a,e).then(function(){f.postWrittenWireStage(),e.post()})}return(h||(h=b("Promise"))).reject(c("err")("[messaging] unsupported remote jid type"))});return k.apply(this,arguments)}g.encryptAndSendMsg=a;g.encryptAndSendKeyDistributionMsg=e}),98); __d("WAWebSendMsgMetricReporter",["WAWebMessageSendPerfReporter","WAWebMessageSendReporter","WAWebMsgType","WAWebWamMsgUtils"],(function(a,b,c,d,e,f,g){a=function(a){var b={createSendReporter:function(b){return new(d("WAWebMessageSendReporter").MessageSendReporter)(a,b)},sendReporter:null,sendPerfReporter:null};Object.defineProperty(b,"sendReporter",{get:function(){return a.wamMessageSendReporter},set:function(b){a.wamMessageSendReporter=b},enumerable:!0});Object.defineProperty(b,"sendPerfReporter",{get:function(){var b;return(b=a.wamMessageSendPerfReporter)!=null?b:null},set:function(b){a.wamMessageSendPerfReporter=b},enumerable:!0});return b};b=function(a){var b=new(d("WAWebMessageSendReporter").MessageSendReporter)(a),c=new(d("WAWebMessageSendPerfReporter").MessageSendPerfReporter)({chatWid:a.to,mediaType:d("WAWebWamMsgUtils").getWamMediaType(a),messageType:d("WAWebWamMsgUtils").getWamMessageType(a)});if(a.kind===d("WAWebMsgType").MsgKind.ProtocolAddonRevoke){var e;(e=c)==null?void 0:e.setIsRevokeMessage(!0)}e={createSendReporter:function(b){return new(d("WAWebMessageSendReporter").MessageSendReporter)(a,b)},sendReporter:null,sendPerfReporter:null};Object.defineProperty(e,"sendReporter",{get:function(){return b},set:function(a){b=a},enumerable:!0});Object.defineProperty(e,"sendPerfReporter",{get:function(){return c},set:function(a){c=a},enumerable:!0});return e};g.createMsgModelMetricReporter=a;g.createAddonMetricReporter=b}),98); __d("WAWebSendMsgToDeviceList",["WADeprecatedSendIq","WAWebCommsAckParser","WAWebSendMsgCommonApi","WAWebSendMsgCreateFanoutStanza","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){function a(a,b,c,d,e){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e,f,g){var h;(h=g.sendPerfReporter)==null?void 0:h.startReadyToSendStage();h=a.data;var i=h.id;h=h.to;a=(yield d("WAWebSendMsgCreateFanoutStanza").createFanoutMsgStanza(a,b,e,f,g));b=a.stanza;(e=g.sendPerfReporter)==null?void 0:e.postReadyToSendStage();(f=g.sendPerfReporter)==null?void 0:f.startWrittenWireStage();a=(yield d("WADeprecatedSendIq").deprecatedSendStanzaAndReturnAck(b,d("WAWebCommsAckParser").toCoreAckTemplate({id:i.id,"class":"message",from:h,participant:null})));e=d("WAWebSendMsgCommonApi").sendMsgAckSyncParser.parse(a);if(e.error)throw c("err")("[messaging] sendMsgToDeviceList: Invalid ack from server");(f=g.sendPerfReporter)==null?void 0:f.postWrittenWireStage();g.sendPerfReporter=null;(b=g.sendReporter)==null?void 0:b.postSuccess();g.sendReporter=null;return e.success});return h.apply(this,arguments)}g.sendMsgToDeviceList=a}),98); __d("WAWebSendRetryMsgJob",["invariant","WADeprecatedSendIq","WALogger","WAWebABPropsSaga","WAWebBotMessageSecret","WAWebCommsAckParser","WAWebE2EProtoGenerator","WAWebOutgoingMessage","WAWebSendMsgCreateDeviceStanza","WAWebWid","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g,h){function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["sendRetry: sending "," to ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["sendRetry: id "," to ",", requester: ",", count: ",""]);j=function(){return a};return a}function a(a,b,c,d,e,f,g,h){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e,f,g,k,l,m){var n;l===void 0&&(l=!1);m===void 0&&(m=void 0);var o=f.data.id.id,p=b||a;n=f==null?void 0:(n=f.data)==null?void 0:n.messageSecret;n=n?new Uint8Array(yield d("WAWebBotMessageSecret").genBotMsgSecretFromMsgSecret(n)):null;d("WALogger").LOG(j(),o,a.toString(),p.toString(),g).tags("messaging");p=d("WAWebOutgoingMessage").createOutgoingMessageProtobuf(d("WAWebOutgoingMessage").OutgoingMessageOriginType.Retry,f);g={type:d("WAWebSendMsgCreateDeviceStanza").MsgType.Retry,retryCount:g};g={to:a,option:g,botMessageSecret:n};c("WAWebWid").isCAPISupportAccount(a)&&d("WAWebABPropsSaga").getIsSagaV1Enabled()&&d("WAWebABPropsSaga").getIsSagaV1ReengagementEnabled()&&(yield d("WAWebE2EProtoGenerator").addDebugInfoSupportPayload(p));a.isUser()?n=(yield d("WAWebSendMsgCreateDeviceStanza").createUserDeviceMsgStanza(f,p,babelHelpers["extends"]({},g,{recipient:e,peerRecipientLid:m}),k)):(b!=null||h(0,56263),n=(yield d("WAWebSendMsgCreateDeviceStanza").createGroupDeviceMsgStanza(f,p,babelHelpers["extends"]({},g,{isLidBot:l,participant:b}))));d("WALogger").LOG(i(),o,a.toString()).tags("messaging");m=b;k=a;a.isBot()&&e!=null&&!(e==null?void 0:e.isBot())&&(m=a,e!=null||h(0,75958),k=e);return d("WADeprecatedSendIq").deprecatedSendStanzaAndWaitForAck(n,d("WAWebCommsAckParser").toCoreAckTemplate({id:o,"class":"message",from:k,participant:m}))});return k.apply(this,arguments)}g.sendRetry=a}),98); __d("WAWebFetchResendMissingKeyJob",["Promise","WALogger","WAParsableXmlNode","WAPromiseQueue","WASmaxPreKeysFetchMissingPreKeysRPC","WAWap","WAWebApiDeviceList","WAWebBackendErrors","WAWebDeviceListPk","WAWebEventsWaitForOfflineDeliveryEnd","WAWebProcessKeyBundle","WAWebSignalCommonUtils","WAWebSignalProtocolStore","WAWebUserPrefsMeUser","WAWebWidFactory","WAWebWidToJid","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["fetchResendMissingKeys: failed to build session with error ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["fetchResendMissingKeys: successfully established "," E2E sessions out of "," requested"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["fetchResendMissingKeys: parsed "," keys"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["fetchResendMissingKeys failed for user ",": ",":",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["fetchResendMissingKeys: find "," users"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["fetchResendMissingKeys failed: ",":",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["fetchResendMissingKeys failed: ",":",""]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["fetchResendMissingKeys: start processing keys for "," wids"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["fetchResendMissingKeys: start sending fetching iq for "," wids"]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["fetchResendMissingKeys: start fetching key for "," wids"]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["fetchResendMissingKeys deduped ",""]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["fetchResendMissingKeys ",""]);t=function(){return a};return a}var u=new(d("WAPromiseQueue").PromiseQueueMap)();function a(a){return v.apply(this,arguments)}function v(){v=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield d("WAWebEventsWaitForOfflineDeliveryEnd").waitForOfflineDeliveryEnd();a=Array.from(new Set(a.map(function(a){return d("WAWebWidFactory").toUserWid(a).toString()}))).map(function(a){return d("WAWebWidFactory").createUserWid(a)});var b=a.map(function(a){return a.toString()}).join();d("WALogger").LOG(t(),b);var c=u.waitIfPending(b);if(c){d("WALogger").LOG(s(),b);return c}return u.enqueueHandlers(b,w(a))});return v.apply(this,arguments)}function w(a){return x.apply(this,arguments)}function x(){x=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){d("WALogger").LOG(r(),a.length);var c=(yield y(a)),e=(yield A(c)),f=new Map();c.forEach(function(a,b){b=e[b];var c=d("WAWebWidFactory").toUserWid(a).toString(),g=f.get(c)||[];if(b!=null){g.push({id:(a=a.device)!=null?a:0,regId:b})}f.set(c,g)});var g=[];f.forEach(function(a,b){b=d("WAWebWidToJid").widToUserJid(d("WAWebWidFactory").createUserWid(b));b={userJid:b,hasUserReasonIdentity:!1,deviceArgs:a.map(function(a){return{deviceId:a.id,registrationElementValue:d("WAWap").BIG_ENDIAN_CONTENT(a.regId)}})};g.push(b)});d("WALogger").LOG(q(),a.length);c=(yield d("WASmaxPreKeysFetchMissingPreKeysRPC").sendFetchMissingPreKeysRPC({userArgs:g}));switch(c.name){case"FetchMissingPreKeysResponseSuccess":d("WALogger").LOG(p(),a.length);return B(c.value);case"FetchMissingPreKeysResponseServerError":a=c.value.errorServerErrors.value;d("WALogger").LOG(o(),a.code,a.text);return(h||(h=b("Promise"))).reject(new(d("WAWebBackendErrors").ServerStatusCodeError)(Number(a.code),a.text));case"FetchMissingPreKeysResponseRequestError":a=c.value.errorRequestErrorsFetch.value;d("WALogger").LOG(n(),a.code,a.text);return(h||(h=b("Promise"))).reject(new(d("WAWebBackendErrors").ServerStatusCodeError)(Number(a.code),a.text))}});return x.apply(this,arguments)}function y(a){return z.apply(this,arguments)}function z(){z=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){d("WALogger").LOG(m(),a.length);var b=(yield d("WAWebApiDeviceList").getDeviceIds(a)),c=new Map();b.forEach(function(b,e){if(b){var f=b.devices;f.forEach(function(a){if(a.id!==0){a=d("WAWebWidFactory").createDeviceWidFromDeviceListPk(b.id,a.id,a.isHosted);c.set(a.toString(),a)}})}f=d("WAWebWidFactory").toUserWid(a[e]);c.set(f.toString(),f)});return Array.from(c.values())});return z.apply(this,arguments)}function A(a){a=a.map(function(a){return d("WAWebUserPrefsMeUser").isMeDevice(a)?d("WAWebSignalProtocolStore").getSignalProtocolStore().getLocalRegistrationId():d("WAWebSignalProtocolStore").getSignalProtocolStore().loadSession(String(d("WAWebSignalCommonUtils").createSignalAddress(a))).then(function(a){var b=a==null?void 0:a.sessions;if(b)for(var c in b)if(b[c].indexInfo.closed===-1)return b[c].registrationId;return a==null?void 0:(c=a.remote)==null?void 0:c.regId})});return(h||(h=b("Promise"))).all(a)}function B(a){return C.apply(this,arguments)}function C(){C=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=[];a.listUser.forEach(function(a){var c=a.userFetchMissingPreKeysSuccessOrFetchMissingPreKeysErrorOrFetchMissingPreKeysErrorFallbackMixinGroup;switch(c.name){case"FetchMissingPreKeysUserSuccess":var e=c.value,f=e.jid;e=e.device;var g=d("WAWebWidFactory").createWid(f);e.forEach(function(a){var c,e=a.preKeyMixin;b.push({identity:a.elementValue,deviceIdentity:(c=(c=a.deviceIdentityMixin)==null?void 0:c.deviceIdentityElementValue)!=null?c:null,skey:{id:d("WAParsableXmlNode").convertBytesToUint(a.skeyIdKeyIDMixin.elementValue,3),pubkey:a.skeyValueKeyDataMixin.elementValue,signature:a.skeySignatureElementValue},key:e&&{id:d("WAParsableXmlNode").convertBytesToUint(e.keyIdKeyIDMixin.elementValue,3),pubkey:e.keyValueKeyDataMixin.elementValue},regId:d("WAParsableXmlNode").convertBytesToUint(a.registrationElementValue,4),wid:d("WAWebWidFactory").createDeviceWidFromDeviceListPk(d("WAWebDeviceListPk").createDeviceListPK(g),a.id,!1)})});return;case"FetchMissingPreKeysUserErrorFallback":case"FetchMissingPreKeysUserError":f=c.value;d("WALogger").WARN(l(),a.jid,f.errorCode,f.errorText).sendLogs("fetchResendMissingKeys-user-error");return}});d("WALogger").LOG(k(),b.length);if(b.length>0)try{a=(yield d("WAWebProcessKeyBundle").processKeyBundles(b));a=a.processedPrekeyCount;d("WALogger").LOG(j(),a,b.length)}catch(a){d("WALogger").WARN(i(),a).sendLogs("fetchResendMissingKeys-session-error")}});return C.apply(this,arguments)}g.fetchResendMissingKeys=a}),98); __d("WAWebPostMdDeviceSyncAckMetric",["WAWebGetMessageChatTypeFromWid","WAWebMdDeviceSyncAckWamEvent","WAWebSendMsgCommonApi","WAWebWamAddressingModeUtils"],(function(a,b,c,d,e,f,g){function a(a,b,c,e){b=new(d("WAWebMdDeviceSyncAckWamEvent").MdDeviceSyncAckWamEvent)({revoke:d("WAWebSendMsgCommonApi").isRevokeMsg(b)});b.chatType=d("WAWebGetMessageChatTypeFromWid").getMessageChatTypeFromWid(a);b.isLid=a.isLid();a.isGroup()&&(c==null?void 0:c.isLid)!=null&&(b.isLid=c.isLid);c!=null&&Object.assign(b,d("WAWebWamAddressingModeUtils").getAddressingModeMetricsFromGroupMetadata(c));e!=null&&(b.serverAddressingMode=d("WAWebWamAddressingModeUtils").getWamAddressingModeFromString(e));a.isUser()&&(b.isLid=a.isLid());b.commit()}g.postMdDeviceSyncAckMetric=a}),98); __d("WAWebSendUserMsgJob",["Promise","WALogger","WATimeUtils","WAWebBizCoexGatingUtils","WAWebBizCoexUtils","WAWebBotGating","WAWebDBDeviceListFanout","WAWebDBUpdateMessageTable","WAWebFetchResendMissingKeyJob","WAWebLidMigrationUtils","WAWebMsgFanoutTypes","WAWebMsgGetters","WAWebPersistedJobDefinitions","WAWebPersistedJobManager","WAWebPostMdDeviceSyncAckMetric","WAWebResendUserMsg","WAWebSendMsgToDeviceList","WAWebSyncDeviceAdvDeviceListJob","WAWebUserPrefsMeUser","WAWebWorkerSafeBackendApi","asyncToGeneratorRuntime","cr:10198"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["resendUserMsg: failed to resend message: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["resendUserMsg: failed to resend message: ",", type: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["fetchResendMissingKeys: failed"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendUserMsg: phash mismatch, got server phash ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendUserMsg: sending ",""]);m=function(){return a};return a}function a(a,b,c){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e){var f=a.data,g=f.id,n=f.to,q=f.invokedBotWid,r=f.protocolMessageKey,s=f.subtype;f=f.botRespOrInvocationRevokeBotWid;d("WALogger").LOG(m(),g).tags("messaging");var t=n.isLid()?(g=d("WAWebUserPrefsMeUser").getMaybeMeLid())!=null?g:d("WAWebUserPrefsMeUser").assertGetMe():d("WAWebUserPrefsMeUser").assertGetMe();g={wids:[n,t]};d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&(n==null?void 0:n.isUser())&&(g.chatWidSetToIncludeHostedInFanoutOneToOneChatOnly=n);var u=(yield d("WAWebDBDeviceListFanout").getFanOutList(g));if(d("WAWebBotGating").isBotEnabled())if(d("WAWebMsgGetters").getIsBotFeedbackMessage(a.data)&&r!=null){!n.isBot()&&r.participant!=null?g=r.participant:a.data.bizBotType!=null?g=n:g=r.remote;u=[g]}else if(q&&(q==null?void 0:q.isBot())){r=q;u=[].concat(u,[r])}else f&&(f==null?void 0:f.isBot())&&((s==="sender_revoke"||s==="admin_revoke")&&(u=[].concat(u,[f])));d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&d("WAWebBizCoexUtils").fanoutListContainsHostedDevice(u)&&void d("WAWebDBUpdateMessageTable").updateMessageTable(a.data.id,{senderOrRecipientAccountTypeHosted:!0});g=(yield d("WAWebSendMsgToDeviceList").sendMsgToDeviceList(a,c,u,{fanoutType:d("WAWebMsgFanoutTypes").FANOUT_TYPE.CHAT},e));o(n,g);var v=g.phash;if(v!=null){d("WALogger").LOG(l(),v).tags("messaging");var w=d("WATimeUtils").unixTime();d("WAWebPostMdDeviceSyncAckMetric").postMdDeviceSyncAckMetric(n,c);e.sendReporter=e.createSendReporter({isResend:!0,originalMessage:a.type==="message"?a.data:void 0});void (h||(h=b("Promise"))).resolve().then(function(){if(!n.isLid())return d("WAWebFetchResendMissingKeyJob").fetchResendMissingKeys([n,t])["catch"](function(){d("WALogger").WARN(k()).sendLogs("fetchResendMissingKeys-sync-error")})}).then(function(){return d("WAWebSyncDeviceAdvDeviceListJob").syncDeviceListJob([n,t],"message",v)}).then(function(){return p(a,c,u,w,e)})["catch"](function(b){d("WALogger").WARN(j(),a.data.id.toString(),a.data.type).tags("messaging"),d("WALogger").ERROR(i(),b).tags("messaging").sendLogs("message-resend-failed",{sampling:.01})})}return g});return n.apply(this,arguments)}function o(a,b){b=b.refreshLid;if(b){b=d("WAWebLidMigrationUtils").toPn(a);b&&d("WAWebWorkerSafeBackendApi").workerSafeFireAndForget("syncContactListJob",{contactIds:[b],shouldSyncDevice:!1,mode:"query"})}}function p(a,b,c,d,e){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e,f){var g=(yield d("WAWebPersistedJobManager").getJobManager().accessors.maybeCreateJob(d("WAWebPersistedJobDefinitions").jobSerializers.resendUserMsg(a,c,e)));yield d("WAWebResendUserMsg").resendUserMsg(a,b,c,e,f);yield d("WAWebPersistedJobManager").getJobManager().accessors.deletePersistedJob(g.id)});return q.apply(this,arguments)}g.encryptAndSendUserMsg=a;g.maybeRefreshLid=o}),98); __d("WAWebIdentityApiUtils",["WABinary","WAWebSignalCommonUtils","WAWebSignalProtocolStore","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){function h(a,b){for(var c=0;c<a.length&&c<b.length;++c)if(a[c]!==b[c])return a[c]-b[c];return a.length-b.length}function a(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield j(a));return b.map(function(b,d){if(b==null)throw c("err")("getAllIdentityKeys: missing identity key for device "+String(a[d]));return b})});return i.apply(this,arguments)}function j(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebSignalProtocolStore").getPersistSignalProtocolStore().bulkLoadIdentityKey(a.map(function(a){return d("WAWebSignalCommonUtils").createSignalAddressForIdentityTable(a)})));return a.map(function(a){return a==null?null:new Uint8Array(d("WAWebSignalCommonUtils").strToBuffer(a))})});return k.apply(this,arguments)}function e(a){var b=new(d("WABinary").Binary)();a.sort(h).forEach(function(a){b.writeByteArray(a)});return b.readByteArray()}g.getAllIdentityKeysBytesOrThrow=a;g.getAllIdentityKeysBytes=j;g.identityKeysToBinary=e}),98); __d("WAWebIdentityIcdcApi",["WACryptoSha256","WAJids","WANullthrows","WASignalOther","WATimeUtils","WAWebABProps","WAWebApiDeviceList","WAWebBizCoexGatingUtils","WAWebCryptoCurve25519","WAWebIdentityApiUtils","WAWebProtobufsAdv.pb","WAWebSignalProtocolStore","WAWebUserPrefsMeUser","WAWebUserPrefsMultiDevice","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h=8,i=30*24*60*60;function a(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield d("WAWebApiDeviceList").getDeviceRecord(a));return!b||b.deleted?null:k(a,b)});return j.apply(this,arguments)}function k(a,b){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if(!b||b.deleted)return null;var e={keyHash:void 0,timestamp:void 0},f=b.timestamp,g=b.devices,h=b.id;b=b.advAccountType;var i=g.some(function(a){return a.id!==d("WAJids").DEFAULT_DEVICE_ID});if(i){var j=g.map(function(a){return[a.keyIndex,d("WAWebWidFactory").createDeviceWidFromDeviceListPk(h,a.id,a.isHosted)]}),k=[],l=null;j.forEach(function(a){var b=a[0];a=a[1];!d("WAWebUserPrefsMeUser").isMeDevice(a)?k.push([b,a]):l=b});j=(yield d("WAWebIdentityApiUtils").getAllIdentityKeysBytes(k.map(function(a){a=a[1];return a})));var n=[],q=[];j.forEach(function(a,b){a!=null&&(n.push(a),q.push(k[b][0]))});if(d("WAWebUserPrefsMeUser").isMeAccount(a)){j=(yield d("WAWebSignalProtocolStore").getSignalProtocolStore().getIdentityKeyPair());if(!j)return null;n.push(new Uint8Array(j.pubKey));q.push(c("WANullthrows")(l))}j=o();e.keyHash=(yield m(n.map(function(a){return new Uint8Array(d("WAWebCryptoCurve25519").toCurveKeyPubKey(a.buffer))}),j));q.length!==g.length&&(e.keyIndexes=q)}(i||p(f))&&(e.timestamp=f);d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&(d("WAWebUserPrefsMeUser").isMeAccount(a)&&(yield d("WAWebUserPrefsMultiDevice").getIsHostedMeAccount())===!0&&(e.senderAccountType=d("WAWebProtobufsAdv.pb").ADVEncryptionType.HOSTED),!d("WAWebUserPrefsMeUser").isMeAccount(a)&&b===d("WAWebProtobufsAdv.pb").ADVEncryptionType.HOSTED&&(e.receiverAccountType=d("WAWebProtobufsAdv.pb").ADVEncryptionType.HOSTED));return e});return l.apply(this,arguments)}function m(a,b){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=d("WAWebIdentityApiUtils").identityKeysToBinary(a);a=(yield d("WACryptoSha256").sha256(a));a=new Uint8Array(a);return d("WASignalOther").sliceBytes(a,0,b)});return n.apply(this,arguments)}function o(){var a=d("WAWebABProps").getABPropConfigValue("md_icdc_hash_length");return Math.max(a,h)}function p(a){return d("WATimeUtils").unixTime()-a<i}g.getICDCMeta=a;g.getICDCMetaFromDeviceRecord=k;g.computeIdentityHash=m}),98); __d("WAWebGetGroupKeyDistributionMsg",["Promise","WALogger","WAWebAdvMetadataCreationFailureWamEvent","WAWebApiDeviceList","WAWebDeviceSentMessageProtoUtils","WAWebE2EProtoGenerator","WAWebEncryptMsgProtobuf","WAWebIdentityIcdcApi","WAWebSendMsgCommonApi","WAWebUserPrefsMeUser","WAWebWidFactory","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendUserMsg: encryption fail for ",", ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["getKeyDistributionMsg: precalculate ICDC for ",""]);j=function(){return a};return a}function a(a,b,c,d,e){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e,f,g,k){var m={senderKeyDistributionMessage:{groupId:e.toString({legacy:!0}),axolotlSenderKeyDistributionMessage:g}};d("WALogger").LOG(j(),a==null?void 0:a.id.toString()).tags("messaging");var n=(yield l(m,f,k,e));g=f.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){try{var e;e=(e=n.get(d("WAWebWidFactory").toUserWid(a).toString()))!=null?e:babelHelpers["extends"]({},m);e=(yield d("WAWebEncryptMsgProtobuf").encryptMsgProtobuf(a,0,e));return{type:e.type,ciphertext:e.ciphertext,isUsingDeprecatedLidSession:e.isUsingDeprecatedLidSession,participant:a}}catch(e){d("WALogger").LOG(i(),a.toString(),e).tags("messaging");if(d("WAWebSendMsgCommonApi").isPrimaryDevice(a))return(h||(h=b("Promise"))).reject(c("err")("[messaging] encryptAndSendUserMsg: encryption fail for primary device "+String(a)))}});return function(b){return a.apply(this,arguments)}}());a=(yield (h||(h=b("Promise"))).all(g));return a.filter(Boolean)});return k.apply(this,arguments)}function l(a,b,c,d){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e,f){var g=d("WAWebUserPrefsMeUser").getMeUser(),i=[].concat(Array.from(new Set(c.map(d("WAWebWidFactory").toUserWid))));c=(yield d("WAWebApiDeviceList").bulkGetDeviceRecord([g].concat(i)));var j=c[0];c=c.slice(1);var k=null;try{k=(yield d("WAWebIdentityIcdcApi").getICDCMetaFromDeviceRecord(g,j))}catch(a){new(d("WAWebAdvMetadataCreationFailureWamEvent").AdvMetadataCreationFailureWamEvent)({advMetadataIsMe:!0}).commit();throw a}var l=new Map();yield (h||(h=b("Promise"))).all(c.map(function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b,c){c=i[c];var g=babelHelpers["extends"]({},a),h=null;if(d("WAWebUserPrefsMeUser").isMeAccount(c))e&&(g=d("WAWebDeviceSentMessageProtoUtils").wrapDeviceSentMessage(g,f));else try{h=(yield d("WAWebIdentityIcdcApi").getICDCMetaFromDeviceRecord(c,b))}catch(a){new(d("WAWebAdvMetadataCreationFailureWamEvent").AdvMetadataCreationFailureWamEvent)({advMetadataIsMe:!1}).commit();throw a}d("WAWebE2EProtoGenerator").populateMessageContextInfo(g,k,h);l.set(c.toString(),g)});return function(a,b){return c.apply(this,arguments)}}()));return l});return m.apply(this,arguments)}g.getKeyDistributionMsg=a;g.generateMsgProtobufs=l}),98); __d("WAWebWamNumberToClientGroupSizeBucket",["WAWebWamEnumClientGroupSizeBucket"],(function(a,b,c,d,e,f,g){function a(a){if(a<=32+1)return d("WAWebWamEnumClientGroupSizeBucket").CLIENT_GROUP_SIZE_BUCKET.SMALL;if(a<=64+1)return d("WAWebWamEnumClientGroupSizeBucket").CLIENT_GROUP_SIZE_BUCKET.MEDIUM;if(a<=128+1)return d("WAWebWamEnumClientGroupSizeBucket").CLIENT_GROUP_SIZE_BUCKET.LARGE;if(a<=256+1)return d("WAWebWamEnumClientGroupSizeBucket").CLIENT_GROUP_SIZE_BUCKET.EXTRA_LARGE;if(a<=512+1)return d("WAWebWamEnumClientGroupSizeBucket").CLIENT_GROUP_SIZE_BUCKET.XX_LARGE;if(a<=1024+1)return d("WAWebWamEnumClientGroupSizeBucket").CLIENT_GROUP_SIZE_BUCKET.LT1024;if(a<=1500+1)return d("WAWebWamEnumClientGroupSizeBucket").CLIENT_GROUP_SIZE_BUCKET.LT1500;if(a<=2e3+1)return d("WAWebWamEnumClientGroupSizeBucket").CLIENT_GROUP_SIZE_BUCKET.LT2000;if(a<=2500+1)return d("WAWebWamEnumClientGroupSizeBucket").CLIENT_GROUP_SIZE_BUCKET.LT2500;if(a<=3e3+1)return d("WAWebWamEnumClientGroupSizeBucket").CLIENT_GROUP_SIZE_BUCKET.LT3000;if(a<=3500+1)return d("WAWebWamEnumClientGroupSizeBucket").CLIENT_GROUP_SIZE_BUCKET.LT3500;if(a<=4e3+1)return d("WAWebWamEnumClientGroupSizeBucket").CLIENT_GROUP_SIZE_BUCKET.LT4000;if(a<=4500+1)return d("WAWebWamEnumClientGroupSizeBucket").CLIENT_GROUP_SIZE_BUCKET.LT4500;return a<=5e3+1?d("WAWebWamEnumClientGroupSizeBucket").CLIENT_GROUP_SIZE_BUCKET.LT5000:d("WAWebWamEnumClientGroupSizeBucket").CLIENT_GROUP_SIZE_BUCKET.LARGEST_BUCKET}g["default"]=a}),98); __d("WAWebMaybePostMdGroupSyncMetrics",["WALogger","WAWebMdGroupParticipantMissAckWamEvent","WAWebSendMsgCommonApi","WAWebWamEnumTypeOfGroupEnum","WAWebWamNumberToClientGroupSizeBucket"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["postGroupParticipantSyncMetric: skip due to no participant change"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["maybePostGroupSyncMetrics: event commit failed with ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["postGroupParticipantSyncMetric: added: ",", removed: ",""]);j=function(){return a};return a}function a(a,b,e,f){b=k(a,b);var g=b.added;b=b.removed;if(g!==0||b!==0){d("WALogger").LOG(j(),g,b);var l=new(d("WAWebMdGroupParticipantMissAckWamEvent").MdGroupParticipantMissAckWamEvent)();l.messageIsRevoke=d("WAWebSendMsgCommonApi").isRevokeMsg(e);l.groupSizeBucket=c("WAWebWamNumberToClientGroupSizeBucket")((f==null?void 0:f.participantCount)||0);l.typeOfGroup=(f==null?void 0:f.wamTypeOfGroup)||d("WAWebWamEnumTypeOfGroupEnum").TYPE_OF_GROUP_ENUM.GROUP;l.isLid=l.isLid=a.some(function(a){return a.isLid()});l.participantAddCount=g;l.participantRemoveCount=b;l.commitAndWaitForFlush()["catch"](function(a){d("WALogger").WARN(i(),a)})}d("WALogger").LOG(h())}function k(a,b){var c=new Set(a.map(String)),d=new Set(b.map(String));return{added:b.filter(function(a){return!c.has(String(a))}).length,removed:a.filter(function(a){return!d.has(String(a))}).length}}g.maybePostGroupSyncMetrics=a;g.computeParticipantChange=k}),98); __d("WAWebResendGroupMsg",["WALogger","WATimeUtils","WAWebDBDeviceListFanout","WAWebFetchResendMissingKeyJob","WAWebGroupMsgSendUtils","WAWebGroupQueryBridge","WAWebMaybePostMdGroupSyncMetrics","WAWebMsgFanoutTypes","WAWebMsgUtilsBridge","WAWebPersistedJobDefinitions","WAWebPersistedJobManager","WAWebPostMdDeviceSyncAckMetric","WAWebSendDirectMsgToDeviceList","WAWebSendMsgCommonApi","WAWebSyncDeviceAdvDeviceListJob","WAWebWamEnumMessageSendResultType","WAWebWidFactory","asyncToGeneratorRuntime","lodash"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["postGroupParticipantSyncMetric: failed to find participant record for group ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["postGroupParticipantSyncMetric: start"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["resendGroupMsg: failed to resend message: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["resendGroupMsg: failed to resend "," message: ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["resendGroupMsg: ",": done"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["resendGroupMsg: ",": skip resending because this message has been overwritten by a revoke"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["resendGroupMsg: ",": resending to devices: ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["resendGroupMsg: ",": skip resending to the empty list"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["resendUserMsg: ",": skip group resending due to "," min timeout"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["resendGroupMsg: ",": sendQueryGroup failed for message resend: ",""]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["postGroupParticipantSyncMetric: ",": failed for postGroupParticipantSyncMetric ",""]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["fetchResendMissingKeys: failed"]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["resendGroupMsg: "," to ",""]);t=function(){return a};return a}function u(a){return v.apply(this,arguments)}function v(){v=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.isDirect,e=a.msgRecord,f=a.msgProtobuf,g=a.oldList,h=a.ackTime,i=a.groupData,u=a.phash,v=a.metricReporter;a=a.serverAddressingMode;var y=e.data.id.id,z=e.data.to;d("WALogger").LOG(t(),y,z.toString()).tags("messaging");d("WAWebPostMdDeviceSyncAckMetric").postMdDeviceSyncAckMetric(z,f,i,a);v.sendReporter=v.createSendReporter({isResend:!0,originalMessage:e.type==="message"?e.data:void 0,groupData:i});a=Array.from(new Set(g.map(function(a){return d("WAWebWidFactory").toUserWid(a).toString()}))).map(function(a){return d("WAWebWidFactory").createUserWid(a)});if(!d("WAWebGroupMsgSendUtils").isCagAddon(e.data,i))try{yield d("WAWebFetchResendMissingKeyJob").fetchResendMissingKeys(g)}catch(a){d("WALogger").WARN(s()).sendLogs("fetchResendMissingKeys-sync-error")}if(b)yield d("WAWebSyncDeviceAdvDeviceListJob").syncDeviceListJob(g,"message",u);else try{yield d("WAWebGroupQueryBridge").sendQueryGroup(z),x(i,z,f,a.map(d("WAWebWidFactory").createWidFromWidLike))["catch"](function(a){d("WALogger").WARN(r(),y,a).tags("messaging")})}catch(a){d("WALogger").WARN(q(),y,a).tags("messaging");w(v);throw a}b=d("WAWebSendMsgCommonApi").getResendTimeoutInSeconds();if(d("WATimeUtils").unixTime()-h>b){d("WALogger").LOG(p(),y,b/60).tags("messaging");(u=v.sendReporter)==null?void 0:u.postFailure({result:d("WAWebWamEnumMessageSendResultType").MESSAGE_SEND_RESULT_TYPE.ERROR_EXPIRED,isTerminal:!1});v.sendReporter=null;return}try{z=(yield d("WAWebDBDeviceListFanout").getFanOutList({wids:a}));h=c("lodash").differenceBy(z,g,String);if(h.length===0){d("WALogger").LOG(o(),y).tags("messaging");return}d("WALogger").LOG(n(),y,h.join(",")).tags("messaging");if(e.data.isOverwrittenByRevoke===!0){d("WALogger").LOG(m(),y).tags("messaging");return}yield d("WAWebSendDirectMsgToDeviceList").sendDirectMsgToDeviceList(e,f,h,{fanoutType:d("WAWebMsgFanoutTypes").FANOUT_TYPE.GROUP_DIRECT,isResendingMsg:!0},i,v);d("WALogger").LOG(l(),y).tags("messaging")}catch(a){d("WALogger").LOG(k(),y,a).tags("messaging");d("WALogger").ERROR(j(),a).tags("messaging");(b=v.sendReporter)==null?void 0:b.postFailure({result:d("WAWebWamEnumMessageSendResultType").MESSAGE_SEND_RESULT_TYPE.ERROR_UNKNOWN,isTerminal:!1});v.sendReporter=null;throw a}yield d("WAWebMsgUtilsBridge").logMessageSendForChatThreadLogging(e.data)});return v.apply(this,arguments)}function w(a){var b;(b=a.sendReporter)==null?void 0:b.postFailure({result:d("WAWebWamEnumMessageSendResultType").MESSAGE_SEND_RESULT_TYPE.ERROR_BACKFILL_USYNC_FAILED,isTerminal:!1});a.sendReporter=null}function x(a,b,c,d){return y.apply(this,arguments)}function y(){y=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e){d("WALogger").LOG(i());var f=(yield d("WAWebGroupMsgSendUtils").getParticipantRecord(String(b)));if(!f){d("WALogger").LOG(h(),String(b));return}b=f.participants.map(d("WAWebWidFactory").createWid);d("WAWebMaybePostMdGroupSyncMetrics").maybePostGroupSyncMetrics(e,b,c,a)});return y.apply(this,arguments)}function a(a){return z.apply(this,arguments)}function z(){z=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.msgRecord,c=a.groupData,e=a.isDirect,f=a.oldList,g=a.phash,h=a.ackTime,i=a.serverAddressingMode;b=(yield d("WAWebPersistedJobManager").getJobManager().accessors.maybeCreateJob(d("WAWebPersistedJobDefinitions").jobSerializers.resendGroupMsg(b,c,e,f,g,h,i)));yield u(a);yield d("WAWebPersistedJobManager").getJobManager().accessors.deletePersistedJob(b.id)});return z.apply(this,arguments)}g.resendGroupMsg=u;g.resendPersistedGroupMsgWrapper=a}),98); __d("WAWebSendDirectMsgToDeviceList",["Promise","WADeprecatedSendIq","WAWebCommsAckParser","WAWebSendMsgCommonApi","WAWebSendMsgCreateFanoutStanza","WAWebSignalProtocolStore","WAWebWamEnumMessageDistributionEnumType","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h;function a(a,b,c,d,e,f){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e,f,g,i,j){var k=a.data,l=k.id;k=k.to;a=(yield d("WAWebSendMsgCreateFanoutStanza").createFanoutMsgStanza(a,e,f,g,j,i));e=a.stanza;yield d("WAWebSignalProtocolStore").getSignalProtocolStore().flushBufferToDiskIfNotMemOnlyMode();(f=j.sendPerfReporter)==null?void 0:f.postReadyToSendStage();(g=j.sendPerfReporter)==null?void 0:g.startWrittenWireStage();i=(yield d("WADeprecatedSendIq").deprecatedSendStanzaAndReturnAck(e,d("WAWebCommsAckParser").toCoreAckTemplate({id:l.id,"class":"message",from:k,participant:null})));a=d("WAWebSendMsgCommonApi").sendMsgAckSyncParser.parse(i);if(a.error)return(h||(h=b("Promise"))).reject(c("err")("[messaging] encryptAndSendGroupDirectMsg: Invalid ack from server"));(f=j.sendReporter)==null?void 0:f.setMessageDistributionType(d("WAWebWamEnumMessageDistributionEnumType").MESSAGE_DISTRIBUTION_ENUM_TYPE.DIRECT_MESSAGE);(g=j.sendPerfReporter)==null?void 0:g.postWrittenWireStage();j.sendPerfReporter=null;(e=j.sendReporter)==null?void 0:e.postSuccess();j.sendReporter=null;return a.success});return i.apply(this,arguments)}g.sendDirectMsgToDeviceList=a}),98); __d("WAWebSendGroupDirectJob",["WALogger","WATimeUtils","WAWebMsgFanoutTypes","WAWebResendGroupMsg","WAWebSendDirectMsgToDeviceList","asyncToGeneratorRuntime","cr:10198"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["resendGroupDirectMsg: failed to resend group msg: ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["resendGroupDirectMsg: failed to resend group msg: ",", type: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendGroupDirectMsg: phash mismatch, got server phash ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendGroupDirectMsg: sending "," with group ",""]);k=function(){return a};return a}function a(a,b,c,d,e){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e,f){var g=a.data.to;d("WALogger").LOG(k(),a.data.id,g.toLogString()).tags("messaging");g=(yield d("WAWebSendDirectMsgToDeviceList").sendDirectMsgToDeviceList(a,b,c,{fanoutType:d("WAWebMsgFanoutTypes").FANOUT_TYPE.GROUP_DIRECT},e,f));var l=g.phash,m=g.addressingMode;l&&(d("WALogger").LOG(j(),l).tags("messaging"),void d("WAWebResendGroupMsg").resendPersistedGroupMsgWrapper({isDirect:!0,msgRecord:a,msgProtobuf:b,oldList:c,ackTime:d("WATimeUtils").unixTime(),groupData:e,phash:l,metricReporter:f,serverAddressingMode:m})["catch"](function(b){d("WALogger").WARN(i(),a.data.id.toString(),a.data.type).tags("messaging"),d("WALogger").ERROR(h(),b).tags("messaging").sendLogs("message-resend-failed",{sampling:.01})}));return g});return l.apply(this,arguments)}g.encryptAndSendGroupDirectMsg=a}),98); __d("WAWebSendGroupKeyDistributionMsgJob",["Promise","WADeprecatedSendIq","WALogger","WAWap","WAWebAdvSignatureApi","WAWebApiMessageInfoStore","WAWebApiParticipantStore","WAWebBackendJobs.flow","WAWebBackendJobsCommon","WAWebCommsAckParser","WAWebCommsWapMd","WAWebGetGroupKeyDistributionMsg","WAWebGroupMsgSendUtils","WAWebLidFoundationalGatingUtils","WAWebManageE2ESessionsJob","WAWebPhashUtils","WAWebSchemaParticipant","WAWebSendMsgCommonApi","WAWebSendMsgQueueMap","WAWebSignal","WAWebSignalProtocolStore","WAWebUserPrefsMeUser","asyncToGeneratorRuntime","cr:10198","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendSenderKeyMsg: Invalid ack from server"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendGroupKeyDistributionMsg: skip sending ",": sender key distribution list is empty"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendGroupKeyDistributionMsg: sending ",""]);k=function(){return a};return a}function a(a,b){d("WALogger").LOG(k(),a).tags("messaging");var c=a.remote;return d("WAWebSendMsgQueueMap").sendMsgQueueMap.enqueue(c.toString(),function(){return l(a,b)})}function l(a,b){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){var f=a.id,g=a.remote,k=(yield d("WAWebSchemaParticipant").getParticipantTable().get(g.toString())),l=(yield d("WAWebGroupMsgSendUtils").getGroupData(g.toString(),k));e.setGroupData(l);e=(yield d("WAWebApiParticipantStore").getGroupSenderKeyListFromParticipantRecord(g,k));l=e.skDistribList;k=e.skList;e=e.rotateKey;k=k.concat(l);if(l.length===0){d("WALogger").LOG(j(),a).tags("messaging");return}yield d("WAWebApiMessageInfoStore").createOrMergeReceiptRecords(k.map(function(b){return{msgKey:a,receiverId:b}}));yield d("WAWebManageE2ESessionsJob").ensureE2ESessions(l);k=(yield d("WAWebPhashUtils").phashV2([].concat(k,[d("WAWebUserPrefsMeUser").assertGetMe()])));e=(yield n(g,l,e));var m=e[0];e=e[1];k=d("WAWap").wap("message",{id:d("WAWap").CUSTOM_STRING(f),to:d("WAWebCommsWapMd").CHAT_JID(g),phash:d("WAWap").CUSTOM_STRING(k),type:"text",device_fanout:d("WAWap").CUSTOM_STRING("false")},d("WAWap").wap("meta",{appdata:"default"}),d("WAWap").wap("enc",{v:d("WAWap").CUSTOM_STRING(d("WAWebBackendJobsCommon").CIPHERTEXT_VERSION.toString()),type:d("WAWap").CUSTOM_STRING(d("WAWebBackendJobs.flow").CiphertextType.Skmsg),"decrypt-fail":d("WAWap").CUSTOM_STRING("hide")}),m,e);yield d("WAWebSignalProtocolStore").getSignalProtocolStore().flushBufferToDiskIfNotMemOnlyMode();m=(yield d("WADeprecatedSendIq").deprecatedSendStanzaAndReturnAck(k,d("WAWebCommsAckParser").toCoreAckTemplate({id:f,"class":"message",from:g,participant:null})));e=d("WAWebSendMsgCommonApi").sendMsgAckSyncParser.parse(m);if(e.error){d("WALogger").WARN(i()).tags("messaging");return(h||(h=b("Promise"))).reject(c("err")("[messaging] encryptAndSendSenderKeyMsg: Invalid ack from server"))}yield d("WAWebApiParticipantStore").markHasSenderKey(g,l);return e.success});return m.apply(this,arguments)}function n(a,b,c){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){var e=b.every(function(a){return a.isLid()});e=e?d("WAWebUserPrefsMeUser").assertGetMeLid():d("WAWebUserPrefsMeUser").assertGetMe();c&&(yield d("WAWebSignal").Session.deleteGroupSenderKeyInfo(a,e));c=(yield d("WAWebSignal").Session.getGroupSenderKeyInfo(a,e,d("WAWebLidFoundationalGatingUtils").shouldUseDeprecatedSenderKeyToCreateSenderKey(b)));e=(yield d("WAWebGetGroupKeyDistributionMsg").getKeyDistributionMsg(null,a,b,c,!0));a=null;b=!1;e&&e.length>0&&(a=d("WAWap").wap("participants",null,e.map(function(a){var c=a.type,e=a.ciphertext;a=a.participant;c===d("WAWebBackendJobs.flow").CiphertextType.Pkmsg&&(b=!0);return d("WAWap").wap("to",{jid:d("WAWebCommsWapMd").DEVICE_JID(a)},d("WAWap").wap("enc",{v:d("WAWap").CUSTOM_STRING(d("WAWebBackendJobsCommon").CIPHERTEXT_VERSION.toString()),"decrypt-fail":d("WAWap").CUSTOM_STRING("hide"),type:d("WAWap").CUSTOM_STRING(c)},e))})));c=null;if(b){e=(yield d("WAWebAdvSignatureApi").getADVEncodedIdentity());c=d("WAWap").wap("device-identity",null,e)}return[a,c]});return o.apply(this,arguments)}g.encryptAndSendGroupKeyDistributionMsg=a}),98); __d("WAWebSendGroupMsgJob",["WALogger","WAWebABProps","WAWebApiContact","WAWebApiParticipantStore","WAWebDBDeviceListFanout","WAWebE2EProtoGenerator","WAWebGroupMsgSendUtils","WAWebLidMigrationUtils","WAWebMaybe","WAWebMsgGetters","WAWebMsgKey","WAWebMsgRcatUtils","WAWebMsgType","WAWebProtobufsE2E.pb","WAWebSchemaMessageInfo","WAWebSendGroupDirectJob","WAWebSendGroupSkmsgJob","WAWebSendMsgQueueMap","WAWebWidFactory","asyncToGeneratorRuntime","err","isStringNullOrEmpty"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose([""," found in "," group groupSendingList.senderKeyList.skList"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose([""," found in "," group groupSendingList.senderKeyList.skDistribList"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose([""," found in "," group groupSendingList.deviceList"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendGroupMsg: ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendGroupMsg: Incognito CAG "," "]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendGroupMsg: sending ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendGroupMsg: queued ",""]);n=function(){return a};return a}var o=Object.freeze({SKMSG:"skmsg",DIRECT:"direct"});function p(a){return a.isLid()}function q(a){return!a.isLid()}function r(a,b,c,d,e,f,g,h){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e,f,g,h,i){b=(yield d("WAWebApiParticipantStore").getGroupSenderKeyListFromParticipantRecord(b,h));h=b.skDistribList;b=b.skList;i=i||t(a,g);i=i?p:q;b={type:o.SKMSG,senderKeyList:{skList:b.filter(i),skDistribList:h.filter(i),rotateKey:!1}};if(d("WAWebMsgGetters").getSubtype(a.data)==="sender_revoke"){h=!g&&d("WAWebABProps").getABPropConfigValue("send_cag_member_revokes_as_GDM");i=c==null?null:yield w(c,b.senderKeyList,{forceDirectMessage:h,normalizeAddressingModeFn:function(a){return a}});return(c=i)!=null?c:b}if(d("WAWebMsgGetters").getType(a.data)==="keep_in_chat"){h=!g&&d("WAWebABProps").getABPropConfigValue("supports_keep_in_chat_in_cag");i=e==null?null:yield y(e,b.senderKeyList,h);return(c=i)!=null?c:b}return f?A(f,b.senderKeyList,{normalizeAddressingModeFn:function(a){return a}}):b});return s.apply(this,arguments)}function t(a,b){var e=a.data,f=e.type,g=e.subtype;e=e.keepType;if(e===d("WAWebProtobufsE2E.pb").KeepType.UNDO_KEEP_FOR_ALL)return!1;switch(f){case"reaction_enc":case"comment":case"event_response":return!0;case"poll_update":if(g==="poll_vote")return!0;break;case"protocol":if(a.type==="addon"&&a.data.kind===d("WAWebMsgType").MsgKind.ProtocolAddonRevoke)return!0;if(g==="sender_revoke")return!1;break;case"notification":case"status_notification":case"notification_template":case"gp2":case"broadcast_notification":case"e2e_notification":case"call_log":case"chat":case"location":case"payment":case"vcard":case"ciphertext":case"debug_placeholder":case"multi_vcard":case"revoked":case"oversized":case"groups_v4_invite":case"hsm":case"template_button_reply":case"debug":case"image":case"video":case"ptv":case"audio":case"ptt":case"sticker":case"status":case"document":case"product":case"order":case"list":case"interactive":case"interactive_response":case"list_response":case"buttons_response":case"reaction":case"poll_creation":case"poll_result_snapshot":case"request_phone_number":case"native_flow":case"biz-cover-photo":case"keep_in_chat":case"pin_message":case"pinned_message":case"unknown":case"newsletter_notification":case"history_bundle":case"newsletter_admin_invite":case"event_creation":case"event_edit_encrypted":case"biz_content_placeholder":case"album":case"sticker-pack":case"rich_response":case"automated_greeting_message":break;default:f;throw c("err")("CAG - Invalid type: "+f)}if(b)return!1;throw c("err")("CAG - non-admin trying to send a regular message")}function u(a,b,c,d,e){return v.apply(this,arguments)}function v(){v=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e,f){a=(yield d("WAWebApiParticipantStore").getGroupSenderKeyListFromParticipantRecord(a,b));b={senderKeyList:a,type:o.SKMSG};var g=function(a){return a.map(d("WAWebLidMigrationUtils").toAddressingModeFactory(f))};if(c){c=(yield w(c,a,{forceDirectMessage:!1,normalizeAddressingModeFn:g}));return(c=c)!=null?c:b}return e?A(e,a,{normalizeAddressingModeFn:g}):b});return v.apply(this,arguments)}function w(a,b,c){return x.apply(this,arguments)}function x(){x=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){a=(yield d("WAWebSchemaMessageInfo").getMessageInfoTable().equals(["msgKey"],String(a)));a=a.map(function(a){return d("WAWebWidFactory").createWid(a.receiverUserJid)});if(a.length===0)return null;var e=b.skDistribList;b=b.skList;var f=new Set([].concat(e,b).map(d("WAWebWidFactory").toUserWid).map(String));a=a.filter(function(a){var b=d("WAWebApiContact").getAlternateUserWid(d("WAWebWidFactory").toUserWid(a));return!f.has(String(a))&&!(b!=null&&f.has(String(b)))});a=c.normalizeAddressingModeFn(a).filter(Boolean);if(c.forceDirectMessage===!1&&a.length===0)return null;c=(yield d("WAWebDBDeviceListFanout").getFanOutList({wids:a}));return{type:o.DIRECT,deviceList:[].concat(c,b,e)}});return x.apply(this,arguments)}function y(a,b,c){return z.apply(this,arguments)}function z(){z=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){a=(yield d("WAWebSchemaMessageInfo").getMessageInfoTable().equals(["msgKey"],String(a)));if(a.length===0)return null;var e=b.skDistribList;b=b.skList;var f=new Set(e.concat(b).map(function(a){return String(d("WAWebWidFactory").toUserWid(a))}));a=a.filter(function(a){return!f.has(a.receiverUserJid)}).map(function(a){return d("WAWebWidFactory").createWid(a.receiverUserJid)});if(a.length===0&&c!==!0)return null;c=(yield d("WAWebDBDeviceListFanout").getFanOutList({wids:a}));a=[].concat(c,b,e);return{type:o.DIRECT,deviceList:a}});return z.apply(this,arguments)}function A(a,b,c){return B.apply(this,arguments)}function B(){B=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){a=(yield d("WAWebSchemaMessageInfo").getMessageInfoTable().equals(["msgKey"],String(a)));var e=b.skDistribList;b=b.skList;var f=new Set(e.concat(b).map(function(a){return String(d("WAWebWidFactory").toUserWid(a))})),g=function(a){return d("WAWebMaybe").ifSome(d("WAWebApiContact").getAlternateUserWid(d("WAWebWidFactory").toUserWid(a)),function(a){return f.has(String(a))})};e=a.map(function(a){return d("WAWebWidFactory").createWid(a.receiverUserJid)}).filter(function(a){return f.has(String(a))||g(a)});b=c.normalizeAddressingModeFn(e).filter(Boolean);a=(yield d("WAWebDBDeviceListFanout").getFanOutList({wids:b}));return{type:o.DIRECT,deviceList:[].concat(a)}});return B.apply(this,arguments)}function a(a,c,e){var f,g=a.data,h=g.id,i=g.to;d("WALogger").LOG(n(),h).tags("messaging");(f=e.sendPerfReporter)==null?void 0:f.startWaitingToEncryptStage();return d("WAWebSendMsgQueueMap").sendMsgQueueMap.enqueue(i.toString(),b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var b,f;d("WALogger").LOG(m(),h).tags("messaging");(b=e.sendPerfReporter)==null?void 0:b.postWaitingToEncryptStage();(b=e.sendPerfReporter)==null?void 0:b.startReadyToSendStage();b=D(c);var j=F(c),n=E(c),p=(yield d("WAWebGroupMsgSendUtils").getParticipantRecord(i.toString())),q=(yield d("WAWebGroupMsgSendUtils").getGroupData(i.toString(),p,a));(f=e.sendReporter)==null?void 0:f.setGroupData(q);(f=e.sendPerfReporter)==null?void 0:f.setGroupData(q);f=(f=p==null?void 0:p.participants.map(function(a){return d("WAWebWidFactory").createUserWid(a)}))!=null?f:[];f=(yield d("WAWebMsgRcatUtils").genContentBindingForMsg(g,f));var s=Boolean(q.isLidAddressingMode);if(q.isCag===!0){var t=Boolean(q.amIAdmin);d("WALogger").LOG(l(),t?"admin":"non-admin").tags("messaging");n=(yield r(a,i,b,n,j,t,p,s))}else{d("WALogger").LOG(k(),d("WAWebGroupMsgSendUtils").formatGroupTypeForLog(q)).tags("messaging");t=(yield u(i,p,b,j,s));n=C(t,q)}p=(q==null?void 0:q.isCapiGroup)===!0?d("WAWebE2EProtoGenerator").updateGroupMsgProtoWithCapiFlag(c):c;if(n.type===o.DIRECT){b=n;j=b.deviceList;(s=e.sendReporter)==null?void 0:s.setDeviceCount(j.length);(t=e.sendPerfReporter)==null?void 0:t.setIsDirectedMessage(!0);return d("WAWebSendGroupDirectJob").encryptAndSendGroupDirectMsg(a,p,j,q,e)}b=n;s=b.senderKeyList;(t=e.sendReporter)==null?void 0:t.setDeviceCount(s.skList.length+s.skDistribList.length);return d("WAWebSendGroupSkmsgJob").encryptAndSendSenderKeyMsg(a,p,s,q,e,f)}))}function C(a,b){var e=b.isLidAddressingMode===!0?p:q;switch(a.type){case o.DIRECT:var f=a.deviceList.filter(e);if(f.length<a.deviceList.length){var g=d("WAWebGroupMsgSendUtils").formatWidTypeCountsForLog(a.deviceList),k=d("WAWebGroupMsgSendUtils").formatGroupTypeForLog(b);d("WALogger").ERROR(j(),g,k).sendLogs("GroupLidInfra/outgoing_message")}return babelHelpers["extends"]({},a,{deviceList:f});case o.SKMSG:g=a.senderKeyList;k=g.skDistribList;f=g.skList;g=k.filter(e);if(g.length<k.length){k=d("WAWebGroupMsgSendUtils").formatWidTypeCountsForLog(k);var l=d("WAWebGroupMsgSendUtils").formatGroupTypeForLog(b);d("WALogger").ERROR(i(),k,l).sendLogs("GroupLidInfra/outgoing_message")}k=f.filter(e);if(k.length<f.length){l=d("WAWebGroupMsgSendUtils").formatWidTypeCountsForLog(f);e=d("WAWebGroupMsgSendUtils").formatGroupTypeForLog(b);d("WALogger").ERROR(h(),l,e).sendLogs("GroupLidInfra/outgoing_message")}return babelHelpers["extends"]({},a,{senderKeyList:babelHelpers["extends"]({},a.senderKeyList,{skDistribList:g,skList:k})});default:a.type;throw c("err")("filterIncorrectlyAddressedDevices - Invalid type: "+a.type)}}function D(a){a=a.protocolMessage;var b=null;if((a==null?void 0:a.type)===d("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.REVOKE&&(a==null?void 0:a.key)){a=a.key;var e=a.remoteJid,f=a.id;a=a.participant;!c("isStringNullOrEmpty")(e)&&!c("isStringNullOrEmpty")(f)&&!c("isStringNullOrEmpty")(a)&&(b=new(c("WAWebMsgKey"))({remote:d("WAWebWidFactory").createWid(e),fromMe:!0,id:f,participant:d("WAWebWidFactory").createWid(a)}))}return b}function E(a){a=a.keepInChatMessage;if(a==null?void 0:a.key){a=a.key;var b=a.remoteJid,e=a.id;a=a.participant;if(!c("isStringNullOrEmpty")(b)&&!c("isStringNullOrEmpty")(e)&&!c("isStringNullOrEmpty")(a)){b=new(c("WAWebMsgKey"))({remote:d("WAWebWidFactory").createWid(b),fromMe:!0,id:e,participant:d("WAWebWidFactory").createWid(a)});return b}}return null}function F(a){a=(a=a.editedMessage)==null?void 0:(a=a.message)==null?void 0:a.protocolMessage;var b=null;if((a==null?void 0:a.type)===d("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.MESSAGE_EDIT&&(a==null?void 0:a.key)){a=a.key;var e=a.remoteJid,f=a.id;a=a.participant;!c("isStringNullOrEmpty")(e)&&!c("isStringNullOrEmpty")(f)&&!c("isStringNullOrEmpty")(a)&&(b=new(c("WAWebMsgKey"))({remote:d("WAWebWidFactory").createWid(e),fromMe:!0,id:f,participant:d("WAWebWidFactory").createWid(a)}))}return b}g.GROUP_MSG_TYPE=o;g.getCagMessageSendList=r;g.getGroupSendListForRevoke=w;g.encryptAndSendGroupMsg=a;g.filterIncorrectlyAddressedDevices=C}),98); __d("WAWebSendGroupSkmsgJob",["Promise","WADeprecatedSendIq","WALogger","WATimeUtils","WAWap","WAWebAck","WAWebAdvSignatureApi","WAWebApiMessageInfoStore","WAWebApiParticipantStore","WAWebBackendJobs.flow","WAWebBackendJobsCommon","WAWebBotGating","WAWebCommsAckParser","WAWebCommsWapMd","WAWebCreateNackFromStanza","WAWebE2EProtoGenerator","WAWebE2EProtoUtils","WAWebEncryptMsgProtobuf","WAWebGetGroupKeyDistributionMsg","WAWebGroupHandleAddressingModeMismatch","WAWebGroupMsgSendUtils","WAWebGroupQueryBridge","WAWebHandleMsgCommon","WAWebManageE2ESessionsJob","WAWebMsgGetters","WAWebPhashUtils","WAWebPostPrekeysDepletionMetric","WAWebReportingTokenUtils","WAWebResendGroupMsg","WAWebSchemaMessage","WAWebSendMsgCommonApi","WAWebSendMsgMetaNode","WAWebSendMsgTypes","WAWebSignal","WAWebSignalProtocolStore","WAWebUserPrefsGeneral","WAWebUserPrefsMeUser","WAWebWamEnumMessageDistributionEnumType","WAWebWamEnumMessageType","WAWebWamEnumMismatchOriginType","WAWebWamEnumPrekeysFetchContext","WAWebWidFactory","WAWebWidToJid","asyncToGeneratorRuntime","cr:10198","cr:10199","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["resendGroupMsg: failed to resend group msg: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["resendGroupMsg: failed to resend group msg: ",", type: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendSenderKeyMsg: phash mismatch for ",", got server phash ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendSenderKeyMsg: sendQueryGroup failed after ack. error: ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendSenderKeyMsg: ack with error code 421"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendSenderKeyMsg: invalid ack from server for ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendSenderKeyMsg: sending ",""]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["ensureE2ESessions: failed for "," devices: ",""]);p=function(){return a};return a}function q(a,b,c){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){var e;(e=a.sendPerfReporter)==null?void 0:e.startPrekeysFetchStage();(e=a.sendPerfReporter)==null?void 0:e.setFetchedPrekeyCount(0);if(b.length>0)try{var f;e=(yield d("WAWebManageE2ESessionsJob").ensureE2ESessions(b));(f=a.sendPerfReporter)==null?void 0:f.setFetchedPrekeyCount(e==null?void 0:e.missedPrekeyCount);d("WAWebPostPrekeysDepletionMetric").maybePostPrekeysDepletionMetric({count:e==null?void 0:e.depletedPrekeyCount,prekeysFetchReason:d("WAWebWamEnumPrekeysFetchContext").PREKEYS_FETCH_CONTEXT.SEND_MESSAGE,messageType:d("WAWebWamEnumMessageType").MESSAGE_TYPE.GROUP,deviceSizeBucket:c.deviceSizeBucket})}catch(a){d("WALogger").ERROR(p(),b.length,a).tags("messaging").devConsole(a)}(f=a.sendPerfReporter)==null?void 0:f.postPrekeysFetchStage()});return r.apply(this,arguments)}function s(a,b,c,d,e,f,g,h){return t.apply(this,arguments)}function t(){t=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e,f,g,h,i){var j,k;(j=h.sendPerfReporter)==null?void 0:j.startClientEncryptStage();j=d("WAWebSendMsgCommonApi").encodeAndPad(f);var l=d("WAWebBackendJobsCommon").mediaTypeFromProtobuf(f);k=d("WAWebBotGating").isBotEnabled()&&((k=a.invokedBotWid)==null?void 0:k.isBot())===!0;var m=d("WAWebBotGating").isBotEnabled()&&d("WAWebMsgGetters").getIsBotFeedbackMessage(a),n=d("WAWebMsgGetters").getIsRevokeForMsgFromOrDeliveredToBot(a);j=(yield d("WAWebEncryptMsgProtobuf").encryptMsgSenderKey(a,b,j,g));g=j.ciphertext;var o=j.senderKeyBytes;j=j.isUsingDeprecatedSenderKey;var p;c.length>0&&(p=(yield d("WAWebGetGroupKeyDistributionMsg").getKeyDistributionMsg(a,b,c,o,!1)));(b=h.sendPerfReporter)==null?void 0:b.postClientEncryptStage();c=null;o=!1;h=!1;p&&p.length>0&&!m?c=d("WAWap").wap("participants",null,p.map(function(a){var b=a.type,c=a.ciphertext,e=a.participant;a=a.isUsingDeprecatedLidSession;b===d("WAWebBackendJobs.flow").CiphertextType.Pkmsg&&(o=!0);a&&(h=!0);a=i==null?void 0:i.get(d("WAWebWidToJid").widToUserJid(d("WAWebWidFactory").toUserWid(e)));a=a!=null?d("WAWap").wap("content_binding",null,a):null;return d("WAWap").wap("to",{jid:d("WAWebCommsWapMd").DEVICE_JID(e)},d("WAWap").wap("enc",{v:d("WAWap").CUSTOM_STRING(d("WAWebBackendJobsCommon").CIPHERTEXT_VERSION.toString()),type:d("WAWap").CUSTOM_STRING(b),"decrypt-fail":d("WAWebBackendJobsCommon").encodeMaybeDecryptFail(d("WAWebE2EProtoUtils").decryptFailAttributeFromProtobuf(f))},c),a)})):i!=null&&(c=d("WAWap").wap("participants",null,e.map(function(a){var b=i==null?void 0:i.get(d("WAWebWidToJid").widToUserJid(d("WAWebWidFactory").toUserWid(a)));return b!=null?d("WAWap").wap("to",{jid:d("WAWebCommsWapMd").DEVICE_JID(a)},d("WAWap").wap("content_binding",null,b)):null})));b=m?null:d("WAWap").wap("enc",{v:d("WAWap").CUSTOM_STRING(d("WAWebBackendJobsCommon").CIPHERTEXT_VERSION.toString()),type:d("WAWap").CUSTOM_STRING(d("WAWebBackendJobs.flow").CiphertextType.Skmsg),mediatype:d("WAWebBackendJobsCommon").encodeMaybeMediaType(l),"decrypt-fail":d("WAWebBackendJobsCommon").encodeMaybeDecryptFail(d("WAWebE2EProtoUtils").decryptFailAttributeFromProtobuf(f))},g);e=null;l=k||m||n?yield w(a,f):[null,!1];g=l[0];k=l[1];if(o||k){m=(yield d("WAWebAdvSignatureApi").getADVEncodedIdentity());e=d("WAWap").wap("device-identity",null,m)}return{keyDistributionMsg:c,skeyEncryptedGroupMsg:b,identityNode:e,botMsgNode:g,isUsingDeprecatedLidSession:j||h}});return t.apply(this,arguments)}function a(a,b,c,d,e,f){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e,f,g,p,r){var t,u=a.data,w=u.id,x=u.to;u=a.data;d("WALogger").LOG(o(),w).tags("messaging");var y=w.id,z=f.skDistribList,A=f.skList;f=f.rotateKey;v(x,p);(t=p.sendPerfReporter)==null?void 0:t.setSenderKeyDistributionCount(z.length);t=A.concat(z);var B=d("WAWebUserPrefsMeUser").assertGetMeLid(),C=d("WAWebUserPrefsMeUser").assertGetMe();B=d("WAWebGroupMsgSendUtils").isCagAddon(u,g)||(g==null?void 0:g.isLidAddressingMode)===!0?B:C;C=(yield d("WAWebPhashUtils").phashV2([].concat(t,[B])));var D=d("WAWebMsgGetters").getIsBotFeedbackMessage(u);yield d("WAWebApiMessageInfoStore").createOrMergeReceiptRecords(t.map(function(a){return{msgKey:w,receiverId:a}}));f&&(yield d("WAWebSignal").Session.deleteGroupSenderKeyInfo(x,B));yield q(p,z,g);f=(yield s(u,x,z,A,e,g,p,r));A=f.keyDistributionMsg;var E=f.skeyEncryptedGroupMsg,F=f.identityNode,G=f.botMsgNode;f=f.isUsingDeprecatedLidSession;r=r==null?void 0:r.get(d("WAWebWidToJid").widToUserJid(d("WAWebWidFactory").toUserWid(B)));B=r!=null?d("WAWap").wap("sender_content_binding",null,r):null;r=g.isLidAddressingMode===!0?d("WAWebHandleMsgCommon").STANZA_MSG_ADDRESSING_MODE.lid:d("WAWebHandleMsgCommon").STANZA_MSG_ADDRESSING_MODE.pn;var H=(yield d("WAWebReportingTokenUtils").genReportingTokenBody(u,e));D=d("WAWap").wap("message",{id:d("WAWap").CUSTOM_STRING(y),to:d("WAWebCommsWapMd").CHAT_JID(x),phash:D?d("WAWap").DROP_ATTR:d("WAWap").CUSTOM_STRING(C),type:d("WAWebE2EProtoUtils").typeAttributeFromProtobuf(e),edit:d("WAWebSendMsgCommonApi").editAttribute(e,u.subtype),addressing_mode:d("WAWap").CUSTOM_STRING(r)},A,E,F,d("WAWebSendMsgMetaNode").genMetaNode(x,a,e,g,{isUsingDeprecatedLidSession:f}),G,B,H);yield d("WAWebSendMsgCommonApi").updateIdentityRange(a,t);yield d("WAWebSignalProtocolStore").getSignalProtocolStore().flushBufferToDiskIfNotMemOnlyMode();(E=p.sendPerfReporter)==null?void 0:E.postReadyToSendStage();(F=p.sendPerfReporter)==null?void 0:F.startWrittenWireStage();b("cr:10199")==null?void 0:b("cr:10199").printEncNode(e);f=(yield d("WADeprecatedSendIq").deprecatedSendStanzaAndReturnAck(D,d("WAWebCommsAckParser").toCoreAckTemplate({id:y,"class":"message",from:x,participant:null})));if(A){(G=p.sendReporter)==null?void 0:G.setMessageDistributionType(d("WAWebWamEnumMessageDistributionEnumType").MESSAGE_DISTRIBUTION_ENUM_TYPE.SENDER_KEY_DISTRIBUTION_MESSAGE)}(B=p.sendPerfReporter)==null?void 0:B.postWrittenWireStage();p.sendPerfReporter=null;(H=p.sendReporter)==null?void 0:H.postSuccess();p.sendReporter=null;E=d("WAWebSendMsgCommonApi").sendMsgAckSyncParser.parse(f);if(E.error){d("WALogger").WARN(n(),u.id).tags("messaging");return(h||(h=b("Promise"))).reject(c("err")("[messaging] encryptAndSendSenderKeyMsg: Invalid ack from server"))}F=E.success.error;if(F===d("WAWebCreateNackFromStanza").NackReason.StaleGroupAddressingMode){d("WALogger").LOG(m()).tags("messaging");(h||(h=b("Promise"))).resolve().then(function(){return d("WAWebGroupQueryBridge").sendQueryGroup(x)})["catch"](function(a){d("WALogger").WARN(l(),a).tags("messaging")});a.type===d("WAWebSendMsgTypes").SendMessageRecordType.Message&&a.data.updateAck(d("WAWebAck").ACK.FAILED,!1);return h.reject(c("err")("[messaging] encryptAndSendSenderKeyMsg: ack with error code 421"))}yield d("WAWebApiParticipantStore").markHasSenderKey(x,z);D=E.success;y=D.phash;A=D.count;G=D.addressingMode;y!=null&&y!==C?(d("WALogger").LOG(k(),u.id,y).tags("messaging"),void d("WAWebResendGroupMsg").resendPersistedGroupMsgWrapper({isDirect:!1,msgRecord:a,msgProtobuf:e,oldList:t,ackTime:d("WATimeUtils").unixTime(),groupData:g,metricReporter:p,serverAddressingMode:G})["catch"](function(b){d("WALogger").WARN(j(),a.data.id.toString(),a.data.type).tags("messaging"),d("WALogger").ERROR(i(),b).tags("messaging").sendLogs("message-resend-failed",{sampling:.01})})):G!=null&&G!==r&&void d("WAWebGroupHandleAddressingModeMismatch").handleAddressingModeMismatch(x,{localAddressingMode:r,serverAddressingMode:G,mismatchOrigin:d("WAWebWamEnumMismatchOriginType").MISMATCH_ORIGIN_TYPE.ACK_OUTGOING_MESSAGE});A!=null&&void d("WAWebSchemaMessage").getMessageTable().merge(String(w),{count:A});return E.success});return u.apply(this,arguments)}function v(a,b){a=d("WAWebUserPrefsGeneral").markUserSentMessageToChat(a);if(a){(a=b.sendPerfReporter)==null?void 0:a.setMessageIsFirstUserMessage(!0);(a=b.sendReporter)==null?void 0:a.setMessageIsFirstUserMessage(!0)}}function w(a,b){return x.apply(this,arguments)}function x(){x=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=d("WAWebMsgGetters").getIsBotFeedbackMessage(a),e=null,f=d("WAWebMsgGetters").getIsRevokeForMsgFromOrDeliveredToBot(a);if(c){var g;e=(g=a.protocolMessageKey)==null?void 0:g.participant}else f?e=a.botRespOrInvocationRevokeBotWid:e=a.invokedBotWid;if(!e||!e.isBot())return[null,!1];yield d("WAWebApiMessageInfoStore").createOrMergeReceiptRecords([{msgKey:a.id,receiverId:e}]);g=!1;yield d("WAWebManageE2ESessionsJob").ensureE2ESessions([e]);b=d("WAWebE2EProtoGenerator").updateBotInvokeMsgProtoCopyForCapi(b,a.botMessageSecret);f&&e.isFbidBot()&&(b=d("WAWebE2EProtoGenerator").updateFbidBotInvokeProtobuf(b));f=(yield d("WAWebEncryptMsgProtobuf").encryptMsgProtobuf(e,0,b,a,0));b=f.type;a=f.ciphertext;b===d("WAWebBackendJobs.flow").CiphertextType.Pkmsg&&(g=!0);f=d("WAWap").wap("bot",{type:c?"feedback":d("WAWap").DROP_ATTR},d("WAWap").wap("to",{jid:d("WAWebCommsWapMd").DEVICE_JID(e)},d("WAWap").wap("enc",{v:d("WAWap").CUSTOM_STRING(d("WAWebBackendJobsCommon").CIPHERTEXT_VERSION.toString()),type:d("WAWap").CUSTOM_STRING(b)},a)));return[f,g]});return x.apply(this,arguments)}g.encryptAndSendSenderKeyMsg=a}),98); __d("WAWebSendNonMessageDataRequest",["WALogger","WAShiftTimer","WATimeUtils","WAWebABProps","WAWebApiPeerMessageStore","WAWebCommsWapMd","WAWebCurrentUser","WAWebE2EProtoUtils","WAWebLid1X1MigrationGating","WAWebLidMigrationUtils","WAWebMsgKey","WAWebMsgType","WAWebNonMessageDataRequestHistorySyncOnDemandUtils","WAWebNonMessageDataRequestLoggingUtils","WAWebNonMessageDataRequestMediaHandlingUtils","WAWebNonMessageDataRequestPlaceholderMessageResendUtils","WAWebProtobufsE2E.pb","WAWebSendAppStateSyncMsgJob","WAWebSyncGatingUtils","WAWebUserPrefsMeUser","WAWebWamEnumPeerDataResponseApplyResultType","WAWebWidFactory","asyncToGeneratorRuntime","gkx"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[rdu] drop history sync on demand request as it's in flight"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[rdu] stop sending history sync on demand request as it fails too many times"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["companion syncd snapshot fatal recovery is not supported in web"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["companion meta nonce fetch is not supported in web"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["full history sync on demand not supported in web"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[rdu] start building rdu message, ## type: ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["[rdu] build rdu message successfully, ## type: ",", ## msg: ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["[rdu] the constructed peer data operation request message is null"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["[rdu] clean rdu message request (regardless of success status). key ",", ## type: ",""]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync][rdu] dropping history sync on demand response as it's timeout with key ","."]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["[rdu] send placeholder message backfill request for ",""]);r=function(){return a};return a}var s=3e3;function a(a,b,c){return t.apply(this,arguments)}function t(){t=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){b=(yield u(a,b,c));if(b==null){d("WALogger").WARN(o());return}d("WALogger").LOG(n(),a,b.id.id).devConsole(b);B(a,b);d("WAWebNonMessageDataRequestLoggingUtils").logNonMessagePeerDataRequest(a,b);yield d("WAWebApiPeerMessageStore").storePeerMessages([b]);d("WAWebNonMessageDataRequestLoggingUtils").sendTimes.set(b.id.id,d("WATimeUtils").unixTimeMs());c=D(a);return d("WAWebSendAppStateSyncMsgJob").encryptAndSendKeyMsg(b,(a=c)!=null?a:void 0)});return t.apply(this,arguments)}function u(a,b,c){return v.apply(this,arguments)}function v(){v=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e){d("WALogger").LOG(m(),a);var f={peerDataOperationRequestType:a,requestUrlPreview:[],requestStickerReupload:[],placeholderMessageResendRequest:[]};switch(a){case d("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.SEND_RECENT_STICKER_BOOTSTRAP:break;case d("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.WAFFLE_LINKING_NONCE_FETCH:break;case d("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.UPLOAD_STICKER:a=w(b);if(a==null)return null;f.requestStickerReupload=a;break;case d("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.GENERATE_LINK_PREVIEW:a=x(b);if(a==null)return null;f.requestUrlPreview=a;break;case d("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.HISTORY_SYNC_ON_DEMAND:a=(yield y(b));if(a==null)return null;f.historySyncOnDemandRequest=a;break;case d("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.PLACEHOLDER_MESSAGE_RESEND:a=A(b);if(a==null)return null;f.placeholderMessageResendRequest=a;break;case d("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.FULL_HISTORY_SYNC_ON_DEMAND:d("WALogger").WARN(l());break;case d("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.COMPANION_META_NONCE_FETCH:d("WALogger").WARN(k());break;case d("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.COMPANION_SYNCD_SNAPSHOT_FATAL_RECOVERY:d("WALogger").WARN(j());break}a=new(c("WAWebMsgKey"))({fromMe:!0,remote:d("WAWebUserPrefsMeUser").getMeUser(),id:(b=e)!=null?b:yield c("WAWebMsgKey").newId()});return{id:a,to:d("WAWebWidFactory").createDeviceWidFromUserAndDevice(d("WAWebUserPrefsMeUser").assertGetMe().user,d("WAWebUserPrefsMeUser").assertGetMe().server,0),type:"protocol",subtype:"peer_data_operation_request_message",kind:d("WAWebMsgType").MsgKind.PeerMessage,peerDataOperationRequestMessage:f}});return v.apply(this,arguments)}function w(a){a=a.fileSha256Arr;a=a==null?void 0:(a=a.filter(function(a){return!d("WAWebNonMessageDataRequestMediaHandlingUtils").inFlightStickerRequests.has(a)}))==null?void 0:a.map(function(a){C(d("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.UPLOAD_STICKER,d("WAWebNonMessageDataRequestMediaHandlingUtils").inFlightStickerRequests,a);return{fileSha256:a}});return(a==null?void 0:a.length)===0?null:a}function x(a){var b=a.urls;return b==null?void 0:b.map(function(b){return{url:b,includeHqThumbnail:a.includeHqThumbnail}})}function y(a){return z.apply(this,arguments)}function z(){z=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!d("WAWebSyncGatingUtils").isHistorySyncOnDemandEnabled())return null;if(d("WAWebABProps").getABPropConfigValue("history_sync_on_demand_request_send_killswitch")&&d("WAWebNonMessageDataRequestHistorySyncOnDemandUtils").historySyncOnDemandRequestsFailureRecord.disableRequestSending){d("WALogger").LOG(i());return null}a=a.chatId;if(a==null)return null;var b=d("WAWebCommsWapMd").CHAT_JID(a).toString();if(new Set(d("WAWebNonMessageDataRequestHistorySyncOnDemandUtils").inFlightHistorySyncOnDemandRequests.values()).has(b)){d("WALogger").LOG(h());return null}a=(yield d("WAWebNonMessageDataRequestHistorySyncOnDemandUtils").getOldestMsgInChatFromDB(a));var c=(yield d("WAWebABProps").getABPropConfigValue("history_sync_on_demand_message_count"));return{chatJid:b,oldestMsgId:a==null?void 0:a.id.id,oldestMsgFromMe:a==null?void 0:a.id.fromMe,onDemandMsgCount:c,oldestMsgTimestampMs:a==null?void 0:a.t}});return z.apply(this,arguments)}function A(a){if(!d("WAWebSyncGatingUtils").isPlaceholderMessageResendEnabled())return null;a=a.msgKeys;if(a==null||a.length===0)return null;d("WAWebCurrentUser").isEmployee()&&d("WALogger").LOG(r(),a.map(function(a){return a.toString()}));return a.filter(function(a){return!d("WAWebNonMessageDataRequestPlaceholderMessageResendUtils").inFlightPlaceholderResendRequests.has(a.id)}).map(function(a){var b;C(d("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.PLACEHOLDER_MESSAGE_RESEND,d("WAWebNonMessageDataRequestPlaceholderMessageResendUtils").inFlightPlaceholderResendRequests,a.id);b=d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()?new(c("WAWebMsgKey"))({id:a.id,fromMe:a.fromMe,remote:(b=d("WAWebLidMigrationUtils").toUserLid(a.remote))!=null?b:a.remote}):a;return{messageKey:d("WAWebE2EProtoUtils").msgKeyToProtobuf(b)}})}function B(a,b){switch(a){case d("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.UPLOAD_STICKER:a=(a=b.peerDataOperationRequestMessage)==null?void 0:a.requestStickerReupload;a!=null&&a.forEach(function(a){a=a.fileSha256;if(a!=null){d("WAWebNonMessageDataRequestMediaHandlingUtils").inFlightStickerRequests.add(a);d("WAWebNonMessageDataRequestMediaHandlingUtils").mediaReuploadRequestCountMap.set(a,((a=d("WAWebNonMessageDataRequestMediaHandlingUtils").mediaReuploadRequestCountMap.get(a))!=null?a:0)+1)}});break;case d("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.HISTORY_SYNC_ON_DEMAND:a=(a=b.peerDataOperationRequestMessage)==null?void 0:a.historySyncOnDemandRequest;if(a!=null){var e=(a=a.chatJid)!=null?a:"";d("WAWebNonMessageDataRequestHistorySyncOnDemandUtils").inFlightHistorySyncOnDemandRequests.set(b.id.id,e);a=d("WAWebABProps").getABPropConfigValue("history_sync_on_demand_timeout_ms");var f=function(){d("WALogger").LOG(q(),c("gkx")("26258")?"":b.id.id),d("WAWebNonMessageDataRequestHistorySyncOnDemandUtils").handleHistorySyncOnDemandFailure(e),d("WAWebNonMessageDataRequestLoggingUtils").logHistorySyncOnDemandResponse(d("WAWebWamEnumPeerDataResponseApplyResultType").PEER_DATA_RESPONSE_APPLY_RESULT_TYPE.REQUEST_TIMEOUT,b.id.id)};C(d("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.HISTORY_SYNC_ON_DEMAND,d("WAWebNonMessageDataRequestHistorySyncOnDemandUtils").inFlightHistorySyncOnDemandRequests,b.id.id,a,f)}break;case d("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.PLACEHOLDER_MESSAGE_RESEND:f=(a=b.peerDataOperationRequestMessage)==null?void 0:a.placeholderMessageResendRequest;f!=null&&f.forEach(function(a){a=(a=a.messageKey)==null?void 0:a.id;a!=null&&d("WAWebNonMessageDataRequestPlaceholderMessageResendUtils").inFlightPlaceholderResendRequests.add(a)});break;default:break}}function C(a,b,e,f,g){f===void 0&&(f=s),new(d("WAShiftTimer").ShiftTimer)(function(){b.has(e)&&(d("WALogger").LOG(p(),c("gkx")("26258")?"":e,a),b["delete"](e),g==null?void 0:g())}).onOrAfter(f)}function D(a){switch(a){case d("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.GENERATE_LINK_PREVIEW:return d("WAWebSyncGatingUtils").isWebLinkPreviewNseSupportEnabled()?"high_force":null;case d("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.PLACEHOLDER_MESSAGE_RESEND:return d("WAWebSyncGatingUtils").isMessagePlaceholderResendNseSupportEnabled()?"high_force":null;case d("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.HISTORY_SYNC_ON_DEMAND:return d("WAWebSyncGatingUtils").isHistorySyncOnDemandEnabled()?"high_force":null;default:return null}}g.sendPeerDataOperationRequest=a}),98); __d("WAWebEncryptAndSendStatusMsg",["WADeprecatedSendIq","WAJids","WALogger","WANullthrows","WAWap","WAWebABProps","WAWebAdvSignatureApi","WAWebApiContact","WAWebApiMessageInfoStore","WAWebBackendJobs.flow","WAWebBackendJobsCommon","WAWebCommsAckParser","WAWebCommsWapMd","WAWebDBDeviceListFanout","WAWebE2EProtoUtils","WAWebGetGroupKeyDistributionMsg","WAWebManageE2ESessionsJob","WAWebMsgFanoutTypes","WAWebMsgKey","WAWebProtobufsE2E.pb","WAWebReportingTokenUtils","WAWebSchemaMessageInfo","WAWebSendMsgCommonApi","WAWebSendMsgCreateFanoutStanza","WAWebSignal","WAWebSignalProtocolStore","WAWebUserPrefsMeUser","WAWebUserPrefsStatus","WAWebUserPrefsStatusType","WAWebWamEnumMessageDistributionEnumType","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendStatusDirectMsg: start sending ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendStatusDirectMsg: send "," to "," device"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendStatusMsg: start sending ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendStatusMsg: encrypt message body done"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendStatusMsg: create receipts records"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendStatusMsg: distribute "," sender key"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendStatusMsg: all device list size ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendStatusMsg: start to send direct revoke message"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendStatusMsg: start to send ",", revoke: ",""]);p=function(){return a};return a}function a(a,b,c){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e){var f=a.data.id,g=d("WAWebABProps").getABPropConfigValue("lid_status_send_enabled"),h=d("WAWebWidFactory").createWid(d("WAJids").STATUS_JID),i=g?c("WANullthrows")(d("WAWebUserPrefsMeUser").getMaybeMeLid()):d("WAWebUserPrefsMeUser").assertGetMe(),q=u(b),s,x=(yield c("WAWebUserPrefsStatus").getStatusList());g&&(x.list=x.list.map(function(a){return d("WAWebApiContact").getCurrentLid(d("WAWebWidFactory").toUserWid(a))}).filter(Boolean).map(function(a){return a}));d("WALogger").LOG(p(),f.id,q).devConsole(b);if(q){(g=e.sendPerfReporter)==null?void 0:g.setIsRevokeMessage(!0);g=(yield d("WAWebSchemaMessageInfo").getMessageInfoTable().equals(["msgKey"],String(q)));q=g.map(function(a){return d("WAWebWidFactory").createWid(a.receiverUserJid)});if(v(q,x.list)){d("WALogger").LOG(o());g=(yield d("WAWebDBDeviceListFanout").getFanOutList({wids:[].concat(q,[i])}));return w(a,b,g,e)}g=q}else{if(x.list.length===0)return;g=x.list;s=d("WAWap").wap("meta",{status_setting:t(x.setting)})}q=(yield d("WAWebDBDeviceListFanout").getFanOutList({wids:[].concat(g,[i])}));d("WALogger").LOG(n(),q.length);x=(yield c("WAWebUserPrefsStatus").getStatusSkDistribList(q));g=x.skDistribList;x=x.participantList;if(g.length>0){var y;d("WALogger").LOG(m(),g.length);(y=e.sendReporter)==null?void 0:y.setMessageDistributionType(d("WAWebWamEnumMessageDistributionEnumType").MESSAGE_DISTRIBUTION_ENUM_TYPE.SENDER_KEY_DISTRIBUTION_MESSAGE);(y=e.sendReporter)==null?void 0:y.setDeviceCount(g.length);(y=e.sendPerfReporter)==null?void 0:y.setSenderKeyDistributionCount(g.length)}yield d("WAWebApiMessageInfoStore").createOrMergeReceiptRecords(q.map(function(a){return{msgKey:f,receiverId:a}}));d("WALogger").LOG(l());(y=e.sendPerfReporter)==null?void 0:y.startPrekeysFetchStage();q=(yield d("WAWebManageE2ESessionsJob").ensureE2ESessions(g));y=q==null?void 0:q.missedPrekeyCount;if(y!=null){(q=e.sendPerfReporter)==null?void 0:q.setFetchedPrekeyCount(y)}(q=e.sendPerfReporter)==null?void 0:q.postPrekeysFetchStage();(y=e.sendPerfReporter)==null?void 0:y.startClientEncryptStage();q=(yield r(h,i,g,x,b));y=q[0];i=q[1];x=q[2];d("WALogger").LOG(k());q=(yield d("WAWebReportingTokenUtils").genReportingTokenBody(a.data,b));b=d("WAWap").wap("message",{id:d("WAWap").CUSTOM_STRING(f.id),to:d("WAWebCommsWapMd").CHAT_JID(h),type:d("WAWebE2EProtoUtils").typeAttributeFromProtobuf(b),edit:d("WAWebSendMsgCommonApi").editAttribute(b,a.data.subtype)},y,i,x,s,q);yield d("WAWebSignalProtocolStore").getSignalProtocolStore().flushBufferToDiskIfNotMemOnlyMode();(a=e.sendPerfReporter)==null?void 0:a.postClientEncryptStage();(y=e.sendPerfReporter)==null?void 0:y.startWrittenWireStage();d("WALogger").LOG(j(),f.id);yield d("WADeprecatedSendIq").deprecatedSendStanzaAndReturnAck(b,d("WAWebCommsAckParser").toCoreAckTemplate({id:f.id,"class":"message",from:h,participant:null}));(i=e.sendPerfReporter)==null?void 0:i.postWrittenWireStage();yield c("WAWebUserPrefsStatus").markStatusHasSenderKey(g)});return q.apply(this,arguments)}function r(a,b,c,d,e){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e,f){var g=d("WAWebSendMsgCommonApi").encodeAndPad(f);f=d("WAWebBackendJobsCommon").mediaTypeFromProtobuf(f);b=(yield d("WAWebSignal").Cipher.encryptSenderKeyMsgSignalProto(a,b,g,!1));g=b.ciphertext;b=b.senderKeyBytes;var h;c.length>0&&(h=(yield d("WAWebGetGroupKeyDistributionMsg").getKeyDistributionMsg(null,a,c,b,!1)));a=[];c=[];b=!1;var i=null;h&&h.length>0&&(a=h.map(function(a){var c=a.type,e=a.ciphertext;a=a.participant;c===d("WAWebBackendJobs.flow").CiphertextType.Pkmsg&&(b=!0);return d("WAWap").wap("to",{jid:d("WAWebCommsWapMd").DEVICE_JID(a)},d("WAWap").wap("enc",{v:d("WAWap").CUSTOM_STRING(d("WAWebBackendJobsCommon").CIPHERTEXT_VERSION.toString()),type:d("WAWap").CUSTOM_STRING(c)},e))}));c=e.map(function(a){return d("WAWap").wap("to",{jid:d("WAWebCommsWapMd").USER_JID(a)})});(c.length>0||a.length>0)&&(i=d("WAWap").wap("participants",null,a.concat(c)));e=d("WAWap").wap("enc",{v:d("WAWap").CUSTOM_STRING(d("WAWebBackendJobsCommon").CIPHERTEXT_VERSION.toString()),type:d("WAWap").CUSTOM_STRING(d("WAWebBackendJobs.flow").CiphertextType.Skmsg),mediatype:d("WAWebBackendJobsCommon").encodeMaybeMediaType(f)},g);a=null;if(b){c=(yield d("WAWebAdvSignatureApi").getADVEncodedIdentity());a=d("WAWap").wap("device-identity",null,c)}return[i,e,a]});return s.apply(this,arguments)}function t(a){switch(a){case d("WAWebUserPrefsStatusType").StatusPrivacySettingType.AllowList:return"allowlist";case d("WAWebUserPrefsStatusType").StatusPrivacySettingType.DenyList:return"denylist";case d("WAWebUserPrefsStatusType").StatusPrivacySettingType.Contact:return"contacts"}}function u(a){a=a.protocolMessage;var b=null;if((a==null?void 0:a.type)===d("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.REVOKE&&(a==null?void 0:a.key)){a=a.key;var e=a.remoteJid,f=a.id;a=a.participant;e!=null&&f!=null&&a!=null&&(b=new(c("WAWebMsgKey"))({remote:d("WAWebWidFactory").createWid(e),fromMe:!0,id:f,participant:d("WAWebWidFactory").createWid(a)}))}return b}function v(a,b){var c=new Set(b.map(function(a){return d("WAWebWidFactory").toUserWid(a).toString()}));return a.some(function(a){return!d("WAWebUserPrefsMeUser").isMeAccount(a)&&!c.has(d("WAWebWidFactory").toUserWid(a).toString())})}function w(a,b,c,d){return x.apply(this,arguments)}function x(){x=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e){var f=a.data.id,g=d("WAWebWidFactory").createWid(d("WAJids").STATUS_JID);d("WALogger").LOG(i(),f.id,c.length);a=(yield d("WAWebSendMsgCreateFanoutStanza").createFanoutMsgStanza(a,b,c,{fanoutType:d("WAWebMsgFanoutTypes").FANOUT_TYPE.GROUP_DIRECT},e));b=a.stanza;yield d("WAWebSignalProtocolStore").getSignalProtocolStore().flushBufferToDiskIfNotMemOnlyMode();(c=e.sendPerfReporter)==null?void 0:c.startWrittenWireStage();d("WALogger").LOG(h(),f.id);yield d("WADeprecatedSendIq").deprecatedSendStanzaAndReturnAck(b,d("WAWebCommsAckParser").toCoreAckTemplate({id:f.id,"class":"message",from:g,participant:null}));(a=e.sendPerfReporter)==null?void 0:a.postWrittenWireStage()});return x.apply(this,arguments)}g.encryptAndSendStatusMsg=a}),98); __d("WAWebMexFetchNewsletterAdminCapabilitiesJobQuery.graphql",[],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"newsletter_id"}],b=[{kind:"Variable",name:"newsletter_id",variableName:"newsletter_id"}],c={alias:null,args:null,kind:"ScalarField",name:"capabilities",storageKey:null};return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"WAWebMexFetchNewsletterAdminCapabilitiesJobQuery",selections:[{alias:null,args:b,concreteType:"XWA2NewsletterAdmin",kind:"LinkedField",name:"xwa2_newsletter_admin",plural:!1,selections:[c],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"WAWebMexFetchNewsletterAdminCapabilitiesJobQuery",selections:[{alias:null,args:b,concreteType:"XWA2NewsletterAdmin",kind:"LinkedField",name:"xwa2_newsletter_admin",plural:!1,selections:[c,{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null}],storageKey:null}]},params:{id:"8277065518994887",metadata:{},name:"WAWebMexFetchNewsletterAdminCapabilitiesJobQuery",operationKind:"query",text:null}}}();e.exports=a}),null); __d("WAWebMexFetchNewsletterAdminCapabilitiesJob",["WALogger","WAWebMexClient","WAWebMexFetchNewsletterAdminCapabilitiesJobQuery.graphql","WAWebNewsletterModelUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[MEX][NEWSLETTER] fetched admin capabilities"]);i=function(){return a};return a}var j=h!==void 0?h:h=b("WAWebMexFetchNewsletterAdminCapabilitiesJobQuery.graphql");function a(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b={newsletter_id:a};b=(yield d("WAWebMexClient").fetchQuery(j,b));d("WALogger").DEV(i()).tags("GQL","MEX").devConsole({newsletterJid:a,response:b});b=(a=b.xwa2_newsletter_admin)==null?void 0:a.capabilities;a=b==null?[]:b.map(d("WAWebNewsletterModelUtils").getNewsletterCapabilityFromValue);return new Set(a)});return k.apply(this,arguments)}g.mexFetchNewsletterAdminCapabilities=a}),98); __d("WAWebApiBlocklist",["Promise","WAWebModelStorageUtils","WAWebSchemaBlocklist","WAWebWidFactory"],(function(a,b,c,d,e,f,g){var h;function a(){return d("WAWebSchemaBlocklist").getBlocklistTable().all().then(function(a){a=a.map(function(a){return d("WAWebWidFactory").createUserWid(a.id)});return a})}function c(a){if(!a)return(h||(h=b("Promise"))).resolve(!1);var c=a.map(function(a){return{id:a.toString()}});return d("WAWebModelStorageUtils").getStorage().lock(["blocklist"],function(a){var b=a[0];return b.clear().then(function(){return b.bulkCreate(c).then(function(){return!0})})})}g.getBlocklist=a;g.updateBlocklist=c}),98); __d("WAWebGetBlocklistJob",["WALogger","WASmaxBlocklistsGetBlockListRPC","WAWebJidToWid","WAWebUserPrefsMultiDevice","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["fetchBlocklist: Unsupported identifier type: PnJid"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["fetchBlocklist: GetBlockListResponseSuccessWithMatch ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["fetchBlocklist failed: code "," text ",""]);j=function(){return a};return a}function k(a,b){d("WALogger").WARN(j(),a,b).sendLogs("getBlocklist")}function a(){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield d("WAWebUserPrefsMultiDevice").getBlocklistHash());a=babelHelpers["extends"]({},a!=null&&{itemArgs:{itemDhash:a}});a=(yield d("WASmaxBlocklistsGetBlockListRPC").sendGetBlockListRPC(a));switch(a.name){case"GetBlockListResponseInternalServerError":var b=a.value.errorServerErrors.value,e=b.code;b=b.text;k(Number(e),b);return{errorCode:Number(e),errorText:b};case"GetBlockListResponseInvalidRequest":e=a.value.errorGetBlocklistErrors.value;b=e.code;e=e.text;k(Number(b),e);return{errorCode:Number(b),errorText:e};case"GetBlockListResponseSuccessWithMatch":d("WALogger").LOG(i(),a.value.type);b={wids:[]};return b;case"GetBlockListResponseSuccessWithMismatch":var f={wids:[]};e=a.value.listDhash;b=a.value.listItem;e!=null&&(f.dhash=e);b.forEach(function(a){f.wids.push({wid:d("WAWebJidToWid").userJidToUserWid(a.jid),displayName:(a=a.displayNameMixin)==null?void 0:a.displayName})});return f;default:a.name;var g={wids:[]};e=a.value.listDhash;b=a.value.listItem;e!=null&&(g.dhash=e);b.forEach(function(a){var b=a.blocklistIds,e,f;if(b.name==="Username")e=b.value.username;else if(b.name==="DisplayName")f=b.value.displayName;else{b.name;d("WALogger").ERROR(h()).sendLogs("get-blocklist-unsupported-identifier-type");throw c("err")("getBlocklist: Unsupported identifier type: PnJid")}g.wids.push({wid:d("WAWebJidToWid").userJidToUserWid(a.jid),displayName:f,username:e})});return g}});return l.apply(this,arguments)}g.getBlocklist=a}),98); __d("WAWebQueryBlockListJob",["WALogger","WASmaxPsaChatBlockGetRPC","WAWebApiBlocklist","WAWebGetBlocklistJob","WAWebUpdateLidMetadataJob","WAWebUserPrefsMultiDevice","WAWebUsernameGatingUtils","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["getBlockingStatusForPSAUser: server response with ",", ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[blocklist] no change in blocklist, skip update"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[blocklist] updating blocklist with "," contact(s)"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[blocklist] fetch blocklist using blocklist"]);k=function(){return a};return a}function a(){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){d("WALogger").LOG(k());var a=(yield d("WAWebGetBlocklistJob").getBlocklist());if(a.errorCode!=null)return a;if(a.dhash!=null&&a.dhash!==""){d("WALogger").LOG(j(),a.wids.length||0);yield d("WAWebUserPrefsMultiDevice").setBlocklistHash(a.dhash);yield d("WAWebApiBlocklist").updateBlocklist(a.wids.map(function(a){return a.wid}));var b=a.wids.map(function(a){var b=a.wid,c=a.displayName;a=a.username;if(c==null&&a==null||!b.isLid())return null;var e={};c!=null?(e.displayNameLID=c,e.username=void 0):a!=null&&d("WAWebUsernameGatingUtils").usernameDisplayedEnabled()&&(e.username=a);return{lid:d("WAWebWidFactory").toUserWid(b),data:e}}).filter(Boolean);yield d("WAWebUpdateLidMetadataJob").updateLidMetadataJob(b)}else d("WALogger").LOG(i());return a});return l.apply(this,arguments)}function c(){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield d("WASmaxPsaChatBlockGetRPC").sendChatBlockGetRPC());switch(a.name){case"ChatBlockGetResponseServerError":var b=a.value.errorChatBlockError.value,c=b.code;b=b.text;d("WALogger").WARN(h(),c,b);return{errorCode:Number(c),errorText:b};default:a.name;return a.value.blockingStatus==="blocked"}});return m.apply(this,arguments)}g.fetchAndUpdateBlocklist=a;g.getBlockingStatusForPSAUser=c}),98); __d("WAWebQueryDisappearingModeJob",["WADeprecatedSendIq","WADeprecatedWapParser","WAWap","WAWebBackendErrors","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h=new(c("WADeprecatedWapParser"))("dmParser",function(a){a=a.child("disappearing_mode");return{duration:a.attrInt("duration"),t:a.attrInt("t")}});function a(){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=d("WAWap").wap("iq",{xmlns:"disappearing_mode",to:d("WAWap").S_WHATSAPP_NET,type:"get",id:d("WAWap").generateId()});a=(yield d("WADeprecatedSendIq").deprecatedSendIq(a,h));if(!a.success)throw new(d("WAWebBackendErrors").ServerStatusCodeError)(a.errorCode);return a.result});return i.apply(this,arguments)}g.queryDisappearingMode=a}),98); __d("WAWebQueryPrivacySettingsJob",["WADeprecatedSendIq","WADeprecatedWapParser","WALogger","WAWap","WAWebPrivacySettings","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["getPrivacy error: "," - code "," text ",""]);h=function(){return a};return a}function i(a,b){b=b.maybeChild("error");var c=b&&b.maybeAttrString("code");b=b&&b.maybeAttrString("text");d("WALogger").WARN(h(),a,c,b).sendLogs("getPrivacy",{sampling:.01})}var j=new(c("WADeprecatedWapParser"))("privacyParser",function(a){a.assertAttr("type","result");var b={};a.child("privacy").forEachChildWithTag("category",function(a){var c=a.attrString("name");switch(c){case"readreceipts":var e=a.attrEnum("value",d("WAWebPrivacySettings").ALL_NONE_WITH_ERROR);e!=="error"?b.readReceipts=e:i("readreceipts",a);break;case"last":e=a.attrEnum("value",d("WAWebPrivacySettings").VISIBILITY_WITH_ERROR);e!=="error"?b.lastSeen=e:i("last",a);break;case"online":e=a.attrEnum("value",d("WAWebPrivacySettings").ONLINE_VISIBILITY_WITH_ERROR);e!=="error"?b.online=e:i("online",a);break;case"profile":e=a.attrEnum("value",d("WAWebPrivacySettings").VISIBILITY_WITH_ERROR);e!=="error"?b.profilePicture=e:i("profile",a);break;case"status":e=a.attrEnum("value",d("WAWebPrivacySettings").VISIBILITY_WITH_ERROR);e!=="error"?b.about=e:i("status",a);break;case"groupadd":e=a.attrEnum("value",d("WAWebPrivacySettings").VISIBILITY_WITH_ERROR);e!=="error"?b.groupAdd=e:i("groupadd",a);break;case"calladd":e=a.attrEnum("value",d("WAWebPrivacySettings").CALL_ADD_WITH_ERROR);e!=="error"?b.callAdd=e:i("calladd",a);break;case"messages":e=a.attrEnum("value",d("WAWebPrivacySettings").ALL_CONTACTS);b.messages=e;break;case"pix":case"linked_profiles":case"stickers":break;default:i(c+" is unknown type",a);break}});return b});function a(){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a;a=(a=d("WAWap")).wap("iq",{xmlns:"privacy",to:a.S_WHATSAPP_NET,type:"get",id:a.generateId()},a.wap("privacy",null));a=(yield d("WADeprecatedSendIq").deprecatedSendIq(a,j));if(!a.success)throw c("err")("invalid response");else return a.result});return k.apply(this,arguments)}g.getPrivacy=a}),98); __d("WAWebQueryPrivacyDisallowedListJob",["WADeprecatedSendIq","WADeprecatedWapParser","WAWap","WAWebJidToWid","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h=new(c("WADeprecatedWapParser"))("getPrivacyDisallowedListParser",function(a){a=a.child("privacy");a=a.maybeChild("list");if(a==null)return{status:"match"};var b=a.mapChildren(function(a){return d("WAWebJidToWid").deviceJidToUserWid(a.attrDeviceJid("jid"))});return{status:"mismatch",users:b,dhash:a.attrString("dhash")}});function a(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b;a=(b=d("WAWap")).wap("iq",{to:b.S_WHATSAPP_NET,type:"get",id:b.generateId(),xmlns:"privacy"},b.wap("privacy",null,b.wap("list",{name:b.CUSTOM_STRING(a),value:b.CUSTOM_STRING("contact_blacklist")})));b=(yield d("WADeprecatedSendIq").deprecatedSendIq(a,h));if(!b.success)throw c("err")("invalid response");else return b.result});return i.apply(this,arguments)}g.queryPrivacyDisallowedList=a}),98); __d("WAWebSyncPrivacyDisallowedLists",["Promise","WAWebQueryPrivacyDisallowedListJob","WAWebSchemaPrivacyDisallowedList","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield (h||(h=b("Promise"))).all(a.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield d("WAWebQueryPrivacyDisallowedListJob").queryPrivacyDisallowedList(a));return{type:a,response:b}});return function(b){return a.apply(this,arguments)}}())));var c=[];a.forEach(function(a){var b=a.response,d=b.status,e=b.users;b=b.dhash;if(d!=="mismatch"||e==null||b==null)return;c.push({id:a.type,disallowedList:e.map(function(a){return a.toString()}),dhash:b})});yield d("WAWebSchemaPrivacyDisallowedList").getPrivacyDisallowedListTable().bulkCreateOrReplace(c);return c});return j.apply(this,arguments)}function a(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield i([a])});return k.apply(this,arguments)}g.syncPrivacyDisallowedLists=i;g.syncSinglePrivacyDisallowedList=a}),98); __d("WAWebAccountSyncJob",["$InternalEnum","WATimeUtils","WAWebBlocklistCollection","WAWebProfilePicThumbCollection","WAWebQueryBlockListJob","WAWebQueryDisappearingModeJob","WAWebQueryPrivacySettingsJob","WAWebSchemaPrivacyDisallowedList","WAWebSyncDeviceAdvDeviceListJob","WAWebSyncPrivacyDisallowedLists","WAWebTos","WAWebUpdateDisappearingModeForContact","WAWebUserPrefsGeneral","WAWebUserPrefsMeUser","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h=b("$InternalEnum")({BLOCKLIST:"blocklist",OPTOUTLIST:"biz_opt_out_list",DEVICES:"devices",DISAPPEARING_MODE:"disappearing_mode",PICTURE:"picture",PRIVACY:"privacy",STATUS:"status",TOS:"tos",NOTICE:"notice",USER:"user",TEXT_STATUS:"text_status"});function a(a){return d("WAWebSyncDeviceAdvDeviceListJob").syncDeviceListJob(d("WAWebUserPrefsMeUser").getMePNandLIDWids(),a,null)}function c(){var a=d("WAWebUserPrefsMeUser").getMeUser(),b=d("WAWebProfilePicThumbCollection").ProfilePicThumbCollection.get(a);return b!=null?d("WAWebProfilePicThumbCollection").ProfilePicThumbCollection.resyncPictures([b]):d("WAWebProfilePicThumbCollection").ProfilePicThumbCollection.resyncPicturesByWid([a])}function e(){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a,b=(yield d("WAWebQueryPrivacySettingsJob").getPrivacy());d("WAWebUserPrefsGeneral").setUserPrivacySettings(b);a=[(a=d("WAWebSchemaPrivacyDisallowedList")).PrivacyDisallowedListType.About,a.PrivacyDisallowedListType.GroupAdd,a.PrivacyDisallowedListType.LastSeen,a.PrivacyDisallowedListType.ProfilePicture];a=(yield d("WAWebSyncPrivacyDisallowedLists").syncPrivacyDisallowedLists(a));return{privacySettings:b,privacyDisallowedRows:a}});return i.apply(this,arguments)}function f(){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield d("WAWebQueryBlockListJob").fetchAndUpdateBlocklist());a.dhash!=null&&a.dhash!==""&&d("WAWebBlocklistCollection").BlocklistCollection.replaceAllWith(a.wids)});return j.apply(this,arguments)}function k(a){var b=d("WATimeUtils").unixTime();a.forEach(function(a){d("WAWebTos").TosManager.setState(a.id,a.state?"ACCEPTED":"NOT_ACCEPTED",(a=a.timestamp)!=null?a:b)})}function l(){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield d("WAWebQueryDisappearingModeJob").queryDisappearingMode());yield d("WAWebUpdateDisappearingModeForContact").updateDisappearingModeForContact(d("WAWebUserPrefsMeUser").getMeUser(),a.duration,a.t)});return m.apply(this,arguments)}g.AccountSyncType=h;g.getDevices=a;g.getAndUpdateProfilePicture=c;g.updatePrivacySettings=e;g.updateBlocklist=f;g.updateTosStateFromAccountSync=k;g.updateDefaultDisappearingMode=l}),98); __d("WAWebRestartRecentSyncJob",["Promise","WAJobOrchestratorTypes","WALogger","WAWebHistorySyncNotificationUtils","WAWebOrchestratorNonPersistedJob","WAWebProtobufsHistorySync.pb","WAWebSchemaHistorySyncNotification","WAWebSyncBootstrap","WAWebSyncGatingUtils","WAWebUserPrefsHistorySync","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Restart recent sync job"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Unprocessed notifications length: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] No unprocessed notifications found, skip restart recent sync job"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Recent sync already completed, skip restart recent sync job"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] History sync is running, skip restart recent sync job"]);m=function(){return a};return a}function a(){return!d("WAWebSyncGatingUtils").isHistorySyncHandlingRestartV2Enabled()?(h||(h=b("Promise"))).resolve():d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("restartRecentSyncJob",function(){return n()},{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.LOW}).waitUntilCompleted()}function n(){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(c("WAWebSyncBootstrap").getIsHistorySyncRunning()){d("WALogger").LOG(m());return}var a=(yield d("WAWebUserPrefsHistorySync").getHistorySyncStatus());if((a==null?void 0:a.recentCompleted)===!0){d("WALogger").LOG(l());return}a=(yield d("WAWebSchemaHistorySyncNotification").getHistorySyncNotificationTable().equals(["processed"],0,{shouldDecrypt:!1}).then(function(a){return a.filter(function(a){return a.syncType===d("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.RECENT||a.syncType===d("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.FULL})}));if(a.length===0){d("WALogger").LOG(k());return}d("WALogger").LOG(j(),a.length);d("WALogger").LOG(i());void c("WAWebSyncBootstrap").continueProgressiveHistorySyncProcessingV2(d("WAWebHistorySyncNotificationUtils").HistorySyncScheduleSource.ManualRestart)});return o.apply(this,arguments)}g.restartRecentSyncJob=a}),98); __d("WAWebNonAddressBookContactsJob",["WAJids","WALogger","WAWebApiContact","WAWebChatCollection","WAWebChatGetters","WAWebLidAwareContactsDB","WAWebModelStorageUtils","WAWebSchemaChat","WAWebSchemaParticipant","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["get "," non-address book contacts, mark dirty, and update the contact table during the initial sync"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["mark "," contacts dirty during the regular sync"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["found "," contacts with set isAddressBookContact value from contact table"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["found "," contacts from chat and group participant tables"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["get "," chunks of contacts from chat collection, chunk size: ",""]);l=function(){return a};return a}function a(a){a===void 0&&(a=500);var b=[],c=[],e=new Set(),f=new Set();for(var g of d("WAWebChatCollection").ChatCollection.toArray())f.size===a&&(b.push(f),f=new Set()),d("WAWebChatGetters").getIsEligibleForContactSync(g)&&(d("WAWebChatGetters").getIsGroup(g)?c.push(g.id):e.has(g.id)||(f.add(g.id),e.add(g.id)));for(g of c){c=d("WAWebChatCollection").ChatCollection.get(g)||{};c=(c=(c=c.groupMetadata)==null?void 0:c.participants.toArray())!=null?c:[];for(c of c)f.size===a&&(b.push(f),f=new Set()),e.has(c.id)||(f.add(c.id),e.add(c.id))}f.size!==0&&b.push(f);d("WALogger").LOG(l(),b.length,a).tags("contact-sync");return b}function m(){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=new Set();yield d("WAWebSchemaParticipant").getParticipantTable().forEach(function(b){b.participants.forEach(function(b){c("WAWebWid").isLid(b)?a.add(d("WAJids").toLidUserJid(d("WAWebWidFactory").createWid(b).user)):a.add(d("WAJids").toPhoneUserJid(d("WAWebWidFactory").createWid(b).user))})});yield d("WAWebSchemaChat").getChatTable().forEach(function(b){c("WAWebWid").isEligibleForUSync(b.id)&&(c("WAWebWid").isLid(b.id)?a.add(d("WAJids").toLidUserJid(d("WAWebWidFactory").createWid(b.id).user)):a.add(d("WAJids").toPhoneUserJid(d("WAWebWidFactory").createWid(b.id).user)))});d("WALogger").LOG(k(),a.size).tags("contact-sync");return Array.from(a)});return n.apply(this,arguments)}function o(){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield c("WAWebLidAwareContactsDB").anyOf(["isAddressBookContact"],[1,0]));a=new Set(a.map(function(a){return a.id}));d("WALogger").LOG(j(),a.size).tags("contact-sync");return a});return p.apply(this,arguments)}function e(){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield m());return d("WAWebModelStorageUtils").getStorage().lock(["contact"],b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var b=(yield o()),e=Array.from(a).map(function(a){return b.has(a)?{id:a,isContactSyncCompleted:0}:{id:a,isAddressBookContact:0,isContactSyncCompleted:0,contactHash:d("WAWebApiContact").getContactHash(a)}});d("WALogger").LOG(i(),e.length).tags("contact-sync");return c("WAWebLidAwareContactsDB").bulkCreateOrMerge(e)}))});return q.apply(this,arguments)}function f(){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield m());return d("WAWebModelStorageUtils").getStorage().lock(["contact"],b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var b=(yield o()),e=a.filter(function(a){return!b.has(a)});e=e.map(function(a){return{id:a,isAddressBookContact:0,isContactSyncCompleted:0,contactHash:d("WAWebApiContact").getContactHash(a)}});d("WALogger").LOG(h(),e.length).tags("contact-sync");return c("WAWebLidAwareContactsDB").bulkCreateOrMerge(e)}))});return r.apply(this,arguments)}g.getAllContactsFromChatCollectionIntoChunks=a;g.getNonAddressBookContactsAndMarkAllContactsDirty=e;g.getAndUpdateNonAddressBookContacts=f}),98); __d("WAWebSyncContactJob",["WAJobOrchestratorTypes","WAWebContactSyncApi","WAWebOrchestratorNonPersistedJob"],(function(a,b,c,d,e,f,g){function a(a,b,c){b===void 0&&(b=!0);a={contactIds:a,shouldDelayBetweenChunks:b,mode:c};return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("syncContactListInChunks",function(a){return d("WAWebContactSyncApi").syncContactListInChunks(a)},{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.SKIP}).waitUntilCompleted(a)}function b(a,b,c){b===void 0&&(b=!0);a={contactIds:a,shouldSyncDevice:b,mode:c};return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("syncContactList",function(a){return d("WAWebContactSyncApi").syncContactList(a)},{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.SKIP}).waitUntilCompleted(a)}g.syncContactListInChunksJob=a;g.syncContactListJob=b}),98); __d("WAWebSyncContactsJob",["WALogger","WANullthrows","WAShiftTimer","WAWebContactSyncApi","WAWebLidAwareContactsDB","WAWebLocalStorage","WAWebUserPrefsAppStateSync","WAWebUserPrefsKeys","WAWebUserPrefsMultiDevice","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["sync dirty contacts, found "," contacts to sync"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncNewContact: contact sync failed, error: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["start new contact sync for "," contacts"]);j=function(){return a};return a}var k=86400,l=2e4,m=1e3,n=60,o=null,p=[];function a(a){p.push(a),!o?(o=new(d("WAShiftTimer").ShiftTimer)(function(){if(!d("WAWebUserPrefsMultiDevice").isRegistered())return;var a=p;p=[];o=null;d("WALogger").LOG(j(),a.length).tags("contact-sync");d("WAWebContactSyncApi").syncContactListInChunks({contactIds:a,shouldDelayBetweenChunks:!0,mode:"query"})["catch"](function(a){d("WALogger").ERROR(i(),a).verbose().tags("non-sad","contact-sync").sendLogs("syncNewContact: contact sync failed")})}),o.onOrBefore(l)):o.debounce(m)}function q(){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield c("WAWebLidAwareContactsDB").equals(["isContactSyncCompleted"],0));a=a.map(function(a){return d("WAWebWidFactory").createWid(a.id)});d("WALogger").LOG(h(),a.length).tags("contact-sync");return d("WAWebContactSyncApi").syncContactListInChunks({contactIds:a,shouldDelayBetweenChunks:!0,mode:"query"})});return r.apply(this,arguments)}function e(){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){(yield d("WAWebUserPrefsMultiDevice").getShouldCheckContactSyncStatus())&&self.setTimeout(function(){q()},n*1e3),yield d("WAWebUserPrefsAppStateSync").setShouldCheckContactSyncStatus()});return s.apply(this,arguments)}function f(){var a;a=(a=c("WANullthrows")(c("WAWebLocalStorage")).getItem(d("WAWebUserPrefsKeys").KEYS.CONTACT_SYNC_REFRESH))!=null?a:k;return parseInt(a,10)}g.syncNewContact=a;g.runSyncDirtyContactsJob=e;g.getContactSyncRefreshSeconds=f}),98); __d("WAWebSyncdRequestAllSyncdMissingKeysJob",["WAJobOrchestratorTypes","WAWebOrchestratorNonPersistedJob","WAWebSyncdHandleMissingKeys","WAWebSyncdStoreMissingKeys","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(){return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("requestAllSyncdMissingKeys",b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield d("WAWebSyncdHandleMissingKeys").requestAllMissingKeys(),self.setTimeout(d("WAWebSyncdStoreMissingKeys").setMissingKeyTimeoutInTransaction,1e3*20)}),{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.BEST_EFFORT,maxTimeoutMs:1e3*30}).waitUntilCompleted()}g.requestAllSyncdMissingKeysJob=a}),98); __d("WAWebSyncdSyncAllCollectionsJob",["WAJobOrchestratorTypes","WALogger","WASyncdConst","WATimeUtils","WAWebOrchestratorNonPersistedJob","WAWebSyncd","WAWebUserPrefsAppStateSync","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: periodic sync for all collection"]);h=function(){return a};return a}function a(){return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("syncdSyncAllCollections",b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a;d("WALogger").LOG(h());yield d("WAWebSyncd").markCollectionsForSync([(a=d("WASyncdConst")).CollectionName.CriticalBlock,a.CollectionName.CriticalUnblockLow,a.CollectionName.Regular,a.CollectionName.RegularLow,a.CollectionName.RegularHigh]);yield d("WAWebUserPrefsAppStateSync").setLastPeriodicAppStateSyncTs(d("WATimeUtils").unixTime())}),{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.LOW,maxTimeoutMs:1e3*30}).waitUntilCompleted()}g.syncdSyncAllCollectionsJob=a}),98); __d("WAWebNonMessageDataRequestMediaHandlingUtils",["Promise","WAJobOrchestratorTypes","WATimeUtils","WAWebMediaMmsV4Upload","WAWebOrchestratorNonPersistedJob","WAWebProtobufsE2E.pb","WAWebSchemaNonMessageDataRequest","WAWebSendNonMessageDataRequest","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h,i=15,j=15,k=new Set(),l=new Map(),m=new Map();function a(a){l.clear(),a.forEach(function(a){a.operationType===d("WAWebSchemaNonMessageDataRequest").DataRequestUploadOperationType.MEDIA_UPLOAD&&l.set(a.id,a)})}function c(){m.clear();return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("requestAllSyncdMissingKeys",b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=d("WATimeUtils").unixTime(),b=d("WAWebSchemaNonMessageDataRequest").getNonMessageDataRequestTable();b=(yield b.all());b.filter(function(b){if(b.operationType!==d("WAWebSchemaNonMessageDataRequest").DataRequestUploadOperationType.MEDIA_UPLOAD)return!1;if(b.requestType!==d("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.UPLOAD_STICKER)return!1;if(b.lastRequestTimeStampSec!=null&&a-b.lastRequestTimeStampSec>48*d("WATimeUtils").HOUR_SECONDS)return!1;return b.requestRetryCount!=null&&b.requestRetryCount>=3?!1:!0});d("WAWebSendNonMessageDataRequest").sendPeerDataOperationRequest(d("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.UPLOAD_STICKER,{fileSha256Arr:b.map(function(a){return a.fileKey})})}),{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.LOW}).waitUntilCompleted()}function e(a,b){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){var e=d("WAWebSchemaNonMessageDataRequest").getNonMessageDataRequestTable(),f=Array.from(a.keys()),g=d("WATimeUtils").unixTime(),i=[];yield (h||(h=b("Promise"))).all(f.map(function(){var f=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){var f=q(b,c,d("WAWebSchemaNonMessageDataRequest").DataRequestUploadOperationType.SEND_REQUEST),h=(yield e.get(f));i.push({id:f,fileKey:b,requestType:c,operationType:d("WAWebSchemaNonMessageDataRequest").DataRequestUploadOperationType.SEND_REQUEST,lastRequestTimeStampSec:g,requestRetryCount:((f=h==null?void 0:h.requestRetryCount)!=null?f:0)+1,responseError:a.get(b)})});return function(a){return f.apply(this,arguments)}}())).then(function(){e.bulkCreateOrReplace(i)})});return n.apply(this,arguments)}function f(a,b,c){a=q(a,b,d("WAWebSchemaNonMessageDataRequest").DataRequestUploadOperationType.MEDIA_UPLOAD);b=l.get(a);return b!=null&&b.lastMediaUploadSuccess===!0&&b.lastMediaUploadTimeStampSec!=null&&c-b.lastMediaUploadTimeStampSec<=d("WATimeUtils").DAY_SECONDS}function o(a,b,c){a=q(a,b,d("WAWebSchemaNonMessageDataRequest").DataRequestUploadOperationType.MEDIA_UPLOAD);b=l.get(a);a=r(c,b==null?void 0:b.lastRequestTimeStampSec);return b!=null&&b.lastMediaUploadSuccess===!1&&a&&b.mediaUploadFailureCount!=null&&b.mediaUploadFailureCount>=i}function p(a,b){var c=[];a.forEach(function(a,e){var f=q(e,d("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.UPLOAD_STICKER,d("WAWebSchemaNonMessageDataRequest").DataRequestUploadOperationType.MEDIA_UPLOAD),g=l.get(f),h=!r(b,g==null?void 0:g.lastMediaUploadTimeStampSec);a=a===d("WAWebMediaMmsV4Upload").UploadMediaResultKind.SUCCESS;g=(h?0:(h=g==null?void 0:g.mediaUploadFailureCount)!=null?h:0)+(a?0:1);h={id:f,fileKey:e,requestType:d("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.UPLOAD_STICKER,operationType:d("WAWebSchemaNonMessageDataRequest").DataRequestUploadOperationType.MEDIA_UPLOAD,lastMediaUploadTimeStampSec:b,lastMediaUploadSuccess:a,mediaUploadFailureCount:g};l.set(f,h);c.push(h)});a=d("WAWebSchemaNonMessageDataRequest").getNonMessageDataRequestTable();a.bulkCreateOrReplace(c)}function q(a,b,c){return a+"_"+String(b)+"_"+String(c)}function r(a,b){a=new Date(a*1e3).toDateString();b=b!=null?new Date(b*1e3).toDateString():a;return a===b}g.MEDIA_REUPLOAD_REQUEST_LIMIT=j;g.inFlightStickerRequests=k;g.mediaReuploadRequestCountMap=m;g.initializeMediaUploadResultFromStorage=a;g.retryNonMessageDataRequestJob=c;g.insertResponseError=e;g.shouldSkipMediaUploadWithSuccess=f;g.shouldSkipMediaUploadWithCancellation=o;g.insertMediaUploadResult=p}),98); __d("WAWebNonMessageDataRequestPlaceholderMessageResendUtils",["WATimeUtils","WAWebABProps","WAWebMsgType","WAWebProtobufsE2E.pb","WAWebSendNonMessageDataRequest","WAWebSyncGatingUtils"],(function(a,b,c,d,e,f,g){var h=new Set();b=new Set();var i=32;function a(a,b){if(!d("WAWebSyncGatingUtils").isPlaceholderMessageResendEnabled()||!b)return;var c=[],e=d("WATimeUtils").unixTime(),f=d("WAWebABProps").getABPropConfigValue("placeholder_message_resend_maximum_days_limit")*d("WATimeUtils").DAY_SECONDS;a.forEach(function(a){a.type===d("WAWebMsgType").MSG_TYPE.CIPHERTEXT&&!h.has(a.id)&&e-a.t<=f&&!a.unsafe().isMdHistoryMsg&&a.subtype!=="bot_unavailable_fanout"&&a.subtype!=="hosted_unavailable_fanout"&&a.subtype!=="view_once_unavailable_fanout"&&(h.add(a.id),c.push(a.id))});if(c.length>0)for(b=0;b<c.length;b+=i){a=c.slice(b,b+i);d("WAWebSendNonMessageDataRequest").sendPeerDataOperationRequest(d("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.PLACEHOLDER_MESSAGE_RESEND,{msgKeys:a})}}g.inFlightPlaceholderResendRequests=b;g.handlePlaceholderMsgsSeen=a}),98); __d("WAWebContactSyncApiConst",[],(function(a,b,c,d,e,f){a=500;b=20;f.CONTACT_SYNC_CHUNK_SIZE=a;f.SYNC_CONTACT_CHUNK_INTERVAL_SECONDS=b}),66); __d("WAWebContactSyncApi",["Promise","WAJids","WALogger","WANullthrows","WAPromiseDelays","WATimeUtils","WAWebAdvHandlerApi","WAWebApiContact","WAWebApiDeviceList","WAWebBizVerifiedNameAction","WAWebContactSyncApiConst","WAWebDBCreateLidPnMappings","WAWebGetIdentityKeysJob","WAWebLidAwareContactsDB","WAWebLocalStorage","WAWebPhashUtils","WAWebSetUsernameJob","WAWebTextStatusCollection","WAWebTextStatusGatingUtils","WAWebUpdateDisappearingModeForContact","WAWebUpdateTextStatusForContact","WAWebUserPrefsKeys","WAWebUsernameGatingUtils","WAWebUsync","WAWebUsyncUser","WAWebWidFactory","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleSyncDevice: skipping "," out of "," records"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleSyncDevice: error ",": ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleUsernameUsync: error ",": ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleLidSync: error ",": ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleDisappearingMode: failed "," : ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleSyncTextStatus: failed "," : ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["failed to execute usync query"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["start contact sync for "," contacts in "," chunks, each chunk size: ",""]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["set contact sync refresh period: ",""]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["invalid contact sync refresh period: ",""]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["mark "," contacts completed for contact sync"]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleSyncStatus: failed "," : ",""]);t=function(){return a};return a}function a(a){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.contactIds,c=a.shouldDelayBetweenChunks;a=a.mode;var e=d("WAWebContactSyncApiConst").CONTACT_SYNC_CHUNK_SIZE;d("WALogger").LOG(p(),b.length,Math.ceil(b.length/e),e).tags("contact-sync");for(var f=0;f<b.length;f+=e){var g=b.slice(f,f+e);c&&(yield d("WAPromiseDelays").delayMs(d("WAWebContactSyncApiConst").SYNC_CONTACT_CHUNK_INTERVAL_SECONDS*1e3));yield v({contactIds:g,shouldSyncDevice:!0,mode:a})}});return u.apply(this,arguments)}function v(a){return w.apply(this,arguments)}function w(){w=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=a.contactIds,f=a.shouldSyncDevice;a=a.mode;if(e.length===0)return;var g=(yield L(e)),i=new(d("WAWebUsync").USyncQuery)().withContext("background").withMode(a).withBusinessProtocol().withStatusProtocol();d("WAWebTextStatusGatingUtils").receiveTextStatusEnabled()&&i.withTextStatusProtocol();f&&i.withDeviceProtocol();i.withDisappearingModeProtocol();i.withLidProtocol();d("WAWebUsernameGatingUtils").usernameUsyncEnabled()&&i.withUsernameProtocol();a=g.filter(function(a){return!a.id.isLid()}).map(function(a){return d("WAWebWidFactory").toUserWid(a.id)});var j=new Map(a.map(function(a){var b=d("WAWebApiContact").getCurrentLid(a);return b==null?null:[a.toString(),b]}).filter(Boolean));g.forEach(function(a){var b=new(d("WAWebUsyncUser").USyncUser)().withId(a.id).withDeviceHash(String(a.hash));if(!a.id.isLid()){a=j.get(a.id.toString());a!=null&&b.withLid(a)}i.withUser(b)});a=null;g=3;var k=10*Math.random();while(g-->0)try{a=(yield i.execute());var l=a.error.all;if(l){var m;k=(m=l.errorBackoff)!=null?m:10*Math.random();throw c("err")("syncContactList: error "+l.errorCode+": "+l.errorText)}else g=0}catch(a){g===0&&d("WALogger").ERROR(o()).verbose().devConsole(a).sendLogs("failed to execute usync query: "+a),yield d("WAPromiseDelays").delayMs(k*1e3)}if(a==null||a.error.all)return;m=a.refresh;l=[];for(g of Object.keys(m))l.push(m[g]);if(l.length>0){k=Math.min.apply(Math,l);N(k)}yield C(a);yield (h||(h=b("Promise"))).all([f?J(a):(h||(h=b("Promise"))).resolve(),A(a),d("WAWebUsernameGatingUtils").usernameUsyncEnabled()?E(a):(h||(h=b("Promise"))).resolve(),x(a),y(a),G(a)]);yield I(e)});return w.apply(this,arguments)}function x(a){var b=a.error.status;if(b){d("WALogger").WARN(t(),b.errorCode,b.errorText);return}a.list.map(function(a){var b=d("WAWebTextStatusCollection").TextStatusCollection.get(a.id);b&&a.status&&b.set({status:a.status})})}function y(a){return z.apply(this,arguments)}function z(){z=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!d("WAWebTextStatusGatingUtils").receiveTextStatusEnabled())return(h||(h=b("Promise"))).resolve();var c=a.error.text_status;if(c){d("WALogger").WARN(n(),c.errorCode,c.errorText);return}yield (h||(h=b("Promise"))).all(a.list.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a.text_status){var b=a.text_status,c=b.text,e=b.emoji,f=b.ephemeralDurationSeconds;b=b.lastUpdateTime;yield d("WAWebUpdateTextStatusForContact").updateTextStatusForContact(a.id,c,e,f,b)}});return function(b){return a.apply(this,arguments)}}()))});return z.apply(this,arguments)}function A(a){return B.apply(this,arguments)}function B(){B=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=a.error.status;if(c){d("WALogger").WARN(m(),c.errorCode,c.errorText);return}yield (h||(h=b("Promise"))).all(a.list.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a.disappearing_mode&&(yield d("WAWebUpdateDisappearingModeForContact").updateDisappearingModeForContact(a.id,a.disappearing_mode.duration,a.disappearing_mode.t))});return function(b){return a.apply(this,arguments)}}()))});return B.apply(this,arguments)}function C(a){return D.apply(this,arguments)}function D(){D=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.error.lid;b&&d("WALogger").WARN(l(),b.errorCode,b.errorText);a=[].concat(a.list,(b=a.sideList)!=null?b:[]).filter(function(a){a=a.lid;return typeof a==="string"});yield d("WAWebDBCreateLidPnMappings").createLidPnMappings({mappings:a.map(function(a){var b=a.id;a=a.lid;return{lid:d("WAWebWidFactory").createUserWid(a),pn:b}}),flushImmediately:!0,learningSource:"usync"})});return D.apply(this,arguments)}function E(a){return F.apply(this,arguments)}function F(){F=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.error.username;if(b){d("WALogger").WARN(k(),b.errorCode,b.errorText);return}a=[].concat(a.list,(b=a.sideList)!=null?b:[]);b=a.map(function(a){return Object.prototype.hasOwnProperty.call(a,"username")?{userId:a.id,username:a.username}:{userId:a.id,username:void 0}});yield d("WAWebSetUsernameJob").setUsernamesJob(b)});return F.apply(this,arguments)}function G(a){return H.apply(this,arguments)}function H(){H=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a.list.filter(function(a){a=a.business;return Boolean(a)});yield d("WAWebBizVerifiedNameAction").handleVerifiedNameSync(a.map(function(a){var b=a.id;a=a.business.verifiedName;return{id:b,verifiedName:a}}))});return H.apply(this,arguments)}function I(a){a=a.map(function(a){a=a.isLid()?d("WAJids").toLidUserJid(a.user):d("WAJids").toPhoneUserJid(a.user);return{id:a,isContactSyncCompleted:1}});d("WALogger").LOG(s(),a.length).tags("contact-sync");return c("WAWebLidAwareContactsDB").bulkCreateOrMerge(a)}function J(a){return K.apply(this,arguments)}function K(){K=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.error.devices;b&&d("WALogger").WARN(j(),b.errorCode,b.errorText);b=a.list.filter(function(a){return a.devices&&a.devices.deviceList!=null&&a.devices.keyIndex!=null&&!("errorCode"in a.devices)}).map(function(a){return{wid:a.id,devices:a.devices}});d("WALogger").LOG(i(),a.list.length-b.length,a.list.length);yield d("WAWebGetIdentityKeysJob").getAndStoreIdentityKeys(b.map(function(a){return a.wid}));return d("WAWebAdvHandlerApi").handleADVDeviceSyncResult(b)});return K.apply(this,arguments)}function L(a){return M.apply(this,arguments)}function M(){M=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=(yield d("WAWebApiDeviceList").getDeviceIds(a));c=c.map(function(a){return a==null?[]:a.devices.map(function(b){return d("WAWebWidFactory").createDeviceWidFromDeviceListPk(a.id,b.id,b.isHosted)})});var e=(yield (h||(h=b("Promise"))).all(c.map(function(a){return a.length===0?"":d("WAWebPhashUtils").phashV2(a)})));c=a.map(function(a,b){return{id:a,hash:e[b]}});return c});return M.apply(this,arguments)}function N(a){if(Number.isNaN(a)||a<=d("WATimeUtils").HOUR_SECONDS){d("WALogger").WARN(r(),a).tags("contact-sync");return}d("WALogger").LOG(q(),a).tags("contact-sync");c("WANullthrows")(c("WAWebLocalStorage")).setItem(d("WAWebUserPrefsKeys").KEYS.CONTACT_SYNC_REFRESH,String(a))}g.syncContactListInChunks=a;g.syncContactList=v;g.handleLidSync=C;g.handleUsernameSync=E;g.markContactsSyncCompleted=I}),98); __d("WAWebOutgoingMessage",["$InternalEnum","WALogger","WAWebE2EProtoGenerator","WAWebE2EProtoUtils","WAWebFrontendMsgGetters","WAWebHandleMsgError","WAWebMessagePluginParseProtobuf","WAWebMsgType","WAWebProcessBaseMsgInfo","WAWebSendMsgTypes","WAWebVerifyProtobufMsgObjectKeys","cr:10197"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["generate proto uncategorized error: msgId:"," type:"," error:",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["generate proto: type:"," error:",""]);i=function(){return a};return a}var j=new Set([(a=d("WAWebMsgType")).MSG_TYPE.CIPHERTEXT,a.MSG_TYPE.UNKNOWN,a.MSG_TYPE.GP2,a.MSG_TYPE.E2E_NOTIFICATION,a.MSG_TYPE.NOTIFICATION_TEMPLATE]);c=b("$InternalEnum")({Chat:"chat",ChatResend:"chat-resend",Retry:"retry",Newsletter:"newsletter",Report:"report",Status:"status",Debug:"debug"});var k=function(a,b,c){if(j.has(b.data.type))return;try{c=d("WAWebE2EProtoUtils").getMutableMessageProtobuf(c);d("WAWebVerifyProtobufMsgObjectKeys").verifyProtobufMessageObjectKeys(c);d("WAWebMessagePluginParseProtobuf").parseProtobuf({msgContext:"outgoing",messageProtobuf:c,baseMessage:b.type===d("WAWebSendMsgTypes").SendMessageRecordType.Message?d("WAWebProcessBaseMsgInfo").msgToBaseMsgInfo(b.data):d("WAWebProcessBaseMsgInfo").msgDataToBaseMsgInfo(b.data)})}catch(c){c instanceof d("WAWebHandleMsgError").MessageValidationError?d("WALogger").WARN(i(),b.data.type,c.name).tags("messaging").sendLogs("outgoingMsg: "+c.name):d("WALogger").WARN(h(),b.data.id,b.data.type,c).sendLogs("outgoing "+String(a)+" "+b.data.type,{sampling:.01});throw c}},l="https://web.whatsapp.net",m=function(a){a.type===d("WAWebMsgType").MSG_TYPE.STICKER&&a.deprecatedMms3Url==null&&(a.deprecatedMms3Url=l);var b;if(d("WAWebFrontendMsgGetters").getAsMms(a)){var c=a.isUnsentPhoneMsg();b=c?{type:a.type}:a.avParams();a.type===d("WAWebMsgType").MSG_TYPE.STICKER&&!c&&b.url==null&&(b.url=l)}return d("WAWebE2EProtoGenerator").createMsgProtobuf(a,b||{})},n=function(a,b){var c=b.type===d("WAWebSendMsgTypes").SendMessageRecordType.Message?m(b.data):d("WAWebE2EProtoGenerator").createAddonProtobuf(b.data);k(a,b,c);return c};e=function(a,b){return n(a,{type:d("WAWebSendMsgTypes").SendMessageRecordType.Message,data:b})};g.OutgoingMessageOriginType=c;g.createOutgoingMessageProtobuf=n;g.createOutgoingMsgModelProtobuf=e}),98); __d("WAWebICDCMetaApi",["WAWebAdvMetadataCreationFailureWamEvent","WAWebE2EProtoGenerator","WAWebIdentityIcdcApi","WAWebUserPrefsMeUser","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=d("WAWebUserPrefsMeUser").getMeUser(),e,f;try{e=(yield d("WAWebIdentityIcdcApi").getICDCMeta(c))}catch(a){new(d("WAWebAdvMetadataCreationFailureWamEvent").AdvMetadataCreationFailureWamEvent)({advMetadataIsMe:!0}).commit();throw a}try{f=d("WAWebUserPrefsMeUser").isMeAccount(a)?null:yield d("WAWebIdentityIcdcApi").getICDCMeta(a)}catch(a){new(d("WAWebAdvMetadataCreationFailureWamEvent").AdvMetadataCreationFailureWamEvent)({advMetadataIsMe:!1}).commit();throw a}d("WAWebE2EProtoGenerator").populateMessageContextInfo(b,e,f)});return h.apply(this,arguments)}g.populateICDCMeta=a}),98); __d("WAWebClientPayload",["WABase64","WAByteArray","WAMd5","WAWebBuildConstants","WAWebClientFeatureFlags","WAWebClientPayloadReleaseChannel","WAWebEnvironment","WAWebLid1X1MigrationGating","WAWebMiscBrowserUtils","WAWebProtobufsCompanionReg.pb","WAWebProtobufsWa6.pb","WAWebSyncdMdSyncFieldstatMeta","WAWebUserPrefsInfoStore","WAWebUserPrefsMeUser","WAWebWamPlatform","asyncToGeneratorRuntime","encodeProtobuf","gkx","justknobx"],(function(a,b,c,d,e,f,g){var h=null,i=null;function a(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=d("WAWebUserPrefsMeUser").assertGetMe();a=babelHelpers["extends"]({},yield l(a),{username:parseInt(b.user,10),device:b.device!=null?b.device:0,lidDbMigrated:d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()},i);return d("encodeProtobuf").encodeProtobuf(d("WAWebProtobufsWa6.pb").ClientPayloadSpec,a).readByteArray()});return j.apply(this,arguments)}function e(a,b,c){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){var e=n(),f=(yield o());c=babelHelpers["extends"]({},yield l(c),{devicePairingData:{buildHash:e,deviceProps:f,eRegid:d("WAByteArray").intToBytes(4,a.registrationId),eKeytype:d("WAByteArray").intToBytes(1,5),eIdent:a.identityKeyPair.pubKey,eSkeyId:d("WAByteArray").intToBytes(3,b.keyId),eSkeyVal:b.keyPair.pubKey,eSkeySig:b.signature}});return d("encodeProtobuf").encodeProtobuf(d("WAWebProtobufsWa6.pb").ClientPayloadSpec,c).readByteArray()});return k.apply(this,arguments)}function l(a){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b;return{passive:(b=a==null?void 0:a.passive)!=null?b:!1,pull:(b=a==null?void 0:a.pull)!=null?b:!1,connectType:d("WAWebProtobufsWa6.pb").ClientPayload$ConnectType.WIFI_UNKNOWN,connectReason:d("WAWebProtobufsWa6.pb").ClientPayload$ConnectReason.USER_ACTIVATED,userAgent:yield r(),webInfo:{webSubPlatform:u()}}});return m.apply(this,arguments)}function n(){var a=d("WABase64").decodeB64(c("WAMd5")(d("WAWebBuildConstants").VERSION_BASE));a=new Uint8Array(a);return a}function o(){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=c("WAWebMiscBrowserUtils").info(),b;if(a.version&&a.version!==""){var e=a.version.split(".");e.length>0&&a.version&&/^[0-9\.]+$/.test(a.version)&&(b={primary:parseInt(e[0],10),secondary:e.length>1?parseInt(e[1],10):void 0,tertiary:e.length>2?parseInt(e[2],10):void 0})}e={inlineInitialPayloadInE2EeMsg:!0,supportBotUserAgentChatHistory:!0,supportCagReactionsAndPolls:!0,supportRecentSyncChunkMessageCountTuning:!0,supportHostedGroupMsg:!0,supportBizHostedMsg:!0,supportFbidBotChatHistory:c("justknobx")._("822"),supportMessageAssociation:c("gkx")("5434"),supportCallLogHistory:c("WAWebEnvironment").isWindows};var f=d("WAWebClientFeatureFlags").isFeatureEnabled("debug_1_year_history_sync");if(f)e=babelHelpers["extends"]({},e,{fullSyncDaysLimit:365});else{var g=(yield d("WAWebSyncdMdSyncFieldstatMeta").MdSyncFieldStatsMeta.getStorageEstimation());g.mdStorageQuotaBytes!==d("WAWebSyncdMdSyncFieldstatMeta").STORAGE_QUOTA_UNAVAILABLE&&(e=babelHelpers["extends"]({},e,{storageQuotaMb:Math.trunc(g.mdStorageQuotaBytes/1024/1024)}))}g=c("WAWebEnvironment").isWindows?d("WAWebProtobufsCompanionReg.pb").DeviceProps$PlatformType.UWP:t(a.name);a={os:a.os,version:b,platformType:g,requireFullSync:f,historySyncConfig:e};g=d("encodeProtobuf").encodeProtobuf(d("WAWebProtobufsCompanionReg.pb").DevicePropsSpec,a).readByteArray();return g});return p.apply(this,arguments)}function f(a){h=a}function q(a){i=a}function r(){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield d("WAWebUserPrefsInfoStore").deviceInfo.get());a=babelHelpers["extends"]({appVersion:{primary:Number(d("WAWebBuildConstants").VERSION_PRIMARY),secondary:Number(d("WAWebBuildConstants").VERSION_SECONDARY),tertiary:Number(d("WAWebBuildConstants").VERSION_TERTIARY)},platform:d("WAWebProtobufsWa6.pb").ClientPayload$UserAgent$Platform.WEB,releaseChannel:yield d("WAWebClientPayloadReleaseChannel").getReleaseChannel(),mcc:a.mcc,mnc:a.mnc,osVersion:a.osVersion,manufacturer:a.manufacturer,device:a.device,osBuildNumber:a.osBuild,localeLanguageIso6391:a.lg,localeCountryIso31661Alpha2:a.lc},h);if(c("WAWebEnvironment").isWindows){var b;a.appVersion={primary:Number((b=d("WAWebBuildConstants")).VERSION_PRIMARY),secondary:Number(b.VERSION_SECONDARY),tertiary:Number(b.VERSION_TERTIARY),quaternary:Number(b.WINDOWS_BUILD)};(d("WAWebBuildConstants").WINDOWS_BUILD==null?void 0:d("WAWebBuildConstants").WINDOWS_BUILD.length)===6&&(a.mcc=d("WAWebBuildConstants").WINDOWS_BUILD.substr(0,3),a.mnc=d("WAWebBuildConstants").WINDOWS_BUILD.substr(3,3))}return a});return s.apply(this,arguments)}function t(a){switch(a){case"Chrome":return d("WAWebProtobufsCompanionReg.pb").DeviceProps$PlatformType.CHROME;case"Firefox":return d("WAWebProtobufsCompanionReg.pb").DeviceProps$PlatformType.FIREFOX;case"IE":return d("WAWebProtobufsCompanionReg.pb").DeviceProps$PlatformType.IE;case"Opera":return d("WAWebProtobufsCompanionReg.pb").DeviceProps$PlatformType.OPERA;case"Safari":return d("WAWebProtobufsCompanionReg.pb").DeviceProps$PlatformType.SAFARI;case"Edge":return d("WAWebProtobufsCompanionReg.pb").DeviceProps$PlatformType.EDGE;case"electron":case"Desktop":return d("WAWebProtobufsCompanionReg.pb").DeviceProps$PlatformType.DESKTOP;case"ipad":case"iPad":return d("WAWebProtobufsCompanionReg.pb").DeviceProps$PlatformType.IPAD;case"tablet":case"Android tablet":return d("WAWebProtobufsCompanionReg.pb").DeviceProps$PlatformType.ANDROID_TABLET;case"Ohana":return d("WAWebProtobufsCompanionReg.pb").DeviceProps$PlatformType.OHANA;case"Aloha":return d("WAWebProtobufsCompanionReg.pb").DeviceProps$PlatformType.ALOHA;case"Catalina":return d("WAWebProtobufsCompanionReg.pb").DeviceProps$PlatformType.CATALINA;default:return d("WAWebProtobufsCompanionReg.pb").DeviceProps$PlatformType.UNKNOWN}}function u(){switch(d("WAWebWamPlatform").getWamPlatform()){case"WEB":case"PWA":return d("WAWebProtobufsWa6.pb").ClientPayload$WebInfo$WebSubPlatform.WEB_BROWSER;case"DARWIN":case"DARWIN_BETA":return d("WAWebProtobufsWa6.pb").ClientPayload$WebInfo$WebSubPlatform.DARWIN;case"MACSTORE":return d("WAWebProtobufsWa6.pb").ClientPayload$WebInfo$WebSubPlatform.APP_STORE;case"WIN_HYBRID":return d("WAWebProtobufsWa6.pb").ClientPayload$WebInfo$WebSubPlatform.WIN_HYBRID;default:return void 0}}g.getClientPayloadForLogin=a;g.getClientPayloadForRegistration=e;g.setUserAgentOverride=f;g.setClientPayloadOverride=q}),98); __d("WAWebExternalBetaApi",["Promise","WAComms","WALogger","WAWebAbPropsSyncJob","WAWebBackendApi","WAWebStartBackend","WAWebUserPrefsGeneral","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["WAWebExternalBetaApi: Syncing AB Props after changing Web Beta opt-in status"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["WAWebExternalBetaApi: Restarting backend"]);j=function(){return a};return a}function a(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=(yield d("WAWebUserPrefsGeneral").getWhatsAppWebExternalBetaJoinedIdb());c!==a&&(yield (h||(h=b("Promise"))).all([d("WAWebUserPrefsGeneral").setWhatsAppWebExternalBetaDirtyBitIdb(!0),d("WAWebUserPrefsGeneral").setWhatsAppWebExternalBetaJoinedIdb(a)]),yield l(),d("WAWebBackendApi").frontendFireAndForget("changeOptInStatusForExternalWebBeta",{}))});return k.apply(this,arguments)}function l(){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){d("WALogger").LOG(j()),d("WAComms").stopComms(),yield d("WAWebStartBackend").startWebComms(),yield d("WAComms").startHandlingRequests(),(yield d("WAWebUserPrefsGeneral").getWhatsAppWebExternalBetaDirtyBitIdb())&&(d("WALogger").LOG(i()),yield d("WAWebAbPropsSyncJob").syncABPropsTask(),yield d("WAWebUserPrefsGeneral").setWhatsAppWebExternalBetaDirtyBitIdb(!1))});return m.apply(this,arguments)}g.changeOptInStatusForExternalWebBeta=a}),98); __d("WAWebGetClientPayloadForLogin",["WALogger","WAWebClientPayload","WAWebPassiveModeManager","WAWebRegisterPassiveTasks","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[comms] getClientPayloadForLogin generated payload in ","ms"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[comms] getClientPayloadForLogin registered passive tasks in ","ms"]);i=function(){return a};return a}function a(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a||{passive:!1,pull:!0};var b=self.performance.now();yield d("WAWebRegisterPassiveTasks").registerPassiveTasksForConnect();d("WALogger").LOG(i(),Math.ceil(self.performance.now()-b)).tags("launch-socket-chat");a.passive=d("WAWebPassiveModeManager").PassiveTaskManager.shouldConnectAsPassiveMode();b=self.performance.now();a=(yield d("WAWebClientPayload").getClientPayloadForLogin(a));d("WALogger").LOG(h(),Math.ceil(self.performance.now()-b)).tags("launch-socket-chat");return a});return j.apply(this,arguments)}g.getClientPayloadForLogin=a}),98); __d("WAWebGetClientPayloadForRegistration",["Promise","WALogger","WAWebClientPayload","WAWebSignalStoreApi","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[comms] getClientPayloadForRegistration generated payload in ","ms"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[comms] getClientPayloadForRegistration fetched signalInfo in ","ms"]);j=function(){return a};return a}function a(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=self.performance.now(),f=(yield (h||(h=b("Promise"))).all([d("WAWebSignalStoreApi").waSignalStore.getRegistrationInfo(),d("WAWebSignalStoreApi").waSignalStore.getSignedPreKey()])),g=f[0];f=f[1];d("WALogger").LOG(j(),Math.ceil(self.performance.now()-e)).tags("launch-socket-chat");if(!f||!g)throw c("err")("Invalid signal credentials");e=self.performance.now();g=(yield d("WAWebClientPayload").getClientPayloadForRegistration(g,f,a));d("WALogger").LOG(i(),Math.ceil(self.performance.now()-e)).tags("launch-socket-chat");return g});return k.apply(this,arguments)}g.getClientPayloadForRegistration=a}),98); __d("WAWebCookieDomain",["gkx"],(function(a,b,c,d,e,f,g){a=".web.whatsapp.com";c("gkx")("26258")||(a=".dev-web.whatsapp.com");b=a;g.COOKIE_DOMAIN=b}),98); __d("WAWebEventsWaitForEvent",["Promise","WAAbortError"],(function(a,b,c,d,e,f,g){var h;function a(a,c,e,f){e===void 0&&(e=function(){return!0});return(f==null?void 0:f.aborted)?(h||(h=b("Promise"))).reject(new(d("WAAbortError").AbortError)()):new(h||(h=b("Promise")))(function(b,g){var h=function(){if(!e.apply(this,arguments))return;j==null?void 0:j();b.apply(this,arguments)},i=function(){j==null?void 0:j(),g(new(d("WAAbortError").AbortError)())},j=function(){a.removeEventListener(c,h),f==null?void 0:f.removeEventListener("abort",i),j=null};f==null?void 0:f.addEventListener("abort",i);a.addEventListener(c,h)})}g["default"]=a}),98); __d("WAWebEventsWaitForOffline",["WAWebEventsWaitForEvent"],(function(a,b,c,d,e,f,g){function a(a){return c("WAWebEventsWaitForEvent")(window,"offline",void 0,a)}g["default"]=a}),98); __d("WAWebWatchedSocket",["WAAbortError","WABinary","WASocketTransport","WAWebEventsWaitForOffline","WAWebNoop"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(b){var e;e=a.call(this,b)||this;e.dataToSend=new(d("WABinary").Binary)();e.wsUrl=b.url;e._offlineListenerAbortController=new AbortController();e._offlineListener=c("WAWebEventsWaitForOffline")(e._offlineListenerAbortController.signal).then(function(){return e.close()})["catch"](d("WAAbortError").catchAbort(c("WAWebNoop")));return e}return b}(d("WASocketTransport").WebSocketTransport);g.WatchedSocket=a}),98); __d("WAWebOpenSocket",["Promise","WAAbortError","WALogger","WANullthrows","WAPromiseRetryLoop","WAWebCookieDomain","WAWebLocalStorage","WAWebMiscErrors","WAWebWatchedSocket","gkx"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[socket] openWebSocketsConcurrently socket with "," failed: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[socket] openWebSocketsConcurrently closing socket with "," as loser"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[socket] openWebSocketsConcurrently opened socket with "," ws."]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[socket] openWebSocketsConcurrently opening ws with ","."]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[socket] ",". Reason: ",", clean: ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["[socket] ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["[socket] ",""]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["[socket] ",""]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["[socket] ",""]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["[socket] Immediate socket closure: closed: "," ",""]);r=function(){return a};return a}var s=["wss://web.whatsapp.com/ws/chat","wss://web.whatsapp.com:5222/ws/chat"];function t(){if(!c("gkx")("26258")){var a;a=(a=c("WANullthrows")(c("WAWebLocalStorage")).getItem("wdev-pinning-cookie-value"))!=null?a:"";document.cookie=["sticky_routing="+a.replace(/\"/g,""),"path=/","domain="+d("WAWebCookieDomain").COOKIE_DOMAIN,"secure"].join(";")}}function u(a){if(a.code===1e3)return;d("WALogger").WARN(r(),a.code,a.reason).tags("socket")}function v(a,b){var c=a!=null?"[socket] "+a+" closed. code: "+b.code:"[socket] closed connection during initialization. Code: "+b.code;switch(b.code){case 1e3:case 1001:d("WALogger").LOG(q(),c).tags("socket");break;case 1006:a!=null&&d("WALogger").WARN(p(),c).tags("socket");d("WALogger").COUNT(o(),c).tags("socket");break;case 1002:case 1003:case 1007:case 1008:case 1009:case 1010:case 1011:case 1015:d("WALogger").ERROR(n(),c).tags("socket");break;default:d("WALogger").ERROR(m(),c,b.reason,b.wasClean).tags("socket");break}}function w(a){var c=new AbortController();return new(h||(h=b("Promise")))(function(b,e){var f=!1,g=[];a.forEach(function(h){d("WALogger").DEV(l(),h).tags("socket"),void x(h,c.signal,u,v).then(function(a){!f?(f=!0,d("WALogger").LOG(k(),h).tags("socket").devConsole(a),b(a)):(d("WALogger").DEV(j(),h).tags("socket"),c.abort(),a.close(1e3,"loser socket"))})["catch"](function(b){if(b.name==="AbortError")return;d("WALogger").WARN(i(),h,b).tags("socket");g.push(b);g.length===a.length&&e(b)})})})}function x(e,f,a,c){var g=new WebSocket(e);g.binaryType="arraybuffer";return new(h||(h=b("Promise")))(function(b,e){g.onopen=b,g.onclose=function(b){if(f==null?void 0:f.aborted){e(new(d("WAAbortError").AbortError)());return}a==null?void 0:a(b);c==null?void 0:c(null,b);e(new(d("WAWebMiscErrors").SocketError)(b))}}).then(function(){return g})}function y(){return{jitter:.1,max:1e4,algo:{type:"fibonacci",first:1e3,second:1e3},relativeDelay:!0}}function z(){return self.navigator!=null?self.navigator.onLine:!0}function a(a){var b=s.map(function(b){return a!=null?b+"?ED="+a:b}),c=!0;t();var e=function(){z()&&c===!1&&(c=!0,f.reset())},f=new(d("WAPromiseRetryLoop").PromiseRetryLoop)({name:"socketOpener",timer:y(),code:function(a){return w(b).then(function(b){a(new(d("WAWebWatchedSocket").WatchedSocket)(b))})["catch"](function(){c=z()})}});self.addEventListener("online",e);f.start();return f.promise()["finally"](function(){self.removeEventListener("online",e)})}g.openWebSocket=a}),98); __d("WAWebUserPrefsScreenLock",["WAArrayBufferUtils","WABase64","WABinary","WAWebDbEncryptionKey","WAWebDirectConnectionX509","WAWebPermanentStorage","WAWebUserPrefsKeys","WAWebUserPrefsStore","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(){var a;z(d("WAWebUserPrefsKeys").MD_KEYS.SCREEN_LOCK_DURATION_SECONDS);a=parseInt((a=c("WAWebUserPrefsStore").getUser(d("WAWebUserPrefsKeys").MD_KEYS.SCREEN_LOCK_DURATION_SECONDS))!=null?a:0,10);return a!==0}function e(){z(d("WAWebUserPrefsKeys").MD_KEYS.SCREEN_LOCK_DURATION_SECONDS);return c("WAWebUserPrefsStore").getUser(d("WAWebUserPrefsKeys").MD_KEYS.SCREEN_LOCK_DURATION_SECONDS)}function f(){var a;z(d("WAWebUserPrefsKeys").MD_KEYS.SCREEN_LOCK_DURATION_SECONDS);return(a=c("WAWebUserPrefsStore").getUser(d("WAWebUserPrefsKeys").MD_KEYS.SCREEN_LOCK_DURATION_SECONDS))!=null?a:0}function h(a){c("WAWebUserPrefsStore").setUser(d("WAWebUserPrefsKeys").MD_KEYS.SCREEN_LOCK_DURATION_SECONDS,a)}function i(a){c("WAWebUserPrefsStore").setUser(d("WAWebUserPrefsKeys").MD_KEYS.SCREEN_LOCK_IV,a)}function j(){z(d("WAWebUserPrefsKeys").MD_KEYS.SCREEN_LOCK_IV);return c("WAWebUserPrefsStore").getUser(d("WAWebUserPrefsKeys").MD_KEYS.SCREEN_LOCK_IV)}function k(a){return c("WAWebUserPrefsStore").setUser(d("WAWebUserPrefsKeys").MD_KEYS.SCREEN_LOCK_SALT,a,{shouldWriteToIdb:!1})}function l(){z(d("WAWebUserPrefsKeys").MD_KEYS.SCREEN_LOCK_SALT,!1);return c("WAWebUserPrefsStore").getUser(d("WAWebUserPrefsKeys").MD_KEYS.SCREEN_LOCK_SALT)}function m(a){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=y();a=(yield u(String(a),b));return c("WAWebUserPrefsStore").setUser(d("WAWebUserPrefsKeys").MD_KEYS.SCREEN_LOCK_ITERATIONS,a+"_"+b)});return n.apply(this,arguments)}function o(){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){z(d("WAWebUserPrefsKeys").MD_KEYS.SCREEN_LOCK_ITERATIONS);var a=c("WAWebUserPrefsStore").getUser(d("WAWebUserPrefsKeys").MD_KEYS.SCREEN_LOCK_ITERATIONS);if(a==null)return null;if(typeof a==="number")return parseInt(a,10);a=a.split("_");var b=a[0];a=a[1];if(b==null||a==null)return null;b=(yield w(b,a));return parseInt(b,10)});return p.apply(this,arguments)}function q(){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){z(d("WAWebUserPrefsKeys").MD_KEYS.SCREEN_UNLOCK_TRY_COUNT);var a=c("WAWebUserPrefsStore").getUser(d("WAWebUserPrefsKeys").MD_KEYS.SCREEN_UNLOCK_TRY_COUNT);if(a==null)return 0;if(typeof a==="number")return parseInt(a,10);a=a.split("_");var b=a[0];a=a[1];b=(yield w(b,a));return parseInt(b,10)});return r.apply(this,arguments)}function s(a,b){return t.apply(this,arguments)}function t(){t=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e=y();a=(yield u(String(a),e));if(b.aborted)return;c("WAWebUserPrefsStore").setUser(d("WAWebUserPrefsKeys").MD_KEYS.SCREEN_UNLOCK_TRY_COUNT,a+"_"+e)});return t.apply(this,arguments)}function u(a,b){return v.apply(this,arguments)}function v(){v=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=new Uint8Array(d("WABase64").decodeB64(b));var c=d("WAWebDbEncryptionKey").DbEncKeyStore.getEncKeys()[0];b=(yield self.crypto.subtle.encrypt({iv:b,name:"AES-CBC"},c.key,d("WAArrayBufferUtils").stringToArrayBuffer(a)));return d("WABase64").encodeB64(b)});return v.apply(this,arguments)}function w(a,b){return x.apply(this,arguments)}function x(){x=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=new Uint8Array(d("WABase64").decodeB64(b));yield d("WAWebDbEncryptionKey").DbEncKeyStore.waitForInit();var c=d("WAWebDbEncryptionKey").DbEncKeyStore.getEncKeys()[0];b=(yield self.crypto.subtle.decrypt({iv:b,name:"AES-CBC"},c.key,d("WABase64").decodeB64(a)));return d("WAWebDirectConnectionX509").arrayBufferToString(b)});return x.apply(this,arguments)}function y(){var a=new Uint8Array(16);self.crypto.getRandomValues(a);a=new(d("WABinary").Binary)(a).readByteArray(16);return d("WABase64").encodeB64(a)}function z(a,b){var d=c("WAWebUserPrefsStore").get(a);if(d!=null){b=b!=null?{shouldWriteToIdb:b}:null;c("WAWebUserPrefsStore").setUser(a,d,(d=b)!=null?d:{});c("WAWebPermanentStorage").removeItem(a)}}g.getScreenLockEnabled=a;g.getScreenLockDurationForLogging=e;g.getScreenLockDurationInSeconds=f;g.setScreenLockDurationInSeconds=h;g.setScreenLockIvString=i;g.getScreenLockIvString=j;g.setScreenLockSalt=k;g.getScreenLockSalt=l;g.setScreenLockIterations=m;g.getScreenLockIterations=o;g.getScreenUnlockTryCount=q;g.setScreenUnlockTryCount=s}),98); __d("WAWebWamEnumWebcSocketConnectReasonType",[],(function(a,b,c,d,e,f){a=Object.freeze({PAGE_LOAD:0,RECONNECT:1});f.WEBC_SOCKET_CONNECT_REASON_TYPE=a}),66); __d("WAWebWebcSocketConnectWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumWebcSocketConnectReasonType"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({WebcSocketConnect:[5450,{webcAuthHandshakeDuration:[1,a.TYPES.TIMER],webcSocketConnectDuration:[2,a.TYPES.TIMER],webcSocketConnectReason:[3,d("WAWebWamEnumWebcSocketConnectReasonType").WEBC_SOCKET_CONNECT_REASON_TYPE],webcSocketHostname:[4,a.TYPES.STRING]},[1,1,1],"regular"]},{WebcSocketConnect:[]});g.WebcSocketConnectWamEvent=b}),98); __d("WAWebOpenChatSocket",["Promise","WABase64","WABinary","WAFrameSocket","WAHex","WALogger","WANoiseHandshake","WANullthrows","WAResultOrError","WAWapDict","WAWebCommonSocketPlatformDetails","WAWebCryptoCurve25519","WAWebGetClientPayloadForLogin","WAWebGetClientPayloadForRegistration","WAWebOpenSocket","WAWebPageLoadLogging","WAWebProcessCertificate","WAWebProtobufsWa6.pb","WAWebSocketLogoutJob","WAWebUserPrefsInfoStore","WAWebUserPrefsMultiDevice","WAWebUserPrefsScreenLock","WAWebWamEnumWebcSocketConnectReasonType","WAWebWebcSocketConnectWamEvent","asyncToGeneratorRuntime","cr:4533","decodeProtobuf","encodeProtobuf","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[socket][unified] handshake failed. Retry count: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[socket][unified] handshake failed with ",", msg: ",", network: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[socket][unified] getCertficateChain error: ",", msg: ",", stack: ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["Unable to decrypt noise data for resume handshake"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[socket][unified] getCertficateChain handshake previously failed "," times. Falling back to full handshake"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["[socket] continueFullHandshakeCore client finish and deriving secrets"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["[socket] Unable to decrypt noise data"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["[socket] doFallbackHandshake continuing handshake with given server hello"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["openChatSocket preIntro ",""]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["[socket] openChatSocketCommon"]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["[socket] certificateCiphertext: ",""]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["[socket] serverStaticCiphertext: ",""]);t=function(){return a};return a}function u(){var a=babelHelpers.taggedTemplateLiteralLoose(["[socket] serverEphemeral: ",""]);u=function(){return a};return a}function v(){var a=babelHelpers.taggedTemplateLiteralLoose(["[socket] server hello content: ",""]);v=function(){return a};return a}function w(){var a=babelHelpers.taggedTemplateLiteralLoose(["[socket] openChatSocket rcv hello"]);w=function(){return a};return a}function x(){var a=babelHelpers.taggedTemplateLiteralLoose(["[socket] resumeNoiseHandshake failed: serverStaticCiphertext not null"]);x=function(){return a};return a}function y(){var a=babelHelpers.taggedTemplateLiteralLoose(["[socket] resumeNoiseHandshake deriving secrets"]);y=function(){return a};return a}function z(){var a=babelHelpers.taggedTemplateLiteralLoose(["[socket] resumeNoiseHandshake continuing resume handshake"]);z=function(){return a};return a}function A(){var a=babelHelpers.taggedTemplateLiteralLoose(["[socket] resumeNoiseHandshake rcv hello"]);A=function(){return a};return a}function B(){var a=babelHelpers.taggedTemplateLiteralLoose(["[socket] resumeNoiseHandshake send hello"]);B=function(){return a};return a}function C(){var a=babelHelpers.taggedTemplateLiteralLoose(["resumeNoiseHandshake failed to encrypt client login props: ",""]);C=function(){return a};return a}function D(){var a=babelHelpers.taggedTemplateLiteralLoose(["[socket] resumeNoiseHandshake EC Agreement 2"]);D=function(){return a};return a}function E(){var a=babelHelpers.taggedTemplateLiteralLoose(["resumeNoiseHandshake failed to encrypt client static key: ",""]);E=function(){return a};return a}function F(){var a=babelHelpers.taggedTemplateLiteralLoose(["[socket] resumeNoiseHandshake encrypt client static key"]);F=function(){return a};return a}function G(){var a=babelHelpers.taggedTemplateLiteralLoose(["[socket] resumeNoiseHandshake EC Agreement 1"]);G=function(){return a};return a}function H(){var a=babelHelpers.taggedTemplateLiteralLoose(["[socket] resumeNoiseHandshake authenticate with client ephemeral key"]);H=function(){return a};return a}function I(){var a=babelHelpers.taggedTemplateLiteralLoose(["[socket] resumeNoiseHandshake authenticate with server static key"]);I=function(){return a};return a}function J(){var a=babelHelpers.taggedTemplateLiteralLoose(["[socket] resumeNoiseHandshake started"]);J=function(){return a};return a}function K(){var a=babelHelpers.taggedTemplateLiteralLoose(["[socket] doFullHandshake: openChatSocket send hello"]);K=function(){return a};return a}var L=1;e=6;var M=new Uint8Array([87,65,e,d("WAWapDict").DICT_VERSION]),N="Noise_XX_25519_AESGCM_SHA256\0\0\0\0",O="Noise_IK_25519_AESGCM_SHA256\0\0\0\0",P="Noise_XXfallback_25519_AESGCM_SHA256";function Q(a){return d("WAWebOpenSocket").openWebSocket(a)}function R(a,b,c){return S.apply(this,arguments)}function S(){S=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e){d("WALogger").DEV(r());var f=(yield d("WAWebUserPrefsMultiDevice").getRoutingInfo()),g=f?f.edgeRouting:null;f=g?d("WABase64").encodeB64UrlSafe(g):null;var h=d("WAWebCryptoCurve25519").keyPair();d("WAWebPageLoadLogging").startPageLoadQplMeasure("socket_open");return Q(f).then(function(){var f=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){var f=void 0;d("WAWebPageLoadLogging").endPageLoadQplMeasure("socket_open");c.markWebcSocketConnectDuration();c.webcSocketConnectReason=d("WAWebPageLoadLogging").wasPageLoadQplLogged()?d("WAWebWamEnumWebcSocketConnectReasonType").WEBC_SOCKET_CONNECT_REASON_TYPE.RECONNECT:d("WAWebWamEnumWebcSocketConnectReasonType").WEBC_SOCKET_CONNECT_REASON_TYPE.PAGE_LOAD;if(g){var i=new(d("WABinary").Binary)();i.write("ED",0,1);i.writeUint8(g.byteLength>>16);i.writeUint16(g.byteLength&65535);i.writeBuffer(g);f=i.readByteArray();d("WALogger").DEV(q(),f)}i=f?d("WABinary").Binary.build(f,M).readByteArray():M;f=new(d("WAFrameSocket").FrameSocket)(b,i);b=a?yield ea(X):null;d("WAWebPageLoadLogging").startPageLoadQplMeasure("auth_handshake");c.startWebcAuthHandshakeDuration();if(b!=null){i=(yield d("WAWebUserPrefsInfoStore").waNoiseInfo.get());return aa(f,e,a,h,i==null?void 0:i.staticKeyPair,b)}return T(f,h,a,e)});return function(a){return f.apply(this,arguments)}}())});return S.apply(this,arguments)}function T(a,b,c,e){var f=new(d("WANoiseHandshake").NoiseHandshake)(a);f.start(N,M);d("WALogger").LOG(K()).tags("handshake");f.authenticate(b.pubKey);a={clientHello:{ephemeral:b.pubKey}};return f.sendAndReceive(d("encodeProtobuf").encodeProtobuf(d("WAWebProtobufsWa6.pb").HandshakeMessageSpec,a).readByteArray()).then(function(a){return V(f,a,b,c,e)})}function aa(a,e,f,g,i,j){if(i==null)return(h||(h=b("Promise"))).reject("resumeNoiseHandshake authKeyPair is null");var k=new(d("WANoiseHandshake").NoiseHandshake)(a);d("WALogger").LOG(J()).tags("handshake");k.start(O,M);d("WALogger").LOG(I()).tags("handshake");k.authenticate(j);d("WALogger").LOG(H()).tags("handshake");k.authenticate(g.pubKey);d("WALogger").LOG(G()).tags("handshake");k.mixIntoKey(d("WAWebCryptoCurve25519").sharedSecret(j,g.privKey));d("WALogger").LOG(F()).tags("handshake");var l=k.encrypt((h||(h=b("Promise"))).resolve(i.pubKey))["catch"](function(a){d("WALogger").ERROR(E(),a);return(h||(h=b("Promise"))).reject(a)});d("WALogger").LOG(D()).tags("handshake");k.mixIntoKey(d("WAWebCryptoCurve25519").sharedSecret(j,i.privKey));j=f?d("WAWebGetClientPayloadForLogin").getClientPayloadForLogin(e):d("WAWebGetClientPayloadForRegistration").getClientPayloadForRegistration(e);j=k.encrypt(h.resolve(j))["catch"](function(a){d("WALogger").ERROR(C(),a);return(h||(h=b("Promise"))).reject(a)});return h.all([g.pubKey,j,l]).then(function(b){var h=b[0],j=b[1];b=b[2];d("WALogger").LOG(B()).tags("handshake");h={clientHello:{ephemeral:h,payload:j,"static":b}};return k.sendAndReceive(d("encodeProtobuf").encodeProtobuf(d("WAWebProtobufsWa6.pb").HandshakeMessageSpec,h).readByteArray()).then(function(b){d("WALogger").LOG(A()).tags("handshake");var h=d("decodeProtobuf").decodeProtobuf(d("WAWebProtobufsWa6.pb").HandshakeMessageSpec,b);h=h.serverHello;h=h||{};var j=h.ephemeral,l=h["static"];h=h.payload;if(l==null){d("WALogger").LOG(z()).tags("handshake");if(!j)throw c("err")("serverHello missing serverEphemeral");if(!h)throw c("err")("serverHello missing certificateCiphertext");k.authenticate(j);k.mixIntoKey(d("WAWebCryptoCurve25519").sharedSecret(j,g.privKey));k.mixIntoKey(d("WAWebCryptoCurve25519").sharedSecret(j,i.privKey));return k.decrypt(h).then(function(){d("WALogger").LOG(y()).tags("handshake");return k.finish()})}d("WALogger").LOG(x());return ba(a,e,f,g,b)})})}function ba(a,b,c,d,e){return U.apply(this,arguments)}function U(){U=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e,f){a=new(d("WANoiseHandshake").NoiseHandshake)(a);a.start(P,M);a.authenticate(e.pubKey);d("WALogger").LOG(p());return V(a,f,e,c,b)});return U.apply(this,arguments)}function V(a,e,f,g,i){d("WALogger").LOG(w());d("WALogger").DEV(v(),d("WAHex").toLowerCaseHex(e));e=d("decodeProtobuf").decodeProtobuf(d("WAWebProtobufsWa6.pb").HandshakeMessageSpec,e);e=e.serverHello;if(!e)throw c("err")("ServerHello payload error");var j=e.ephemeral,k=e["static"];e=e.payload;if(j==null||k==null||e==null)throw c("err")("Missing server Ephemeral");d("WALogger").DEV(u(),d("WAHex").toLowerCaseHex(new Uint8Array(j)));d("WALogger").DEV(t(),d("WAHex").toLowerCaseHex(new Uint8Array(k)));d("WALogger").DEV(s(),d("WAHex").toLowerCaseHex(new Uint8Array(e)));a.authenticate(j);a.mixIntoKey(d("WAWebCryptoCurve25519").sharedSecret(j,f.privKey));k=a.decrypt(k);var l=k.then(function(a){return d("WAWebCryptoCurve25519").sharedSecret(a,f.privKey)});a.mixIntoKey(l);return(h||(h=b("Promise"))).all([k,a.decrypt(e),j]).then(function(b){var c=b[0],d=b[1];b=b[2];return ca(a,c,d,b,g,i)})}function ca(a,b,c,d,e,f){return W.apply(this,arguments)}function W(){W=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e,f,g,i,j){yield d("WAWebProcessCertificate").verifyAndProcessCertificate({certificate:f,serverStatic:e,isRegistered:i});yield g;f=i?d("WAWebGetClientPayloadForLogin").getClientPayloadForLogin(j):d("WAWebGetClientPayloadForRegistration").getClientPayloadForRegistration(j);e=(yield d("WAWebUserPrefsInfoStore").waNoiseInfo.get());e==null&&(d("WALogger").LOG(o()).tags("launch-socket-chat","handshake"),yield d("WAWebSocketLogoutJob").socketLogout(),c("WANullthrows")(e,"Unexpected null: noiseData"));i=c("WANullthrows")(e).staticKeyPair;return(h||(h=b("Promise"))).all([da(i,a,g),a.encrypt(h.resolve(f))]).then(function(b){var c=b[0];b=b[1];c={clientFinish:{"static":c,payload:b}};d("WALogger").LOG(n());a.send(d("encodeProtobuf").encodeProtobuf(d("WAWebProtobufsWa6.pb").HandshakeMessageSpec,c).readByteArray());return a.finish()})});return W.apply(this,arguments)}function da(a,e,f){var g=(h||(h=b("Promise"))).resolve(a.pubKey);g=e.encrypt(g);if(!f)return(h||(h=b("Promise"))).reject(c("err")("staticAgreement called before serverKeys"));f=d("WAWebCryptoCurve25519").sharedSecret(f,a.privKey);e.mixIntoKey(f);return g}var X=0;function ea(a){return Y.apply(this,arguments)}function Y(){Y=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(d("WAWebUserPrefsScreenLock").getScreenLockEnabled())return null;if(a>=L){d("WALogger").LOG(m(),a).tags("handshake");return null}try{a=(yield d("WAWebUserPrefsInfoStore").waNoiseInfo.get());if(a==null){d("WALogger").LOG(l()).tags("launch-socket-chat");return null}a=a.certificateChainBuffer?d("WAWebUserPrefsInfoStore").waNoiseInfo.getCertficateChain(a.certificateChainBuffer):null;return d("WAWebCommonSocketPlatformDetails").makeServerInfoIfKnown(a)}catch(a){d("WALogger").ERROR(k(),a.name,a.message,a.stack).tags("handshake");return null}});return Y.apply(this,arguments)}function fa(a,b){return Z.apply(this,arguments)}function Z(){Z=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){try{a=a||{passive:!1,pull:!0};var c=new(d("WAWebWebcSocketConnectWamEvent").WebcSocketConnectWamEvent)();b=(yield R(b,c,a));d("WAWebPageLoadLogging").endPageLoadQplMeasure("auth_handshake");c.markWebcAuthHandshakeDuration();c.commit();X=0;return d("WAResultOrError").makeResult(b)}catch(b){d("WAWebPageLoadLogging").incrementPageLoadQplSocketError();a=ga();d("WALogger").LOG(j(),b.name,b.message,a).tags("handshake");a&&(X++,d("WALogger").ERROR(i(),X).tags("handshake").sendLogs("handshake-error",{sampling:.01}));return d("WAResultOrError").makeError("disconnected")}});return Z.apply(this,arguments)}function ga(){return self.navigator!=null?self.navigator.onLine:!0}function a(a){return $.apply(this,arguments)}function $(){$=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=d("WAWebUserPrefsMultiDevice").isRegistered();return fa(a,b)});return $.apply(this,arguments)}g["default"]=a}),98); __d("WAWebProcessCertificate",["WALogger","WAVerifyChainCertificateWA6","WAWebDbEncryptionKey","WAWebUserPrefsInfoStore","WAWebUserPrefsScreenLock","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[socket] processCertificate: failed to set cert chain: ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[socket] persisting cert chain finished"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[socket] persisting cert chain start"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[socket] processCertificate finished with success: ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[socket] processCertificate start"]);l=function(){return a};return a}function a(a){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.certificate,e=a.serverStatic;a=a.isRegistered;d("WALogger").LOG(l()).tags("handshake");b=d("WAVerifyChainCertificateWA6").verifyChainCertificateWA6(b,e);d("WALogger").LOG(k(),b.success).tags("handshake");if(!b.success)throw c("err")("[socket] processCertificate error: "+b.error);if(a&&!d("WAWebUserPrefsScreenLock").getScreenLockEnabled()){e=b.value;var f=e.intermediate,g=e.leaf;g&&f&&(d("WALogger").LOG(j()).tags("handshake"),void d("WAWebDbEncryptionKey").DbEncKeyStore.waitForInit().then(function(){d("WAWebUserPrefsInfoStore").waNoiseInfo.setCertificateChain({intermediate:{key:f.key,notAfter:Number(f.notAfter),notBefore:Number(f.notBefore)},leaf:{key:g.key,notAfter:Number(g.notAfter),notBefore:Number(g.notBefore)}}).then(function(){d("WALogger").LOG(i()).tags("handshake")})["catch"](function(a){d("WALogger").ERROR(h(),a).sendLogs("handhshake-set-cert-chain",{sampling:.01})})}))}});return m.apply(this,arguments)}g.verifyAndProcessCertificate=a}),98); __d("WAWebDeleteAllCacheStorage",["Promise","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f){var g;function a(){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=window.caches;if(a==null)return;var c=(yield a.keys());yield (g||(g=b("Promise"))).all(c.map(function(b){return a["delete"](b)}))});return h.apply(this,arguments)}f["default"]=a}),66); __d("WAWebFeatureDetectionDetermineIncognito",["Promise","WACustomError","WAFilteredCatch","WALogger","WAPromiseTimeout","WAWebIndexedDB","WAWebLocalStorage","WAWebUA"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["promiseUtil:determineIncognito failed check: ",""]);i=function(){return a};return a}function a(){var a=new(h||(h=b("Promise")))(function(a){function b(){a(!1)}if(self.requestFileSystem)self.requestFileSystem(window.TEMPORARY,1,b,function(b){a(b.name==="SecurityError")});else if(c("WAWebIndexedDB")){var e=c("WAWebIndexedDB").open("pb_detect");e?(e.onsuccess=b,e.onerror=function(b){b.preventDefault(),window.InvalidStateError?a(b instanceof window.InvalidStateError):a(!0)}):b()}else d("WAWebUA").UA.isTrident?a(!0):b()}).then(function(a){if(a)return a;if(!c("WAWebLocalStorage"))return!1;try{c("WAWebLocalStorage").setItem("INCOG","0");c("WAWebLocalStorage").removeItem("INCOG");return!1}catch(a){if(a.name==="QuotaExceededError")return!0;throw a}});return d("WAPromiseTimeout").promiseTimeout(a,100,"detectIncognitoTimeout")["catch"](d("WAFilteredCatch").filteredCatch(d("WACustomError").TimeoutError,function(){return!1}))["catch"](function(a){d("WALogger").WARN(i(),String(a)).devConsole(a).sendLogs("incog-throw");return!1})}g["default"]=a}),98); __d("WAWebLruMediaStorageUtils",["invariant","WAWebIdb","WAWebStorage","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g,h){var i="lru-media-storage-idb",j=null;function a(){var a=new(c("WAWebIdb"))(i);j=new(d("WAWebStorage").Storage)(a)}function e(){j!=null||h(0,56300);return j}function f(){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(j==null)throw c("err")("[lru-media-storage-idb] Storage should be created first before being destroyed");try{yield j.purge()}finally{j=null}});return k.apply(this,arguments)}a();g.getStorage=e;g.destroyStorage=f}),98); __d("WAWebMediaArrayBufferCacheStore",["WAWebKeyValueCacheStore"],(function(a,b,c,d,e,f,g){var h={ignoreSearch:!0,ignoreMethod:!0,ignoreVary:!0};a=function(a){babelHelpers.inheritsLoose(b,a);function b(b){return a.call(this,b,i,j,{encodeKey:k,matchOptions:h})||this}return b}(c("WAWebKeyValueCacheStore"));function i(a){return new Response(a)}function j(a){return a.arrayBuffer()}function k(a,b){a=encodeURIComponent(a);b=encodeURIComponent(b);return"https://_media_cache_v2_.whatsapp.com/"+b+"_"+a}g["default"]=a}),98); __d("WAWebLruMediaStorage",["WAWebLruMediaStorageUtils","once"],(function(a,b,c,d,e,f,g){a=2;b=c("once")(function(){return d("WAWebLruMediaStorageUtils").getStorage().initialize()});g.versionToRollout=a;g.initialize=b}),98); __d("WAWebMediaLruIdbStoreUtils",["Promise","WAWebAbstractStore","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;a=function(a){babelHelpers.inheritsLoose(c,a);function c(b,c){var d;d=a.call(this)||this;d.$IdbStore$p_1=b;d.$IdbStore$p_2=c;return d}var d=c.prototype;d.doGet=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield this.$IdbStore$p_1();return this.$IdbStore$p_2.get(a)});function c(b){return a.apply(this,arguments)}return c}();d.doQueryByIndex=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){yield this.$IdbStore$p_1();return this.$IdbStore$p_2.all({limit:b.limit,index:[a]})});function c(b,c){return a.apply(this,arguments)}return c}();d.doGetAll=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield this.$IdbStore$p_1();return this.$IdbStore$p_2.all()});function c(){return a.apply(this,arguments)}return c}();d.doPut=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=this;yield this.$IdbStore$p_1().then(function(){return c.$IdbStore$p_2.createOrReplace(b)});return b});function c(b,c){return a.apply(this,arguments)}return c}();d.doDel=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield this.$IdbStore$p_1();return this.$IdbStore$p_2.remove(a)});function c(b){return a.apply(this,arguments)}return c}();d.doCount=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield this.$IdbStore$p_1();return this.$IdbStore$p_2.count()});function c(){return a.apply(this,arguments)}return c}();d.doClear=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield this.$IdbStore$p_1();return this.$IdbStore$p_2.clear(!0)});function c(){return a.apply(this,arguments)}return c}();d.doOpen=function(){return this.$IdbStore$p_1()};d.doClose=function(){return(h||(h=b("Promise"))).resolve()};return c}(c("WAWebAbstractStore"));g["default"]=a}),98); __d("WAWebSchemaLruMediaArrayBuffer",["WAWebLruMediaStorageUtils","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){var h="id",i="data";a="lru-media-array-buffer";b=d("WAWebStorageMutationBuilder").columnBuilder();c=b.addColumn;e=b.addUserDefinedPrimaryKey;d("WAWebLruMediaStorageUtils").getStorage().add(a).version(d("WAWebLruMediaStorageUtils").getStorage().versions.version(0),[e(h),c(i)]).view(function(a){a={id:a[h],data:a[i]};return a});f=d("WAWebLruMediaStorageUtils").getStorage().table(a);g.IdbArrayBufferTable=f}),98); __d("WAWebMediaArrayBufferIdbStore",["Promise","WAWebAbstractStore","WAWebLruMediaStorage","WAWebMediaLruIdbStoreUtils","WAWebSchemaLruMediaArrayBuffer","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h;a=function(a){babelHelpers.inheritsLoose(e,a);function e(b){b=a.call(this)||this;b.$ArrayBufferIdbStore$p_1=new(c("WAWebMediaLruIdbStoreUtils"))(d("WAWebLruMediaStorage").initialize,d("WAWebSchemaLruMediaArrayBuffer").IdbArrayBufferTable);return b}var f=e.prototype;f.doGet=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield this.$ArrayBufferIdbStore$p_1.get(a));return!a?null:a.data});function c(b){return a.apply(this,arguments)}return c}();f.doQueryByIndex=function(a,b){throw c("err")("Not implemented. Actual Arraybuffer store does not need it.")};f.doGetAll=function(){throw c("err")("Not implemented. Actual Arraybuffer store does not need it.")};f.doPut=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=(yield this.$ArrayBufferIdbStore$p_1.put(a,{id:a,data:b}));return a.data});function c(b,c){return a.apply(this,arguments)}return c}();f.doDel=function(a){return this.$ArrayBufferIdbStore$p_1.del(a)};f.doCount=function(){return this.$ArrayBufferIdbStore$p_1.count()};f.clear=function(){return this.$ArrayBufferIdbStore$p_1.clear()};f.doOpen=function(){return(h||(h=b("Promise"))).resolve()};f.doClose=function(){return(h||(h=b("Promise"))).resolve()};return e}(c("WAWebAbstractStore"));g["default"]=a}),98); __d("WAWebMediaStoreDummyImpl",["Promise","WAWebAbstractStore"],(function(a,b,c,d,e,f,g){var h;a=function(a){babelHelpers.inheritsLoose(c,a);function c(){return a.apply(this,arguments)||this}var d=c.prototype;d.get=function(a){return(h||(h=b("Promise"))).resolve()};d.queryByIndex=function(a,c){return(h||(h=b("Promise"))).resolve([])};d.getAll=function(){return(h||(h=b("Promise"))).resolve([])};d.put=function(a,c){return(h||(h=b("Promise"))).resolve(c)};d.del=function(a){return(h||(h=b("Promise"))).resolve()};d.count=function(){return(h||(h=b("Promise"))).resolve(0)};d.clear=function(){return(h||(h=b("Promise"))).resolve()};d.setMaxSize=function(a){return(h||(h=b("Promise"))).resolve()};return c}(c("WAWebAbstractStore"));g["default"]=a}),98); __d("WAWebSchemaLruMediaMetaInfo",["WAWebLruMediaStorageUtils","WAWebStorageMutationBuilder"],(function(a,b,c,d,e,f,g){a="id";b="timestamp";c="size";e="lru-media-meta-info";f=d("WAWebStorageMutationBuilder").columnBuilder();var h=f.addColumn,i=f.addUserDefinedPrimaryKey;f=f.addIndex;(d=d("WAWebLruMediaStorageUtils")).getStorage().add(e).version(d.getStorage().versions.version(1),[i(a),h(b),f(b)]).version(d.getStorage().versions.version(2),[h(c)]).view(function(a){a={id:a.id,timestamp:a.timestamp,size:a.size||0};return a});i=d.getStorage().table(e);g.metaInfoPrimaryIndex=a;g.metaInfoDateIndex=b;g.metaInfoSizeIndex=c;g.IdbMetaInfoTable=i}),98); __d("WAWebSizeLruObjectStore",["Promise","WALogger","WANullthrows","WAPromiseLoop","WAPromiseQueue","WAShiftTimer","WAWebAbstractStore","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Invalid size in index ",": ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Error while purging during setMaxSize: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["Error while purging: ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["SizeLRUObjectStore: _dispose error: ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["SizeLruObjectStore: _purge error: No row returned but currentSize (",") > maxSize (","). Row count is "," (may be out of date)."]);m=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(e,a);function e(e,f){var g;g=a.call(this)||this;g._queueMap=new(d("WAPromiseQueue").PromiseQueueMap)();g._purge=function(){if(g._pendingPurgePromise)return g._pendingPurgePromise;var a=g.open().then(function(){return d("WAPromiseLoop").promiseLoop(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=function(){g._pendingPurgePromise=null,a()},f=g.getCurrentSize();if(f==null||f<=g._maxSize){e();return}f=(yield g.queryOneByIndex(g._dateIndex));var i=g.getCurrentSize(),j=g._maxSize;if(i==null||i<=j){e();return}if(f==null){b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield g.count());d("WALogger").WARN(m(),i,j,a).sendLogs("size-lru-store-invalid-empty")})();return(h||(h=b("Promise"))).reject(c("err")("Query returned no result but currentSize > maxSize"))}e=f[g._primaryIndex];return g.del(e)});return function(b){return a.apply(this,arguments)}}())});return g._pendingPurgePromise=a};g._schedulePurge=function(){g._purgeTimer.debounce(2*1e3)};g.doPut=function(a,d){return g._queueMap.enqueue(a,b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(d[g._primaryIndex]!==a)throw c("err")("The key you provide does not match.");var b=(yield g._store.get(a));b=b==null?0:g._getSize(b);var e=g._getSize(d);e=e-b;b=(yield g._store.put(a,d));g._currentSize=c("WANullthrows")(g.getCurrentSize())+e;g._schedulePurge();return b}))};g.doDel=function(a){return g._queueMap.enqueue(a,b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var b=(yield g._store.get(a));if(b==null)return;try{yield g._dispose(a,b)}catch(a){d("WALogger").WARN(l(),a.message).sendLogs("size-lru-store-dispose-error");throw a}yield g._store.del(a);g._currentSize=c("WANullthrows")(g.getCurrentSize())-g._getSize(b)}))};g._store=e;g._primaryIndex=f.primaryIndex;g._dateIndex=f.dateIndex;g._sizeIndex=f.sizeIndex;if(f.maxSize<0)throw c("err")("Cannot set max size to a negative number");g._maxSize=Math.floor(f.maxSize);g._dispose=f.dispose;g._purgeTimer=new(d("WAShiftTimer").ShiftTimer)(function(){g._purge()["catch"](function(a){d("WALogger").WARN(k(),a.message)})});return g}var f=e.prototype;f.getCurrentSize=function(){return this._currentSize};f.getMaxSize=function(){return this._maxSize};f.setMaxSize=function(a){if(a<0)return(h||(h=b("Promise"))).reject(c("err")("Cannot set size to a negative number"));this._maxSize=Math.floor(a);this._purgeTimer.cancel();return this._purge()["catch"](function(a){d("WALogger").WARN(j(),a.message)})};f.putObject=function(a){var b=a[this._primaryIndex];return this.put(b,a)};f._getSize=function(a){a=a[this._sizeIndex];if(typeof a!=="number"||a<0){d("WALogger").WARN(i(),this._sizeIndex,a);return 0}return a};f.doGet=function(a){return this._store.get(a)};f.queryOneByIndex=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield this._store.queryByIndex(a,{limit:1}));return a.length===0?null:a[0]});function c(b){return a.apply(this,arguments)}return c}();f.doQueryByIndex=function(a,b){return this._store.queryByIndex(a,b)};f.doGetAll=function(){return this._store.getAll()};f.doClear=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){this._purgeTimer.cancel(),yield this._store.clear(),this._currentSize=0});function c(){return a.apply(this,arguments)}return c}();f.doCount=function(){return this._store.count()};f.doOpen=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=this;yield this._store.open();if(this._currentSize!=null)return;var b=(yield this._store.doGetAll());this._currentSize=b.reduce(function(b,c){return b+a._getSize(c)},0)});function c(){return a.apply(this,arguments)}return c}();f.doClose=function(){this._currentSize=null;return this._store.close()};return e}(c("WAWebAbstractStore"));g["default"]=a}),98); __d("WAWebMediaStoreMetaInfo",["WAWebLruMediaStorage","WAWebMediaLruIdbStoreUtils","WAWebSchemaLruMediaMetaInfo","WAWebSizeLruObjectStore"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(b,e){var f;b={primaryIndex:(f=d("WAWebSchemaLruMediaMetaInfo")).metaInfoPrimaryIndex,dateIndex:f.metaInfoDateIndex,sizeIndex:f.metaInfoSizeIndex,maxSize:b,dispose:e};e=new(c("WAWebMediaLruIdbStoreUtils"))(d("WAWebLruMediaStorage").initialize,f.IdbMetaInfoTable);return a.call(this,e,b)||this}return b}(c("WAWebSizeLruObjectStore"));g["default"]=a}),98); __d("WAWebMediaStoreLruImpl",["Promise","WALogger","WANullthrows","WAPromiseQueue","WAStorageEstimator","WAWeb-dexie","WAWebAbstractStore","WAWebMediaGatingUtils","WAWebMediaStoreMetaInfo","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["LruMediaStore: encounter QuotaExceededError, thus shrink the size of LruMediaStore"]);i=function(){return a};return a}var j=3e7;a=function(a){babelHelpers.inheritsLoose(e,a);function e(e){var f;f=a.call(this)||this;f._queueMap=new(d("WAPromiseQueue").PromiseQueueMap)();f.updateMaxSizeInterval=null;f._dispose=function(a,b){return f._bufferStore.del(a)};f.doPut=function(a,e){return f._queueMap.enqueue(a,b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(e.byteLength>f.getMaxSize())return e;if(e.byteLength>j)return e;var b={id:a,timestamp:new Date().getTime(),size:e.byteLength};try{yield f._metaInfoStore.putObject(b);return f._bufferStore.put(a,e)}catch(a){if(a instanceof c("WAWeb-dexie").AbortError&&a.message.includes("QuotaExceededError")){d("WALogger").LOG(i());f.setMaxSize(c("WANullthrows")(f.getCurrentSize())/2);return}throw a}}))};f.doDel=function(a){return f._queueMap.enqueue(a,function(){return f._metaInfoStore.del(a)})};f._updateMaxSize=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a===void 0&&(a=!1);if(d("WAWebMediaGatingUtils").isStoreQuotaManagerEnabled())return;var b=(yield d("WAStorageEstimator").estimateStorage());if(!b.success){f._clearStoreForThisSession();return}var c=f.getCurrentSize();if(c==null)return;b=b.value;var e=b.quota;b=b.usage;b=e-b;e=f._calculateTargetedBufferSize(e);if(b>e){a&&f.setMaxSize(b);return}a=e-b;if(c<a){f._clearStoreForThisSession();return}f.setMaxSize(c-a)});return function(b){return a.apply(this,arguments)}}();var g=e.maxSize;e=e.arrayBufferStore;f._bufferStore=e;f._metaInfoStore=new(c("WAWebMediaStoreMetaInfo"))(g,f._dispose);d("WAWebMediaGatingUtils").isStoreQuotaManagerEnabled()||(f.updateMaxSizeInterval=self.setInterval(f._updateMaxSize,60*1e3));return f}var f=e.prototype;f.doGet=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield this._bufferStore.get(a));b!=null&&this.put(a,b);return b});function c(b){return a.apply(this,arguments)}return c}();f.doClear=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield this._bufferStore.clear();return this._metaInfoStore.clear()});function c(){return a.apply(this,arguments)}return c}();f.doCount=function(){return this._metaInfoStore.count()};f.doOpen=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield (h||(h=b("Promise"))).all([this._metaInfoStore.open(),this._bufferStore.open()])});function c(){return a.apply(this,arguments)}return c}();f.doClose=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield (h||(h=b("Promise"))).all([this._metaInfoStore.close(),this._bufferStore.close()])});function c(){return a.apply(this,arguments)}return c}();f.getCurrentSize=function(){return this._metaInfoStore.getCurrentSize()};f.getMaxSize=function(){return this._metaInfoStore.getMaxSize()};f.setMaxSize=function(a){return this._metaInfoStore.setMaxSize(a)};f._calculateTargetedBufferSize=function(a){a=Math.floor(a*.01);if(a<1e8)return 1e8;return a>5e8?5e8:a};f._clearStoreForThisSession=function(){this.setMaxSize(0),this.updateMaxSizeInterval&&(self.clearInterval(this.updateMaxSizeInterval),this.updateMaxSizeInterval=null)};return e}(c("WAWebAbstractStore"));g["default"]=a}),98); __d("WAWebSerializeError",["WAWebNormalizeStack"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WAWebNormalizeStack").normalizeError(a),c=b.name,e=b.message;b.stack;b=babelHelpers.objectWithoutPropertiesLoose(b,["name","message","stack"]);a=d("WAWebNormalizeStack").normalizeStack(a,!0);b=Object.keys(b).length===0?"":" "+JSON.stringify(b,function(a,b){return a&&typeof b==="object"?String(b):b});return c+" - "+(e||"")+b+"\n"+a}g["default"]=a}),98); __d("WAWebStoreQuotaManager",["WAStorageEstimator","WAWebABProps","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h=1024*1024*1024;a=new Map([["lru-media-store",{getQuota:function(a){return a<=d("WAWebABProps").getABPropConfigValue("web_browser_quota_threshold")*h?Math.min(a*.2,d("WAWebABProps").getABPropConfigValue("web_browser_min_storage_quota")*h):.2*a}}]]);c=function(){function a(a){this.$1=a}var c=a.prototype;c.getQuotaForStore=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield d("WAStorageEstimator").estimateStorage());if(!b.success)return 0;b=b.value.quota;return Math.floor((a=(a=this.$1.get(a))==null?void 0:a.getQuota(b))!=null?a:0)});function c(b){return a.apply(this,arguments)}return c}();return a}();e=new c(a);g.storeQuotaManager=e}),98); __d("WAWebMediaStore",["WALogger","WAWebIndexedDB","WAWebMediaArrayBufferCacheStore","WAWebMediaArrayBufferIdbStore","WAWebMediaGatingUtils","WAWebMediaStoreDummyImpl","WAWebMediaStoreLruImpl","WAWebMiscErrors","WAWebSerializeError","WAWebStoreQuotaManager","asyncToGeneratorRuntime","once"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["\n Failed to initialize media store! Falling back to fake (no-op) storage. Error:\n ","\n "]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["\n There was a security error attempting to open the media storage. This likely indicates a permissions error. Falling back to fake (no-op) storage.\n "],["\n There was a security error attempting to open the media storage. \\\n This likely indicates a permissions error. Falling back to fake \\\n (no-op) storage.\n "]);i=function(){return a};return a}a=function(){function a(){this._getBackingStore=c("once")(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){try{var a=(yield j());if(a!=null){yield a.open();return a}}catch(a){if(a.name==="SecurityError")d("WALogger").WARN(i());else if(a instanceof d("WAWebMiscErrors").DbOnLogoutAbort)throw a;else d("WALogger").ERROR(h(),c("WAWebSerializeError")(a)).verbose().devConsole(a).sendLogs("Failed to initialize media store")}return new(c("WAWebMediaStoreDummyImpl"))()}))}var e=a.prototype;e.setMaxSize=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield this._getBackingStore());b.setMaxSize(a)});function c(b){return a.apply(this,arguments)}return c}();e.get=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield this._getBackingStore());return b.get(a)});function c(b){return a.apply(this,arguments)}return c}();e.queryByIndex=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=(yield this._getBackingStore());return c.queryByIndex(a,b)});function c(b,c){return a.apply(this,arguments)}return c}();e.getAll=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield this._getBackingStore());return a.getAll()});function c(){return a.apply(this,arguments)}return c}();e.put=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=(yield this._getBackingStore());return c.put(a,b)});function c(b,c){return a.apply(this,arguments)}return c}();e.del=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield this._getBackingStore());yield b.del(a)});function c(b){return a.apply(this,arguments)}return c}();e.count=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield this._getBackingStore());return a.count()});function c(){return a.apply(this,arguments)}return c}();e.clear=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield this._getBackingStore());yield a.clear()});function c(){return a.apply(this,arguments)}return c}();e.open=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield this._getBackingStore());yield a.open()});function c(){return a.apply(this,arguments)}return c}();e.close=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield this._getBackingStore());yield a.close()});function c(){return a.apply(this,arguments)}return c}();return a}();function j(){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=l();if(a==null)return null;var b=d("WAWebMediaGatingUtils").isStoreQuotaManagerEnabled()?yield d("WAWebStoreQuotaManager").storeQuotaManager.getQuotaForStore("lru-media-store"):Number.MAX_SAFE_INTEGER;return new(c("WAWebMediaStoreLruImpl"))({maxSize:b,arrayBufferStore:a})});return k.apply(this,arguments)}function l(){if(c("WAWebIndexedDB")!=null){var a=new(c("WAWebMediaArrayBufferIdbStore"))("media_lru_buffer");return"caches"in self?new(c("WAWebMediaArrayBufferCacheStore"))("lru-media-array-buffer-cache"):a}return null}e=new a();g.MediaStore=a;g.LruMediaStore=e}),98); __d("WAWebUnpairDeviceJob",["WADeprecatedSendIq","WADeprecatedWapParser","WAWap","WAWebCommsWapMd","WAWebUserPrefsMeUser","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h=new(c("WADeprecatedWapParser"))("unpairResponse",function(a){a.assertTag("iq");a.assertFromServer();var b=a.attrString("type"),c=200;b==="error"&&(c=a.child("error").attrInt("code"));return{status:c}});function a(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b;b=(b=d("WAWap")).wap("iq",{to:b.S_WHATSAPP_NET,type:"set",id:b.generateId(),xmlns:"md"},b.wap("remove-companion-device",{jid:d("WAWebCommsWapMd").DEVICE_JID(d("WAWebUserPrefsMeUser").assertGetMe()),reason:b.CUSTOM_STRING(a)}));a=(yield d("WADeprecatedSendIq").deprecatedSendIq(b,h));return a.success?{status:a.result.status}:{status:a.errorCode}});return i.apply(this,arguments)}g.unpairDevice=a}),98); __d("WAWebUserPrefsClearLocalState",["Promise","WAWebLoggerImpl","WAWebPermanentStorage","WAWebTemporaryStorage","WAWebUserPrefsKeys","WAWebUserPrefsStore","WAWebUserPrefsTypes","asyncToGeneratorRuntime","gkx"],(function(a,b,c,d,e,f,g){var h;function i(){var a=c("WAWebUserPrefsStore").get(d("WAWebUserPrefsKeys").KEYS.PRESERVED_USER_KEYS,{storage:c("WAWebPermanentStorage")});a=a instanceof Array?[].concat(d("WAWebUserPrefsTypes").LS_PRESERVE_KEYS,a.filter(function(a){return typeof a==="string"})):d("WAWebUserPrefsTypes").LS_PRESERVE_KEYS;return c("WAWebUserPrefsStore").getKeys(c("WAWebPermanentStorage"),a,!0)}function j(){return c("WAWebUserPrefsStore").getKeys(c("WAWebTemporaryStorage"),d("WAWebUserPrefsTypes").TS_PRESERVE_KEYS,!0)}function a(){c("WAWebTemporaryStorage").clear(j())}function e(){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=i();a=[c("WAWebTemporaryStorage").clear(j()),c("WAWebPermanentStorage").clear(a)];c("gkx")("26258")&&a.push(d("WAWebLoggerImpl").Logger.clearLogs());yield (h||(h=b("Promise"))).all(a)});return k.apply(this,arguments)}g.clearAllTemporaryStorageData=a;g.clearAllLocalState=e}),98); __d("WAWebSocketModel",["Promise","WAComms","WALogger","WANullthrows","WAPromiseDelays","WAPromiseTimeout","WAWebABPropsCache","WAWebAddMeContactAction","WAWebBackgroundSyncAction","WAWebBaseModel","WAWebCmd","WAWebConnModel","WAWebCrashlog","WAWebCryptoEncKeyHelper","WAWebCryptoEncryptionSaltHelper","WAWebDeleteAllCacheStorage","WAWebEnvironment","WAWebFeatureDetectionDetermineIncognito","WAWebFtsClient","WAWebFtsStorage","WAWebInvocationInterface","WAWebJobsStorage","WAWebLocalStorage","WAWebLogoutReason","WAWebLogoutReasonConstants","WAWebLruMediaStorageUtils","WAWebMediaStore","WAWebMiscBrowserUtils","WAWebMiscErrors","WAWebModelStorage","WAWebNetworkStatus","WAWebOffdStorage","WAWebPonyfillsUrlSearchParams","WAWebQplStorage","WAWebSentinel","WAWebSignalStorage","WAWebSocketConstants","WAWebSubscribePushManagerAction","WAWebSyncBootstrap","WAWebSyncdGatingUtils","WAWebUnpairDeviceJob","WAWebUpdater","WAWebUserPrefsAppStateSync","WAWebUserPrefsClearLocalState","WAWebUserPrefsGeneral","WAWebUserPrefsKeys","WAWebUserPrefsMeUser","WAWebUserPrefsMultiDevice","WAWebUserPrefsStore","WAWebWorkerStorage","asyncToGeneratorRuntime","cr:10201","cr:17219","err","gkx","requireDeferred"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[CRITICAL] unpairDevice failed with error, preoceed with local logout \n",""],["[CRITICAL] unpairDevice failed with error, preoceed with local logout \\n",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["ws2:multi-device logout failed with error code ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["ws2:clearState error ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["ws2:clearState failed due to DB operations aborted: ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["ws2:clearState error ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["ws2:clearState failed due to DB operations aborted: ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["ws2:clearState"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["ws2:clearAllLocalState error ",""]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["ws2:destroySignal error ",""]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["ws2:clearRegistrationInfo error ",""]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["ws2:setMe error ",""]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["ws2:setUnknownId error ",""]);t=function(){return a};return a}function u(){var a=babelHelpers.taggedTemplateLiteralLoose(["ws2:clearState error ",""]);u=function(){return a};return a}function v(){var a=babelHelpers.taggedTemplateLiteralLoose(["[ws2] moving to main screen from onCriticalSyncDone"]);v=function(){return a};return a}function w(){var a=babelHelpers.taggedTemplateLiteralLoose(["ws2:stream change: ",""]);w=function(){return a};return a}function x(){var a=babelHelpers.taggedTemplateLiteralLoose(["ws2:state change: ",""]);x=function(){return a};return a}function y(){var a=babelHelpers.taggedTemplateLiteralLoose(["",""]);y=function(){return a};return a}function z(){var a=babelHelpers.taggedTemplateLiteralLoose(["ws socket id: ",""]);z=function(){return a};return a}function A(){var a=babelHelpers.taggedTemplateLiteralLoose(["wd online: ",""]);A=function(){return a};return a}function B(){var a=babelHelpers.taggedTemplateLiteralLoose(["ws state ",""]);B=function(){return a};return a}function C(){var a=babelHelpers.taggedTemplateLiteralLoose(["ws:summary --------------------------------"]);C=function(){return a};return a}function D(){var a=babelHelpers.taggedTemplateLiteralLoose(["ws2: [logout error] sentinelPromise or sendCurrentLogoutPromise timed out with ",""]);D=function(){return a};return a}function E(){var a=babelHelpers.taggedTemplateLiteralLoose(["ws2: [logout error] sendCurrentLogoutPromise errored with ",""]);E=function(){return a};return a}function F(){var a=babelHelpers.taggedTemplateLiteralLoose(["ws2: multi-device logout did not manage to send sentinel patch"]);F=function(){return a};return a}function G(){var a=babelHelpers.taggedTemplateLiteralLoose(["ws2:user logged out"]);G=function(){return a};return a}function H(){var a=babelHelpers.taggedTemplateLiteralLoose(["WS2 logout debug: \n ",""],["WS2 logout debug: \\n ",""]);H=function(){return a};return a}function I(){var a=babelHelpers.taggedTemplateLiteralLoose(["destroyStorage: failed with error ",""]);I=function(){return a};return a}function J(){var a=babelHelpers.taggedTemplateLiteralLoose(["destroyStorage: failed with error ",""]);J=function(){return a};return a}function K(){var a=babelHelpers.taggedTemplateLiteralLoose(["clearCredentials: dirty bit is still set"]);K=function(){return a};return a}function L(){var a=babelHelpers.taggedTemplateLiteralLoose(["clearCredentials: native logout failed - ",""]);L=function(){return a};return a}function M(){var a=babelHelpers.taggedTemplateLiteralLoose(["[ws2] moving to main screen from main_stream_mode_ready"]);M=function(){return a};return a}function N(){var a=babelHelpers.taggedTemplateLiteralLoose(["[ws2] did not meet conditions to move to main screen"]);N=function(){return a};return a}function O(){var a=babelHelpers.taggedTemplateLiteralLoose(["[ws2] observed main_stream_mode_ready"]);O=function(){return a};return a}function P(){var a=babelHelpers.taggedTemplateLiteralLoose(["[ws2] observed on_critical_sync_done"]);P=function(){return a};return a}var Q=c("requireDeferred")("WAWebClearAppStates").__setRef("WAWebSocketModel");a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.socket=d("WAWebBaseModel").session(),c.launchGeneration=d("WAWebBaseModel").session(0),c.backoffGeneration=d("WAWebBaseModel").session(0),c.hasSynced=d("WAWebBaseModel").session(),c.state=d("WAWebBaseModel").session(d("WAWebSocketConstants").SOCKET_STATE.UNLAUNCHED),c.stream=d("WAWebBaseModel").session(d("WAWebSocketConstants").SOCKET_STREAM.DISCONNECTED),c.isIncognito=d("WAWebBaseModel").session(),c.retryTimestamp=d("WAWebBaseModel").session(),c.mustExitLoop=d("WAWebBaseModel").session(),b)||babelHelpers.assertThisInitialized(c)}var f=e.prototype;f.initialize=function(){var a=this,e;this.clearAppStatesDeferred=Q.load();this.listenTo(this,"change:state",this.$SocketImpl$p_1.bind(this));this.listenTo(this,"change:stream",this.$SocketImpl$p_2.bind(this));d("WAPromiseDelays").delayMs(0).then(c("WAWebFeatureDetectionDetermineIncognito")).then(function(b){a.isIncognito=b});this.listenTo((e=d("WAWebCmd")).Cmd,"log_socket_summary",this.summary);this.listenTo(e.Cmd,"set_socket_state",function(b){a.state=b});this.listenTo(e.Cmd,"open_socket_stream",function(){c("WAWebNetworkStatus").online=!0,void c("WAWebNetworkStatus").checkOnline(),a.openStream(),a.hasSynced&&a.set({stream:d("WAWebSocketConstants").SOCKET_STREAM.CONNECTED})});this.listenTo(e.Cmd,"socket_stream_disconnected",function(){a.set({stream:d("WAWebSocketConstants").SOCKET_STREAM.DISCONNECTED}),void c("WAWebNetworkStatus").checkOnline()});this.listenTo(e.Cmd,"on_critical_sync_done",function(){d("WALogger").LOG(P()),a.$SocketImpl$p_3()});this.listenTo(e.Cmd,"main_stream_mode_ready",b("asyncToGeneratorRuntime").asyncToGenerator(function*(){d("WALogger").LOG(O());if(!(yield d("WAWebUserPrefsAppStateSync").getAllCriticalDataSynced())){d("WALogger").LOG(N());return}d("WALogger").LOG(M());a.set({hasSynced:!0,stream:d("WAWebSocketConstants").SOCKET_STREAM.CONNECTED})}));this.listenTo(e.Cmd,"socket_stream_disconnected",function(){a.stream=d("WAWebSocketConstants").SOCKET_STREAM.DISCONNECTED})};f.reconnect=function(){d("WAWebCmd").Cmd.reconnectSocket()};f.takeover=function(){throw"Takeover called without conflict!"};f.exitLoop=function(){this.mustExitLoop=!0};f.$SocketImpl$p_4=function(){c("WAWebLocalStorage")==null?void 0:c("WAWebLocalStorage").setItem(d("WAWebUserPrefsKeys").KEYS.LOGOUT_DIRTY_BIT,"1")};f.$SocketImpl$p_5=function(){c("WAWebLocalStorage")==null?void 0:c("WAWebLocalStorage").removeItem(d("WAWebUserPrefsKeys").KEYS.LOGOUT_DIRTY_BIT)};f.$SocketImpl$p_6=function(){return(c("WAWebLocalStorage")==null?void 0:c("WAWebLocalStorage").getItem(d("WAWebUserPrefsKeys").KEYS.LOGOUT_DIRTY_BIT))==="1"};f.clearCredentialsAndStoredData=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){if(c("WAWebEnvironment").isWindows){var f;f=b("cr:17219")==null?void 0:(f=b("cr:17219").getWindowsBridge())==null?void 0:f.getClientKeyBridge();if(f!=null)try{yield d("WAPromiseTimeout").promiseTimeout(f.clearClientKey(),5e3)}catch(a){d("WALogger").ERROR(L(),a).tags("logout").sendLogs("native-clear-credentials-failed")}}f=!1;a===d("WAWebLogoutReasonConstants").LogoutReason.ClientFatalError&&(f=!0);this.$SocketImpl$p_4();f=(yield this.clearCredentials());if(this.$SocketImpl$p_6()){f=!0;var g=d("WALogger").ERROR(K()).tags("logout");c("gkx")("26258")||g.sendLogs("Logout clearCredentials failed")}void d("WAWebSubscribePushManagerAction").unsubscribePushManager();void d("WAWebBackgroundSyncAction").updatePeriodicBackgroundSyncRegistration(!0);this.$SocketImpl$p_4();try{yield this.destroyStorage()}catch(a){f=!0,c("gkx")("26258")?d("WALogger").ERROR(J(),a).tags("logout"):d("WALogger").ERROR(I(),a).tags("logout").sendLogs("Logout destroyStorage failed")}d("WAWebABPropsCache").clearABPropConfigs();f||this.$SocketImpl$p_5();g=new(c("WAWebPonyfillsUrlSearchParams"))();f&&c("WAWebMiscBrowserUtils").info().name!=="Firefox"&&g.set("post_logout","1");if(a){f=d("WAWebLogoutReason").getErrorCodeFromLogoutReason(a);f&&g.set("logout_reason",f);if(a===d("WAWebLogoutReasonConstants").LogoutReason.AccountLocked&&e!=null){f=e.logoutMessageHeader;a=e.logoutMessageSubtext;f!=null&&g.set("logout_message_header",f);a!=null&&g.set("logout_message_subtext",a)}}e=g.toString();e==null||e===""?window.location.reload():window.location.href=window.location.pathname+"?"+g.toString()});function e(b,c){return a.apply(this,arguments)}return e}();f.destroyStorage=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=[d("WAWebModelStorage").destroy(),d("WAWebLruMediaStorageUtils").destroyStorage()];a.push(d("WAWebFtsStorage").destroy());a.push(d("WAWebOffdStorage").destroy());a.push(d("WAWebJobsStorage").destroy());a.push(d("WAWebQplStorage").destroy());a.push(d("WAWebFtsClient").ftsClient.clearInitializationPromises());a.push(d("WAWebFtsClient").ftsClient.destroyExternalStorage());a.push(d("WAWebWorkerStorage").destroy());yield (h||(h=b("Promise"))).all(a)});function c(){return a.apply(this,arguments)}return c}();f.logout=function(a){var e=this;a===void 0&&(a=d("WAWebLogoutReasonConstants").LogoutReason.UserInitiated);c("WAWebLocalStorage")==null?void 0:c("WAWebLocalStorage").removeItem("WebEncKeySalt");c("WAWebLocalStorage")==null?void 0:c("WAWebLocalStorage").removeItem("WANoiseInfo");d("WAWebInvocationInterface").get().setLogoutState(!0);d("WAWebCmd").Cmd.onStartingLogout();if(!c("gkx")("26258"))try{throw c("err")("Non Error - WS2 logout, thrown only for getting logout stack trace")}catch(a){d("WALogger").LOG(H(),a.stack).verbose()}d("WALogger").LOG(G());var f=(h||(h=b("Promise"))).resolve(),g=0,i=20;i=Math.min(i,Math.max(g,d("WAWebSyncdGatingUtils").getSyncdSentinelTimeoutSeconds()));f=d("WAPromiseTimeout").promiseTimeout(c("WAWebSentinel")(),i*1e3)["catch"](function(){return d("WALogger").WARN(F())});g=3;d("WAPromiseTimeout").promiseTimeout(f.then(function(){return e.sendCurrentLogout(a)})["catch"](function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){d("WALogger").ERROR(E(),b),yield e.clearCredentialsAndStoredData(a),d("WAWebCmd").Cmd.logout()});return function(a){return c.apply(this,arguments)}}()),g*1e3,"network request took more than "+g+" seconds").then(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield e.clearCredentialsAndStoredData(a),e.state===d("WAWebSocketConstants").SOCKET_STATE.OPENING&&e.trigger("change:state"),d("WAWebCmd").Cmd.logout()}))["catch"](function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){d("WALogger").ERROR(D(),b),yield e.clearCredentialsAndStoredData(a),d("WAWebCmd").Cmd.logout()});return function(a){return c.apply(this,arguments)}}())["finally"](function(){d("WAWebInvocationInterface").get().setLogoutState(!1)})};f.summary=function(){var a;(a=d("WALogger")).LOG(C());a.LOG(B(),this.state);a.LOG(A(),String(navigator.onLine));a.LOG(z(),this.socket?this.socket.id:"n/a");c("gkx")("26258")||void c("WAWebSyncBootstrap").getCriticalSyncDebugSummary().then(function(a){d("WALogger").LOG(y(),a)})};f.$SocketImpl$p_1=function(){d("WALogger").LOG(x(),this.state)};f.$SocketImpl$p_2=function(){d("WALogger").LOG(w(),this.stream),this.stream===d("WAWebSocketConstants").SOCKET_STREAM.DISCONNECTED&&this.unset("resumePromise")};f.$SocketImpl$p_3=function(){d("WALogger").LOG(v()),this.set({hasSynced:!0,stream:d("WAWebSocketConstants").SOCKET_STREAM.CONNECTED})};f.openStream=function(){var a=d("WAWebUserPrefsMeUser").getMeUser();if(a){var c;(c=d("WAWebConnModel")).Conn.blockStoreAdds=!1;c.Conn.id="1";c.Conn.trigger("me_ready");c.Conn.meReadyTriggered=!0;return d("WAWebAddMeContactAction").addMeToContacts(a)}return(h||(h=b("Promise"))).resolve()};f.clearCredentials=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){c("WAWebUserPrefsStore").updatePreservedUserKeys();var a=!1;try{a=(yield this.clearState())}catch(b){a=!0}try{d("WAWebUserPrefsGeneral").setBrowserId()}catch(b){a=!0,d("WALogger").ERROR(u(),b).tags("logout")}try{d("WAWebUserPrefsMeUser").setUnknownId()}catch(a){d("WALogger").ERROR(t(),a).tags("logout")}try{d("WAWebUserPrefsMeUser").setMe()}catch(b){a=!0,d("WALogger").ERROR(s(),b).tags("logout")}try{yield d("WAWebUserPrefsMultiDevice").clearRegistrationInfo()}catch(b){a=!0,d("WALogger").ERROR(r(),b).tags("logout")}try{yield d("WAWebSignalStorage").destroy()}catch(b){a=!0,d("WALogger").ERROR(q(),b).tags("logout")}try{yield d("WAWebCryptoEncKeyHelper").deleteEncKeysAndCache(),yield d("WAWebCryptoEncryptionSaltHelper").deleteSalt()}catch(b){a=!0}try{yield d("WAWebUserPrefsClearLocalState").clearAllLocalState()}catch(b){a=!0,d("WALogger").ERROR(p(),b).tags("logout")}return a});function e(){return a.apply(this,arguments)}return e}();f.clearState=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){d("WALogger").LOG(o());var a=!1;this.unset("hasSynced");try{c("WANullthrows")(yield this.clearAppStatesDeferred)()}catch(b){a=!0,b instanceof d("WAWebMiscErrors").DbOnLogoutAbort?d("WALogger").WARN(n(),b.stack):d("WALogger").ERROR(m(),b.stack).sendLogs("clear_session_app_state")}try{yield R()}catch(b){a=!0,b instanceof d("WAWebMiscErrors").DbOnLogoutAbort?d("WALogger").WARN(l(),b.stack):d("WALogger").ERROR(k(),b.stack).sendLogs("clear_persistent_app_state")}return a});function e(){return a.apply(this,arguments)}return e}();f.sendCurrentLogout=function(a){a=d("WAWebUnpairDeviceJob").unpairDevice(a).then(function(a){a.status!==200&&d("WALogger").WARN(j(),a.status),d("WAComms").stopComms()})["catch"](function(a){d("WALogger").ERROR(i(),a.stack).verbose().devConsole(a)});a||(a=(h||(h=b("Promise"))).reject(c("err")("sendCurrentLogout: should not reach")));return a};f.updateImmediately=function(a){d("WAWebCrashlog").upload({reason:a,immediate:!0})["finally"](function(){d("WAWebUpdater").Updater.restart(!0)})};return e}(d("WAWebBaseModel").BaseModel);e=d("WAWebBaseModel").defineModel(a);f=new e();function R(){return S.apply(this,arguments)}function S(){S=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield (h||(h=b("Promise"))).allSettled([c("WAWebDeleteAllCacheStorage")(),d("WAWebMediaStore").LruMediaStore.clear()]));a.forEach(function(a){if(a.status==="rejected")throw a.reason})});return S.apply(this,arguments)}g.Socket=f}),98); __d("WAWebChatStateBridge",["WASendChatStateProtocol","WAWebWidToJid"],(function(a,b,c,d,e,f,g){function a(a){return d("WASendChatStateProtocol").sendChatStateProtocol(d("WAWebWidToJid").widToChatJid(a),"idle")}function b(a){return d("WASendChatStateProtocol").sendChatStateProtocol(d("WAWebWidToJid").widToChatJid(a),"recording_audio")}function c(a){return d("WASendChatStateProtocol").sendChatStateProtocol(d("WAWebWidToJid").widToChatJid(a),"typing")}g.sendChatStatePaused=a;g.sendChatStateRecording=b;g.sendChatStateComposing=c}),98); __d("WAWebSendPresenceSubscriptionJob",["WASmaxPresenceSubscribeRPC","WAWebWidToJid"],(function(a,b,c,d,e,f,g){function a(a,b){var c;a.isUser()&&b!=null&&(c={privacyTokenContentsMixinArgs:{anyElementValue:new Uint8Array(b)}});void d("WASmaxPresenceSubscribeRPC").sendSubscribeRPC({presenceTo:d("WAWebWidToJid").widToChatJid(a),tCTokenMixinArgs:c})}g["default"]=a}),98); __d("WAWebContactPresenceBridge",["Promise","WASendPresenceStatusProtocol","WAWebConnModel","WAWebSendPresenceSubscriptionJob","WAWebWid","WAWebWidFactory"],(function(a,b,c,d,e,f,g){var h;function a(){void d("WASendPresenceStatusProtocol").sendPresenceStatusProtocol({status:"available",name:d("WAWebConnModel").Conn.pushname})}function e(){void d("WASendPresenceStatusProtocol").sendPresenceStatusProtocol({status:"unavailable",name:d("WAWebConnModel").Conn.pushname})}function f(a,e){var f;a instanceof c("WAWebWid")?f=a:f=d("WAWebWidFactory").createWid(a);return(h||(h=b("Promise"))).resolve(c("WAWebSendPresenceSubscriptionJob")(f,e))}g.setPresenceAvailable=a;g.setPresenceUnavailable=e;g.subscribePresence=f}),98); __d("WAWebPresenceChatAction",["WAFilteredCatch","WALogger","WAWebBackendErrors","WAWebChatGetters","WAWebChatStateBridge","WAWebContactPresenceBridge","WAWebLidMigrationUtils","WAWebStateUtils","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["models:chat send presence resend composing error ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["models:chat send presence resend recording error ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["models:chat send presence recording error ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["models:chat send presence paused error ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["models:chat send presence composing error ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["",""]);m=function(){return a};return a}var n=2500,o=1e4;function a(a){if(d("WAWebChatGetters").getIsNewsletter(a)||a.id.isBot())return;return r(d("WAWebStateUtils").unproxy(a))}function b(a){if(d("WAWebChatGetters").getIsNewsletter(a)||a.id.isBot())return;return s(d("WAWebStateUtils").unproxy(a))}function e(a){if(d("WAWebChatGetters").getIsNewsletter(a)||a.id.isBot())return;return t(d("WAWebStateUtils").unproxy(a))}function f(){d("WAWebContactPresenceBridge").setPresenceAvailable()}function p(){d("WAWebContactPresenceBridge").setPresenceUnavailable()}function q(a){var b=d("WAWebLidMigrationUtils").shouldHaveAccountLid(a.id);if(b&&a.accountLid==null){var e="[presence] getChatIdentifier: lid-migrated client does not have an accountLid!";d("WALogger").ERROR(m(),e).sendLogs("lid-migrated-client-with-null-account-lid");throw c("err")(e)}return b&&a.accountLid?a.accountLid:a.id}function r(a){if(!a.typing){var b=q(a);d("WAWebChatStateBridge").sendChatStateComposing(b)["catch"](d("WAFilteredCatch").filteredCatch(d("WAWebBackendErrors").ServerStatusCodeError,function(a){a.status>=400&&d("WALogger").WARN(l(),b.toLogString())}));a.presenceResendTimerId=self.setTimeout(function(){return u(a)},o)}a.typing=!0;a.pausedTimerId&&self.clearTimeout(a.pausedTimerId);a.pausedTimerId=self.setTimeout(function(){return s(a)},n)}function s(a){if(a.typing||a.recording){var b=q(a);d("WAWebChatStateBridge").sendChatStatePaused(b)["catch"](d("WAFilteredCatch").filteredCatch(d("WAWebBackendErrors").ServerStatusCodeError,function(a){a.status>=400&&d("WALogger").WARN(k(),b.toLogString())}))}a.presenceResendTimerId&&(self.clearTimeout(a.presenceResendTimerId),a.unset("presenceResendTimerId"));a.pausedTimerId&&(self.clearTimeout(a.pausedTimerId),a.unset("pausedTimerId"));a.typing=a.recording=!1}function t(a){if(!a.recording){var b=q(a);d("WAWebChatStateBridge").sendChatStateRecording(b)["catch"](d("WAFilteredCatch").filteredCatch(d("WAWebBackendErrors").ServerStatusCodeError,function(a){a.status>=400&&d("WALogger").WARN(j(),b.toLogString())}));a.presenceResendTimerId=self.setTimeout(function(){return u(a)},o)}a.pausedTimerId&&(self.clearTimeout(a.pausedTimerId),a.unset("pausedTimerId"));a.recording=!0;a.typing=!1}function u(a){var b=a.id;if(a.recording)d("WAWebChatStateBridge").sendChatStateRecording(b)["catch"](d("WAFilteredCatch").filteredCatch(d("WAWebBackendErrors").ServerStatusCodeError,function(a){a.status>=400&&d("WALogger").WARN(i(),b.toLogString())}));else if(a.typing)d("WAWebChatStateBridge").sendChatStateComposing(b)["catch"](d("WAFilteredCatch").filteredCatch(d("WAWebBackendErrors").ServerStatusCodeError,function(a){a.status>=400&&d("WALogger").WARN(h(),b.toLogString())}));else{a.unset("presenceResendTimerId");return}a.presenceResendTimerId=self.setTimeout(function(){return u(a)},o)}function v(a){a.presence.isOnline?u(a):a.presenceResendTimerId&&(self.clearTimeout(a.presenceResendTimerId),a.unset("presenceResendTimerId"))}function w(a){a.presenceResendTimerId&&(self.clearTimeout(a.presenceResendTimerId),a.unset("presenceResendTimerId")),a.pausedTimerId&&(self.clearTimeout(a.pausedTimerId),a.unset("pausedTimerId")),a.typing=!1}g.markComposing=a;g.markPaused=b;g.markRecording=e;g.sendPresenceAvailable=f;g.sendPresenceUnavailable=p;g.getChatIdentifier=q;g.presenceOnlineChanged=v;g.clearPresence=w}),98); __d("WAWebStreamModel",["$InternalEnum","WALogger","WAShiftTimer","WAWebBaseModel","WAWebCmd","WAWebLockScreenResolver","WAWebNetworkStatus","WAWebPresenceChatAction","WAWebPresenceCollection","WAWebSocketConstants","WAWebSocketModel","WAWebUpdater","WAWebUserPrefsMultiDevice","WAWebUserPrefsScreenLock","WAWebWamEnumWebcStreamModeCode","WAWebWamPageLoadReporter","WAWebWebcPageResumeWamEvent","WAWebWebcStreamModeChangeWamEvent","asyncToGeneratorRuntime","gkx"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Stream:unknown obscure level:"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Stream:onAvailableUpdate user ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Stream:autoLockShiftTimer auto lock due to inactivity"]);j=function(){return a};return a}var k=b("$InternalEnum").Mirrored(["OFFLINE","OPENING","PAIRING","SYNCING","RESUMING","CONNECTING","NORMAL"]),l=b("$InternalEnum").Mirrored(["QR","MAIN","SYNCING","OFFLINE","CONFLICT","PROXYBLOCK","TOS_BLOCK","SMB_TOS_BLOCK","DEPRECATED_VERSION"]),m=b("$InternalEnum").Mirrored(["SHOW","OBSCURE","HIDE"]),n=18e3,o=3e3;a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.info=d("WAWebBaseModel").session(k.NORMAL),c.mode=d("WAWebBaseModel").session(l.SYNCING),c.obscurity=d("WAWebBaseModel").session(m.HIDE),c.needsUpdate=d("WAWebBaseModel").session(),c.clientExpired=d("WAWebBaseModel").session(!1),c.hardExpired=d("WAWebBaseModel").session(!1),c.lastSyncStart=d("WAWebBaseModel").session(t()),c.needsManualDownload=d("WAWebBaseModel").session(),c.couldForce=d("WAWebBaseModel").session(),c.uiActive=d("WAWebBaseModel").session(),c.available=d("WAWebBaseModel").session(!0),c.unavailableShiftTimer=d("WAWebBaseModel").session(),c.unavailableAutoLockTimer=d("WAWebBaseModel").session(),c.unavailableLogoutTimer=d("WAWebBaseModel").session(),c.unobscureShiftTimer=d("WAWebBaseModel").session(),c.resumeCount=d("WAWebBaseModel").session(0),c.phoneAuthed=d("WAWebBaseModel").session(!1),c.displayInfo=d("WAWebBaseModel").derived(function(){return s(this.info,this.obscurity)},["info","obscurity"]),b)||babelHelpers.assertThisInitialized(c)}var f=e.prototype;f.initialize=function(){var b=this;a.prototype.initialize.call(this);d("WAWebUserPrefsMultiDevice").isRegistered()||(this.mode=l.QR);this.unavailableShiftTimer=new(d("WAShiftTimer").ShiftTimer)(function(){return b.markUnavailable()});this.unobscureShiftTimer=new(d("WAShiftTimer").ShiftTimer)(function(){return b.unobscure()});this.unavailableAutoLockTimer=new(d("WAShiftTimer").ShiftTimer)(function(){d("WAWebUserPrefsScreenLock").getScreenLockDurationInSeconds()!==0&&(d("WALogger").LOG(j()),void d("WAWebLockScreenResolver").lockScreenAndTriggerUnlockFlow())});this.listenTo(d("WAWebSocketModel").Socket,"change:state change:stream change:hasSynced",this.$StreamImpl$p_1);this.listenTo(c("WAWebNetworkStatus"),"change:online",this.$StreamImpl$p_1);this.listenTo(this,"change:available",this.$StreamImpl$p_2);this.listenTo(this,"change:phoneAuthed",this.$StreamImpl$p_3);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(d("WAWebCmd").Cmd,"midnight",this.updateHardExpire);this.listenTo(d("WAWebCmd").Cmd,"serverUpdatedClientExpiration",this.updateHardExpire);this.listenTo(d("WAWebCmd").Cmd,"socket_stream_disconnected",function(){d("WAWebPresenceCollection").PresenceCollection.clearAllPresence()});window.document&&document.addEventListener("visibilitychange",this.updateCouldForce);this.updateCouldForce();this.updateHardExpire()};f["delete"]=function(){};f.markAvailable=function(){this.unavailableShiftTimer.cancel(),this.available=!0};f.markUnavailable=function(a){a!=null&&a!==0?this.unavailableShiftTimer.onOrBefore(a):(this.unavailableShiftTimer.cancel(),this.available=!1)};f.$StreamImpl$p_1=function(){var a=q(),b={info:a,mode:r(),phoneAuthed:d("WAWebSocketModel").Socket.stream!==d("WAWebSocketConstants").SOCKET_STREAM.DISCONNECTED};if(a===k.NORMAL)this.unobscureShiftTimer.cancel(),b.obscurity=m.HIDE;else if(a===k.OFFLINE)this.unobscureShiftTimer.cancel(),b.obscurity=m.OBSCURE;else switch(this.obscurity){case m.HIDE:this.unobscureShiftTimer.onOrBefore(n);break;case m.OBSCURE:this.unobscureShiftTimer.onOrBefore(o);break;case m.SHOW:break}this.set(b)};f.unobscure=function(){this.obscurity=m.SHOW};f.$StreamImpl$p_3=function(){this.phoneAuthed&&this.sendAvailability(!0)};f.$StreamImpl$p_2=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=this.available;d("WALogger").LOG(i(),a?"available":"unavailable");var b=d("WAWebUserPrefsScreenLock").getScreenLockDurationInSeconds();!a&&b!==0?this.unavailableAutoLockTimer.onOrBefore(b*1e3):this.unavailableAutoLockTimer.cancel();this.sendAvailability(!1);a||d("WAWebPresenceCollection").PresenceCollection.clearAllPresence()});function c(){return a.apply(this,arguments)}return c}();f.sendAvailability=function(a){(a||this.uiActive)&&(this.available?d("WAWebPresenceChatAction").sendPresenceAvailable():d("WAWebPresenceChatAction").sendPresenceUnavailable())};f.updateCouldForce=function(){this.couldForce=!this.uiActive||!this.available&&document.hidden};f.updateHardExpire=function(){d("WAWebUpdater").Updater.isExpired()&&(this.hardExpired=!0,d("WAWebUpdater").Updater.restart(!0))};f.logPageResume=function(){this.info===k.RESUMING&&(this.resumeCount++,new(d("WAWebWebcPageResumeWamEvent").WebcPageResumeWamEvent)({webcResumeCount:this.resumeCount}).commit())};f.updateWamLog=function(){var a=this.info===k.NORMAL;d("WAWebWamPageLoadReporter").streamInfoChange(this.info,1,a);a&&this.stopListening(this,"change:info",this.updateWamLog)};f.logModeChange=function(){this.mode===l.SYNCING&&(this.lastSyncStart=t()),new(d("WAWebWebcStreamModeChangeWamEvent").WebcStreamModeChangeWamEvent)({webcStreamMode:p(this.mode)}).commit()};return e}(d("WAWebBaseModel").BaseModel);a.Proxy="stream";function p(a){switch(a){case l.QR:return d("WAWebWamEnumWebcStreamModeCode").WEBC_STREAM_MODE_CODE.QR;case l.MAIN:return d("WAWebWamEnumWebcStreamModeCode").WEBC_STREAM_MODE_CODE.MAIN;case l.SYNCING:return d("WAWebWamEnumWebcStreamModeCode").WEBC_STREAM_MODE_CODE.SYNCING;case l.OFFLINE:return d("WAWebWamEnumWebcStreamModeCode").WEBC_STREAM_MODE_CODE.OFFLINE;case l.CONFLICT:return d("WAWebWamEnumWebcStreamModeCode").WEBC_STREAM_MODE_CODE.CONFLICT;case l.PROXYBLOCK:return d("WAWebWamEnumWebcStreamModeCode").WEBC_STREAM_MODE_CODE.PROXYBLOCK;case l.DEPRECATED_VERSION:return d("WAWebWamEnumWebcStreamModeCode").WEBC_STREAM_MODE_CODE.DEPRECATED_VERSION;case l.TOS_BLOCK:case l.SMB_TOS_BLOCK:return d("WAWebWamEnumWebcStreamModeCode").WEBC_STREAM_MODE_CODE.TOS_BLOCK}}e=d("WAWebBaseModel").defineModel(a);f=new e();function q(){var a=!1;if((a||c("gkx")("26256"))&&!c("WAWebNetworkStatus").online&&c("WAWebNetworkStatus").simulatedOfflineConditions)return k.OFFLINE;switch(d("WAWebSocketModel").Socket.state){case d("WAWebSocketConstants").SOCKET_STATE.OPENING:return c("WAWebNetworkStatus").online?k.OPENING:k.OFFLINE;case d("WAWebSocketConstants").SOCKET_STATE.PAIRING:return d("WAWebSocketModel").Socket.hasSynced?k.RESUMING:k.PAIRING;case d("WAWebSocketConstants").SOCKET_STATE.CONNECTED:return d("WAWebSocketModel").Socket.stream!==d("WAWebSocketConstants").SOCKET_STREAM.CONNECTED?d("WAWebSocketModel").Socket.hasSynced?k.NORMAL:k.SYNCING:k.NORMAL;case d("WAWebSocketConstants").SOCKET_STATE.UNLAUNCHED:case d("WAWebSocketConstants").SOCKET_STATE.PROXYBLOCK:default:return k.NORMAL}}function r(){var a;a=d("WAWebUserPrefsMultiDevice").isRegistered();if(!a&&d("WAWebSocketModel").Socket.state!==d("WAWebSocketConstants").SOCKET_STATE.PROXYBLOCK)return l.QR;a=d("WAWebSocketModel").Socket.hasSynced;switch(d("WAWebSocketModel").Socket.state){case d("WAWebSocketConstants").SOCKET_STATE.PROXYBLOCK:return l.PROXYBLOCK;case d("WAWebSocketConstants").SOCKET_STATE.CONFLICT:return l.CONFLICT;case d("WAWebSocketConstants").SOCKET_STATE.TOS_BLOCK:return l.TOS_BLOCK;case d("WAWebSocketConstants").SOCKET_STATE.SMB_TOS_BLOCK:return l.SMB_TOS_BLOCK;case d("WAWebSocketConstants").SOCKET_STATE.DEPRECATED_VERSION:return l.DEPRECATED_VERSION;case d("WAWebSocketConstants").SOCKET_STATE.UNLAUNCHED:return l.SYNCING;case d("WAWebSocketConstants").SOCKET_STATE.UNPAIRED_IDLE:case d("WAWebSocketConstants").SOCKET_STATE.UNPAIRED:return l.QR;case d("WAWebSocketConstants").SOCKET_STATE.OPENING:if(!c("WAWebNetworkStatus").online&&!d("WAWebSocketModel").Socket.hasSynced)return l.OFFLINE;default:return a||d("WAWebSocketModel").Socket.stream===d("WAWebSocketConstants").SOCKET_STREAM.CONNECTED?l.MAIN:l.SYNCING}}function s(a,b){switch(b){case m.SHOW:return a;case m.HIDE:return d("WAWebSocketModel").Socket.hasSynced?k.NORMAL:k.CONNECTING;case m.OBSCURE:switch(a){case k.OPENING:case k.PAIRING:case k.SYNCING:case k.RESUMING:return k.CONNECTING;default:return a}}d("WALogger").WARN(h()).devConsole(b);return a}function t(){return Math.floor(window.performance.now())}g.StreamInfo=k;g.StreamMode=l;g.Stream=f}),98); __d("WAWebMessagePluginGenerateProtobuf",["WAWebMessagePluginGenerateProtobufRegistry","WAWebPluginCreateRegistryLookup"],(function(a,b,c,d,e,f,g){var h=d("WAWebPluginCreateRegistryLookup").createMsgTypeRegistryLookup(c("WAWebMessagePluginGenerateProtobufRegistry"));function a(a){var b=a.json;return(b=h(b.type,b.subtype))==null?void 0:b.generateProtobuf==null?void 0:b.generateProtobuf(a)}g.generateProtobuf=a}),98); __d("WAWebEventsGenerateEventCreationMessageProto",[],(function(a,b,c,d,e,f){function a(a){var b=a.contextInfo;a=a.json;b={description:a.eventDescription,isCanceled:a.isEventCanceled,location:a.eventLocation,name:a.eventName,startTime:a.eventStartTime,endTime:a.eventEndTime,joinLink:a.eventJoinLink,contextInfo:(a=b)!=null?a:void 0};return{eventMessage:b}}f["default"]=a}),66); __d("WAWebEventsGenerateEventEditMessageProto",["WAWebE2EProtoUtils","WAWebProtobufsE2E.pb"],(function(a,b,c,d,e,f,g){function a(a){a=a.json;a={targetMessageKey:d("WAWebE2EProtoUtils").encodeKey(a.targetMessageKey),encIv:a.encIv,encPayload:a.encPayload,secretEncType:d("WAWebProtobufsE2E.pb").Message$SecretEncryptedMessage$SecretEncType.EVENT_EDIT};return{secretEncryptedMessage:a}}g["default"]=a}),98); __d("WAWebEventsGenerateEventResponseMessageProto",["WAWebE2EProtoUtils"],(function(a,b,c,d,e,f,g){function a(a){a=a.json;a={eventCreationMessageKey:d("WAWebE2EProtoUtils").encodeKey(a.targetMessageKey),encPayload:a.encPayload,encIv:a.encIv};return{encEventResponseMessage:a}}g["default"]=a}),98); __d("WAWebGenerateBizContentPlaceholderProto",["err"],(function(a,b,c,d,e,f,g){function a(a){throw c("err")("Not supported")}g["default"]=a}),98); __d("WAWebGenerateBotFeedbackProtocolMessageProto",["WAWebBotTypes","WAWebE2EProtoUtils","WAWebProtobufsE2E.pb"],(function(a,b,c,d,e,f,g){function a(a){a=a.json;var b;switch(a.botFeedbackKind){case d("WAWebBotTypes").BotFeedbackKind.POSITIVE:b=d("WAWebProtobufsE2E.pb").Message$BotFeedbackMessage$BotFeedbackKind.BOT_FEEDBACK_POSITIVE;break;case d("WAWebBotTypes").BotFeedbackKind.NEGATIVE_GENERIC:b=d("WAWebProtobufsE2E.pb").Message$BotFeedbackMessage$BotFeedbackKind.BOT_FEEDBACK_NEGATIVE_GENERIC;break;case d("WAWebBotTypes").BotFeedbackKind.NEGATIVE_HELPFUL:b=d("WAWebProtobufsE2E.pb").Message$BotFeedbackMessage$BotFeedbackKind.BOT_FEEDBACK_NEGATIVE_HELPFUL;break;case d("WAWebBotTypes").BotFeedbackKind.NEGATIVE_INTERESTING:b=d("WAWebProtobufsE2E.pb").Message$BotFeedbackMessage$BotFeedbackKind.BOT_FEEDBACK_NEGATIVE_INTERESTING;break;case d("WAWebBotTypes").BotFeedbackKind.NEGATIVE_ACCURATE:b=d("WAWebProtobufsE2E.pb").Message$BotFeedbackMessage$BotFeedbackKind.BOT_FEEDBACK_NEGATIVE_ACCURATE;break;case d("WAWebBotTypes").BotFeedbackKind.NEGATIVE_SAFE:b=d("WAWebProtobufsE2E.pb").Message$BotFeedbackMessage$BotFeedbackKind.BOT_FEEDBACK_NEGATIVE_SAFE;break;case d("WAWebBotTypes").BotFeedbackKind.NEGATIVE_OTHER:b=d("WAWebProtobufsE2E.pb").Message$BotFeedbackMessage$BotFeedbackKind.BOT_FEEDBACK_NEGATIVE_OTHER;break;case d("WAWebBotTypes").BotFeedbackKind.NEGATIVE_REFUSED:b=d("WAWebProtobufsE2E.pb").Message$BotFeedbackMessage$BotFeedbackKind.BOT_FEEDBACK_NEGATIVE_REFUSED;break;case d("WAWebBotTypes").BotFeedbackKind.NEGATIVE_NOT_VISUALLY_APPEALING:b=d("WAWebProtobufsE2E.pb").Message$BotFeedbackMessage$BotFeedbackKind.BOT_FEEDBACK_NEGATIVE_NOT_VISUALLY_APPEALING;break;case d("WAWebBotTypes").BotFeedbackKind.NEGATIVE_NOT_RELEVANT_TO_TEXT:b=d("WAWebProtobufsE2E.pb").Message$BotFeedbackMessage$BotFeedbackKind.BOT_FEEDBACK_NEGATIVE_NOT_RELEVANT_TO_TEXT;break}a={messageKey:d("WAWebE2EProtoUtils").encodeKey(a.protocolMessageKey),kind:b,text:a.botFeedbackText};a={type:d("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.BOT_FEEDBACK_MESSAGE,botFeedbackMessage:a};return{protocolMessage:a}}g["default"]=a}),98); __d("WAWebGenerateBotRequestWelcomeMessageProto",["WAWebProtobufsE2E.pb"],(function(a,b,c,d,e,f,g){function a(a){return{protocolMessage:{type:d("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.REQUEST_WELCOME_MESSAGE}}}g["default"]=a}),98); __d("WAWebGenerateButtonsResponseMessageProto",[],(function(a,b,c,d,e,f){function a(a){var b=a.json;a=a.contextInfo;return{buttonsResponseMessage:babelHelpers["extends"]({},b.buttonsResponse,{contextInfo:a})}}f["default"]=a}),66); __d("WAWebGenerateCancelPaymentMessageProto",["err"],(function(a,b,c,d,e,f,g){function a(a){throw c("err")("Not supported")}g["default"]=a}),98); __d("WAWebGenerateExtendedTextMessageProtoUtils",["WATypeUtils","WAWebE2EProtoUtils","WAWebGroupType","WAWebProtobufsE2E.pb"],(function(a,b,c,d,e,f,g){function h(a){switch(a){case d("WAWebGroupType").GroupType.COMMUNITY:return d("WAWebProtobufsE2E.pb").Message$ExtendedTextMessage$InviteLinkGroupType.PARENT;case d("WAWebGroupType").GroupType.LINKED_SUBGROUP:return d("WAWebProtobufsE2E.pb").Message$ExtendedTextMessage$InviteLinkGroupType.SUB;case d("WAWebGroupType").GroupType.LINKED_ANNOUNCEMENT_GROUP:return d("WAWebProtobufsE2E.pb").Message$ExtendedTextMessage$InviteLinkGroupType.DEFAULT_SUB;default:return d("WAWebProtobufsE2E.pb").Message$ExtendedTextMessage$InviteLinkGroupType.DEFAULT}}function a(a){var b=a.json;a=a.contextInfo;return{extendedTextMessage:{text:b.body,matchedText:b.matchedText,description:b.description,title:b.title,jpegThumbnail:d("WAWebE2EProtoUtils").encodeBytes(b.thumbnail),previewType:b.richPreviewType,contextInfo:a,mediaKey:d("WAWebE2EProtoUtils").encodeBytes(b.mediaKey),mediaKeyTimestamp:d("WATypeUtils").isNumber(b.mediaKeyTimestamp)?b.mediaKeyTimestamp:void 0,thumbnailDirectPath:b.thumbnailDirectPath,thumbnailSha256:d("WAWebE2EProtoUtils").encodeBytes(b.thumbnailSha256),thumbnailEncSha256:d("WAWebE2EProtoUtils").encodeBytes(b.thumbnailEncSha256),thumbnailHeight:b.thumbnailHeight,thumbnailWidth:b.thumbnailWidth,inviteLinkGroupTypeV2:h(b.inviteGrpType),backgroundArgb:b.backgroundColor,paymentLinkMetadata:b.paymentLinkMetadata}}}g["default"]=a}),98); __d("WAWebGenerateExtendedTextUrlChatMessageProto",["WAWebGenerateExtendedTextMessageProtoUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=a.json;a=a.contextInfo;return c("WAWebGenerateExtendedTextMessageProtoUtils")({json:b,contextInfo:a})}g["default"]=a}),98); __d("WAWebGenerateChatMessageProto",["WAWebGenerateExtendedTextUrlChatMessageProto"],(function(a,b,c,d,e,f,g){function a(a){var b=a.json;a=a.contextInfo;return b.quotedMsg||b.quotedRemoteJid||Array.isArray(b.mentionedJidList)&&b.mentionedJidList.length>0||Array.isArray(b.groupMentions)&&b.groupMentions.length>0||b.conversionTuple||b.isForwarded||b.forwardingScore||b._isPaymentNoteMsg||b.ephemeralDuration||b.ephemeralSettingTimestamp||b.ctwaContext||b.backgroundColor||(a==null?void 0:a.utm)?c("WAWebGenerateExtendedTextUrlChatMessageProto")({json:b,contextInfo:a}):{conversation:b.body}}g["default"]=a}),98); __d("WAWebGenerateDeclinePaymentMessageProto",["err"],(function(a,b,c,d,e,f,g){function a(a){throw c("err")("Not supported")}g["default"]=a}),98); __d("WAWebGenerateDocumentMessageProto",["WATypeUtils","WAWebE2EProtoUtils","WAWebMsgType","WAWebWid"],(function(a,b,c,d,e,f,g){function a(a){var b=a.contextInfo,e=a.json;a=a.mediaMetadata;a=a===void 0?{}:a;var f=e.mimetype||a.mimetype,g=void 0,h=void 0;e.type!==d("WAWebMsgType").MSG_TYPE.INTERACTIVE&&(g=e.caption,h=e.caption,g=a.filename);f={url:a.url,mimetype:f,title:g,caption:h,directPath:a.directPath,fileSha256:d("WAWebE2EProtoUtils").encodeBytes(a.filehash),fileEncSha256:d("WAWebE2EProtoUtils").encodeBytes(a.encFilehash),fileName:a.filename,fileLength:d("WATypeUtils").isNumber(e.size)?e.size:void 0,mediaKey:d("WAWebE2EProtoUtils").encodeBytes(a.mediaKey),mediaKeyTimestamp:d("WATypeUtils").isNumber(a.mediaKeyTimestamp)?a.mediaKeyTimestamp:void 0,jpegThumbnail:d("WAWebE2EProtoUtils").encodeBytes(e.body),contextInfo:b,contactVcard:e.isVcardOverMmsDocument,thumbnailDirectPath:a.thumbnailDirectPath,thumbnailSha256:d("WAWebE2EProtoUtils").encodeBytes(a.thumbnailSha256),thumbnailEncSha256:d("WAWebE2EProtoUtils").encodeBytes(a.thumbnailEncSha256),thumbnailHeight:a.thumbnailHeight,thumbnailWidth:a.thumbnailWidth};Number.isFinite(e.pageCount)&&!Number.isNaN(e.pageCount)&&(f.pageCount=e.pageCount);d("WAWebE2EProtoUtils").validateOutgoingRequiredMediaProperties(e.type,f,c("WAWebWid").isNewsletter(e.to));return{documentMessage:f}}g["default"]=a}),98); __d("WAWebGenerateEncCommentMessageProto",["WAWebE2EProtoUtils"],(function(a,b,c,d,e,f,g){function a(a){a=a.json;return{encCommentMessage:{targetMessageKey:d("WAWebE2EProtoUtils").encodeKey(a.targetMessageKey),encIv:a.encIv,encPayload:a.encPayload}}}g["default"]=a}),98); __d("WAWebGenerateEphemeralSyncResponseMessageProto",["WAWebE2EProtoUtils","WAWebProtobufsE2E.pb"],(function(a,b,c,d,e,f,g){function a(a){a=a.json;a={type:d("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.EPHEMERAL_SYNC_RESPONSE,ephemeralExpiration:a.ephemeralDuration,ephemeralSettingTimestamp:a.ephemeralSettingTimestamp,disappearingMode:d("WAWebE2EProtoUtils").disappearingModeInitiatorToProto(a.disappearingModeInitiator,a.disappearingModeTrigger,a.disappearingModeInitiatedByMe)};return{protocolMessage:a}}g["default"]=a}),98); __d("WAWebGenerateGroupInviteMessageProto",["WAWebE2EProtoUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=a.json;a=a.contextInfo;return{groupInviteMessage:{inviteCode:b.inviteCode,inviteExpiration:parseInt(b.inviteCodeExp,10),groupJid:b.inviteGrp,groupName:b.inviteGrpName,caption:b.comment,jpegThumbnail:d("WAWebE2EProtoUtils").encodeBytes(b.inviteGrpJpegThum),contextInfo:a}}}g["default"]=a}),98); __d("WAWebGenerateHsmMessageProto",["err"],(function(a,b,c,d,e,f,g){function a(a){throw c("err")("Not supported")}g["default"]=a}),98); __d("WAWebGenerateImageMessageProto",["WATypeUtils","WAWebE2EProtoUtils","WAWebMediaGatingUtils","WAWebWid","err"],(function(a,b,c,d,e,f,g){function a(a){var b=a.json,e=a.mediaMetadata;a=a.contextInfo;if(e==null)throw c("err")("generateImageMessageProto: generating image protobuf without mediaMetadata");var f=b.mimetype||e.mimetype,g={};c("WAWebWid").isStatus(b.to)&&(g={thumbnailDirectPath:e.thumbnailDirectPath,thumbnailSha256:d("WAWebE2EProtoUtils").encodeBytes(e.thumbnailSha256),thumbnailEncSha256:d("WAWebE2EProtoUtils").encodeBytes(e.thumbnailEncSha256)});d("WAWebMediaGatingUtils").isThumbnailGenerationForMsgOnServerEnabled(b)&&(g={thumbnailDirectPath:e.thumbnailDirectPath,thumbnailSha256:d("WAWebE2EProtoUtils").encodeBytes(e.thumbnailSha256)});f=babelHelpers["extends"]({url:e.url,mimetype:f,caption:b.caption,directPath:e.directPath,fileSha256:d("WAWebE2EProtoUtils").encodeBytes(e.filehash),fileEncSha256:d("WAWebE2EProtoUtils").encodeBytes(e.encFilehash),height:e.height,width:e.width,fileLength:d("WATypeUtils").isNumber(b.size)?b.size:void 0,mediaKey:d("WAWebE2EProtoUtils").encodeBytes(e.mediaKey),mediaKeyTimestamp:d("WATypeUtils").isNumber(e.mediaKeyTimestamp)?e.mediaKeyTimestamp:void 0,jpegThumbnail:b.isViewOnce?void 0:d("WAWebE2EProtoUtils").encodeBytes(b.body),contextInfo:a,viewOnce:b.isViewOnce},g);d("WAWebE2EProtoUtils").validateOutgoingRequiredMediaProperties(b.type,f,c("WAWebWid").isNewsletter(b.to));return{imageMessage:f}}g["default"]=a}),98); __d("WAWebGenerateVideoMessageProto",["WATypeUtils","WAWebE2EProtoUtils","WAWebMediaGatingUtils","WAWebMsgType","WAWebWid"],(function(a,b,c,d,e,f,g){function a(a){var b=a.json,e=a.mediaMetadata;a=a.contextInfo;var f=e==null?void 0:e.duration;f=f!=null&&d("WATypeUtils").isString(f)?parseInt(f,10):f;var g=b.caption,h=b.mimetype||(e==null?void 0:e.mimetype),i={};d("WAWebMediaGatingUtils").isThumbnailGenerationForMsgOnServerEnabled(b)&&(i={thumbnailDirectPath:e==null?void 0:e.thumbnailDirectPath,thumbnailSha256:d("WAWebE2EProtoUtils").encodeBytes(e==null?void 0:e.thumbnailSha256)});h=babelHelpers["extends"]({url:e==null?void 0:e.url,mimetype:h,directPath:e==null?void 0:e.directPath,fileSha256:d("WAWebE2EProtoUtils").encodeBytes(e==null?void 0:e.filehash),fileEncSha256:d("WAWebE2EProtoUtils").encodeBytes(e==null?void 0:e.encFilehash),height:e==null?void 0:e.height,width:e==null?void 0:e.width,seconds:f,caption:g,fileLength:d("WATypeUtils").isNumber(b.size)?b.size:void 0,mediaKey:d("WAWebE2EProtoUtils").encodeBytes(e==null?void 0:e.mediaKey),mediaKeyTimestamp:d("WATypeUtils").isNumber(e==null?void 0:e.mediaKeyTimestamp)?e.mediaKeyTimestamp:void 0,jpegThumbnail:b.isViewOnce?void 0:d("WAWebE2EProtoUtils").encodeBytes(b.body),gifPlayback:b.isGif,gifAttribution:b.gifAttribution,accessibilityLabel:b.accessibilityLabel,contextInfo:a,streamingSidecar:b.streamingSidecar,viewOnce:b.isViewOnce},i);d("WAWebE2EProtoUtils").validateOutgoingRequiredMediaProperties(b.type,h,c("WAWebWid").isNewsletter(b.to));return b.type===d("WAWebMsgType").MSG_TYPE.PTV?{ptvMessage:h}:{videoMessage:h}}g["default"]=a}),98); __d("WAWebGenerateInteractiveMessageProto",["WAWebE2EProtoUtils","WAWebGenerateDocumentMessageProto","WAWebGenerateImageMessageProto","WAWebGenerateVideoMessageProto","WAWebInteractiveMessageHeaderMediaType","WAWebInteractiveMessagesNativeFlowName"],(function(a,b,c,d,e,f,g){function a(a){var b=a.json,e=a.mediaMetadata;a=a.contextInfo;var f;if(b.interactiveHeader){f={title:b.interactiveHeader.title,subtitle:b.interactiveHeader.subtitle,hasMediaAttachment:b.interactiveHeader.hasMediaAttachment};if(b.interactiveHeader.thumbnail)f=babelHelpers["extends"]({},f,{jpegThumbnail:d("WAWebE2EProtoUtils").encodeBytes(b.interactiveHeader.thumbnail)});else if(b.interactiveHeader.mediaType)switch(b.interactiveHeader.mediaType){case d("WAWebInteractiveMessageHeaderMediaType").InteractiveMessageHeaderMediaType.VIDEO:var g=c("WAWebGenerateVideoMessageProto")({json:b,mediaMetadata:e,contextInfo:a}).videoMessage;f=babelHelpers["extends"]({},f,{videoMessage:babelHelpers["extends"]({},g,{caption:void 0})});break;case d("WAWebInteractiveMessageHeaderMediaType").InteractiveMessageHeaderMediaType.DOCUMENT:f=babelHelpers["extends"]({},f,{documentMessage:c("WAWebGenerateDocumentMessageProto")({json:b,mediaMetadata:e,contextInfo:a}).documentMessage});break;case d("WAWebInteractiveMessageHeaderMediaType").InteractiveMessageHeaderMediaType.IMAGE:f=babelHelpers["extends"]({},f,{imageMessage:c("WAWebGenerateImageMessageProto")({json:b,mediaMetadata:e,contextInfo:a}).imageMessage});break}}g=babelHelpers["extends"]({body:b.caption||b.nativeFlowName===c("WAWebInteractiveMessagesNativeFlowName").ORDER_STATUS?{text:b.caption}:void 0,footer:b.footer?{text:b.footer}:void 0,header:f},a&&{contextInfo:a});e=d("WAWebE2EProtoUtils").getInteractiveMessageFieldNameForType(b.interactiveType);e&&(g[e]=b.interactivePayload);return{interactiveMessage:g}}g["default"]=a}),98); __d("WAWebGenerateInteractiveResponseMessageProto",["WAWebE2EProtoUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=a.json;a=a.contextInfo;var c=b.interactivePayload,e=c.type;c=babelHelpers.objectWithoutPropertiesLoose(c,["type"]);e=d("WAWebE2EProtoUtils").getInteractiveResponseMessageFieldNameForType(e);e=(b={body:{text:b.body}},b[e]=c,b.contextInfo=a,b);return{interactiveResponseMessage:e}}g["default"]=a}),98); __d("WAWebGenerateKeepInChatMessageProto",["WAWebE2EProtoUtils"],(function(a,b,c,d,e,f,g){function a(a){a=a.json;return{keepInChatMessage:{key:d("WAWebE2EProtoUtils").encodeKey(a.keptMessageKey),keepType:a.keepType,timestampMs:a.senderTimestampMs}}}g["default"]=a}),98); __d("WAWebGenerateListMessageProto",[],(function(a,b,c,d,e,f){function a(a){var b=a.json;a=a.contextInfo;return{listMessage:babelHelpers["extends"]({},b.list,{contextInfo:a})}}f["default"]=a}),66); __d("WAWebGenerateListResponseMessageProto",[],(function(a,b,c,d,e,f){function a(a){var b=a.json;a=a.contextInfo;return{listResponseMessage:babelHelpers["extends"]({},b.listResponse,{contextInfo:a})}}f["default"]=a}),66); __d("WAWebGenerateLocationMessageProto",["WATypeUtils","WAWebE2EProtoUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=a.json;a=a.contextInfo;var c={};if(b.loc&&d("WATypeUtils").isString(b.loc)){var e=b.loc.split("\n");c={name:e[0],address:e[1],url:b.clientUrl}}return{locationMessage:babelHelpers["extends"]({},c,{degreesLatitude:parseFloat(b.lat)||void 0,degreesLongitude:parseFloat(b.lng)||void 0,jpegThumbnail:d("WAWebE2EProtoUtils").encodeBytes(b.body),contextInfo:a})}}g["default"]=a}),98); __d("WAWebGenerateMultiVcardMessageProto",[],(function(a,b,c,d,e,f){function a(a){var b=a.json;a=a.contextInfo;return{contactsArrayMessage:{contacts:b.vcardList.map(function(a){return a}),contextInfo:a}}}f["default"]=a}),66); __d("WAWebGenerateNativeFlowButtonsMessageProto",["WAWebButtonsMessageProtoUtils","WAWebGenerateImageMessageProto","WAWebProtobufsE2E.pb"],(function(a,b,c,d,e,f,g){function a(a){var b=a.message,e=a.json,f=a.mediaMetadata;a=a.contextInfo;b=babelHelpers["extends"]({},b);if(e.headerType===d("WAWebProtobufsE2E.pb").Message$ButtonsMessage$HeaderType.IMAGE){f=c("WAWebGenerateImageMessageProto")({json:e,mediaMetadata:f,contextInfo:void 0});f=f.imageMessage;b=babelHelpers["extends"]({},b,{imageMessage:f})}b=d("WAWebButtonsMessageProtoUtils").createDynamicReplyButtonsMessage(b,e,a);b.buttonsMessage=babelHelpers["extends"]({},b.buttonsMessage,{buttons:e.nativeFlowButtons});return b}g["default"]=a}),98); __d("WAWebGenerateNewsletterAdminInviteMessageProto",["WAWebE2EProtoUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=a.json;a=a.contextInfo;b=b.newsletterAdminInviteInfo;var c=b.newsletterId,e=b.newsletterName,f=b.inviteExpiration,g=b.inviteMessage;b=b.pictureThumbnail;return{newsletterAdminInviteMessage:{newsletterJid:d("WAWebE2EProtoUtils").encodeJid(c),newsletterName:e,caption:g,inviteExpiration:f,jpegThumbnail:d("WAWebE2EProtoUtils").encodeBytes(b),contextInfo:a}}}g["default"]=a}),98); __d("WAWebGenerateOrderMessageProto",["WAWebE2EProtoUtils"],(function(a,b,c,d,e,f,g){function a(a){a=a.json;return a.itemCount||a.message||a.orderId||a.orderTitle||a.sellerJid||a.status||a.surface||a.thumbnail||a.token||a.totalAmount1000||a.totalCurrencyCode||a.catalogType?{orderMessage:{itemCount:a.itemCount,message:a.message,orderId:a.orderId,orderTitle:a.orderTitle,sellerJid:a.sellerJid,status:a.status,surface:a.surface,thumbnail:d("WAWebE2EProtoUtils").encodeBytes(a.thumbnail),token:a.token,totalAmount1000:a.totalAmount1000,totalCurrencyCode:a.totalCurrencyCode,catalogType:a.catalogType}}:{conversation:a.body}}g["default"]=a}),98); __d("WAWebGeneratePaymentInviteMessageProto",["err"],(function(a,b,c,d,e,f,g){function a(a){throw c("err")("Not supported")}g["default"]=a}),98); __d("WAWebGeneratePinMessageProto",["WAWebE2EProtoUtils"],(function(a,b,c,d,e,f,g){function a(a){a=a.json;return{pinInChatMessage:{key:d("WAWebE2EProtoUtils").encodeKey(a.pinParentKey),type:a.pinMessageType,senderTimestampMs:a.pinSenderTimestampMs},messageContextInfo:{messageAddOnDurationInSecs:a.pinExpiryDuration}}}g["default"]=a}),98); __d("WAWebGeneratePollResultSnapshotMessageProto",[],(function(a,b,c,d,e,f){"use strict";function a(a){var b=a.msgContext,c=a.contextInfo;a=a.json;var d=a.pollName;if(b==="quoted")return{pollResultSnapshotMessage:{name:d,pollVotes:[],contextInfo:c}};b=a.pollVotesSnapshot;a=b.pollVotes.map(function(a){var b=a.option;a=a.optionVoteCount;return{optionName:b.name,optionVoteCount:a}});return{pollResultSnapshotMessage:{name:d,pollVotes:a,contextInfo:c}}}f["default"]=a}),66); __d("WAWebGenerateProductMessageProto",["WAWebGenerateImageMessageProto"],(function(a,b,c,d,e,f,g){function a(a){var b=a.json,d=a.mediaMetadata;a=a.contextInfo;var e;d!=null&&(e=c("WAWebGenerateImageMessageProto")({json:b,mediaMetadata:d,contextInfo:a}).imageMessage);d={product:{productImage:e,productId:b.productId,title:b.title,description:b.description,currencyCode:b.currencyCode,priceAmount1000:b.priceAmount1000||void 0,salePriceAmount1000:b.salePriceAmount1000||void 0,retailerId:b.retailerId,url:b.url,productImageCount:b.productImageCount},businessOwnerJid:b.businessOwnerJid,contextInfo:a,body:b.caption,footer:b.footer};return{productMessage:d}}g["default"]=a}),98); __d("WAWebGenerateProtocolEphemeralSettingMessageProto",["WAWebE2EProtoUtils","WAWebProtobufsE2E.pb"],(function(a,b,c,d,e,f,g){function a(a){a=a.json;return{protocolMessage:{type:d("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.EPHEMERAL_SETTING,ephemeralExpiration:a.ephemeralDuration,disappearingMode:d("WAWebE2EProtoUtils").disappearingModeInitiatorToProto(a.disappearingModeInitiator,a.disappearingModeTrigger,a.disappearingModeInitiatedByMe)}}}g["default"]=a}),98); __d("WAWebGenerateProtocolHistorySyncNotificationMessageProto",["err"],(function(a,b,c,d,e,f,g){function a(a){throw c("err")("generateProtocolHistorySyncNotificationMessageProto: Not supported")}g["default"]=a}),98); __d("WAWebGenerateProtocolRevokeMessageProto",["WAWebE2EProtoUtils","WAWebProtobufsE2E.pb","WAWebWid"],(function(a,b,c,d,e,f,g){function a(a){a=a.json;return babelHelpers["extends"]({protocolMessage:{key:d("WAWebE2EProtoUtils").encodeKey(a.protocolMessageKey),type:d("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.REVOKE}},a.botTargetSenderJid instanceof c("WAWebWid")?{messageContextInfo:{botMetadata:{invokerJid:a.botTargetSenderJid.toJid()}}}:{})}g["default"]=a}),98); __d("WAWebGenerateProtocolSharePhoneNumberMessageProto",["WAWebProtobufsE2E.pb"],(function(a,b,c,d,e,f,g){function a(a){return{protocolMessage:{type:d("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.SHARE_PHONE_NUMBER}}}g["default"]=a}),98); __d("WAWebGenerateReactionEncMessageProto",["WAWebE2EProtoUtils"],(function(a,b,c,d,e,f,g){function a(a){a=a.json;return{encReactionMessage:{targetMessageKey:d("WAWebE2EProtoUtils").encodeKey(a.targetMessageKey),encIv:a.encIv,encPayload:a.encPayload}}}g["default"]=a}),98); __d("WAWebGenerateRequestPhoneNumberMessageProto",[],(function(a,b,c,d,e,f){function a(a){a=a.contextInfo;return{requestPhoneNumberMessage:{contextInfo:a}}}f["default"]=a}),66); __d("WAWebGenerateStickerPackMessageProto",["WAWebE2EProtoUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=a.json;a=a.mediaMetadata;a=a===void 0?{}:a;return{stickerPackMessage:{stickerPackId:b.stickerPackId,name:b.filename,publisher:b.stickerPackPublisher,fileSha256:d("WAWebE2EProtoUtils").encodeBytes(a.filehash),fileEncSha256:d("WAWebE2EProtoUtils").encodeBytes(a.encFilehash),mediaKey:d("WAWebE2EProtoUtils").encodeBytes(a.mediaKey),directPath:b.directPath,caption:b.caption,packDescription:b.description,thumbnailSha256:d("WAWebE2EProtoUtils").encodeBytes(a.thumbnailSha256),thumbnailEncSha256:d("WAWebE2EProtoUtils").encodeBytes(a.thumbnailEncSha256),thumbnailDirectPath:b.thumbnailDirectPath,stickers:b.stickers,fileLength:b.size,trayIconFileName:b.trayIconFileName,stickerPackSize:b.stickerPackSize}}}g["default"]=a}),98); __d("WAWebGenerateTemplateButtonReplyMessageProto",[],(function(a,b,c,d,e,f){function a(a){var b=a.json;a=a.contextInfo;return{templateButtonReplyMessage:{selectedId:b.selectedId,selectedIndex:b.selectedIndex,selectedCarouselCardIndex:b.selectedCarouselCardIndex,selectedDisplayText:b.body,contextInfo:a}}}f["default"]=a}),66); __d("WAWebGenerateVcardMessageProto",[],(function(a,b,c,d,e,f){function a(a){var b=a.json;a=a.contextInfo;return{contactMessage:{displayName:b.vcardFormattedName,vcard:b.body,contextInfo:a}}}f["default"]=a}),66); __d("WAWebPollsProtoUtils",["WALogger","WAWebProtobufsE2E.pb"],(function(a,b,c,d,e,f,g){"use strict";function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Outgoing photo poll with missing option hashes"]);h=function(){return a};return a}function a(a){var b=a.pollContentType;if(b!==d("WAWebProtobufsE2E.pb").Message$PollContentType.IMAGE)return;b=a.options;a=b.some(function(a){a=a.optionHash;return a==null||a===""});a&&d("WALogger").ERROR(h()).devConsole(b).sendLogs("outgoing-photo-poll-missing-option-hashes")}g.validatePhotoPollCreationMessage=a}),98); __d("WAWebPollsGeneratePollCreationMessageProto",["WAWebPollCreationUtils","WAWebPollsProtoUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=a.msgContext,c=a.contextInfo;a=a.json;var e=a.pollContentType===d("WAWebPollCreationUtils").PollContentType.IMAGE;b=b==="quoted"?{name:a.pollName,options:[]}:{name:a.pollName,options:a.pollOptions.map(function(a){var b=a.name;a=a.hash;return e?{optionName:b,optionHash:a}:{optionName:b}}),selectableOptionsCount:a.pollSelectableOptionsCount,pollContentType:d("WAWebPollCreationUtils").getPollContentTypeAsE2EValue(a.pollContentType)};c!=null&&(b.contextInfo=c);d("WAWebPollsProtoUtils").validatePhotoPollCreationMessage(b);if(a.isSentCagPollCreation)return{pollCreationMessageV2:b};return a.pollSelectableOptionsCount===1||a.pollContentType===d("WAWebPollCreationUtils").PollContentType.IMAGE?{pollCreationMessageV3:b}:{pollCreationMessage:b}}g["default"]=a}),98); __d("WAWebPollsGeneratePollVoteMessageProto",["WAWebE2EProtoUtils"],(function(a,b,c,d,e,f,g){function a(a){a=a.json;a={pollCreationMessageKey:d("WAWebE2EProtoUtils").encodeKey(a.pollUpdateParentKey),vote:a.encPollVote,senderTimestampMs:a.senderTimestampMs};return{pollUpdateMessage:a}}g["default"]=a}),98); __d("WAWebPttGenerateAudioOrPttMessageProto",["invariant","WALogger","WATypeUtils","WAWebAudioMessageProtoUtils","WAWebE2EProtoUtils","WAWebWid"],(function(a,b,c,d,e,f,g,h){function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Outgoing waveform with invalid size: ",""]);i=function(){return a};return a}function a(a){var b=a.json,e=a.mediaMetadata;a=a.contextInfo;e||h(0,66891);var f=b.mimetype||e.mimetype,g=e.duration,j=b.waveform||e.waveform;g=g!=null&&d("WATypeUtils").isString(g)?parseInt(g,10):g;f={url:e.url,mimetype:f,directPath:e.directPath,fileSha256:d("WAWebE2EProtoUtils").encodeBytes(e.filehash),fileEncSha256:d("WAWebE2EProtoUtils").encodeBytes(e.encFilehash),seconds:g,ptt:b.type==="ptt",fileLength:d("WATypeUtils").isNumber(b.size)?b.size:void 0,mediaKey:d("WAWebE2EProtoUtils").encodeBytes(e.mediaKey),mediaKeyTimestamp:d("WATypeUtils").isNumber(e.mediaKeyTimestamp)?e.mediaKeyTimestamp:void 0,contextInfo:a,streamingSidecar:b.streamingSidecar,viewOnce:b.isViewOnce};j&&(d("WAWebAudioMessageProtoUtils").validateWaveform(j)?f.waveform=j.buffer:d("WALogger").ERROR(i(),j.byteLength).sendLogs("outgoing-waveform-invalid-size"));d("WAWebE2EProtoUtils").validateOutgoingRequiredMediaProperties(b.type?"ptt":"audio",f,c("WAWebWid").isNewsletter(b.to));return{audioMessage:f}}g["default"]=a}),98); __d("WAWebReactionsGenerateReactionMessageProto",["WAWebE2EProtoUtils"],(function(a,b,c,d,e,f,g){function a(a){a=a.json;return{reactionMessage:{key:d("WAWebE2EProtoUtils").encodeKey(a.reactionParentKey),text:a.reactionText,senderTimestampMs:a.reactionTimestamp}}}g["default"]=a}),98); __d("WAWebStickersGenerateStickerMessageProto",["invariant","WALogger","WATypeUtils","WAWebE2EProtoUtils","WAWebMsgType","WAWebStickerMimeUtils","WAWebWid","err"],(function(a,b,c,d,e,f,g,h){function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["invalid sticker mimetype: ",""]);i=function(){return a};return a}function a(a){var b=a.contextInfo,e=a.json;a=a.mediaMetadata;a!=null||h(0,66810);if(a.mimetype!=null&&!d("WAWebStickerMimeUtils").getValidStickerMimeTypes().has(a.mimetype)){d("WALogger").WARN(i(),a.mimetype);throw c("err")("invalid sticker mimetype")}a={url:a.url,mimetype:a.mimetype,directPath:a.directPath,fileSha256:d("WAWebE2EProtoUtils").encodeBytes(a.filehash),fileEncSha256:d("WAWebE2EProtoUtils").encodeBytes(a.encFilehash),mediaKey:d("WAWebE2EProtoUtils").encodeBytes(a.mediaKey),mediaKeyTimestamp:d("WATypeUtils").isNumber(a.mediaKeyTimestamp)?a.mediaKeyTimestamp:void 0,fileLength:d("WATypeUtils").isNumber(e.size)?e.size:void 0,height:e.height,width:e.width,firstFrameLength:a.firstFrameLength,firstFrameSidecar:e.firstFrameSidecar||void 0,isAnimated:a.isAnimated,isLottie:a.isLottie,stickerSentTs:e.stickerSentTs,contextInfo:b};d("WAWebE2EProtoUtils").validateOutgoingRequiredMediaProperties(d("WAWebMsgType").MSG_TYPE.STICKER,a,c("WAWebWid").isNewsletter(e.to));return{stickerMessage:a}}g["default"]=a}),98); __d("WAWebMessagePluginGenerateProtobufRegistry",["WAWebEventsGenerateEventCreationMessageProto","WAWebEventsGenerateEventEditMessageProto","WAWebEventsGenerateEventResponseMessageProto","WAWebGenerateBizContentPlaceholderProto","WAWebGenerateBotFeedbackProtocolMessageProto","WAWebGenerateBotRequestWelcomeMessageProto","WAWebGenerateButtonsResponseMessageProto","WAWebGenerateCancelPaymentMessageProto","WAWebGenerateChatMessageProto","WAWebGenerateDeclinePaymentMessageProto","WAWebGenerateDocumentMessageProto","WAWebGenerateEncCommentMessageProto","WAWebGenerateEphemeralSyncResponseMessageProto","WAWebGenerateExtendedTextUrlChatMessageProto","WAWebGenerateGroupInviteMessageProto","WAWebGenerateHsmMessageProto","WAWebGenerateImageMessageProto","WAWebGenerateInteractiveMessageProto","WAWebGenerateInteractiveResponseMessageProto","WAWebGenerateKeepInChatMessageProto","WAWebGenerateListMessageProto","WAWebGenerateListResponseMessageProto","WAWebGenerateLocationMessageProto","WAWebGenerateMultiVcardMessageProto","WAWebGenerateNativeFlowButtonsMessageProto","WAWebGenerateNewsletterAdminInviteMessageProto","WAWebGenerateOrderMessageProto","WAWebGeneratePaymentInviteMessageProto","WAWebGeneratePinMessageProto","WAWebGeneratePollResultSnapshotMessageProto","WAWebGenerateProductMessageProto","WAWebGenerateProtocolEphemeralSettingMessageProto","WAWebGenerateProtocolHistorySyncNotificationMessageProto","WAWebGenerateProtocolMessageEditProto","WAWebGenerateProtocolRevokeMessageProto","WAWebGenerateProtocolSharePhoneNumberMessageProto","WAWebGenerateReactionEncMessageProto","WAWebGenerateRequestPaymentMessageProto","WAWebGenerateRequestPhoneNumberMessageProto","WAWebGenerateSendPaymentMessageProto","WAWebGenerateStickerPackMessageProto","WAWebGenerateTemplateButtonReplyMessageProto","WAWebGenerateVcardMessageProto","WAWebGenerateVideoMessageProto","WAWebPollsGeneratePollCreationMessageProto","WAWebPollsGeneratePollVoteMessageProto","WAWebPttGenerateAudioOrPttMessageProto","WAWebReactionsGenerateReactionMessageProto","WAWebStickersGenerateStickerMessageProto"],(function(a,b,c,d,e,f,g){b=[{type:"album",subtype:void 0,generateProtobuf:null},{type:"audio",subtype:void 0,generateProtobuf:c("WAWebPttGenerateAudioOrPttMessageProto")},{type:"biz_content_placeholder",subtype:void 0,generateProtobuf:c("WAWebGenerateBizContentPlaceholderProto")},{type:"buttons_response",subtype:void 0,generateProtobuf:c("WAWebGenerateButtonsResponseMessageProto")},{type:"chat",subtype:"url",generateProtobuf:c("WAWebGenerateExtendedTextUrlChatMessageProto")},{type:"chat",subtype:void 0,generateProtobuf:c("WAWebGenerateChatMessageProto")},{type:"ciphertext",subtype:"bot_unavailable_fanout",generateProtobuf:null},{type:"ciphertext",subtype:"fanout",generateProtobuf:null},{type:"ciphertext",subtype:"hosted_unavailable_fanout",generateProtobuf:null},{type:"ciphertext",subtype:"view_once_unavailable_fanout",generateProtobuf:null},{type:"ciphertext",subtype:void 0,generateProtobuf:null},{type:"comment",subtype:void 0,generateProtobuf:c("WAWebGenerateEncCommentMessageProto")},{type:"debug_placeholder",subtype:void 0,generateProtobuf:null},{type:"document",subtype:void 0,generateProtobuf:c("WAWebGenerateDocumentMessageProto")},{type:"event_creation",subtype:void 0,generateProtobuf:c("WAWebEventsGenerateEventCreationMessageProto")},{type:"event_edit_encrypted",subtype:void 0,generateProtobuf:c("WAWebEventsGenerateEventEditMessageProto")},{type:"event_response",subtype:void 0,generateProtobuf:c("WAWebEventsGenerateEventResponseMessageProto")},{type:"groups_v4_invite",subtype:void 0,generateProtobuf:c("WAWebGenerateGroupInviteMessageProto")},{type:"hsm",subtype:void 0,generateProtobuf:c("WAWebGenerateHsmMessageProto")},{type:"image",subtype:void 0,generateProtobuf:c("WAWebGenerateImageMessageProto")},{type:"interactive",subtype:void 0,generateProtobuf:c("WAWebGenerateInteractiveMessageProto")},{type:"interactive_response",subtype:void 0,generateProtobuf:c("WAWebGenerateInteractiveResponseMessageProto")},{type:"keep_in_chat",subtype:void 0,generateProtobuf:c("WAWebGenerateKeepInChatMessageProto")},{type:"list",subtype:void 0,generateProtobuf:c("WAWebGenerateListMessageProto")},{type:"list_response",subtype:void 0,generateProtobuf:c("WAWebGenerateListResponseMessageProto")},{type:"location",subtype:void 0,generateProtobuf:c("WAWebGenerateLocationMessageProto")},{type:"multi_vcard",subtype:void 0,generateProtobuf:c("WAWebGenerateMultiVcardMessageProto")},{type:"native_flow",subtype:void 0,generateProtobuf:c("WAWebGenerateNativeFlowButtonsMessageProto")},{type:"newsletter_admin_invite",subtype:void 0,generateProtobuf:c("WAWebGenerateNewsletterAdminInviteMessageProto")},{type:"notification_template",subtype:"contact_info_card",generateProtobuf:null},{type:"order",subtype:void 0,generateProtobuf:c("WAWebGenerateOrderMessageProto")},{type:"payment",subtype:"ciphertext",generateProtobuf:null},{type:"payment",subtype:"futureproof",generateProtobuf:null},{type:"payment",subtype:"invite",generateProtobuf:c("WAWebGeneratePaymentInviteMessageProto")},{type:"payment",subtype:"request",generateProtobuf:c("WAWebGenerateRequestPaymentMessageProto")},{type:"payment",subtype:"send",generateProtobuf:c("WAWebGenerateSendPaymentMessageProto")},{type:"pin_message",subtype:void 0,generateProtobuf:c("WAWebGeneratePinMessageProto")},{type:"pinned_message",subtype:void 0,generateProtobuf:null},{type:"poll_creation",subtype:void 0,generateProtobuf:c("WAWebPollsGeneratePollCreationMessageProto")},{type:"poll_result_snapshot",subtype:void 0,generateProtobuf:c("WAWebGeneratePollResultSnapshotMessageProto")},{type:"poll_update",subtype:"poll_vote",generateProtobuf:c("WAWebPollsGeneratePollVoteMessageProto")},{type:"product",subtype:void 0,generateProtobuf:c("WAWebGenerateProductMessageProto")},{type:"protocol",subtype:"admin_revoke",generateProtobuf:a=c("WAWebGenerateProtocolRevokeMessageProto")},{type:"protocol",subtype:"bot_feedback",generateProtobuf:c("WAWebGenerateBotFeedbackProtocolMessageProto")},{type:"protocol",subtype:"bot_memu_onboarding",generateProtobuf:null},{type:"protocol",subtype:"bot_request_welcome",generateProtobuf:c("WAWebGenerateBotRequestWelcomeMessageProto")},{type:"protocol",subtype:"ephemeral_setting",generateProtobuf:c("WAWebGenerateProtocolEphemeralSettingMessageProto")},{type:"protocol",subtype:"ephemeral_sync_response",generateProtobuf:c("WAWebGenerateEphemeralSyncResponseMessageProto")},{type:"protocol",subtype:"event_edit_decrypted",generateProtobuf:null},{type:"protocol",subtype:"history_sync_notification",generateProtobuf:c("WAWebGenerateProtocolHistorySyncNotificationMessageProto")},{type:"protocol",subtype:"message_edit",generateProtobuf:c("WAWebGenerateProtocolMessageEditProto")},{type:"protocol",subtype:"sender_revoke",generateProtobuf:a},{type:"protocol",subtype:"share_phone_number",generateProtobuf:c("WAWebGenerateProtocolSharePhoneNumberMessageProto")},{type:"protocol",subtype:"status_group_mention_message",generateProtobuf:null},{type:"protocol",subtype:"status_mention_message",generateProtobuf:null},{type:"ptt",subtype:void 0,generateProtobuf:c("WAWebPttGenerateAudioOrPttMessageProto")},{type:"ptv",subtype:void 0,generateProtobuf:c("WAWebGenerateVideoMessageProto")},{type:"reaction",subtype:void 0,generateProtobuf:c("WAWebReactionsGenerateReactionMessageProto")},{type:"reaction_enc",subtype:void 0,generateProtobuf:c("WAWebGenerateReactionEncMessageProto")},{type:"request_phone_number",subtype:void 0,generateProtobuf:c("WAWebGenerateRequestPhoneNumberMessageProto")},{type:"revoked",subtype:"admin",generateProtobuf:a},{type:"revoked",subtype:"sender",generateProtobuf:a},{type:"rich_response",subtype:void 0,generateProtobuf:null},{type:"status_notification",subtype:"status_notification_message",generateProtobuf:null},{type:"sticker",subtype:void 0,generateProtobuf:c("WAWebStickersGenerateStickerMessageProto")},{type:"sticker-pack",subtype:void 0,generateProtobuf:c("WAWebGenerateStickerPackMessageProto")},{type:"template_button_reply",subtype:void 0,generateProtobuf:c("WAWebGenerateTemplateButtonReplyMessageProto")},{type:"unknown",subtype:"payment_action_request_declined",generateProtobuf:c("WAWebGenerateDeclinePaymentMessageProto")},{type:"unknown",subtype:"payment_transaction_request_cancelled",generateProtobuf:c("WAWebGenerateCancelPaymentMessageProto")},{type:"unknown",subtype:"phone",generateProtobuf:null},{type:"unknown",subtype:"phone_only_feature",generateProtobuf:null},{type:"unknown",subtype:void 0,generateProtobuf:null},{type:"vcard",subtype:void 0,generateProtobuf:c("WAWebGenerateVcardMessageProto")},{type:"video",subtype:void 0,generateProtobuf:c("WAWebGenerateVideoMessageProto")}];g["default"]=b}),98); __d("WAWebFetchSubscriptionsQuery_facebookRelayOperation",[],(function(a,b,c,d,e,f){e.exports="29753057770976041"}),null); __d("WAWebFetchSubscriptionsQuery.graphql",["WAWebFetchSubscriptionsQuery_facebookRelayOperation"],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"data"}],c=[{alias:null,args:[{kind:"Variable",name:"request",variableName:"data"}],concreteType:"XWAGetSubscriptionsResponse",kind:"LinkedField",name:"xwa_get_subscriptions",plural:!1,selections:[{alias:null,args:null,concreteType:"XWASubscriptionInfoType",kind:"LinkedField",name:"subscriptions",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"status",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"end_time",storageKey:null}],storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"WAWebFetchSubscriptionsQuery",selections:c,type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"WAWebFetchSubscriptionsQuery",selections:c},params:{id:b("WAWebFetchSubscriptionsQuery_facebookRelayOperation"),metadata:{},name:"WAWebFetchSubscriptionsQuery",operationKind:"query",text:null}}}();e.exports=a}),null); __d("WAWebFetchSubscriptions",["Promise","WACustomError","WALogger","WAPromiseTimeout","WAWebBizGatingUtils","WAWebFetchAdAccountToken","WAWebFetchSubscriptionsQuery.graphql","WAWebGraphQLServerError","WAWebNetworkStatus","WAWebRelayClient","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h,i;function j(){var a=babelHelpers.taggedTemplateLiteralLoose(['fetchSubscriptions: failed as "','"']);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["fetchSubscriptions: success"]);k=function(){return a};return a}var l={type:"error"},m=h!==void 0?h:h=b("WAWebFetchSubscriptionsQuery.graphql");function a(){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(d("WAWebBizGatingUtils").isGetSubscriptionsGraphqlMigrationEnabled()===!1)return(i||(i=b("Promise"))).resolve({type:"not-enabled"});var a=(yield o());if(a.type==="success"){d("WALogger").LOG(k());return a}a.type;d("WALogger").LOG(j(),a.type);return a});return n.apply(this,arguments)}function o(){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){try{var a=(yield d("WAPromiseTimeout").promiseTimeout(d("WAWebFetchAdAccountToken").fetchToken(),d("WAWebBizGatingUtils").adAccountTokenNoncePushWaitTimeoutSeconds()*1e3));if(a.type==="success"){var b=(yield q(a.token));b.type!=="success"?b.type==="auth-failure"?d("WAWebFetchAdAccountToken").markTokenAsInvalid():b.type:b.type;return b}a.type;return a}catch(a){return a instanceof d("WACustomError").TimeoutError?{type:"timeout"}:{type:"error"}}});return p.apply(this,arguments)}function q(a){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield c("WAWebNetworkStatus").waitIfOffline();a=(yield d("WAWebRelayClient").fetchQuery(m,{data:{platform:"UNKNOWN"}},{environmentType:"facebook",accessToken:a})["catch"](function(a){if(d("WAWebFetchAdAccountToken").hasGraphQLAuthError(a))return{type:"auth-failure"};if(a instanceof d("WAWebGraphQLServerError").GraphQLServerError)return{type:"graphql-error",error:a}}));a=a==null?void 0:(a=a.xwa_get_subscriptions)==null?void 0:a.subscriptions;return a==null?l:{type:"success",subscriptions:a.map(function(a){var b;return{expirationDate:(b=a.end_time)!=null?b:null,id:(b=a.id)!=null?b:"",status:s(a.status)}})}});return r.apply(this,arguments)}function s(a){if(a==null)return;a=a;switch(a){case"STATUS_ACTIVE":return"ACTIVE";case"STATUS_CANCELED":return"CANCELED";case"STATUS_DISCOUNT_TRIAL":return"DISCOUNT_TRIAL";case"STATUS_EXPIRED":return"EXPIRED";case"STATUS_FREE_TRIAL":return"FREE_TRIAL";case"STATUS_IN_GRACE_PERIOD":return"IN_GRACE_PERIOD";case"STATUS_ON_HOLD":return"ON_HOLD"}}g.fetchSubscriptions=a}),98); __d("WAWebSubscriptionJob",["WADeprecatedSendIq","WADeprecatedWapParser","WAWap","WAWapDeprecatedSmaxID","WAWebBackendErrors","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h=new(c("WADeprecatedWapParser"))("subscriptionsParser",function(a){a.assertTag("iq");a.assertFromServer();a=a.child("subscriptions");var b=[];a.forEachChildWithTag("subscription",function(a){var c=a.attrString("status"),d=a.maybeAttrInt("subscription_end_time");a=a.attrString("id");b.push({id:a,status:c,expirationDate:d})});return b});function a(){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a;a=(a=d("WAWap")).wap("iq",{xmlns:"fb:thrift_iq",id:a.generateId(),type:"get",smax_id:a.SMAX_ID(c("WAWapDeprecatedSmaxID").QuerySubscription),to:a.S_WHATSAPP_NET});a=(yield d("WADeprecatedSendIq").deprecatedSendIq(a,h));if(a.success)return a.result;throw new(d("WAWebBackendErrors").ServerStatusCodeError)(a.errorCode,a.errorText)});return i.apply(this,arguments)}g.querySubscriptions=a}),98); __d("WAWebUserPrefsSubscription",["$InternalEnum","WAWebUserPrefsStore"],(function(a,b,c,d,e,f,g){var h=b("$InternalEnum").Mirrored(["NextSubscriptionQuery","ShouldShowMetaVerifiedEntryPoint","NextFetchSubscriptionEntryPointsTime","MetaVerifiedEntryPointRedirectionUri"]);function a(){var a;return(a=parseInt(c("WAWebUserPrefsStore").getUser(h.NextSubscriptionQuery),10))!=null?a:0}function d(a){c("WAWebUserPrefsStore").setUser(h.NextSubscriptionQuery,a)}function e(){var a=c("WAWebUserPrefsStore").getUser(h.ShouldShowMetaVerifiedEntryPoint);return a==null?null:a===!0}function f(a){c("WAWebUserPrefsStore").setUser(h.ShouldShowMetaVerifiedEntryPoint,a)}function i(){var a;return(a=parseInt(c("WAWebUserPrefsStore").getUser(h.NextFetchSubscriptionEntryPointsTime),10))!=null?a:0}function j(a){c("WAWebUserPrefsStore").setUser(h.NextFetchSubscriptionEntryPointsTime,a)}function k(){var a=c("WAWebUserPrefsStore").getUser(h.MetaVerifiedEntryPointRedirectionUri);if(typeof a!=="string")return null;else if(a==="")return null;return a}function l(a){c("WAWebUserPrefsStore").setUser(h.MetaVerifiedEntryPointRedirectionUri,a)}g.getNextSubscriptionQuery=a;g.setNextSubscriptionQuery=d;g.getShouldShowMetaVerifiedEntryPoint=e;g.setShouldShowMetaVerifiedEntryPoint=f;g.getNextFetchSubscriptionEntryPointsTime=i;g.setNextFetchSubscriptionEntryPointsTime=j;g.getMetaVerifiedEntryPointRedirectionUri=k;g.setMetaVerifiedEntryPointRedirectionUri=l}),98); __d("WAWebSubscriptions",["WAExponentialBackoff","WALogger","WAPromiseDelays","WAWebBackendErrors","WAWebBizGatingUtils","WAWebFetchSubscriptions","WAWebPremiumAccessEngine","WAWebSchemaSubscription","WAWebSubscriptionCollection","WAWebSubscriptionJob","WAWebUserPrefsMeUser","WAWebUserPrefsSubscription","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["subscription sync: Subscriptions graphql fetch failed, falling back to IQ"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Subscriptions manager, fetch state"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["subscription sync: error PremiumAccessEngine ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["Subscriptions manager, got subscriptions: ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["subscription sync: error PremiumAccessEngine ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["Subscriptions manager, no subscriptions found"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["Subscriptions manager, sleeping for "," sec"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["Subscriptions manager, non recoverable error, exiting"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["Subscriptions manager, will retry in "," ms"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["Subscriptions manager pull failed, error: ",""]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["Subscriptions manager query failed, retriable error: ",", failCount ",""]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["Subscriptions manager, run"]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["Subscriptions manager found scheduled query, not due yet, sleeping for "," sec"]);t=function(){return a};return a}var u={minTimeout:1e3,maxTimeout:16e3,retries:5,signal:new AbortController().signal},v=86400*1e3;function w(){return x.apply(this,arguments)}function x(){x=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(!d("WAWebBizGatingUtils").subscriptionFetchEnabled())return;var a=d("WAWebUserPrefsSubscription").getNextSubscriptionQuery();if(a){a=a-Date.now();a>0&&(d("WALogger").DEV(t(),a/1e3),yield d("WAPromiseDelays").delayMs(a))}try{yield d("WAExponentialBackoff").exponentialBackoff(u,function(a,b){d("WALogger").DEV(s());return A()["catch"](function(c){if(c instanceof d("WAWebBackendErrors").ServerStatusCodeError)switch(c.statusCode){case 500:d("WALogger").WARN(r(),c.message,b);return a(c)}throw c})})}catch(a){d("WALogger").ERROR(q(),a).verbose().devConsole(a).sendLogs("Subscriptions manager run failed");if(a instanceof d("WAWebBackendErrors").ServerStatusCodeError&&a.statusCode===500)d("WALogger").DEV(p(),v);else{d("WALogger").DEV(o());return}}d("WALogger").DEV(n(),v/1e3);d("WAWebUserPrefsSubscription").setNextSubscriptionQuery(Date.now()+v);yield d("WAPromiseDelays").delayMs(v);d("WAWebUserPrefsMeUser").getMaybeMeUser()&&void w()});return x.apply(this,arguments)}function y(a){return z.apply(this,arguments)}function z(){z=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(d("WAWebBizGatingUtils").subscriptionFetchEnabled()){if(a.length===0){d("WALogger").DEV(m());d("WAWebSubscriptionCollection").SubscriptionCollection.reset();try{d("WAWebPremiumAccessEngine").update()}catch(a){d("WALogger").ERROR(l(),a).sendLogs("PremiumAccessEngine")}return}var b=["ACTIVE","FREE_TRIAL","IN_GRACE_PERIOD"];a=a.map(function(a){var c={id:a.id,isAutoRenewing:a.status==="ACTIVE",isDeactivated:!b.includes(a.status),expirationDate:a.expirationDate!==void 0?parseInt(a.expirationDate,10):void 0};a.status==="CANCELED"&&(c.expirationDate||0)>new Date().getTime()/1e3&&(c.isDeactivated=!1);return c});d("WALogger").DEV(k(),JSON.stringify(a));yield d("WAWebSchemaSubscription").getSubscriptionTable().bulkCreateOrMerge(a);d("WAWebSubscriptionCollection").SubscriptionCollection.add(a,{merge:!0});try{d("WAWebPremiumAccessEngine").update()}catch(a){d("WALogger").ERROR(j(),a).sendLogs("PremiumAccessEngine")}}});return z.apply(this,arguments)}function A(){return B.apply(this,arguments)}function B(){B=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(!d("WAWebUserPrefsMeUser").getMaybeMeUser())return;d("WALogger").DEV(i());if(d("WAWebBizGatingUtils").isGetSubscriptionsGraphqlMigrationEnabled()){var a=(yield d("WAWebFetchSubscriptions").fetchSubscriptions());if(a.type==="success"&&a.subscriptions!=null)void y(a.subscriptions);else return c()}else{d("WALogger").WARN(h()).sendLogs("PremiumAccessEngine",{sampling:.01});return c()}function c(){return e.apply(this,arguments)}function e(){e=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield d("WAWebSubscriptionJob").querySubscriptions());return y(a)});return e.apply(this,arguments)}});return B.apply(this,arguments)}g.runSubscriptionsManager=w;g.applySubscriptions=y}),98); __d("WAWebGenerateBotMetadata",["WAWebBotGating","WAWebLidMigrationUtils","WAWebProtobufsE2E.pb"],(function(a,b,c,d,e,f,g){"use strict";function a(a){var b=a.botPersonaId!=null?a.botPersonaId:void 0;a=h(a);return b==null&&a==null?void 0:{personaId:b,invokerJid:a,capabilityMetadata:i()}}function h(a){if(a.subtype==="bot_feedback"){var b;return(b=a.botTargetSenderJid)==null?void 0:b.toJid()}if(a.botTargetSenderJid!=null){return(b=d("WAWebLidMigrationUtils").toLid(a.botTargetSenderJid))==null?void 0:b.toJid()}return void 0}function i(){var a=[];d("WAWebBotGating").isRichStructuredResponseEnabled()&&(a.push(d("WAWebProtobufsE2E.pb").BotCapabilityMetadata$BotCapabilityType.RICH_RESPONSE_STRUCTURED_RESPONSE),d("WAWebBotGating").isRichResponseHeadingEnabled()&&a.push(d("WAWebProtobufsE2E.pb").BotCapabilityMetadata$BotCapabilityType.RICH_RESPONSE_HEADING),d("WAWebBotGating").isRichResponseSubHeadingEnabled()&&a.push(d("WAWebProtobufsE2E.pb").BotCapabilityMetadata$BotCapabilityType.RICH_RESPONSE_SUB_HEADING),d("WAWebBotGating").isRichResponseTableEnabled()&&a.push(d("WAWebProtobufsE2E.pb").BotCapabilityMetadata$BotCapabilityType.RICH_RESPONSE_TABLE));return a.length>0?{capabilities:a}:void 0}g.generateBotMetadata=a;g.generateBotCapabilityMetadata=i}),98); __d("WAWebE2EProtoGenerator",["WALogger","WATypeUtils","WAWebABPropsSaga","WAWebAssociationProtoUtils","WAWebBizCoexGatingUtils","WAWebBotGating","WAWebButtonsMessageProtoUtils","WAWebConversionTupleCollection","WAWebE2EProtoUtils","WAWebGenerateBotMetadata","WAWebLidMigrationUtils","WAWebLoggerDebugInfo","WAWebMessageAssociation.flow","WAWebMessageAssociationGatingUtils","WAWebMessagePluginGenerateProtobuf","WAWebMessagePluginGenerateReportingTokenContent","WAWebMessagingGatingUtils","WAWebMsgType","WAWebPollCreationUtils","WAWebProtobufsE2E.pb","WAWebURLUtils","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime","lodash"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["failed to generate associated message context info for "," of association "," due to error: ",""]);h=function(){return a};return a}function a(a,b,c){if(!b&&!c)return;a.messageContextInfo=babelHelpers["extends"]({},a.messageContextInfo,{deviceListMetadata:{senderKeyHash:b==null?void 0:b.keyHash,senderTimestamp:b==null?void 0:b.timestamp,senderKeyIndexes:b==null?void 0:b.keyIndexes,recipientKeyHash:c==null?void 0:c.keyHash,recipientTimestamp:c==null?void 0:c.timestamp,recipientKeyIndexes:c==null?void 0:c.keyIndexes,senderAccountType:d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()?b==null?void 0:b.senderAccountType:void 0,receiverAccountType:d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()?c==null?void 0:c.receiverAccountType:void 0},deviceListMetadataVersion:2})}function e(a){if(a.type!==d("WAWebMsgType").MSG_TYPE.PROTOCOL)return{};switch(a.subtype){case"app_state_sync_key_share":return{protocolMessage:{type:d("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.APP_STATE_SYNC_KEY_SHARE,appStateSyncKeyShare:a.appStateSyncKeyShare}};case"app_state_sync_key_request":return{protocolMessage:{type:d("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.APP_STATE_SYNC_KEY_REQUEST,appStateSyncKeyRequest:a.appStateSyncKeyRequest}};case"app_state_fatal_exception_notification":return{protocolMessage:{type:d("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.APP_STATE_FATAL_EXCEPTION_NOTIFICATION,appStateFatalExceptionNotification:a.appStateFatalExceptionNotification}};case"peer_data_operation_request_message":return{protocolMessage:{type:d("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.PEER_DATA_OPERATION_REQUEST_MESSAGE,peerDataOperationRequestMessage:a.peerDataOperationRequestMessage}};case"peer_data_operation_request_response_message":return{protocolMessage:{type:d("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.PEER_DATA_OPERATION_REQUEST_RESPONSE_MESSAGE,peerDataOperationRequestResponseMessage:a.peerDataOperationRequestResponseMessage}}}return{}}function f(a,b){var c=k(a);return j(c,b,(c=a.utm)!=null?c:void 0)}function i(a){return j(a)}function j(a,b,c){var e={};if(a.quotedMsg){var f=a.quotedMsg.mentionedJidList,g=a.quotedMsg.groupMentions,h=[],i=[];Array.isArray(f)&&f.length>0&&h.push.apply(h,f.map(d("WAWebE2EProtoUtils").encodeJid));Array.isArray(g)&&g.length>0&&i.push.apply(i,g.map(function(a){return{groupSubject:a.groupSubject,groupJid:d("WAWebE2EProtoUtils").encodeJid(a.groupJid)}}));f=h.length>0||i.length>0?{mentionedJid:h,groupMentions:i}:void 0;e.stanzaId=a.quotedStanzaID;e.remoteJid=d("WAWebE2EProtoUtils").encodeJid(a.quotedRemoteJid);e.participant=d("WAWebE2EProtoUtils").encodeJid(a.quotedParticipant);g={duration:a.quotedMsg.duration,directPath:a.quotedMsg.directPath,encFilehash:a.quotedMsg.encFilehash,filehash:a.quotedMsg.filehash,height:a.quotedMsg.height,mediaKey:a.quotedMsg.mediaKey,mediaKeyTimestamp:d("WATypeUtils").isNumber(a.quotedMsg.mediaKeyTimestamp)?a.quotedMsg.mediaKeyTimestamp:void 0,mimetype:a.quotedMsg.mimetype,url:a.quotedMsg.clientUrl||a.quotedMsg.deprecatedMms3Url,width:a.quotedMsg.width};e.quotedMessage=l(a.quotedMsg,g,f,void 0,"quoted")}else a.quotedRemoteJid&&a.quotedGroupSubject&&a.quotedParentGroupJid?(e.remoteJid=d("WAWebE2EProtoUtils").encodeJid(a.quotedRemoteJid),e.groupSubject=a.quotedGroupSubject,e.parentGroupJid=d("WAWebE2EProtoUtils").encodeJid(a.quotedParentGroupJid)):a.quotedRemoteJid&&(e.remoteJid=d("WAWebE2EProtoUtils").encodeJid(a.quotedRemoteJid));if(a.mentionedJidList&&a.mentionedJidList.length>0){h=a.mentionedJidList;e.mentionedJid=h.map(d("WAWebE2EProtoUtils").encodeJid)}a.groupMentions&&a.groupMentions.length>0&&(e.groupMentions=a.groupMentions.map(function(a){return{groupSubject:a.groupSubject,groupJid:d("WAWebE2EProtoUtils").encodeJid(a.groupJid)}}));a.conversionTuple&&Object.assign(e,a.conversionTuple);a.isForwarded&&(e.isForwarded=a.isForwarded);a.forwardingScore&&(e.forwardingScore=a.forwardingScore);a.groupId&&(e.groupId=a.groupId);a.groupIndex&&(e.groupIndex=a.groupIndex);a.groupSize&&(e.groupSize=a.groupSize);if(a.forwardedNewsletterMessageInfo){i=a.forwardedNewsletterMessageInfo;g=i.newsletterId;f=i.newsletterName;h=i.serverMessageId;e.forwardedNewsletterMessageInfo={newsletterJid:d("WAWebE2EProtoUtils").encodeJid(g),newsletterName:f,serverMessageId:h}}a.ephemeralDuration&&(e.expiration=a.ephemeralDuration);a.ephemeralSettingTimestamp&&(e.ephemeralSettingTimestamp=a.ephemeralSettingTimestamp);(a.disappearingModeInitiator||a.disappearingModeTrigger!=null&&a.to.isGroup())&&(e.disappearingMode=d("WAWebE2EProtoUtils").disappearingModeInitiatorToProto(a.disappearingModeInitiator,a.disappearingModeTrigger,a.disappearingModeInitiatedByMe));a.ctwaContext&&(e.externalAdReply={sourceUrl:a.ctwaContext.sourceUrl,sourceId:a.ctwaContext.sourceId,sourceType:a.ctwaContext.sourceType,body:a.ctwaContext.description,title:a.ctwaContext.title,thumbnailUrl:a.ctwaContext.thumbnailUrl,thumbnail:a.ctwaContext.thumbnail?d("WAWebE2EProtoUtils").encodeBytes(a.ctwaContext.thumbnail):void 0,mediaType:a.ctwaContext.mediaType,mediaUrl:a.ctwaContext.mediaUrl});c&&(e.utm={utmCampaign:c.campaign!=null?c.campaign:void 0,utmSource:c.source!=null?c.source:void 0});a.cannotBeRanked&&(e.featureEligibilities={cannotBeRanked:a.cannotBeRanked});a.limitSharing&&(e.limitSharingV2=a.limitSharing);return l(a,b,Object.keys(e).length>0?e:void 0)}function k(a){var b=a.id,d=a.toJSON();delete d.status;delete d.mimetype;delete d.height;delete d.width;delete d.recipients;delete d.chat;delete d.broadcast;delete d.ack;delete d.invis;delete d.filehash;delete d.recvFresh;delete d.mediaData;c("WAWebURLUtils").isHttp(a.clientUrl)||delete d.clientUrl;c("WAWebURLUtils").isHttp(a.deprecatedMms3Url)||delete d.deprecatedMms3Url;for(a in d)d[a]==null&&delete d[a];a=c("WAWebConversionTupleCollection").get(b.remote);a&&(d.conversionTuple=a.serialize());return d}function l(a,b,c,e,f){b===void 0&&(b={});c===void 0&&(c=void 0);b=m(a,b,c,e,f);try{e=d("WAWebAssociationProtoUtils").getValidatedOutgoingMessageAssociationContextInfo(a.associationType,a.parentMsgKey);e&&(b.messageContextInfo=babelHelpers["extends"]({},b.messageContextInfo,e))}catch(b){d("WALogger").ERROR(h(),a.type,a.associationType,b).sendLogs("getProtobufMessage: failed to generate associated message context info")}!(d("WAWebBotGating").isBotEnabled()&&((f=a.invokedBotWid)==null?void 0:f.isBot()))&&a.messageSecret&&(b.messageContextInfo=babelHelpers["extends"]({},b.messageContextInfo,{messageSecret:a.messageSecret}));if(d("WAWebBotGating").isBotEnabled()){e=d("WAWebGenerateBotMetadata").generateBotMetadata(a);b.messageContextInfo=babelHelpers["extends"]({},b.messageContextInfo,{botMetadata:e})}b=v(b,a,c);if(d("WAWebMessagingGatingUtils").isReportingTokenSendingEnabled()&&d("WAWebMessagePluginGenerateReportingTokenContent").isMsgTypeReportingTokenCompatible(a.type,a.subtype)){b.messageContextInfo=babelHelpers["extends"]({},b.messageContextInfo,{messageSecret:(e=(f=b.messageContextInfo)==null?void 0:f.messageSecret)!=null?e:a.messageSecret})}a.limitSharing&&(b.messageContextInfo=babelHelpers["extends"]({},b.messageContextInfo,{limitSharingV2:a.limitSharing}));return b}function m(a,b,c,e,f){b===void 0&&(b={});c===void 0&&(c=void 0);e=e?e:{};f=d("WAWebMessagePluginGenerateProtobuf").generateProtobuf({message:e,msgContext:f,contextInfo:c,json:a,mediaMetadata:b});if(f!=null)return f;switch(a.type){case d("WAWebMsgType").MSG_TYPE.AUTOMATED_GREETING_MESSAGE:return{conversation:a.body};case"template":a.subtype==="text"?(a.type="chat",a.title&&(a.body="*"+a.title+"*\n"+a.body)):a.type=a.subtype;return l(a,b,c,e)}return e}function n(a,b){return b.type==="ptt"?{viewOnceMessageV2Extension:{message:a}}:{viewOnceMessage:{message:a}}}function o(a){return{documentWithCaptionMessage:{message:a}}}function p(a){return{lottieStickerMessage:{message:a}}}function q(a){return{groupMentionedMessage:{message:a}}}function r(a){return{botInvokeMessage:{message:a}}}function s(a){return{pollCreationMessageV4:{message:a}}}function t(a){return{associatedChildMessage:{message:babelHelpers["extends"]({},a,{messageContextInfo:void 0})},messageContextInfo:a.messageContextInfo}}function u(a){var b=a.messageContextInfo;a=babelHelpers.objectWithoutPropertiesLoose(a,["messageContextInfo"]);return{pollCreationOptionImageMessage:{message:a},messageContextInfo:b}}function v(a,b,e){var f,g=a;b.pollContentType===d("WAWebPollCreationUtils").PollContentType.IMAGE&&(g=s(g));b.associationType!=null&&(b.associationType===d("WAWebMessageAssociation.flow").MessageAssociationType.MEDIA_POLL?g=u(g):d("WAWebMessageAssociationGatingUtils").isFutureproofAssociatedChildEnabled()&&(g=t(g)));b.isViewOnce&&(g=n(g,b));b.isDynamicReplyButtonsMsg===!0&&(g=d("WAWebButtonsMessageProtoUtils").createDynamicReplyButtonsMessage(g,b,e));b.type===d("WAWebMsgType").MSG_TYPE.DOCUMENT&&Boolean((f=g.documentMessage)==null?void 0:f.caption)&&(g=o(g));b.type===d("WAWebMsgType").MSG_TYPE.STICKER&&Boolean((f=g.stickerMessage)==null?void 0:f.isLottie)&&(g=p(g));(e==null?void 0:(f=e.groupMentions)==null?void 0:f.length)&&!g.editedMessage&&(g=q(g));if(!((e=b.invokedBotWid)==null?void 0:e.isFbidBot())&&(((f=b.invokedBotWid)==null?void 0:f.isPnBot())||b.subtype==="bot_request_welcome")){g=r(g);if(d("WAWebBotGating").isBotEnabled()){g.messageContextInfo=babelHelpers["extends"]({},g.messageContextInfo,{messageSecret:b.messageSecret,botMetadata:babelHelpers["extends"]({},((e=a.messageContextInfo)==null?void 0:e.botMetadata)||{},b.botTargetSenderJid instanceof c("WAWebWid")?{invokerJid:b.botTargetSenderJid.toJid()}:{})})}}return g}function w(a,b){a=c("lodash").cloneDeep(a);a.messageContextInfo=babelHelpers["extends"]({},a.messageContextInfo,{messageSecret:null});b&&(a.messageContextInfo=babelHelpers["extends"]({},a.messageContextInfo,{botMessageSecret:b}));b=(a==null?void 0:(b=a.botInvokeMessage)==null?void 0:(b=b.message)==null?void 0:(b=b.extendedTextMessage)==null?void 0:b.contextInfo)||(a==null?void 0:(b=a.extendedTextMessage)==null?void 0:b.contextInfo);if((b==null?void 0:b.quotedMessage)!=null){var e;b.participant!=null&&((e=d("WAWebWidFactory").createWid(b.participant))==null?void 0:e.isBot())!==!0&&(delete b.quotedMessage,delete b.stanzaId,delete b.remoteJid,delete b.participant)}e=a==null?void 0:(e=a.protocolMessage)==null?void 0:(b=e.botFeedbackMessage)==null?void 0:b.messageKey;e!=null&&e.remoteJid!=null&&delete e.remoteJid;b=(a==null?void 0:(b=a.protocolMessage)==null?void 0:b.type)===d("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.REVOKE?a==null?void 0:(e=a.protocolMessage)==null?void 0:e.key:null;b!=null&&b.remoteJid!=null&&delete b.remoteJid;return a}function x(a){var b,e=a;b=(b=a==null?void 0:(b=a.botInvokeMessage)==null?void 0:(b=b.message)==null?void 0:(b=b.extendedTextMessage)==null?void 0:(b=b.contextInfo)==null?void 0:b.participant)!=null?b:a==null?void 0:(b=a.extendedTextMessage)==null?void 0:(b=b.contextInfo)==null?void 0:b.participant;if(b!=null){b=d("WAWebWidFactory").createWid(b);if(!b.isBot()){e=c("lodash").cloneDeep(a);a=(a=(a=e)==null?void 0:(a=a.botInvokeMessage)==null?void 0:(a=a.message)==null?void 0:(a=a.extendedTextMessage)==null?void 0:a.contextInfo)!=null?a:(a=e)==null?void 0:(a=a.extendedTextMessage)==null?void 0:a.contextInfo;if(a!=null){b=d("WAWebLidMigrationUtils").toLid(b);a.participant=d("WAWebE2EProtoUtils").encodeJid(b)}}}return e}function y(a){var b,e=a;b=a==null?void 0:(b=a.protocolMessage)==null?void 0:(b=b.key)==null?void 0:b.participant;if(b!=null){b=d("WAWebWidFactory").createWid(b);if(!b.isBot()&&!b.isLid()){e=c("lodash").cloneDeep(a);a=(a=e)==null?void 0:(a=a.protocolMessage)==null?void 0:a.key;if(a!=null){b=d("WAWebLidMigrationUtils").toLid(b);a.participant=d("WAWebE2EProtoUtils").encodeJid(b)}}}return e}function z(a){var b=a,d=(a==null?void 0:a.protocolMessage)!=null;if(d){b=c("lodash").cloneDeep(a);(d=b.protocolMessage)==null?void 0:(a=d.key)==null?void 0:delete a.remoteJid;(d=b.protocolMessage)==null?void 0:(a=d.key)==null?void 0:delete a.participant}return b}function A(a){a=c("lodash").cloneDeep(a);a.messageContextInfo=babelHelpers["extends"]({},a.messageContextInfo,{capiCreatedGroup:!0});return a}function B(a){return C.apply(this,arguments)}function C(){C=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield d("WAWebLoggerDebugInfo").getDebugInfo({addLanguageFields:!0,convertFields:!0,addUserAgentDetails:!0}));b.sagaKey="saga_v1_enabled";b={version:1,debug_information:b};d("WAWebABPropsSaga").getIsSagaV1CarouselNoExposureEnabled()&&(b=babelHelpers["extends"]({citations_carousel:!0},b));a.messageContextInfo=babelHelpers["extends"]({},a.messageContextInfo,{supportPayload:JSON.stringify(b)})});return C.apply(this,arguments)}g.populateMessageContextInfo=a;g.createPeerMsgProtobuf=e;g.createMsgProtobuf=f;g.createAddonProtobuf=i;g.getProtobufMessage=l;g.updateBotInvokeMsgProtoCopyForCapi=w;g.updateFbidBotProtobuf=x;g.updateFbidBotInvokeProtobuf=y;g.updateBotProtobuf=z;g.updateGroupMsgProtoWithCapiFlag=A;g.addDebugInfoSupportPayload=B}),98); __d("WAWebApiHistorySyncNotification",["WALogger","WAWebHistorySyncNotificationUtils","WAWebHistorySyncProgress","WAWebProtobufsHistorySync.pb","WAWebSchemaHistorySyncNotification","WAWebSyncGatingUtils","WAWebUserPrefsHistorySync","WAWebUserPrefsTypes","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] return null for next history sync chunk due to next=null"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] fetched next history sync chunk for processing, ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] return null for next history sync chunk due to inFlightChunk.size=",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] isPreviousChunkProcessed returned false for ","_",", last processed: "," "]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] isPreviousChunkProcessed: next chunk already processed ","_",", last processed: chunkOrder:"," progress:",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] check if previous recent sync is processed with optimized logic"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] isPreviousChunkProcessed returned false for ","_",", last processed: "," "]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] isPreviousChunkProcessed: next chunk already processed ","_",", last processed: "," "]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] add history sync notification, ",""]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] updateCurrentlyProcessed failed with error ",""]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] remove history sync notification from db with ","_",""]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] getNextUnProcessedNotification chunkOrder is null, ",""]);s=function(){return a};return a}var t=new Set(),u={};function v(a,b,c){return w.apply(this,arguments)}function w(){w=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){if(a===d("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.PUSH_NAME)return!0;if([d("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.FULL,d("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.RECENT].includes(a)&&b===1||d("WAWebSyncGatingUtils").isHistorySyncOnDemandEnabled()&&a===d("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.ON_DEMAND&&b===0){if(a===d("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.RECENT){var e=(yield d("WAWebUserPrefsHistorySync").getInitialHistorySyncComplete());return e===!0}e=(yield d("WAWebUserPrefsHistorySync").getHistorySyncStatus());return!!(e==null?void 0:e.recentCompleted)}e=(yield d("WAWebUserPrefsHistorySync").getLastHistorySyncedChunk());if(e==null)return!1;var f=e.split("_"),g=f[0];f=f[1];if(g===""+a&&f===""+(b-1))return!0;else if(g===""+a&&f===""+b){d("WALogger").LOG(o(),a,b,e).tags("history-sync");yield A(c,a,b);return!1}d("WALogger").LOG(n(),a,b,e).tags("history-sync");return!1});return w.apply(this,arguments)}function x(a,b,c){return y.apply(this,arguments)}function y(){y=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){d("WALogger").LOG(m());if(b===1){var e=(yield d("WAWebUserPrefsHistorySync").getInitialHistorySyncComplete());return e===!0}e=(yield d("WAWebUserPrefsHistorySync").getLastHistoryRecentSyncedChunk());if(e==null)return!1;var f=e.chunkOrder;if(f===b-1)return!0;else if(f===b){d("WALogger").LOG(l(),a,b,e.chunkOrder,e.progress).tags("history-sync");yield A(c,a,b);return!1}d("WALogger").LOG(k(),a,b,f).tags("history-sync");return!1});return y.apply(this,arguments)}function z(a){return d("WAWebSchemaHistorySyncNotification").getHistorySyncNotificationTable().equals(["processed"],0,{shouldDecrypt:!1}).then(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b;a=a.filter(function(a){return!t.has(a.msgKey)&&!a.reuploadPending}).sort(function(a,b){if(a.syncType!==b.syncType)return b.syncType-a.syncType;return a.chunkOrder!=null&&b.chunkOrder!=null?a.chunkOrder-b.chunkOrder:0});a=a.length>0?a[0]:void 0;b=(b=a)==null?void 0:b.chunkOrder;if(b==null){var c;d("WALogger").LOG(s(),(c=a)==null?void 0:c.msgKey).tags("history-sync");return void 0}if(a){a.syncType===d("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.RECENT&&d("WAWebSyncGatingUtils").isRecentSyncNextChunkFetchOptimizationEnabled()?c=(yield x(a.syncType,b,a.msgKey)):c=(yield v(a.syncType,b,a.msgKey));d("WAWebHistorySyncProgress").handleChunkProgress(c);if(!c)return void 0;a=(yield d("WAWebSchemaHistorySyncNotification").getHistorySyncNotificationTable().postflightDecryptSingleRecord(a))}return a});return function(b){return a.apply(this,arguments)}}())}function A(a,b,c){d("WALogger").LOG(r(),b,c);t["delete"](a);return d("WAWebSchemaHistorySyncNotification").getHistorySyncNotificationTable().remove(a)["catch"](function(a){d("WALogger").LOG(q(),a).tags("history-sync")})}function a(a){t["delete"](a);return d("WAWebSchemaHistorySyncNotification").getHistorySyncNotificationTable().merge(a,{reuploadPending:!0})}function c(a){t["delete"](a)}function B(a){var b=d("WAWebHistorySyncNotificationUtils").getHistorySyncBasicChunkInfoString(a.syncType,a.chunkOrder,a.isReupload);d("WALogger").DEV(p(),b);b=a.downloadOptions.mediaKey;var c=a.downloadOptions.directPath,e=a.downloadOptions.filehash,f=a.downloadOptions.encFilehash;a.downloadOptions.mediaKey="";a.downloadOptions.directPath="";a.downloadOptions.filehash="";a.downloadOptions.encFilehash="";b=babelHelpers["extends"]({},a,{chunkEncryptionKey:b,directPath:c,filehash:e,encFilehash:f});a.processed=0;return d("WAWebSchemaHistorySyncNotification").getHistorySyncNotificationTable().createOrMerge(a.msgKey,b)}function e(a,b){return C.apply(this,arguments)}function C(){C=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b===void 0&&(b=!1),yield B(a).then(function(){void d("WAWebUserPrefsHistorySync").setRecentSyncSingleChunkStatus(a.syncType,d("WAWebUserPrefsTypes").HistorySyncSingleChunkStatusType.NOTIFICATION_STORED,a.chunkOrder)}),b&&t.add(a.msgKey)});return C.apply(this,arguments)}function f(){return D.apply(this,arguments)}function D(){D=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(t.size>0){d("WALogger").LOG(j(),t.size);return null}var a=(yield z());if(a){var b=d("WAWebHistorySyncNotificationUtils").getHistorySyncBasicChunkInfoString(a==null?void 0:a.syncType,a==null?void 0:a.chunkOrder,a==null?void 0:a.isReupload);d("WALogger").DEV(i(),b);a.downloadOptions.mediaKey=a.chunkEncryptionKey;delete a.chunkEncryptionKey;a.downloadOptions.directPath=a.directPath||a.downloadOptions.directPath;delete a.directPath;a.downloadOptions.filehash=a.downloadOptions.filehash===""?a.filehash:a.downloadOptions.filehash;delete a.filehash;a.downloadOptions.encFilehash=a.encFilehash;delete a.encFilehash;t.add(a.msgKey)}else d("WALogger").LOG(h());return a});return D.apply(this,arguments)}g.inFlightChunk=t;g.recentSyncChunkHandlingTriedCount=u;g.updateCurrentlyProcessed=A;g.markChunkForReuploadPending=a;g.removeLocalFailureFromInFlightChunk=c;g.enqueueNotification=e;g.fetchNextHistorySyncChunkForProcessing=f}),98); __d("WAWebSettingsGetters",["WAWebGetters","WAWebGettersCaches"],(function(a,b,c,d,e,f,g){a=d("WAWebGetters").createGetterFactories({createCache:d("WAWebGettersCaches").createSettingsCache});b=a.field;c=a.computed;e=a.clearCacheFor;f=e;d=b("archive");a=c(function(a){a=a[0];return!a.enabled?!1:!a.classic},[d]);g.clearSettingsGetterCacheFor=f;g.getArchive=d;g.getShowArchiveV2=a}),98); __d("WAWebSettingsModel",["WAWebBaseModel","WAWebSettingsGetters"],(function(a,b,c,d,e,f,g){var h={classic:!1,enabled:!1};a={duration:0,settingTimestamp:0};b=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.archive=d("WAWebBaseModel").prop(),c.disappearingMode=d("WAWebBaseModel").prop(),b)||babelHelpers.assertThisInitialized(c)}var c=b.prototype;c["delete"]=function(){this.set({archive:h,disappearingMode:h}),a.prototype["delete"].call(this),d("WAWebSettingsGetters").clearSettingsGetterCacheFor(this)};return b}(d("WAWebBaseModel").BaseModel);b.Proxy="settings";c=d("WAWebBaseModel").defineModel(b);e=new c({id:"default_settings_id",archive:h,disappearingMode:a});g["default"]=e}),98); __d("WAWebInitFromStorage",["Promise","WALogger","WAWebAgentCollection","WAWebApiHydrateWidsUtil","WAWebBizGatingUtils","WAWebBlocklistCollection","WAWebCartCollection","WAWebChatAssignmentCollection","WAWebCommunityActivityCollection","WAWebConnModel","WAWebDBLabelAssociationDatabaseApi","WAWebFavoriteStickerCollection","WAWebGroupMetadataCollection","WAWebLabelCollection","WAWebListsGatingUtils","WAWebLogoutReasonConstants","WAWebMarketingMessagesUserFeedbackGatingUtils","WAWebMobilePlatforms","WAWebModelStorageUtils","WAWebNonMessageDataRequestMediaHandlingUtils","WAWebOptOutListCollection","WAWebQuickReplyCollection","WAWebRecentStickerCollectionMd","WAWebSchemaAgent","WAWebSchemaBlocklist","WAWebSchemaCart","WAWebSchemaChatAssignment","WAWebSchemaFavoriteStickers","WAWebSchemaLabel","WAWebSchemaNonMessageDataRequest","WAWebSchemaOptOutList","WAWebSchemaQuickReply","WAWebSchemaRecentStickers","WAWebSchemaStickerDownload","WAWebSchemaSubscription","WAWebSchemaUnjoinedSubgroupMetadata","WAWebSettingsGetters","WAWebSettingsModel","WAWebSocketModel","WAWebStickerDownloadCollection","WAWebSubscriptionCollection","WAWebUnjoinedSubgroupMetadataCollection","WAWebUserPrefsGeneral","WAWebUserPrefsMultiDevice","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[init-from-storage]: restoreUnjoinedSubgroups: complete restoring unjoined subgroups"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[init-from-storage]: restoreUnjoinedSubgroups: start restoring unjoined subgroups"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[InitFromStorage] important metadata loaded"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["platform not found in UserPrefs."]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[InitFromStorage] will attempt to initialize metadata from storage"]);m=function(){return a};return a}function a(){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){d("WALogger").LOG(m());d("WAWebConnModel").Conn.trigger("me_ready");d("WAWebConnModel").Conn.meReadyTriggered=!0;var a=d("WAWebUserPrefsGeneral").getPushname(),b=(yield d("WAWebUserPrefsGeneral").getLastMobilePlatform());if(b==null){d("WALogger").ERROR(l());return d("WAWebSocketModel").Socket.logout(d("WAWebLogoutReasonConstants").LogoutReason.UnknownCompanion)}yield d("WAWebMobilePlatforms").setMobilePlatform(b,!1);d("WAWebConnModel").Conn.pushname=a;d("WAWebConnModel").Conn.platform=b;d("WALogger").LOG(k())});return n.apply(this,arguments)}function e(){return d("WAWebSchemaBlocklist").getBlocklistTable().all().then(function(a){d("WAWebBlocklistCollection").BlocklistCollection.initializeFromCache(a.map(d("WAWebApiHydrateWidsUtil").hydrateWids))})}function f(){return!d("WAWebMarketingMessagesUserFeedbackGatingUtils").isMMOptOutEnabled()?(h||(h=b("Promise"))).resolve():d("WAWebSchemaOptOutList").getOptOutListTable().all().then(function(a){d("WAWebOptOutListCollection").OptOutListCollection.initializeFromCache(a.map(d("WAWebApiHydrateWidsUtil").hydrateWids))})}function o(){return d("WAWebBizGatingUtils").canDisplayLabel()||d("WAWebListsGatingUtils").isListsEnabled()?d("WAWebSchemaLabel").getLabelTable().all().then(function(a){d("WAWebLabelCollection").LabelCollection.initializeFromCache(a)}):(h||(h=b("Promise"))).resolve()}function p(){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(d("WAWebBizGatingUtils").canDisplayLabel()||d("WAWebListsGatingUtils").isListsEnabled()){var a=[];yield d("WAWebModelStorageUtils").getStorage().lock(["label","label-association","chat"],function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){b=b[0];b=(yield b.all());b=b.map(function(a){return a.id});b=(yield d("WAWebDBLabelAssociationDatabaseApi").queryLabelAssociationsForLabelIds(b));a.push.apply(a,b)});return function(a){return c.apply(this,arguments)}}());a.length>0&&d("WAWebLabelCollection").LabelCollection.initializeAssociationsFromCache(a)}return(h||(h=b("Promise"))).resolve()});return q.apply(this,arguments)}function r(){return d("WAWebBizGatingUtils").canSendQuickReply()?d("WAWebSchemaQuickReply").getQuickReplyTable().all().then(function(a){d("WAWebQuickReplyCollection").QuickReplyCollection.initializeFromCache(a)}):(h||(h=b("Promise"))).resolve()}function s(){return d("WAWebSchemaRecentStickers").getRecentStickersTable().all().then(function(a){return d("WAWebRecentStickerCollectionMd").RecentStickerCollectionMd.initializeFromCache(a)})}function t(){return d("WAWebSchemaFavoriteStickers").getFavoriteStickersTable().all().then(function(a){return d("WAWebFavoriteStickerCollection").FavoriteStickerCollection.initializeFromCache(a)})}function u(){return v.apply(this,arguments)}function v(){v=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield d("WAWebUserPrefsMultiDevice").getArchiveV2EnabledSetting()),b=(yield d("WAWebUserPrefsMultiDevice").getUnarchiveChatsSetting());a!=null&&(c("WAWebSettingsModel").archive=babelHelpers["extends"]({},d("WAWebSettingsGetters").getArchive(c("WAWebSettingsModel")),{enabled:a}));b!=null&&(c("WAWebSettingsModel").archive=babelHelpers["extends"]({},d("WAWebSettingsGetters").getArchive(c("WAWebSettingsModel")),{classic:b}))});return v.apply(this,arguments)}function w(){return d("WAWebSchemaCart").getCartTable().all().then(function(a){d("WAWebCartCollection").CartCollection.initializeFromCache(a.map(d("WAWebApiHydrateWidsUtil").hydrateWids))})}function x(){return y.apply(this,arguments)}function y(){y=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(d("WAWebBizGatingUtils").isMultiDeviceMessageAttributionEnabled()){var a=(yield d("WAWebSchemaAgent").getAgentTable().all());d("WAWebAgentCollection").AgentCollection.initializeFromCache(a)}});return y.apply(this,arguments)}function z(){return A.apply(this,arguments)}function A(){A=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield d("WAWebSchemaSubscription").getSubscriptionTable().all());d("WAWebSubscriptionCollection").SubscriptionCollection.initializeFromCache(a)});return A.apply(this,arguments)}function B(){return C.apply(this,arguments)}function C(){C=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(d("WAWebBizGatingUtils").chatAssignmentEnabled()){var a=(yield d("WAWebSchemaChatAssignment").getChatAssignmentTable().all());d("WAWebChatAssignmentCollection").ChatAssignmentCollection.initializeFromCache(a)}});return C.apply(this,arguments)}function D(){return E.apply(this,arguments)}function E(){E=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){d("WALogger").DEV(j());try{var a=(yield d("WAWebSchemaUnjoinedSubgroupMetadata").getUnjoinedSubgroupMetadataTable().all());a.forEach(function(a){c("WAWebUnjoinedSubgroupMetadataCollection").add({id:d("WAWebWidFactory").createWid(a.id),subject:a.subject,subjectTime:a.subjectTime,defaultSubgroup:a.defaultSubgroup,parentGroupId:d("WAWebWidFactory").createWid(a.parentGroup),size:a.size,generalSubgroup:a.generalSubgroup,membershipApprovalMode:a.membershipApprovalMode,membershipApprovalRequest:a.membershipApprovalRequest,hiddenSubgroup:a.hiddenSubgroup},{merge:!0})})}finally{d("WALogger").DEV(i())}});return E.apply(this,arguments)}function F(){var a=c("WAWebGroupMetadataCollection").filter(function(a){return a.isParentGroup});a=a.map(function(a){return c("WAWebCommunityActivityCollection").syncActivityFor(a.id)});return(h||(h=b("Promise"))).all(a)}function G(){return d("WAWebSchemaNonMessageDataRequest").getNonMessageDataRequestTable().all().then(function(a){d("WAWebNonMessageDataRequestMediaHandlingUtils").initializeMediaUploadResultFromStorage(a)})}function H(){return d("WAWebSchemaStickerDownload").getStickerDownloadTable().all().then(function(a){return d("WAWebStickerDownloadCollection").StickerDownloadCollection.initializeFromCache(a)})}g.restoreImportantMetaData=a;g.restoreBlocklist=e;g.restoreOptOutList=f;g.restoreLabels=o;g.restoreLabelAssociations=p;g.restoreQuickReplies=r;g.restoreRecentStickers=s;g.restoreFavoriteStickers=t;g.restoreArchiveV2Settings=u;g.restoreCarts=w;g.restoreAgents=x;g.restoreSubscriptions=z;g.restoreChatAssignments=B;g.restoreUnjoinedSubgroups=D;g.restoreCommunityActivity=F;g.restoreMediaUploadResult=G;g.restoreStickerDownload=H}),98); __d("WAWebGetPendingMutation",["WAWebRunInTransaction"],(function(a,b,c,d,e,f,g){"use strict";function a(a){return d("WAWebRunInTransaction").runInTransaction({PendingMutationStore:!0},function(b){b=b.PendingMutationStore;return b.getByCollection(a)})}function b(){return d("WAWebRunInTransaction").runInTransaction({PendingMutationStore:!0},function(a){a=a.PendingMutationStore;return a.getAll()})}function c(a){return d("WAWebRunInTransaction").runInTransaction({PendingMutationStore:!0},function(b){b=b.PendingMutationStore;return b.bulkCreate(a)})}g.getSyncPendingMutationsByCollectionInTransaction=a;g.getAllSyncPendingMutationsInTransaction=b;g.bulkCreateSyncPendingMutationsInTransaction=c}),98); __d("WAWebSentinel",["WASyncdConst","WAWebGetPendingMutation","WAWebSentinelMutationSync","WAWebSyncd","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";function a(){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield c("WAWebSentinelMutationSync").getSentinelMutations());yield d("WAWebGetPendingMutation").bulkCreateSyncPendingMutationsInTransaction(a);return d("WAWebSyncd").markCollectionsForSync(Array.from(d("WASyncdConst").CollectionName.members()))});return h.apply(this,arguments)}g["default"]=a}),98); __d("WAWebGetCollectionVersion",["WACryptoLtHash","WAWebRunInTransaction"],(function(a,b,c,d,e,f,g){"use strict";function a(a){return d("WAWebRunInTransaction").runInTransaction({CollectionVersionStore:!0},function(b){b=b.CollectionVersionStore;return b.get(a)})}function h(a,b){a=a.CollectionVersionStore;return a.get(b).then(function(a){return(a=a==null?void 0:a.ltHash)!=null?a:new ArrayBuffer(d("WACryptoLtHash").KEY_LENGTH_BYTES)})}function b(a){return d("WAWebRunInTransaction").runInTransaction({CollectionVersionStore:!0},function(b){b=b.CollectionVersionStore;return h({CollectionVersionStore:b},a)})}function c(a){return d("WAWebRunInTransaction").runInTransaction({CollectionVersionStore:!0},function(b){b=b.CollectionVersionStore;return b.bulkGet(a)})}function e(){return d("WAWebRunInTransaction").runInTransaction({CollectionVersionStore:!0},function(a){a=a.CollectionVersionStore;return a.getAll()})}function f(a,b,c){return d("WAWebRunInTransaction").runInTransaction({CollectionVersionStore:!0},function(d){d=d.CollectionVersionStore;return d.update(a,{version:b,ltHash:c})})}function i(a){return d("WAWebRunInTransaction").runInTransaction({CollectionVersionStore:!0},function(b){b=b.CollectionVersionStore;return b.bulkUpdate(a)})}function j(a){return d("WAWebRunInTransaction").runInTransaction({CollectionVersionStore:!0},function(b){b=b.CollectionVersionStore;return b.get(a).then(function(a){return a==null?void 0:a.isCollectionInMacMismatchFatal})})}function k(a){return d("WAWebRunInTransaction").runInTransaction({CollectionVersionStore:!0},function(b){b=b.CollectionVersionStore;return b.update(a,{isCollectionInMacMismatchFatal:!0})})}g.getCollectionVersionInTransaction=a;g.getCollectionVersionLtHashInTransaction=b;g.bulkGetCollectionVersionsInTransaction=c;g.getAllCollectionVersionsInTransaction=e;g.updateCollectionVersionAndLtHashInTransaction=f;g.bulkUpdateCollectionVersionInTransaction=i;g.getIsCollectionInMacMismatchFatalInTransaction=j;g.updateIsCollectionInMacMismatchFatalInTransaction=k}),98); __d("WAWebGetSyncAction",["WAWebRunInTransaction"],(function(a,b,c,d,e,f,g){"use strict";function a(){return d("WAWebRunInTransaction").runInTransaction({SyncActionStore:!0},function(a){a=a.SyncActionStore;return a.count()})}function b(a){return d("WAWebRunInTransaction").runInTransaction({SyncActionStore:!0},function(b){b=b.SyncActionStore;return b.get(a)})}function c(a){return d("WAWebRunInTransaction").runInTransaction({SyncActionStore:!0},function(b){b=b.SyncActionStore;return b.getByCollections(a)})}function e(a){return d("WAWebRunInTransaction").runInTransaction({SyncActionStore:!0},function(b){b=b.SyncActionStore;return b.getByIndexMacs(a)})}function f(a){return d("WAWebRunInTransaction").runInTransaction({SyncActionStore:!0},function(b){b=b.SyncActionStore;return b.getByActionStates(a)})}function h(a){return d("WAWebRunInTransaction").runInTransaction({SyncActionStore:!0},function(b){b=b.SyncActionStore;return b.getByModelInfos(a)})}function i(){return d("WAWebRunInTransaction").runInTransaction({SyncActionStore:!0},function(a){a=a.SyncActionStore;return a.getAll()})}g.countSyncActionsInTransaction=a;g.getSyncActionInTransaction=b;g.getSyncActionsByCollectionsInTransaction=c;g.getSyncActionsByIndexMacsInTransaction=e;g.getSyncActionsByActionStatesInTransaction=f;g.getSyncActionsByModelInfosInTransaction=h;g.getAllSyncActions=i}),98); __d("WAWebSyncdCollectionsStateMachine",["WALogger","WASyncdConst","WATimeUtils","WAWebGetCollectionVersion","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Collection "," is in finite retry state with no failure start time"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: ",": "," ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: state machine persistToDb. states:"]);j=function(){return a};return a}a=function(){function a(){}a.loadStatesFromDb=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=this,b=(yield d("WAWebGetCollectionVersion").getAllCollectionVersionsInTransaction());b.forEach(function(b){return a.collectionStates.set(b.collection,{collection:b.collection,state:b.state,finiteFailureStartTime:b.finiteFailureStartTime})})});function c(){return a.apply(this,arguments)}return c}();a.persistToDb=function(){var a=[];this.collectionStates.forEach(function(b){return a.push(b)});d("WALogger").LOG(j());a.forEach(function(a){var b=a.finiteFailureStartTime==null?"":"(failure start: "+a.finiteFailureStartTime+")";d("WALogger").LOG(i(),a.collection,a.state,b)});return d("WAWebGetCollectionVersion").bulkUpdateCollectionVersionInTransaction(a)};a.clean=function(){this.collectionStates=new Map()};a.getCollectionState=function(a){var b=this.collectionStates.get(a);if(b)return b.state;this.moveCollectionsToUpToDate([a]);return d("WASyncdConst").CollectionSyncState.UpToDate};a.getCollectionsInStateDirty=function(){var a=[];this.collectionStates.forEach(function(b){b.state===d("WASyncdConst").CollectionSyncState.Dirty&&a.push(b.collection)});return a};a.getCollectionsInStateRetry=function(){var a=[];this.collectionStates.forEach(function(b){b.state===d("WASyncdConst").CollectionSyncState.FailingFiniteRetry&&a.push(b.collection)});return a};a.getCollectionsInStateFatal=function(){var a=[];this.collectionStates.forEach(function(b){b.state===d("WASyncdConst").CollectionSyncState.Fatal&&a.push(b.collection)});return a};a.getCollectionsInStateBlocked=function(){var a=[];this.collectionStates.forEach(function(b){b.state===d("WASyncdConst").CollectionSyncState.Blocked&&a.push(b.collection)});return a};a.moveCollectionsToUpToDate=function(a){var b=this;a.forEach(function(a){return b.collectionStates.set(a,{collection:a,state:d("WASyncdConst").CollectionSyncState.UpToDate,finiteFailureStartTime:void 0})})};a.moveCollectionsToDirty=function(a){var b=this;a.forEach(function(a){return b.collectionStates.set(a,{collection:a,state:d("WASyncdConst").CollectionSyncState.Dirty,finiteFailureStartTime:(a=b.collectionStates.get(a))==null?void 0:a.finiteFailureStartTime})})};a.moveCollectionsToFiniteRetry=function(a){var b=this;a.forEach(function(a){return b.collectionStates.set(a,{collection:a,state:d("WASyncdConst").CollectionSyncState.FailingFiniteRetry,finiteFailureStartTime:(a=(a=b.collectionStates.get(a))==null?void 0:a.finiteFailureStartTime)!=null?a:d("WATimeUtils").unixTimeMs()})})};a.moveCollectionsToFatal=function(a){var b=this;a.forEach(function(a){return b.collectionStates.set(a,{collection:a,state:d("WASyncdConst").CollectionSyncState.Fatal})})};a.moveCollectionsToBlocked=function(a){var b=this;a.forEach(function(a){return b.collectionStates.set(a,{collection:a,state:d("WASyncdConst").CollectionSyncState.Blocked,finiteFailureStartTime:(a=b.collectionStates.get(a))==null?void 0:a.finiteFailureStartTime})})};a.getExpiredCollections=function(){var a=[];this.collectionStates.forEach(function(b){if(b.state===d("WASyncdConst").CollectionSyncState.FailingFiniteRetry){var c;b.finiteFailureStartTime==null?(c=Infinity,d("WALogger").WARN(h(),b.collection)):c=b.finiteFailureStartTime;c=c+d("WASyncdConst").FINITE_FAILURE_EXPIRY_DURATION;c<d("WATimeUtils").unixTimeMs()&&a.push(b.collection)}});return a};a.getCollectionMinFailureTime=function(){var a=Array.from(this.collectionStates.values()).filter(function(a){return a.state===d("WASyncdConst").CollectionSyncState.FailingFiniteRetry}).map(function(a){return a.finiteFailureStartTime}).filter(Boolean);return a.length===0?null:Math.min.apply(Math,a)};return a}();a.collectionStates=new Map();g["default"]=a}),98); __d("WAWebSyncdDisabled",["WAWebRuntimeEnvironmentUtils"],(function(a,b,c,d,e,f,g){function a(){return d("WAWebRuntimeEnvironmentUtils").isWorker()?!0:!1}g.isSyncdDisabled=a}),98); __d("WAWebSyncdKeyCache",["WABase64","WASyncdKeyTypes","WAWebGetSyncKey","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";var h=new Map();function a(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=d("WABase64").encodeB64(d("WASyncdKeyTypes").fromSyncKeyId(a)),c=h.get(b);if(c)return c.keyData;c=(yield d("WAWebGetSyncKey").getSyncKeyInTransaction_DO_NOT_USE(a));c&&h.set(b,c);return(a=c)==null?void 0:a.keyData});return i.apply(this,arguments)}function c(){h=new Map()}g.getKeyData=a;g.clearSyncKeysCache=c}),98); __d("WAWebSyncdMetricCriticalBootstrapStage",["$InternalEnum","WALogger","WAPREList","WAPREMetrics","WASyncAction.pb","decodeProtobuf"],(function(a,b,c,d,e,f,g){"use strict";function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: unknown SyncdDecryptMutationsType for DecryptMutations"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: missing decryptedMutationMessageRangeCountArray for DecryptMutations"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: missing totalAdditionalMessagesCount for DecryptMutations"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: missing count for DecryptMutations"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: missing type for DecryptMutations"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: unknown bootstrap stage: "," for critical bootstrap stage"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: missing bootstrap stage for critical bootstrap stage"]);n=function(){return a};return a}var o=b("$InternalEnum").Mirrored(["ABOUT_TO_APPLY_MUTATIONS","APPLIED_MUTATIONS","MUTATIONS_DECRYPTED","REQUEST_BUILT","RESPONSE_RECEIVED","RESPONSE_PARSED_VALID","ENTERED_RETRY_MODE","MISSING_KEYS_RECEIVED"]),p=b("$InternalEnum").Mirrored(["PATCH_MUTATIONS","SNAPSHOT_MUTATIONS"]);function q(a){d("WAPREMetrics").startMetric(d("WAPREList").PRE_METRIC.SYNCD_CRITICAL_BOOTSTRAP_STAGE).endSuccess(r({type:a}))}function a(a,b){q(o.MUTATIONS_DECRYPTED),d("WAPREMetrics").startMetric(d("WAPREList").PRE_METRIC.SYNCD_DECRYPT_MUTATIONS).endSuccess(s({type:a,mutations:b}))}function r(a){return{string:{criticalBootstrapStage:a.type}}}function s(a){var b=a.type;a=a.mutations;var c,e=0,f=[];a.forEach(function(a){a=a.binarySyncData;a=d("decodeProtobuf").decodeProtobuf(d("WASyncAction.pb").SyncActionDataSpec,a);a=a.value;if(a==null)return;a.archiveChatAction?c=a.archiveChatAction.messageRange:a.markChatAsReadAction?c=a.markChatAsReadAction.messageRange:a.clearChatAction?c=a.clearChatAction.messageRange:a.deleteChatAction&&(c=a.deleteChatAction.messageRange);c!=null&&(e+=c.messages.length,f.push(c.messages.length))});return{string:{mutationType:b},"int":{count:a.length,totalAdditionalMessagesCount:e},int_array:{messageRangeLengths:f}}}function c(a){a=a==null?void 0:(a=a.string)==null?void 0:a.criticalBootstrapStage;if(a==null){d("WALogger").ERROR(n());return null}var b=o.cast(a);if(b==null){d("WALogger").ERROR(m(),a);return null}return{type:b}}function e(a){var b,c,e;b=a==null?void 0:(b=a.string)==null?void 0:b.mutationType;c=a==null?void 0:(c=a["int"])==null?void 0:c.count;e=a==null?void 0:(e=a["int"])==null?void 0:e.totalAdditionalMessagesCount;a=a==null?void 0:(a=a.int_array)==null?void 0:a.messageRangeLengths;if(b==null){d("WALogger").ERROR(l());return null}if(c==null){d("WALogger").ERROR(k());return null}if(e==null){d("WALogger").ERROR(j());return null}if(a==null){d("WALogger").ERROR(i());return null}b=p.cast(b);if(b==null){d("WALogger").ERROR(h());return null}return{type:b,count:c,totalAdditionalMessagesCount:e,decryptedMutationMessageRangeCountArray:a}}g.SyncdCriticalBootstrapStageType=o;g.SyncdDecryptMutationsType=p;g.reportSyncdCriticalBootstrapStage=q;g.reportSyncdDecryptedMutations=a;g.convertSyncdCriticalBootstrapStageFromAnnotations=c;g.convertSyncdDecryptMutationsMetricsFromAnnotations=e}),98); __d("WAWebSyncd",["Promise","WALogger","WASyncdConst","WAWebGetCollectionVersion","WAWebGetMissingKey","WAWebGetPendingMutation","WAWebGetSyncAction","WAWebGetSyncKey","WAWebRunInTransaction","WAWebSyncdCollectionsStateMachine","WAWebSyncdCryptoUtils","WAWebSyncdDbCallbacksApi","WAWebSyncdDisabled","WAWebSyncdKeyCache","WAWebSyncdMetricCriticalBootstrapStage","WAWebSyncdMetricFatalError","WAWebSyncdOrphan","WAWebSyncdServerSync","WAWebSyncdWamAppState","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: syncing pending mutations and blocked collections due to app resume"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: syncPendingMutationsAndBlockedCollections: [","]"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: syncPendingMutationsAndBlockedCollections"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: fatal error: expired collections"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: cleanup after sync()"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: exception during sync(): ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: server sync successful"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: initiate server sync"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: no collections to sync"]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: dirty collections: ",""]);r=function(){return a};return a}function a(){var b=babelHelpers.taggedTemplateLiteralLoose(["syncd:\n key id: ","\n key timestamp: ","\n key device indexes: ",""]);a=function(){return b};return b}function e(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: "," unsupported mutations"]);e=function(){return a};return a}function f(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd:\n "," successful "," mutations\n "," orphan "," mutations,\n "," failed "," mutations"]);f=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: local version (",")for "," >= server version (","); will not mark for sync."]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: local version (",") for "," less than server version (","); will mark for sync."]);t=function(){return a};return a}function u(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: server version for "," missing; will mark for sync."]);u=function(){return a};return a}function v(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: local version for "," missing; will mark for sync."]);v=function(){return a};return a}function w(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: start filter collections: ",""]);w=function(){return a};return a}function x(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: "," state before sync: ",""]);x=function(){return a};return a}function y(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: marking for sync: ",""]);y=function(){return a};return a}function z(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: retry is in flight"]);z=function(){return a};return a}function A(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: state machine tick"]);A=function(){return a};return a}function B(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: cleanup after handleRetry()"]);B=function(){return a};return a}function C(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: exception during handleRetry(): ",""]);C=function(){return a};return a}function D(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: server sync retry successful"]);D=function(){return a};return a}function E(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: initiate server sync retry"]);E=function(){return a};return a}function F(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: syncBlockedCollections:\n \tmoving blocked collections to dirty: [","]\n \tadding inflight collections to pending: [","]"],["syncd: syncBlockedCollections:\n \\tmoving blocked collections to dirty: [","]\n \\tadding inflight collections to pending: [","]"]);F=function(){return a};return a}function G(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: sync blocked collections: ",""]);G=function(){return a};return a}var aa=1e3,ba=1e3*60*60,ca=2,H=new Set(),I=new Set(),J,K=!1,L=0,M=0;function N(a,b){return O.apply(this,arguments)}function O(){O=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=b!=null?yield da(a,b):a;d("WALogger").LOG(y(),b);b.forEach(function(a){var b=c("WAWebSyncdCollectionsStateMachine").getCollectionState(a);d("WALogger").LOG(x(),a,b);b===d("WASyncdConst").CollectionSyncState.UpToDate?c("WAWebSyncdCollectionsStateMachine").moveCollectionsToDirty([a]):b===d("WASyncdConst").CollectionSyncState.Dirty&&(I=new Set([].concat(Array.from(I),[a])))});yield c("WAWebSyncdCollectionsStateMachine").persistToDb();return U()});return O.apply(this,arguments)}function da(a,b){return P.apply(this,arguments)}function P(){P=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){d("WALogger").LOG(w(),a);var c=(yield d("WAWebGetCollectionVersion").bulkGetCollectionVersionsInTransaction(a)),e=new Map(a.map(function(a,b){return[a,(a=c[b])==null?void 0:a.version]}));return a.filter(function(a){var c=e.get(a);if(c==null){d("WALogger").LOG(v(),a);return!0}var f=b.get(a);if(f==null){d("WALogger").LOG(u(),a);return!0}if(c<f){d("WALogger").LOG(t(),c,a,f);return!0}d("WALogger").LOG(s(),c,a,f);return!1})});return P.apply(this,arguments)}function ea(){return Q.apply(this,arguments)}function Q(){Q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a,b=(yield d("WAWebGetSyncAction").countSyncActionsInTransaction());(a=d("WAWebSyncdWamAppState")).setStoredMutationCount(b);b=(yield d("WAWebGetSyncAction").getSyncActionsByActionStatesInTransaction([d("WASyncdConst").SyncActionState.Malformed]));a.setInvalidActionCount(b.length);b=(yield d("WAWebGetSyncAction").getSyncActionsByActionStatesInTransaction([d("WASyncdConst").SyncActionState.Unsupported]));a.setUnsupportedActionCount(b.length);b=(yield d("WAWebGetMissingKey").getMissingKeyCountTransaction());a.setMissingKeyCount(b)});return Q.apply(this,arguments)}function R(){return S.apply(this,arguments)}function S(){S=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){});return S.apply(this,arguments)}function R(){return T.apply(this,arguments)}function T(){T=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){});return T.apply(this,arguments)}function fa(){var a=c("WAWebSyncdCollectionsStateMachine").getCollectionsInStateBlocked();d("WALogger").LOG(G(),a);c("WAWebSyncdCollectionsStateMachine").moveCollectionsToDirty(a);I=new Set([].concat(Array.from(I),Array.from(H)));d("WALogger").LOG(F(),a,Array.from(H));return U()}function U(){return V.apply(this,arguments)}function V(){V=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(d("WAWebSyncdDisabled").isSyncdDisabled())return(h||(h=b("Promise"))).resolve();var a=c("WAWebSyncdCollectionsStateMachine").getCollectionsInStateDirty();d("WALogger").LOG(r(),a);var e=new Set(a.filter(function(a){return!H.has(a)}));if(e.size===0){d("WALogger").LOG(q());return(h||(h=b("Promise"))).resolve()}a=[];try{H=new Set([].concat(Array.from(H),Array.from(e)));d("WALogger").LOG(p());a=(yield d("WAWebSyncdServerSync").serverSync(Array.from(e)));d("WALogger").LOG(o());var f=a.filter(function(a){return a.state===d("WASyncdConst").CollectionState.ErrorRetry});f.length>0&&(M=f[0].serverBackoff||0,L=0);Y(a)}catch(a){d("WALogger").LOG(n(),a),c("WAWebSyncdCollectionsStateMachine").moveCollectionsToFiniteRetry(Array.from(e))}finally{d("WALogger").LOG(m()),c("WAWebSyncdCollectionsStateMachine").persistToDb(),H=new Set(Array.from(H).filter(function(a){return!e.has(a)})),X(),yield d("WAWebSyncdDbCallbacksApi").handleSyncCompleted(a)}});return V.apply(this,arguments)}function ga(){if(d("WAWebSyncdDisabled").isSyncdDisabled())return;var a=new Set(c("WAWebSyncdCollectionsStateMachine").getCollectionsInStateRetry());if(a.size===0)return;J=setTimeout(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){try{K=!0;L+=1;d("WALogger").LOG(E());var b=(yield d("WAWebSyncdServerSync").serverSync(Array.from(a)));d("WALogger").LOG(D());Y(b)}catch(b){d("WALogger").LOG(C(),b),c("WAWebSyncdCollectionsStateMachine").moveCollectionsToFiniteRetry(Array.from(a))}finally{d("WALogger").LOG(B()),yield ia(),c("WAWebSyncdCollectionsStateMachine").persistToDb(),K=!1,X()}}),ha(L,M))}function ha(a,b){a=Math.pow(ca,a)*aa;return Math.min(Math.max(a,b),ba)}function ia(){return W.apply(this,arguments)}function W(){W=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=c("WAWebSyncdCollectionsStateMachine").getExpiredCollections();a.length>0&&(c("WAWebSyncdCollectionsStateMachine").moveCollectionsToFatal(a),yield d("WAWebSyncdDbCallbacksApi").printSyncdLog(),d("WALogger").ERROR(l()).sendLogs("syncd: fatal error: expired collections"),d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.TOO_MANY_INTERNAL_SERVER_ERRORS_IN_7D,a[0]))});return W.apply(this,arguments)}function X(){d("WALogger").LOG(A());c("WAWebSyncdCollectionsStateMachine").getCollectionsInStateDirty().length>0&&(I=new Set(Array.from(I).filter(function(a){return H.has(a)})),U());var a=c("WAWebSyncdCollectionsStateMachine").getCollectionsInStateRetry();if(a.length>0){if(K){d("WALogger").LOG(z());return}J!=null&&clearTimeout(J);I=new Set(Array.from(I).filter(function(b){return!a.includes(b)}));ga()}c("WAWebSyncdCollectionsStateMachine").getCollectionsInStateFatal().length>0&&d("WAWebSyncdDbCallbacksApi").handleSyncdFatal({collections:c("WAWebSyncdCollectionsStateMachine").getCollectionsInStateFatal()})}function Y(a){return a.forEach(function(a){if(a.state===d("WASyncdConst").CollectionState.Success&&!I.has(a.name))return c("WAWebSyncdCollectionsStateMachine").moveCollectionsToUpToDate([a.name]);if(a.state===d("WASyncdConst").CollectionState.ErrorRetry){d("WAWebSyncdMetricCriticalBootstrapStage").reportSyncdCriticalBootstrapStage(d("WAWebSyncdMetricCriticalBootstrapStage").SyncdCriticalBootstrapStageType.ENTERED_RETRY_MODE);return c("WAWebSyncdCollectionsStateMachine").moveCollectionsToFiniteRetry([a.name])}if(a.state===d("WASyncdConst").CollectionState.ErrorFatal)return c("WAWebSyncdCollectionsStateMachine").moveCollectionsToFatal([a.name]);if(a.state===d("WASyncdConst").CollectionState.Blocked&&!I.has(a.name))return c("WAWebSyncdCollectionsStateMachine").moveCollectionsToBlocked([a.name])})}function ja(){return Z.apply(this,arguments)}function Z(){Z=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){d("WALogger").LOG(k());var a=(yield d("WAWebGetPendingMutation").getAllSyncPendingMutationsInTransaction()),b=c("WAWebSyncdCollectionsStateMachine").getCollectionsInStateBlocked();c("WAWebSyncdCollectionsStateMachine").moveCollectionsToDirty(b);a=a.map(function(a){return a.collection}).concat(b);a.length>0&&(d("WALogger").LOG(j(),a),N(a))});return Z.apply(this,arguments)}function ka(){return c("WAWebSyncdCollectionsStateMachine").loadStatesFromDb().then(function(){return X()})}function la(){return $.apply(this,arguments)}function $(){$=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield d("WAWebSyncdOrphan").applyAllOrphansAndUnsupported(),d("WALogger").LOG(i()),yield ja()});return $.apply(this,arguments)}function ma(){return d("WAWebRunInTransaction").runInTransaction({SyncActionStore:!0,CollectionVersionStore:!0,PendingMutationStore:!0,MissingKeyStore:!0,SyncKeyStore:!0},function(a){var e=a.SyncActionStore,f=a.CollectionVersionStore,g=a.PendingMutationStore,i=a.MissingKeyStore;a=a.SyncKeyStore;return(h||(h=b("Promise"))).all([e.clear(),f.clear(),g.clear(),i.clear(),a.clear()]).then(function(){c("WAWebSyncdCollectionsStateMachine").clean(),d("WAWebSyncdKeyCache").clearSyncKeysCache()})})}function na(){return H}function oa(){return I}g.markCollectionsForSync=N;g.reportWam=ea;g.logKeysInfoInIntern=R;g.syncBlockedCollections=fa;g.initializeStateMachine=ka;g.processOnAppResume=la;g.clearSyncdData=ma;g.getInFlightCollections=na;g.getPendingCollections=oa}),98); __d("WAWebSyncdDecryptMutations",["WACryptoUtils","WAWebSyncdCrypto","WAWebSyncdCryptoConst","WAWebSyncdCryptoUtils","WAWebSyncdDecode","WAWebSyncdError","WAWebSyncdMetricFatalError","WAWebSyncdValidateSyncActionProtobuf","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";function a(a,b,c,d,e){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e,f,g){var h,i=g.index.blob;g=g.value.blob;var j=(h=d("WAWebSyncdCrypto")).valueMacFromIndexAndValueCipherText(g);g=d("WAWebSyncdCryptoUtils").split(g,d("WAWebSyncdCryptoConst").IV_LENGTH,g.byteLength-d("WAWebSyncdCryptoConst").MAC_LENGTH-d("WAWebSyncdCryptoConst").IV_LENGTH);var k=g[0],l=g[1];g=g[2];e=(yield h.generateEncryptionKeys(e));var m=e.indexKey,n=e.valueEncryptionKey;e=e.valueMacKey;var o=d("WAWebSyncdCryptoUtils").combine([k,l]);f=h.generateAssociatedData(f,b);b=(yield h.generateMac(f,o,e));if(!d("WACryptoUtils").arrayBuffersEqual(g,b)){d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.DECRYPTION_FAILED,a);throw new(d("WAWebSyncdError").SyncdFatalError)("decryption failure: valueMAC mismatch")}h=(yield d("WAWebSyncdCrypto").decryptCipherText(new Uint8Array(k),n,l));f=d("WAWebSyncdDecode").decodeSyncActionData(a,h);o=c("WAWebSyncdValidateSyncActionProtobuf").validateSyncActionDataProtobuf(a,f);e=(yield d("WAWebSyncdCrypto").generateIndexMac(m,o.index));if(!d("WACryptoUtils").arrayBuffersEqual(i,e)){d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.DECRYPTION_FAILED,a);throw new(d("WAWebSyncdError").SyncdFatalError)("decryption failure: indexMAC mismatch")}return{syncAction:o,indexMac:i,valueMac:j,indexValueBinary:h}});return h.apply(this,arguments)}g.syncdDecryptMutation=a}),98); __d("WAWebSyncdEncryptMutations",["WAArrayBufferUtils","WACryptoDependencies","WASyncAction.pb","WAWebSyncdCrypto","WAWebSyncdCryptoConst","WAWebSyncdCryptoUtils","WAWebSyncdError","WAWebSyncdMetricFatalError","WAWebSyncdRequestEncode","asyncToGeneratorRuntime","decodeProtobuf"],(function(a,b,c,d,e,f,g){"use strict";function a(a,b,c){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){try{var e,f=a.index,g=a.binarySyncAction,h=a.operation;a=a.version;f=d("WAArrayBufferUtils").stringToArrayBuffer(f);c=(yield (e=d("WAWebSyncdCrypto")).generateEncryptionKeys(c));var j=c.indexKey,k=c.valueEncryptionKey;c=c.valueMacKey;var l=(yield d("WACryptoDependencies").getCrypto().getRandomValues(new Uint8Array(d("WAWebSyncdCryptoConst").IV_LENGTH))),m=e.generatePadding(f.byteLength,g.byteLength);g=i(f,g,m,a);m=(yield e.generateCipherText(l,k,g));a=e.generateAssociatedData(h,b);l=(yield e.generateMac(a,m,c));k=d("WAWebSyncdCryptoUtils").combine([m,l]);g=(yield e.generateIndexMac(j,f));return{indexMac:g,indexAndValueCipherText:k}}catch(a){d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.ENCRYPTION_FAILED);throw new(d("WAWebSyncdError").SyncdFatalError)("encryption failure")}});return h.apply(this,arguments)}function i(a,b,c,e){return d("WAWebSyncdRequestEncode").encodeSyncActionData({index:a,value:d("decodeProtobuf").decodeProtobuf(d("WASyncAction.pb").SyncActionValueSpec,b),padding:c,version:e})}g.syncdEncryptMutation=a}),98); __d("WAWebSyncdEncryptionManager",["WACryptoHmac","WAEncodeString","WAWebSyncdCrypto","WAWebSyncdCryptoUtils","WAWebSyncdDecryptMutations","WAWebSyncdEncryptMutations","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";function a(a,b,c,d){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e){a=(yield d("WAWebSyncdCrypto").generateEncryptionKeys(a));a=a.snapshotMacKey;e=d("WAEncodeString").toUtf8(e).buffer;c=d("WAWebSyncdCryptoUtils").to64BitNetworkOrder(c);return d("WACryptoHmac").hmacSha256(a,d("WAWebSyncdCryptoUtils").combine([b,c,e]))});return h.apply(this,arguments)}function c(a,b,c,d,e){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e,f){a=(yield d("WAWebSyncdCrypto").generateEncryptionKeys(a));a=a.patchMacKey;f=d("WAEncodeString").toUtf8(f).buffer;e=d("WAWebSyncdCryptoUtils").to64BitNetworkOrder(e);return d("WACryptoHmac").hmacSha256(a,d("WAWebSyncdCryptoUtils").combine([b].concat(c,[e,f])))});return i.apply(this,arguments)}e={encryptMutation:d("WAWebSyncdEncryptMutations").syncdEncryptMutation,decryptMutation:d("WAWebSyncdDecryptMutations").syncdDecryptMutation,generatePatchMac:c,generateSnapshotMac:a};g.WASyncdEncryptionManager=e}),98); __d("WAWebEncryptionManagerSelector",["WASyncdKmpEncryptionManager","WAWebABProps","WAWebSyncdEncryptionManager"],(function(a,b,c,d,e,f,g){"use strict";function a(){return d("WAWebABProps").getABPropConfigValue("kmp_syncd_crypto_module_enabled")?d("WASyncdKmpEncryptionManager").WASyncdKmpEncryptionManager:d("WAWebSyncdEncryptionManager").WASyncdEncryptionManager}g.syncdEncryptionManager=a}),98); __d("WAWebKeyManagementUtils",["WALogger","WAWebApiDeviceList","WAWebUserPrefsMeUser","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: getPeerDevices: error ",". Future key requests will only be sent to primary device."]);h=function(){return a};return a}function a(){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=[],b=d("WAWebUserPrefsMeUser").assertGetMe();try{var c=(yield d("WAWebApiDeviceList").getMyDeviceList());c.devices.forEach(function(c){c.id!==b.getDeviceId()&&a.push(d("WAWebWidFactory").createDeviceWidFromUserAndDevice(b.user,b.server,c.id))})}catch(a){d("WALogger").WARN(h(),a).sendLogs(a.toString());return[d("WAWebWidFactory").createDeviceWidFromUserAndDevice(b.user,b.server,0)]}return a});return i.apply(this,arguments)}g.getPeerDevices=a}),98); __d("WAWebSyncdMetrics",["$InternalEnum","WALogger","WAPREList","WAPREMetrics","WASyncdConst"],(function(a,b,c,d,e,f,g){"use strict";function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: unknown error code: "," for key rotation event"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: missing error code for key rotation event"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: unknown error code: "," for critical event"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: missing error code for critical event"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: unknown collection "," for bootstrap data applied event"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: missing durationMs for bootstrap data applied event"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: missing snapshotUsed for bootstrap data applied event"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: missing collection for bootstrap data applied event"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: unknown collection "," for bootstrap app state download metric"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: missing isSuccess for bootstrap app state download metric"]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: missing downloadStartTs for bootstrap app state download metric"]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: missing collection for bootstrap app state download metric"]);s=function(){return a};return a}var t=b("$InternalEnum").Mirrored(["MISSING_MUTATION_TO_REMOVE"]),u=b("$InternalEnum").Mirrored(["SNAPSHOT_USED","SNAPSHOT_NOT_USED"]),v=b("$InternalEnum").Mirrored(["APP_STATE_SYNC_KEY_EXPIRY","DEVICE_DEREGISTERATION","NO_KEYS"]);function a(a){var b=d("WAPREMetrics").startMetric(d("WAPREList").PRE_METRIC.SYNCD_BOOTSTRAP_APP_STATE_DOWNLOAD);a.isSuccess!=="success"?b.endFail("syncd error: Error downloading snapshot or patches",w(a)):b.endSuccess(w(a))}function c(a,b,c){d("WAPREMetrics").startMetric(d("WAPREList").PRE_METRIC.SYNCD_BOOTSTRAP_DATA_APPLIED).endSuccess(x({collection:a,snapshotUsed:b,durationMs:c}))}function e(a,b){d("WAPREMetrics").startMetric(d("WAPREList").PRE_METRIC.SYNCD_CRITICAL_EVENT).endFail("syncd critical event: "+a,y({type:a,collection:b}))}function f(a){d("WAPREMetrics").startMetric(d("WAPREList").PRE_METRIC.SYNCD_KEY_ROTATION).endSuccess(z({type:a}))}function w(a){var b=a.collection,c=a.downloadSize,d=a.downloadStartTs;a=a.isSuccess;return{string:{collection:b},"int":{downloadSize:c,downloadStartTs:d},bool:{isSuccess:a==="success"}}}function x(a){return{string:{collection:a.collection},bool:{snapshot:a.snapshotUsed===u.SNAPSHOT_USED},"int":{durationMs:a.durationMs}}}function y(a){return{string:{criticalEventCode:a.type,collection:a.collection==null?null:a.collection}}}function z(a){return{string:{keyRotationEventCode:a.type}}}function A(a){var b,c,e;b=a==null?void 0:(b=a.string)==null?void 0:b.collection;c=a==null?void 0:(c=a["int"])==null?void 0:c.downloadSize;e=a==null?void 0:(e=a["int"])==null?void 0:e.downloadStartTs;a=a==null?void 0:(a=a.bool)==null?void 0:a.isSuccess;if(b==null){d("WALogger").ERROR(s());return null}if(e==null){d("WALogger").ERROR(r());return null}if(a==null){d("WALogger").ERROR(q());return null}var f=d("WASyncdConst").CollectionName.cast(b);if(f==null){d("WALogger").ERROR(p(),b);return null}b=a?"success":"failure";return{collection:f,downloadStartTs:e,downloadSize:c,isSuccess:b}}function B(a){var b,c;b=a==null?void 0:(b=a.string)==null?void 0:b.collection;c=a==null?void 0:(c=a.bool)==null?void 0:c.snapshot;a=a==null?void 0:(a=a["int"])==null?void 0:a.durationMs;if(b==null){d("WALogger").ERROR(o());return null}if(c==null){d("WALogger").ERROR(n());return null}if(a==null){d("WALogger").ERROR(m());return null}var e=d("WASyncdConst").CollectionName.cast(b);if(e==null){d("WALogger").ERROR(l(),b);return null}b=c?u.SNAPSHOT_USED:u.SNAPSHOT_NOT_USED;return{collection:e,snapshotUsed:b,durationMs:a}}function C(a){var b;b=a==null?void 0:(b=a.string)==null?void 0:b.criticalEventCode;if(b==null){d("WALogger").ERROR(k());return null}var c=t.cast(b);if(c==null){d("WALogger").ERROR(j(),b);return null}return{type:c,collection:d("WASyncdConst").CollectionName.cast(a==null?void 0:(b=a.string)==null?void 0:b.collection)}}function D(a){a=a==null?void 0:(a=a.string)==null?void 0:a.keyRotationEventCode;if(a==null){d("WALogger").ERROR(i());return null}var b=v.cast(a);if(b==null){d("WALogger").ERROR(h(),a);return null}return{type:b}}function E(a){var b={};Object.keys(a).forEach(function(c){typeof a[c]==="number"?(b["int"]==null&&(b["int"]={}),b["int"][c]=a[c]):typeof a[c]==="string"&&(b.string==null&&(b.string={}),b.string[c]=a[c])});return Object.keys(b).length>0?b:void 0}b=function(){function a(){this.event=d("WAPREMetrics").startMetric(d("WAPREList").PRE_METRIC.SYNCD)}var b=a.prototype;b.end=function(a){a===void 0&&(a=!1),a?this.event.endFail("syncd failed"):this.event.endSuccess()};b.mark=function(a,b){this.event.addPoint(a,E(b))};return a}();g.SyncdCriticalEventType=t;g.SyncdBootstrapDataAppliedSnapshotUsed=u;g.SyncdKeyRotationEventType=v;g.reportSyncdBootstrapAppStateDownloadMetric=a;g.reportSyncdBootstrapDataApplied=c;g.reportSyncdCriticalEvent=e;g.reportSyncdKeyRotationEvent=f;g.convertSyncdBootstrapAppStateDownloadFromAnnotations=A;g.convertSyncdBootstrapDataAppliedFromAnnotations=B;g.convertSyncdCriticalEventFromAnnotations=C;g.convertSyncdKeyRotationEventFromAnnotations=D;g.constructAnnotationsFromContext=E;g.SyncdEventFlow=b}),98); __d("WAWebSyncdAntiTampering",["$InternalEnum","Promise","WACryptoLtHash","WACryptoUtils","WAEncodeString","WALogger","WAPromiseEach","WAServerSync.pb","WASyncdConst","WASyncdKeyTypes","WATextEncoding","WAWebABProps","WAWebConnModel","WAWebCurrentUser","WAWebEncryptionManagerSelector","WAWebGetCollectionVersion","WAWebGetSyncAction","WAWebKeyManagementUtils","WAWebRunInTransaction","WAWebSyncdCrypto","WAWebSyncdCryptoUtils","WAWebSyncdDbCallbacksApi","WAWebSyncdError","WAWebSyncdKeyCache","WAWebSyncdMetricFatalError","WAWebSyncdMetrics","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";var h,i;function j(){var a=babelHelpers.taggedTemplateLiteralLoose([""," first time for ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose([""," first time for ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["|",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: current snapshot "," v"," with "," mutations. context "," mutations:"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: logMacs: ",": prepare"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: failed LtHash check for ",""]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["",""]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["",""]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["",""]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["",""]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["",""]);t=function(){return a};return a}function u(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: had to use fallbackQueryForValueMac in collection "," for platform ",": ","\n }"]);u=function(){return a};return a}function v(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: computing snapshot and patch macs for outgoing patch "," v",":\n encoded version: ","\n encoded collection: ","\n snapshotMAC: ","\n patchMAC: ",""]);v=function(){return a};return a}function w(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd:\n expected patchMAC: ","$\n computed patchMAC: ",""]);w=function(){return a};return a}function x(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: unable to validate patch mac."]);x=function(){return a};return a}function y(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: snapshot_mac_mismatch_in_patch due to cache mismatch"]);y=function(){return a};return a}function z(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: clientDebugData?.currentLthash: ",",\n scratchLtHash: ",",\n currentLtHash: ",""]);z=function(){return a};return a}function A(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: skip fatal after snapshot mac mismatch for collection ",""]);A=function(){return a};return a}function B(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] ",""]);B=function(){return a};return a}function C(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] ",""]);C=function(){return a};return a}function D(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] ",""]);D=function(){return a};return a}function E(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: fatal extra details:\n mdFatalErrorCode: ",",\n collection: ",",\n mutationCount: ",",\n patchVersion: ",",\n isLtHashConsistent: ",",\n macFatalCollectionNameMismatch: ",",\n macFatalCurrentLthashMismatch: ",",\n macFatalNewLthashMismatch: ",",\n macFatalPatchVersionMismatch: ",",\n macFatalNewLthashSubtractMismatch: ",",\n macFatalNumberHasOverrideMutation: ",",\n macFatalNumberNumAddMutation: ",",\n macFatalNumberNumRemoveMutation: ",",\n macFatalSenderCurrentLthashToLocalCalculatedCurrentLthashMismatch: ",",\n isPatchSenderPrimary: ",",\n macFatalDidUseMacFetchFallback: ",",\n macFatalHasMissingRemove: ",",\n macFatalNumberAddMismatch: ",",\n macFatalNumberRemoveMismatch: ",",\n isThereAnotherSyncdCompanion: ","\n "]);E=function(){return a};return a}function F(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd:\n expected snapshotMAC: ","\n computed snapshotMAC: ",""]);F=function(){return a};return a}function G(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: collection "," is already in snapshot mac mismatch so not checking again"]);G=function(){return a};return a}function H(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: empty local lthash found when processing "," patch v",""]);H=function(){return a};return a}function I(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: "," received patch v"," !== latest local version (v",") + 1"]);I=function(){return a};return a}function J(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: error on incoming records:\n \t",""],["[","] syncd: error on incoming records:\n \\t",""]);J=function(){return a};return a}function K(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: validating snapshot and patch mac for "," v",":\n expected snapshotMAC: ","\n expected patchMAC: ","\n encoded version: ","\n encoded collection: ","\n key ID: ","\n "]);K=function(){return a};return a}function L(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: computeLtHashAndValidatePatch for ",""]);L=function(){return a};return a}function aa(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: validating snapshot mac for "," snapshot v",":\n ltHash: ","\n encoded version: ","\n encoded collection: ","\n expected snapshotMAC: ","\n "]);aa=function(){return a};return a}function ba(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd:\n "," snapshot macsToAdd:\n ",""]);ba=function(){return a};return a}var M=b("$InternalEnum").Mirrored(["Incoming","Outgoing"]),ca=[(i=d("WASyncdConst")).Actions.LocaleSetting,i.Actions.SettingPushName,"generated_wui",i.Actions.Sentinel,i.Actions.PrimaryVersion,i.Actions.TimeFormat,i.Actions.Nux,i.Actions.BotWelcomeRequest,i.Actions.DeviceCapabilities,i.Actions.Archive,i.Actions.LockChat,i.Actions.FavoriteSticker,i.Actions.ChatLockSettings,i.Actions.MarkChatAsRead,i.Actions.NoteEdit,i.Actions.Pin,i.Actions.PinDEPRECATED,i.Actions.RemoveRecentSticker,i.Actions.UnarchiveChatsSetting,i.Actions.AndroidUnsupportedActions];function N(a,b,c){c===void 0&&(c=!0);a=typeof a==="string"?a:d("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(a);b=typeof b==="string"?b:d("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(b);c=c?-16:0;return a.slice(c)+":"+b.slice(c)}var da=d("WATextEncoding").newTextDecoder();function a(a,b,c){return O.apply(this,arguments)}function O(){O=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){var e=b.mac,f=b.version,g=b.keyId,h=b.records;g=(yield d("WAWebSyncdKeyCache").getKeyData(g.id));if(!g)throw new(d("WAWebSyncdError").SyncdMissingKeyError)();var i=new Map(h.map(function(a){return[d("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(a.index.blob),d("WAWebSyncdCrypto").valueMacFromIndexAndValueCipherText(a.value.blob)]}));d("WALogger").LOG(ba(),c,a,Array.from(i.entries()).map(function(a){var b=a[0];a=a[1];return N(b,a)}).join("\n\t"));i=(yield d("WACryptoLtHash").LT_HASH_ANTI_TAMPERING.add(d("WACryptoLtHash").EMPTY_LT_HASH,Array.from(i.values())));var j=(yield d("WAWebSyncdCrypto").generateEncryptionKeys(g));j=j.snapshotMacKey;var k=d("WAWebSyncdCryptoUtils").to64BitNetworkOrder(f.version),l=d("WAEncodeString").toUtf8(a).buffer;d("WALogger").LOG(aa(),c,a,f.version,d("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(i),d("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(k),d("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(l),d("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(e)).devConsole("\n --- DEV ONLY ---\n snapshotMacKey: "+d("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(j));yield fa(a,e,g,i,k,l,!0,h.length,b.version.version,null,null,null,null,c);return i});return O.apply(this,arguments)}function c(a,b,c,d){return P.apply(this,arguments)}function P(){P=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e,f){d("WALogger").LOG(L(),e,a);var g=c.version,h=c.mutations,i=c.snapshotMac,j=c.patchMac,k=c.keyId;k=k.id;var l=(yield d("WAWebSyncdKeyCache").getKeyData(k));if(!l)throw new(d("WAWebSyncdError").SyncdMissingKeyError)();var m=h.map(function(a){return{operation:a.operation,indexMac:a.record.index.blob,valueMac:d("WAWebSyncdCrypto").valueMacFromIndexAndValueCipherText(a.record.value.blob)}}),n=(yield d("WAWebGetCollectionVersion").getCollectionVersionLtHashInTransaction(a));f=(yield ha(a,m,e,f,c.version.version,M.Incoming,n));var o=d("WAWebSyncdCryptoUtils").to64BitNetworkOrder(g.version),p=d("WAEncodeString").toUtf8(a).buffer;d("WALogger").LOG(K(),e,a,g.version,d("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(i),d("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(j),d("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(o),d("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(p),d("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(d("WASyncdKeyTypes").fromSyncKeyId(k)));try{yield ga(a,j,l,i,m.map(function(a){return a.valueMac}),h.length,g.version,e),yield fa(a,i,l,f.ltHash,o,p,!1,h.length,g.version,c.clientDebugData,n,f,c.deviceIndex,e)}catch(a){yield q();throw a}return f.ltHash;function q(){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var b=(yield Y(a,e,"logErrorDiagnostics",!1)),c=new Map(b.map(function(a){var b=a.indexMac;a=a.valueMac;return[d("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(b),d("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(a)]}));d("WALogger").LOG(J(),e,m.map(function(a){var b=a.operation,e=a.indexMac;a=a.valueMac;return(b===d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET?"set":"remove")+" | "+N(e,a,!1)+" | "+(c.has(d("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(e))?"found":"did not find")+" indexMAC in the above logged macs"}).join("\n\t"))});return r.apply(this,arguments)}});return P.apply(this,arguments)}function ea(a,b,c){return Q.apply(this,arguments)}function Q(){Q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){var e=(yield d("WAWebGetCollectionVersion").getCollectionVersionInTransaction(a).then(function(a){return(a=a==null?void 0:a.version)!=null?a:0}));if(e!==b-1){var f=e>b-1?"greater-than-expected":"less-than-expected";d("WALogger").WARN(I(),c,a,b,e).sendLogs("syncd-version-check-error-local-version-"+f);yield d("WAWebSyncdDbCallbacksApi").writeSyncdLog(a,"["+c+"] received patch v"+b+" !== latest local version (v"+e+") + 1");throw new(d("WAWebSyncdError").SyncdRetryableError)("syncd-version-check-error-local-version-"+f)}e=(yield d("WAWebGetCollectionVersion").getCollectionVersionLtHashInTransaction(a));if(d("WACryptoUtils").arrayBuffersEqual(e,d("WACryptoLtHash").EMPTY_LT_HASH)&&b!==1){d("WALogger").WARN(H(),c,a,b).sendLogs("syncd-empty-lthash-on-mac-mismatch");throw new(d("WAWebSyncdError").SyncdRetryableError)("empty lthash")}});return Q.apply(this,arguments)}function fa(a,b,c,d,e,f,g,h,i,j,k,l,m,n){return R.apply(this,arguments)}function R(){R=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e,f,g,h,i,j,k,l,m,n,o){var p,q=d("WAWebABProps").getABPropConfigValue("syncd_do_not_fatal_on_snapshot_mac_mismatch_in_patches")&&!h;p=(p=(yield d("WAWebGetCollectionVersion").getIsCollectionInMacMismatchFatalInTransaction(a)))!=null?p:!1;if(q&&p){d("WALogger").LOG(G(),o,a);return}p=d("WAWebEncryptionManagerSelector").syncdEncryptionManager().generateSnapshotMac;p=(yield p(c,e,j,a));c=d("WACryptoUtils").arrayBuffersEqual(p,b);if(!c){d("WALogger").DEV(F(),o,d("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(b),d("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(p));h||(yield ea(a,j,o));yield d("WAWebSyncdDbCallbacksApi").writeSyncdLog(a,"["+o+"] failed validate snapshot mac");c=(yield V(o,a));b=c.isLtHashConsistent;p=c.scratchLtHash;c=h?d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.SNAPSHOT_MAC_MISMATCH_IN_SNAPSHOT:d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.SNAPSHOT_MAC_MISMATCH_IN_PATCH;h=(k==null?void 0:k.collectionName)&&!d("WACryptoUtils").arrayBuffersEqual(g,k==null?void 0:k.collectionName);g=(k==null?void 0:k.newLthash)&&!d("WACryptoUtils").arrayBuffersEqual(e,k==null?void 0:k.newLthash);e=(k==null?void 0:k.patchVersion)&&!d("WACryptoUtils").arrayBuffersEqual(f,k==null?void 0:k.patchVersion);f=(k==null?void 0:k.currentLthash)&&l&&!d("WACryptoUtils").arrayBuffersEqual(l,k==null?void 0:k.currentLthash);var r=(k==null?void 0:k.newLthashSubtract)&&(m==null?void 0:m.subtractResult)&&!d("WACryptoUtils").arrayBuffersEqual(m==null?void 0:m.subtractResult,k==null?void 0:k.newLthashSubtract),s=m==null?void 0:m.hasOverride,t=m==null?void 0:m.numAdd,u=m==null?void 0:m.numRemove,v=(k==null?void 0:k.currentLthash)&&p&&!d("WACryptoUtils").arrayBuffersEqual(p,k==null?void 0:k.currentLthash);n=n===0;var w=(k==null?void 0:k.numberAdd)!=null&&(m==null?void 0:m.numAdd)!=null&&(m==null?void 0:m.numAdd)!==(k==null?void 0:k.numberAdd),x=(k==null?void 0:k.numberRemove)!=null&&(m==null?void 0:m.numRemove)!=null&&(m==null?void 0:m.numRemove)!==(k==null?void 0:k.numberRemove),H=m==null?void 0:m.didUseFallback;m=m==null?void 0:m.hasMissingRemove;var I=(yield d("WAWebKeyManagementUtils").getPeerDevices()).length>1;d("WAWebSyncdMetricFatalError").reportSyncdFatalError(c,a,i,j,!q,b,h,f,g,e,r,s,t,u,v,n,H,m,w,x,I);d("WALogger").LOG(E(),o,c,a,i,j,b,h,f,g,e,r,s,t,u,v,n,H,m,w,x,I);if(q){yield d("WAWebSyncdDbCallbacksApi").printSyncdLog(a);c="syncd: unable to validate snapshot mac. collection: "+a;if(d("WAWebCurrentUser").isEmployee())d("WALogger").ERROR(D(),o,c).sendLogs(c,{sampling:1});else if(k!=null){i=c+" (additional info)";d("WALogger").ERROR(C(),o,i).sendLogs(i,{sampling:1})}else d("WALogger").ERROR(B(),o,c).sendLogs(c,{sampling:.01});yield d("WAWebGetCollectionVersion").updateIsCollectionInMacMismatchFatalInTransaction(a);d("WALogger").LOG(A(),o,a);if(v===!1&&f===!0){d("WALogger").LOG(z(),o,d("WAWebSyncdCryptoUtils").arrayBufferToHexPadded((j=k==null?void 0:k.currentLthash)!=null?j:new ArrayBuffer(0)).slice(-16),d("WAWebSyncdCryptoUtils").arrayBufferToHexPadded((b=p)!=null?b:new ArrayBuffer(0)).slice(-16),d("WAWebSyncdCryptoUtils").arrayBufferToHexPadded((h=l)!=null?h:new ArrayBuffer(0)).slice(-16));d("WALogger").ERROR(y()).sendLogs("syncd: snapshot_mac_mismatch_in_patch due to cache mismatch")}return}throw new(d("WAWebSyncdError").SyncdFatalError)("unable to validate snapshot mac")}});return R.apply(this,arguments)}function ga(a,b,c,d,e,f,g,h){return S.apply(this,arguments)}function S(){S=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e,f,g,h,i){var j=d("WAWebEncryptionManagerSelector").syncdEncryptionManager().generatePatchMac;j=(yield j(c,e,f,h,a));c=d("WACryptoUtils").arrayBuffersEqual(j,b);if(!c){yield ea(a,h,i);yield d("WAWebSyncdDbCallbacksApi").writeSyncdLog(a,"failed validate patch mac");d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.MAC_MISMATCH_PATCH,a,g,h);d("WALogger").WARN(x(),i).sendLogs("syncd: unable to validate patch mac.");d("WALogger").DEV(w(),b,j);throw new(d("WAWebSyncdError").SyncdFatalError)("unable to validate patch mac")}});return S.apply(this,arguments)}function e(a,b,c,d){return T.apply(this,arguments)}function T(){T=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e){var f,g=(yield d("WAWebGetCollectionVersion").getCollectionVersionInTransaction(a).then(function(a){return(a=a==null?void 0:a.version)!=null?a:d("WASyncdConst").DEFAULT_COLLECTION_VERSION}))+1,h=(f=d("WAWebSyncdCryptoUtils")).to64BitNetworkOrder(g),i=d("WAEncodeString").toUtf8(a).buffer,j=d("WAWebEncryptionManagerSelector").syncdEncryptionManager();b=(yield j.generateSnapshotMac(e,b,g,a));j=(yield j.generatePatchMac(e,b,c.map(function(a){return a.valueMac}),g,a));c=(yield d("WAWebSyncdCrypto").generateEncryptionKeys(e));e=c.patchMacKey;c=c.snapshotMacKey;d("WALogger").LOG(v(),a,g,f.arrayBufferToHexPadded(h),f.arrayBufferToHexPadded(i),f.arrayBufferToHexPadded(b),f.arrayBufferToHexPadded(j)).devConsole("\n --- DEV ONLY ---\n snapshotMacKey: "+f.arrayBufferToHexPadded(c)+"\n patchMacKey: "+f.arrayBufferToHexPadded(e));return{snapshotMac:b,patchMac:j}});return T.apply(this,arguments)}function ha(a,b,c,d,e,f,g){return U.apply(this,arguments)}function U(){U=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e,f,g,i,j){var k=d("WAWebABProps").getABPropConfigValue("enable_syncd_debug_data_in_patch")||a===d("WASyncdConst").CollectionName.CriticalBlock||i===M.Outgoing;j=(j=j)!=null?j:yield d("WAWebGetCollectionVersion").getCollectionVersionLtHashInTransaction(a);var l=(yield ja(c.map(function(a){return a.indexMac}))),m=new Map(),n=new Map(),o=new Map(),v=!1,w=!1;yield d("WAPromiseEach").promiseEach(c,function(){var f=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){var f=b.indexMac,h=b.valueMac;b=b.operation;var j=da.decode(f);j=l.get(j);if(j)b===d("WAServerSync.pb").SyncdMutation$SyncdOperation.REMOVE?n.set(d("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(f),j.valueMac):o.set(d("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(f),j.valueMac);else if(b===d("WAServerSync.pb").SyncdMutation$SyncdOperation.REMOVE){j=(yield z(f));if(j!=null){n.set(d("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(f),j);w=!0;d("WALogger").WARN(u(),e,a,(j=d("WAWebConnModel").Conn.platform)!=null?j:"[empty]",d("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(f).slice(-16)).tags("non-sad").sendLogs("syncd: fallback query");yield d("WAWebSyncdDbCallbacksApi").writeSyncdLog(a,"["+e+"] used fallback for "+d("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(f))}else{v=!0;yield d("WAWebSyncdDbCallbacksApi").writeSyncdLog(a,"["+e+"] incoming REMOVE mutation missing in local snapshot for collection "+a+" version "+((j=g==null?void 0:g.toString())!=null?j:"n/a")+": "+d("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(f));yield Y(a,e,"REMOVE missing",!1);j="\n syncUseMultipleMacQueries: "+d("WAWebABProps").getABPropConfigValue("web_syncd_query_index_mac_using_multiple_queries").toString()+"\n input mutations mac:\n "+c.map(function(a){return(a.operation===d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET?"SET ":"REMOVE ")+N(a.indexMac,a.valueMac)}).join("\n\t")+"\n currentMacs: "+Array.from(l.values()).map(function(a){return N(a.indexMac,a.valueMac)}).join(", ")+"\n ";d("WALogger").LOG(t(),j);yield d("WAWebSyncdDbCallbacksApi").writeSyncdLog(a,"missing remove additional info: "+j);d("WAWebSyncdMetrics").reportSyncdCriticalEvent(d("WAWebSyncdMetrics").SyncdCriticalEventType.MISSING_MUTATION_TO_REMOVE,a);j="["+e+"] syncd: missing indexMAC in sync-actions table for REMOVE mutation in collection "+a+" version "+((j=g==null?void 0:g.toString())!=null?j:"n/a")+" direction "+(i?i:"n/a")+" for platform "+((j=d("WAWebConnModel").Conn.platform)!=null?j:"[empty]")+": "+d("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(f).slice(-16);a===d("WASyncdConst").CollectionName.CriticalBlock?(yield d("WAWebSyncdDbCallbacksApi").printSyncdLog(a),d("WALogger").ERROR(s(),j).sendLogs("syncd: missing indexMAC from REMOVE in collection "+a)):d("WALogger").ERROR(r(),j).sendLogs("syncd: missing indexMAC from REMOVE in collection "+a,{sampling:.01})}}b===d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET&&m.set(d("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(f),h)});return function(a){return f.apply(this,arguments)}}());var x=(yield d("WACryptoLtHash").LT_HASH_ANTI_TAMPERING.subtractThenAdd(j,Array.from(m.values()),Array.from(n.values()).concat(Array.from(o.values())))),y=x.ltHash;x=x.subtractResult;j="["+e+"] syncd: computing ltHash for "+a+":\n mutations length: "+c.length+"\n currentLtHash: "+d("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(j).slice(-16)+"\n subtractResult: "+d("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(x).slice(-16)+"\n currentMacs length: "+l.size+"\n macsToAdd:\n "+Array.from(m.entries()).map(function(a){var b=a[0];a=a[1];return N(b,a)}).join("\n\t")+"\n macsToRemove:\n "+Array.from(n.entries()).map(function(a){var b=a[0];a=a[1];return N(b,a)}).join("\n\t")+"\n macsToOverwrite (also remove):\n "+Array.from(o.entries()).map(function(a){var b=a[0];a=a[1];return N(b,a)}).join("\n\t")+"\n newLtHash: "+d("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(y).slice(-16)+"\n hasMissingRemove: "+v.toString()+"\n didUseFallback: "+w.toString();d("WALogger").LOG(q(),j);yield d("WAWebSyncdDbCallbacksApi").writeSyncdLog(a,"generate lthash details 1: "+j);if(k){j="\n input mutations mac:\n "+c.map(function(a){return(a.operation===d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET?"SET ":"REMOVE ")+N(a.indexMac,a.valueMac)}).join("\n\t")+"\n currentMacs: "+Array.from(l.values()).map(function(a){return N(a.indexMac,a.valueMac)}).join(", ")+"\n ";d("WALogger").LOG(p(),j);yield d("WAWebSyncdDbCallbacksApi").writeSyncdLog(a,"generate lthash details 2: "+j)}return{ltHash:y,numAdd:m.size,numRemove:n.size,hasOverride:o.size>0,subtractResult:x,hasMissingRemove:v,didUseFallback:w};function z(a){return f==null?(h||(h=b("Promise"))).resolve(null):f(a)}});return U.apply(this,arguments)}function V(a,b,c){return W.apply(this,arguments)}function W(){W=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e){e=d("WAWebCurrentUser").isEmployee()?900:e;var f=(yield d("WAWebRunInTransaction").runInTransaction({SyncActionStore:!0,CollectionVersionStore:!0},function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var d=a.SyncActionStore;a=a.CollectionVersionStore;a=c==null?yield a.getAll():[yield a.get(c)];return(h||(h=b("Promise"))).all(a.filter(Boolean).map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.collection;a=a.ltHash;var c=(yield d.getByCollections([b]));return{collection:b,ltHash:a,mutations:c}});return function(b){return a.apply(this,arguments)}}()))});return function(b){return a.apply(this,arguments)}}())),g=0;f.map(function(a){a.collection;a.ltHash;a=a.mutations;g+=a.length});if(e!==void 0&&g>e)return{isLtHashConsistent:void 0,scratchLtHash:void 0,cachedLtHash:void 0};var i=null,j=null;e=!0;yield (h||(h=b("Promise"))).all(f.map(function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){var c=b.collection,f=b.ltHash;b=b.mutations;b=(yield ia(b));i==null&&(i=b);j==null&&(j=f);d("WACryptoUtils").arrayBuffersEqual(f,b)||g>0&&(e=!1,d("WALogger").ERROR(o(),a,c).verbose())});return function(a){return c.apply(this,arguments)}}()));return{isLtHashConsistent:e,scratchLtHash:i,cachedLtHash:j}});return W.apply(this,arguments)}function ia(a){a=new Map(a.map(function(a){return[d("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(a.indexMac),a.valueMac]}));return d("WACryptoLtHash").LT_HASH_ANTI_TAMPERING.add(d("WACryptoLtHash").EMPTY_LT_HASH,Array.from(a.values()))}function ja(a){return X.apply(this,arguments)}function X(){X=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebGetSyncAction").getSyncActionsByIndexMacsInTransaction(a));return new Map(a.map(function(a){return[da.decode(a.indexMac),{indexMac:a.indexMac,valueMac:a.valueMac}]}))});return X.apply(this,arguments)}function ka(a,b){var c=!1;d("WAWebCurrentUser").isEmployee()&&(c=!0);(a===d("WASyncdConst").CollectionName.RegularLow||a===d("WASyncdConst").CollectionName.CriticalBlock)&&(c=!0);ca.includes(b.action)&&(c=!0);if(b.action&&c){if(b.action===d("WASyncdConst").Actions.DeviceCapabilities){if(d("WAWebCurrentUser").isEmployee())return b.index;a=b.index.indexOf(":");return"device_capabilities:"+b.index.slice(a-4)}return b.action}}function Y(a,b,c,d){return Z.apply(this,arguments)}function Z(){Z=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e,f){f===void 0&&(f=!0);var g=f?20:1;d("WALogger").LOG(n(),a);var i=(yield d("WAWebRunInTransaction").runInTransaction({SyncActionStore:!0,CollectionVersionStore:!0},function(c){var d=c.SyncActionStore;c=c.CollectionVersionStore;return(h||(h=b("Promise"))).all([c.get(a).then(function(a){return a==null?void 0:a.version}),d.getByCollections([a])])})),j=i[0];i=i[1];d("WALogger").LOG(m(),c,a,j,i.length,e);c=d("WAWebCurrentUser").isEmployee()?200:120;if(f&&i.length>c)return i;c=i.reduce(function(b,c,d){d%g===0&&b.push("");b[b.length-1]+=N(c.indexMac,c.valueMac,f)+(" "+((d=ka(a,c))!=null?d:"n/a")+" | ");return b},[]);c.forEach(function(a){return d("WALogger").LOG(l(),a)});if(a===d("WASyncdConst").CollectionName.CriticalBlock||a===d("WASyncdConst").CollectionName.RegularLow||d("WAWebCurrentUser").isEmployee()){yield d("WAWebSyncdDbCallbacksApi").writeSyncdLog(a,"current local snapshot for "+a+" v"+((j=j)!=null?j:"n/a")+" mutation length "+i.length+" context "+e+": "+c.join("\n"))}return i});return Z.apply(this,arguments)}function f(a,b,c,d){return $.apply(this,arguments)}function $(){$=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e){e===void 0&&(e=400);e=(yield V(c,a,e));var f=e.isLtHashConsistent,g=e.scratchLtHash;e=e.cachedLtHash;g=g==null?"":d("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(g).slice(-16);e=e==null?"":d("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(e).slice(-16);if(f===!1){yield d("WAWebSyncdDbCallbacksApi").writeSyncdLog(a,"["+c+"] lthash first time inconsistent. scratchLtHash: "+g+", cachedLtHash: "+e+", context: "+b);yield d("WAWebSyncdDbCallbacksApi").printSyncdLog(a);c="syncd: lthash inconsistent";a===d("WASyncdConst").CollectionName.CriticalBlock||d("WAWebCurrentUser").isEmployee()?d("WALogger").ERROR(k(),c,a).verbose().sendLogs(c):d("WALogger").ERROR(j(),c,a).verbose().sendLogs(c,{sampling:.01});return!0}else if(f===!0){yield d("WAWebSyncdDbCallbacksApi").writeSyncdLog(a,"lthash consistent. scratchLtHash: "+g+", cachedLtHash: "+e+", context: "+b);return!1}yield d("WAWebSyncdDbCallbacksApi").writeSyncdLog(a,"lthash unknown if consistent. scratchLtHash: "+g+", cachedLtHash: "+e+", context: "+b);return void 0});return $.apply(this,arguments)}g.SyncdPatchDirection=M;g.indexAndValueMacToString=N;g.computeLtHashAndValidateSnapshot=a;g.computeLtHashAndValidatePatch=c;g.computeOutgoingSnapshotAndPatchMacs=e;g.computeLtHash=ha;g.checkLtHash=V;g.computeLtHashFromScratch=ia;g.logMacsInSnapshot=Y;g.reportCollectionInconsistency=f}),98); __d("WAWebSyncdRequestBuilderTypesConverter",["WANullthrows","WASyncAction.pb","decodeProtobuf","encodeProtobuf"],(function(a,b,c,d,e,f,g){"use strict";function a(a,b){return a.map(function(a){var e=d("decodeProtobuf").decodeProtobuf(d("WASyncAction.pb").SyncActionDataSpec,a.binarySyncData).value;e=d("encodeProtobuf").encodeProtobuf(d("WASyncAction.pb").SyncActionValueSpec,c("WANullthrows")(e)).readBuffer();return{collection:a.collection,index:a.index,binarySyncAction:e,operation:b,version:a.version,timestamp:a.timestamp,action:a.action}})}g.syncActionsToPendingMutations=a}),98); __d("WAWebSyncdCoreApi",["Promise","WALogger","WAServerSync.pb","WASyncdConst","WATypeUtils","WAWebCmd","WAWebEventsWaitForOfflineDeliveryEnd","WAWebLid1X1MigrationGating","WAWebModelStorageUtils","WAWebSchemaChat","WAWebSchemaSyncActions","WAWebSyncd","WAWebSyncdDb","WAWebSyncdDisabled","WAWebSyncdGetActionHandler","WAWebSyncdRequestBuilderTypesConverter","WAWebUserPrefsAppStateSync","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime","lodash","tryParseJSONMixed"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: getPnMutationsForLidCleanup: chat JID not a string"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: getPnMutationsForLidCleanup: indexParts is not an array"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: invalid action ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: sanitizing null 'action' property in sync-actions table"]);l=function(){return a};return a}var m=["pending-mutations"];function a(){if(d("WAWebSyncdDisabled").isSyncdDisabled())return(h||(h=b("Promise"))).resolve();n();d("WAWebEventsWaitForOfflineDeliveryEnd").waitForOfflineDeliveryEnd().then(function(){d("WAWebSyncd").processOnAppResume()});o();return d("WAWebSyncd").initializeStateMachine()}function n(){var a=1e3*60;a=c("lodash").debounce(d("WAWebSyncd").reportWam,a,{maxWait:a*3});d("WAWebCmd").Cmd.on(d("WAWebCmd").APP_STATE_SYNC_COMPLETED,a)}function o(){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield d("WAWebUserPrefsAppStateSync").getMdSyncActionsActionSanitized());if(!a){d("WALogger").LOG(l());a=(yield d("WAWebSchemaSyncActions").getSyncActionsTable().all());a=a.filter(function(a){return a.action==null});a=a.map(function(a){var b=JSON.parse(a.index)[0],c=d("WASyncdConst").Actions.cast(b);if(!c){d("WALogger").LOG(k(),b);return babelHelpers["extends"]({},a)}return babelHelpers["extends"]({},a,{action:b})});yield d("WAWebSyncdDb").updateSyncActionRows(a);yield d("WAWebUserPrefsAppStateSync").setMdSyncActionsActionSanitized(!0)}});return p.apply(this,arguments)}function e(a,c,e){a=[].concat(a,m);d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()&&a.push("chat","sync-actions");a=d("WAWebModelStorageUtils").getStorage().lock(a,function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var f=(yield q(c));return(h||(h=b("Promise"))).all([d("WAWebSyncdDb").appendPendingMutationsRows(c.concat(f)),e(a)])});return function(b){return a.apply(this,arguments)}}()).then(function(){var a=c.map(function(a){return a.collection});void d("WAWebSyncd").markCollectionsForSync(a)});return(h||(h=b("Promise"))).resolve(a)}function q(a){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()||d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isSyncdSessionMigrated())return[];a=(yield (h||(h=b("Promise"))).all(a.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a.action==null)return;var b=d("WAWebSyncdGetActionHandler").getActionHandler(a.action);if((b==null?void 0:b.chatJidIndex)==null)return;b=b.chatJidIndex;a=c("tryParseJSONMixed")(a.index);if(!Array.isArray(a)){d("WALogger").ERROR(j()).sendLogs("syncd-lid-cleanup-invalid-index-non-array");return}var e=a[b];if(!d("WATypeUtils").isString(e)){d("WALogger").ERROR(i()).sendLogs("syncd-lid-cleanup-invalid-index-non-string-jid");return}if(!c("WAWebWid").isLid(e))return;e=(yield d("WAWebSchemaChat").getChatTable().equals(["accountLid"],e,{shouldDecrypt:!1}))[0];if(e==null||e.accountLid===e.id)return;e=d("WAWebWidFactory").createWid(e.id).toJid();a=[].concat(a);a[b]=e;b=JSON.stringify(a);return d("WAWebSchemaSyncActions").getSyncActionsTable().get(b)});return function(b){return a.apply(this,arguments)}}()))).filter(Boolean).map(d("WAWebSchemaSyncActions").convertToSyncActionFromRow);return d("WAWebSyncdRequestBuilderTypesConverter").syncActionsToPendingMutations(a,d("WAServerSync.pb").SyncdMutation$SyncdOperation.REMOVE)});return r.apply(this,arguments)}g.initialize=a;g.sanitizeActionInSyncActionsRow=o;g.lockForSync=e}),98); __d("WAWebSyncdCriticalBootstrapProcessingApi",["WATimeUtils","WAWebMdBootstrapAppStateCriticalDataProcessingWamEvent","WAWebSyncBootstrap","WAWebSyncdMdSyncFieldstatMeta","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){c("WAWebSyncBootstrap").isSyncDCriticalDataSyncInProcess()&&new(d("WAWebMdBootstrapAppStateCriticalDataProcessingWamEvent").MdBootstrapAppStateCriticalDataProcessingWamEvent)({bootstrapAppStateDataStage:a,mdSessionId:yield d("WAWebSyncdMdSyncFieldstatMeta").MdSyncFieldStatsMeta.getMdSessionId(),mdTimestamp:d("WATimeUtils").unixTimeMs()}).commit()});return h.apply(this,arguments)}g.logCriticalBootstrapStageIfNecessary=a}),98); __d("WAWebAndroidUnsupportedActionsSync",["Promise","WALogger","WASyncdAction","WASyncdConst","WAWebUserPrefsAppStateSync"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[syncd] primary allows all mutations flag set: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["locale setting sync: operation not supported"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: androidUnsupportedMutation has invalid 'allowed' value"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: successfully set primary allows all mutations flag"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["android unsupported actions: malformed mutation"]);m=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(c,a);function c(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=null,b)||babelHelpers.assertThisInitialized(c)}var e=c.prototype;e.getVersion=function(){return 4};e.getAction=function(){return d("WASyncdConst").Actions.AndroidUnsupportedActions};e.applyMutations=function(a){var c=this;return(h||(h=b("Promise"))).all(a.map(function(a){try{if(a.operation==="set"){a=a.value;a=a.androidUnsupportedActions;if(!a){d("WALogger").WARN(m());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}a=a.allowed;a===!0?(c.updatePrimaryAllowsAllMutationsFlag("allow_unsupported_mutation"),d("WALogger").DEV(l())):d("WALogger").DEV(k());return{actionState:d("WASyncdConst").SyncActionState.Success}}d("WALogger").WARN(j());return{actionState:d("WASyncdConst").SyncActionState.Unsupported}}catch(a){return{actionState:d("WASyncdConst").SyncActionState.Failed}}}))};e.updatePrimaryAllowsAllMutationsFlag=function(a){d("WAWebUserPrefsAppStateSync").getPrimaryAllowsAllMutations()||(d("WALogger").LOG(i(),a),d("WAWebUserPrefsAppStateSync").setPrimaryAllowsAllMutations())};return c}(d("WASyncdAction").SyncActionBase);c=new a();g["default"]=c}),98); __d("WAWebSyncdLogs",["WALogger","WASyncdConst","WAWebPriorLogs","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: cannot log unknown cagtegory ",""]);h=function(){return a};return a}a=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=d("WAWebPriorLogs").WAWebLogCategory.cast(a);if(c!=null)return d("WAWebPriorLogs").writePriorLog(c,b);d("WALogger").WARN(h(),a)});return function(b,c){return a.apply(this,arguments)}}();c=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=[].concat(Array.from(a?[a]:d("WASyncdConst").CollectionName.members()),[""]).map(function(a){return d("WAWebPriorLogs").WAWebLogCategory.cast(a)}).filter(Boolean);return d("WAWebPriorLogs").printPriorLogs(a)});return function(b){return a.apply(this,arguments)}}();g.writeSyncdLogImpl=a;g.printSyncdLogs=c}),98); __d("WAWebSyncdDbCallbacksApi",["Promise","WAWebAndroidUnsupportedActionsSync","WAWebCmd","WAWebEventsWaitForOfflineDeliveryEnd","WAWebLid1X1MigrationGating","WAWebMsgKey","WAWebSchemaChat","WAWebSyncdFatal","WAWebSyncdLogs","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;f=function(a){a.deviceIndex===0&&c("WAWebAndroidUnsupportedActionsSync").updatePrimaryAllowsAllMutationsFlag("device index");return(h||(h=b("Promise"))).resolve()};var i=function(a){d("WAWebCmd").Cmd.trigger(d("WAWebCmd").APP_STATE_SYNC_COMPLETED,a);return(h||(h=b("Promise"))).resolve()},j=function(){return d("WAWebEventsWaitForOfflineDeliveryEnd").waitForOfflineDeliveryEnd().then(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){}))},k=function(a){return d("WAWebSyncdFatal").handleFatalError(a==null?void 0:a.collections)};function a(a){return d("WAWebSchemaChat").getChatTable().bulkGet(a).then(function(a){return a.map(function(a){return a==null?void 0:a.accountLid})})}function e(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated())return[];a=a.map(function(a){return c("WAWebMsgKey").fromString(a)}).filter(function(a){return a.remote.isUser()&&!a.remote.isLid()});var b=(yield d("WAWebSchemaChat").getChatTable().bulkGet(a.map(function(a){return a.remote.toString()}))).map(function(a){return a==null?void 0:a.accountLid}),e=[];for(var f=0;f<a.length;f++){var g=b[f];if(g!=null){var h=a[f];e.push(new(c("WAWebMsgKey"))({fromMe:h.fromMe,remote:d("WAWebWidFactory").createWid(g),id:h.id}).toString())}}return e});return l.apply(this,arguments)}g.handleSyncBeforeApplyPatch=f;g.handleSyncCompleted=i;g.handleSyncDelayApplyingPatchUntilUIUnblocks=j;g.handleSyncdFatal=k;g.writeSyncdLog=d("WAWebSyncdLogs").writeSyncdLogImpl;g.printSyncdLog=d("WAWebSyncdLogs").printSyncdLogs;g.bulkGetAccountLid=a;g.getAdditionalLidMsgKeys=e}),98); __d("WAWebSyncdFatal",["Promise","WAAsyncSleep","WALogger","WATimeUtils","WAWebLogoutReasonConstants","WAWebSocketLogoutJob","WAWebSyncdDbCallbacksApi","WAWebSyncdFatalExceptionNotificationApi","WAWebSyncdLogs","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: Received fatal error and logged out"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: end notifying primary on fatal error. tsBeforeSleep: ",", tsBeforeSendToPrimary: ",", currTs: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: end notifying primary on fatal error"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: error when sending fatal message to primary: ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: start notifying primary on fatal error"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: fatal flow: before sleep"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: starting fatal flow for ",""]);o=function(){return a};return a}var p=5e3;function a(a){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){d("WALogger").LOG(o(),a);a?yield r(a,"handleFatalError for collection"):yield d("WAWebSyncdDbCallbacksApi").writeSyncdLog("","handleFatalError without collection");var b=[];a!=null&&(b=a.map(function(a){return String(a)}));var c=d("WATimeUtils").castMilliSecondsToUnixTime(d("WATimeUtils").unixTimeMs());d("WALogger").LOG(n());yield d("WAAsyncSleep").asyncSleep(p);yield r(a,"handleFatalError before notify primary");var e=d("WATimeUtils").castMilliSecondsToUnixTime(d("WATimeUtils").unixTimeMs());d("WALogger").LOG(m());try{yield d("WAWebSyncdFatalExceptionNotificationApi").sendAppStateFatalExceptionNotification(b)}catch(a){d("WALogger").ERROR(l(),a).sendLogs("syncd: could not send fatal to primary")}d("WALogger").LOG(k());yield r(a,"handleFatalError after notify primary");b=d("WATimeUtils").castMilliSecondsToUnixTime(d("WATimeUtils").unixTimeMs());d("WALogger").LOG(j(),d("WATimeUtils").toHttpHeaderDate(c),d("WATimeUtils").toHttpHeaderDate(e),d("WATimeUtils").toHttpHeaderDate(b));yield d("WAWebSyncdLogs").printSyncdLogs();d("WALogger").ERROR(i()).verbose().tags("syncd","logout").sendLogs("syncd: fatal error and logged out");yield d("WAWebSocketLogoutJob").socketLogout(d("WAWebLogoutReasonConstants").LogoutReason.SyncdFailure)});return q.apply(this,arguments)}function r(a,c){return(h||(h=b("Promise"))).all(((a=a)!=null?a:[""]).map(function(a){return d("WAWebSyncdDbCallbacksApi").writeSyncdLog(a,c)}))}g.handleFatalError=a}),98); __d("WAWebSyncdFatalExceptionNotificationApi",["WATimeUtils","WAWebApiPeerMessageStore","WAWebMsgKey","WAWebMsgType","WAWebSendAppStateSyncMsgJob","WAWebUserPrefsMeUser","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a={collectionNames:a,timestamp:d("WATimeUtils").unixTimeMs()};var b=new(c("WAWebMsgKey"))({fromMe:!0,remote:d("WAWebUserPrefsMeUser").getMeUser(),id:yield c("WAWebMsgKey").newId()});b={id:b,to:d("WAWebWidFactory").createDeviceWidFromUserAndDevice(d("WAWebUserPrefsMeUser").assertGetMe().user,d("WAWebUserPrefsMeUser").assertGetMe().server,0),type:"protocol",subtype:"app_state_fatal_exception_notification",kind:d("WAWebMsgType").MsgKind.PeerMessage,appStateFatalExceptionNotification:a};yield d("WAWebApiPeerMessageStore").storePeerMessages([b]);return d("WAWebSendAppStateSyncMsgJob").encryptAndSendKeyMsg(b)});return h.apply(this,arguments)}g.sendAppStateFatalExceptionNotification=a}),98); __d("WAWebSyncdKeyCallbacksApi",["WAWebApiDeviceList","WAWebKeyManagementSendKeyRequestApi","WAWebKeyManagementSendKeyShareApi","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){a=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield d("WAWebApiDeviceList").getMyDeviceList()),b=a.currentIndex,e=a.devices;a=a.rawId;if(b==null)throw c("err")("syncd: missing current index for own device");return{currentIndex:b,deviceIndexes:e.map(function(a){return a.keyIndex}),rawId:a}});return function(){return a.apply(this,arguments)}}();e=function(a){return d("WAWebKeyManagementSendKeyShareApi").sendAppStateSyncKeyShare({type:"key_rotation",keys:a})};g.getDeviceFingerprint=a;g.sendSyncdKeyRequest=d("WAWebKeyManagementSendKeyRequestApi").sendAppStateSyncKeyRequest;g.sendSyncdKeyRotation=e}),98); __d("WAWebWamEnumUploadSourceType",[],(function(a,b,c,d,e,f){a=Object.freeze({OTHER:1,CAMERA:2,GALLERY:3,SHARE:4});f.UPLOAD_SOURCE_TYPE=a}),66); __d("WAWebMapFileOriginToUploadOrigin",["WAWebWamEnumMediaPickerOriginType","WAWebWamEnumUploadSourceType"],(function(a,b,c,d,e,f,g){function a(a,b){if(b)return d("WAWebWamEnumUploadSourceType").UPLOAD_SOURCE_TYPE.OTHER;switch(a){case d("WAWebWamEnumMediaPickerOriginType").MEDIA_PICKER_ORIGIN_TYPE.CHAT_PHOTO_LIBRARY:return d("WAWebWamEnumUploadSourceType").UPLOAD_SOURCE_TYPE.GALLERY;case d("WAWebWamEnumMediaPickerOriginType").MEDIA_PICKER_ORIGIN_TYPE.MENU_CAMERA_CAPTURE:return d("WAWebWamEnumUploadSourceType").UPLOAD_SOURCE_TYPE.CAMERA;case d("WAWebWamEnumMediaPickerOriginType").MEDIA_PICKER_ORIGIN_TYPE.PASTE:return d("WAWebWamEnumUploadSourceType").UPLOAD_SOURCE_TYPE.SHARE;default:return d("WAWebWamEnumUploadSourceType").UPLOAD_SOURCE_TYPE.OTHER}}g["default"]=a}),98); __d("WAWebWamEnumConnectionType",[],(function(a,b,c,d,e,f){a=Object.freeze({HOSTNAME:0,IP4:1,IP6:2});f.CONNECTION_TYPE=a}),66); __d("WAWebWamEnumHttpProtocolVersionType",[],(function(a,b,c,d,e,f){a=Object.freeze({HTTP1:0,HTTP2:1,HTTP3:2});f.HTTP_PROTOCOL_VERSION_TYPE=a}),66); __d("WAWebWamEnumMediaUploadModeType",[],(function(a,b,c,d,e,f){a=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});f.MEDIA_UPLOAD_MODE_TYPE=a}),66); __d("WAWebWamEnumNetworkStackType",[],(function(a,b,c,d,e,f){a=Object.freeze({NATIVE:0,OK_HTTP:1,LIGER:2,APACHE:3,WATLS:4,CRONET:5});f.NETWORK_STACK_TYPE=a}),66); __d("WAWebWamEnumOptimisticFlagType",[],(function(a,b,c,d,e,f){a=Object.freeze({NONE:0,OPTIMISTIC:1,OPT_USED:2,OPT_TAKEOVER:3,OPT_DISABLED:4});f.OPTIMISTIC_FLAG_TYPE=a}),66); __d("WAWebWamEnumOverallMediaKeyReuseType",[],(function(a,b,c,d,e,f){a=Object.freeze({NONE_NEW_CONTENT:1,NONE_EXPIRED:2,REUSED:3,NONE_WAS_STATUS:4});f.OVERALL_MEDIA_KEY_REUSE_TYPE=a}),66); __d("WAWebWamEnumUploadOriginType",[],(function(a,b,c,d,e,f){a=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,COMMUNITY:9,CHANNEL:10,BROADCAST:11,MULTI_CHAT:12,INTEROP:13});f.UPLOAD_ORIGIN_TYPE=a}),66); __d("WAWebMediaUpload2WamEvent",["WAWebWamCodegenUtils","WAWebWamEnumConnectionType","WAWebWamEnumHttpProtocolVersionType","WAWebWamEnumMediaQuality","WAWebWamEnumMediaType","WAWebWamEnumMediaUploadModeType","WAWebWamEnumMediaUploadResultType","WAWebWamEnumNetworkStackType","WAWebWamEnumOptimisticFlagType","WAWebWamEnumOverallLastUploadRetryPhaseType","WAWebWamEnumOverallMediaKeyReuseType","WAWebWamEnumPairedMediaType","WAWebWamEnumUploadOriginType","WAWebWamEnumUploadSourceType"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({MediaUpload2:[1588,{appContext:[63,a.TYPES.STRING],appContextBitfield:[64,a.TYPES.INTEGER],batchSize:[57,a.TYPES.INTEGER],connectionType:[43,d("WAWebWamEnumConnectionType").CONNECTION_TYPE],debugMediaException:[34,a.TYPES.STRING],debugMediaIp:[32,a.TYPES.STRING],debugUrl:[33,a.TYPES.STRING],estimatedBandwidth:[45,a.TYPES.NUMBER],estimatedBandwidthV2:[61,a.TYPES.NUMBER],fileHeight:[55,a.TYPES.INTEGER],fileWidth:[56,a.TYPES.INTEGER],finalizeConnectT:[28,a.TYPES.TIMER],finalizeHttpCode:[31,a.TYPES.INTEGER],finalizeIsReuse:[30,a.TYPES.BOOLEAN],finalizeNetworkT:[29,a.TYPES.TIMER],httpProtocolVersionType:[51,d("WAWebWamEnumHttpProtocolVersionType").HTTP_PROTOCOL_VERSION_TYPE],isViewOnce:[49,a.TYPES.BOOLEAN],mediaCollectionId:[60,a.TYPES.INTEGER],mediaId:[46,a.TYPES.INTEGER],messageKeyHash:[58,a.TYPES.STRING],networkStack:[42,d("WAWebWamEnumNetworkStackType").NETWORK_STACK_TYPE],originalSize:[53,a.TYPES.INTEGER],overallAttemptCount:[4,a.TYPES.INTEGER],overallConnBlockFetchT:[10,a.TYPES.TIMER],overallConnectionClass:[41,a.TYPES.STRING],overallCumT:[37,a.TYPES.TIMER],overallCumUserVisibleT:[38,a.TYPES.TIMER],overallDomain:[5,a.TYPES.STRING],overallEncryptT:[50,a.TYPES.TIMER],overallIsFinal:[36,a.TYPES.BOOLEAN],overallIsForward:[16,a.TYPES.BOOLEAN],overallIsManual:[13,a.TYPES.BOOLEAN],overallLastUploadRetryPhase:[11,d("WAWebWamEnumOverallLastUploadRetryPhaseType").OVERALL_LAST_UPLOAD_RETRY_PHASE_TYPE],overallMediaKeyReuse:[40,d("WAWebWamEnumOverallMediaKeyReuseType").OVERALL_MEDIA_KEY_REUSE_TYPE],overallMediaSize:[7,a.TYPES.NUMBER],overallMediaType:[1,d("WAWebWamEnumMediaType").MEDIA_TYPE],overallMmsVersion:[6,a.TYPES.INTEGER],overallOptimisticFlag:[12,d("WAWebWamEnumOptimisticFlagType").OPTIMISTIC_FLAG_TYPE],overallQueueT:[9,a.TYPES.TIMER],overallRetryCount:[3,a.TYPES.INTEGER],overallT:[8,a.TYPES.TIMER],overallTranscodeT:[15,a.TYPES.TIMER],overallUploadMode:[39,d("WAWebWamEnumMediaUploadModeType").MEDIA_UPLOAD_MODE_TYPE],overallUploadOrigin:[44,d("WAWebWamEnumUploadOriginType").UPLOAD_ORIGIN_TYPE],overallUploadResult:[35,d("WAWebWamEnumMediaUploadResultType").MEDIA_UPLOAD_RESULT_TYPE],overallUserVisibleT:[14,a.TYPES.TIMER],pairedMediaType:[62,d("WAWebWamEnumPairedMediaType").PAIRED_MEDIA_TYPE],photoQualitySetting:[52,d("WAWebWamEnumMediaQuality").MEDIA_QUALITY],resumeConnectT:[17,a.TYPES.TIMER],resumeHttpCode:[20,a.TYPES.INTEGER],resumeIsReuse:[19,a.TYPES.BOOLEAN],resumeNetworkT:[18,a.TYPES.TIMER],uploadBytesTransferred:[27,a.TYPES.NUMBER],uploadConnectT:[22,a.TYPES.TIMER],uploadHttpCode:[25,a.TYPES.INTEGER],uploadIsReuse:[24,a.TYPES.BOOLEAN],uploadIsStreaming:[26,a.TYPES.BOOLEAN],uploadNetworkT:[23,a.TYPES.TIMER],uploadResumePoint:[21,a.TYPES.INTEGER],uploadSource:[48,d("WAWebWamEnumUploadSourceType").UPLOAD_SOURCE_TYPE],usedFallbackHint:[47,a.TYPES.STRING],videoQualitySetting:[54,d("WAWebWamEnumMediaQuality").MEDIA_QUALITY]},[1,1,1],"regular"]},{MediaUpload2:[]});g.MediaUpload2WamEvent=b}),98); __d("WAWebWamEnumBackendStoreType",[],(function(a,b,c,d,e,f){a=Object.freeze({UNKNOWN:0,NON_DIRECT_PATH:1,EVERSTORE:2,OIL:3,EXPRESS_PATH:4,STATIC:5,MANIFOLD:6});f.BACKEND_STORE_TYPE=a}),66); __d("WAWebWamEnumMediaDownloadModeType",[],(function(a,b,c,d,e,f){a=Object.freeze({MANUAL:1,FULL:2,PREFETCH:3,HEADER:4,THUMBNAIL:5,EXPRESS_PATH_DOWNLOAD:6,PREFETCH_FOR_THUMB_PREVIEW:7,FULL_FOR_THUMB_PREVIEW:8});f.MEDIA_DOWNLOAD_MODE_TYPE=a}),66); __d("WAWebWamEnumMediaDownloadResultType",[],(function(a,b,c,d,e,f){a=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,ERROR_CRONET:30,ERROR_NO_CLIENT_NETWORK:31,ERROR_HOST_SWITCH_REQUIRED:32,ERROR_SUSPICIOUS_CONTENT:33,ERROR_NO_ENCRYPTION_ALGORITHM:34,ERROR_NO_ENCRYPTED_HASH:35,ERROR_NO_MEDIA_HASH:36,ERROR_NO_MEDIA_KEY:37,ERROR_NO_SIDECAR:38,ERROR_HASH_VERIFICATION_FAILURE:39,INTEGRITY_CHECK_FAILURE:40});f.MEDIA_DOWNLOAD_RESULT_TYPE=a}),66); __d("WAWebWamEnumWebcMediaOperationCode",[],(function(a,b,c,d,e,f){a=Object.freeze({DOWNLOAD:1,UPLOAD:2});f.WEBC_MEDIA_OPERATION_CODE=a}),66); __d("WAWebWebcMediaErrorUnknownDetailsWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumWebcMediaOperationCode"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({WebcMediaErrorUnknownDetails:[2352,{mediaId:[1,a.TYPES.INTEGER],webcMediaErrorMessage:[4,a.TYPES.STRING],webcMediaErrorName:[3,a.TYPES.STRING],webcMediaOperation:[2,d("WAWebWamEnumWebcMediaOperationCode").WEBC_MEDIA_OPERATION_CODE]},[1,1,1],"regular"]},{WebcMediaErrorUnknownDetails:[]});g.WebcMediaErrorUnknownDetailsWamEvent=b}),98); __d("WAWebWamMediaMetricUtils",["WAAbortError","WALogger","WAWebHttpErrors","WAWebMediaHostsErrors","WAWebMmsClientErrors","WAWebMmsMediaTypes","WAWebWamEnumBackendStoreType","WAWebWamEnumMediaDownloadModeType","WAWebWamEnumMediaDownloadResultType","WAWebWamEnumMediaType","WAWebWamEnumMediaUploadModeType","WAWebWamEnumMediaUploadResultType","WAWebWamEnumWebcMediaOperationCode","WAWebWebcMediaErrorUnknownDetailsWamEvent","err","gkx"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Unrecognized direct path type: ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Unrecognized direct path type"]);i=function(){return a};return a}function j(a){switch(a){case"thumbnail-document":case"thumbnail-image":case"thumbnail-video":case"thumbnail-link":case"newsletter-thumbnail-link":return!0}return!1}function a(a,b,c){if(j(a))return d("WAWebWamEnumMediaDownloadModeType").MEDIA_DOWNLOAD_MODE_TYPE.THUMBNAIL;if(b==="manual")return d("WAWebWamEnumMediaDownloadModeType").MEDIA_DOWNLOAD_MODE_TYPE.MANUAL;return c?d("WAWebWamEnumMediaDownloadModeType").MEDIA_DOWNLOAD_MODE_TYPE.PREFETCH:d("WAWebWamEnumMediaDownloadModeType").MEDIA_DOWNLOAD_MODE_TYPE.FULL}function b(a){return j(a)?d("WAWebWamEnumMediaUploadModeType").MEDIA_UPLOAD_MODE_TYPE.THUMBNAIL:d("WAWebWamEnumMediaUploadModeType").MEDIA_UPLOAD_MODE_TYPE.REGULAR}function e(a){switch(a){case d("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_AUDIO:case"audio":return d("WAWebWamEnumMediaType").MEDIA_TYPE.AUDIO;case"document":return d("WAWebWamEnumMediaType").MEDIA_TYPE.DOCUMENT;case"thumbnail-document":return d("WAWebWamEnumMediaType").MEDIA_TYPE.DOCUMENT;case d("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_GIF:case"gif":return d("WAWebWamEnumMediaType").MEDIA_TYPE.GIF;case"image":case d("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_IMAGE:return d("WAWebWamEnumMediaType").MEDIA_TYPE.PHOTO;case"thumbnail-image":return d("WAWebWamEnumMediaType").MEDIA_TYPE.PHOTO;case"ppic":return d("WAWebWamEnumMediaType").MEDIA_TYPE.PROFILE_PIC;case"product":return d("WAWebWamEnumMediaType").MEDIA_TYPE.PRODUCT_IMAGE;case d("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_PTT:case"ptt":return d("WAWebWamEnumMediaType").MEDIA_TYPE.PTT;case d("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_STICKER:case"sticker":return d("WAWebWamEnumMediaType").MEDIA_TYPE.STICKER;case"sticker-pack":return d("WAWebWamEnumMediaType").MEDIA_TYPE.STICKER_PACK;case"thumbnail-sticker-pack":return d("WAWebWamEnumMediaType").MEDIA_TYPE.STICKER_PACK;case"video":case d("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_VIDEO:return d("WAWebWamEnumMediaType").MEDIA_TYPE.VIDEO;case"ptv":case d("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_PTV:return d("WAWebWamEnumMediaType").MEDIA_TYPE.PUSH_TO_VIDEO;case"thumbnail-video":return d("WAWebWamEnumMediaType").MEDIA_TYPE.VIDEO;case"template":return d("WAWebWamEnumMediaType").MEDIA_TYPE.TEMPLATE;case"md-msg-hist":return d("WAWebWamEnumMediaType").MEDIA_TYPE.MD_HISTORY_SYNC;case"md-app-state":return d("WAWebWamEnumMediaType").MEDIA_TYPE.MD_APP_STATE;case"product-catalog-image":return d("WAWebWamEnumMediaType").MEDIA_TYPE.PRODUCT_IMAGE;case d("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_THUMBNAIL_LINK:case"thumbnail-link":return d("WAWebWamEnumMediaType").MEDIA_TYPE.URL;case"payment-bg-image":return d("WAWebWamEnumMediaType").MEDIA_TYPE.NONE;case"biz-cover-photo":return d("WAWebWamEnumMediaType").MEDIA_TYPE.NONE;case"ads-image":return d("WAWebWamEnumMediaType").MEDIA_TYPE.NONE;case"music-artwork":return d("WAWebWamEnumMediaType").MEDIA_TYPE.MUSIC_ARTWORK;default:a;throw c("err")("webMediaType is invalid: "+a)}}function f(a){if(a instanceof d("WAWebMmsClientErrors").MMSUnauthorizedError)return d("WAWebWamEnumMediaUploadResultType").MEDIA_UPLOAD_RESULT_TYPE.ERROR_NO_PERMISSIONS;if(a instanceof d("WAWebMmsClientErrors").MediaTooLargeError)return d("WAWebWamEnumMediaUploadResultType").MEDIA_UPLOAD_RESULT_TYPE.ERROR_BAD_MEDIA;if(a instanceof d("WAWebMmsClientErrors").MMSThrottleError)return d("WAWebWamEnumMediaUploadResultType").MEDIA_UPLOAD_RESULT_TYPE.ERROR_THROTTLE;if(a instanceof d("WAWebHttpErrors").HttpStatusCodeError&&a.status>=500)return d("WAWebWamEnumMediaUploadResultType").MEDIA_UPLOAD_RESULT_TYPE.ERROR_SERVER;if(a instanceof d("WAWebMediaHostsErrors").NoMediaHostsError)return d("WAWebWamEnumMediaUploadResultType").MEDIA_UPLOAD_RESULT_TYPE.ERROR_MEDIA_CONN;if(a.name===d("WAAbortError").ABORT_ERROR)return d("WAWebWamEnumMediaUploadResultType").MEDIA_UPLOAD_RESULT_TYPE.ERROR_CANCEL;return a instanceof d("WAWebHttpErrors").HttpNetworkError?d("WAWebWamEnumMediaUploadResultType").MEDIA_UPLOAD_RESULT_TYPE.ERROR_UPLOAD:d("WAWebWamEnumMediaUploadResultType").MEDIA_UPLOAD_RESULT_TYPE.ERROR_UNKNOWN}function k(a){if(a instanceof d("WAWebMmsClientErrors").MMSThrottleError)return d("WAWebWamEnumMediaDownloadResultType").MEDIA_DOWNLOAD_RESULT_TYPE.ERROR_THROTTLE;if(a instanceof d("WAWebMediaHostsErrors").NoMediaHostsError)return d("WAWebWamEnumMediaDownloadResultType").MEDIA_DOWNLOAD_RESULT_TYPE.ERROR_MEDIA_CONN;if(a instanceof d("WAWebHttpErrors").HttpNetworkError)return d("WAWebWamEnumMediaDownloadResultType").MEDIA_DOWNLOAD_RESULT_TYPE.ERROR_NETWORK;if(a instanceof d("WAWebHttpErrors").HttpStatusCodeError)switch(a.status){case 404:case 410:return d("WAWebWamEnumMediaDownloadResultType").MEDIA_DOWNLOAD_RESULT_TYPE.ERROR_TOO_OLD;case 416:return d("WAWebWamEnumMediaDownloadResultType").MEDIA_DOWNLOAD_RESULT_TYPE.ERROR_CANNOT_RESUME;case 401:return d("WAWebWamEnumMediaDownloadResultType").MEDIA_DOWNLOAD_RESULT_TYPE.ERROR_INVALID_URL;case 429:case 507:return d("WAWebWamEnumMediaDownloadResultType").MEDIA_DOWNLOAD_RESULT_TYPE.ERROR_THROTTLE;default:return d("WAWebWamEnumMediaDownloadResultType").MEDIA_DOWNLOAD_RESULT_TYPE.ERROR_UNKNOWN}if(a.name===d("WAAbortError").ABORT_ERROR)return d("WAWebWamEnumMediaDownloadResultType").MEDIA_DOWNLOAD_RESULT_TYPE.ERROR_CANCEL;return a instanceof d("WAWebHttpErrors").MmsDownloadFilehashMismatchError?d("WAWebWamEnumMediaDownloadResultType").MEDIA_DOWNLOAD_RESULT_TYPE.ERROR_ENC_HASH_MISMATCH:d("WAWebWamEnumMediaDownloadResultType").MEDIA_DOWNLOAD_RESULT_TYPE.ERROR_UNKNOWN}function l(a){if(a instanceof d("WAWebHttpErrors").HttpStatusCodeError)return a.status}function m(){return 1+Math.floor(Number.MAX_SAFE_INTEGER*Math.random())}function n(a,b){if(b==null)return;var c;a.overallDownloadResult===d("WAWebWamEnumMediaDownloadResultType").MEDIA_DOWNLOAD_RESULT_TYPE.ERROR_UNKNOWN?c=d("WAWebWamEnumWebcMediaOperationCode").WEBC_MEDIA_OPERATION_CODE.DOWNLOAD:a.overallUploadResult===d("WAWebWamEnumMediaUploadResultType").MEDIA_UPLOAD_RESULT_TYPE.ERROR_UNKNOWN&&(c=d("WAWebWamEnumWebcMediaOperationCode").WEBC_MEDIA_OPERATION_CODE.UPLOAD);if(c==null)return;new(d("WAWebWebcMediaErrorUnknownDetailsWamEvent").WebcMediaErrorUnknownDetailsWamEvent)({mediaId:a.mediaId,webcMediaOperation:c,webcMediaErrorName:b.name,webcMediaErrorMessage:b.message}).commit()}function o(a){if(!a)return d("WAWebWamEnumBackendStoreType").BACKEND_STORE_TYPE.NON_DIRECT_PATH;switch(a.slice(0,2).toLowerCase()){case"/v":return d("WAWebWamEnumBackendStoreType").BACKEND_STORE_TYPE.EVERSTORE;case"/o":return d("WAWebWamEnumBackendStoreType").BACKEND_STORE_TYPE.OIL;case"/m":return d("WAWebWamEnumBackendStoreType").BACKEND_STORE_TYPE.MANIFOLD}c("gkx")("26258")?d("WALogger").ERROR(i()).sendLogs("unrecognized-direct-path-type"):d("WALogger").ERROR(h(),a).sendLogs("unrecognized-direct-path-type");return null}g.getMetricOverallDownloadModeType=a;g.getMetricOverallUploadModeType=b;g.getMetricMediaType=e;g.getMetricUploadErrorResultType=f;g.getMetricDownloadErrorResultType=k;g.getStatusCode=l;g.generateMediaEventId=m;g.logErrorUnknownDetails=n;g.getMetricBackendStore=o}),98); __d("WAWebCreateMediaUploadMetrics",["WAWebABProps","WAWebHttpErrors","WAWebMapFileOriginToUploadOrigin","WAWebMediaUpload2WamEvent","WAWebMmsMediaTypes","WAWebWamEnumConnectionType","WAWebWamEnumMediaQuality","WAWebWamEnumMediaUploadResultType","WAWebWamEnumNetworkStackType","WAWebWamEnumOverallLastUploadRetryPhaseType","WAWebWamMediaMetricUtils"],(function(a,b,c,d,e,f,g){function a(a,b,e,f,g,h){h===void 0&&(h=!1);var i=d("WAWebWamMediaMetricUtils").generateMediaEventId(),j=new(d("WAWebMediaUpload2WamEvent").MediaUpload2WamEvent)({mediaId:i,connectionType:d("WAWebWamEnumConnectionType").CONNECTION_TYPE.HOSTNAME,overallMediaType:d("WAWebWamMediaMetricUtils").getMetricMediaType(a),overallMmsVersion:4,overallAttemptCount:e,networkStack:d("WAWebWamEnumNetworkStackType").NETWORK_STACK_TYPE.NATIVE,overallUploadMode:d("WAWebWamMediaMetricUtils").getMetricOverallUploadModeType(a),overallIsForward:f,overallUploadOrigin:b,uploadSource:c("WAWebMapFileOriginToUploadOrigin")(b,f),isViewOnce:g,overallUserVisibleT:0});if(a===d("WAWebMmsMediaTypes").MEDIA_TYPES.IMAGE&&d("WAWebABProps").getABPropConfigValue("hqp_log_enabled")){e=h?d("WAWebWamEnumMediaQuality").MEDIA_QUALITY.HIGHEST_QUALITY:d("WAWebWamEnumMediaQuality").MEDIA_QUALITY.DATA_SAVER;j.set({photoQualitySetting:e})}function k(a){j.set({overallMediaSize:a})}function l(a){a instanceof d("WAWebHttpErrors").HttpStatusCodeError&&j.set({resumeHttpCode:a.status})}function m(){j.set({overallUploadResult:d("WAWebWamEnumMediaUploadResultType").MEDIA_UPLOAD_RESULT_TYPE.DUPLICATE,overallIsFinal:!0,resumeHttpCode:200}),j.markOverallCumT(),j.commit()}function n(a){var b=a.hostName,c=a.hostClass;a=a.failCount;j.set({overallDomain:b,overallConnectionClass:c,overallRetryCount:a})}function o(){j.set({resumeHttpCode:404,overallUploadResult:d("WAWebWamEnumMediaUploadResultType").MEDIA_UPLOAD_RESULT_TYPE.OK,overallIsFinal:!0,uploadHttpCode:200,finalizeHttpCode:200}),j.markOverallCumT(),j.commit()}function p(a){j.set({overallUploadResult:d("WAWebWamMediaMetricUtils").getMetricUploadErrorResultType(a),overallIsFinal:!0});var b=d("WAWebWamMediaMetricUtils").getStatusCode(a);b!=null&&(j.uploadHttpCode=b,j.finalizeHttpCode=b);j.markOverallCumT();j.commit();d("WAWebWamMediaMetricUtils").logErrorUnknownDetails(j,a)}function q(a){j.set({overallT:a})}function r(a,b,c,e){var f=new(d("WAWebMediaUpload2WamEvent").MediaUpload2WamEvent)(j.all),g=d("WAWebWamMediaMetricUtils").getStatusCode(a),h=e===d("WAWebWamEnumOverallLastUploadRetryPhaseType").OVERALL_LAST_UPLOAD_RETRY_PHASE_TYPE.FINALIZE?g:f.finalizeHttpCode;f.set({mediaId:d("WAWebWamMediaMetricUtils").generateMediaEventId(),overallUploadResult:d("WAWebWamMediaMetricUtils").getMetricUploadErrorResultType(a),overallIsFinal:!1,overallT:b,overallRetryCount:c,overallLastUploadRetryPhase:e,finalizeHttpCode:h});g!=null&&(j.uploadHttpCode=g);j.markOverallCumT();f.commit();d("WAWebWamMediaMetricUtils").logErrorUnknownDetails(j,a)}function s(){j.startOverallEncryptT()}function t(){j.markOverallEncryptT()}function u(){j.set({uploadIsStreaming:!0})}function v(a){j.set({uploadBytesTransferred:a})}function w(a){a!=null&&j.set({isViewOnce:a}),j.markOverallUserVisibleT()}return{handleStreamUploadStart:u,handleArrayBufferCreated:k,handleCheckExistingError:l,handleCheckExistingSuccess:m,handleUploadHostFound:n,handleUploadSuccess:o,handleUploadError:p,handleUploadAttemptSuccess:q,handleUploadAttemptError:r,mediaId:i,handleEncryptionStart:s,handleEncryptionSuccess:t,handleUploadProgress:v,handleSendMessageStart:w}}g["default"]=a}),98); __d("WAWebCryptoCalculateStreamingSidecar",["Promise","WAArrayBuffersConcat","WACryptoHmac","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h,i=64*1024,j=16,k=10;function a(a,b){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){var e=a instanceof ArrayBuffer?a.byteLength:a.buffer.byteLength;e=e-j;e=Math.ceil(e/i);e=Array.from({length:e},function(b,e){b=e*i;e=b+j+i;b=a.slice(b,e);return d("WACryptoHmac").hmacSha256(c,b,k)});e=(yield (h||(h=b("Promise"))).all(e));return d("WAArrayBuffersConcat").concatArrayBuffers.apply(void 0,e)});return l.apply(this,arguments)}g.IV_LENGTH=j;g.HMAC_LENGTH=k;g.calculateStreamingSidecar=a}),98); __d("WAWebCryptoCalculateFirstFrameSidecar",["WACryptoHmac","WAWebCryptoCalculateStreamingSidecar"],(function(a,b,c,d,e,f,g){var h=16;function a(a,b,c){a=Math.ceil(a/h)*h;b=b.slice(0,d("WAWebCryptoCalculateStreamingSidecar").IV_LENGTH+a);return d("WACryptoHmac").hmacSha256(c,b,d("WAWebCryptoCalculateStreamingSidecar").HMAC_LENGTH)}g["default"]=a}),98); __d("WAWebCryptoCreateMediaKeys",["WABase64","WACryptoHkdf","WALogger","WAWebMiscErrors","WAWebMmsMediaTypes","asyncToGeneratorRuntime","err","gkx"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["decodeB64: invalid base64 string ",""]);h=function(){return a};return a}function a(a,b){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e=j(a),f;try{f=d("WABase64").decodeB64(b)}catch(a){c("gkx")("26258")||d("WALogger").LOG(h(),b)}if(!b||!e||!f)throw new(d("WAWebMiscErrors").MediaEncryptionError)("createKeys fail: !!mediakey: "+!!b+" info: "+e+" type: "+a);b=(yield d("WACryptoHkdf").extractAndExpand(f,e,112));if(!b||b.byteLength<112)throw new(d("WAWebMiscErrors").MediaEncryptionError)("computeMediaKeys: hkdf error");return{iv:b.slice(0,0+16),encKey:b.slice(16,16+32),macKey:b.slice(48,48+32),refKey:b.slice(80,80+32)}});return i.apply(this,arguments)}function j(a){switch(a){case d("WAWebMmsMediaTypes").MEDIA_TYPES.AUDIO:return"WhatsApp Audio Keys";case d("WAWebMmsMediaTypes").MEDIA_TYPES.DOCUMENT:return"WhatsApp Document Keys";case d("WAWebMmsMediaTypes").MEDIA_TYPES.GIF:return"WhatsApp Video Keys";case d("WAWebMmsMediaTypes").MEDIA_TYPES.IMAGE:return"WhatsApp Image Keys";case d("WAWebMmsMediaTypes").MEDIA_TYPES.PPIC:throw c("err")("Cannot create media keys for profile pics");case d("WAWebMmsMediaTypes").MEDIA_TYPES.PRODUCT:return"WhatsApp Image Keys";case d("WAWebMmsMediaTypes").MEDIA_TYPES.PTT:return"WhatsApp Audio Keys";case d("WAWebMmsMediaTypes").MEDIA_TYPES.STICKER:return"WhatsApp Image Keys";case d("WAWebMmsMediaTypes").MEDIA_TYPES.VIDEO:case d("WAWebMmsMediaTypes").MEDIA_TYPES.PTV:return"WhatsApp Video Keys";case d("WAWebMmsMediaTypes").MEDIA_TYPES.THUMBNAIL_DOCUMENT:return"WhatsApp Document Thumbnail Keys";case d("WAWebMmsMediaTypes").MEDIA_TYPES.STICKER_PACK:return"WhatsApp Sticker Pack Keys";case d("WAWebMmsMediaTypes").MEDIA_TYPES.THUMBNAIL_STICKER_PACK:return"WhatsApp Sticker Pack Thumbnail Keys";case d("WAWebMmsMediaTypes").MEDIA_TYPES.THUMBNAIL_IMAGE:return"WhatsApp Image Thumbnail Keys";case d("WAWebMmsMediaTypes").MEDIA_TYPES.THUMBNAIL_VIDEO:return"WhatsApp Video Thumbnail Keys";case d("WAWebMmsMediaTypes").MEDIA_TYPES.THUMBNAIL_LINK:return"WhatsApp Link Thumbnail Keys";case d("WAWebMmsMediaTypes").MEDIA_TYPES.TEMPLATE:throw c("err")("Cannot create media keys for template");case d("WAWebMmsMediaTypes").MEDIA_TYPES.HISTORY_SYNC:return"WhatsApp History Keys";case d("WAWebMmsMediaTypes").MEDIA_TYPES.MD_APP_STATE:return"WhatsApp App State Keys";case d("WAWebMmsMediaTypes").MEDIA_TYPES.PRODUCT_CATALOG_IMAGE:throw c("err")("Cannot create media keys for product catalog image");case d("WAWebMmsMediaTypes").MEDIA_TYPES.PAYMENT_BG_IMAGE:return"WhatsApp Payment Background Keys";case d("WAWebMmsMediaTypes").MEDIA_TYPES.NATIVE_AD_IMAGE:return"ads-image";case d("WAWebMmsMediaTypes").MEDIA_TYPES.MUSIC_ARTWORK:return"WhatsApp Music Artwork Keys";case d("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_AUDIO:case d("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_DOCUMENT:case d("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_GIF:case d("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_IMAGE:case d("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_PTT:case d("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_PTV:case d("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_STICKER:case d("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_VIDEO:case d("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_THUMBNAIL_LINK:throw c("err")("createKeys: newsletter media is not encrypted: "+a);default:a;return}}g["default"]=a}),98); __d("WAWebMmsPerformanceExperimentSwitch",["WAWebServerPropConstants"],(function(a,b,c,d,e,f,g){function a(a){return a>d("WAWebServerPropConstants").DEFAULT_MAX_FILE_SIZE_BYTES}function b(){return!0}g.shouldEncryptInChunks=a;g.isPerformanceExperimentEnabled=b}),98); __d("WAWebWebp",["$InternalEnum","WABinary","WALogger","WATypedArraysEqual"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["JSON not found in sticker file"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Sticker file not extended format."]);i=function(){return a};return a}var j=b("$InternalEnum")({VP8X:"VP8X",ANMF:"ANMF",EXIF:"EXIF",XMP:"XMP "}),k=12,l=8,m=4,n=20,o=2,p="}".charCodeAt(0),q=0;function r(a,b){b=u(b);var d=0;d+=k;while(d<a.byteLength){var e=a.slice(d,d+l),f=e.slice(0,m);e=t(e.slice(m,2*m));e%2!==0&&(e+=1);if(c("WATypedArraysEqual")(f,b))return{position:d,size:e+m+m};d+=l+e}return null}function a(a){if(!s(a)){d("WALogger").LOG(i());return null}var b=r(a,j.EXIF);if(!b)return null;a=a.slice(b.position,b.position+b.size);var c,e;for(var f=a.byteLength;f>0;--f)if(e==null&&a[f]===p)e=f;else if(e!=null&&a[f]===q){c=f+1;break}if(c==null||e==null){d("WALogger").WARN(h());return null}return{position:b.position+c,size:e-c+1}}function s(a){a=a.slice(k,k+m);return c("WATypedArraysEqual")(a,u(j.VP8X))}function e(a){a=new Uint8Array(a);return s(a)&&(o&a[n])!==0}function t(a){return a.reduce(function(a,b,c){return a+(b<<c*8)},0)}function f(a){var b=new(d("WABinary").Binary)();b.writeUint32(a,!0);return b.readByteArray()}function u(a){var b=new(d("WABinary").Binary)();b.writeString(a);return b.readByteArray()}g.Chunk=j;g.CHUNK_HEADER_SIZE=l;g.FOUR=m;g.findWebpChunk=r;g.findWebpMetadata=a;g.isExtendedFile=s;g.isAnimatedWebp=e;g.littleEndianToNumber=t;g.numberToLittleEndian=f;g.stringToUint8=u}),98); __d("WAWebWebpMetadata",["$InternalEnum","WAWebStickerMetadataParsing","WAWebWamEnumStickerMakerSourceType"],(function(a,b,c,d,e,f,g){var h=b("$InternalEnum")({CutoutImage:1,WebStickerMaker:2,IosStickerMaker:3,AndroidStickerMaker:4,TransparentImage:5,GIF:6});function a(a){return d("WAWebStickerMetadataParsing").toStickerMetadata(a)}function c(a){var b={};a.isFirstParty!=null&&(b[d("WAWebStickerMetadataParsing").STICKER_METADATA_FIELDS.isFirstParty]=a.isFirstParty?1:0);a.isFromStickerMaker!=null&&(b[d("WAWebStickerMetadataParsing").STICKER_METADATA_FIELDS.isFromStickerMaker]=a.isFromStickerMaker?1:0);a.emojis!=null&&(b[d("WAWebStickerMetadataParsing").STICKER_METADATA_FIELDS.emojis]=a.emojis);a.stickerPackId!=null&&(b[d("WAWebStickerMetadataParsing").STICKER_METADATA_FIELDS.stickerPackId]=a.stickerPackId);a.stickerPackName!=null&&(b[d("WAWebStickerMetadataParsing").STICKER_METADATA_FIELDS.stickerPackName]=a.stickerPackName);a.stickerPackPublisher!=null&&(b[d("WAWebStickerMetadataParsing").STICKER_METADATA_FIELDS.stickerPackPublisher]=a.stickerPackPublisher);a.stickerPackPlayStoreLink!=null&&(b[d("WAWebStickerMetadataParsing").STICKER_METADATA_FIELDS.stickerPackPlayStoreLink]=a.stickerPackPlayStoreLink);a.stickerPackAppleStoreLink!=null&&(b[d("WAWebStickerMetadataParsing").STICKER_METADATA_FIELDS.stickerPackAppleStoreLink]=a.stickerPackAppleStoreLink);a.isAvatar!=null&&(b[d("WAWebStickerMetadataParsing").STICKER_METADATA_FIELDS.isAvatar]=a.isAvatar?1:0);a.isAiSticker!=null&&(b[d("WAWebStickerMetadataParsing").STICKER_METADATA_FIELDS.isAiSticker]=a.isAiSticker?1:0);a.stickerMakerSourceType!=null&&(b[d("WAWebStickerMetadataParsing").STICKER_METADATA_FIELDS.stickerMakerSourceType]=a.stickerMakerSourceType);return b}function e(a){if(a==null)return null;switch(a){case h.CutoutImage:return d("WAWebWamEnumStickerMakerSourceType").STICKER_MAKER_SOURCE_TYPE.CUTOUT_IMAGE;case h.WebStickerMaker:return d("WAWebWamEnumStickerMakerSourceType").STICKER_MAKER_SOURCE_TYPE.WEB_STICKER_MAKER;case h.IosStickerMaker:return d("WAWebWamEnumStickerMakerSourceType").STICKER_MAKER_SOURCE_TYPE.IOS_STICKER_MAKER;case h.AndroidStickerMaker:return d("WAWebWamEnumStickerMakerSourceType").STICKER_MAKER_SOURCE_TYPE.ANDROID_STICKER_MAKER;case h.TransparentImage:return d("WAWebWamEnumStickerMakerSourceType").STICKER_MAKER_SOURCE_TYPE.TRANSPARENT_IMAGE;case h.GIF:return d("WAWebWamEnumStickerMakerSourceType").STICKER_MAKER_SOURCE_TYPE.GIF}}g.StickerMakerSourceType=h;g.toWebpMetadata=a;g.toRawWebpMetadata=c;g.getStickerMakerSourceType=e}),98); __d("WAWebStickerMetadataParsing",["WAWebWebpMetadata"],(function(a,b,c,d,e,f,g){"use strict";var h={isFirstParty:!1,isFromStickerMaker:!1,emojis:[],stickerPackId:null,stickerPackName:null,stickerPackPublisher:null,stickerPackPlayStoreLink:null,stickerPackAppleStoreLink:null,isAvatar:!1,isAiSticker:!1,stickerMakerSourceType:null},i={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",isAiSticker:"is-ai-sticker",stickerMakerSourceType:"sticker-maker-source-type"};function a(a){var b=a[i.isFirstParty],c=a[i.isFromStickerMaker],e=a[i.emojis],f=a[i.stickerPackId],g=a[i.stickerPackName],j=a[i.stickerPackPublisher],k=a[i.stickerPackPlayStoreLink],l=a[i.stickerPackAppleStoreLink],m=a[i.isAvatar],n=a[i.isAiSticker];a=d("WAWebWebpMetadata").StickerMakerSourceType.cast(a[i.stickerMakerSourceType]);var o=babelHelpers["extends"]({},h);if(b!=null){b=b===1;o.isFirstParty=b}if(c!=null){b=c===1;o.isFromStickerMaker=b}e!=null&&Array.isArray(e)&&(o.emojis=e);f!=null&&(o.stickerPackId=f);g!=null&&(o.stickerPackName=g);j!=null&&(o.stickerPackPublisher=j);k!=null&&(o.stickerPackPlayStoreLink=k);l!=null&&(o.stickerPackAppleStoreLink=l);if(m!=null){c=m===1;o.isAvatar=c}if(n!=null){b=n===1;o.isAiSticker=b}a!=null&&(o.stickerMakerSourceType=a);return o}g.DEFAULT_STICKER_METADATA=h;g.STICKER_METADATA_FIELDS=i;g.toStickerMetadata=a}),98); __d("WAWebGetWebpMetadata",["WALogger","WAWebWebp","WAWebWebpMetadata"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Failed to parse emojis out of sticker, returning empty object."]);h=function(){return a};return a}function i(a){a=new Uint8Array(a);var b=d("WAWebWebp").findWebpMetadata(a);if(!b)return{};var c=b.position;b=b.size;var e=new TextDecoder();a=a.slice(c,c+b);c=e.decode(a);try{b=JSON.parse(c);return b}catch(a){d("WALogger").LOG(h()).devConsole(a);return{}}}function a(a){a=i(a);a=d("WAWebWebpMetadata").toWebpMetadata(a);return a}g.getWebpMetadata=a}),98); __d("WAWebWebpParseWebp",["WALogger","WATypedArraysEqual","WAWebGetWebpMetadata","WAWebWebp"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Sticker file not extended format."]);h=function(){return a};return a}var i=3,j=5e3;function k(a){if(a===0)return 0;var b=Math.min(Math.floor(j/a),i);return Math.max(b,1)*a}var l=44,m=20,n=3,o=4,p={animationDuration:0,singleLoopDuration:0,emojis:[],isFirstParty:!1,isFromStickerMaker:!1,stickerPackId:null,stickerPackName:null,stickerPackPublisher:null,isAvatar:!1,isAiSticker:!1,stickerMakerSourceType:null};function a(a){var b=new Uint8Array(a);if(!d("WAWebWebp").isExtendedFile(b)){d("WALogger").LOG(h());return p}a=d("WAWebGetWebpMetadata").getWebpMetadata(a);var e=a.emojis,f=a.isFirstParty,g=a.isFromStickerMaker,i=a.stickerPackId,j=a.stickerPackName,q=a.stickerPackPublisher,r=a.isAvatar,s=a.isAiSticker;a=a.stickerMakerSourceType;e=babelHelpers["extends"]({},p,{emojis:e,isFirstParty:f,isFromStickerMaker:g,stickerPackId:i,stickerPackName:j,stickerPackPublisher:q,isAvatar:r,isAiSticker:s,stickerMakerSourceType:a});if(!d("WAWebWebp").isAnimatedWebp(b))return e;f=0;g=l;var t;while(c("WATypedArraysEqual")(b.slice(g,g+o),d("WAWebWebp").stringToUint8(d("WAWebWebp").Chunk.ANMF))){i=g+m;j=b.slice(i,i+n);if(j.length!==n)return e;f+=d("WAWebWebp").littleEndianToNumber(j);q=g+o;r=b.slice(q,q+o);if(r.length!==o)return e;g+=o*2+d("WAWebWebp").littleEndianToNumber(r);t==null&&(t=g)}s=k(f);return babelHelpers["extends"]({},e,{animationDuration:s,firstFrameLength:t,singleLoopDuration:f})}g.MAX_LOOPS=i;g.getTotalAnimationDuration=k;g.parseWebp=a}),98); __d("WAWebCryptoEncryptMedia",["Promise","WAArrayBuffersConcat","WACryptoAesCbc","WACryptoHmac","WALogger","WAMediaCalculateFilehash","WAPromiseProps","WATypedArraysConcat","WAWebCryptoCalculateFirstFrameSidecar","WAWebCryptoCalculateStreamingSidecar","WAWebCryptoCreateMediaKeys","WAWebMiscErrors","WAWebMmsMediaTypes","WAWebMmsPerformanceExperimentSwitch","WAWebWebpParseWebp","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["encryptMedia: error"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["encryptMedia: success"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["encryptMedia: start"]);k=function(){return a};return a}var l=10;function m(a,b,c){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e,f){var g=f.iv,i=f.encKey;f=f.macKey;i=(yield d("WACryptoAesCbc").aesCbcEncrypt(i,a,g));g=i.slice(g.byteLength);var j=(yield d("WACryptoHmac").hmacSha256(f,i,l)),k=(h||(h=b("Promise"))).resolve();if(e===d("WAWebMmsMediaTypes").MEDIA_TYPES.VIDEO||e===d("WAWebMmsMediaTypes").MEDIA_TYPES.AUDIO){var m=d("WAArrayBuffersConcat").concatArrayBuffers(i,j);k=d("WAWebCryptoCalculateStreamingSidecar").calculateStreamingSidecar(m,f)}m=h.resolve();if(e===d("WAWebMmsMediaTypes").MEDIA_TYPES.STICKER){e=d("WAWebWebpParseWebp").parseWebp(a);a=e.firstFrameLength;if(a!=null){e=d("WAArrayBuffersConcat").concatArrayBuffers(i,j);m=c("WAWebCryptoCalculateFirstFrameSidecar")(a,e,f)}}i=d("WAArrayBuffersConcat").concatArrayBuffers(g,j);return d("WAPromiseProps").promiseProps({ciphertextHmac:i,hash:d("WAMediaCalculateFilehash").calculateFilehash(i),sidecar:k,firstFrameSidecar:m})});return n.apply(this,arguments)}function a(a){var c=a.ivCiphertext,e=a.signature;a=a.macKey;c=d("WAArrayBuffersConcat").concatArrayBuffers(c,e);return{sidecar:d("WAWebCryptoCalculateStreamingSidecar").calculateStreamingSidecar(c,a),firstFrameSidecar:(h||(h=b("Promise"))).resolve()}}function e(a){var e=a.plaintext,f=a.ivCiphertext,g=a.signature;a=a.macKey;e=d("WAWebWebpParseWebp").parseWebp(e);e=e.firstFrameLength;return{sidecar:(h||(h=b("Promise"))).resolve(),firstFrameSidecar:e!=null?c("WAWebCryptoCalculateFirstFrameSidecar")(e,d("WAArrayBuffersConcat").concatArrayBuffers(f,g),a):(h||(h=b("Promise"))).resolve()}}var o=new Map([[d("WAWebMmsMediaTypes").MEDIA_TYPES.VIDEO,a],[d("WAWebMmsMediaTypes").MEDIA_TYPES.AUDIO,a],[d("WAWebMmsMediaTypes").MEDIA_TYPES.STICKER,e]]);function p(a,b,c){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e){var f=e.iv,g=e.encKey;e=e.macKey;g=d("WAWebMmsPerformanceExperimentSwitch").shouldEncryptInChunks(a.byteLength)?yield d("WACryptoAesCbc").aesCbcEncryptWithChunking(g,a,f):yield d("WACryptoAesCbc").aesCbcEncrypt(g,a,f);f=new Uint8Array(g).subarray(f.byteLength);var i=(yield d("WACryptoHmac").hmacSha256(e,g,l));a=(c=o.get(c)==null?void 0:o.get(c)({plaintext:a,ivCiphertext:g,signature:i,macKey:e}))!=null?c:{};g=a.sidecar;e=g===void 0?(h||(h=b("Promise"))).resolve():g;c=a.firstFrameSidecar;g=c===void 0?(h||(h=b("Promise"))).resolve():c;a=d("WATypedArraysConcat").concatTypedArrays(Uint8Array,[f,new Uint8Array(i)]).buffer;return d("WAPromiseProps").promiseProps({ciphertextHmac:a,hash:d("WAMediaCalculateFilehash").calculateFilehash(a),sidecar:e,firstFrameSidecar:g})});return q.apply(this,arguments)}function f(a){var e=a.mediaKey,f=a.plaintext,g=a.type;return new(h||(h=b("Promise")))(function(a,b){var h={mediaKey:e.slice(0,10),type:g};d("WALogger").LOG(k()).devConsole(h);if(!g)throw new(d("WAWebMiscErrors").MediaEncryptionError)('encryptMedia: missing "type"');if(!e)throw new(d("WAWebMiscErrors").MediaEncryptionError)('encryptMedia: missing "mediaKey"');c("WAWebCryptoCreateMediaKeys")(g,e).then(function(a){return d("WAWebMmsPerformanceExperimentSwitch").isPerformanceExperimentEnabled()?p(f,g,a):m(f,g,a)}).then(function(b){d("WALogger").LOG(j()).devConsole(h),a(b)})["catch"](function(a){d("WALogger").WARN(i()).devConsole(h,a);if(a instanceof d("WAWebMiscErrors").MediaEncryptionError)throw a;throw new(d("WAWebMiscErrors").MediaEncryptionError)("encryption error: "+String(a)+"; stack: "+a.stack)})["catch"](b)})}g["default"]=f}),98); __d("WAWebCryptoRandomMediaKey",["WABase64","WATimeUtils"],(function(a,b,c,d,e,f,g){function a(){var a=new Uint8Array(32);self.crypto.getRandomValues(a);return{key:d("WABase64").encodeB64(a),timestamp:d("WATimeUtils").unixTime()}}g["default"]=a}),98); __d("WAWebMediaDebugString",[],(function(a,b,c,d,e,f){function a(a){return(a=a==null?void 0:a.slice(0,10))!=null?a:""}f.getDebugString=a}),66); __d("WAWebMmsDownloadUploadCrashLogger",["$InternalEnum","WALogger","WAWebLocalStorage","justknobx"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["downloadUploadCrashLogger.likelyCrashedDuring","WithID","",""]);h=function(){return a};return a}a=b("$InternalEnum").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"]);var i="DownloadUploadCrashLoggerLikelyCrashed",j=new Set([a.DOWNLOAD_DECRYPTION_FINISHED,a.DOWNLOAD_ERROR,a.UPLOAD_FINISHED,a.UPLOAD_ERROR]);function k(a){return a.toLowerCase().replace(/(?:^|_)(\w)/g,function(a,b){return b.toLocaleUpperCase()})}function l(a){return Object.entries(a).map(function(a){var b=a[0];a=a[1];return b+": "+String(a)}).join(", ")}e=function(){function a(){this.hasPerformedInit=!1,this.$3=function(){c("WAWebLocalStorage")==null?void 0:c("WAWebLocalStorage").removeItem(i)}}var b=a.prototype;b.$1=function(){var a=c("WAWebLocalStorage")==null?void 0:c("WAWebLocalStorage").getItem(i);return a?JSON.parse(a):{}};b.$2=function(){c("WAWebLocalStorage")==null?void 0:c("WAWebLocalStorage").setItem(i,JSON.stringify(this.storage))};b.$4=function(){return c("justknobx")._("3944")};b.init=function(){if(this.hasPerformedInit||!this.$4())return;window.addEventListener("beforeunload",this.$3);this.storage=this.$1();Object.entries(this.storage).forEach(function(a){var b=a[0];a=a[1];var c=a.progressType;a=a.metadata;d("WALogger").WARN(h(),k(c),b,a?"AndData => "+l(a):"").sendLogs("download-upload-manager-likely-crashed")});this.$3();this.hasPerformedInit=!0};b.reset=function(){if(!this.$4())return;window.removeEventListener("beforeunload",this.$3);this.$3();this.hasPerformedInit=!1};b.mark=function(a,b,c){if(!this.$4())return;j.has(b)?delete this.storage[String(a)]:this.storage[String(a)]={progressType:b,metadata:c};this.$2()};return a}();f=new e();g.ProgressType=a;g.downloadUploadCrashLogger=f}),98); __d("WAWebUploadManager",["Promise","WAAbortError","WAFilteredCatch","WALogger","WAMemoizeConcurrent","WATimeUtils","WAWebCreateMediaUploadMetrics","WAWebCryptoEncryptMedia","WAWebCryptoRandomMediaKey","WAWebFileUtils","WAWebMediaDebugString","WAWebMmsClient","WAWebMmsClientErrors","WAWebMmsDownloadUploadCrashLogger","WAWebMmsPerformanceExperimentSwitch","WAWebPonyfillsUrlSearchParams","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["uploadManager.encryptAndUpload: error"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["uploadManager.encryptAndUpload: canceled"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["uploadManager.encryptAndUpload: success"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["uploadManager.encryptAndUpload: start"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["uploadManager._getExistingOrUpload: [","] error"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["uploadManager._getExistingOrUpload: [","] canceled"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["uploadManager._getExistingOrUpload: [","] success"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["uploadManager._getExistingOrUpload: [","] start"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["uploadManager.checkIfAlreadyUploaded: [","] error"]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["uploadManager.checkIfAlreadyUploaded: [","] canceled"]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["uploadManager.checkIfAlreadyUploaded: [","] success"]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["uploadManager.checkIfAlreadyUploaded: [","] start"]);t=function(){return a};return a}function u(a){var b=a.mediaKey;a=a.mediaKeyTimestamp;if(b!=null&&a!=null)return{mediaKey:b,mediaKeyTimestamp:a};b=c("WAWebCryptoRandomMediaKey")();a=b.key;b=b.timestamp;return{mediaKey:a,mediaKeyTimestamp:b}}a=function(){function a(){var a=this;this._checkIfAlreadyUploaded=c("WAMemoizeConcurrent")(function(a){return a.token},function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.encFilehash,e=a.type;e={encFilehash:b,type:e};b=d("WAWebMediaDebugString").getDebugString(b);d("WALogger").LOG(t(),b).devConsole(e);try{a=(yield c("WAWebMmsClient").checkIfUploadExists(a)["catch"](d("WAFilteredCatch").filteredCatch(d("WAWebMmsClientErrors").MediaNotFoundError,function(){return null})));d("WALogger").LOG(s(),b).devConsole(e);return a}catch(a){a.name===d("WAAbortError").ABORT_ERROR?d("WALogger").LOG(r(),b).devConsole(e,a):d("WALogger").WARN(q(),b).devConsole(e,a);throw a}});return function(b){return a.apply(this,arguments)}}());this._memoizedUpload=c("WAMemoizeConcurrent")(function(a){return a.token},function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.ciphertextHmac,d=a.encFilehash,e=a.type,f=a.signal,g=a.onUploadHostFound,h=a.onUploadAttemptSuccess,i=a.onUploadAttemptError,j=a.onUploadSuccess,k=a.onProgress,l=a.onFinalize,m=a.onStreamUploadStart,n=a.mediaId,o=a.generateThumbnailOnServer;d=(yield c("WAWebMmsClient").upload({ciphertextHmac:b,encFilehash:d,type:e,signal:f,onUploadHostFound:g,onUploadAttemptSuccess:h,onUploadAttemptError:i,onProgress:k,byteOffset:(b=a.byteOffset)!=null?b:0,onFinalize:l,onStreamUploadStart:m,mediaId:n,token:a.token,generateThumbnailOnServer:o}));j();return d});return function(b){return a.apply(this,arguments)}}());this._getExistingOrUpload=c("WAMemoizeConcurrent")(function(a){return a.token},function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){var c=b.ciphertextHmac,e=b.encFilehash,f=b.signal,g=b.type,h=b.onCheckExistingSuccess,i=b.onCheckExistingError,j=b.onUploadHostFound,k=b.onUploadAttemptSuccess,l=b.onUploadAttemptError,q=b.onUploadSuccess,r=b.onProgress,s=b.onFinalize,t=b.onStreamUploadStart,u=b.mediaId,v=b.generateThumbnailOnServer,w={encFilehash:e,type:g},x=d("WAWebMediaDebugString").getDebugString(e);d("WALogger").LOG(p(),x).devConsole(w);try{var y=(yield a._checkIfAlreadyUploaded({encFilehash:e,type:g,signal:f,mediaId:u,token:b.token,generateThumbnailOnServer:v})["catch"](function(a){i(a);throw a}).then(function(d){if((d==null?void 0:d.complete)===!0){h();return{directPath:d.directPath,handle:d.handle,url:d.url}}return a._memoizedUpload({ciphertextHmac:c,encFilehash:e,type:g,signal:f,onUploadHostFound:j,onUploadAttemptSuccess:k,onUploadAttemptError:l,onUploadSuccess:q,onCheckExistingSuccess:h,onCheckExistingError:i,onProgress:r,onFinalize:s,onStreamUploadStart:t,byteOffset:d==null?void 0:d.resume,mediaId:u,token:b.token,generateThumbnailOnServer:v})}));d("WALogger").LOG(o(),x).devConsole(w,y);return y}catch(a){a.name===d("WAAbortError").ABORT_ERROR?d("WALogger").LOG(n(),x).devConsole(w,a):d("WALogger").WARN(m(),x).devConsole(w,a);throw a}});return function(a){return c.apply(this,arguments)}}());d("WAWebMmsDownloadUploadCrashLogger").downloadUploadCrashLogger.init()}var e=a.prototype;e.encryptAndUpload=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=this,f=a.blob,g=a.signal,m=a.type,n=a.userUploadAttemptCount,o=a.forwardedFromWeb,p=a.uploadOrigin,q=a.onProgress,r=a.onFinalize,s=a.isViewOnce,t=a.isHdPhoto,w={type:m};d("WALogger").LOG(l()).devConsole(w);p=c("WAWebCreateMediaUploadMetrics")(m,p,n,o,s,t);var x=p.handleCheckExistingSuccess,y=p.handleCheckExistingError,z=p.handleUploadHostFound,A=p.handleUploadAttemptSuccess,B=p.handleUploadAttemptError,C=p.handleUploadSuccess,D=p.handleArrayBufferCreated;n=p.handleUploadError;var E=p.mediaId,F=p.handleEncryptionStart,G=p.handleEncryptionSuccess,H=p.handleStreamUploadStart,I=p.handleUploadProgress,J=function(a,b){q==null?void 0:q(a,b);b=b+a.loaded;I(b)};d("WAWebMmsDownloadUploadCrashLogger").downloadUploadCrashLogger.mark(E,d("WAWebMmsDownloadUploadCrashLogger").ProgressType.UPLOAD_ENCRYPTION_STARTED);try{if(d("WAWebMmsPerformanceExperimentSwitch").isPerformanceExperimentEnabled()){var K=u(a);s=(h||(h=b("Promise"))).resolve(f).then(function(a){d("WAWebMmsDownloadUploadCrashLogger").downloadUploadCrashLogger.mark(E,d("WAWebMmsDownloadUploadCrashLogger").ProgressType.UPLOAD_BLOB_TO_ARRAY_BUFFER_STARTED,{size:f instanceof Blob?f.size:f.byteLength});a=a instanceof Blob?d("WAWebFileUtils").blobToArrayBuffer(a):a;d("WAWebMmsDownloadUploadCrashLogger").downloadUploadCrashLogger.mark(E,d("WAWebMmsDownloadUploadCrashLogger").ProgressType.UPLOAD_BLOB_TO_ARRAY_BUFFER_FINISHED);return a}).then(function(a){D(a.byteLength);F();return c("WAWebCryptoEncryptMedia")({type:m,plaintext:a,mediaKey:K.mediaKey})}).then(function(b){var c=b.hash,f=b.ciphertextHmac,h=b.sidecar,i=b.firstFrameSidecar;G();d("WAWebMmsDownloadUploadCrashLogger").downloadUploadCrashLogger.mark(E,d("WAWebMmsDownloadUploadCrashLogger").ProgressType.UPLOAD_ENCRYPTION_FINISHED);b=a.mediaKey?e._getExistingOrUpload:e._memoizedUpload;return b({ciphertextHmac:f,encFilehash:c,type:m,signal:g,onCheckExistingSuccess:x,onCheckExistingError:y,onUploadHostFound:z,onUploadAttemptSuccess:A,onUploadAttemptError:B,onUploadSuccess:C,onProgress:J,onFinalize:r,onStreamUploadStart:H,mediaId:E,token:(b=a.token)!=null?b:c}).then(function(a){return{directPath:o?v(a.directPath):a.directPath,encFilehash:c,mediaKey:K.mediaKey,mediaKeyTimestamp:K.mediaKeyTimestamp,sidecar:h,firstFrameSidecar:i,url:a.url,handle:a.handle}})})}else{d("WAWebMmsDownloadUploadCrashLogger").downloadUploadCrashLogger.mark(E,d("WAWebMmsDownloadUploadCrashLogger").ProgressType.UPLOAD_BLOB_TO_ARRAY_BUFFER_STARTED,{size:f instanceof Blob?f.size:f.byteLength});t=f instanceof Blob?d("WAWebFileUtils").blobToArrayBuffer(f):(h||(h=b("Promise"))).resolve(f);d("WAWebMmsDownloadUploadCrashLogger").downloadUploadCrashLogger.mark(E,d("WAWebMmsDownloadUploadCrashLogger").ProgressType.UPLOAD_BLOB_TO_ARRAY_BUFFER_FINISHED);s=t.then(function(){var f=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){D(b.byteLength);var f=u(a),h=f.mediaKey;f=f.mediaKeyTimestamp;F();b=(yield c("WAWebCryptoEncryptMedia")({type:m,plaintext:b,mediaKey:h}));var i=b.ciphertextHmac,j=b.hash,k=b.sidecar;b=b.firstFrameSidecar;G();d("WAWebMmsDownloadUploadCrashLogger").downloadUploadCrashLogger.mark(E,d("WAWebMmsDownloadUploadCrashLogger").ProgressType.UPLOAD_ENCRYPTION_FINISHED);var l=a.mediaKey?e._getExistingOrUpload:e._memoizedUpload;i=(yield l({ciphertextHmac:i,encFilehash:j,type:m,signal:g,onCheckExistingSuccess:x,onCheckExistingError:y,onUploadHostFound:z,onUploadAttemptSuccess:A,onUploadAttemptError:B,onUploadSuccess:C,onFinalize:r,onStreamUploadStart:H,onProgress:J,mediaId:E,token:(l=a.token)!=null?l:j}));return{directPath:o?v(i.directPath):i.directPath,encFilehash:j,mediaKey:h,mediaKeyTimestamp:f,sidecar:k,firstFrameSidecar:b,url:i.url,handle:i.handle}});return function(a){return f.apply(this,arguments)}}())}p=(yield s);d("WALogger").LOG(k()).devConsole(w);d("WAWebMmsDownloadUploadCrashLogger").downloadUploadCrashLogger.mark(E,d("WAWebMmsDownloadUploadCrashLogger").ProgressType.UPLOAD_FINISHED);return p}catch(a){a.name===d("WAAbortError").ABORT_ERROR?d("WALogger").LOG(j()).devConsole(w,a):d("WALogger").WARN(i()).devConsole(w,a);d("WAWebMmsDownloadUploadCrashLogger").downloadUploadCrashLogger.mark(E,d("WAWebMmsDownloadUploadCrashLogger").ProgressType.UPLOAD_ERROR);n(a);throw a}});function e(b){return a.apply(this,arguments)}return e}();e.unencryptedUpload=function(a){var b=a.file,d=a.hash,e=a.type,f=a.signal,g=a.uploadOrigin,h=a.isViewOnce,i=a.generateThumbnailOnServer;g=c("WAWebCreateMediaUploadMetrics")(e,g,0,!1,h);h=g.handleCheckExistingSuccess;var j=g.handleCheckExistingError,k=g.handleUploadHostFound,l=g.handleUploadAttemptSuccess,m=g.handleUploadAttemptError,n=g.handleUploadSuccess,o=g.handleStreamUploadStart,p=g.handleUploadProgress;g=g.mediaId;var q=function(a,b){p(a.loaded+b)};a=(a=a.token)!=null?a:d;return this._getExistingOrUpload({ciphertextHmac:b,encFilehash:d,type:e,signal:f,onCheckExistingSuccess:h,onCheckExistingError:j,onUploadHostFound:k,onUploadAttemptSuccess:l,onUploadAttemptError:m,onUploadSuccess:n,onStreamUploadStart:o,onProgress:q,mediaId:g,token:a,generateThumbnailOnServer:i})};e.uploadCoverPhoto=function(a){var b=a.file,d=a.hash,e=a.type,f=a.signal,g=a.uploadOrigin,h=a.isViewOnce;g=c("WAWebCreateMediaUploadMetrics")(e,g,0,!1,h);h=g.handleCheckExistingSuccess;var i=g.handleCheckExistingError,j=g.handleUploadHostFound,k=g.handleUploadAttemptSuccess,l=g.handleUploadAttemptError,m=g.handleUploadSuccess,n=g.handleStreamUploadStart,o=g.handleUploadProgress;g=g.mediaId;var p=function(a,b){o(a.loaded+b)};d={ciphertextHmac:b,encFilehash:d,type:e,signal:f,onCheckExistingSuccess:h,onCheckExistingError:i,onUploadHostFound:j,onUploadAttemptSuccess:k,onUploadAttemptError:l,onUploadSuccess:m,onStreamUploadStart:n,onProgress:p,mediaId:g,token:(b=a.token)!=null?b:a.hash};return this._memoizedUpload(d)};return a}();e=new a();function v(a){a=a.split("?");var b=a[0];a=a[1];a=new(c("WAWebPonyfillsUrlSearchParams"))(a);var e=d("WATimeUtils").unixTime();a.set("_nc_hot",String(e));return b+"?"+a.toString()}g["default"]=e}),98); __d("WAWebSyncdNetCallbacksApi",["WABase64","WALogger","WAWebDownloadManager","WAWebMmsClientErrors","WAWebSyncdError","WAWebSyncdUploadFatalErrorMetric","WAWebUploadManager","WAWebWamEnumMdSyncdFatalErrorCode","WAWebWamEnumUploadOriginType","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: error downloading "," of expected size "," with expected hash b64 length of "," for collection ",""]);h=function(){return a};return a}a=function(a){return c("WAWebUploadManager").encryptAndUpload({blob:a,signal:new AbortController().signal,type:"md-app-state",uploadOrigin:d("WAWebWamEnumUploadOriginType").UPLOAD_ORIGIN_TYPE.UNKNOWN,userUploadAttemptCount:0,forwardedFromWeb:!1,isViewOnce:!1}).then(function(a){var b=a.mediaKey,e=a.directPath,f=a.encFilehash;a=a.handle;if(a==null)throw c("err")("Missing handle after uploading external patch to mms4");return{mediaKey:d("WABase64").decodeB64(b),directPath:e,encFilehash:d("WABase64").decodeB64(f),handle:a}})};e=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){var e=a.mediaKey,f=a.directPath,g=a.fileSha256,i=a.fileEncSha256;f={directPath:f,encFilehash:d("WABase64").encodeB64(i),filehash:d("WABase64").encodeB64(g),mediaKey:d("WABase64").encodeB64(e),type:"md-app-state",userDownloadAttemptCount:0};try{return yield d("WAWebDownloadManager").downloadManager.downloadAndMaybeDecrypt(babelHelpers["extends"]({signal:new AbortController().signal},f))}catch(e){d("WALogger").LOG(h(),b,a.fileSizeBytes,d("WABase64").encodeB64(a.fileEncSha256).length,c);if(e instanceof d("WAWebMmsClientErrors").MediaNotFoundError){d("WAWebSyncdUploadFatalErrorMetric").uploadFatalErrorMetric(b==="patch"?d("WAWebWamEnumMdSyncdFatalErrorCode").MD_SYNCD_FATAL_ERROR_CODE.EXTERNAL_PATCH_EXPIRED:d("WAWebWamEnumMdSyncdFatalErrorCode").MD_SYNCD_FATAL_ERROR_CODE.SNAPSHOT_EXPIRED,c);throw new(d("WAWebSyncdError").SyncdFatalError)("external patch expired")}throw e}});return function(b,c,d){return a.apply(this,arguments)}}();g.uploadSyncExternalPatch=a;g.downloadSyncBlob=e}),98); __d("WAWebSyncdOrphan",["Promise","WALogger","WASyncdConst","WAWebGetSyncAction","WAWebSyncdCollectionHandler","WAWebSyncdDbCallbacksApi","WAWebSyncdDisabled","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: end applyAllOrphansAndUnsupported"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: start applyAllOrphansAndUnsupported"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: finished applying orphans of type "," with ids=",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: applying orphans of type "," with ids=",""]);l=function(){return a};return a}function a(a,b){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){if(d("WAWebSyncdDisabled").isSyncdDisabled())return(h||(h=b("Promise"))).resolve();yield (h||(h=b("Promise"))).all([n(a),p(c),d("WAWebSyncdDbCallbacksApi").bulkGetAccountLid(c).then(function(a){return r(a.filter(Boolean))})])});return m.apply(this,arguments)}function n(a){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield d("WAWebSyncdDbCallbacksApi").getAdditionalLidMsgKeys(a));yield t(a.concat(b),d("WASyncdConst").SyncModelType.Msg)});return o.apply(this,arguments)}function p(a){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield t(a,d("WASyncdConst").SyncModelType.Chat)});return q.apply(this,arguments)}function r(a){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield t(a,d("WASyncdConst").SyncModelType.Account)});return s.apply(this,arguments)}function t(a,b){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){d("WALogger").DEV(l(),c,a);if(d("WAWebSyncdDisabled").isSyncdDisabled())return(h||(h=b("Promise"))).resolve();var e=(yield d("WAWebGetSyncAction").getSyncActionsByModelInfosInTransaction(a.map(function(a){return[a,c,d("WASyncdConst").SyncActionState.Orphan]})));yield d("WAWebSyncdCollectionHandler").applyIndividualMutations(e);d("WALogger").DEV(k(),c,a)});return u.apply(this,arguments)}function c(){return v.apply(this,arguments)}function v(){v=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(d("WAWebSyncdDisabled").isSyncdDisabled())return(h||(h=b("Promise"))).resolve();d("WALogger").LOG(j());var a=(yield d("WAWebGetSyncAction").getSyncActionsByActionStatesInTransaction([d("WASyncdConst").SyncActionState.Orphan,d("WASyncdConst").SyncActionState.Unsupported]));yield d("WAWebSyncdCollectionHandler").applyIndividualMutations(a);d("WALogger").LOG(i())});return v.apply(this,arguments)}function e(a){return w.apply(this,arguments)}function w(){w=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield t(a,d("WASyncdConst").SyncModelType.Agent)});return w.apply(this,arguments)}function f(a){return x.apply(this,arguments)}function x(){x=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield t(a,d("WASyncdConst").SyncModelType.ChatAssignment)});return x.apply(this,arguments)}function y(a){return z.apply(this,arguments)}function z(){z=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield t(a,d("WASyncdConst").SyncModelType.UserStatusMute)});return z.apply(this,arguments)}g.checkOrphanMutations=a;g.checkOrphanMessages=n;g.checkOrphanChats=p;g.applyAllOrphansAndUnsupported=c;g.checkOrphanAgents=e;g.checkOrphanChatAssignments=f;g.checkOrphanUserStatusMutes=y}),98); __d("WAWebSyncdResponseParser",["WADeprecatedWapParser","WALogger","WASyncdConst","WAWebSyncdDecode","WAWebSyncdError","WAWebSyncdMetricFatalError"],(function(a,b,c,d,e,f,g){"use strict";function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: collection "," did not get server error"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: collection "," got server code has_more_patches"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: retryable error: collection "," throws ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: fatal error 404: collection "," throws ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: fatal error: collection "," throws ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: collection "," got server error: ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: successfully parsed collection ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: collection "," has no version, patches or snapshot"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: start parsing syncd collections"]);p=function(){return a};return a}a=new(c("WADeprecatedWapParser"))("syncResponseParser",function(a){d("WALogger").LOG(p());var b=[];a=a.child("sync");a.mapChildrenWithTag("collection",function(a){var c=d("WASyncdConst").CollectionName.cast(a.attrString("name"));if(!c)throw new(d("WAWebSyncdError").SyncdFatalError)("invalid collection name");var e={name:c};e.state=q(a,e.name);a.hasAttr("version")&&(e.version=parseInt(a.attrString("version"),10));a.hasChild("patches")&&(e.patches=a.child("patches").mapChildrenWithTag("patch",function(a){return d("WAWebSyncdDecode").decodeSyncdPatch(c,a.contentBytes())}));a.hasChild("snapshot")&&(e.snapshot=d("WAWebSyncdDecode").decodeExternalBlobReference(c,a.child("snapshot").contentBytes()));b.push(e);e.version==null&&e.patches==null&&e.snapshot==null&&d("WALogger").LOG(o(),c);d("WALogger").LOG(n(),c)});return b});function q(a,b){if(a.hasAttr("type")&&a.attrString("type")==="error"){var c=a.child("error"),e=c.attrString("code");c=c.attrString("text");d("WALogger").LOG(m(),b,e);switch(e){case"409":return a.hasAttr("has_more_patches")?d("WASyncdConst").CollectionState.ConflictHasMore:d("WASyncdConst").CollectionState.Conflict;case"400":d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.XMPP_BAD_REQUEST_FOR_COLLECTION);d("WALogger").ERROR(l(),String(b),c).sendLogs("syncd: fatal error 400: collection "+String(b));return d("WASyncdConst").CollectionState.ErrorFatal;case"404":d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.XMPP_NOT_FOUND_FOR_COLLECTION);d("WALogger").ERROR(k(),String(b),c).sendLogs("syncd: fatal error: collection "+String(b));return d("WASyncdConst").CollectionState.ErrorFatal;default:d("WALogger").WARN(j(),String(b),c).sendLogs("syncd: retryable error: collection "+String(b));return d("WASyncdConst").CollectionState.ErrorRetry}}else if(a.hasAttr("has_more_patches")){d("WALogger").LOG(i(),b);return d("WASyncdConst").CollectionState.SuccessHasMore}else{d("WALogger").LOG(h(),b);return d("WASyncdConst").CollectionState.Success}}g.syncResponseParser=a}),98); __d("WAWebSyncdServerSync",["Promise","WADeprecatedSendIq","WALogger","WASyncdConst","WAWebGetPendingMutation","WAWebRuntimeEnvironmentUtils","WAWebSyncd","WAWebSyncdCollectionHandler","WAWebSyncdDbCallbacksApi","WAWebSyncdError","WAWebSyncdMetricCriticalBootstrapStage","WAWebSyncdMetricFatalError","WAWebSyncdMetrics","WAWebSyncdRequestBuilder","WAWebSyncdResponseParser","WAWebSyncdWamAppState","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: received sync response for collections:\n ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: completed network operation for collections:\n ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: retryable error: syncd global throws ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: fatal error: syncd global throws ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: end apply collections: ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: start apply collections:\n ",""]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["\n\t"," v",""],["\\n\\t"," v",""]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: local collection versions:"]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: deferred local mutation upload for ",""]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: reached max iterations for collections: ",""]);s=function(){return a};return a}var t=5,u=500;function a(a){return v.apply(this,arguments)}function v(){v=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=Math.random().toString(36).substr(2,5);yield B(a,c+" start serverSync");var e=[];a=[].concat(a);var f=0;while(f<t||a.length>0&&f<u){if(a.length===0)break;var g=(yield w(a,c)),i=g.doneCollections;g=g.refetchCollections;yield (h||(h=b("Promise"))).all(i.map(function(a){return B([a.name],c+" done collection "+a.name+",\n state: "+a.state)}));a=g;e=e.concat(i);f++;c=Math.random().toString(36).substr(2,5)}a.length>0&&(yield B(a,"error: max iterations"),d("WALogger").ERROR(s(),a).tags("syncd").sendLogs("syncd: max iteration"),e=e.concat(a.map(function(a){return{state:d("WASyncdConst").CollectionState.ErrorRetry,name:a}})));return e});return v.apply(this,arguments)}function w(a,b){return x.apply(this,arguments)}function x(){x=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){if(a.length===0)return{doneCollections:[],refetchCollections:[]};try{var e=(yield y(a,c)),f=e.collectionDetails,g=e.localCollectionVersions,i=e.collectionsToUpload;i.length>0&&d("WALogger").LOG(r(),i);d("WALogger").LOG(q(),c);g.forEach(function(a,b){d("WALogger").LOG(p(),b,(b=a)!=null?b:"(undefined)}")});var j=[],k=[];f.forEach(function(a){switch(a.state){case d("WASyncdConst").CollectionState.ErrorRetry:case d("WASyncdConst").CollectionState.ErrorFatal:case d("WASyncdConst").CollectionState.Blocked:k.push(a);return;default:j.push(a)}(a.state===d("WASyncdConst").CollectionState.Conflict||a.state===d("WASyncdConst").CollectionState.ConflictHasMore)&&d("WAWebSyncdWamAppState").incConflict()});d("WALogger").LOG(o(),c,j.map(function(a){return a.name}));var s=new(d("WAWebSyncdMetrics").SyncdEventFlow)();e=(yield (h||(h=b("Promise"))).all(j.map(function(a){return d("WAWebSyncdCollectionHandler").applyAppStateSyncResponse(a,c,g.get(a.name),s)})));s.end();d("WALogger").LOG(n(),j.map(function(a){return a.name}));var t=[];yield h.all(e.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a.state===d("WASyncdConst").CollectionState.Conflict){var b=(yield d("WAWebGetPendingMutation").getSyncPendingMutationsByCollectionInTransaction(a.name)).length>0;b?t.push(a.name):(a.state=d("WASyncdConst").CollectionState.Success,k.push(a))}else a.state===d("WASyncdConst").CollectionState.ConflictHasMore||a.state===d("WASyncdConst").CollectionState.SuccessHasMore||a.state===d("WASyncdConst").CollectionState.Success&&i.some(function(b){return b===a.name})?t.push(a.name):k.push(a)});return function(b){return a.apply(this,arguments)}}()));return{doneCollections:k,refetchCollections:t}}catch(b){if(b instanceof d("WAWebSyncdError").SyncdFatalError){d("WALogger").ERROR(m(),b.message).sendLogs("syncd: fatal error: syncd global throws "+b.message);yield B(a,c+" moving to fatal state: "+b.name+" "+b.message+" "+b.stack);f=a.map(function(a){return{state:d("WASyncdConst").CollectionState.ErrorFatal,name:a}});return{doneCollections:f,refetchCollections:[]}}d("WALogger").WARN(l(),c,b.message).sendLogs("syncd: retryable error: syncd global throws "+b.message);yield B(a,"["+c+"] retryable error: "+b);e=a.map(function(a){return{state:d("WASyncdConst").CollectionState.ErrorRetry,name:a,serverBackoff:b.errorBackoff}});return{doneCollections:e,refetchCollections:[]}}});return x.apply(this,arguments)}function y(a,b){return z.apply(this,arguments)}function z(){z=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e,f=(yield c("WAWebSyncdRequestBuilder")(a,b)),g=f.syncIqNode,h=f.collectionWithPendingMutationsIds,l=f.collectionWithEncryptedMutations,m=f.localCollectionVersions;f=f.collectionsToSkip;(e=d("WAWebSyncdMetricCriticalBootstrapStage")).reportSyncdCriticalBootstrapStage(e.SyncdCriticalBootstrapStageType.REQUEST_BUILT);var n="["+b+"] syncd: before sendIq for collections:\n "+a.map(function(a){var b;return"\n\t\n "+a+" v"+((b=m.get(a))!=null?b:"(undefined)")+" "+(((b=(b=h.get(a))==null?void 0:b.length)!=null?b:0)>0&&m.get(a)!=null?" with local changes":"")}).join(",")+"\n\n in flight: "+Array.from(d("WAWebSyncd").getInFlightCollections()).join(",")+"\n pending: "+Array.from(d("WAWebSyncd").getPendingCollections()).join(",")+"\n is worker? "+d("WAWebRuntimeEnvironmentUtils").isWorker().toString()+"\n ";d("WALogger").LOG(k(),b,n);yield B(a,n);n=(yield d("WADeprecatedSendIq").deprecatedSendIq(g,d("WAWebSyncdResponseParser").syncResponseParser));d("WALogger").LOG(j(),b,a);e.reportSyncdCriticalBootstrapStage(e.SyncdCriticalBootstrapStageType.RESPONSE_RECEIVED);if(n.success){d("WAWebSyncdMetricCriticalBootstrapStage").reportSyncdCriticalBootstrapStage(d("WAWebSyncdMetricCriticalBootstrapStage").SyncdCriticalBootstrapStageType.RESPONSE_PARSED_VALID);yield B(a,"["+b+"] after sendIq success");g=n.result;d("WALogger").LOG(i(),b,g.map(function(a){var b="\n"+a.name;a.version!=null&&(b+="\n\tupdated to version "+a.version);a.snapshot!=null&&(b+="\n\tcontains snapshot");a.patches!=null&&(b+="\n\tcontains "+a.patches.length+" patches");return b}));g.forEach(function(a){var b=h.get(a.name);b&&(a.syncedPendingMutationsId=b);b=l.get(a.name);b&&(a.syncedEncryptedMutations=b)});return{collectionDetails:g,localCollectionVersions:m,collectionsToUpload:f}}e=n.errorCode;a=n.errorText;b=n.errorBackoff;throw A(e,a,b)});return z.apply(this,arguments)}function A(a,b,c){switch(a){case 400:d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.XMPP_BAD_REQUEST_GLOBAL_ERROR);return new(d("WAWebSyncdError").SyncdFatalError)(b);case 404:d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.XMPP_NOT_FOUND_GLOBAL_ERROR);return new(d("WAWebSyncdError").SyncdFatalError)(b);case 405:d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.XMPP_BAD_METHOD_GLOBAL_ERROR);return new(d("WAWebSyncdError").SyncdFatalError)(b);case 406:d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.XMPP_NOT_ACCEPTABLE_GLOBAL_ERROR);return new(d("WAWebSyncdError").SyncdFatalError)(b);default:return new(d("WAWebSyncdError").SyncdRetryableError)(b,c)}}function B(a,c){return(h||(h=b("Promise"))).all(a.map(function(a){return d("WAWebSyncdDbCallbacksApi").writeSyncdLog(a,c)}))}g.serverSync=a}),98); __d("WAWebAgentSync",["Promise","WALogger","WASyncdAction","WASyncdConst","WAWebAgentCollection","WAWebAgentModelUtils","WAWebMsgCollection","WAWebSchemaAgent","WAWebSyncdIndexUtils","WAWebUnattributedMessageCollection","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["agent:syncd: operation not supported"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["agent:syncd: agentAction.name is empty"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["agent:syncd: malformed mutation"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["agent:delayed-attribution: couldn't find Agent for message id::"," with device id::",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["agent:delayed-attribution: couldn't find message id::",""]);m=function(){return a};return a}function n(){(h||(h=b("Promise"))).resolve().then(function(){d("WAWebUnattributedMessageCollection").UnattributedMessageCollection.getModelsArray().forEach(function(a){var b=a.id;a=a.deviceId;var c=d("WAWebMsgCollection").MsgCollection.get(b);if(c==null){d("WALogger").DEV(m(),b);return}var e=d("WAWebAgentCollection").AgentCollection.getByDeviceId(a);if(e==null){d("WALogger").DEV(l(),b,a);return}c.agentId=String(e.id);d("WAWebUnattributedMessageCollection").UnattributedMessageCollection.remove(b)})})}a=function(a){babelHelpers.inheritsLoose(c,a);function c(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=null,b)||babelHelpers.assertThisInitialized(c)}var e=c.prototype;e.getVersion=function(){return 7};e.getAction=function(){return d("WASyncdConst").Actions.Agent};e.applyMutations=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=[],c=[];a=a.map(function(a){try{var e=a.indexParts;e=e[1];e||d("WAWebSyncdIndexUtils").throwInvalidActionIndex();if(a.operation==="remove"){c.push(e);return{actionState:d("WASyncdConst").SyncActionState.Success}}if(a.operation==="set"){var f;a=a.value.agentAction;if(!a){d("WALogger").DEV(k());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}f=d("WAWebAgentModelUtils").getFormattedAgentName((f=a.name)!=null?f:"",(f=a.deviceID)!=null?f:-1);f===""&&d("WALogger").DEV(j());b.push({id:e,name:f,deviceId:(e=a.deviceID)!=null?e:-1,isDeleted:Boolean(a.isDeleted)});return{actionState:d("WASyncdConst").SyncActionState.Success}}d("WALogger").DEV(i());return{actionState:d("WASyncdConst").SyncActionState.Unsupported}}catch(a){return{actionState:d("WASyncdConst").SyncActionState.Failed}}});yield d("WAWebSchemaAgent").getAgentTable().bulkCreateOrMerge(b);d("WAWebAgentCollection").AgentCollection.add(b,{merge:!0});yield d("WAWebSchemaAgent").getAgentTable().bulkRemove(c);d("WAWebAgentCollection").AgentCollection.remove(c);n();return a});function c(b){return a.apply(this,arguments)}return c}();return c}(d("WASyncdAction").SyncActionBase);c=new a();g["default"]=c}),98); __d("WAWebArchiveChatSync",["Promise","WALogger","WANullthrows","WAServerSync.pb","WASyncAction.pb","WASyncdAction","WASyncdConst","WAWebApiActiveMessageRanges","WAWebChatDbUpdatesApi","WAWebMessageRangeUtils","WAWebPinChatSync","WAWebSettingsGetters","WAWebSettingsModel","WAWebSyncdActionUtils","WAWebSyncdGetChat","WAWebSyncdIndexUtils","WAWebSyncdUtils","WAWebWamEnumMdSyncdCriticalEventCode","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime","decodeProtobuf","encodeProtobuf"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[syncd][archive-chat]: archive-",", rangeEnclosedType-",", chatId-",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[syncd][archive-chat]: shouldKeepChatsArchived-",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[syncd][archive-chat]: archive-",", chatId-",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[syncd][archive-chat]: REMOVE operation not supported"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[syncd][archive-chat]: malformed mutation"]);m=function(){return a};return a}function n(a,b){switch(b){case d("WAWebMessageRangeUtils").MessageRangeEncloseType.RangesAreEqual:case d("WAWebMessageRangeUtils").MessageRangeEncloseType.RangeAEnclosesRangeB:return{actionState:d("WASyncdConst").SyncActionState.Success};case d("WAWebMessageRangeUtils").MessageRangeEncloseType.RangeBEnclosesRangeA:case d("WAWebMessageRangeUtils").MessageRangeEncloseType.RangesNotEnclosing:return{actionState:d("WASyncdConst").SyncActionState.Orphan,orphanModel:{modelType:d("WASyncdConst").SyncModelType.Chat,modelId:a.toString()}}}}a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=1,b)||babelHelpers.assertThisInitialized(c)}var f=e.prototype;f.getVersion=function(){return 3};f.getAction=function(){return d("WASyncdConst").Actions.Archive};f.validateSyncActionValue=function(a){a=a.archiveChatAction;var b=a==null?void 0:a.archived;return b!=null&&d("WAWebMessageRangeUtils").validateMessageRange(a==null?void 0:a.messageRange)};f.applyMutations=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=this,f=[];a=(yield (h||(h=b("Promise"))).all(a.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){try{if(a.operation==="set"){var b=a.indexParts;a=a.value;b=b[1];b||d("WAWebSyncdIndexUtils").throwInvalidActionIndex();if(!c("WAWebWid").isWid(b)){d("WAWebSyncdUtils").uploadCriticalEventMetric(d("WAWebWamEnumMdSyncdCriticalEventCode").MD_SYNCD_CRITICAL_EVENT_CODE.ACTION_INVALID_INDEX_DATA);return{actionState:d("WASyncdConst").SyncActionState.Malformed}}b=(yield d("WAWebSyncdGetChat").resolveChatForMutationIndex(d("WAWebWidFactory").createWid(b)));if(!b.success)return{actionState:d("WASyncdConst").SyncActionState.Orphan,orphanModel:b.orphanModel};b=b.chat.id;var g=a.archiveChatAction;if(!e.validateSyncActionValue(a)){d("WALogger").WARN(m());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}var h=c("WANullthrows")(g==null?void 0:g.archived);g=c("WANullthrows")(g==null?void 0:g.messageRange);b=d("WAWebWidFactory").createWid(b);b=(yield e.$ArchiveChatSync$p_1(b,h,g,a));b.updates&&f.push(b.updates);return b.syncApplyActionResult}d("WALogger").WARN(l());return{actionState:d("WASyncdConst").SyncActionState.Unsupported}}catch(a){return{actionState:d("WASyncdConst").SyncActionState.Failed}}});return function(b){return a.apply(this,arguments)}}())));f.length>0&&(yield d("WAWebChatDbUpdatesApi").setArchive(f));return a});function e(b){return a.apply(this,arguments)}return e}();f.$ArchiveChatSync$p_1=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e,f){yield d("WAWebApiActiveMessageRanges").removeActiveMessageRange(a.toString(),d("WAWebApiActiveMessageRanges").getActiveRangeAction("archive"));if(!b){d("WALogger").DEV(k(),b,a.toString());return{updates:{id:a.toString(),archive:b},syncApplyActionResult:{actionState:d("WASyncdConst").SyncActionState.Success}}}var g=(yield d("WAWebMessageRangeUtils").constructMessageRange(a,{forOutgoingMutation:!1}));g=d("WAWebMessageRangeUtils").compareMessageRanges(g,e);var h=d("encodeProtobuf").encodeProtobuf(d("WASyncAction.pb").SyncActionValueSpec,f).readBuffer();e=function(){return d("WAWebApiActiveMessageRanges").addActiveMessageRange(a.toString(),d("WAWebApiActiveMessageRanges").getActiveRangeAction("archive"),h)};f=d("WAWebSettingsGetters").getShowArchiveV2(c("WAWebSettingsModel"));d("WALogger").DEV(j(),f);d("WALogger").DEV(i(),b,g,a.toLogString());switch(g){case d("WAWebMessageRangeUtils").MessageRangeEncloseType.RangesAreEqual:case d("WAWebMessageRangeUtils").MessageRangeEncloseType.RangeBEnclosesRangeA:yield e();return{updates:{id:a.toString(),archive:b},syncApplyActionResult:n(a,g)};case d("WAWebMessageRangeUtils").MessageRangeEncloseType.RangeAEnclosesRangeB:case d("WAWebMessageRangeUtils").MessageRangeEncloseType.RangesNotEnclosing:if(f)return{updates:{id:a.toString(),archive:b},syncApplyActionResult:n(a,g)};yield e();return{updates:void 0,syncApplyActionResult:n(a,g)}}});function e(b,c,d,e){return a.apply(this,arguments)}return e}();f.getArchiveChatMutation=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){var e=(yield d("WAWebSyncdGetChat").getChatJidMutationIndexForChat(c));b={archiveChatAction:{archived:b,messageRange:yield d("WAWebMessageRangeUtils").constructMessageRange(c,{forOutgoingMutation:!0,mutationIndexJid:e})}};return d("WAWebSyncdActionUtils").buildPendingMutation({collection:d("WASyncdConst").CollectionName.RegularLow,indexArgs:[e],value:b,version:this.getVersion(),operation:d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET,timestamp:a,action:this.getAction()})});function c(b,c,d){return a.apply(this,arguments)}return c}();f.getMutationsForArchive=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e){var f=[this.getArchiveChatMutation(a,c,e)];c&&f.push(d("WAWebPinChatSync").PinChatSync.getPinMutation(a,!1,e));return(h||(h=b("Promise"))).all(f)});function c(b,c,d){return a.apply(this,arguments)}return c}();f.resolveConflicts=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){var f=d("decodeProtobuf").decodeProtobuf(d("WASyncAction.pb").SyncActionValueSpec,a.binarySyncAction),g=d("decodeProtobuf").decodeProtobuf(d("WASyncAction.pb").SyncActionDataSpec,e.binarySyncData).value,h=a.timestamp;e=e.timestamp;f=c("WANullthrows")(f.archiveChatAction);var i=c("WANullthrows")(g==null?void 0:g.archiveChatAction),j=d("WAWebMessageRangeUtils").compareMessageRanges(c("WANullthrows")(i.messageRange),c("WANullthrows")(f.messageRange));switch(j){case d("WAWebMessageRangeUtils").MessageRangeEncloseType.RangeAEnclosesRangeB:return d("WASyncdConst").ConflictResolutionState.ApplyRemoteAndDropLocal;case d("WAWebMessageRangeUtils").MessageRangeEncloseType.RangeBEnclosesRangeA:return d("WASyncdConst").ConflictResolutionState.SkipRemote;case d("WAWebMessageRangeUtils").MessageRangeEncloseType.RangesAreEqual:return h<=e?d("WASyncdConst").ConflictResolutionState.ApplyRemoteAndDropLocal:d("WASyncdConst").ConflictResolutionState.SkipRemote;case d("WAWebMessageRangeUtils").MessageRangeEncloseType.RangesNotEnclosing:var k=h<=e?(j=i.archived)!=null?j:!1:(h=f.archived)!=null?h:!1;e=d("WAWebMessageRangeUtils").mergeMessageRanges(c("WANullthrows")(i.messageRange),c("WANullthrows")(f.messageRange));j={archived:k,messageRange:e};var l=d("encodeProtobuf").encodeProtobuf(d("WASyncAction.pb").SyncActionValueSpec,babelHelpers["extends"]({},g,{archiveChatAction:j})).readBuffer();h=babelHelpers["extends"]({},a,{binarySyncAction:l});delete h.id;yield d("WAWebMessageRangeUtils").lockForMessageRangeSync(["chat"],[h],b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var b=JSON.parse(a.index);b=d("WAWebWidFactory").createWid(b[1]);yield d("WAWebApiActiveMessageRanges").addActiveMessageRange(b.toString(),d("WAWebApiActiveMessageRanges").getActiveRangeAction("archive"),l);return d("WAWebChatDbUpdatesApi").setArchive([{id:b.toString(),archive:k}])}));return d("WASyncdConst").ConflictResolutionState.SkipRemoteAndDropLocal}});function e(b,c){return a.apply(this,arguments)}return e}();return e}(d("WASyncdAction").SyncActionBase);e=new a();g["default"]=e}),98); __d("WAWebArchiveSettingSync",["Promise","WALogger","WASyncAction.pb","WASyncdAction","WASyncdConst","WAWebAndroidUnsupportedActionsSync","WAWebApiActiveMessageRanges","WAWebChatCollection","WAWebMessageRangeUtils","WAWebModelStorageUtils","WAWebSchemaActiveMessageRanges","WAWebSchemaChat","WAWebSettingsGetters","WAWebSettingsModel","WAWebSyncdDb","WAWebSyncdGetChat","WAWebUserPrefsMultiDevice","WAWebWidFactory","asyncToGeneratorRuntime","decodeProtobuf","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Archive_Setting_Sync: Update some chats as side effects for setting 'off'"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Archive_Setting_Sync: Updating chats side effects for setting 'off'"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["Archive_Setting_Sync: Update some chats as side effects for setting 'on'"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["Archive_Setting_Sync: Update chats side effects for setting 'on': Iteration took ","ms"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["Archive_Setting_Sync: Unsupported rangeEnclosedType ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["unarchive "," as ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["Archive_Setting_Sync: Updating chats side effects for setting 'on'"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["archive setting sync: no mutations"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["archive setting sync: operation not supported"]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: successfully set unarchiveChatsSetting to ",""]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: successfully set ArchiveV2Enabled to true"]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["archive setting sync: malformed mutation"]);t=function(){return a};return a}function u(){var a=babelHelpers.taggedTemplateLiteralLoose(["binarySyncAction should not be null"]);u=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=null,b)||babelHelpers.assertThisInitialized(c)}var f=e.prototype;f.getVersion=function(){return 4};f.getAction=function(){return d("WASyncdConst").Actions.UnarchiveChatsSetting};f.decodeValue=function(a){if(a.binarySyncData){var b=d("decodeProtobuf").decodeProtobuf(d("WASyncAction.pb").SyncActionDataSpec,a.binarySyncData);if(b.value)return b.value}else{if(!a.binarySyncAction){d("WALogger").ERROR(u()).tags("syncd").sendLogs("syncd binarySyncAction should not be null");throw c("err")("binarySyncAction should not be null")}return d("decodeProtobuf").decodeProtobuf(d("WASyncAction.pb").SyncActionValueSpec,a.binarySyncAction)}};f.applyMutations=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){var f=this;c("WAWebAndroidUnsupportedActionsSync").updatePrimaryAllowsAllMutationsFlag("other mutation");var g=e.setMutationsPendingToPersist;if(a.length>0){e=a[a.length-1];try{a=[];if(e.operation==="set"){e=e.value;e=e.unarchiveChatsSetting;if((e==null?void 0:e.unarchiveChats)==null){d("WALogger").WARN(t());return[{actionState:d("WASyncdConst").SyncActionState.Malformed}]}var h=e.unarchiveChats;e=(yield d("WAWebUserPrefsMultiDevice").getArchiveV2EnabledSetting());e||(yield d("WAWebUserPrefsMultiDevice").setArchiveV2EnabledSetting(!0),c("WAWebSettingsModel").archive=babelHelpers["extends"]({},d("WAWebSettingsGetters").getArchive(c("WAWebSettingsModel")),{enabled:!0}),d("WALogger").DEV(s()));yield d("WAWebUserPrefsMultiDevice").setUnarchiveChatsSetting(h);c("WAWebSettingsModel").archive=babelHelpers["extends"]({},d("WAWebSettingsGetters").getArchive(c("WAWebSettingsModel")),{classic:h});d("WALogger").DEV(r(),h);yield d("WAWebModelStorageUtils").getStorage().lock(["message","chat","sync-actions","active-message-ranges"],b("asyncToGeneratorRuntime").asyncToGenerator(function*(){a=(yield f.updateSideEffectOnChats(h,g)),yield d("WAWebSchemaChat").getChatTable().bulkCreateOrMerge(a)}));a.forEach(function(a){if(a.id!=null){var b=d("WAWebWidFactory").createWid(a.id);b=d("WAWebChatCollection").ChatCollection.get(b);b&&(b.archive=a.archive===!0)}});return[{actionState:d("WASyncdConst").SyncActionState.Success}]}d("WALogger").WARN(q());return[{actionState:d("WASyncdConst").SyncActionState.Unsupported}]}catch(a){return[{actionState:d("WASyncdConst").SyncActionState.Failed}]}}d("WALogger").WARN(p());return[{actionState:d("WASyncdConst").SyncActionState.Failed}]});function e(b,c){return a.apply(this,arguments)}return e}();f.$ArchiveSettingSync$p_1=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=this,e=[];d("WALogger").DEV(o());var f=self.performance.now(),g=(yield d("WAWebSchemaChat").getChatTable().all());g=g.filter(function(a){return a.archive}).map(function(a){return a.id});var i=(yield (h||(h=b("Promise"))).all(g.map(function(a){return d("WAWebApiActiveMessageRanges").getActiveMessageRanges(a)}))),j=i.flat().filter(function(a){return a.action===d("WAWebSchemaActiveMessageRanges").ActiveRangeAction.Archive}).map(function(a){return a.chatId});i=g.filter(function(a){return!j.includes(a)});g=(yield h.all(i.map(function(c){c=d("WAWebWidFactory").createWid(c);var e=JSON.stringify([d("WASyncdConst").Actions.Archive,c.toString({legacy:!0})]);c=a.find(function(a){return a.index===e});return c?(h||(h=b("Promise"))).resolve(c):d("WAWebSyncdDb").getSyncAction(e)})));i=g.filter(function(a){var b;if(!a)return!1;b=(b=c.decodeValue(a))==null?void 0:b.archiveChatAction;return[d("WASyncdConst").SyncActionState.Success,d("WASyncdConst").SyncActionState.Orphan].includes(a.actionState)&&(b==null?void 0:b.archived)===!0&&b.messageRange}).map(function(a){var b;b=a&&((b=c.decodeValue(a))==null?void 0:b.archiveChatAction);a=a?JSON.parse(a.index)[1]:"";return[a,b==null?void 0:b.messageRange]});var p=new Map(i);g=Array.from(p.keys());var q=(yield h.all(g.map(function(a){return d("WAWebMessageRangeUtils").constructMessageRange(d("WAWebWidFactory").createWid(a),{forOutgoingMutation:!1})})));g.forEach(function(a,b){b=q[b];var c=p.get(a);if(c){b=d("WAWebMessageRangeUtils").compareMessageRanges(b,c);if(b===d("WAWebMessageRangeUtils").MessageRangeEncloseType.RangeAEnclosesRangeB||b===d("WAWebMessageRangeUtils").MessageRangeEncloseType.RangesNotEnclosing){d("WALogger").DEV(n(),a,b);c=d("WAWebWidFactory").createWid(a);e.push({id:c.toString({legacy:!1}),archive:!1})}else d("WALogger").WARN(m(),b).sendLogs("ArchiveSettingSync setting true rangeEnclosedType unsupported")}});i=self.performance.now();d("WALogger").DEV(l(),i-f);e.length>0&&d("WALogger").DEV(k());return e});function c(b){return a.apply(this,arguments)}return c}();f.$ArchiveSettingSync$p_2=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=this,e=[];d("WALogger").DEV(j());var f=(yield d("WAWebSyncdDb").getSyncActionsRows(["action"],[d("WASyncdConst").Actions.Archive]));a=a.filter(function(a){return a.action===d("WASyncdConst").Actions.Archive});var g=a.map(function(a){return a.index});f=f.filter(function(a){return!g.includes(a.index)});f=[].concat(f,a);a=f.filter(function(a){if(a.actionState===d("WASyncdConst").SyncActionState.Success){a=c.decodeValue(a);return(a==null?void 0:(a=a.archiveChatAction)==null?void 0:a.archived)===!0}return!1});f=a.map(function(a){a=JSON.parse(a.index)[1];return d("WAWebWidFactory").createWid(a)});a=f.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebSyncdGetChat").resolveChatForMutationIndex(a));if(a.success)return d("WAWebWidFactory").createWid(a.chat.id)});return function(b){return a.apply(this,arguments)}}());f=(yield (h||(h=b("Promise"))).all(a));f.filter(Boolean).forEach(function(a){e.push({id:a.toString({legacy:!1}),archive:!0})});e.length>0&&d("WALogger").DEV(i());return e});function c(b){return a.apply(this,arguments)}return c}();f.updateSideEffectOnChats=function(a,b){return a?this.$ArchiveSettingSync$p_1(b):this.$ArchiveSettingSync$p_2(b)};return e}(d("WASyncdAction").SyncActionBase);e=new a();g["default"]=e}),98); __d("WAWebBotWelcomeRequestSync",["Promise","WALogger","WAServerSync.pb","WASyncdAction","WASyncdConst","WATimeUtils","WAWebChatCollection","WAWebDBUpdateChatTable","WAWebSyncdActionUtils","WAWebSyncdGetChat","WAWebSyncdIndexUtils","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[BotWelcomeRequestSync] mutation generated, set bot welcome request to "," for ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[BotWelcomeRequestSync] operation not supported"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[BotWelcomeRequestSync]: set bot welcome request to "," for ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[BotWelcomeRequestSync]: malformed mutation. isSent is not of boolean type"]);l=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(c,a);function c(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=1,b)||babelHelpers.assertThisInitialized(c)}var e=c.prototype;e.getVersion=function(){return 2};e.getAction=function(){return d("WASyncdConst").Actions.BotWelcomeRequest};e.applyMutations=function(a){return(h||(h=b("Promise"))).all(a.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){try{switch(a.operation){case"set":var b=a.indexParts;a=a.value;b=b[1];b||d("WAWebSyncdIndexUtils").throwInvalidActionIndex();a=(a=a.botWelcomeRequestAction)==null?void 0:a.isSent;if(a==null){d("WALogger").WARN(l());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}b=(yield d("WAWebSyncdGetChat").resolveChatForMutationIndex(d("WAWebWidFactory").createWid(b)));if(!b.success)return{actionState:d("WASyncdConst").SyncActionState.Orphan,orphanModel:b.orphanModel};b=d("WAWebWidFactory").createWid(b.chat.id);yield d("WAWebDBUpdateChatTable").updateChatTable(b,{hasRequestedWelcomeMsg:a});var c=d("WAWebChatCollection").ChatCollection.get(b);c!=null&&(c.hasRequestedWelcomeMsg=a);d("WALogger").DEV(k(),a,b);return{actionState:d("WASyncdConst").SyncActionState.Success};default:d("WALogger").WARN(j());return{actionState:d("WASyncdConst").SyncActionState.Unsupported}}}catch(a){return{actionState:d("WASyncdConst").SyncActionState.Failed}}});return function(b){return a.apply(this,arguments)}}()))};e.getBotWelcomeRequestSetMutation=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c={botWelcomeRequestAction:{isSent:b}};c=d("WAWebSyncdActionUtils").buildPendingMutation({collection:d("WASyncdConst").CollectionName.RegularLow,indexArgs:[yield d("WAWebSyncdGetChat").getChatJidMutationIndexForChat(a)],value:c,version:this.getVersion(),operation:d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET,timestamp:d("WATimeUtils").unixTime(),action:this.getAction()});d("WALogger").DEV(i(),b,a).devConsole(c);return c});function c(b,c){return a.apply(this,arguments)}return c}();return c}(d("WASyncdAction").SyncActionBase);c=new a();g["default"]=c}),98); __d("WAWebCallLogSync",["Promise","WALogger","WASyncdAction","WASyncdConst","WATimeUtils","WAWebUserPrefsMultiDevice","WAWebVoipActionWriteCallLogMessage","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["call log sync: operation not supported"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["call log sync: successfully applied"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["call log sync: malformed mutation"]);k=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(c,a);function c(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=null,b)||babelHelpers.assertThisInitialized(c)}var e=c.prototype;e.getVersion=function(){return 1};e.getAction=function(){return d("WASyncdConst").Actions.CallLog};e.applyMutations=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){return(h||(h=b("Promise"))).all(a.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){try{if(a.operation==="set"){var b=a.value;b=(b=b.callLogAction)!=null?b:{};b=b.callLogRecord;if(!b){d("WALogger").WARN(k());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}var c=d("WAWebUserPrefsMultiDevice").getPairingTimestamp();if(c!=null){var e=d("WATimeUtils").castMilliSecondsToUnixTime(a.timestamp);if(e>d("WATimeUtils").castToUnixTime(c)){c=!d("WATimeUtils").happenedWithin(e,d("WATimeUtils").MINUTE_SECONDS);yield d("WAWebVoipActionWriteCallLogMessage").generateCallLogFromCallSyncRecord({callLogRecord:b,shouldHideInConversation:c});d("WALogger").LOG(j())}}return{actionState:d("WASyncdConst").SyncActionState.Success}}else if(a.operation==="remove")return{actionState:d("WASyncdConst").SyncActionState.Success};d("WALogger").WARN(i());return{actionState:d("WASyncdConst").SyncActionState.Unsupported}}catch(a){return{actionState:d("WASyncdConst").SyncActionState.Failed}}});return function(b){return a.apply(this,arguments)}}()))});function c(b){return a.apply(this,arguments)}return c}();return c}(d("WASyncdAction").SyncActionBase);c=new a();g["default"]=c}),98); __d("WAWebChatAssignmentOpenedStatusSync",["Promise","WALogger","WAServerSync.pb","WASyncdAction","WASyncdConst","WATimeUtils","WAWebBizChatAssignmentOpenedAction","WAWebChatAssignmentCollection","WAWebSyncdActionUtils","WAWebSyncdGetChat","WAWebSyncdIndexUtils","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["chat_assignment_opened_status:syncd: operation not supported"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["chat_assignment_opened_status:syncd: malformed mutation"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["chat_assignment_opened_status:syncd: malformed mutation"]);k=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(c,a);function c(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=1,b)||babelHelpers.assertThisInitialized(c)}var e=c.prototype;e.getVersion=function(){return d("WASyncdConst").CHAT_ASSIGNMENT_SYNC_VERSION};e.getAction=function(){return d("WASyncdConst").Actions.ChatAssignmentOpenedStatus};e.createChatOpenedMutations=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=d("WATimeUtils").unixTimeMs();a=(yield (h||(h=b("Promise"))).all(a.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.chatId,e=a.agentId;a=a.chatOpenedByAgent;a={chatAssignmentOpenedStatus:{chatOpened:a}};return d("WAWebSyncdActionUtils").buildPendingMutation({timestamp:c,collection:d("WASyncdConst").CollectionName.Regular,operation:d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET,indexArgs:[yield d("WAWebSyncdGetChat").getChatJidMutationIndexForChat(d("WAWebWidFactory").createWid(b)),e],value:a,action:d("WASyncdConst").Actions.ChatAssignmentOpenedStatus,version:d("WASyncdConst").CHAT_ASSIGNMENT_SYNC_VERSION})});return function(b){return a.apply(this,arguments)}}())));return a});function c(b){return a.apply(this,arguments)}return c}();e.applyMutations=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=[];a=(yield (h||(h=b("Promise"))).all(a.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){try{var b=a.indexParts,e=b[1];b=b[2];(e==null||b==null)&&d("WAWebSyncdIndexUtils").throwInvalidActionIndex();if(a.operation==="set"){e=(yield d("WAWebSyncdGetChat").resolveChatForMutationIndex(d("WAWebWidFactory").createWid(e)));if(!e.success)return{actionState:d("WASyncdConst").SyncActionState.Orphan,orphanModel:e.orphanModel};e=d("WAWebWidFactory").createWid(e.chat.id);a=a.value.chatAssignmentOpenedStatus;if(!a){d("WALogger").DEV(k());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}a=a.chatOpened;if(a==null){d("WALogger").DEV(j());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}var f=e.toJid()+"_"+b,g=d("WAWebChatAssignmentCollection").ChatAssignmentCollection.get(f);if(g==null)return{actionState:d("WASyncdConst").SyncActionState.Orphan,orphanModel:{modelId:f,modelType:d("WASyncdConst").SyncModelType.ChatAssignment}};c.push({id:f,chatId:e.toJid(),agentId:b,chatOpenedByAgent:a});return{actionState:d("WASyncdConst").SyncActionState.Success}}d("WALogger").DEV(i());return{actionState:d("WASyncdConst").SyncActionState.Unsupported}}catch(a){return{actionState:d("WASyncdConst").SyncActionState.Failed}}});return function(b){return a.apply(this,arguments)}}())));yield d("WAWebBizChatAssignmentOpenedAction").updateLocalOpenedState(c);return a});function c(b){return a.apply(this,arguments)}return c}();return c}(d("WASyncdAction").SyncActionBase);c=new a();g["default"]=c}),98); __d("WAWebChatAssignmentSync",["Promise","WALogger","WAServerSync.pb","WASyncdAction","WASyncdConst","WATimeUtils","WAWebAgentCollection","WAWebBizChatAssignmentAction","WAWebChatAssignmentCollection","WAWebSchemaChatAssignment","WAWebSyncBootstrap","WAWebSyncdActionUtils","WAWebSyncdGetChat","WAWebSyncdIndexUtils","WAWebSyncdOrphan","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["chat_assignment:syncd: operation not supported"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["chat_assignment:syncd: malformed mutation"]);j=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=1,b)||babelHelpers.assertThisInitialized(c)}var f=e.prototype;f.getVersion=function(){return d("WASyncdConst").CHAT_ASSIGNMENT_SYNC_VERSION};f.getAction=function(){return d("WASyncdConst").Actions.ChatAssignment};f.createChatAssignmentMutations=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=d("WATimeUtils").unixTimeMs();a=(yield (h||(h=b("Promise"))).all(a.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.chatId;a=a.agentId;a={chatAssignment:{deviceAgentID:a}};return d("WAWebSyncdActionUtils").buildPendingMutation({timestamp:c,collection:d("WASyncdConst").CollectionName.Regular,operation:d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET,indexArgs:[yield d("WAWebSyncdGetChat").getChatJidMutationIndexForChat(d("WAWebWidFactory").createWid(b))],value:a,action:d("WASyncdConst").Actions.ChatAssignment,version:d("WASyncdConst").CHAT_ASSIGNMENT_SYNC_VERSION})});return function(b){return a.apply(this,arguments)}}())));return a});function c(b){return a.apply(this,arguments)}return c}();f.applyMutations=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=[],f=[],g=[],k=(yield (h||(h=b("Promise"))).all(a.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){try{var b=a.indexParts;b=b[1];b||d("WAWebSyncdIndexUtils").throwInvalidActionIndex();if(a.operation==="set"){var h=a.value.chatAssignment;if(!h){d("WALogger").DEV(j());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}var k=(h=h.deviceAgentID)!=null?h:"";h=d("WAWebAgentCollection").AgentCollection.get(k);if(k!==""&&h==null)return{actionState:d("WASyncdConst").SyncActionState.Orphan,orphanModel:{modelId:k,modelType:d("WASyncdConst").SyncModelType.Agent}};b=(yield d("WAWebSyncdGetChat").resolveChatForMutationIndex(d("WAWebWidFactory").createWid(b)));if(!b.success)return{actionState:d("WASyncdConst").SyncActionState.Orphan,orphanModel:b.orphanModel};var l=d("WAWebWidFactory").createWid(b.chat.id);d("WAWebChatAssignmentCollection").ChatAssignmentCollection.getAgentCollectionForChatId(l).filter(function(a){return a.id!==k}).forEach(function(a){return f.push(l.toJid()+"_"+a.id)});k!==""&&e.push({id:l.toJid()+"_"+k,chatId:l.toJid(),agentId:k,chatOpenedByAgent:!1});c("WAWebSyncBootstrap").isSyncDBootstrapInProcess()||g.push({chatId:l,agent:h,timestamp:Math.floor(a.timestamp/1e3)});return{actionState:d("WASyncdConst").SyncActionState.Success}}d("WALogger").DEV(i());return{actionState:d("WASyncdConst").SyncActionState.Unsupported}}catch(a){return{actionState:d("WASyncdConst").SyncActionState.Failed}}});return function(b){return a.apply(this,arguments)}}())));yield d("WAWebSchemaChatAssignment").getChatAssignmentTable().bulkCreateOrMerge(e);d("WAWebChatAssignmentCollection").ChatAssignmentCollection.processChatAssignments(e);yield d("WAWebSchemaChatAssignment").getChatAssignmentTable().bulkRemove(f);d("WAWebChatAssignmentCollection").ChatAssignmentCollection.remove(f);d("WAWebBizChatAssignmentAction").createChatAssignmentSystemMsgs(g);d("WAWebBizChatAssignmentAction").triggerChatAssignmentNotification(e,a.map(function(a){return a.timestamp}).join("-"));a=e.map(function(a){return a.id.toString()});d("WAWebSyncdOrphan").checkOrphanChatAssignments(a);return k});function e(b){return a.apply(this,arguments)}return e}();return e}(d("WASyncdAction").SyncActionBase);e=new a();g["default"]=e}),98); __d("WAWebClearChatSync",["Promise","WALogger","WANullthrows","WAServerSync.pb","WASyncAction.pb","WASyncdAction","WASyncdConst","WAWebABProps","WAWebAndroidUnsupportedActionsSync","WAWebApiActiveMessageRanges","WAWebBackendApi","WAWebChatCollection","WAWebDBMessageRange","WAWebDBQueryAndRemoveMessageHistory","WAWebMdSyncdDogfoodingFeatureUsageWamEvent","WAWebMessageRangeUtils","WAWebMsgKey","WAWebPersistedJobDefinitions","WAWebPersistedJobManager","WAWebSyncdActionUtils","WAWebSyncdDb","WAWebSyncdGetChat","WAWebSyncdIndexUtils","WAWebSyncdUtils","WAWebWamEnumMdFeatureCode","WAWebWamEnumMdSyncdCriticalEventCode","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime","decodeProtobuf","encodeProtobuf","gkx"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[syncd][clear-chat]: chatId-",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[syncd][clear-chat]: REMOVE operation not supported"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[syncd][clear-chat]: malformed mutation"]);k=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=1,b)||babelHelpers.assertThisInitialized(c)}var f=e.prototype;f.getVersion=function(){return 6};f.getAction=function(){return d("WASyncdConst").Actions.ClearChat};f.$ClearChatSync$p_1=function(a,b,e,f){var g=new Set();a.forEach(function(a){if(a.actionName===d("WASyncdConst").Actions.Star&&a.timestamp>b){a=d("WAWebSyncdIndexUtils").getMsgKeyFromStarActionIndex(a.index);g.add(a.toString());f!=null&&a.remote.equals(f)&&g.add(new(c("WAWebMsgKey"))({fromMe:a.fromMe,id:a.id,remote:e}).toString())}});return g};f.validateSyncActionValue=function(a){a=a.clearChatAction;return d("WAWebMessageRangeUtils").validateMessageRange(a==null?void 0:a.messageRange)};f.applyMutations=function(a,e){var f=this;c("WAWebAndroidUnsupportedActionsSync").updatePrimaryAllowsAllMutationsFlag("other mutation");var g=e.allSupportedSetMutations;return(h||(h=b("Promise"))).all(a.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){try{if(a.operation==="set"){var b,e=a.indexParts,h=a.value,i=e[1],l=e[2];e=e[3];(!i||!l||!e)&&d("WAWebSyncdIndexUtils").throwInvalidActionIndex();if(!c("WAWebWid").isWid(i)){d("WAWebSyncdUtils").uploadCriticalEventMetric(d("WAWebWamEnumMdSyncdCriticalEventCode").MD_SYNCD_CRITICAL_EVENT_CODE.ACTION_INVALID_INDEX_DATA);return{actionState:d("WASyncdConst").SyncActionState.Malformed}}if(!f.validateSyncActionValue(h)){d("WALogger").WARN(k());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}i=(yield d("WAWebSyncdGetChat").resolveChatForMutationIndex(d("WAWebWidFactory").createWid(i)));if(!i.success)return{actionState:d("WASyncdConst").SyncActionState.Orphan,orphanModel:i.orphanModel};var m=d("WAWebWidFactory").createWid(i.chat.id);b=d("WAWebMessageRangeUtils").replaceMessageRangeRemoteJid(m,c("WANullthrows")((b=h.clearChatAction)==null?void 0:b.messageRange));a=f.$ClearChatSync$p_1(g,a.timestamp,m,i.chat.accountLid==null?null:d("WAWebWidFactory").createWid(i.chat.accountLid));return f.$ClearChatSync$p_2(d("WAWebWidFactory").createWid(i.chat.id),b,l==="1",e==="0",a,h)}d("WALogger").WARN(j());return{actionState:d("WASyncdConst").SyncActionState.Unsupported}}catch(a){return{actionState:d("WASyncdConst").SyncActionState.Failed}}});return function(b){return a.apply(this,arguments)}}()))};f.clearChat=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e){b=(yield d("WAWebDBQueryAndRemoveMessageHistory").queryAndRemoveMessagesInMessageRange(a,b,{skipStarred:!c,skipMessages:e}));b.length>0&&(d("WAWebBackendApi").frontendFireAndForget("deleteModelsForLastAddOnPreview",{messagesIds:b}),yield d("WAWebPersistedJobManager").getJobManager().waitUntilPersisted(d("WAWebPersistedJobDefinitions").jobSerializers.deleteAddOns(a.toString(),b)));c=d("WAWebChatCollection").ChatCollection.get(a);c&&c.deleteMessages(b)});function c(b,c,d,e){return a.apply(this,arguments)}return c}();f.$ClearChatSync$p_2=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e,f,g){g=d("encodeProtobuf").encodeProtobuf(d("WASyncAction.pb").SyncActionValueSpec,g).readBuffer();d("WALogger").DEV(i(),a.toString());yield d("WAWebApiActiveMessageRanges").addActiveMessageRange(a.toString(),d("WAWebApiActiveMessageRanges").getActiveRangeAction("clearChat",{deleteMedia:e,deleteStarred:c}),g);yield this.clearChat(a,b,c,f);return d("WAWebABProps").getABPropConfigValue("web_clear_delete_keep_orphaned")?{actionState:d("WASyncdConst").SyncActionState.Orphan,orphanModel:{modelType:d("WASyncdConst").SyncModelType.Chat,modelId:a.toString()}}:{actionState:d("WASyncdConst").SyncActionState.Success}});function c(b,c,d,e,f,g){return a.apply(this,arguments)}return c}();f.getClearChatMutation=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e,f,g){g===void 0&&(g=!1);c("gkx")("26258")||new(d("WAWebMdSyncdDogfoodingFeatureUsageWamEvent").MdSyncdDogfoodingFeatureUsageWamEvent)({mdSyncdDogfoodingFeature:e?d("WAWebWamEnumMdFeatureCode").MD_FEATURE_CODE.CLEAR_CHAT_REMOVE_STARRED_MUTATION:d("WAWebWamEnumMdFeatureCode").MD_FEATURE_CODE.CLEAR_CHAT_KEEP_STARRED_MUTATION}).commit();g=g?b.toString():yield d("WAWebSyncdGetChat").getChatJidMutationIndexForChat(b);b=(yield d("WAWebMessageRangeUtils").constructForwardMovingMessageRange(b,g));g=this.$ClearChatSync$p_3(d("WAWebWidFactory").createWid(g),e,f||!1);e=(yield d("WAWebSyncdDb").getPendingMutationsRowsByIndex(["index"],d("WAWebSyncdActionUtils").buildIndex(this.getAction(),g)));if(e.length){f=e.reduce(function(a,b){return a.timestamp>b.timestamp?a:b});e=d("decodeProtobuf").decodeProtobuf(d("WASyncAction.pb").SyncActionValueSpec,f.binarySyncAction);e=(f=e.clearChatAction)==null?void 0:f.messageRange;e&&(b=d("WAWebMessageRangeUtils").mergeMessageRanges(b,e),d("WAWebDBMessageRange").logMaybeMillisecondTimestamp(b.lastMessageTimestamp,"pendingMutationRange"))}f={clearChatAction:{messageRange:b}};return d("WAWebSyncdActionUtils").buildPendingMutation({collection:d("WASyncdConst").CollectionName.RegularHigh,indexArgs:g,value:f,version:this.getVersion(),operation:d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET,timestamp:a,action:this.getAction()})});function e(b,c,d,e,f){return a.apply(this,arguments)}return e}();f.$ClearChatSync$p_3=function(a,b,c){return[a.toJid(),b?"1":"0",c?"1":"0"]};f.resolveConflicts=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){var f=this,g=d("decodeProtobuf").decodeProtobuf(d("WASyncAction.pb").SyncActionValueSpec,a.binarySyncAction),h=d("decodeProtobuf").decodeProtobuf(d("WASyncAction.pb").SyncActionDataSpec,e.binarySyncData).value,i=a.timestamp;e=e.timestamp;g=c("WANullthrows")(g.clearChatAction);var j=c("WANullthrows")(h==null?void 0:h.clearChatAction),k=d("WAWebMessageRangeUtils").compareMessageRanges(c("WANullthrows")(j.messageRange),c("WANullthrows")(g.messageRange));switch(k){case d("WAWebMessageRangeUtils").MessageRangeEncloseType.RangeAEnclosesRangeB:return d("WASyncdConst").ConflictResolutionState.ApplyRemoteAndDropLocal;case d("WAWebMessageRangeUtils").MessageRangeEncloseType.RangeBEnclosesRangeA:return d("WASyncdConst").ConflictResolutionState.SkipRemote;case d("WAWebMessageRangeUtils").MessageRangeEncloseType.RangesAreEqual:return i<=e?d("WASyncdConst").ConflictResolutionState.ApplyRemoteAndDropLocal:d("WASyncdConst").ConflictResolutionState.SkipRemote;case d("WAWebMessageRangeUtils").MessageRangeEncloseType.RangesNotEnclosing:var l=d("WAWebMessageRangeUtils").mergeMessageRanges(c("WANullthrows")(j.messageRange),c("WANullthrows")(g.messageRange));k={messageRange:l};var m=d("encodeProtobuf").encodeProtobuf(d("WASyncAction.pb").SyncActionValueSpec,babelHelpers["extends"]({},h,{clearChatAction:k})).readBuffer();i=babelHelpers["extends"]({},a,{binarySyncAction:m});delete i.id;yield d("WAWebMessageRangeUtils").lockForMessageRangeSync(["message-association","chat"],[i],b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var b=JSON.parse(a.index),c=d("WAWebWidFactory").createWid(b[1]),e=b[2]==="1";b=b[3]==="1";yield d("WAWebApiActiveMessageRanges").addActiveMessageRange(c.toString(),d("WAWebApiActiveMessageRanges").getActiveRangeAction("clearChat",{deleteStarred:e,deleteMedia:b}),m);return f.clearChat(c,l,e)}));return d("WASyncdConst").ConflictResolutionState.SkipRemoteAndDropLocal}});function e(b,c){return a.apply(this,arguments)}return e}();return e}(d("WASyncdAction").SyncActionBase);e=new a();g["default"]=e}),98); __d("WAWebContactShortName",["WALogger","WAWebAlphaRegex","WAWebNonEmptyString"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[short-name] unable to get short name for contact"]);h=function(){return a};return a}function a(a){if(a==null)return null;a=a.split(/\s/);a=a[0];if(c("WAWebAlphaRegex").exec(a))return d("WAWebNonEmptyString").asMaybeNonEmptyString(a);d("WALogger").LOG(h());return null}g.getShortName=a}),98); __d("WAWebLidContactsGatingUtils",["WAWebABProps"],(function(a,b,c,d,e,f,g){function a(){return d("WAWebABProps").getABPropConfigValue("allow_lid_contacts_storage")}function b(){return d("WAWebABProps").getABPropConfigValue("allow_share_lid_contacts_vcard")}function c(){return d("WAWebABProps").getABPropConfigValue("allow_lid_contacts_add_to_group")}function e(){return d("WAWebABProps").getABPropConfigValue("allow_lid_contacts_new_1on1_chat")}g.isLidStorageEnabled=a;g.isLidVcardSharingEnabled=b;g.isLidContactAddToGroupEnabled=c;g.isLidContactOneOnOneChatEnabled=e}),98); __d("WAWebContactSync",["Promise","WAJids","WALogger","WAServerSync.pb","WASyncdAction","WASyncdConst","WATimeUtils","WAWebApiContact","WAWebBotGating","WAWebContactCollection","WAWebContactShortName","WAWebDBCreateLidPnMappings","WAWebDeleteStatusAction","WAWebLidContactsGatingUtils","WAWebSyncContactsJob","WAWebSyncdActionUtils","WAWebSyncdDbCallbacksApi","WAWebSyncdIndexUtils","WAWebSyncdOrphan","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: added "," contacts, removed "," contacts"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: handler done"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: handler after save"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: before pn job"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: handler after loop"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["contact sync: operation not supported"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["contact sync: malformed mutation"]);o=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(c,a);function c(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=null,b)||babelHelpers.assertThisInitialized(c)}var e=c.prototype;e.getVersion=function(){return 2};e.getAction=function(){return d("WASyncdConst").Actions.Contact};e.applyMutations=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e){e===void 0&&(e=!1);var f=[],g=[],p=[],q=d("WAWebLidContactsGatingUtils").isLidStorageEnabled();c=(yield (h||(h=b("Promise"))).all(a.map(function(a){try{var b=a.indexParts;b=b[1];b||d("WAWebSyncdIndexUtils").throwInvalidActionIndex();var c=d("WAWebWidFactory").createUserWid(b);if(a.operation==="set"){var e=a.value.contactAction;if(!e){d("WALogger").WARN(o());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}if(c.isUser()&&c.isLid()&&!q)return{actionState:d("WASyncdConst").SyncActionState.Skipped};b={id:b,name:e.fullName||"",shortName:e.firstName||((b=d("WAWebContactShortName").getShortName(e.fullName))!=null?b:""),type:"in",syncToAddressbook:e.saveOnPrimaryAddressbook,isAddressBookContact:1,isContactSyncCompleted:0};if(c.isUser()&&!c.isLid()&&e.lidJid!=null){e=d("WAWebWidFactory").toUserLidOrThrow(d("WAWebWidFactory").createUserWid(e.lidJid,"lid"));p.push({lid:e,pn:d("WAWebWidFactory").toUserWid(c)})}f.push(b);d("WAWebContactCollection").ContactCollection.add(babelHelpers["extends"]({},b,{id:c}),{merge:!0});d("WAWebSyncContactsJob").syncNewContact(c);return{actionState:d("WASyncdConst").SyncActionState.Success}}if(a.operation==="remove"){if(c.isUser()&&c.isLid()&&!q)return{actionState:d("WASyncdConst").SyncActionState.Skipped};if(d("WAWebBotGating").isBotReceiveEnabled()&&c.isBot())return{actionState:d("WASyncdConst").SyncActionState.Skipped};e=d("WAWebContactCollection").ContactCollection.get(c);e!=null&&e.setNotMyContact();g.push(c);return{actionState:d("WASyncdConst").SyncActionState.Success}}d("WALogger").WARN(n());return{actionState:d("WASyncdConst").SyncActionState.Unsupported}}catch(a){return{actionState:d("WASyncdConst").SyncActionState.Failed}}})));d("WALogger").LOG(m());d("WALogger").LOG(l());yield d("WAWebDBCreateLidPnMappings").createLidPnMappings({mappings:p,flushImmediately:!0,learningSource:"other"});yield d("WAWebApiContact").createOrMergeAddressBookContacts(f);d("WALogger").LOG(k());e===!0&&(yield d("WAWebSyncdDbCallbacksApi").writeSyncdLog(d("WASyncdConst").CollectionName.CriticalUnblockLow,"handler after save"));d("WAWebSyncdOrphan").checkOrphanUserStatusMutes(f.map(function(a){return a.id}));if(g.length>0){a=g.map(function(a){return a.isLid()?d("WAJids").toLidUserJid(a.user):d("WAJids").toPhoneUserJid(a.user)});yield d("WAWebApiContact").setNotAddressBookContacts(a);d("WAWebDeleteStatusAction").clearStatusForRemovedContact()}d("WALogger").LOG(j());e===!0&&(yield d("WAWebSyncdDbCallbacksApi").writeSyncdLog(d("WASyncdConst").CollectionName.CriticalUnblockLow,"handler done"));d("WALogger").DEV(i(),f.length,g.length);return c});function c(b,c,d){return a.apply(this,arguments)}return c}();e.getContactSyncMutation=function(a,b,c,e,f,g){g===void 0&&(g=!1);var h=d("WATimeUtils").unixTimeMs();b={contactAction:{fullName:(b=b)!=null?b:void 0,firstName:(b=c)!=null?b:void 0,lidJid:f?f.toString({legacy:!0}):void 0,saveOnPrimaryAddressbook:(c=e)!=null?c:void 0}};return d("WAWebSyncdActionUtils").buildPendingMutation({collection:d("WASyncdConst").CollectionName.CriticalUnblockLow,indexArgs:[a.toString({legacy:!0})],operation:g?d("WAServerSync.pb").SyncdMutation$SyncdOperation.REMOVE:d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET,version:this.getVersion(),value:b,timestamp:h,action:this.getAction()})};return c}(d("WASyncdAction").SyncActionBase);c=new a();g["default"]=c}),98); __d("WAWebDeleteChatSync",["Promise","WALogger","WANullthrows","WAServerSync.pb","WASyncAction.pb","WASyncdAction","WASyncdConst","WAWebAndroidUnsupportedActionsSync","WAWebApiActiveMessageRanges","WAWebBackendApi","WAWebBizCoexGatingUtils","WAWebBizCoexUtils","WAWebChatCollection","WAWebChatDeleteBridge","WAWebDBMessageRange","WAWebDBQueryAndRemoveMessageHistory","WAWebMdSyncdDogfoodingFeatureUsageWamEvent","WAWebMessageRangeUtils","WAWebNonMessageDataRequestHistorySyncOnDemandUtils","WAWebPersistedJobDefinitions","WAWebPersistedJobManager","WAWebSyncdActionUtils","WAWebSyncdDb","WAWebSyncdGetChat","WAWebSyncdIndexUtils","WAWebSyncdUtils","WAWebWamEnumMdFeatureCode","WAWebWamEnumMdSyncdCriticalEventCode","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime","decodeProtobuf","encodeProtobuf","gkx"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[syncd][delete-chat]: rangeEnclosedType-"," chatId-",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[syncd][delete-chat]: REMOVE operation not supported"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[syncd][delete-chat]: malformed mutation"]);k=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=1,b)||babelHelpers.assertThisInitialized(c)}var f=e.prototype;f.getVersion=function(){return 6};f.getAction=function(){return d("WASyncdConst").Actions.DeleteChat};f.validateSyncActionValue=function(a){a=a.deleteChatAction;return d("WAWebMessageRangeUtils").validateMessageRange(a==null?void 0:a.messageRange)};f.applyMutations=function(a){var e=this;c("WAWebAndroidUnsupportedActionsSync").updatePrimaryAllowsAllMutationsFlag("other mutation");return(h||(h=b("Promise"))).all(a.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){try{if(a.operation==="set"){var b,f=a.indexParts;a=a.value;var g=f[1];f=f[2];(!g||!f)&&d("WAWebSyncdIndexUtils").throwInvalidActionIndex();if(!c("WAWebWid").isWid(g)){d("WAWebSyncdUtils").uploadCriticalEventMetric(d("WAWebWamEnumMdSyncdCriticalEventCode").MD_SYNCD_CRITICAL_EVENT_CODE.ACTION_INVALID_INDEX_DATA);return{actionState:d("WASyncdConst").SyncActionState.Malformed}}if(!e.validateSyncActionValue(a)){d("WALogger").WARN(k());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}g=(yield d("WAWebSyncdGetChat").resolveChatForMutationIndex(d("WAWebWidFactory").createWid(g)));if(!g.success)return{actionState:d("WASyncdConst").SyncActionState.Orphan,orphanModel:g.orphanModel};g=d("WAWebWidFactory").createWid(g.chat.id);b=d("WAWebMessageRangeUtils").replaceMessageRangeRemoteJid(g,c("WANullthrows")((b=a.deleteChatAction)==null?void 0:b.messageRange));return e.$DeleteChatSync$p_1(g,b,f==="0",a)}d("WALogger").WARN(j());return{actionState:d("WASyncdConst").SyncActionState.Unsupported}}catch(a){return{actionState:d("WASyncdConst").SyncActionState.Failed}}});return function(b){return a.apply(this,arguments)}}()))};f.deleteChat=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&(d("WAWebBizCoexUtils").deleteChatFromFallbackHostedAdvSystemMsgOnPlaceholderCache(a),d("WAWebBizCoexUtils").clearDedupInitialHostedSystemMsgCache());var c=d("WAWebChatCollection").ChatCollection.get(a);if(b){b=(yield d("WAWebDBQueryAndRemoveMessageHistory").queryAndRemoveMessagesInMessageRange(a,b,{forceDeleteAllMessagesExceptInitialEncryption:!0}));b.length>0&&(d("WAWebBackendApi").frontendFireAndForget("deleteModelsForLastAddOnPreview",{messagesIds:b}),yield d("WAWebPersistedJobManager").getJobManager().waitUntilPersisted(d("WAWebPersistedJobDefinitions").jobSerializers.deleteAddOns(a.toString(),b)));c&&c.deleteMessages(b)}else yield d("WAWebChatDeleteBridge").deleteFromStorage(a),c&&c["delete"]();d("WAWebNonMessageDataRequestHistorySyncOnDemandUtils").deleteChatFromInitialSyncBoundary(a)});function c(b,c){return a.apply(this,arguments)}return c}();f.$DeleteChatSync$p_1=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e){e=d("encodeProtobuf").encodeProtobuf(d("WASyncAction.pb").SyncActionValueSpec,e).readBuffer();yield d("WAWebApiActiveMessageRanges").addActiveMessageRange(a.toString(),d("WAWebApiActiveMessageRanges").getActiveRangeAction("deleteChat",{deleteMedia:c}),e);c=(yield d("WAWebMessageRangeUtils").constructMessageRange(a,{forOutgoingMutation:!1}));e=d("WAWebMessageRangeUtils").compareMessageRanges(c,b);d("WALogger").DEV(i(),e,a.toString());switch(e){case d("WAWebMessageRangeUtils").MessageRangeEncloseType.RangeAEnclosesRangeB:case d("WAWebMessageRangeUtils").MessageRangeEncloseType.RangesNotEnclosing:yield this.deleteChat(a,b);break;default:yield this.deleteChat(a);break}return{actionState:d("WASyncdConst").SyncActionState.Success}});function c(b,c,d,e){return a.apply(this,arguments)}return c}();f.getDeleteChatMutation=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e){c("gkx")("26258")||new(d("WAWebMdSyncdDogfoodingFeatureUsageWamEvent").MdSyncdDogfoodingFeatureUsageWamEvent)({mdSyncdDogfoodingFeature:d("WAWebWamEnumMdFeatureCode").MD_FEATURE_CODE.DELETE_MUTATION}).commit();var f=(yield d("WAWebSyncdGetChat").getChatJidMutationIndexForChat(b)),g=d("WAWebWidFactory").createWid(f);b=(yield d("WAWebMessageRangeUtils").constructForwardMovingMessageRange(b,f));f=d("WAWebSyncdActionUtils").buildIndex(this.getAction(),this.buildDeleteChatIndexArgs(d("WAWebWidFactory").createWid(f),e||!1));f=(yield d("WAWebSyncdDb").getPendingMutationsRowsByIndex(["index"],f));if(f.length){f=f.reduce(function(a,b){return a.timestamp>b.timestamp?a:b});f=d("decodeProtobuf").decodeProtobuf(d("WASyncAction.pb").SyncActionValueSpec,f.binarySyncAction);f=(f=f.deleteChatAction)==null?void 0:f.messageRange;f&&(b=d("WAWebMessageRangeUtils").mergeMessageRanges(b,f),d("WAWebDBMessageRange").logMaybeMillisecondTimestamp(b.lastMessageTimestamp,"pendingMutationRange"))}return this.buildDeleteChatMutation({timestamp:a,indexWid:g,mergedRange:b,deleteMediaFiles:e||!1})});function e(b,c,d){return a.apply(this,arguments)}return e}();f.resolveConflicts=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){var f=this,g=d("decodeProtobuf").decodeProtobuf(d("WASyncAction.pb").SyncActionValueSpec,a.binarySyncAction),h=d("decodeProtobuf").decodeProtobuf(d("WASyncAction.pb").SyncActionDataSpec,e.binarySyncData).value,i=a.timestamp;e=e.timestamp;g=c("WANullthrows")(g.deleteChatAction);var j=c("WANullthrows")(h==null?void 0:h.deleteChatAction),k=d("WAWebMessageRangeUtils").compareMessageRanges(c("WANullthrows")(j.messageRange),c("WANullthrows")(g.messageRange));switch(k){case d("WAWebMessageRangeUtils").MessageRangeEncloseType.RangeAEnclosesRangeB:return d("WASyncdConst").ConflictResolutionState.ApplyRemoteAndDropLocal;case d("WAWebMessageRangeUtils").MessageRangeEncloseType.RangeBEnclosesRangeA:return d("WASyncdConst").ConflictResolutionState.SkipRemote;case d("WAWebMessageRangeUtils").MessageRangeEncloseType.RangesAreEqual:return i<=e?d("WASyncdConst").ConflictResolutionState.ApplyRemoteAndDropLocal:d("WASyncdConst").ConflictResolutionState.SkipRemote;case d("WAWebMessageRangeUtils").MessageRangeEncloseType.RangesNotEnclosing:var l=d("WAWebMessageRangeUtils").mergeMessageRanges(c("WANullthrows")(j.messageRange),c("WANullthrows")(g.messageRange));k={messageRange:l};var m=d("encodeProtobuf").encodeProtobuf(d("WASyncAction.pb").SyncActionValueSpec,babelHelpers["extends"]({},h,{deleteChatAction:k})).readBuffer();i=babelHelpers["extends"]({},a,{binarySyncAction:m});delete i.id;yield d("WAWebMessageRangeUtils").lockForMessageRangeSync(["message-association","chat"],[i],b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var b=JSON.parse(a.index),c=d("WAWebWidFactory").createWid(b[1]);yield d("WAWebApiActiveMessageRanges").addActiveMessageRange(c.toString(),d("WAWebApiActiveMessageRanges").getActiveRangeAction("deleteChat",{deleteMedia:b[2]==="1"}),m);return f.deleteChat(c,l)}));return d("WASyncdConst").ConflictResolutionState.SkipRemoteAndDropLocal}});function e(b,c){return a.apply(this,arguments)}return e}();f.buildDeleteChatMutation=function(a){var b=a.timestamp,c=a.indexWid,e=a.mergedRange;a=a.deleteMediaFiles;e={deleteChatAction:{messageRange:e}};return d("WAWebSyncdActionUtils").buildPendingMutation({collection:d("WASyncdConst").CollectionName.RegularHigh,indexArgs:this.buildDeleteChatIndexArgs(c,a),value:e,version:this.getVersion(),operation:d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET,timestamp:b,action:this.getAction()})};f.buildDeleteChatIndexArgs=function(a,b){return[a.toJid(),b?"1":"0"]};return e}(d("WASyncdAction").SyncActionBase);e=new a();g["default"]=e}),98); __d("WAWebAddonProcessDeleteForMe",["Promise","WALogger","WAWebAddonConstants","WAWebAddonDBTable","WAWebAddonSortUtils","WAWebAddonUpdateDataUtils","WAWebMsgType","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["processDeleteForMe failed: ",""]);i=function(){return a};return a}function a(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){return d("WAWebAddonDBTable").addonDBTable.getByMsgKey(d("WAWebMsgType").MSG_TYPE.COMMENT,a)});return j.apply(this,arguments)}function k(a,b){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){yield d("WAWebAddonUpdateDataUtils").updateAddonsInTableMode({processMode:d("WAWebAddonConstants").AddonProcessMode.DeleteForMe,tableMode:a},{remove:b})});return l.apply(this,arguments)}function m(a){return Array.from(d("WAWebAddonSortUtils").groupAddonsByTableMode(a)).map(function(b){var c=b[0];b=b[1];return k(c,b)["catch"](function(b){d("WALogger").ERROR(i(),b).tags("messaging","addons").sendLogs("deleteAddonForMe: "+((b=a[0])==null?void 0:b.type)+" in "+String(c)+" failed");return})})}function n(a){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=m(a);yield (h||(h=b("Promise"))).all(a)});return o.apply(this,arguments)}function c(a){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield n([a])});return p.apply(this,arguments)}g.hasDeleteAddonForMe=a;g.processDeleteForMe=n;g.processDeleteForMeSingle=c}),98); __d("WAWebDeleteMessageForMeSync",["Promise","WALogger","WANullthrows","WAServerSync.pb","WASyncAction.pb","WASyncdAction","WASyncdConst","WATimeUtils","WAWebAddonProcessDeleteForMe","WAWebBackendApi","WAWebChatLoadMessages","WAWebCurrentUser","WAWebDBMessageDelete","WAWebFrontendMsgGetters","WAWebLidMigrationUtils","WAWebMsgCollection","WAWebMsgGetters","WAWebMsgKey","WAWebPersistedJobDefinitions","WAWebPersistedJobManager","WAWebSyncdActionUtils","WAWebSyncdGetChat","WAWebSyncdIndexUtils","WAWebSyncdResolveMessages","WAWebSyncdUtils","WAWebWamEnumMdSyncdCriticalEventCode","WAWebWidFactory","WAWebWidToJid","asyncToGeneratorRuntime","decodeProtobuf"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: after deleting messages"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: before deleting messages"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["delete_message_for_me_sync: operation not supported"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: successfully deleted "," for me."]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["delete_message_for_me_sync: msg "," found in storage but not in collection"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: after cache for delete message for me"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: after apply delete message for me"]);o=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=1,b)||babelHelpers.assertThisInitialized(c)}var f=e.prototype;f.getVersion=function(){return 3};f.getAction=function(){return d("WASyncdConst").Actions.DeleteMessageForMe};f.applyMutations=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){d("WAWebCurrentUser").isEmployee()&&d("WALogger").LOG(o());var e=[],f=(yield d("WAWebSyncdResolveMessages").resolveMessagesForMutations(a)),g=f.incomingRemoteToLocalChatId,p=f.messagesInDB;d("WAWebCurrentUser").isEmployee()&&d("WALogger").LOG(n());f=(yield (h||(h=b("Promise"))).all(a.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){try{if(a.operation==="set"){a=a.indexParts;var b=a[1],f=a[2],h=a[3];a=a[4];(!b||!f||!h||!a)&&d("WAWebSyncdIndexUtils").throwInvalidActionIndex();var i=g.get(b);b=d("WAWebSyncdIndexUtils").syncKeyToMsgKey(b,f,h,a);if(!b){d("WAWebSyncdUtils").uploadCriticalEventMetric(d("WAWebWamEnumMdSyncdCriticalEventCode").MD_SYNCD_CRITICAL_EVENT_CODE.ACTION_INVALID_INDEX_DATA);return{actionState:d("WASyncdConst").SyncActionState.Malformed}}if(i==null)return{actionState:d("WASyncdConst").SyncActionState.Orphan,orphanModel:{modelId:b.toString(),modelType:d("WASyncdConst").SyncModelType.Msg}};var j=c("WANullthrows")(d("WAWebSyncdIndexUtils").syncKeyToMsgKey(i,f,h,a,!1));i=p.find(function(a){return a.startsWith(j.toString())});if(i==null){f=d("WAWebLidMigrationUtils").getAlternateMsgKey(j);if(f!=null){h=(yield d("WAWebAddonProcessDeleteForMe").hasDeleteAddonForMe(f));if(h!=null)try{yield d("WAWebAddonProcessDeleteForMe").processDeleteForMeSingle(h);return{actionState:d("WASyncdConst").SyncActionState.Success}}catch(a){}}return{actionState:d("WASyncdConst").SyncActionState.Orphan,orphanModel:{modelId:b.toString(),modelType:d("WASyncdConst").SyncModelType.Msg}}}e.push(i);a=d("WAWebMsgCollection").MsgCollection.get(i);a?(d("WAWebFrontendMsgGetters").getChat(a).msgs.length===1&&(yield d("WAWebChatLoadMessages").loadEarlierMsgs(d("WAWebFrontendMsgGetters").getChat(a))),a["delete"]()):d("WALogger").WARN(m(),i);d("WALogger").DEV(l(),i);return{actionState:d("WASyncdConst").SyncActionState.Success}}d("WALogger").WARN(k());return{actionState:d("WASyncdConst").SyncActionState.Unsupported}}catch(a){return{actionState:d("WASyncdConst").SyncActionState.Failed}}});return function(b){return a.apply(this,arguments)}}())));d("WAWebCurrentUser").isEmployee()&&d("WALogger").LOG(j());if(e.length>0){yield d("WAWebDBMessageDelete").removeMessagesFromHistory(e);var q=new Set();e.forEach(function(a){return q.add(c("WAWebMsgKey").fromString(a).remote.toString())});a=Array.from(q.values()).join(",").toString();d("WAWebBackendApi").frontendFireAndForget("deleteModelsForLastAddOnPreview",{messagesIds:e});yield d("WAWebPersistedJobManager").getJobManager().waitUntilPersisted(d("WAWebPersistedJobDefinitions").jobSerializers.deleteAddOns(a,e))}d("WAWebCurrentUser").isEmployee()&&d("WALogger").LOG(i());return f});function e(b){return a.apply(this,arguments)}return e}();f.resolveConflicts=function(a,e){a=d("decodeProtobuf").decodeProtobuf(d("WASyncAction.pb").SyncActionValueSpec,a.binarySyncAction);e=d("decodeProtobuf").decodeProtobuf(d("WASyncAction.pb").SyncActionDataSpec,e.binarySyncData).value;a=c("WANullthrows")((a=a.deleteMessageForMeAction)==null?void 0:a.deleteMedia);e=c("WANullthrows")(e==null?void 0:(e=e.deleteMessageForMeAction)==null?void 0:e.deleteMedia);return!e&&a?(h||(h=b("Promise"))).resolve(d("WASyncdConst").ConflictResolutionState.SkipRemote):(h||(h=b("Promise"))).resolve(d("WASyncdConst").ConflictResolutionState.SkipRemoteAndDropLocal)};f.buildDeleteForMeMutation=function(a){var b=a.timestamp,c=a.deleteMedia,e=a.messageTimestamp;a=babelHelpers.objectWithoutPropertiesLoose(a,["timestamp","deleteMedia","messageTimestamp"]);c={deleteMessageForMeAction:{deleteMedia:c,messageTimestamp:e}};return d("WAWebSyncdActionUtils").buildPendingMutation({collection:d("WASyncdConst").CollectionName.RegularHigh,indexArgs:d("WAWebSyncdActionUtils").buildMessageKey(a),value:c,version:this.getVersion(),operation:d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET,timestamp:b,action:this.getAction()})};f.getDeleteForMeMutations=function(a,c){var e=this,f=d("WATimeUtils").unixTimeMs();return(h||(h=b("Promise"))).all(a.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.id.remote,g=d("WAWebMsgGetters").getSender(a);g=g?d("WAWebWidToJid").widToUserJid(g):null;return e.buildDeleteForMeMutation({timestamp:f,deleteMedia:c,messageTimestamp:d("WAWebMsgGetters").getT(a),remoteJid:b.isNewsletter()?d("WAWebWidToJid").widToNewsletterJid(b):d("WAWebWidToJid").widToChatJid(d("WAWebWidFactory").createWid(yield d("WAWebSyncdGetChat").getChatJidMutationIndexForChat(b))),id:a.id.id,fromMe:a.id.fromMe,participant:d("WAWebMsgGetters").getIsGroupMsg(a)&&!a.id.fromMe?g:null})});return function(b){return a.apply(this,arguments)}}()))};return e}(d("WASyncdAction").SyncActionBase);e=new a();g["default"]=e}),98); __d("WAWebExternalWebBetaSync",["Promise","WALogger","WASyncdAction","WASyncdConst","WAWebABProps","WAWebExternalBetaApi","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["external beta opt in sync: operation not supported"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: successfully set web external beta opt in to ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["beta setting sync: malformed mutation value"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["beta setting sync: malformed mutation"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: action not enabled"]);m=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(c,a);function c(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=null,b)||babelHelpers.assertThisInitialized(c)}var e=c.prototype;e.getVersion=function(){return 3};e.getAction=function(){return d("WASyncdConst").Actions.ExternalWebBeta};e.applyMutations=function(a){if(d("WAWebABProps").getABPropConfigValue("external_beta_can_join")!==!0){d("WALogger").LOG(m());return(h||(h=b("Promise"))).resolve(a.map(function(){return{actionState:d("WASyncdConst").SyncActionState.Unsupported}}))}return(h||(h=b("Promise"))).all(a.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){try{if(a.operation==="set"){a=a.value;a=a.externalWebBetaAction;if(!a){d("WALogger").WARN(l());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}if(a.isOptIn!==void 0)yield d("WAWebExternalBetaApi").changeOptInStatusForExternalWebBeta(a.isOptIn);else{d("WALogger").WARN(k());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}d("WALogger").DEV(j(),a.isOptIn);return{actionState:d("WASyncdConst").SyncActionState.Success}}d("WALogger").WARN(i());return{actionState:d("WASyncdConst").SyncActionState.Unsupported}}catch(a){return{actionState:d("WASyncdConst").SyncActionState.Failed}}});return function(b){return a.apply(this,arguments)}}()))};return c}(d("WASyncdAction").SyncActionBase);c=new a();g["default"]=c}),98); __d("WAWebDBFavoriteDatabaseApi",["WAWebLidMigrationDbUtils","WAWebSchemaFavorite","WAWebUserPrefsFavoritesLidMigration","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=d("WAWebUserPrefsFavoritesLidMigration").isFavoritesMigrationComplete()?yield p(a):a;yield d("WAWebSchemaFavorite").getFavoriteTable().bulkCreateOrReplace(a)});return h.apply(this,arguments)}function c(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=d("WAWebUserPrefsFavoritesLidMigration").isFavoritesMigrationComplete()?yield p(a):a;yield d("WAWebSchemaFavorite").getFavoriteTable().clear();yield d("WAWebSchemaFavorite").getFavoriteTable().bulkCreateOrReplace(a)});return i.apply(this,arguments)}function e(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=d("WAWebUserPrefsFavoritesLidMigration").isFavoritesMigrationComplete()?[].concat(yield n(a),a):a;yield d("WAWebSchemaFavorite").getFavoriteTable().bulkRemove(a)});return j.apply(this,arguments)}function f(){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield d("WAWebSchemaFavorite").getFavoriteTable().all());if(a.length===0)return 0;a=Math.max.apply(Math,a.map(function(a){a=a.orderIndex;return a}));return a+1});return k.apply(this,arguments)}function l(){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield d("WAWebSchemaFavorite").getFavoriteTable().all());return d("WAWebUserPrefsFavoritesLidMigration").isFavoritesMigrationComplete()?r(a):a});return m.apply(this,arguments)}function n(a){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield d("WAWebLidMigrationDbUtils").findAccountLidsForPnChatIds(a));return a.map(function(a){var c;return(c=b.get(a))!=null?c:a})});return o.apply(this,arguments)}function p(a){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield d("WAWebLidMigrationDbUtils").findAccountLidsForPnChatIds(a.map(function(a){return a.id})));return a.map(function(a){var c;return babelHelpers["extends"]({},a,{id:(c=b.get(a.id))!=null?c:a.id})})});return q.apply(this,arguments)}function r(a){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield d("WAWebLidMigrationDbUtils").findChatIdsForAccountLids(a.map(function(a){return a.id})));return a.map(function(a){var c;return babelHelpers["extends"]({},a,{id:(c=b.get(a.id))!=null?c:a.id})})});return s.apply(this,arguments)}g.addOrEditFavorites=a;g.setFavorites=c;g.removeFavorites=e;g.getNextFavoriteOrderIndex=f;g.getAllFavorites=l}),98); __d("WAWebFavoritesSync",["Promise","WALogger","WAServerSync.pb","WASyncdAction","WASyncdConst","WAWebApiContact","WAWebDBFavoriteDatabaseApi","WAWebFavoriteCollection","WAWebLid1X1MigrationGating","WAWebSyncdActionUtils","WAWebSyncdGetChat","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Favorites sync: successfully set favorites to"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["favorites sync: malformed mutation"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["favorites sync: operation not supported"]);k=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(c,a);function c(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=null,b)||babelHelpers.assertThisInitialized(c)}var e=c.prototype;e.getVersion=function(){return 1};e.getAction=function(){return d("WASyncdConst").Actions.Favorites};e.applyMutations=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c,e;a=a.map(function(a){var b;if(a.operation!=="set"){d("WALogger").WARN(k());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}if(((b=a.value.favoritesAction)==null?void 0:b.favorites)==null){d("WALogger").WARN(j());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}(e==null||a.timestamp>e.timestamp)&&(e=a);return{actionState:d("WASyncdConst").SyncActionState.Success}});c=(c=e)==null?void 0:(c=c.value.favoritesAction)==null?void 0:c.favorites;if(c!=null){var f=0;c=c.reduce(function(a,b){b=b.id;b!=null&&a.push({id:b,orderIndex:f++});return a},[]);c=(yield (h||(h=b("Promise"))).all(c.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield d("WAWebSyncdGetChat").resolveChatForMutationIndex(d("WAWebWidFactory").createWid(a.id)));if(b.success===!0)return{orderIndex:a.orderIndex,id:b.chat.id};b.success;b=d("WAWebWidFactory").createWid(a.id);if(d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()&&b.isLid()){b=d("WAWebApiContact").getPhoneNumber(d("WAWebWidFactory").toUserWid(b));if(b!=null)return{orderIndex:a.orderIndex,id:b.toString()}}return{orderIndex:a.orderIndex,id:a.id}});return function(b){return a.apply(this,arguments)}}())));yield d("WAWebDBFavoriteDatabaseApi").setFavorites(c);d("WAWebFavoriteCollection").FavoriteCollection.set(c.map(function(a){return{id:a.id,orderIndex:a.orderIndex}}));d("WALogger").DEV(i()).devConsole(c)}return a});function c(b){return a.apply(this,arguments)}return c}();e.getFavoritesMutation=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){a=a.map(function(a){return{orderIndex:a.orderIndex,wid:d("WAWebWidFactory").createWid(a.id)}});a=(yield (h||(h=b("Promise"))).all(a.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){return babelHelpers["extends"]({},a,{mutationIndex:yield d("WAWebSyncdGetChat").getWidMutationIndexForWid(a.wid)})});return function(b){return a.apply(this,arguments)}}())));return d("WAWebSyncdActionUtils").buildPendingMutation({collection:d("WASyncdConst").CollectionName.RegularHigh,indexArgs:[],operation:d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET,version:this.getVersion(),timestamp:c,action:this.getAction(),value:{favoritesAction:{favorites:a.sort(function(a,b){return a.orderIndex-b.orderIndex}).map(function(a){a=a.mutationIndex;return{id:a}})}}})});function c(b,c){return a.apply(this,arguments)}return c}();return c}(d("WASyncdAction").SyncActionBase);c=new a();g["default"]=c}),98); __d("WAWebBizLabelItemParentType",["$InternalEnum"],(function(a,b,c,d,e,f){a=b("$InternalEnum").Mirrored(["Chat","Contact","Msg"]);f.LabelItemParentType=a}),66); __d("WAWebLabelJidSync",["Promise","WALogger","WASyncdAction","WASyncdConst","WAWebApiContact","WAWebBizLabelItemParentType","WAWebBizLabelUtils","WAWebDBLabelAssociationDatabaseApi","WAWebLid1X1MigrationGating","WAWebSchemaChat","WAWebSchemaLabelAssociation","WAWebSyncdGetChat","WAWebSyncdIndexUtils","WAWebSyncdUtils","WAWebWamEnumMdSyncdCriticalEventCode","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["label jid sync: unsupported operation"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["label jid sync: malformed mutation"]);j=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=2,b)||babelHelpers.assertThisInitialized(c)}var f=e.prototype;f.getVersion=function(){return d("WASyncdConst").LABEL_ASSOCIATION_SYNC_VERSION};f.getAction=function(){return d("WASyncdConst").Actions.LabelJid};f.applyMutations=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=new Set(),f=[],g=[];a=(yield (h||(h=b("Promise"))).all(a.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){try{if(a.operation==="set"){var b=a.indexParts;a=a.value;var h=b[1];b=b[2];(!h||!b)&&d("WAWebSyncdIndexUtils").throwInvalidActionIndex();a=(a=a.labelAssociationAction)==null?void 0:a.labeled;if(a==null){d("WALogger").WARN(j());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}if(!c("WAWebWid").isWid(b)){d("WAWebSyncdUtils").uploadCriticalEventMetric(d("WAWebWamEnumMdSyncdCriticalEventCode").MD_SYNCD_CRITICAL_EVENT_CODE.ACTION_INVALID_INDEX_DATA);return{actionState:d("WASyncdConst").SyncActionState.Malformed}}b=d("WAWebWidFactory").createWid(b);var k=(yield d("WAWebSyncdGetChat").resolveChatForMutationIndex(b));if(k.success===!0)b=d("WAWebWidFactory").createWid(k.chat.id);else{k.success;if(d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()&&b.isLid()){k=d("WAWebApiContact").getPhoneNumber(d("WAWebWidFactory").toUserWid(b));k!=null&&(b=k)}}k=b.toString();var l={labelId:h,associationId:k,type:d("WAWebSchemaLabelAssociation").LabelAssociationType.Jid};if(a){a=e.has(k);if(!a){var m=(yield d("WAWebSchemaChat").getChatTable().get(k,!1));m&&(e.add(k),a=!0)}f.push(l);d("WAWebBizLabelUtils").addToLabelCollection(k,[h],a||!b.isUser()?d("WAWebBizLabelItemParentType").LabelItemParentType.Chat:d("WAWebBizLabelItemParentType").LabelItemParentType.Contact)}else g.push(d("WAWebSchemaLabelAssociation").createLabelAssociationPrimaryKey(l)),d("WAWebBizLabelUtils").removeLabelFromCollection(k,h,d("WAWebBizLabelItemParentType").LabelItemParentType.Chat);return{actionState:d("WASyncdConst").SyncActionState.Success}}d("WALogger").WARN(i());return{actionState:d("WASyncdConst").SyncActionState.Unsupported}}catch(a){return{actionState:d("WASyncdConst").SyncActionState.Failed}}});return function(b){return a.apply(this,arguments)}}())));yield d("WAWebDBLabelAssociationDatabaseApi").removeLabelAssociations(g);yield d("WAWebDBLabelAssociationDatabaseApi").addOrEditLabelAssociations(f);return a});function e(b){return a.apply(this,arguments)}return e}();return e}(d("WASyncdAction").SyncActionBase);e=new a();g["default"]=e}),98); __d("WAWebLabelMessageSync",["Promise","WALogger","WASyncdAction","WASyncdConst","WAWebBizLabelItemParentType","WAWebBizLabelUtils","WAWebDBLabelAssociationDatabaseApi","WAWebSchemaLabelAssociation","WAWebSchemaMessage","WAWebSyncdIndexUtils","WAWebSyncdUtils","WAWebWamEnumMdSyncdCriticalEventCode","WAWebWid","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["label message sync: operation not supported"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["label message sync: malformed mutation"]);j=function(){return a};return a}function k(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=new Set();yield d("WAWebSchemaMessage").getMessageTable().bulkGet(a.map(function(a){a=a.indexParts;var b=a[2],e=a[3],f=a[4];a=a[5];if(!b||!e||!f||!a)return null;return!c("WAWebWid").isWid(b)?null:(b=d("WAWebSyncdIndexUtils").syncKeyToMsgKey(b,e,f,a))==null?void 0:b.toString()}).filter(Boolean)).then(function(a){return a.forEach(function(a){a&&b.add(a.id)})});return b});return l.apply(this,arguments)}a=function(a){babelHelpers.inheritsLoose(c,a);function c(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=2,b)||babelHelpers.assertThisInitialized(c)}var e=c.prototype;e.getVersion=function(){return d("WASyncdConst").LABEL_ASSOCIATION_SYNC_VERSION};e.getAction=function(){return d("WASyncdConst").Actions.LabelMessage};e.applyMutations=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=[],e=[],f=(yield k(a));a=(yield (h||(h=b("Promise"))).all(a.map(function(a){try{if(a.operation==="set"){var b=a.indexParts;a=a.value;var g=b[1],h=b[2],k=b[3],l=b[4];b=b[5];(!g||!h||!k||!l||!b)&&d("WAWebSyncdIndexUtils").throwInvalidActionIndex();a=(a=a.labelAssociationAction)==null?void 0:a.labeled;if(a==null){d("WALogger").WARN(j());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}h=d("WAWebSyncdIndexUtils").syncKeyToMsgKey(h,k,l,b);if(!h){d("WAWebSyncdUtils").uploadCriticalEventMetric(d("WAWebWamEnumMdSyncdCriticalEventCode").MD_SYNCD_CRITICAL_EVENT_CODE.ACTION_INVALID_INDEX_DATA);return{actionState:d("WASyncdConst").SyncActionState.Malformed}}if(!f.has(h.toString()))return{actionState:d("WASyncdConst").SyncActionState.Orphan,orphanModel:{modelId:h.toString(),modelType:d("WASyncdConst").SyncModelType.Msg}};k={labelId:g,associationId:h.toString(),type:d("WAWebSchemaLabelAssociation").LabelAssociationType.Message};a?(c.push(k),d("WAWebBizLabelUtils").addToLabelCollection(h.toString(),[g],d("WAWebBizLabelItemParentType").LabelItemParentType.Msg)):(e.push(d("WAWebSchemaLabelAssociation").createLabelAssociationPrimaryKey(k)),d("WAWebBizLabelUtils").removeLabelFromCollection(h.toString(),g,d("WAWebBizLabelItemParentType").LabelItemParentType.Msg));return{actionState:d("WASyncdConst").SyncActionState.Success}}d("WALogger").WARN(i());return{actionState:d("WASyncdConst").SyncActionState.Unsupported}}catch(a){return{actionState:d("WASyncdConst").SyncActionState.Failed}}})));yield d("WAWebDBLabelAssociationDatabaseApi").removeLabelAssociations(e);yield d("WAWebDBLabelAssociationDatabaseApi").addOrEditLabelAssociations(c);return a});function c(b){return a.apply(this,arguments)}return c}();return c}(d("WASyncdAction").SyncActionBase);e=new a();g["default"]=e}),98); __d("WAWebLabelSync",["Promise","WALogger","WAServerSync.pb","WASyncAction.pb","WASyncdAction","WASyncdConst","WAWebBizGatingUtils","WAWebDBLabelAssociationDatabaseApi","WAWebLabelCollection","WAWebMobilePlatforms","WAWebModelStorageUtils","WAWebSchemaLabel","WAWebSyncdActionUtils","WAWebSyncdIndexUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["getLabelMutation: type has unexpected value: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["label sync: operation not supported"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["labelEditAction.type has unexpected value: ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["labelEditAction.color is empty"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["labelEditAction.name is empty"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["label sync: malformed mutation"]);n=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(c,a);function c(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=null,b)||babelHelpers.assertThisInitialized(c)}var e=c.prototype;e.getVersion=function(){return 3};e.getAction=function(){return d("WASyncdConst").Actions.LabelEdit};e.applyMutations=function(a){var c=d("WAWebBizGatingUtils").isLabelReorderingSyncFromPrimaryEnabled();return(h||(h=b("Promise"))).all(a.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){try{if(a.operation==="set"){var e,f=a.indexParts;a=a.value;var g=f[1];g||d("WAWebSyncdIndexUtils").throwInvalidActionIndex();f=a.labelEditAction;if(!f){d("WALogger").WARN(n());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}if(f.deleted===!0){yield d("WAWebSchemaLabel").getLabelTable().remove(g);d("WAWebLabelCollection").LabelCollection.remove(g);return{actionState:d("WASyncdConst").SyncActionState.Success}}a=f.color;var h=f.predefinedId,i=f.isActive,o=f.type,p=f.isImmutable;e=(e=f.name)!=null?e:"";e===""&&d("WALogger").WARN(m());d("WAWebMobilePlatforms").isSMB()&&a==null&&d("WALogger").WARN(l());var q={id:g,name:e,colorIndex:a,predefinedId:h};c&&f.orderIndex!=null&&(q.orderIndex=f.orderIndex);if(o!=null){e=d("WAWebSchemaLabel").ListType.cast(o);e!=null?q.type=e:d("WALogger").WARN(k(),o)}i!=null&&(q.isActive=i);p!=null&&(q.isImmutable=p);a=(yield d("WAWebModelStorageUtils").getStorage().lock(["label","label-association","chat"],function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a[0];yield a.createOrReplace(q);return d("WAWebDBLabelAssociationDatabaseApi").queryLabelAssociationsForLabelIds([g])});return function(b){return a.apply(this,arguments)}}()));d("WAWebBizGatingUtils").isCTWADetectedOutcomeWS1Enabled()&&o===d("WASyncAction.pb").SyncActionValue$LabelEditAction$ListType.SERVER_ASSIGNED?d("WAWebLabelCollection").LabelCollection.addToServerAssignedLabelIds(q.id):d("WAWebLabelCollection").LabelCollection.add(babelHelpers["extends"]({},q),{merge:!0});h=d("WAWebLabelCollection").LabelCollection.get(g);if(h!=null&&a.length>0){var r=h.labelItemCollection.reduce(function(a,b){a.add(b.id);return a},new Set());f=a.filter(function(a){return!r.has(a.associationId)});f.length>0&&d("WAWebLabelCollection").LabelCollection.initializeAssociationsFromCache(f)}return{actionState:d("WASyncdConst").SyncActionState.Success}}d("WALogger").WARN(j());return{actionState:d("WASyncdConst").SyncActionState.Unsupported}}catch(a){return{actionState:d("WASyncdConst").SyncActionState.Failed}}});return function(b){return a.apply(this,arguments)}}()))};e.getLabelMutation=function(a,b,c,e,f,g,h,j){b={name:b,deleted:e};c!=null&&(b.color=c);f!=null&&(b.predefinedId=f);g!=null&&(b.isActive=g);if(h!=null){e=d("WASyncAction.pb").SyncActionValue$LabelEditAction$ListType.cast(h);e!=null?b.type=e:d("WALogger").WARN(i(),h)}return d("WAWebSyncdActionUtils").buildPendingMutation({collection:d("WASyncdConst").CollectionName.Regular,indexArgs:[a],value:{labelEditAction:b},version:this.getVersion(),operation:d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET,timestamp:j,action:this.getAction()})};return c}(d("WASyncdAction").SyncActionBase);c=new a();g["default"]=c}),98); __d("WAWebMarkChatAsReadSync",["Promise","WALogger","WANullthrows","WAServerSync.pb","WASyncAction.pb","WASyncdAction","WASyncdConst","WAWebApiActiveMessageRanges","WAWebChatGetExistingBridge","WAWebConstantsDeprecated","WAWebMessageRangeUtils","WAWebSchemaChat","WAWebSyncdActionUtils","WAWebSyncdGetChat","WAWebSyncdIndexUtils","WAWebSyncdUtils","WAWebUpdateUnreadChatAction","WAWebWamEnumMdSyncdCriticalEventCode","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime","decodeProtobuf","encodeProtobuf"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[syncd][mark-chat-as-read]: isChatMarkedUnreadByUser-true"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[syncd][mark-chat-as-read]: read-",", rangeEnclosedType-",", chatId-",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[syncd][mark-chat-as-read]: operation not supported"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[syncd][mark-chat-as-read]: malformed mutation"]);l=function(){return a};return a}function m(a,b){switch(b){case d("WAWebMessageRangeUtils").MessageRangeEncloseType.RangesAreEqual:case d("WAWebMessageRangeUtils").MessageRangeEncloseType.RangeAEnclosesRangeB:return{actionState:d("WASyncdConst").SyncActionState.Success};case d("WAWebMessageRangeUtils").MessageRangeEncloseType.RangeBEnclosesRangeA:case d("WAWebMessageRangeUtils").MessageRangeEncloseType.RangesNotEnclosing:return{actionState:d("WASyncdConst").SyncActionState.Orphan,orphanModel:{modelType:d("WASyncdConst").SyncModelType.Chat,modelId:a.toString()}}}}a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=1,b)||babelHelpers.assertThisInitialized(c)}var f=e.prototype;f.getVersion=function(){return 3};f.getAction=function(){return d("WASyncdConst").Actions.MarkChatAsRead};f.$MarkChatAsReadSync$p_1=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=(yield d("WAWebChatGetExistingBridge").getExisting(a));a&&(b?d("WAWebUpdateUnreadChatAction").markSeen(a):d("WAWebUpdateUnreadChatAction").markUnseen(a))});function c(b,c){return a.apply(this,arguments)}return c}();f.$MarkChatAsReadSync$p_2=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebSchemaChat").getChatTable().get(a.toString(),!1));return(a==null?void 0:a.unreadCount)===c("WAWebConstantsDeprecated").MARKED_AS_UNREAD});function e(b){return a.apply(this,arguments)}return e}();f.validateSyncActionValue=function(a){a=a.markChatAsReadAction;var b=a==null?void 0:a.read;return b!=null&&d("WAWebMessageRangeUtils").validateMessageRange(a==null?void 0:a.messageRange)};f.applyMutations=function(a){var e=this;return(h||(h=b("Promise"))).all(a.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){try{if(a.operation==="set"){var b,f,g=a.indexParts;a=a.value;g=g[1];g||d("WAWebSyncdIndexUtils").throwInvalidActionIndex();if(!e.validateSyncActionValue(a)){d("WALogger").WARN(l());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}if(!c("WAWebWid").isWid(g)){d("WAWebSyncdUtils").uploadCriticalEventMetric(d("WAWebWamEnumMdSyncdCriticalEventCode").MD_SYNCD_CRITICAL_EVENT_CODE.ACTION_INVALID_INDEX_DATA);return{actionState:d("WASyncdConst").SyncActionState.Malformed}}b=c("WANullthrows")((b=a.markChatAsReadAction)==null?void 0:b.read);f=c("WANullthrows")((f=a.markChatAsReadAction)==null?void 0:f.messageRange);g=(yield d("WAWebSyncdGetChat").resolveChatForMutationIndex(d("WAWebWidFactory").createWid(g)));return!g.success?{actionState:d("WASyncdConst").SyncActionState.Orphan,orphanModel:g.orphanModel}:e.$MarkChatAsReadSync$p_3(d("WAWebWidFactory").createWid(g.chat.id),b,f,a)}d("WALogger").WARN(k());return{actionState:d("WASyncdConst").SyncActionState.Unsupported}}catch(a){return{actionState:d("WASyncdConst").SyncActionState.Failed}}});return function(b){return a.apply(this,arguments)}}()))};f.$MarkChatAsReadSync$p_3=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e,f){yield d("WAWebApiActiveMessageRanges").removeActiveMessageRange(a.toString(),d("WAWebApiActiveMessageRanges").getActiveRangeAction("markChatAsRead"));var g=(yield d("WAWebMessageRangeUtils").constructMessageRange(a,{forOutgoingMutation:!1}));g=d("WAWebMessageRangeUtils").compareMessageRanges(g,e);var k=d("encodeProtobuf").encodeProtobuf(d("WASyncAction.pb").SyncActionValueSpec,f).readBuffer();e=function(){return d("WAWebApiActiveMessageRanges").addActiveMessageRange(a.toString(),d("WAWebApiActiveMessageRanges").getActiveRangeAction("markChatAsRead"),k)};d("WALogger").DEV(j(),c,g,a.toString());switch(g){case d("WAWebMessageRangeUtils").MessageRangeEncloseType.RangesAreEqual:case d("WAWebMessageRangeUtils").MessageRangeEncloseType.RangeBEnclosesRangeA:yield e();yield this.$MarkChatAsReadSync$p_1(a,c);return(h||(h=b("Promise"))).resolve(m(a,g));case d("WAWebMessageRangeUtils").MessageRangeEncloseType.RangesNotEnclosing:case d("WAWebMessageRangeUtils").MessageRangeEncloseType.RangeAEnclosesRangeB:c&&(yield this.$MarkChatAsReadSync$p_2(a))&&(d("WALogger").DEV(i()),yield this.$MarkChatAsReadSync$p_1(a,c));return(h||(h=b("Promise"))).resolve(m(a,g))}});function c(b,c,d,e){return a.apply(this,arguments)}return c}();f.getMarkChatAsReadMutation=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){var e=(yield d("WAWebSyncdGetChat").getChatJidMutationIndexForChat(c));b={markChatAsReadAction:{read:b,messageRange:yield d("WAWebMessageRangeUtils").constructMessageRange(c,{forOutgoingMutation:!0,mutationIndexJid:e})}};return d("WAWebSyncdActionUtils").buildPendingMutation({collection:d("WASyncdConst").CollectionName.RegularLow,indexArgs:[e],value:b,version:this.getVersion(),operation:d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET,timestamp:a,action:this.getAction()})});function c(b,c,d){return a.apply(this,arguments)}return c}();f.resolveConflicts=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){var f=this,g=d("decodeProtobuf").decodeProtobuf(d("WASyncAction.pb").SyncActionValueSpec,a.binarySyncAction),h=d("decodeProtobuf").decodeProtobuf(d("WASyncAction.pb").SyncActionDataSpec,e.binarySyncData).value,i=a.timestamp;e=e.timestamp;g=c("WANullthrows")(g.markChatAsReadAction);var j=c("WANullthrows")(h==null?void 0:h.markChatAsReadAction),k=d("WAWebMessageRangeUtils").compareMessageRanges(c("WANullthrows")(j.messageRange),c("WANullthrows")(g.messageRange));switch(k){case d("WAWebMessageRangeUtils").MessageRangeEncloseType.RangeAEnclosesRangeB:return d("WASyncdConst").ConflictResolutionState.ApplyRemoteAndDropLocal;case d("WAWebMessageRangeUtils").MessageRangeEncloseType.RangeBEnclosesRangeA:return d("WASyncdConst").ConflictResolutionState.SkipRemote;case d("WAWebMessageRangeUtils").MessageRangeEncloseType.RangesAreEqual:return i<=e?d("WASyncdConst").ConflictResolutionState.ApplyRemoteAndDropLocal:d("WASyncdConst").ConflictResolutionState.SkipRemote;case d("WAWebMessageRangeUtils").MessageRangeEncloseType.RangesNotEnclosing:var l=i<=e?(k=j.read)!=null?k:!1:(i=g.read)!=null?i:!1;e=d("WAWebMessageRangeUtils").mergeMessageRanges(c("WANullthrows")(j.messageRange),c("WANullthrows")(g.messageRange));k={read:l,messageRange:e};var m=d("encodeProtobuf").encodeProtobuf(d("WASyncAction.pb").SyncActionValueSpec,babelHelpers["extends"]({},h,{markChatAsReadAction:k})).readBuffer();i=babelHelpers["extends"]({},a,{binarySyncAction:m});delete i.id;yield d("WAWebMessageRangeUtils").lockForMessageRangeSync(["chat"],[i],b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var b=JSON.parse(a.index);b=d("WAWebWidFactory").createWid(b[1]);yield d("WAWebApiActiveMessageRanges").addActiveMessageRange(b.toString(),d("WAWebApiActiveMessageRanges").getActiveRangeAction("markChatAsRead"),m);return f.$MarkChatAsReadSync$p_1(b,l)}));return d("WASyncdConst").ConflictResolutionState.SkipRemoteAndDropLocal}});function e(b,c){return a.apply(this,arguments)}return e}();return e}(d("WASyncdAction").SyncActionBase);e=new a();g["default"]=e}),98); __d("WAWebMessageRangeUtils",["$InternalEnum","WALogger","WALongInt","WASyncAction.pb","WASyncdConst","WAWebApiActiveMessageRanges","WAWebDBMessageRange","WAWebSchemaActiveMessageRanges","WAWebSyncdCoreApi","WAWebSyncdDb","WAWebSyncdUtils","WAWebTimestampConversionUtils","WAWebWamEnumMdSyncdCriticalEventCode","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime","decodeProtobuf"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["constructForwardMovingMessageRange: deleteMessageForMeAction malformed"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["constructForwardMovingMessageRange: delete for me mutation index malformed ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: deleteForMeSyncActions length: ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: constructing forward moving message range for ","\n ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: constructing current message range for ","\n ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["message_range_utils: malformed message key for id ",""]);n=function(){return a};return a}var o=b("$InternalEnum").Mirrored(["RangeAEnclosesRangeB","RangeBEnclosesRangeA","RangesAreEqual","RangesNotEnclosing"]);function p(a,b){var c=new Set(a.messages.map(function(a){return(a=a.key)==null?void 0:a.id}));for(var e=0;e<b.messages.length;e++)if(b.messages[e].timestamp==null){var f;if(!c.has((f=b.messages[e].key)==null?void 0:f.id))return!1}for(f=0;f<b.messages.length;f++){if(!c.has((e=b.messages[f].key)==null?void 0:e.id)&&d("WALongInt").numberOrThrowIfTooLarge((e=a.lastMessageTimestamp)!=null?e:0)<=d("WALongInt").numberOrThrowIfTooLarge((e=b.messages[f].timestamp)!=null?e:0))return!1}return!0}function q(a,b){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c,e=(yield (c=d("WAWebDBMessageRange")).getLastMessageTimestamp(a));c.logMaybeMillisecondTimestamp(e,"getLastMessageTimestamp");var f=(yield c.getLastSystemMessageTimestamp(a));c.logMaybeMillisecondTimestamp(f,"lastSystemMessageTimestamp");c=(yield c.getAdditionalMessages(a,e));var g=c.messages;c=c.newLastMessageTimestamp;c!=null&&(e=c,d("WAWebDBMessageRange").logMaybeMillisecondTimestamp(c,"newLastMessageTimestamp"));if(e==null){c=g.sort(d("WAWebDBMessageRange").timestampComparison);c=(c=c[g.length-1])==null?void 0:c.timestamp;e=c!=null?d("WALongInt").numberOrThrowIfTooLarge(c):null;d("WAWebDBMessageRange").logMaybeMillisecondTimestamp(e,"sorting")}c={messages:g};e!=null&&(c.lastMessageTimestamp=e);f!=null&&((e==null||f>d("WALongInt").numberOrThrowIfTooLarge(e))&&(c.lastSystemMessageTimestamp=f,d("WAWebDBMessageRange").logMaybeMillisecondTimestamp(c.lastSystemMessageTimestamp,"lastSystemMessageTimestamp")));if(b.forOutgoingMutation&&c.lastMessageTimestamp==null){g=(yield d("WAWebDBMessageRange").getFirstSystemMessageTimestamp(a));g!=null&&(c.lastMessageTimestamp=g,d("WAWebDBMessageRange").logMaybeMillisecondTimestamp(c.lastMessageTimestamp,"firstSystemMessageTimestamp"),g===f&&(c.lastSystemMessageTimestamp=void 0))}d("WALogger").DEV(m(),a.toString({legacy:!0}),JSON.stringify(c,null,2));if(b.forOutgoingMutation&&b.mutationIndexJid!=null)for(e of c.messages){((g=e.key)==null?void 0:g.remoteJid)!=null&&(e.key.remoteJid=b.mutationIndexJid)}return c});return r.apply(this,arguments)}function a(a,b){var c=p(a,b);b=p(b,a);if(c&&b)return o.RangesAreEqual;else if(c)return o.RangeAEnclosesRangeB;else if(b)return o.RangeBEnclosesRangeA;return o.RangesNotEnclosing}function s(a,b,c){var e=new Map();a=a.concat(b);a.forEach(function(a){var b,f;b=(b=(b=a.key)==null?void 0:b.id)!=null?b:"";if(d("WALongInt").numberOrThrowIfTooLarge((f=a.timestamp)!=null?f:0)>=c){f=e.get(b);if(f){var g;e.set(b,d("WALongInt").numberOrThrowIfTooLarge((g=f.timestamp)!=null?g:0)<d("WALongInt").numberOrThrowIfTooLarge((g=a.timestamp)!=null?g:0)?a:f)}else e.set(b,a)}});return Array.from(e.values())}function t(a,b){var c,e;c=d("WALongInt").numberOrThrowIfTooLarge((c=a.lastMessageTimestamp)!=null?c:0);e=d("WALongInt").numberOrThrowIfTooLarge((e=b.lastMessageTimestamp)!=null?e:0);c=Math.max(c,e);e=s(a.messages,b.messages,c);e={messages:e};c!==0&&(e.lastMessageTimestamp=c);if(a.lastSystemMessageTimestamp!=null||b.lastSystemMessageTimestamp!=null){b=Math.max(d("WALongInt").numberOrThrowIfTooLarge((a=a.lastSystemMessageTimestamp)!=null?a:0),d("WALongInt").numberOrThrowIfTooLarge((a=b.lastSystemMessageTimestamp)!=null?a:0));(c==null||b>c)&&(e.lastSystemMessageTimestamp=b)}return e}var u=[[(h=d("WAWebWamEnumMdSyncdCriticalEventCode")).MD_SYNCD_CRITICAL_EVENT_CODE.MESSAGE_RANGE_LAST_SYSTEM_MESSAGE_TIMESTAMP_SET,function(a){var b=a.lastSystemMessageTimestamp;a=a.lastMessageTimestamp;return b!=null&&a!=null&&d("WALongInt").numberOrThrowIfTooLarge(b)<d("WALongInt").numberOrThrowIfTooLarge(a)}],[h.MD_SYNCD_CRITICAL_EVENT_CODE.MESSAGE_RANGE_MESSAGES_CROSS_LIMIT,function(a){return a.messages.filter(function(a){return a.timestamp!=null}).length>1e3}]],v=[[h.MD_SYNCD_CRITICAL_EVENT_CODE.MESSAGE_RANGE_MESSAGE_KEY_UNSET,function(a){return a.key==null}],[h.MD_SYNCD_CRITICAL_EVENT_CODE.MESSAGE_RANGE_MESSAGE_KEY_REMOTE_JID_UNSET,function(a){return((a=a.key)==null?void 0:a.remoteJid)==null}],[h.MD_SYNCD_CRITICAL_EVENT_CODE.MESSAGE_RANGE_MESSAGE_KEY_FROM_ME_UNSET,function(a){return((a=a.key)==null?void 0:a.fromMe)==null}],[h.MD_SYNCD_CRITICAL_EVENT_CODE.MESSAGE_RANGE_MESSAGE_KEY_STANZA_ID_UNSET,function(a){return((a=a.key)==null?void 0:a.id)==null}],[h.MD_SYNCD_CRITICAL_EVENT_CODE.MESSAGE_RANGE_MESSAGE_KEY_REMOTE_JID_INVALID,function(a){return!d("WAWebWidFactory").isWidlike((a=a.key)==null?void 0:a.remoteJid)}],[h.MD_SYNCD_CRITICAL_EVENT_CODE.MESSAGE_RANGE_MESSAGE_KEY_PARTICIPANT_UNSET,function(a){var b;return c("WAWebWid").isGroup((b=a.key)==null?void 0:b.remoteJid)&&((b=a.key)==null?void 0:b.fromMe)!==!0&&((b=a.key)==null?void 0:b.participant)==null}]];function e(a){if(a==null){d("WAWebSyncdUtils").uploadCriticalEventMetric(d("WAWebWamEnumMdSyncdCriticalEventCode").MD_SYNCD_CRITICAL_EVENT_CODE.MESSAGE_RANGE_UNSET);return!1}for(var b of u){var c=b[0],e=b[1];if(a&&e(a)){d("WAWebSyncdUtils").uploadCriticalEventMetric(c);return!1}}if((a==null?void 0:a.messages)==null)return!0;for(e of a.messages)for(c of v){b=c[0];a=c[1];if(a(e)){d("WALogger").DEV(n(),(a=e.key)==null?void 0:a.id);d("WAWebSyncdUtils").uploadCriticalEventMetric(b);return!1}}return!0}function f(a,b){return w.apply(this,arguments)}function w(){w=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=(yield q(a,{forOutgoingMutation:!0,mutationIndexJid:b}));b=(yield d("WAWebApiActiveMessageRanges").getActiveMessageRanges(a.toString()));b.forEach(function(a){var b=a.actionValue.messageRange;b&&(d("WAWebDBMessageRange").logMaybeMillisecondTimestamp(b.lastMessageTimestamp,"activeRanges"),d("WAWebDBMessageRange").logMaybeMillisecondTimestamp(b.lastSystemMessageTimestamp,"activeRangesSystem"));switch(a.action){case d("WAWebSchemaActiveMessageRanges").ActiveRangeAction.ClearChatDeleteStarredDeleteMedia:case d("WAWebSchemaActiveMessageRanges").ActiveRangeAction.ClearChatDeleteStarredKeepMedia:case d("WAWebSchemaActiveMessageRanges").ActiveRangeAction.ClearChatKeepStarredDeleteMedia:case d("WAWebSchemaActiveMessageRanges").ActiveRangeAction.ClearChatKeepStarredKeepMedia:case d("WAWebSchemaActiveMessageRanges").ActiveRangeAction.DeleteChatDeleteMedia:case d("WAWebSchemaActiveMessageRanges").ActiveRangeAction.DeleteChatKeepMedia:b=a.actionValue.messageRange;b&&(c=t(c,b));break;case d("WAWebSchemaActiveMessageRanges").ActiveRangeAction.Archive:case d("WAWebSchemaActiveMessageRanges").ActiveRangeAction.MarkChatAsRead:break}});d("WAWebDBMessageRange").logMaybeMillisecondTimestamp(c.lastMessageTimestamp,"intermediaForwardMovingRange");b=(yield x(a));c.messages=s(c.messages,b,d("WALongInt").numberOrThrowIfTooLarge((b=c.lastMessageTimestamp)!=null?b:0));c=d("WAWebDBMessageRange").fixMessageRange(c);d("WAWebDBMessageRange").logMaybeMillisecondTimestamp(c.lastMessageTimestamp,"forwardMovingRange");d("WALogger").DEV(l(),a.toString({legacy:!0}),JSON.stringify(c,null,2));return c});return w.apply(this,arguments)}function x(a){return y.apply(this,arguments)}function y(){y=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=[],c=(yield d("WAWebSyncdDb").getSyncActionsRows(["action"],[d("WASyncdConst").Actions.DeleteMessageForMe]));d("WALogger").LOG(k(),c.length);c.forEach(function(c){var e=a.toString({legacy:!0}),f=JSON.parse(c.index);if(f.length!==5)d("WALogger").LOG(j(),c.index);else if(e===f[1]&&c.actionState===d("WASyncdConst").SyncActionState.Success){e=d("decodeProtobuf").decodeProtobuf(d("WASyncAction.pb").SyncActionDataSpec,c.binarySyncData).value;e=e==null?void 0:(c=e.deleteMessageForMeAction)==null?void 0:c.messageTimestamp;if(e==null)d("WALogger").LOG(i());else{c={remoteJid:f[1],id:f[2],fromMe:f[3]==="1",participant:f[4]!=="0"?f[4]:void 0};b.push({key:c,timestamp:d("WAWebTimestampConversionUtils").maybeMillisecondsToSeconds(e)})}}});return b});return y.apply(this,arguments)}function z(a,b){return babelHelpers["extends"]({},b,{messages:b.messages.map(function(b){return babelHelpers["extends"]({},b,{key:babelHelpers["extends"]({},b.key,{remoteJid:a.toString()})})})})}h=function(a,b,c){return d("WAWebSyncdCoreApi").lockForSync([].concat(a,["message","active-message-ranges"]),b,c)};g.MessageRangeEncloseType=o;g.constructMessageRange=q;g.compareMessageRanges=a;g.mergeMessageRanges=t;g.validateMessageRange=e;g.constructForwardMovingMessageRange=f;g.replaceMessageRangeRemoteJid=z;g.lockForMessageRangeSync=h}),98); __d("WAWebMuteChatSync",["Promise","WALogger","WALongInt","WAServerSync.pb","WASyncdAction","WASyncdConst","WATimeUtils","WAWebMuteCollection","WAWebSchemaChat","WAWebSyncdActionUtils","WAWebSyncdGetChat","WAWebSyncdIndexUtils","WAWebSyncdUtils","WAWebWamEnumMdSyncdCriticalEventCode","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["mute chat sync: operation not supported"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: successfully set mute for "," with expiration=",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["mute chat sync: malformed mutation"]);k=function(){return a};return a}var l=-1;a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=1,b)||babelHelpers.assertThisInitialized(c)}var f=e.prototype;f.getVersion=function(){return 2};f.getAction=function(){return d("WASyncdConst").Actions.Mute};f.applyMutations=function(a){return(h||(h=b("Promise"))).all(a.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){try{if(a.operation==="set"){var b=a.indexParts;a=a.value;b=b[1];b||d("WAWebSyncdIndexUtils").throwInvalidActionIndex();if(!c("WAWebWid").isWid(b)){d("WAWebSyncdUtils").uploadCriticalEventMetric(d("WAWebWamEnumMdSyncdCriticalEventCode").MD_SYNCD_CRITICAL_EVENT_CODE.ACTION_INVALID_INDEX_DATA);return{actionState:d("WASyncdConst").SyncActionState.Malformed}}var e=a.muteAction;a=(a=a.muteAction)==null?void 0:a.muted;e=d("WALongInt").maybeNumberOrThrowIfTooLarge(e==null?void 0:e.muteEndTimestamp);if(a==null||a&&e==null){d("WALogger").WARN(k());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}a=(yield d("WAWebSyncdGetChat").resolveChatForMutationIndex(d("WAWebWidFactory").createWid(b)));if(!a.success)return{actionState:d("WASyncdConst").SyncActionState.Orphan,orphanModel:a.orphanModel};b=a.chat.id;e=(a=e)!=null?a:0;a=e>0&&e<d("WATimeUtils").unixTimeMs()?0:Math.floor(e/1e3);yield d("WAWebSchemaChat").getChatTable().merge(b,{muteExpiration:a});e={id:d("WAWebWidFactory").createWid(b),expiration:a};d("WAWebMuteCollection").MuteCollection.add(e,{merge:!0});d("WALogger").DEV(j(),b,a);return{actionState:d("WASyncdConst").SyncActionState.Success}}d("WALogger").WARN(i());return{actionState:d("WASyncdConst").SyncActionState.Unsupported}}catch(a){return{actionState:d("WASyncdConst").SyncActionState.Failed}}});return function(b){return a.apply(this,arguments)}}()))};f.generateMuteMutation=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=b!==void 0&&b!==0,e=d("WATimeUtils").unixTimeMs();b=b;b!==l&&(b*=1e3);c={muted:c,muteEndTimestamp:b};b={muteAction:c};return d("WAWebSyncdActionUtils").buildPendingMutation({collection:d("WASyncdConst").CollectionName.RegularHigh,indexArgs:[yield d("WAWebSyncdGetChat").getChatJidMutationIndexForChat(a)],operation:d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET,version:this.getVersion(),value:b,timestamp:e,action:this.getAction()})});function c(b,c){return a.apply(this,arguments)}return c}();return e}(d("WASyncdAction").SyncActionBase);e=new a();g["default"]=e}),98); __d("WAWebNoteSync",["Promise","WAJids","WALogger","WALongInt","WAServerSync.pb","WASyncAction.pb","WASyncdAction","WASyncdConst","WAWebNoteAction","WAWebNoteCollection","WAWebNotesUtils","WAWebSchemaNote","WAWebSyncdActionUtils","WAWebSyncdGetChat","WAWebSyncdIndexUtils","WAWebWidFactory","WAWebWidToJid","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["noteEditAction.unstructuredContent is empty"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["noteEditAction.createdAt is a non-safe integer"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["noteEditAction.createdAt is empty"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["noteEditAction.chatJid is not a valid chatJid"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["noteEditAction.chatJid is empty"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["noteEditAction.type is empty"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["note sync: malformed mutation"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["note sync: operation not supported"]);p=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(c,a);function c(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=null,b)||babelHelpers.assertThisInitialized(c)}var e=c.prototype;e.getVersion=function(){return 7};e.getAction=function(){return d("WASyncdConst").Actions.NoteEdit};e.applyMutations=function(a){var c=this;return(h||(h=b("Promise"))).all(a.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a.operation!=="set"){d("WALogger").WARN(p());return{actionState:d("WASyncdConst").SyncActionState.Unsupported}}try{var b=a.indexParts,e=a.value;b=b[1];b||d("WAWebSyncdIndexUtils").throwInvalidActionIndex();e=e.noteEditAction;if(!e){d("WALogger").WARN(o());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}if(e.deleted===!0){yield d("WAWebSchemaNote").getNoteTable().remove(b);d("WAWebNoteCollection").NoteCollection.remove(b);return{actionState:d("WASyncdConst").SyncActionState.Success}}var f=e.type,g=e.chatJid,h=e.createdAt;e=e.unstructuredContent;if(f==null){d("WALogger").WARN(n());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}if(g==null){d("WALogger").WARN(m());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}var q=d("WAJids").validateChatJid(g);if(q==null){d("WALogger").WARN(l());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}h==null&&d("WALogger").WARN(k());var r=d("WALongInt").maybeNumber(h);h!=null&&r==null&&d("WALogger").WARN(j());e==null&&d("WALogger").WARN(i());h=(yield d("WAWebSyncdGetChat").resolveChatForMutationIndex(d("WAWebWidFactory").createWid(g)));if(!h.success)return{actionState:d("WASyncdConst").SyncActionState.Orphan,orphanModel:h.orphanModel};g=d("WAWebWidToJid").widToChatJid(d("WAWebWidFactory").createWid(h.chat.id));h=(yield c.resolveNoteId(q,g,b));h={id:h,type:f===d("WASyncAction.pb").SyncActionValue$NoteEditAction$NoteType.UNSTRUCTURED?"unstructured":"structured",chatJid:g,content:(q=e)!=null?q:"",modifiedAt:Math.floor(a.timestamp/1e3),createdAt:Math.floor(((b=r)!=null?b:0)/1e3)};yield d("WAWebNoteAction").upsertFromSyncd(h);return{actionState:d("WASyncdConst").SyncActionState.Success}}catch(a){return{actionState:d("WASyncdConst").SyncActionState.Failed}}});return function(b){return a.apply(this,arguments)}}()))};e.resolveNoteId=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){return b===a?c:d("WAWebNotesUtils").generateNoteId(b)});function c(b,c,d){return a.apply(this,arguments)}return c}();e.getNoteMutation=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield d("WAWebSyncdGetChat").getChatJidMutationIndexForChat(d("WAWebWidFactory").createWid(a.chatJid)));b=d("WAWebWidToJid").widToChatJid(d("WAWebWidFactory").createWid(b));var c=(yield this.resolveNoteId(a.chatJid,b,String(a.id)));b={noteEditAction:{type:a.type==="unstructured"?d("WASyncAction.pb").SyncActionValue$NoteEditAction$NoteType.UNSTRUCTURED:d("WASyncAction.pb").SyncActionValue$NoteEditAction$NoteType.STRUCTURED,chatJid:b,unstructuredContent:a.content,createdAt:a.createdAt*1e3}};return d("WAWebSyncdActionUtils").buildPendingMutation({collection:d("WASyncdConst").CollectionName.RegularLow,indexArgs:[c],value:b,version:this.getVersion(),operation:d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET,timestamp:a.modifiedAt*1e3,action:this.getAction()})});function c(b){return a.apply(this,arguments)}return c}();return c}(d("WASyncdAction").SyncActionBase);c=new a();g["default"]=c}),98); __d("WAWebNuxSyncKey",["WAWebNux"],(function(a,b,c,d,e,f,g){function a(a){switch(a){case d("WAWebNux").NUX.EPHEMERAL:return d("WAWebNux").NuxSyncKey.EPHEMERAL;case d("WAWebNux").NUX.EPHEMERAL_VIEW_ONCE:return d("WAWebNux").NuxSyncKey.EPHEMERAL_VIEW_ONCE;case d("WAWebNux").NUX.EPHEMERAL_VIEW_ONCE_RECEIVER:return d("WAWebNux").NuxSyncKey.EPHEMERAL_VIEW_ONCE_RECEIVER;case d("WAWebNux").NUX.STATUS_QUICK_REPLIES:return d("WAWebNux").NuxSyncKey.STATUS_QUICK_REPLIES;case d("WAWebNux").NUX.COMMUNITY:return d("WAWebNux").NuxSyncKey.COMMUNITY;case d("WAWebNux").NUX.COMMUNITY_HOME:return d("WAWebNux").NuxSyncKey.COMMUNITY_HOME;case d("WAWebNux").NUX.KEEP_IN_CHAT:return d("WAWebNux").NuxSyncKey.KEEP_IN_CHAT;case d("WAWebNux").NUX.FORWARD_MEDIA_WITH_CAPTION:return d("WAWebNux").NuxSyncKey.FORWARD_MEDIA_WITH_CAPTION;case d("WAWebNux").NUX.MESSAGE_EDIT:return d("WAWebNux").NuxSyncKey.MESSAGE_EDIT;case d("WAWebNux").NUX.NEWSLETTER_MULTI_ADMIN:return d("WAWebNux").NuxSyncKey.NEWSLETTER_MULTI_ADMIN;case d("WAWebNux").NUX.SUPPORT_AI:return d("WAWebNux").NuxSyncKey.SUPPORT_AI;case d("WAWebNux").NUX.TOOLTIP_STATUS_ENTRY_POINT:return d("WAWebNux").NuxSyncKey.TOOLTIP_STATUS_ENTRY_POINT;case d("WAWebNux").NUX.STATUS_PRIVATE_MENTIONS:return d("WAWebNux").NuxSyncKey.STATUS_PRIVATE_MENTIONS;case d("WAWebNux").NUX.MESSAGE_LABEL_DEPRECATION_MIGRATED_PERMANENT:return d("WAWebNux").NuxSyncKey.MESSAGE_LABEL_DEPRECATION_MIGRATED;case d("WAWebNux").NUX.ADD_TO_LISTS:return d("WAWebNux").NuxSyncKey.ADD_TO_LISTS;case d("WAWebNux").NUX.WEB_UI_REFRESH:return d("WAWebNux").NuxSyncKey.WEB_UI_REFRESH;default:return d("WAWebNux").isCommunityAdminPromotionNuxKey(a)||d("WAWebNux").isChatAutoMutedNuxKey(a)?a:null}}g.getNuxSyncKey=a}),98); __d("WAWebUserPrefsNuxPreferences",["WAWebBizGatingUtils","WAWebEventEmitter","WAWebNux","WAWebNuxSyncKey","WAWebUserPrefsKeys","WAWebUserPrefsStore"],(function(a,b,c,d,e,f,g){var h=function(b){babelHelpers.inheritsLoose(a,b);function a(){return b.apply(this,arguments)||this}var c=a.prototype;c.handleNuxChange=function(a){this.trigger(a)};return a}(c("WAWebEventEmitter")),i=new h();function a(a){var b=d("WAWebNuxSyncKey").getNuxSyncKey(a);if(b!=null&&n(b))return!1;b=j(a);return!b?!0:b.views<p(a)}function j(a){a=c("WAWebUserPrefsStore").getUser(a);if(a==null||typeof a!=="object")return null;a=a.views;return typeof a==="number"?{views:a}:null}function b(a,b){c("WAWebUserPrefsStore").setUser(a,b),i.handleNuxChange(a)}function k(a){c("WAWebUserPrefsStore").setUser(a),i.handleNuxChange(a)}function l(){var a=c("WAWebUserPrefsStore").get(d("WAWebUserPrefsKeys").KEYS.NUX_LIST);return a instanceof Array?a.filter(function(a){return typeof a==="string"}):[]}function e(a){var b=new Set(l());a.forEach(function(a){var c=a.nuxKey;a=a.acknowledged;a?b.add(c):b["delete"](c)});c("WAWebUserPrefsStore").set(d("WAWebUserPrefsKeys").KEYS.NUX_LIST,Array.from(b));a.forEach(function(a){a=a.nuxKey;a=o(a);a!=null&&i.handleNuxChange(a)})}function f(){c("WAWebUserPrefsStore").set(d("WAWebUserPrefsKeys").KEYS.NUX_LIST,[])}function m(a){k(a);var b=l().filter(function(b){return b!==a});c("WAWebUserPrefsStore").set(d("WAWebUserPrefsKeys").KEYS.NUX_LIST,b)}function n(a){return l().includes(a)}function o(a){switch(a){case"message_label_deprecation_migrated":return d("WAWebNux").NUX.MESSAGE_LABEL_DEPRECATION_MIGRATED_PERMANENT;default:return null}}function p(a){switch(a){case"message_label_deprecation_migrated_permanent":case"desktop_upsell":return Number.POSITIVE_INFINITY;case"chat_assignment":return d("WAWebBizGatingUtils").chatAssignmentMaxNuxImpressions();case"status_quick_replies":return 3;case"web_ui_refresh":return 2;default:a;return 1}}g.NuxPrefsEvent=i;g.shouldShowNUX=a;g.getNUX=j;g.setNUX=b;g.removeNUX=k;g.getNuxSyncList=l;g.updateNuxSyncList=e;g.removeAllNuxSync=f;g.resetNux=m;g.nuxExistsInNuxSync=n;g.getNuxMaxViews=p}),98); __d("WAWebNuxSync",["Promise","WALogger","WAServerSync.pb","WASyncdAction","WASyncdConst","WATimeUtils","WATypeUtils","WAWebSyncdActionUtils","WAWebSyncdCoreApi","WAWebUserPrefsNuxPreferences","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["NuxSync: update nux to local store"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["NuxSync: malformed mutation"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["NuxSync: operation not supported ",""]);k=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(c,a);function c(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=null,b)||babelHelpers.assertThisInitialized(c)}var e=c.prototype;e.getVersion=function(){return 7};e.getAction=function(){return d("WASyncdConst").Actions.Nux};e.applyMutations=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=[];a=a.map(function(a){if(a.operation!=="set"){d("WALogger").WARN(k(),a);return{actionState:d("WASyncdConst").SyncActionState.Malformed}}var c=a.indexParts[1];if(!d("WATypeUtils").isString(c)){d("WALogger").WARN(j()).devConsole(a);return{actionState:d("WASyncdConst").SyncActionState.Malformed}}b.push({nuxKey:c,acknowledged:((c=a.value.nuxAction)==null?void 0:c.acknowledged)===!0});return{actionState:d("WASyncdConst").SyncActionState.Success}});b.length!==0&&(d("WALogger").LOG(i()),d("WAWebUserPrefsNuxPreferences").updateNuxSyncList(b));return a});function c(b){return a.apply(this,arguments)}return c}();e.$NuxSync$p_1=function(a,b,c){c={nuxAction:{acknowledged:c}};return d("WAWebSyncdActionUtils").buildPendingMutation({collection:d("WASyncdConst").CollectionName.RegularLow,indexArgs:[a],value:c,version:this.getVersion(),operation:d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET,timestamp:b,action:this.getAction()})};e.acknowledgeNux=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield this.$NuxSync$p_2(a,!0)});function c(b){return a.apply(this,arguments)}return c}();e.unAcknowledgeNux=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield this.$NuxSync$p_2(a,!1)});function c(b){return a.apply(this,arguments)}return c}();e.$NuxSync$p_2=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){d("WAWebUserPrefsNuxPreferences").updateNuxSyncList([{nuxKey:a,acknowledged:c}]);a=this.$NuxSync$p_1(a,d("WATimeUtils").unixTimeMs(),c);yield d("WAWebSyncdCoreApi").lockForSync([],[a],function(){return(h||(h=b("Promise"))).resolve()})});function c(b,c){return a.apply(this,arguments)}return c}();return c}(d("WASyncdAction").SyncActionBase);c=new a();g["default"]=c}),98); __d("WAWebPinChatSync",["$InternalEnum","Promise","WALogger","WALongInt","WANullthrows","WAServerSync.pb","WASyncAction.pb","WASyncdAction","WASyncdConst","WATimeUtils","WAWebAndroidUnsupportedActionsSync","WAWebArchiveChatSync","WAWebChatGetExistingBridge","WAWebMdSyncdDogfoodingFeatureUsageWamEvent","WAWebSchemaChat","WAWebSyncdActionUtils","WAWebSyncdCoreApi","WAWebSyncdDb","WAWebSyncdGetChat","WAWebSyncdIndexUtils","WAWebSyncdUtils","WAWebWamEnumMdFeatureCode","WAWebWamEnumMdSyncdCriticalEventCode","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime","decodeProtobuf","gkx"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: pin_chat_sync: "," already pinned, updating timestamp"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: pin_chat_sync: unpin ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: pin_chat_sync: missing pinned field"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: pin_chat_sync: missing pinAction"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: pin_chat_sync: missing chatJid in index"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: pin_chat_sync: REMOVE not supported"]);n=function(){return a};return a}var o=3,p=2;function q(a){switch(a){case r.Chat:return function(a){return!c("WAWebWid").isNewsletter(a)};case r.Newsletter:return function(a){return c("WAWebWid").isNewsletter(a)}}}var r=b("$InternalEnum").Mirrored(["Chat","Newsletter"]);a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=1,b)||babelHelpers.assertThisInitialized(c)}var f=e.prototype;f.getVersion=function(){return 5};f.getAction=function(){return d("WASyncdConst").Actions.Pin};f.applyMutations=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){c("WAWebAndroidUnsupportedActionsSync").updatePrimaryAllowsAllMutationsFlag("other mutation");var b=[];for(var d=0;d<a.length;d++)b.push(yield this.applyMutation(a[d]));return b});function d(b){return a.apply(this,arguments)}return d}();f.applyMutation=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a.operation==="remove"){d("WALogger").WARN(n());return(h||(h=b("Promise"))).resolve({actionState:d("WASyncdConst").SyncActionState.Unsupported})}var e=a.indexParts,f=a.value;a=a.timestamp;e=e[1];try{e||(d("WALogger").WARN(m()),d("WAWebSyncdIndexUtils").throwInvalidActionIndex());if(!c("WAWebWid").isWid(e)){d("WAWebSyncdUtils").uploadCriticalEventMetric(d("WAWebWamEnumMdSyncdCriticalEventCode").MD_SYNCD_CRITICAL_EVENT_CODE.ACTION_INVALID_INDEX_DATA);return{actionState:d("WASyncdConst").SyncActionState.Malformed}}f=f.pinAction;if(f==null){d("WALogger").WARN(l());return(h||(h=b("Promise"))).resolve({actionState:d("WASyncdConst").SyncActionState.Malformed})}f=f.pinned;if(f==null){d("WALogger").WARN(k());return(h||(h=b("Promise"))).resolve({actionState:d("WASyncdConst").SyncActionState.Malformed})}e=(yield d("WAWebSyncdGetChat").resolveChatForMutationIndex(d("WAWebWidFactory").createWid(e)));if(!e.success)return{actionState:d("WASyncdConst").SyncActionState.Orphan,orphanModel:e.orphanModel};var g=e.chat.id;e=e.chat.id;var q=d("WAWebWidFactory").createWid(e);if(!f){d("WALogger").DEV(j(),e);yield this.applyUpdates([{wid:q,pinned:!1,timestamp:a}]);return{actionState:d("WASyncdConst").SyncActionState.Success}}e=q.isNewsletter()?yield this.getLocalNewsletterPins():yield this.getLocalChatPins();if(e.some(function(a){return a.chatId.toString()===q.toString()})){d("WALogger").DEV(i(),g);yield this.applyUpdates([{wid:q,pinned:f,timestamp:a}]);return{actionState:d("WASyncdConst").SyncActionState.Success}}g=q.isNewsletter()?p:o;if(e.length<g){yield this.applyUpdates([{wid:q,pinned:f,timestamp:a}]);return{actionState:d("WASyncdConst").SyncActionState.Success}}c("gkx")("26258")||new(d("WAWebMdSyncdDogfoodingFeatureUsageWamEvent").MdSyncdDogfoodingFeatureUsageWamEvent)({mdSyncdDogfoodingFeature:d("WAWebWamEnumMdFeatureCode").MD_FEATURE_CODE.UNPIN_4TH_CHAT_MUTATION}).commit();g=e.reduce(function(a,b){return b.timestamp<a.timestamp?b:a});f=[];e=g.timestamp<a?g.chatId:q;e===g.chatId&&f.push({wid:g.chatId,pinned:!1,timestamp:a},{wid:q,pinned:!0,timestamp:a});yield (h||(h=b("Promise"))).all([this.applyUpdates(f),this.createPendingUnpin(e,a)]);return h.resolve({actionState:d("WASyncdConst").SyncActionState.Success})}catch(a){return{actionState:d("WASyncdConst").SyncActionState.Failed}}});function e(b){return a.apply(this,arguments)}return e}();f.applyUpdates=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a.length===0)return;var c=a.map(function(a){var b=a.wid,c=a.pinned;a=a.timestamp;b={id:b.toString(),pin:c?a:0};c&&(b.archive=!1);return b});yield (h||(h=b("Promise"))).all(c.map(function(a){return d("WAWebSchemaChat").getChatTable().merge(a.id,a)}));yield h.all(a.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield d("WAWebChatGetExistingBridge").getExisting(a.wid));if(b==null)return;b.pin=a.pinned?a.timestamp:0;a.pinned&&(b.archive=!1)});return function(b){return a.apply(this,arguments)}}()))});function c(b){return a.apply(this,arguments)}return c}();f.createPendingUnpin=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){yield d("WAWebSyncdDb").appendPendingMutationsRows([yield this.getPinMutation(b,!1,a)])});function c(b,c){return a.apply(this,arguments)}return c}();f.getLocalChatPins=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){return this.$PinChatSyncImpl$p_1(r.Chat)});function c(){return a.apply(this,arguments)}return c}();f.getLocalNewsletterPins=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){return this.$PinChatSyncImpl$p_1(r.Newsletter)});function c(){return a.apply(this,arguments)}return c}();f.$PinChatSyncImpl$p_1=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=d("WAWebSchemaChat").getChatTable().all().then(function(a){return a.filter(function(a){return a.pin!=null&&a.pin>0}).map(function(a){return[a.id,c("WANullthrows")(a.pin)]})}),f=d("WAWebSyncdDb").getSyncActionsRows(["action"],[d("WASyncdConst").Actions.Pin]).then(function(a){return a.filter(function(a){return a.actionState===d("WASyncdConst").SyncActionState.Orphan}).map(function(a){var b=JSON.parse(a.index);if(b.length<2)return null;b=b[1];a=d("decodeProtobuf").decodeProtobuf(d("WASyncAction.pb").SyncActionDataSpec,a.binarySyncData).value;return(a==null?void 0:a.pinAction)==null||(a==null?void 0:a.pinAction.pinned)!==!0?null:[b,d("WALongInt").numberOrThrowIfTooLarge((b=a.timestamp)!=null?b:0)]}).filter(Boolean)});e=(yield (h||(h=b("Promise"))).all([e,f]));f=e[0];e=e[1];var g=q(a);return[].concat(f,e).filter(function(a){a=a[0];return g(a)}).map(function(a){var b=a[0];a=a[1];return{chatId:d("WAWebWidFactory").createWid(b),timestamp:a}})});function e(b){return a.apply(this,arguments)}return e}();f.unpinAllChats=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){return this.$PinChatSyncImpl$p_2(yield this.getLocalChatPins())});function c(){return a.apply(this,arguments)}return c}();f.unpinAllNewsletters=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){return this.$PinChatSyncImpl$p_2(yield this.getLocalNewsletterPins())});function c(){return a.apply(this,arguments)}return c}();f.$PinChatSyncImpl$p_2=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=this,e=d("WATimeUtils").unixTimeMs(),f=(yield (h||(h=b("Promise"))).all(a.map(function(a){a=a.chatId;return c.getPinMutation(e,!1,a)})));return d("WAWebSyncdCoreApi").lockForSync(["chat"],f,function(){return(h||(h=b("Promise"))).resolve()}).then(function(){return c.applyUpdates(a.map(function(a){a=a.chatId;return{wid:a,pinned:!1,timestamp:e}}))})});function c(b){return a.apply(this,arguments)}return c}();f.getMutationsForPin=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e){c("gkx")("26258")||new(d("WAWebMdSyncdDogfoodingFeatureUsageWamEvent").MdSyncdDogfoodingFeatureUsageWamEvent)({mdSyncdDogfoodingFeature:d("WAWebWamEnumMdFeatureCode").MD_FEATURE_CODE.PIN_MUTATION}).commit();var f=[yield this.getPinMutation(a,b,e)];b&&f.push(yield c("WAWebArchiveChatSync").getArchiveChatMutation(a,!1,e));return f});function e(b,c,d){return a.apply(this,arguments)}return e}();f.getPinMutation=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){b={pinAction:{pinned:b}};return d("WAWebSyncdActionUtils").buildPendingMutation({collection:d("WASyncdConst").CollectionName.RegularLow,indexArgs:[yield d("WAWebSyncdGetChat").getChatJidMutationIndexForChat(c)],value:b,version:this.getVersion(),operation:d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET,timestamp:a,action:this.getAction()})});function c(b,c,d){return a.apply(this,arguments)}return c}();return e}(d("WASyncdAction").SyncActionBase);e=new a();g.MAX_PINNED_CHATS=o;g.MAX_PINNED_NEWSLETTERS=p;g.PinChatSync=e}),98); __d("WAWebPrimaryVersionSync",["WALogger","WASyncdAction","WASyncdConst","WAWebSyncdIndexUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: primary version sync, successfully get primary version ","\n with value ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: primary version sync, malformed mutation"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: primary version sync, operation not supported"]);j=function(){return a};return a}var k={CURRENT:"current",SESSION_START:"session_start"};a=function(a){babelHelpers.inheritsLoose(c,a);function c(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=null,b)||babelHelpers.assertThisInitialized(c)}var e=c.prototype;e.getVersion=function(){return 7};e.getAction=function(){return d("WASyncdConst").Actions.PrimaryVersion};e.applyMutations=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){return a.map(function(a){if(a.operation!=="set"){d("WALogger").WARN(j());return{actionState:d("WASyncdConst").SyncActionState.Unsupported}}var b=a.indexParts;a=a.value;b=b[1];(!b||b!==k.CURRENT&&b!==k.SESSION_START)&&d("WAWebSyncdIndexUtils").throwInvalidActionIndex();a=(a=a.primaryVersionAction)==null?void 0:a.version;if(a==null){d("WALogger").WARN(i());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}d("WALogger").DEV(h(),b,a);return{actionState:d("WASyncdConst").SyncActionState.Success}})});function c(b){return a.apply(this,arguments)}return c}();return c}(d("WASyncdAction").SyncActionBase);c=new a();g["default"]=c}),98); __d("WAWebSetPushnameLocallyConnAction",["WAWebConnModel","WAWebUserPrefsGeneral"],(function(a,b,c,d,e,f,g){function a(a){d("WAWebConnModel").Conn.pushname=a,d("WAWebUserPrefsGeneral").setPushname(a)}g.setPushnameLocally=a}),98); __d("WAWebPushNameSync",["Promise","WALogger","WASendPresenceStatusProtocol","WAServerSync.pb","WASyncdAction","WASyncdConst","WAWebSetPushnameLocallyConnAction","WAWebSyncBootstrap","WAWebSyncdActionUtils","WAWebSyncdCriticalBootstrapProcessingApi","WAWebWamEnumBootstrapAppStateDataStageCode","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["push name sync: operation not supported"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: successfully set pushname to ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["push name sync: empty pushname"]);k=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=null,b)||babelHelpers.assertThisInitialized(c)}var f=e.prototype;f.getVersion=function(){return 1};f.getAction=function(){return d("WASyncdConst").Actions.SettingPushName};f.applyMutations=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield (h||(h=b("Promise"))).all(a.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){try{if(a.operation==="set"){a=a.value;a=(a=a.pushNameSetting)==null?void 0:a.name;a||(d("WALogger").WARN(k()),d("WAWebSyncdCriticalBootstrapProcessingApi").logCriticalBootstrapStageIfNecessary(d("WAWebWamEnumBootstrapAppStateDataStageCode").BOOTSTRAP_APP_STATE_DATA_STAGE_CODE.PUSHNAME_INVALID),a="");void d("WASendPresenceStatusProtocol").sendPresenceStatusProtocol({name:a});d("WAWebSetPushnameLocallyConnAction").setPushnameLocally(a);yield d("WAWebSyncdCriticalBootstrapProcessingApi").logCriticalBootstrapStageIfNecessary(d("WAWebWamEnumBootstrapAppStateDataStageCode").BOOTSTRAP_APP_STATE_DATA_STAGE_CODE.PUSHNAME_APPLIED);c("WAWebSyncBootstrap").isSyncDCriticalDataSyncInProcess()&&(yield c("WAWebSyncBootstrap").setSyncDCriticalSynced(),yield c("WAWebSyncBootstrap").setSyncDCriticalDataSyncCompleted());d("WALogger").DEV(j(),a);return(h||(h=b("Promise"))).resolve({actionState:d("WASyncdConst").SyncActionState.Success})}d("WALogger").WARN(i());return(h||(h=b("Promise"))).resolve({actionState:d("WASyncdConst").SyncActionState.Unsupported})}catch(a){d("WAWebSyncdCriticalBootstrapProcessingApi").logCriticalBootstrapStageIfNecessary(d("WAWebWamEnumBootstrapAppStateDataStageCode").BOOTSTRAP_APP_STATE_DATA_STAGE_CODE.PUSHNAME_INVALID);return{actionState:d("WASyncdConst").SyncActionState.Failed}}});return function(b){return a.apply(this,arguments)}}())));return a});function e(b){return a.apply(this,arguments)}return e}();f.getPushnameMutation=function(a,b){b={pushNameSetting:{name:b}};return d("WAWebSyncdActionUtils").buildPendingMutation({collection:d("WASyncdConst").CollectionName.CriticalBlock,indexArgs:[],value:b,version:this.getVersion(),operation:d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET,timestamp:a,action:this.getAction()})};return e}(d("WASyncdAction").SyncActionBase);e=new a();g["default"]=e}),98); __d("WAWebQuickRepliesSync",["Promise","WALogger","WAServerSync.pb","WASyncdAction","WASyncdConst","WAWebQuickReplyCollection","WAWebSchemaQuickReply","WAWebSyncdActionUtils","WAWebSyncdIndexUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["quick replies sync: operation not supported"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["quick replies sync: malformed mutation"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["quick replies sync: malformed mutation"]);k=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(c,a);function c(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=null,b)||babelHelpers.assertThisInitialized(c)}var e=c.prototype;e.getVersion=function(){return 2};e.getAction=function(){return d("WASyncdConst").Actions.QuickReply};e.applyMutations=function(a){return(h||(h=b("Promise"))).all(a.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){try{if(a.operation==="set"){var b=a.indexParts;a=a.value;b=b[1];b||d("WAWebSyncdIndexUtils").throwInvalidActionIndex();a=a.quickReplyAction;if(!a){d("WALogger").WARN(k());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}if(a.deleted===!0){yield d("WAWebSchemaQuickReply").getQuickReplyTable().remove(b);d("WAWebQuickReplyCollection").QuickReplyCollection.remove(b);return{actionState:d("WASyncdConst").SyncActionState.Success}}var c=a.shortcut,e=a.message;if(c==null||c===""||e==null||e===""){d("WALogger").WARN(j());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}var f=a.keywords||[];a=a.count||0;var g={id:b,shortcut:c,count:a,message:e,keywords:f};yield d("WAWebSchemaQuickReply").getQuickReplyTable().createOrReplace(g);d("WAWebQuickReplyCollection").QuickReplyCollection.add({id:b,shortcut:c,message:e,keywords:f,count:a},{merge:!0});return{actionState:d("WASyncdConst").SyncActionState.Success}}d("WALogger").WARN(i());return{actionState:d("WASyncdConst").SyncActionState.Unsupported}}catch(a){return{actionState:d("WASyncdConst").SyncActionState.Failed}}});return function(b){return a.apply(this,arguments)}}()))};e.getQuickReplyDeleteMutation=function(a,b){var c={quickReplyAction:{deleted:!0,keywords:[],shortcut:"",message:"",count:0}};return d("WAWebSyncdActionUtils").buildPendingMutation({collection:d("WASyncdConst").CollectionName.Regular,indexArgs:[a],value:c,version:this.getVersion(),operation:d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET,timestamp:b,action:this.getAction()})};e.getQuickReplyAddOrEditMutation=function(a,b,c,e,f,g){f={quickReplyAction:{deleted:!1,keywords:f,shortcut:b,message:c,count:e}};return d("WAWebSyncdActionUtils").buildPendingMutation({collection:d("WASyncdConst").CollectionName.Regular,indexArgs:[a],value:f,version:this.getVersion(),operation:d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET,timestamp:g,action:this.getAction()})};return c}(d("WASyncdAction").SyncActionBase);c=new a();g["default"]=c}),98); __d("WAWebSentinelMutationSync",["Promise","WALogger","WAServerSync.pb","WASyncdAction","WASyncdConst","WATagsLogger","WATimeUtils","WAWebGetSyncKey","WAWebSyncdActionUtils","WAWebSyncdKeyManagement","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["sentinel mutation sync: no key pairs"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["preparing mutations..."]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["sentinel mutation sync: operation not supported"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["sentinel mutation sync: malformed mutation"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["applying mutations..."]);m=function(){return a};return a}var n=d("WATagsLogger").TAGS(["syncd","SentinelMutationSync"]);a=function(a){babelHelpers.inheritsLoose(c,a);function c(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=null,b)||babelHelpers.assertThisInitialized(c)}var e=c.prototype;e.getVersion=function(){return 3};e.getAction=function(){return d("WASyncdConst").Actions.Sentinel};e.applyMutations=function(a){n.LOG(m());return(h||(h=b("Promise"))).all(a.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){try{if(a.operation==="set"){a=(a=a.value.keyExpiration)==null?void 0:a.expiredKeyEpoch;if(a==null){d("WALogger").ERROR(l());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}yield d("WAWebGetSyncKey").expireSyncKeyInTransaction(a);return{actionState:d("WASyncdConst").SyncActionState.Success}}d("WALogger").WARN(k());return{actionState:d("WASyncdConst").SyncActionState.Unsupported}}catch(a){return{actionState:d("WASyncdConst").SyncActionState.Failed}}});return function(b){return a.apply(this,arguments)}}()))};e.getSentinelMutations=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=this;n.LOG(j());var b=d("WATimeUtils").unixTimeMs(),c=Array.from(d("WASyncdConst").CollectionName.members()),e=(yield d("WAWebSyncdKeyManagement").getNewestKeyPair());if(e==null){d("WALogger").ERROR(i());return[]}e=e.keyEpoch;var f={keyExpiration:{expiredKeyEpoch:e}};return c.map(function(c){return d("WAWebSyncdActionUtils").buildPendingMutation({collection:c,indexArgs:[c],operation:d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET,version:a.getVersion(),value:f,timestamp:b,action:a.getAction()})})});function c(){return a.apply(this,arguments)}return c}();return c}(d("WASyncdAction").SyncActionBase);c=new a();Object.freeze(c);e=c;g["default"]=e}),98); __d("WAWebStarMessageSync",["Promise","WALogger","WANullthrows","WAServerSync.pb","WASyncdAction","WASyncdConst","WATimeUtils","WAWebAssociationProcessor","WAWebAssociationProcessorConstants","WAWebCurrentUser","WAWebDBProcessMessage","WAWebLid1X1MigrationGating","WAWebMessageAssociationGatingUtils","WAWebMsgCollection","WAWebMsgKey","WAWebSchemaChat","WAWebStarredMsgCollection","WAWebSyncdActionUtils","WAWebSyncdGetChat","WAWebSyncdIndexUtils","WAWebSyncdResolveMessages","WAWebSyncdUtils","WAWebWamEnumMdSyncdCriticalEventCode","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: after persist stars"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: before persist stars"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["star message sync: operation not supported"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: successfully "," msg ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["star_message_sync: msg "," found in storage but not in collection"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["star message sync: found chat via fallback"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["star message sync: malformed mutation"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: after gather cache for star message"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: start apply star message"]);q=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=1,b)||babelHelpers.assertThisInitialized(c)}var f=e.prototype;f.getVersion=function(){return 2};f.getAction=function(){return d("WASyncdConst").Actions.Star};f.applyMutations=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=[],f=[];d("WAWebCurrentUser").isEmployee()&&d("WALogger").LOG(q());var g=(yield d("WAWebSyncdResolveMessages").resolveMessagesForMutations(a)),r=g.incomingRemoteToLocalChatId,s=g.messagesInDB;d("WAWebCurrentUser").isEmployee()&&d("WALogger").LOG(p());g=(yield (h||(h=b("Promise"))).all(a.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){try{if(a.operation==="set"){var b=a.indexParts;a=a.value;var g=b[1],h=b[2],i=b[3];b=b[4];(!g||!h||!i||!b)&&d("WAWebSyncdIndexUtils").throwInvalidActionIndex();a=(a=a.starAction)==null?void 0:a.starred;var j=r.get(g);if(a==null){d("WALogger").WARN(o());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}g=d("WAWebSyncdIndexUtils").syncKeyToMsgKey(g,h,i,b);if(g==null){d("WAWebSyncdUtils").uploadCriticalEventMetric(d("WAWebWamEnumMdSyncdCriticalEventCode").MD_SYNCD_CRITICAL_EVENT_CODE.ACTION_INVALID_INDEX_DATA);return{actionState:d("WASyncdConst").SyncActionState.Malformed}}if(j==null){if(!d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()){var p=(yield d("WAWebSchemaChat").getChatTable().get(g.remote.toString()));p!=null&&d("WALogger").ERROR(n()).sendLogs("star-message-sync-found-chat-via-fallback",{sampling:.01})}return{actionState:d("WASyncdConst").SyncActionState.Orphan,orphanModel:{modelId:g.toString(),modelType:d("WASyncdConst").SyncModelType.Msg}}}var q=c("WANullthrows")(d("WAWebSyncdIndexUtils").syncKeyToMsgKey(j,h,i,b,!1));p=s.find(function(a){return a.startsWith(q.toString())});if(p==null)return{actionState:d("WASyncdConst").SyncActionState.Orphan,orphanModel:{modelId:g.toString(),modelType:d("WASyncdConst").SyncModelType.Msg}};a?e.push(p.toString()):f.push(p.toString());j=d("WAWebMsgCollection").MsgCollection.get(p);if(j){h=j.associationType;if(h!=null&&d("WAWebMessageAssociationGatingUtils").isMessageAssociationInfraEnabled()){i=d("WAWebAssociationProcessor").getAssociationProcessorByAssociationType(h);(i==null?void 0:i.processorType)===d("WAWebAssociationProcessorConstants").AssociationProcessorType.WithDetachedMessages&&j.detachAssociatedMsg()}j.star=a;j.star?d("WAWebStarredMsgCollection").addStarredMsgs([j]):d("WAWebStarredMsgCollection").removeStarredMsgs([j])}else d("WALogger").WARN(m(),q);d("WALogger").DEV(l(),a?"starred":"unstarred",q);return{actionState:d("WASyncdConst").SyncActionState.Success}}d("WALogger").WARN(k());return{actionState:d("WASyncdConst").SyncActionState.Unsupported}}catch(a){return{actionState:d("WASyncdConst").SyncActionState.Failed}}});return function(b){return a.apply(this,arguments)}}())));d("WAWebCurrentUser").isEmployee()&&d("WALogger").LOG(j());yield h.all([d("WAWebDBProcessMessage").starMessages(e),d("WAWebDBProcessMessage").unstarMessages(f)]);d("WAWebCurrentUser").isEmployee()&&d("WALogger").LOG(i());return g});function e(b){return a.apply(this,arguments)}return e}();f.getStarMessageMutations=function(a,e){var f=this,g=d("WATimeUtils").unixTimeMs();return(h||(h=b("Promise"))).all(a.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b={starAction:{starred:e}};a=new(c("WAWebMsgKey"))({fromMe:a.fromMe,participant:a.participant,remote:d("WAWebWidFactory").createWid(yield d("WAWebSyncdGetChat").getChatJidMutationIndexForChat(a.remote)),id:a.id});return d("WAWebSyncdActionUtils").buildPendingMutation({collection:d("WASyncdConst").CollectionName.RegularHigh,indexArgs:d("WAWebSyncdUtils").constructMsgKeySegmentsFromMsgKey(a),operation:d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET,version:f.getVersion(),value:b,timestamp:g,action:f.getAction()})});return function(b){return a.apply(this,arguments)}}()))};return e}(d("WASyncdAction").SyncActionBase);e=new a();g["default"]=e}),98); __d("WAWebSyncdGetActionHandler",["WAWebCollectionHandlerActions"],(function(a,b,c,d,e,f,g){"use strict";var h=null,i=null;function a(a){h==null&&(h=new Map(d("WAWebCollectionHandlerActions").ActionHandlers.map(function(a){return[a.getAction(),a]})));return h.get(a)}function b(){i==null&&(i=Math.max.apply(Math,d("WAWebCollectionHandlerActions").ActionHandlers.map(function(a){return a.getVersion()})));return i}g.getActionHandler=a;g.maxSupportedVersion=b}),98); __d("WAWebSyncdIndexUtils",["WALogger","WAWebMsgKey","WAWebSyncdError","WAWebSyncdUploadFatalErrorMetric","WAWebUserPrefsMeUser","WAWebWamEnumMdSyncdFatalErrorCode","WAWebWid","WAWebWidFactory","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[sync-action] star action index data is malformed, , cannot create MsgKey"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncKeyToMsgKey: invalid participant value: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncKeyToMsgKey: invalid remote value: ",""]);j=function(){return a};return a}var k=/\d(?=)/gm;function l(a,b,e,f,g){g===void 0&&(g=!0);var h=void 0;if(!c("WAWebWid").isWid(a)){d("WALogger").WARN(j(),a.replace(k,"#"));return null}if(!d("WAWebWidFactory").createWid(a).isUser()){if(e==="0"&&!c("WAWebWid").isWid(f)){d("WALogger").WARN(i(),f.replace(k,"#"));return null}e==="1"?h=g?d("WAWebUserPrefsMeUser").getMeUser():void 0:h=d("WAWebWidFactory").createWid(f)}return new(c("WAWebMsgKey"))({fromMe:e==="1",remote:d("WAWebWidFactory").createWid(a),id:b,participant:h})}function a(a){a=JSON.parse(a);if(a.length<5)throw c("err")("[sync-action] star action index malformed, cannot create MsgKey");a=l(a[1],a[2],a[3],a[4]);if(!a){d("WALogger").WARN(h());throw c("err")("[sync-action] star action index data is malformed, , cannot create MsgKey")}return a}function b(){d("WAWebSyncdUploadFatalErrorMetric").uploadFatalErrorMetric(d("WAWebWamEnumMdSyncdFatalErrorCode").MD_SYNCD_FATAL_ERROR_CODE.INVALID_ACTION_INDEX,null);throw new(d("WAWebSyncdError").SyncdFatalError)("invalid action index")}g.syncKeyToMsgKey=l;g.getMsgKeyFromStarActionIndex=a;g.throwInvalidActionIndex=b}),98); __d("WAWebUserStatusMuteSync",["Promise","WALogger","WAServerSync.pb","WASyncdAction","WASyncdConst","WAWebContactCollection","WAWebLidAwareContactsDB","WAWebSyncdActionUtils","WAWebSyncdIndexUtils","WAWebSyncdUtils","WAWebWamEnumMdSyncdCriticalEventCode","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["status user mute chat sync: operation not supported"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: user status mute for "," will be added in bulk"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["UserStatusMuteSyncd: malformed mutation ",""]);k=function(){return a};return a}function l(a){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=new Set();yield c("WAWebLidAwareContactsDB").bulkGet(a.map(function(a){a=a.indexParts;a=a[1];return!a||!c("WAWebWid").isWid(a)?null:a}).filter(Boolean)).then(function(a){return a.forEach(function(a){a&&b.add(a.id)})});return b});return m.apply(this,arguments)}a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=null,b)||babelHelpers.assertThisInitialized(c)}var f=e.prototype;f.getVersion=function(){return 7};f.getAction=function(){return d("WASyncdConst").Actions.UserStatusMute};f.applyMutations=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=(yield l(a)),f=[];a=(yield (h||(h=b("Promise"))).all(a.map(function(a){try{if(a.operation==="set"){var b=a.indexParts,g=a.value;b=b[1];b||d("WAWebSyncdIndexUtils").throwInvalidActionIndex();if(!c("WAWebWid").isWid(b)){d("WAWebSyncdUtils").uploadCriticalEventMetric(d("WAWebWamEnumMdSyncdCriticalEventCode").MD_SYNCD_CRITICAL_EVENT_CODE.ACTION_INVALID_INDEX_DATA);return{actionState:d("WASyncdConst").SyncActionState.Malformed}}g=(g=g.userStatusMuteAction)==null?void 0:g.muted;if(g===void 0){d("WALogger").WARN(k(),a);return{actionState:d("WASyncdConst").SyncActionState.Malformed}}if(!e.has(b))return{actionState:d("WASyncdConst").SyncActionState.Orphan,orphanModel:{modelId:b,modelType:d("WASyncdConst").SyncModelType.UserStatusMute}};f.push({id:b,statusMute:g});d("WALogger").DEV(j(),b);return{actionState:d("WASyncdConst").SyncActionState.Success}}d("WALogger").WARN(i());return{actionState:d("WASyncdConst").SyncActionState.Unsupported}}catch(a){return{actionState:d("WASyncdConst").SyncActionState.Failed}}})));yield c("WAWebLidAwareContactsDB").bulkCreateOrMerge(f);var g=f.map(function(a){var b=d("WAWebWidFactory").createUserWid(a.id),c=d("WAWebContactCollection").ContactCollection.get(b);return{id:b,pushname:(c==null?void 0:c.pushname)||"",type:(c==null?void 0:c.type)||"out",name:c==null?void 0:c.name,statusMute:a.statusMute}});d("WAWebContactCollection").ContactCollection.add(g,{merge:!0});return a});function e(b){return a.apply(this,arguments)}return e}();f.getMutationForStatusMute=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){b={userStatusMuteAction:{muted:b}};a=d("WAWebSyncdActionUtils").buildPendingMutation({action:this.getAction(),collection:d("WASyncdConst").CollectionName.RegularHigh,indexArgs:[a.toString({legacy:!0})],operation:d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET,timestamp:c,value:b,version:this.getVersion()});return a});function c(b,c,d){return a.apply(this,arguments)}return c}();return e}(d("WASyncdAction").SyncActionBase);e=new a();g["default"]=e}),98); __d("WAWebCustomPaymentMethodsSync",["WALogger","WASyncdAction","WASyncdConst","WAWebABProps","WAWebBackendApi","WAWebMobilePlatforms","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Custom Payment Methods sync: successfully synced payment methods"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Custom Payment Methods sync: malformed mutation"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Custom Payment Methods sync: operation not supported"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["Custom Payment Methods sync: operation not supported, user does not pass ABProp"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["Custom Payment Methods sync: operation not supported, app is not SMB"]);l=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(c,a);function c(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=null,b)||babelHelpers.assertThisInitialized(c)}var e=c.prototype;e.getVersion=function(){return 7};e.getAction=function(){return d("WASyncdConst").Actions.CustomPaymentMethods};e.applyMutations=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(d("WAWebMobilePlatforms").isSMB()!==!0){d("WALogger").WARN(l());return a.map(function(){return{actionState:d("WASyncdConst").SyncActionState.Unsupported}})}if(d("WAWebABProps").getABPropConfigValue("payments_br_pix_phase_1_seller_sync_enabled")!==!0){d("WALogger").WARN(k());return a.map(function(){return{actionState:d("WASyncdConst").SyncActionState.Unsupported}})}return a.map(function(a){if(a.operation!=="set"){d("WALogger").WARN(j());return{actionState:d("WASyncdConst").SyncActionState.Unsupported}}a=(a=a.value.customPaymentMethodsAction)==null?void 0:a.customPaymentMethods;if(a==null){d("WALogger").WARN(i());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}d("WAWebBackendApi").frontendFireAndForget("setCustomPaymentMethods",{customPaymentMethods:a});d("WALogger").DEV(h());return{actionState:d("WASyncdConst").SyncActionState.Success}})});function c(b){return a.apply(this,arguments)}return c}();return c}(d("WASyncdAction").SyncActionBase);c=new a();g["default"]=c}),98); __d("WAWebDBLabelsReorder",["Promise","WALogger","WAWebModelStorageUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[Label] updateLabelsSortOrder: updating storage failed"]);i=function(){return a};return a}function a(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield d("WAWebModelStorageUtils").getStorage().lock(["label"],function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(c){var e=c[0],f=a.reduce(function(a,b,c){a.set(b,c);return a},new Map([]));try{c=a.map(function(a){return String(a)});c=(yield e.bulkGet(c));var g=[];c.forEach(function(a){if(a==null)return;var b=f.get(Number(a.id));b!=null&&g.push(e.merge(a.id,{orderIndex:b}))});return(h||(h=b("Promise"))).all(g)}catch(a){d("WALogger").ERROR(i()).devConsole(a).tags("labels").sendLogs("labels-db-update-failed");throw a}});return function(a){return c.apply(this,arguments)}}())});return j.apply(this,arguments)}g.updateLabelsSortOrder=a}),98); __d("WAWebLabelReorderingSync",["Promise","WALogger","WAPromiseEach","WASyncdAction","WASyncdConst","WAWebBackendApi","WAWebBizGatingUtils","WAWebDBLabelsReorder","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[Label] reordering sync: operation failed"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[Label] reordering sync: operation not supported"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[Label] reordering sync: operation successful"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[Label] reordering sync: malformed mutation"]);l=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(c,a);function c(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=null,b)||babelHelpers.assertThisInitialized(c)}var e=c.prototype;e.getVersion=function(){return 3};e.getAction=function(){return d("WASyncdConst").Actions.LabelReordering};e.applyMutations=function(a){return!d("WAWebBizGatingUtils").isLabelReorderingSyncFromPrimaryEnabled()?(h||(h=b("Promise"))).resolve([{actionState:d("WASyncdConst").SyncActionState.Skipped}]):d("WAPromiseEach").promiseEach(a,function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){try{if(a.operation==="set"){a=a.value;a=a==null?void 0:a.labelReorderingAction;if(a==null||a.sortedLabelIds==null||Array.isArray(a.sortedLabelIds)===!1||a.sortedLabelIds.length===0){d("WALogger").WARN(l());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}yield d("WAWebDBLabelsReorder").updateLabelsSortOrder(a.sortedLabelIds);d("WALogger").LOG(k());d("WAWebBackendApi").frontendFireAndForget("reorderLabels",{sortedLabelIds:a.sortedLabelIds});return{actionState:d("WASyncdConst").SyncActionState.Success}}d("WALogger").WARN(j());return{actionState:d("WASyncdConst").SyncActionState.Unsupported}}catch(a){d("WALogger").WARN(i()).verbose().devConsole(a);return{actionState:d("WASyncdConst").SyncActionState.Failed}}});return function(b){return a.apply(this,arguments)}}())};return c}(d("WASyncdAction").SyncActionBase);c=new a();g["default"]=c}),98); __d("WAWebLocaleSettingSync",["Promise","WALogger","WASyncdAction","WASyncdConst","WAWebEnvironment","WAWebL10N","WAWebL10NConstants","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["locale setting sync: operation not supported"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: successfully set locale to ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["locale setting sync: malformed mutation"]);k=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=null,b)||babelHelpers.assertThisInitialized(c)}var f=e.prototype;f.getVersion=function(){return 3};f.getAction=function(){return d("WASyncdConst").Actions.LocaleSetting};f.applyMutations=function(a){return(h||(h=b("Promise"))).all(a.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){try{if(c("WAWebEnvironment").isWindows)return{actionState:d("WASyncdConst").SyncActionState.Skipped};if(a.operation==="set"){a=a.value;a=a.localeSetting;if(!a){d("WALogger").WARN(k());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}var b=a.locale;yield c("WAWebL10N").setLocale(b,d("WAWebL10NConstants").L10N_PRIORITY.PHONE,!1);d("WALogger").DEV(j(),a.locale);return{actionState:d("WASyncdConst").SyncActionState.Success}}d("WALogger").WARN(i());return{actionState:d("WASyncdConst").SyncActionState.Unsupported}}catch(a){return{actionState:d("WASyncdConst").SyncActionState.Failed}}});return function(b){return a.apply(this,arguments)}}()))};return e}(d("WASyncdAction").SyncActionBase);e=new a();g["default"]=e}),98); __d("WAWebUserPrefsCustomPaymentMethods",["WALogger","WAWebUserPrefsKeys","WAWebUserPrefsLocalStorage","WAWebUserPrefsTypes"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["pix_display_name is null"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["pix_key_type is invalid"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["pix_key_type is null"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["pix_key is null"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["invalid custom payment method type: ",""]);l=function(){return a};return a}function m(a){return a!=null&&o(a.display_name)&&o(a.credentialId)&&o(a.key)&&o(a.key_type)&&d("WAWebUserPrefsTypes").PixKeyType.cast(a.key_type)!=null&&o(a.country)}function a(){var a;a=(a=n())==null?void 0:a.pix;return m(a)&&a?a:null}function n(){var a=c("WAWebUserPrefsLocalStorage").getItemFromLocalStorage(d("WAWebUserPrefsKeys").KEYS.CUSTOM_PAYMENT_METHODS);return a}function b(a){var b={};a.forEach(function(a){var c=d("WAWebUserPrefsTypes").WACustomPaymentMethodType.cast(a.type);if(c==null){d("WALogger").ERROR(l(),a.type).sendLogs("monitor-errors");return}switch(c){case d("WAWebUserPrefsTypes").WACustomPaymentMethodType.PIX_KEY:var e,f;c=(c=a.metadata.filter(function(a){return a.key==="pix_key"}))==null?void 0:(c=c.at(0))==null?void 0:c.value;if(c==null){d("WALogger").ERROR(k()).sendLogs("monitor-errors");return}e=(e=a.metadata.filter(function(a){return a.key==="pix_key_type"}))==null?void 0:(e=e.at(0))==null?void 0:e.value;if(e==null){d("WALogger").ERROR(j()).sendLogs("monitor-errors");return}e=d("WAWebUserPrefsTypes").PixKeyType.cast(e.toUpperCase());if(e==null){d("WALogger").ERROR(i()).sendLogs("monitor-errors");return}f=(f=a.metadata.filter(function(a){return a.key==="pix_display_name"}))==null?void 0:(f=f.at(0))==null?void 0:f.value;if(f==null){d("WALogger").ERROR(h()).sendLogs("monitor-errors");return}b.pix={credentialId:a.credentialId,key:c,key_type:e,display_name:f,country:a.country};break}});c("WAWebUserPrefsLocalStorage").setItemToLocalStorage(d("WAWebUserPrefsKeys").KEYS.CUSTOM_PAYMENT_METHODS,b)}function e(){var a;a=(a=n())==null?void 0:a.pix;return m(a)}function o(a,b){b===void 0&&(b=!1);return b&&a==null?!0:typeof a==="string"&&a.trim().length>0}g.getPIX=a;g.setCustomPaymentMethods=b;g.isPIXValid=e;g.isStringFieldValid=o}),98); __d("WAWebUserPrefsMerchantPaymentPartner",["WASyncAction.pb","WAWebUserPrefsCustomPaymentMethods","WAWebUserPrefsKeys","WAWebUserPrefsLocalStorage","WAWebUserPrefsTypes"],(function(a,b,c,d,e,f,g){function h(){var a=c("WAWebUserPrefsLocalStorage")==null?void 0:c("WAWebUserPrefsLocalStorage").getItemFromLocalStorage(d("WAWebUserPrefsKeys").KEYS.MERCHANT_PAYMENT_PARTNER);return a}function a(){var a=h();return i(a)&&a?a:null}function i(a){if(!a)return!1;var b=a.status,c=a.country,e=a.credential_id;a=a.gateway_name;if(b===d("WAWebUserPrefsTypes").PaymentPartnerStatusType.ACTIVE)return d("WAWebUserPrefsCustomPaymentMethods").isStringFieldValid(c)&&d("WAWebUserPrefsCustomPaymentMethods").isStringFieldValid(e)&&d("WAWebUserPrefsCustomPaymentMethods").isStringFieldValid(a);else if(b===d("WAWebUserPrefsTypes").PaymentPartnerStatusType.INACTIVE)return d("WAWebUserPrefsCustomPaymentMethods").isStringFieldValid(c)&&d("WAWebUserPrefsCustomPaymentMethods").isStringFieldValid(e,!0)&&d("WAWebUserPrefsCustomPaymentMethods").isStringFieldValid(a,!0);return!1}function b(a){var b=a.status===d("WASyncAction.pb").SyncActionValue$MerchantPaymentPartnerAction$Status.ACTIVE?d("WAWebUserPrefsTypes").PaymentPartnerStatusType.ACTIVE:d("WAWebUserPrefsTypes").PaymentPartnerStatusType.INACTIVE;b={status:b,country:a.country,gateway_name:a.gatewayName,credential_id:a.credentialId};c("WAWebUserPrefsLocalStorage").setItemToLocalStorage(d("WAWebUserPrefsKeys").KEYS.MERCHANT_PAYMENT_PARTNER,b)}function e(){var a=h();return i(a)}f={getPaymentPartner:a,isPaymentPartnerValid:e,setMerchantPaymentPartner:b};g["default"]=f}),98); __d("WAWebMerchantPaymentPartnerSync",["WALogger","WASyncdAction","WASyncdConst","WAWebABProps","WAWebMobilePlatforms","WAWebUserPrefsMerchantPaymentPartner","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Merchant Payment Partner sync: successfully synced payment methods"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Merchant Payment Partner sync:malformed mutation"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Merchant Payment Partner sync: operation not supported"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["Merchant Payment Partner sync: operation not supported, user does not pass ABProp"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["Merchant Payment Partner sync: operation not supported, app is not SMB"]);l=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=null,b)||babelHelpers.assertThisInitialized(c)}var f=e.prototype;f.getVersion=function(){return 7};f.getAction=function(){return d("WASyncdConst").Actions.MerchantPaymentPartner};f.applyMutations=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(d("WAWebMobilePlatforms").isSMB()!==!0){d("WALogger").WARN(l());return a.map(function(){return{actionState:d("WASyncdConst").SyncActionState.Unsupported}})}if(d("WAWebABProps").getABPropConfigValue("payments_br_merchant_psp_account_status_sync")!==!0){d("WALogger").WARN(k());return a.map(function(){return{actionState:d("WASyncdConst").SyncActionState.Unsupported}})}return a.map(function(a){if(a.operation!=="set"){d("WALogger").WARN(j());return{actionState:d("WASyncdConst").SyncActionState.Unsupported}}a=a.value.merchantPaymentPartnerAction;if(a==null){d("WALogger").WARN(i());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}c("WAWebUserPrefsMerchantPaymentPartner").setMerchantPaymentPartner(a);d("WALogger").DEV(h());return{actionState:d("WASyncdConst").SyncActionState.Success}})});function e(b){return a.apply(this,arguments)}return e}();return e}(d("WASyncdAction").SyncActionBase);e=new a();Object.freeze(e);f=e;g["default"]=f}),98); __d("WAWebPaymentInfoSync",["WALogger","WASyncdAction","WASyncdConst","WAWebABProps","WAWebBackendApi","WAWebMobilePlatforms","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["payment info sync: successfully set cpi info"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["cpi payment info sync: malformed mutation"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["payment info sync: operation not supported"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["payment info sync: operation not supported, user does not pass ABProp"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["payment info sync: operation not supported, app is not SMB"]);l=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(c,a);function c(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=null,b)||babelHelpers.assertThisInitialized(c)}var e=c.prototype;e.getVersion=function(){return 7};e.getAction=function(){return d("WASyncdConst").Actions.PaymentInfo};e.applyMutations=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(d("WAWebMobilePlatforms").isSMB()!==!0){d("WALogger").WARN(l());return a.map(function(){return{actionState:d("WASyncdConst").SyncActionState.Unsupported}})}if(d("WAWebABProps").getABPropConfigValue("order_details_payment_instructions_sync_enabled")!==!0){d("WALogger").WARN(k());return a.map(function(){return{actionState:d("WASyncdConst").SyncActionState.Unsupported}})}return a.map(function(a){if(a.operation!=="set"){d("WALogger").WARN(j());return{actionState:d("WASyncdConst").SyncActionState.Unsupported}}a=(a=a.value.paymentInfoAction)==null?void 0:a.cpi;if(typeof a!=="string"){d("WALogger").WARN(i());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}d("WAWebBackendApi").frontendFireAndForget("setCPIInfo",{cpiInfo:a});d("WALogger").DEV(h());return{actionState:d("WASyncdConst").SyncActionState.Success}})});function c(b){return a.apply(this,arguments)}return c}();return c}(d("WASyncdAction").SyncActionBase);c=new a();g["default"]=c}),98); __d("WAWebPnForLidChatSync",["WALogger","WASyncdAction","WASyncdConst","WAWebABProps","WAWebDBCreateLidPnMappings","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["pn_for_lid_chat sync: successfully updated the lidXPn mapping}"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["pn_for_lid_chat sync: malformed mutation - invalid pnJid"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["pn_for_lid_chat sync: malformed mutation - invalid key"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["pn_for_lid_chat sync: operation not supported"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["pn_for_lid_chat sync: operation not supported"]);l=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(c,a);function c(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=null,b)||babelHelpers.assertThisInitialized(c)}var e=c.prototype;e.getVersion=function(){return 8};e.getAction=function(){return d("WASyncdConst").Actions.PnForLidChat};e.applyMutations=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(d("WAWebABProps").getABPropConfigValue("pnh_pn_for_lid_chat_sync")!==!0){d("WALogger").WARN(l());return a.map(function(){return{actionState:d("WASyncdConst").SyncActionState.Unsupported}})}var b=[];a=a.map(function(a){if(a.operation!=="set"){d("WALogger").WARN(k());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}var c=a.indexParts[1];if(!d("WAWebWidFactory").isWidlike(c)){d("WALogger").WARN(j());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}a=(a=a.value.pnForLidChatAction)==null?void 0:a.pnJid;if(a==null||!d("WAWebWidFactory").isWidlike(a)){d("WALogger").WARN(i());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}a=d("WAWebWidFactory").createUserWid(a);c=d("WAWebWidFactory").toUserLidOrThrow(d("WAWebWidFactory").createUserWid(c));b.push({lid:c,pn:a});return{actionState:d("WASyncdConst").SyncActionState.Success}});yield d("WAWebDBCreateLidPnMappings").createLidPnMappings({mappings:b,flushImmediately:!0,learningSource:"other"});d("WALogger").DEV(h());return a});function c(b){return a.apply(this,arguments)}return c}();return c}(d("WASyncdAction").SyncActionBase);c=new a();g["default"]=c}),98); __d("WAWebPrimaryFeatureSync",["WALogger","WANullthrows","WASyncdAction","WASyncdConst","WAWebPrimaryFeatures","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["primary feature sync: successfully set flags to ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["primary feature sync: malformed mutation"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["primary feature sync: operation not supported"]);j=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=null,b)||babelHelpers.assertThisInitialized(c)}var f=e.prototype;f.getVersion=function(){return 7};f.getAction=function(){return d("WASyncdConst").Actions.PrimaryFeature};f.applyMutations=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b;a=a.map(function(a){var c;if(a.operation!=="set"){d("WALogger").WARN(j());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}c=(c=a.value.primaryFeature)==null?void 0:c.flags;if(c==null){d("WALogger").WARN(i());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}(b==null||a.timestamp>b.timestamp)&&(b=a);return{actionState:d("WASyncdConst").SyncActionState.Success}});if(b!=null){var e;e=c("WANullthrows")((e=b.value.primaryFeature)==null?void 0:e.flags);yield d("WAWebPrimaryFeatures").setPrimaryFeatures(e);d("WALogger").DEV(h(),e)}return a});function e(b){return a.apply(this,arguments)}return e}();return e}(d("WASyncdAction").SyncActionBase);e=new a();g["default"]=e}),98); __d("WAWebShareOwnPnSync",["WALogger","WASyncdAction","WASyncdConst","WAWebABProps","WAWebUpdateLidMetadataJob","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["share_own_pn sync: successfully updated shareOwnPn value}"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["share_own_pn sync: malformed mutation - invalid key"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["share_own_pn sync: operation not supported"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["share_own_pn sync: operation not supported"]);k=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(c,a);function c(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=null,b)||babelHelpers.assertThisInitialized(c)}var e=c.prototype;e.getVersion=function(){return 8};e.getAction=function(){return d("WASyncdConst").Actions.ShareOwnPn};e.applyMutations=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(d("WAWebABProps").getABPropConfigValue("share_own_pn_sync")!==!0){d("WALogger").WARN(k());return a.map(function(){return{actionState:d("WASyncdConst").SyncActionState.Unsupported}})}var b=[];a=a.map(function(a){if(a.operation!=="set"){d("WALogger").WARN(j());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}a=a.indexParts[1];if(!d("WAWebWidFactory").isWidlike(a)){d("WALogger").WARN(i());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}a=d("WAWebWidFactory").createUserWid(a);b.push({lid:a,data:{shareOwnPn:!0}});return{actionState:d("WASyncdConst").SyncActionState.Success}});yield d("WAWebUpdateLidMetadataJob").updateLidMetadataJob(b);d("WALogger").DEV(h());return a});function c(b){return a.apply(this,arguments)}return c}();return c}(d("WASyncdAction").SyncActionBase);c=new a();g["default"]=c}),98); __d("WAWebStatusPrivacySettingSync",["WALogger","WAServerSync.pb","WASyncAction.pb","WASyncdAction","WASyncdConst","WAWebCmd","WAWebSyncdActionUtils","WAWebUserPrefsIndexedDBStorage","WAWebUserPrefsStatus","WAWebUserPrefsStatusType","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[syncd] Failed to write status privacy settings to IndexedDB ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[syncd] unexpected mutation count "," for status privacy sync"]);i=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=null,b)||babelHelpers.assertThisInitialized(c)}var f=e.prototype;f.getVersion=function(){return 7};f.getAction=function(){return d("WASyncdConst").Actions.StatusPrivacy};f.applyMutations=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a.length!==1){d("WALogger").ERROR(i(),a.length);return a.map(function(){return{actionState:d("WASyncdConst").SyncActionState.Malformed}})}var b=a[0];if(b.operation==="set")try{b=b.value;b=b.statusPrivacy;if(!b)return[{actionState:d("WASyncdConst").SyncActionState.Malformed}];var e=b.mode;b=b.userJid;if(e==null)return[{actionState:d("WASyncdConst").SyncActionState.Malformed}];var f=[],g,j=[],k=[];switch(e){case d("WASyncAction.pb").SyncActionValue$StatusPrivacyAction$StatusDistributionMode.CONTACTS:g=d("WAWebUserPrefsStatusType").StatusPrivacySettingType.Contact;f=c("WAWebUserPrefsStatus").calculateStatusPrivacyUpdateEntries({setting:g});break;case d("WASyncAction.pb").SyncActionValue$StatusPrivacyAction$StatusDistributionMode.ALLOW_LIST:g=d("WAWebUserPrefsStatusType").StatusPrivacySettingType.AllowList;j=b.map(d("WAWebWidFactory").createWid).filter(function(a){return a.isUser()});f=c("WAWebUserPrefsStatus").calculateStatusPrivacyUpdateEntries({setting:g,allowList:j});break;case d("WASyncAction.pb").SyncActionValue$StatusPrivacyAction$StatusDistributionMode.DENY_LIST:g=d("WAWebUserPrefsStatusType").StatusPrivacySettingType.DenyList;k=b.map(d("WAWebWidFactory").createWid).filter(function(a){return a.isUser()});f=c("WAWebUserPrefsStatus").calculateStatusPrivacyUpdateEntries({setting:g,denyList:k});break}f.length>0&&(yield d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.bulkSetItemsToIndexedDB(f).then(function(){d("WAWebCmd").Cmd.updateStatusPrivacySettings({setting:g,allowList:j,denyList:k})}));return[{actionState:d("WASyncdConst").SyncActionState.Success}]}catch(b){d("WALogger").ERROR(h(),b);return a.map(function(){return{actionState:d("WASyncdConst").SyncActionState.Failed}})}return[{actionState:d("WASyncdConst").SyncActionState.Unsupported}]});function e(b){return a.apply(this,arguments)}return e}();f.getStatusPrivacySettingMutation=function(a,b,c){var e;switch(a){case d("WAWebUserPrefsStatusType").StatusPrivacySettingType.Contact:e=d("WASyncAction.pb").SyncActionValue$StatusPrivacyAction$StatusDistributionMode.CONTACTS;break;case d("WAWebUserPrefsStatusType").StatusPrivacySettingType.AllowList:e=d("WASyncAction.pb").SyncActionValue$StatusPrivacyAction$StatusDistributionMode.ALLOW_LIST;break;case d("WAWebUserPrefsStatusType").StatusPrivacySettingType.DenyList:e=d("WASyncAction.pb").SyncActionValue$StatusPrivacyAction$StatusDistributionMode.DENY_LIST;break}return d("WAWebSyncdActionUtils").buildPendingMutation({collection:d("WASyncdConst").CollectionName.RegularHigh,indexArgs:[],operation:d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET,version:this.getVersion(),timestamp:c,action:this.getAction(),value:{statusPrivacy:{mode:e,userJid:b}}})};return e}(d("WASyncdAction").SyncActionBase);e=new a();g["default"]=e}),98); __d("WAWebTimeFormatSync",["WALogger","WASyncdAction","WASyncdConst","WAWebClock","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["time format sync: successfully set time format to "," hour"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["time format sync: malformed mutation"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["time format sync: operation not supported"]);j=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(c,a);function c(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=null,b)||babelHelpers.assertThisInitialized(c)}var e=c.prototype;e.getVersion=function(){return 7};e.getAction=function(){return d("WASyncdConst").Actions.TimeFormat};e.applyMutations=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){return a.map(function(a){if(a.operation!=="set"){d("WALogger").WARN(j());return{actionState:d("WASyncdConst").SyncActionState.Unsupported}}a=(a=a.value.timeFormatAction)==null?void 0:a.isTwentyFourHourFormatEnabled;if(a==null){d("WALogger").WARN(i());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}d("WAWebClock").Clock.setIs24Hour(a,d("WAWebClock").TimeFormatSource.PhoneTimeFormat);d("WALogger").DEV(h(),a?"24":"12");return{actionState:d("WASyncdConst").SyncActionState.Success}})});function c(b){return a.apply(this,arguments)}return c}();return c}(d("WASyncdAction").SyncActionBase);c=new a();g["default"]=c}),98); __d("WAWebVoipRelayAllCallsSettingSync",["Promise","WALogger","WASyncdAction","WASyncdConst","WAWebUserPrefsGeneral","asyncToGeneratorRuntime","cr:17219"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["voip relay-all-calls setting sync: operation not supported"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: voip: set relay-all-calls setting to ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["voip relay-all-calls setting sync: mutation has null value"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["voip relay-all-calls setting sync: malformed mutation"]);l=function(){return a};return a}c=(a=b("cr:17219"))!=null?a:{};var m=c.getWindowsBridge;e=function(a){babelHelpers.inheritsLoose(c,a);function c(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=null,b)||babelHelpers.assertThisInitialized(c)}var e=c.prototype;e.getVersion=function(){return 1};e.getAction=function(){return d("WASyncdConst").Actions.VoipRelayAllCalls};e.applyMutations=function(a){return(h||(h=b("Promise"))).all(a.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){try{if(a.operation==="set"){a=a.value;a=a.privacySettingRelayAllCalls;if(!a){d("WALogger").WARN(l());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}a=a.isEnabled;if(a==null)d("WALogger").WARN(k());else{var b;d("WAWebUserPrefsGeneral").setUserPrivacySettings(babelHelpers["extends"]({},d("WAWebUserPrefsGeneral").getUserPrivacySettings(),{voipRelayAllCalls:a}));m==null?void 0:(b=m())==null?void 0:(b=b.voip)==null?void 0:b.setHideMyIp((b=a)!=null?b:!1)}d("WALogger").DEV(j(),a);return{actionState:d("WASyncdConst").SyncActionState.Success}}d("WALogger").WARN(i());return{actionState:d("WASyncdConst").SyncActionState.Unsupported}}catch(a){return{actionState:d("WASyncdConst").SyncActionState.Failed}}});return function(b){return a.apply(this,arguments)}}()))};return c}(d("WASyncdAction").SyncActionBase);f=new e();g["default"]=f}),98); __d("WAWebAccountLinkingConstants",["$InternalEnum"],(function(a,b,c,d,e,f){a=b("$InternalEnum").Mirrored(["Active","Paused","Unlinked","Unknown"]);c="AccountLinkKey";f.AccountLinkState=a;f.AccountLinkKey=c}),66); __d("WAWebAccountLinkingDBOperations",["WAWebModelStorageUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return d("WAWebModelStorageUtils").getStorage().lock(["account-linking"],function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){b=b[0];yield b.createOrReplace(a)});return function(a){return c.apply(this,arguments)}}())}g.createOrUpdateAccountLinkingState=a}),98); __d("WAWebAccountLinkingGatingUtils",["WAWebABProps"],(function(a,b,c,d,e,f,g){function a(){return d("WAWebABProps").getABPropConfigValue("web_waffle")}g.accountLinkingEnabled=a}),98); __d("WAWebAccountLinkingUtils",["WAWebAccountLinkingConstants"],(function(a,b,c,d,e,f,g){function a(a){switch(a){case 0:return d("WAWebAccountLinkingConstants").AccountLinkState.Active;case 1:return d("WAWebAccountLinkingConstants").AccountLinkState.Paused;case 2:return d("WAWebAccountLinkingConstants").AccountLinkState.Unlinked;default:return d("WAWebAccountLinkingConstants").AccountLinkState.Unknown}}g.mapToAccountLinkState=a}),98); __d("WAWebWaffleAccountLinkStateSync",["WALogger","WANullthrows","WASyncdAction","WASyncdConst","WAWebAccountLinkingConstants","WAWebAccountLinkingDBOperations","WAWebAccountLinkingGatingUtils","WAWebAccountLinkingUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["waffleaccountlinkstate sync: malformed mutation"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["waffleaccountlinkstate sync: operation not supported"]);i=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=null,b)||babelHelpers.assertThisInitialized(c)}var f=e.prototype;f.getVersion=function(){return 1};f.getAction=function(){return d("WASyncdConst").Actions.WaffleAccountLinkState};f.applyMutations=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b;a=a.map(function(a){var c;if(!d("WAWebAccountLinkingGatingUtils").accountLinkingEnabled())return{actionState:d("WASyncdConst").SyncActionState.Unsupported};if(a.operation!=="set"){d("WALogger").WARN(i());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}if(((c=a.value.waffleAccountLinkStateAction)==null?void 0:c.linkState)==null){d("WALogger").WARN(h());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}(b==null||a.timestamp>b.timestamp)&&(b=a);return{actionState:d("WASyncdConst").SyncActionState.Success}});if(b!=null){var e,f;e=d("WAWebAccountLinkingUtils").mapToAccountLinkState(c("WANullthrows")((e=b.value.waffleAccountLinkStateAction)==null?void 0:e.linkState));f=Number(c("WANullthrows")((f=b)==null?void 0:f.value.timestamp));yield this.storeLinkState(e,f)}return a});function e(b){return a.apply(this,arguments)}return e}();f.storeLinkState=function(a,b){return d("WAWebAccountLinkingDBOperations").createOrUpdateAccountLinkingState({accountLinkKey:d("WAWebAccountLinkingConstants").AccountLinkKey,linkState:a,linkTimestamp:b})};return e}(d("WASyncdAction").SyncActionBase);e=new a();g["default"]=e}),98); __d("WAWebCollectionHandlerActions",["WAWebAgentSync","WAWebAndroidUnsupportedActionsSync","WAWebArchiveChatSync","WAWebArchiveSettingSync","WAWebBotWelcomeRequestSync","WAWebCallLogSync","WAWebChatAssignmentOpenedStatusSync","WAWebChatAssignmentSync","WAWebChatLockSettingsSync","WAWebClearChatSync","WAWebContactSync","WAWebCustomPaymentMethodsSync","WAWebDeleteChatSync","WAWebDeleteMessageForMeSync","WAWebDeviceCapabilitiesSync","WAWebDisableLinkPreviewsSync","WAWebExternalWebBetaSync","WAWebFavoritesSync","WAWebLabelJidSync","WAWebLabelMessageSync","WAWebLabelReorderingSync","WAWebLabelSync","WAWebLocaleSettingSync","WAWebLockChatSync","WAWebMarkChatAsReadSync","WAWebMerchantPaymentPartnerSync","WAWebMuteChatSync","WAWebNoteSync","WAWebNuxSync","WAWebPaymentInfoSync","WAWebPinChatSync","WAWebPnForLidChatSync","WAWebPremiumMessageBroadcastSync","WAWebPremiumMessageSync","WAWebPrimaryFeatureSync","WAWebPrimaryVersionSync","WAWebPushNameSync","WAWebQuickRepliesSync","WAWebSentinelMutationSync","WAWebShareOwnPnSync","WAWebStarMessageSync","WAWebStatusPrivacySettingSync","WAWebStickersFavoriteSyncAction","WAWebStickersRemoveRecentSyncAction","WAWebTimeFormatSync","WAWebUserStatusMuteSync","WAWebVoipRelayAllCallsSettingSync","WAWebWaffleAccountLinkStateSync"],(function(a,b,c,d,e,f,g){a=[c("WAWebStarMessageSync"),c("WAWebContactSync"),c("WAWebMuteChatSync"),c("WAWebLabelSync"),c("WAWebLabelReorderingSync"),c("WAWebAgentSync"),c("WAWebLabelMessageSync"),c("WAWebLabelJidSync"),c("WAWebQuickRepliesSync"),c("WAWebLocaleSettingSync"),c("WAWebPushNameSync"),c("WAWebArchiveChatSync"),c("WAWebMarkChatAsReadSync"),c("WAWebClearChatSync"),c("WAWebDeleteMessageForMeSync"),c("WAWebSentinelMutationSync"),c("WAWebArchiveSettingSync"),d("WAWebPinChatSync").PinChatSync,c("WAWebDeleteChatSync"),c("WAWebAndroidUnsupportedActionsSync"),c("WAWebPrimaryFeatureSync"),c("WAWebNuxSync"),c("WAWebTimeFormatSync"),c("WAWebUserStatusMuteSync"),c("WAWebPrimaryVersionSync"),c("WAWebStickersRemoveRecentSyncAction"),c("WAWebChatAssignmentSync"),c("WAWebChatAssignmentOpenedStatusSync"),c("WAWebStickersFavoriteSyncAction"),c("WAWebShareOwnPnSync"),c("WAWebPnForLidChatSync"),c("WAWebExternalWebBetaSync"),c("WAWebPremiumMessageSync"),c("WAWebPremiumMessageBroadcastSync"),c("WAWebStatusPrivacySettingSync"),c("WAWebBotWelcomeRequestSync"),c("WAWebPaymentInfoSync"),c("WAWebCustomPaymentMethodsSync"),c("WAWebLockChatSync"),c("WAWebChatLockSettingsSync"),c("WAWebDisableLinkPreviewsSync"),c("WAWebNoteSync"),c("WAWebFavoritesSync"),c("WAWebMerchantPaymentPartnerSync"),c("WAWebDeviceCapabilitiesSync"),c("WAWebVoipRelayAllCallsSettingSync"),c("WAWebCallLogSync"),c("WAWebWaffleAccountLinkStateSync")];g.ActionHandlers=a}),98); __d("WAWebSyncdResolveConflict",["Promise","WASyncdConst","WAWebGetPendingMutation","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";var h;function i(a,b){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){a=(yield (h||(h=b("Promise"))).all(a.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=c.get(a.index);if(b){var d=a.actionHandler;return{remoteMutationIndex:a.index,conflictResolutionState:yield d.resolveConflicts(b,a)}}});return function(b){return a.apply(this,arguments)}}())));var d=new Map();a.forEach(function(a){a&&d.set(a.remoteMutationIndex,a.conflictResolutionState)});return d});return j.apply(this,arguments)}function a(a,b){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=[],e=[],f=(yield d("WAWebGetPendingMutation").getSyncPendingMutationsByCollectionInTransaction(a));a=new Map(f.map(function(a){return[a.index,a]}));var g=(yield i(b,a));b.forEach(function(a){var b=g.get(a.index);if(b)switch(b){case d("WASyncdConst").ConflictResolutionState.SkipRemote:break;case d("WASyncdConst").ConflictResolutionState.ApplyRemoteAndDropLocal:c.push(a);e=e.concat(f.filter(function(b){return b.index===a.index}));break;case d("WASyncdConst").ConflictResolutionState.SkipRemoteAndDropLocal:e=e.concat(f.filter(function(b){return b.index===a.index}));break}else c.push(a)});b=[];for(var h=0;h<c.length;h++){var j=c[h].actionHandler;j=(yield j.dropMutationDueToCrossIndexConflict(c[h],a));j||b.push(c[h])}j=e.map(function(a){return a.id}).filter(Boolean);return{remoteMutationsToApply:b,pendingSetMutationsToDrop:j}});return k.apply(this,arguments)}g.resolveConflict=a}),98); __d("WAWebSyncdValidateMutations",["WACryptoUtils","WALogger","WALongInt","WAServerSync.pb","WASyncAction.pb","WASyncdConst","WAWebSyncdError","WAWebSyncdMetricFatalError","decodeProtobuf"],(function(a,b,c,d,e,f,g){"use strict";function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: is using same timestamp? ","\n is same key? ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: all duplicated actions:"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["validation not required for local mutations"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: duplicate "," mutation: ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: duplicate "," mutation: [not specified]"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: duplicate "," mutation: ",""]);m=function(){return a};return a}function a(a,b){var c=new Set();b.forEach(function(b){b=b.version.version;if(c.has(b)){d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.DUPLICATE_PATCH_VERSION_IN_COLLECTION,a);throw new(d("WAWebSyncdError").SyncdFatalError)("duplicate patch version in collection")}c.add(b)})}function n(a){return a==null?!0:[d("WASyncdConst").Actions.Agent,d("WASyncdConst").Actions.AndroidUnsupportedActions,d("WASyncdConst").Actions.Archive,d("WASyncdConst").Actions.BotWelcomeRequest,d("WASyncdConst").Actions.ChatAssignment,d("WASyncdConst").Actions.ChatAssignmentOpenedStatus,d("WASyncdConst").Actions.ChatLockSettings,d("WASyncdConst").Actions.ClearChat,d("WASyncdConst").Actions.Contact,d("WASyncdConst").Actions.CustomPaymentMethods,d("WASyncdConst").Actions.DeleteChat,d("WASyncdConst").Actions.DeleteMessageForMe,d("WASyncdConst").Actions.DeviceCapabilities,d("WASyncdConst").Actions.DisableLinkPreviews,d("WASyncdConst").Actions.ExternalWebBeta,d("WASyncdConst").Actions.FavoriteSticker,d("WASyncdConst").Actions.LabelEdit,d("WASyncdConst").Actions.LabelJid,d("WASyncdConst").Actions.LabelMessage,d("WASyncdConst").Actions.LabelReordering,d("WASyncdConst").Actions.LocaleSetting,d("WASyncdConst").Actions.LockChat,d("WASyncdConst").Actions.MarkChatAsRead,d("WASyncdConst").Actions.MarketingMessage,d("WASyncdConst").Actions.MarketingMessageBroadcast,d("WASyncdConst").Actions.Mute,d("WASyncdConst").Actions.Nux,d("WASyncdConst").Actions.PaymentInfo,d("WASyncdConst").Actions.Pin,d("WASyncdConst").Actions.PinDEPRECATED,d("WASyncdConst").Actions.PnForLidChat,d("WASyncdConst").Actions.PrimaryFeature,d("WASyncdConst").Actions.PrimaryVersion,d("WASyncdConst").Actions.QuickReply,d("WASyncdConst").Actions.RemoveRecentSticker,d("WASyncdConst").Actions.Sentinel,d("WASyncdConst").Actions.SettingPushName,d("WASyncdConst").Actions.ShareOwnPn,d("WASyncdConst").Actions.Star,d("WASyncdConst").Actions.StatusPrivacy,d("WASyncdConst").Actions.Subscription,d("WASyncdConst").Actions.TimeFormat,d("WASyncdConst").Actions.UnarchiveChatsSetting,d("WASyncdConst").Actions.UserStatusMute,d("WASyncdConst").Actions.Favorites,d("WASyncdConst").Actions.NoteEdit].includes(a)}function o(a){var b=d("WASyncdConst").Actions.cast(JSON.parse(a.index)[0]),c=a.operation===d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET?"SET":"REMOVE";n(b)?d("WALogger").LOG(m(),c,b):d("WALogger").LOG(l(),c);d("WALogger").DEV(k(),c,a.index)}function b(a,b,c){var e=new Set(),f=new Set();b.forEach(function(g){var h=!1;g.operation===d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET&&(e.has(g.index)?(o(g),h=!0):e.add(g.index));g.operation===d("WAServerSync.pb").SyncdMutation$SyncdOperation.REMOVE&&(f.has(g.index)?(o(g),h=!0):f.add(g.index));if(h)switch(c){case d("WASyncdConst").SyncDataType.Patch:d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.SAME_INDEX_FOR_MULTIPLE_MUTATIONS_IN_PATCH,a);throw new(d("WAWebSyncdError").SyncdFatalError)("same index for multiple mutations in patch");case d("WASyncdConst").SyncDataType.Snapshot:d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.SAME_INDEX_FOR_MULTIPLE_MUTATIONS_IN_SNAPSHOT,a,void 0,void 0,!1);p(b);break;case d("WASyncdConst").SyncDataType.Local:d("WALogger").WARN(j())}})}function p(a){d("WALogger").LOG(i());var b=new Map();a.forEach(function(a){if(b.has(a.index)){o(a);var c=b.get(a.index);if(c==null)return;var e=d("decodeProtobuf").decodeProtobuf(d("WASyncAction.pb").SyncActionDataSpec,a.binarySyncData).value,f=d("decodeProtobuf").decodeProtobuf(d("WASyncAction.pb").SyncActionDataSpec,c.binarySyncData).value;d("WALogger").LOG(h(),(e==null?void 0:e.timestamp)===(f==null?void 0:f.timestamp),d("WACryptoUtils").arrayBuffersEqual(a.keyId,c==null?void 0:c.keyId))}b.set(a.index,a)})}function c(a,b){return b.map(function(b){var c=d("decodeProtobuf").decodeProtobuf(d("WASyncAction.pb").SyncActionDataSpec,b.binarySyncData);c=c.value;if(!c){d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.MISSING_ACTION_VALUE,a);throw new(d("WAWebSyncdError").SyncdFatalError)("missing action value")}c=d("WALongInt").maybeNumberOrThrowIfTooLarge(c.timestamp);if(c==null){d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.MISSING_ACTION_TIMESTAMP,a);throw new(d("WAWebSyncdError").SyncdFatalError)("missing action timestamp")}return{index:b.index,version:b.version,keyId:b.keyId,indexMac:b.indexMac,valueMac:b.valueMac,collection:b.collection,binarySyncData:b.binarySyncData,timestamp:c}})}g.validateNoDuplicatePatchVersionInCollection=a;g.validateNoSameIndexForMultipleMutations=b;g.validateAndTypeSetMutations=c}),98); __d("WAWebSyncdValidateServerSyncProtobuf",["WALongInt","WASyncAction.pb","WASyncdKeyTypes","WAWebSyncdError","WAWebSyncdMetricFatalError","decodeProtobuf"],(function(a,b,c,d,e,f,g){"use strict";a=function(){function a(){}a.validateSnapshotProtobuf=function(b,c){var e=c.version,f=c.records,g=c.mac;c=c.keyId;var h=e==null?void 0:e.version;if(!e||h==null){d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.MISSING_SNAPSHOT_VERSION,b);throw new(d("WAWebSyncdError").SyncdFatalError)("missing snapshot version")}e=f.map(function(c){return a.validateRecordProtobuf(b,c)});if(!g){d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.MISSING_SNAPSHOT_MAC,b);throw new(d("WAWebSyncdError").SyncdFatalError)("missing snapshot mac")}f=a.validateKeyIdProtobuf(b,c,d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.MISSING_SNAPSHOT_KEY_ID);return{version:{version:d("WALongInt").numberOrThrowIfTooLarge(h)},records:e,mac:g,keyId:f}};a.validatePatchProtobuf=function(b,c){var e=c.version,f=c.mutations,g=c.externalMutations,h=c.snapshotMac,i=c.patchMac,j=c.keyId,k=c.exitCode,l=c.deviceIndex;c=c.clientDebugData;var m=e==null?void 0:e.version;if(!e||m==null){d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.MISSING_PATCH_VERSION,b);throw new(d("WAWebSyncdError").SyncdFatalError)("missing patch version")}if(f&&f.length>0&&g){d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.PATCH_WITH_BOTH_INLINE_AND_EXTERNAL_MUTATIONS,b);throw new(d("WAWebSyncdError").SyncdFatalError)("patch with both inline and external mutations")}if(!h){d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.MISSING_PATCH_SNAPSHOT_MAC,b);throw new(d("WAWebSyncdError").SyncdFatalError)("missing patch snapshot mac")}if(!i){d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.MISSING_PATCH_MAC,b);throw new(d("WAWebSyncdError").SyncdFatalError)("missing patch mac")}e=a.validateKeyIdProtobuf(b,j,d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.MISSING_PATCH_KEY_ID);j=void 0;c!=null&&(j=d("decodeProtobuf").decodeProtobuf(d("WASyncAction.pb").PatchDebugDataSpec,c));if(g){c=a.validateExternalBlobReference(b,g);return{version:{version:d("WALongInt").numberOrThrowIfTooLarge(m)},mutations:void 0,externalMutations:c,snapshotMac:h,patchMac:i,keyId:e,deviceIndex:l,clientDebugData:j}}g=f.map(function(c){return a.validateMutationProtobuf(b,c)});return{version:{version:d("WALongInt").numberOrThrowIfTooLarge(m)},mutations:g,externalMutations:void 0,exitCode:k,snapshotMac:h,patchMac:i,keyId:e,deviceIndex:l,clientDebugData:j}};a.validateExternalBlobReference=function(a,b){var c=b.mediaKey,e=b.directPath,f=b.handle,g=b.fileSizeBytes,h=b.fileSha256;b=b.fileEncSha256;if(!c){d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.MISSING_EXTERNAL_BLOB_REFERENCE_MEDIA_KEY,a);throw new(d("WAWebSyncdError").SyncdFatalError)("missing external blob reference media key")}if(e==null){d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.MISSING_EXTERNAL_BLOB_REFERENCE_DIRECT_PATH,a);throw new(d("WAWebSyncdError").SyncdFatalError)("missing external blob reference direct path")}if(!h){d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.MISSING_EXTERNAL_BLOB_REFERENCE_FILE_SHA256,a);throw new(d("WAWebSyncdError").SyncdFatalError)("missing external blob reference file SHA256")}if(!b){d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.MISSING_EXTERNAL_BLOB_REFERENCE_FILE_ENC_SHA256,a);throw new(d("WAWebSyncdError").SyncdFatalError)("missing external blob reference file enc SHA256")}return{mediaKey:c,directPath:e,handle:f,fileSizeBytes:g,fileSha256:h,fileEncSha256:b}};a.validateMutationProtobuf=function(b,c){var e=c.operation;c=c.record;if(e==null){d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.MISSING_MUTATION_OPERATION,b);throw new(d("WAWebSyncdError").SyncdFatalError)("missing mutation operation")}if(!c){d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.MISSING_MUTATION_RECORD,b);throw new(d("WAWebSyncdError").SyncdFatalError)("missing mutation record")}b=a.validateRecordProtobuf(b,c);return{operation:e,record:b}};a.validateRecordProtobuf=function(b,c){var e=c.index,f=c.value;c=c.keyId;var g=e==null?void 0:e.blob,h=f==null?void 0:f.blob;if(!e||!g){d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.MISSING_MUTATION_INDEX,b);throw new(d("WAWebSyncdError").SyncdFatalError)("missing mutation index")}if(!f||!h){d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.MISSING_MUTATION_VALUE,b);throw new(d("WAWebSyncdError").SyncdFatalError)("missing mutation value")}e=a.validateKeyIdProtobuf(b,c,d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.MISSING_MUTATION_KEY_ID);return{index:{blob:g},value:{blob:h},keyId:e}};a.validateKeyIdProtobuf=function(a,b,c){var e=b==null?void 0:b.id;if(!b||!e){d("WAWebSyncdMetricFatalError").reportSyncdFatalError(c,a);throw new(d("WAWebSyncdError").SyncdFatalError)("missing mutation key id")}return{id:d("WASyncdKeyTypes").toSyncKeyId(e)}};return a}();g["default"]=a}),98); __d("WAWebWamEnumMdPlatform",[],(function(a,b,c,d,e,f){a=Object.freeze({ANDROID:1,SMBA:2,IPHONE:3,SMBI:4,WEB:5,WINDOWS:6,DARWIN:7,IPAD:8,WEAROS:9});f.MD_PLATFORM=a}),66); __d("WAWebWamEnumMutationOperationEnum",[],(function(a,b,c,d,e,f){a=Object.freeze({SET:0,REMOVE:1});f.MUTATION_OPERATION_ENUM=a}),66); __d("WAWebInvalidMacIncomingMutationWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumCollection","WAWebWamEnumMdPlatform","WAWebWamEnumMutationOperationEnum"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({InvalidMacIncomingMutation:[6072,{collection:[1,d("WAWebWamEnumCollection").COLLECTION],doesIndexExistLocally:[2,a.TYPES.BOOLEAN],isSenderPrimary:[3,a.TYPES.BOOLEAN],mutationActionName:[4,a.TYPES.STRING],mutationIndexMac:[5,a.TYPES.STRING],mutationOperationType:[6,d("WAWebWamEnumMutationOperationEnum").MUTATION_OPERATION_ENUM],patchSenderPlatform:[7,d("WAWebWamEnumMdPlatform").MD_PLATFORM],patchVersionNum:[8,a.TYPES.INTEGER],senderDeviceId:[9,a.TYPES.INTEGER]},[1,1,1],"regular"]},{InvalidMacIncomingMutation:[]});g.InvalidMacIncomingMutationWamEvent=b}),98); __d("WAWebWamEnumMutationBundleType",[],(function(a,b,c,d,e,f){a=Object.freeze({SNAPSHOT:0,PATCH:1});f.MUTATION_BUNDLE_TYPE=a}),66); __d("WAWebWamEnumMutationDirectionType",[],(function(a,b,c,d,e,f){a=Object.freeze({INCOMING:0,OUTGOING:1});f.MUTATION_DIRECTION_TYPE=a}),66); __d("WAWebWamEnumMutationOperationType",[],(function(a,b,c,d,e,f){a=Object.freeze({SET:0,REMOVE:1});f.MUTATION_OPERATION_TYPE=a}),66); __d("WAWebWamEnumSyncdCollectionType",[],(function(a,b,c,d,e,f){a=Object.freeze({REGULAR:1,REGULAR_LOW:2,REGULAR_HIGH:3,CRITICAL_BLOCK:4,CRITICAL_UNBLOCK_LOW:5});f.SYNCD_COLLECTION_TYPE=a}),66); __d("WAWebMdSyncdMutationWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumMutationBundleType","WAWebWamEnumMutationDirectionType","WAWebWamEnumMutationOperationType","WAWebWamEnumSyncdCollectionType"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({MdSyncdMutation:[5970,{appSessionId:[1,a.TYPES.STRING],companionSessionIds:[2,a.TYPES.STRING],contentLength:[3,a.TYPES.INTEGER],isInBootstrap:[4,a.TYPES.BOOLEAN],isUsingLid:[5,a.TYPES.BOOLEAN],mutationBundle:[6,d("WAWebWamEnumMutationBundleType").MUTATION_BUNDLE_TYPE],mutationDirection:[7,d("WAWebWamEnumMutationDirectionType").MUTATION_DIRECTION_TYPE],mutationMac:[8,a.TYPES.STRING],mutationName:[9,a.TYPES.STRING],mutationOperation:[10,d("WAWebWamEnumMutationOperationType").MUTATION_OPERATION_TYPE],patchMac:[15,a.TYPES.STRING],seqNumber:[11,a.TYPES.INTEGER],syncdCollection:[12,d("WAWebWamEnumSyncdCollectionType").SYNCD_COLLECTION_TYPE],syncdKeyhash:[13,a.TYPES.STRING],syncdKeyid:[14,a.TYPES.STRING]},[1,1,1],"regular"]},{MdSyncdMutation:[]});g.MdSyncdMutationWamEvent=b}),98); __d("WAWebSyncdWamReportingUtils",["WALogger","WASyncAction.pb","WASyncdConst","WAWebABProps","WAWebInvalidMacIncomingMutationWamEvent","WAWebMdSyncdMutationWamEvent","WAWebSyncdCryptoUtils","WAWebWamEnumMdPlatform","WAWebWamEnumMutationBundleType","WAWebWamEnumMutationDirectionType","WAWebWamEnumMutationOperationEnum","WAWebWamEnumMutationOperationType","WAWebWamEnumSyncdCollectionType","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncReportMutationToWam: ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncReportInvalidMutation: ",""]);i=function(){return a};return a}function j(a){switch(a){case d("WASyncdConst").CollectionName.RegularHigh:return d("WAWebWamEnumSyncdCollectionType").SYNCD_COLLECTION_TYPE.REGULAR_HIGH;case d("WASyncdConst").CollectionName.RegularLow:return d("WAWebWamEnumSyncdCollectionType").SYNCD_COLLECTION_TYPE.REGULAR_LOW;case d("WASyncdConst").CollectionName.Regular:return d("WAWebWamEnumSyncdCollectionType").SYNCD_COLLECTION_TYPE.REGULAR;case d("WASyncdConst").CollectionName.CriticalBlock:return d("WAWebWamEnumSyncdCollectionType").SYNCD_COLLECTION_TYPE.CRITICAL_BLOCK;case d("WASyncdConst").CollectionName.CriticalUnblockLow:return d("WAWebWamEnumSyncdCollectionType").SYNCD_COLLECTION_TYPE.CRITICAL_UNBLOCK_LOW}}function k(a){switch(a){case d("WASyncAction.pb").PatchDebugData$Platform.ANDROID:return d("WAWebWamEnumMdPlatform").MD_PLATFORM.ANDROID;case d("WASyncAction.pb").PatchDebugData$Platform.IPHONE:return d("WAWebWamEnumMdPlatform").MD_PLATFORM.IPHONE;case d("WASyncAction.pb").PatchDebugData$Platform.WEB:return d("WAWebWamEnumMdPlatform").MD_PLATFORM.WEB;case d("WASyncAction.pb").PatchDebugData$Platform.SMBA:return d("WAWebWamEnumMdPlatform").MD_PLATFORM.SMBA;case d("WASyncAction.pb").PatchDebugData$Platform.SMBI:return d("WAWebWamEnumMdPlatform").MD_PLATFORM.SMBI;case d("WASyncAction.pb").PatchDebugData$Platform.UWP:return d("WAWebWamEnumMdPlatform").MD_PLATFORM.WINDOWS;case d("WASyncAction.pb").PatchDebugData$Platform.DARWIN:return d("WAWebWamEnumMdPlatform").MD_PLATFORM.DARWIN;case d("WASyncAction.pb").PatchDebugData$Platform.WEAROS:return d("WAWebWamEnumMdPlatform").MD_PLATFORM.WEAROS;case d("WASyncAction.pb").PatchDebugData$Platform.IPAD:return d("WAWebWamEnumMdPlatform").MD_PLATFORM.IPAD}}function a(a,b,c,d,e,f,g,h,i){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e,f,g,i,k,l){try{var m=d("WAWebABProps").getABPropConfigValue("syncd_mutation_and_bundle_logging");if(!m)return;m=JSON.parse(m);if(!m||!m.allowlist||!m.allowlist.includes(a))return;new(d("WAWebMdSyncdMutationWamEvent").MdSyncdMutationWamEvent)({appSessionId:"",companionSessionIds:k,contentLength:0,isInBootstrap:!1,isUsingLid:!1,mutationBundle:i?d("WAWebWamEnumMutationBundleType").MUTATION_BUNDLE_TYPE.PATCH:d("WAWebWamEnumMutationBundleType").MUTATION_BUNDLE_TYPE.SNAPSHOT,mutationDirection:c?d("WAWebWamEnumMutationDirectionType").MUTATION_DIRECTION_TYPE.INCOMING:d("WAWebWamEnumMutationDirectionType").MUTATION_DIRECTION_TYPE.OUTGOING,mutationMac:e,mutationName:f,mutationOperation:g?d("WAWebWamEnumMutationOperationType").MUTATION_OPERATION_TYPE.REMOVE:d("WAWebWamEnumMutationOperationType").MUTATION_OPERATION_TYPE.SET,seqNumber:b,syncdCollection:j(a),syncdKeyhash:"",syncdKeyid:"",patchMac:(m=l)!=null?m:""}).commit()}catch(a){d("WALogger").ERROR(h(),a).sendLogs("syncReportMutationToWam failed")}});return l.apply(this,arguments)}function c(a){try{new(d("WAWebInvalidMacIncomingMutationWamEvent").InvalidMacIncomingMutationWamEvent)({collection:j(a.collection),doesIndexExistLocally:a.doesIndexExistLocally,isSenderPrimary:a.senderDeviceId===0,mutationActionName:a.mutationName,mutationIndexMac:d("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(a.indexMac).slice(-16),mutationOperationType:a.isRemove?d("WAWebWamEnumMutationOperationEnum").MUTATION_OPERATION_ENUM.REMOVE:d("WAWebWamEnumMutationOperationEnum").MUTATION_OPERATION_ENUM.SET,patchSenderPlatform:a.senderPlatform!=null?k(a.senderPlatform):void 0,patchVersionNum:a.patchVersion,senderDeviceId:a.senderDeviceId}).commit()}catch(a){d("WALogger").ERROR(i(),a).sendLogs("syncReportInvalidMutation failed")}}g.syncReportMutationToWam=a;g.syncReportInvalidMutation=c}),98); __d("WAWebSyncdCollectionHandler",["Promise","WABase64","WACryptoDependencies","WACryptoUtils","WALogger","WALongInt","WANullthrows","WAServerSync.pb","WASyncAction.pb","WASyncdConst","WASyncdKeyTypes","WATimeUtils","WAWebABProps","WAWebCurrentUser","WAWebGetCollectionVersion","WAWebGetMissingKey","WAWebGetPendingMutation","WAWebGetSyncAction","WAWebRunInTransaction","WAWebSyncdAntiTampering","WAWebSyncdCollectionHandlerTypesConverter","WAWebSyncdCollectionUtils","WAWebSyncdCryptoUtils","WAWebSyncdDbCallbacksApi","WAWebSyncdDecryptMutationsWrapper","WAWebSyncdError","WAWebSyncdGetActionHandler","WAWebSyncdHandleMissingKeys","WAWebSyncdMMSDownload","WAWebSyncdMdSyncFieldstatMeta","WAWebSyncdMetricCriticalBootstrapStage","WAWebSyncdMetricFatalError","WAWebSyncdMetrics","WAWebSyncdResolveConflict","WAWebSyncdValidateMutations","WAWebSyncdValidateServerSyncProtobuf","WAWebSyncdWamAppState","WAWebSyncdWamReportingUtils","asyncToGeneratorRuntime","decodeProtobuf","err"],(function(a,b,c,d,e,f,g){"use strict";var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose([""," syncd: after apply remove mutations for ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose([""," syncd: before apply remove mutations for ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose([""," syncd: completed apply set mutations for "," ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: max timestamp from recent patch: "," days agp"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: after apply mutation batch for "," ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: actionStates after apply ",": ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: catching error during _applySetMutations: ",""]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: after apply mutation batch for "," v",", mutations count: ",", handler: "," ",""]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: before apply mutation batch for "," v",", mutations count: "," ",""]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: applying mutations "," for handler "," ",""]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: after resolveConflict for "," v",""]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: before resolveConflict for "," v",""]);t=function(){return a};return a}function u(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: completed final transaction in _applyPatch for "," v",""]);u=function(){return a};return a}function v(){var a=babelHelpers.taggedTemplateLiteralLoose(["",""]);v=function(){return a};return a}function w(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: [","] skip applying syncd old version ",""]);w=function(){return a};return a}function x(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: processed "," mutations in patch version "," of collection ",""]);x=function(){return a};return a}function y(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: completed _applyRemoveMutations for "," v",""]);y=function(){return a};return a}function z(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: completed computeLtHashAndValidatePatch for "," v",""]);z=function(){return a};return a}function A(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: ",": empty patch found"]);A=function(){return a};return a}function B(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: applying patch "," v"," from device ","\n SET count: ","\n REMOVE count: ",""]);B=function(){return a};return a}function C(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: ",""]);C=function(){return a};return a}function D(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: no patches for collection ",""]);D=function(){return a};return a}function E(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: UI is unblocked, waited for ","ms"]);E=function(){return a};return a}function aa(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: patches have "," mutations, wait for UI unblock"]);aa=function(){return a};return a}function ba(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: completed applying snapshot for ",""]);ba=function(){return a};return a}function ca(){var a=babelHelpers.taggedTemplateLiteralLoose(["",""]);ca=function(){return a};return a}function da(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: [","] skip applying syncd old version ",""]);da=function(){return a};return a}function ea(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: collection ","'s snapshot v"," applied"]);ea=function(){return a};return a}function fa(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: processed "," mutations in snapshot of collection "," v",""]);fa=function(){return a};return a}function ga(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: collection ","'s snapshot decrypted"]);ga=function(){return a};return a}function ha(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: collection ","'s snapshot validated"]);ha=function(){return a};return a}function ia(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: start validate ","'s snapshot"]);ia=function(){return a};return a}function ja(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: ","'s external patch downloaded"]);ja=function(){return a};return a}function ka(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: download patch for ",""]);ka=function(){return a};return a}function la(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: download snapshot for ",""]);la=function(){return a};return a}function ma(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: failed to debug upload: ",""]);ma=function(){return a};return a}function na(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: "," "]);na=function(){return a};return a}function oa(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: end _uploadSuccessful for ",""]);oa=function(){return a};return a}function pa(){var a=babelHelpers.taggedTemplateLiteralLoose(["",""]);pa=function(){return a};return a}function qa(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: [","] skip applying syncd old version ",""]);qa=function(){return a};return a}function ra(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: _uploadSuccessful: write to db for ",""]);ra=function(){return a};return a}function sa(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: _uploadSuccessful: unexpected server version (",") after patch upload, expected ",""]);sa=function(){return a};return a}function ta(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: could not log max timestamp: ",""]);ta=function(){return a};return a}function ua(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: retryable error: "," throws ",""]);ua=function(){return a};return a}function va(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: fatal error: "," throws ",""]);va=function(){return a};return a}function wa(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: key error: "," missing keys"]);wa=function(){return a};return a}function xa(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: applyAppStateSyncResponse: finished applying "," in ","ms"]);xa=function(){return a};return a}function ya(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: sync "," but there are no updates"]);ya=function(){return a};return a}function za(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: "," v"," uploaded successfully"]);za=function(){return a};return a}function Aa(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: "," patches applied successfully"]);Aa=function(){return a};return a}function Ba(){var a=babelHelpers.taggedTemplateLiteralLoose([""," syncd: has missing patches. collection: ",""]);Ba=function(){return a};return a}function Ca(){var a=babelHelpers.taggedTemplateLiteralLoose([""," syncd: has missing patches. collection: ",", localVersion: ",",\n minPatch: ",""]);Ca=function(){return a};return a}function Da(){var a=babelHelpers.taggedTemplateLiteralLoose([""," syncd: missing keys: [","]"]);Da=function(){return a};return a}function Ea(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: "," snapshot and patches applied successfully"]);Ea=function(){return a};return a}function Fa(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: start applying collection ",""]);Fa=function(){return a};return a}function Ga(){var a=babelHelpers.taggedTemplateLiteralLoose([""," syncd: end applyIndividualMutations"]);Ga=function(){return a};return a}function Ha(){var a=babelHelpers.taggedTemplateLiteralLoose([""," syncd: end update db after apply individual mutations for collection ",""]);Ha=function(){return a};return a}function Ia(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: end apply individual mutations for collection ",""]);Ia=function(){return a};return a}function Ja(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: could not find original individual mutation"]);Ja=function(){return a};return a}function Ka(){var a=babelHelpers.taggedTemplateLiteralLoose([""," syncd: apply individual mutations for collection ",""]);Ka=function(){return a};return a}function La(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: start applyIndividualMutations"]);La=function(){return a};return a}function Ma(){var a=babelHelpers.taggedTemplateLiteralLoose(["getShortMdSessionId: ",""]);Ma=function(){return a};return a}function Na(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: no handler for action ",""]);Na=function(){return a};return a}function Oa(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: invalid action ",""]);Oa=function(){return a};return a}function Pa(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: no handler for action ",""]);Pa=function(){return a};return a}function Qa(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: invalid action ",""]);Qa=function(){return a};return a}var Ra=0,Sa=new ArrayBuffer(128),F=null;function G(){return H.apply(this,arguments)}function H(){H=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){try{if(F!=null)return F;var a=(yield d("WAWebSyncdMdSyncFieldstatMeta").MdSyncFieldStatsMeta.getMdSessionId());a=d("WABase64").decodeB64(a);a=(yield d("WACryptoDependencies").getCrypto().subtle.digest({name:"SHA-1"},a));a=d("WABase64").encodeB64UrlSafe(a);F=a.slice(-6);return F}catch(a){d("WALogger").ERROR(Ma(),a).sendLogs("getShortMdSessionId failed");return""}});return H.apply(this,arguments)}function a(a){return I.apply(this,arguments)}function I(){I=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a.length===0)return(h||(h=b("Promise"))).resolve();var c=Math.random().toString(36).substr(2,5),e=a.sort(function(a,b){return a.timestamp-b.timestamp});d("WALogger").LOG(La());e=d("WAWebSyncdCollectionHandlerTypesConverter").syncActionsToDecryptedMutation(e);var f=e.reduce(function(a,b){var c;c=(c=a.get(b.collection))!=null?c:[];c.push(b);a.set(b.collection,c);return a},new Map());e=Array.from(f.keys()).map(function(){var e=b("asyncToGeneratorRuntime").asyncToGenerator(function*(e){d("WALogger").LOG(Ka(),c,e);var g=f.get(e);if(g===void 0)return;g=(yield V(e,g,d("WASyncdConst").SyncDataType.Local,c,null,null));var h=g.setMutationsToPersist,i=g.pendingSetMutationsToDrop;g=h.map(function(a){return{actionState:a.actionState,index:a.index,modelId:a.modelId,modelType:a.modelType}});var j=g;j=g.filter(function(b){var c=a.find(function(a){return a.index===b.index});if(c==null){d("WALogger").ERROR(Ja()).sendLogs("syncd: could not find original individual mutation");return!0}return b.actionState!==c.actionState||b.modelId!==c.modelId||b.modelType!==c.modelType});d("WALogger").LOG(Ia(),c,e);yield d("WAWebRunInTransaction").runInTransaction({SyncActionStore:!0,PendingMutationStore:!0},function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.SyncActionStore;a=a.PendingMutationStore;j.length>0&&(yield b.bulkUpdate(j));i.length>0&&(yield a.bulkRemove(i))});return function(b){return a.apply(this,arguments)}}());d("WALogger").LOG(Ha(),c,e)});return function(a){return e.apply(this,arguments)}}());yield (h||(h=b("Promise"))).all(e);d("WALogger").LOG(Ga(),c)});return I.apply(this,arguments)}function e(a,b,c,d){return J.apply(this,arguments)}function J(){J=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e){var f=a.name,g=a.version,h=a.patches,i=a.snapshot,j=a.syncedPendingMutationsId,k=a.syncedEncryptedMutations;d("WALogger").LOG(Fa(),b,f);try{var l;e==null?void 0:e.mark("external_mutations_download_start",{patchCount:(l=a.patches)==null?void 0:l.length,snapshotSizeBytes:(l=a.snapshot)==null?void 0:l.fileSizeBytes});l=(yield Wa(f,h,i,c));h=l[0];i=l[1];e==null?void 0:e.mark("external_mutations_download_end",{patchesWithMutationsCount:i==null?void 0:i.length,snapshotRecordsCount:h==null?void 0:h.records.length});l=performance.now();if(h!=null)yield Za(f,h,i,e,b),d("WALogger").LOG(Ea(),b,f);else if(i!=null){var m=Math.min.apply(Math,i.map(function(a){return a.version.version})),n=c!=null&&m>c+1&&i.length>0;if(n){yield d("WAWebSyncdDbCallbacksApi").writeSyncdLog(f,b+" has missing patches");n=(yield d("WAWebGetMissingKey").getAllMissingKeysInTransaction());d("WALogger").LOG(Da(),b,n.map(function(a){return a.keyHex+":"+a.timestamp}));d("WALogger").LOG(Ca(),b,f,c,m);yield Ta(f,i[0]);yield d("WAWebSyncdDbCallbacksApi").printSyncdLog(f);d("WALogger").ERROR(Ba(),b,f).sendLogs("syncd: has missing patches");d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.SERVER_DID_NOT_SEND_ALL_PATCHES,f,void 0,(n=c)!=null?n:0);throw new(d("WAWebSyncdError").SyncdFatalError)("syncd: has missing patches")}yield ab(f,i,e,b);d("WALogger").LOG(Aa(),b,f)}else if(g!=null){m=k.filter(function(a){return a.operation===d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET}).length;n=k.filter(function(a){return a.operation===d("WAServerSync.pb").SyncdMutation$SyncdOperation.REMOVE}).length;e=Array.from(new Set(k.map(function(a){return a.index}))).length;yield d("WAWebSyncdDbCallbacksApi").writeSyncdLog(f,b+" start upload patch. version: "+g+". mutation count: "+k.length+",\n numSet: "+m+", numRemove: "+n+", numUniqueIndex: "+e);yield Ua(f,g,j,k,b);var o=(yield G());k.forEach(function(a){var b=JSON.parse(a.index)[0];void d("WAWebSyncdWamReportingUtils").syncReportMutationToWam(f,g,!1,d("WABase64").encodeB64UrlSafe(a.indexMac),b,a.operation===d("WAServerSync.pb").SyncdMutation$SyncdOperation.REMOVE,!0,o,a.patchMac?d("WABase64").encodeB64UrlSafe(a.patchMac):void 0)});yield d("WAWebSyncdDbCallbacksApi").writeSyncdLog(f,b+" end upload patches");d("WALogger").LOG(za(),b,f,g)}else d("WAWebSyncdCollectionUtils").isBootstrap(c)&&(yield d("WAWebGetCollectionVersion").updateCollectionVersionAndLtHashInTransaction(f,Ra,Sa)),d("WALogger").LOG(ya(),f);m=Math.floor(performance.now()-l);d("WALogger").LOG(xa(),f,m);if((i||h)&&(d("WAWebSyncdCollectionUtils").isBootstrap(c)&&!d("WAWebSyncdCollectionUtils").isCriticalCollection(f))){n=h!=null;d("WAWebSyncdMetrics").reportSyncdBootstrapDataApplied(f,n?d("WAWebSyncdMetrics").SyncdBootstrapDataAppliedSnapshotUsed.SNAPSHOT_USED:d("WAWebSyncdMetrics").SyncdBootstrapDataAppliedSnapshotUsed.SNAPSHOT_NOT_USED,m)}return a}catch(a){e=a.message;yield d("WAWebSyncdDbCallbacksApi").writeSyncdLog(f,"error (maybe retryable): "+a);if(a instanceof d("WAWebSyncdError").SyncdMissingKeyError){d("WALogger").WARN(wa(),f);return{name:f,state:d("WASyncdConst").CollectionState.Blocked}}if(a instanceof d("WAWebSyncdError").SyncdFatalError){d("WALogger").ERROR(va(),f,e).sendLogs("syncd: fatal error: "+String(f)+" throws "+e);return{name:f,state:d("WASyncdConst").CollectionState.ErrorFatal}}d("WALogger").WARN(ua(),f,e).sendLogs("syncd: retryable error: "+String(f)+" throws "+e);return{name:f,state:d("WASyncdConst").CollectionState.ErrorRetry}}});return J.apply(this,arguments)}function Ta(a,b){return K.apply(this,arguments)}function K(){K=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){try{b=(yield d("WAWebSyncdDecryptMutationsWrapper").tryDecryptPatch(a,b));b=b.filter(function(a){return a.operation===d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET});b=d("WAWebSyncdValidateMutations").validateAndTypeSetMutations(a,b);b=b.length>0?b[0].timestamp:null;b=b==null?null:d("WATimeUtils").daysDiff(d("WATimeUtils").unixTimeMs(),b);yield d("WAWebSyncdDbCallbacksApi").writeSyncdLog(a,"max timestamp in first patch: "+((a=b)!=null?a:"n/a")+" days ago")}catch(a){d("WALogger").WARN(ta(),a)}});return K.apply(this,arguments)}function Ua(a,b,c,d,e){return L.apply(this,arguments)}function L(){L=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e,f,g){var h=f.map(function(a){return{indexMac:a.indexMac,valueMac:a.valueMac,operation:a.operation}});yield Va(g,a,f,h);h=(yield d("WAWebSyncdAntiTampering").computeLtHash(a,h,g,null,c,d("WAWebSyncdAntiTampering").SyncdPatchDirection.Outgoing));var i=h.ltHash,j=d("WAWebSyncdCollectionHandlerTypesConverter").encryptedUploadMutationsToSyncActions(f.filter(function(a){return a.operation===d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET}),d("WASyncdConst").SyncActionState.Success);yield d("WAWebSyncdDbCallbacksApi").writeSyncdLog(a,"["+g+"] set mutation during upload: "+j.map(function(a){return d("WAWebSyncdAntiTampering").indexAndValueMacToString(a.indexMac,a.valueMac)}).join("\n\t"));var k=new Set(j.map(function(a){return a.index})),l=f.filter(function(a){return a.operation===d("WAServerSync.pb").SyncdMutation$SyncdOperation.REMOVE&&!k.has(a.index)}).map(function(a){return a.index});yield d("WAWebSyncdDbCallbacksApi").writeSyncdLog(a,"["+g+"] count removed during upload: "+l.length);h=(h=(yield d("WAWebGetCollectionVersion").getCollectionVersionInTransaction(a).then(function(a){return a==null?void 0:a.version})))!=null?h:0;c!==h+1&&d("WALogger").ERROR(sa(),c,h+1).sendLogs("syncd: unexpected server version after patch upload");d("WALogger").LOG(ra(),g,a);yield d("WAWebSyncdAntiTampering").logMacsInSnapshot(a,g,"pre-processing outgoing patch v"+c);yield d("WAWebSyncdAntiTampering").reportCollectionInconsistency(a,"pre-processing outgoing patch "+c+".",g);yield S(a,c,f,g);h=null;yield d("WAWebRunInTransaction").runInTransaction({SyncActionStore:!0,PendingMutationStore:!0,CollectionVersionStore:!0},function(){var f=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){var f=b.SyncActionStore,k=b.PendingMutationStore;b=b.CollectionVersionStore;h=(yield Z(a,c,"outgoing patch",b,g));d("WAWebABProps").getABPropConfigValue("web_syncd_do_not_allow_write_old_patch")===!1||h==null?(yield f.bulkRemove(l),yield f.bulkSet(j),yield k.bulkRemove(e),yield b.update(a,{version:c,ltHash:i})):d("WALogger").LOG(qa(),g,c)});return function(a){return f.apply(this,arguments)}}());if(h!=null){f=h;yield d("WAWebSyncdDbCallbacksApi").writeSyncdLog(a,f);yield d("WAWebSyncdDbCallbacksApi").printSyncdLog(a);d("WALogger").ERROR(pa(),f).sendLogs("syncd: processing old version for "+a)}d("WALogger").LOG(oa(),g,a)});return L.apply(this,arguments)}function Va(a,b,c,d){return M.apply(this,arguments)}function M(){M=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e,f){try{e=(yield (h||(h=b("Promise"))).all([(yield h.all(e.filter(function(a){return a.operation===d("WAServerSync.pb").SyncdMutation$SyncdOperation.REMOVE}).map(function(a){return d("WAWebGetSyncAction").getSyncActionInTransaction(a.index)}))).filter(Boolean),(yield h.all(e.filter(function(a){return a.operation===d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET}).map(function(a){return d("WAWebGetSyncAction").getSyncActionInTransaction(a.index)}))).filter(Boolean),(yield h.all(e.filter(function(a){return a.operation===d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET}).map(function(a){return d("WAWebGetSyncAction").getSyncActionsByIndexMacsInTransaction([a.indexMac])}))).filter(Boolean)]));var g=e[0],i=e[1];e=e[2];var j=null;i.length===1&&e.length===1&&e[0].length===1&&(j=i[0].index===e[0][0].index);a="["+a+"] patch uploaded with mutations mac for "+c+":\n\n SET: "+f.filter(function(a){return a.operation===d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET}).map(function(a){return d("WAWebSyncdAntiTampering").indexAndValueMacToString(a.indexMac,a.valueMac)}).join("\n\t")+"\n REMOVE: "+f.filter(function(a){return a.operation===d("WAServerSync.pb").SyncdMutation$SyncdOperation.REMOVE}).map(function(a){return d("WAWebSyncdAntiTampering").indexAndValueMacToString(a.indexMac,a.valueMac)}).join("\n\t")+"\n\n REMOVE fetch by index: "+g.map(function(a){return a.collection+":"+d("WAWebSyncdAntiTampering").indexAndValueMacToString(a.indexMac,a.valueMac)+":"+R(a.index)}).join("\n\t")+"\n SET fetch by index: "+i.map(function(a){return a.collection+":"+d("WAWebSyncdAntiTampering").indexAndValueMacToString(a.indexMac,a.valueMac)+":"+R(a.index)}).join("\n\t")+"\n SET fetch by mac: "+e.map(function(a){return a.map(function(a){return a.collection+":"+d("WAWebSyncdAntiTampering").indexAndValueMacToString(a.indexMac,a.valueMac)+":"+R(a.index)})}).join("\n\t")+"\n isSameIndex: "+(j==null?"n/a":j.toString())+"\n ";d("WALogger").LOG(na(),a);yield d("WAWebSyncdDbCallbacksApi").writeSyncdLog(c,a)}catch(a){d("WALogger").LOG(ma(),a)}});return M.apply(this,arguments)}function Wa(a,b,c,d){return N.apply(this,arguments)}function N(){N=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e,f,g){var i=(h||(h=b("Promise"))).resolve(),j=0,k=d("WATimeUtils").unixTimeMs();if(f!=null){var l;f=c("WAWebSyncdValidateServerSyncProtobuf").validateExternalBlobReference(a,f);j+=d("WALongInt").numberOrThrowIfTooLarge((l=f.fileSizeBytes)!=null?l:0);d("WALogger").LOG(la(),a);i=d("WAWebSyncdMMSDownload").downloadSnapshot(a,f)}l=h.resolve();if(e!=null&&e.length>0){f=e.map(function(b){return c("WAWebSyncdValidateServerSyncProtobuf").validatePatchProtobuf(a,b)});l=(h||(h=b("Promise"))).all(f.map(function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){var c=b.mutations||[],e=b.externalMutations;if(e){d("WALogger").LOG(ka(),a);c=(yield d("WAWebSyncdMMSDownload").downloadExternalPatch(a,e));d("WALogger").LOG(ja(),a);j+=d("WALongInt").numberOrThrowIfTooLarge((e=e.fileSizeBytes)!=null?e:0)}return{mutations:c,version:b.version,snapshotMac:b.snapshotMac,patchMac:b.patchMac,keyId:b.keyId,exitCode:b.exitCode,deviceIndex:b.deviceIndex,clientDebugData:b.clientDebugData}});return function(a){return c.apply(this,arguments)}}()))}var m,n;try{e=(yield (h||(h=b("Promise"))).all([i,l]));m=e[0];n=e[1];d("WAWebSyncdCollectionUtils").isBootstrap(g)&&d("WAWebSyncdMetrics").reportSyncdBootstrapAppStateDownloadMetric({collection:a,downloadStartTs:k,downloadSize:j,isSuccess:"success"})}catch(b){d("WAWebSyncdCollectionUtils").isBootstrap(g)&&d("WAWebSyncdMetrics").reportSyncdBootstrapAppStateDownloadMetric({collection:a,downloadStartTs:k,downloadSize:j,isSuccess:"failure"});throw b}return[m,n]});return N.apply(this,arguments)}function Xa(a,c){var e=function(){var e=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b,e){a==null?void 0:a.mark("anti_tampering_start",{source:d("WASyncdConst").SyncDataType.Snapshot});b=(yield d("WAWebSyncdAntiTampering").computeLtHashAndValidateSnapshot(b,e,c));a==null?void 0:a.mark("anti_tampering_end",{source:d("WASyncdConst").SyncDataType.Snapshot});return b});return function(a,b){return e.apply(this,arguments)}}(),f=function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b,c){a==null?void 0:a.mark("decryption_start",{source:d("WASyncdConst").SyncDataType.Snapshot});b=(yield d("WAWebSyncdDecryptMutationsWrapper").tryDecryptSnapshot(b,c));a==null?void 0:a.mark("decryption_end",{source:d("WASyncdConst").SyncDataType.Snapshot});return b});return function(a,b){return c.apply(this,arguments)}}();return{measuredComputeLtHashAndValidateSnapshot:e,measuredTryDecryptSnapshot:f}}function Ya(a){var c=function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b,c,e,f){a==null?void 0:a.mark("anti_tampering_start",{source:d("WASyncdConst").SyncDataType.Patch});b=(yield d("WAWebSyncdAntiTampering").computeLtHashAndValidatePatch(b,c,e,f));a==null?void 0:a.mark("anti_tampering_end",{source:d("WASyncdConst").SyncDataType.Patch});return b});return function(a,b,d,e){return c.apply(this,arguments)}}(),e=function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b,c){a==null?void 0:a.mark("decryption_start",{source:d("WASyncdConst").SyncDataType.Patch});b=(yield d("WAWebSyncdDecryptMutationsWrapper").tryDecryptPatch(b,c));a==null?void 0:a.mark("decryption_end",{source:d("WASyncdConst").SyncDataType.Patch});return b});return function(a,b){return c.apply(this,arguments)}}();return{measuredComputeLtHashAndValidatePatch:c,measuredTryDecryptPatch:e}}function Za(a,b,c,d,e){return O.apply(this,arguments)}function O(){O=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e,f,g){yield d("WAWebSyncdDbCallbacksApi").writeSyncdLog(a,"["+g+"] start _applySnapshotAndPatches. mutation count: "+c.records.length+", version: "+c.version.version);try{var h=Xa(f,g),i=h.measuredComputeLtHashAndValidateSnapshot;h=h.measuredTryDecryptSnapshot;f==null?void 0:f.mark("apply_start",{source:d("WASyncdConst").SyncDataType.Snapshot,snapshotRecordsCount:c.records.length});d("WALogger").LOG(ia(),g,a);var j=(yield i(a,c));d("WALogger").LOG(ha(),g,a);i=(yield h(a,c));d("WALogger").LOG(ga(),g,a);var k=(yield G());i.forEach(function(b){var e=JSON.parse(b.index)[0];void d("WAWebSyncdWamReportingUtils").syncReportMutationToWam(a,c.version.version,!0,d("WABase64").encodeB64UrlSafe(b.indexMac),e,b.operation===d("WAServerSync.pb").SyncdMutation$SyncdOperation.REMOVE,!1,k,d("WABase64").encodeB64UrlSafe(c.mac))});yield S(a,c.version.version,i,g);d("WAWebSyncdWamAppState").addMutationCount(c.records.length);d("WAWebSyncdMetricCriticalBootstrapStage").reportSyncdDecryptedMutations(d("WAWebSyncdMetricCriticalBootstrapStage").SyncdDecryptMutationsType.SNAPSHOT_MUTATIONS,i);d("WAWebSyncdValidateMutations").validateNoSameIndexForMultipleMutations(a,i,d("WASyncdConst").SyncDataType.Snapshot);var l=c.version.version;h=(yield V(a,i,d("WASyncdConst").SyncDataType.Snapshot,g,f,c.version.version));var m=h.setMutationsToPersist,n=h.pendingSetMutationsToDrop;d("WALogger").LOG(fa(),g,i.length,a,l);d("WALogger").LOG(ea(),g,a,l);h=null;f==null?void 0:f.mark("update_DB_start",{source:d("WASyncdConst").SyncDataType.Snapshot,setMutationsToPersistCount:m.length,pendingMutationsToDropCount:n.length});yield d("WAWebRunInTransaction").runInTransaction({SyncActionStore:!0,PendingMutationStore:!0,CollectionVersionStore:!0},function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){var c=b.SyncActionStore,e=b.PendingMutationStore;b=b.CollectionVersionStore;h=(yield Z(a,l,"snapshot",b,g));d("WAWebABProps").getABPropConfigValue("web_syncd_do_not_allow_write_old_patch")===!1||h==null?(yield c.bulkSet(m),yield e.bulkRemove(n),yield b.update(a,{version:l,ltHash:j})):d("WALogger").LOG(da(),g,l)});return function(a){return c.apply(this,arguments)}}());f==null?void 0:f.mark("update_DB_end",{source:d("WASyncdConst").SyncDataType.Snapshot});if(h!=null){var o=h;yield d("WAWebSyncdDbCallbacksApi").writeSyncdLog(a,o);yield d("WAWebSyncdDbCallbacksApi").printSyncdLog(a);d("WALogger").ERROR(ca(),o).sendLogs("syncd: processing old version for "+a)}d("WALogger").LOG(ba(),g,a);f==null?void 0:f.mark("apply_end",{source:d("WASyncdConst").SyncDataType.Snapshot,decryptedMutationsCount:i.length})}catch(b){yield d("WAWebSyncdDbCallbacksApi").writeSyncdLog(a,"exception "+b.message);b instanceof d("WAWebSyncdError").SyncdMissingKeyError&&(yield d("WAWebSyncdHandleMissingKeys").handleMissingKeysInSnapshot(a,c));throw b}yield d("WAWebSyncdDbCallbacksApi").writeSyncdLog(a,"["+g+"] done applying snapshot");e&&(f==null?void 0:f.mark("apply_start",{source:d("WASyncdConst").SyncDataType.Patch,patchCount:e.length}),yield ab(a,e,f,g),f==null?void 0:f.mark("apply_end",{source:d("WASyncdConst").SyncDataType.Patch,patchCount:e.length}))});return O.apply(this,arguments)}function $a(a){return P.apply(this,arguments)}function P(){P=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=d("WAWebABProps").getABPropConfigValue("web_syncd_max_mutations_to_process_during_resume");if(a>b){b=Date.now();d("WALogger").LOG(aa(),a);yield d("WAWebSyncdDbCallbacksApi").handleSyncDelayApplyingPatchUntilUIUnblocks();d("WALogger").LOG(E(),Date.now()-b)}});return P.apply(this,arguments)}function ab(a,b,c,d){return Q.apply(this,arguments)}function Q(){Q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e,f){var g=c.length===0?"n/a":c[c.length-1].version.version;yield d("WAWebSyncdDbCallbacksApi").writeSyncdLog(a,"["+f+"] start apply patches. count: "+c.length+", last patch version: "+g);if(c.length===0){d("WALogger").LOG(D(),f,a);return(h||(h=b("Promise"))).resolve()}d("WAWebSyncdValidateMutations").validateNoDuplicatePatchVersionInCollection(a,c);c.sort(function(a,b){return a.version.version>b.version.version?1:-1});try{var i=c.reduce(function(a,b){return a+b.mutations.length},0);yield $a(i);for(var j=0;j<c.length;j++){if(j<=4||j%10===0){var k;yield d("WAWebSyncdDbCallbacksApi").writeSyncdLog(a,"["+f+"] start applying "+a+" patch "+c[j].version.version+" with "+c[j].mutations.length+" mutations from device "+((k=c[j].deviceIndex)!=null?k:"n/a"))}yield bb(a,c[j],e,j<=1,f);(j<=4||j%10===0)&&(yield d("WAWebSyncdDbCallbacksApi").writeSyncdLog(a,"["+f+"] finished applying patch "+c[j].version.version+" with "+c[j].mutations.length+" mutations"))}yield d("WAWebSyncdDbCallbacksApi").writeSyncdLog(a,"["+f+"] after apply patches for "+a+" (last patch: v"+g+" total mutations: "+i+")")}catch(b){yield d("WAWebSyncdDbCallbacksApi").writeSyncdLog(a,"exception"+b.message);b instanceof d("WAWebSyncdError").SyncdMissingKeyError&&(yield d("WAWebSyncdHandleMissingKeys").handleMissingKeysInPatches(a,c));throw b}});return Q.apply(this,arguments)}function R(a){try{return JSON.parse(a)[0]}catch(a){return"n/a (parse error)"}}function S(a,b,c,d){return T.apply(this,arguments)}function T(){T=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e){if(a===d("WASyncdConst").CollectionName.CriticalBlock||a===d("WASyncdConst").CollectionName.RegularLow){c=c.map(function(a){var b=a.operation===d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET?"SET":"REMOVE",c=R(a.index);return b+" "+c+" index mac: "+d("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(a.indexMac).slice(-16)+", key id: "+d("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(d("WASyncdKeyTypes").fromSyncKeyId(a.keyId))}).join(" || ");b="mutations in patch for collection "+a+" version "+b+": "+c;d("WALogger").LOG(C(),e,b);yield d("WAWebSyncdDbCallbacksApi").writeSyncdLog(a,b)}});return T.apply(this,arguments)}function bb(a,b,c,d,e){return U.apply(this,arguments)}function U(){U=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e,f,g){f===void 0&&(f=!1);var h=d("WAWebABProps").getABPropConfigValue("enable_syncd_debug_data_in_patch")||a===d("WASyncdConst").CollectionName.CriticalBlock||a===d("WASyncdConst").CollectionName.RegularLow||d("WAWebCurrentUser").isEmployee();if(h){var i;yield d("WAWebSyncdAntiTampering").logMacsInSnapshot(a,g,"pre-processing incoming patch "+c.version.version+".");yield d("WAWebSyncdAntiTampering").reportCollectionInconsistency(a,"["+g+"] pre-processing incoming patch "+c.version.version+".\n incoming current lthash: "+d("WAWebSyncdCryptoUtils").arrayBufferToHexPadded((i=c==null?void 0:(i=c.clientDebugData)==null?void 0:i.currentLthash)!=null?i:new ArrayBuffer(0)).slice(-16)+",\n incoming new lthash: "+d("WAWebSyncdCryptoUtils").arrayBufferToHexPadded((i=c==null?void 0:(i=c.clientDebugData)==null?void 0:i.newLthash)!=null?i:new ArrayBuffer(0)).slice(-16),g,250)}if(c.exitCode){var j;i=c.exitCode.code;yield d("WAWebSyncdDbCallbacksApi").writeSyncdLog(a,"patch exit code "+((j=i)!=null?j:""));switch(i){case 100:d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.TERMINAL_PATCH_MISSING_DATA,a);break;case 101:d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.TERMINAL_PATCH_DESERIALIZATION_ERROR,a);break;default:d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.TERMINAL_PATCH_UNKNOWN,a)}throw new(d("WAWebSyncdError").SyncdFatalError)("received terminal patch with exit code: "+String(i)+" text: "+String((j=c.exitCode)==null?void 0:j.text)+" ")}yield d("WAWebSyncdDbCallbacksApi").handleSyncBeforeApplyPatch(c);i=c.mutations.filter(function(a){return a.operation===d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET}).length;j=c.mutations.length-i;d("WALogger").LOG(B(),g,a,c.version.version,c.deviceIndex,i,j);i===0&&j===0&&d("WALogger").WARN(A(),a).sendLogs("syncd: "+a+": empty patch found");i=Ya(e);j=i.measuredComputeLtHashAndValidatePatch;i=i.measuredTryDecryptPatch;i=(yield i(a,c));d("WAWebSyncdMetricCriticalBootstrapStage").reportSyncdDecryptedMutations(d("WAWebSyncdMetricCriticalBootstrapStage").SyncdDecryptMutationsType.PATCH_MUTATIONS,i);var k=(yield G());i.forEach(function(b){var e=JSON.parse(b.index)[0];void d("WAWebSyncdWamReportingUtils").syncReportMutationToWam(a,c.version.version,!0,d("WABase64").encodeB64UrlSafe(b.indexMac),e,b.operation===d("WAServerSync.pb").SyncdMutation$SyncdOperation.REMOVE,!0,k,c.patchMac?d("WABase64").encodeB64UrlSafe(c.patchMac):void 0)});yield S(a,c.version.version,i,g);f&&(yield d("WAWebSyncdDbCallbacksApi").writeSyncdLog(a,"["+g+"] after decrypt patch "+c.version.version));var l=(yield j(a,c,g,q));d("WALogger").LOG(z(),g,a,c.version.version);d("WAWebSyncdWamAppState").addMutationCount(i.length);d("WAWebSyncdValidateMutations").validateNoSameIndexForMultipleMutations(a,i,d("WASyncdConst").SyncDataType.Patch);j=eb(i);var m=j.filter(function(a){return a.operation===d("WAServerSync.pb").SyncdMutation$SyncdOperation.REMOVE});q=(yield cb(a,m,g));q=q.pendingRemoveMutationsToDrop;d("WALogger").LOG(y(),g,a,c.version.version);j=j.filter(function(a){return a.operation===d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET});j=(yield V(a,j,d("WASyncdConst").SyncDataType.Patch,g,e,c.version.version,f));var n=j.setMutationsToPersist;j=j.pendingSetMutationsToDrop;d("WALogger").LOG(x(),g,i.length,c.version.version,a);var o=q.concat(j);e==null?void 0:e.mark("update_DB_start",{source:d("WASyncdConst").SyncDataType.Patch,setMutationsToPersistCount:n.length,pendingMutationsToDropCount:o.length});var p=c.version.version;i=null;yield d("WAWebRunInTransaction").runInTransaction({SyncActionStore:!0,PendingMutationStore:!0,CollectionVersionStore:!0},function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){var c=b.SyncActionStore,e=b.PendingMutationStore;b=b.CollectionVersionStore;i=(yield Z(a,p,"incoming patch",b,g));d("WAWebABProps").getABPropConfigValue("web_syncd_do_not_allow_write_old_patch")===!1||i==null?(yield c.bulkRemove(m.map(function(a){return a.index})),yield c.bulkSet(n),yield e.bulkRemove(o),yield b.update(a,{version:p,ltHash:l})):d("WALogger").LOG(w(),g,p)});return function(a){return c.apply(this,arguments)}}());if(i!=null){q=i;yield d("WAWebSyncdDbCallbacksApi").writeSyncdLog(a,q);yield d("WAWebSyncdDbCallbacksApi").printSyncdLog(a);d("WALogger").ERROR(v(),q).sendLogs("syncd: processing old version for "+a)}(h||a===d("WASyncdConst").CollectionName.RegularLow||d("WAWebCurrentUser").isEmployee())&&(yield d("WAWebSyncdAntiTampering").logMacsInSnapshot(a,g,"post-processing incoming patch "+c.version.version+"."));e==null?void 0:e.mark("update_DB_end",{source:d("WASyncdConst").SyncDataType.Patch});d("WALogger").LOG(u(),g,a,c.version.version);f&&(yield d("WAWebSyncdDbCallbacksApi").writeSyncdLog(a,"["+g+"] after final transaction for patch "+c.version.version+". new lthash: "+d("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(l).slice(-16)));function q(a){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){var c;return(c=(yield d("WAWebGetSyncAction").getSyncActionsByCollectionsInTransaction([a])).filter(function(a){return d("WACryptoUtils").arrayBuffersEqual(b,a.indexMac)}).pop())==null?void 0:c.valueMac});return r.apply(this,arguments)}});return U.apply(this,arguments)}function V(a,b,c,d,e,f,g){return W.apply(this,arguments)}function W(){W=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e,f,g,h,i){i===void 0&&(i=!1);d("WAWebSyncdMetricCriticalBootstrapStage").reportSyncdCriticalBootstrapStage(d("WAWebSyncdMetricCriticalBootstrapStage").SyncdCriticalBootstrapStageType.ABOUT_TO_APPLY_MUTATIONS);var j=e===d("WASyncdConst").SyncDataType.Local?" (individual mutations)":"",u=[];b=d("WAWebSyncdValidateMutations").validateAndTypeSetMutations(a,b);b=fb(a,b);var v=b.supportedMutations;b=b.unsupportedMutations;b.forEach(function(a){return u.push(d("WAWebSyncdCollectionHandlerTypesConverter").setMutationToSyncAction(a,d("WASyncdConst").SyncActionState.Unsupported))});g==null?void 0:g.mark("conflict_resolution_start",{source:e,collectionName:a,count:v.length});d("WALogger").LOG(t(),f,a,h);b=(yield d("WAWebSyncdResolveConflict").resolveConflict(a,v));var w=b.remoteMutationsToApply;b=b.pendingSetMutationsToDrop;d("WALogger").LOG(s(),f,a,h);v=v.filter(function(a){return!w.includes(a)});g==null?void 0:g.mark("conflict_resolution_end",{source:e,collectionName:a,apply:w.length,drop:v.length});v.forEach(function(a){return u.push(d("WAWebSyncdCollectionHandlerTypesConverter").setMutationToSyncAction(a,d("WASyncdConst").SyncActionState.Skipped,a.actionName))});g==null?void 0:g.mark("apply_set_mutations_start",{source:e,collectionName:a,count:w.length});v=gb(w);var x=null;for(var y=0;y<v.length;y++){var z=i&&y<=1,A=v[y][0].actionHandler,B=v[y].map(function(a){var b;a.binarySyncData?b=c("WANullthrows")(d("decodeProtobuf").decodeProtobuf(d("WASyncAction.pb").SyncActionDataSpec,a.binarySyncData).value):b=d("decodeProtobuf").decodeProtobuf(d("WASyncAction.pb").SyncActionValueSpec,a.binarySyncAction);(x==null||x<a.timestamp)&&(x=a.timestamp);return{operation:"set",indexParts:a.indexArr,value:b,timestamp:a.timestamp}});z&&(yield d("WAWebSyncdDbCallbacksApi").writeSyncdLog(a,f+" after deserialize. mutationsToApply length: "+B.length));var C=[],D=!1;try{d("WAWebCurrentUser").isEmployee()&&d("WALogger").LOG(r(),JSON.stringify(B.slice(0,3),null,2),A.getAction(),j);d("WALogger").LOG(q(),f,a,h,B.length,j);C=(yield A.applyMutations(B,{setMutationsPendingToPersist:u,allSupportedSetMutations:w},z));A=d("WAWebCurrentUser").isEmployee()?A.getAction():"-";d("WALogger").LOG(p(),f,a,h,B.length,A,j);if(z){yield d("WAWebSyncdDbCallbacksApi").writeSyncdLog(a,"["+f+"] after apply group "+y+"/"+v.length+" for "+a+" "+((B=h)!=null?B:"")+". result length: "+C.length)}}catch(b){if(b instanceof d("WAWebSyncdError").SyncdFatalError||a===d("WASyncdConst").CollectionName.CriticalBlock)throw b;D=!0;d("WALogger").WARN(o(),b)}d("WALogger").DEV(n(),j,C.slice(0,100).map(function(a){return a.actionState}));d("WALogger").LOG(m(),f,a,j);for(A=0;A<v[y].length;A++){z=D?d("WASyncdConst").SyncActionState.Failed:C[A].actionState;u.push(d("WAWebSyncdCollectionHandlerTypesConverter").setMutationToSyncAction(v[y][A],z,v[y][A].actionName,D?void 0:(B=C[A].orphanModel)==null?void 0:B.modelId,D?void 0:(z=C[A].orphanModel)==null?void 0:z.modelType))}}B=x;z=B==null?null:d("WATimeUtils").daysDiff(d("WATimeUtils").unixTimeMs(),B);d("WALogger").LOG(l(),(D=z)!=null?D:"n/a");if(i){yield d("WAWebSyncdDbCallbacksApi").writeSyncdLog(a,f+" max timestamp from recent patch: "+((A=z)!=null?A:"n/a")+" days ago")}C=u.reduce(function(a,b){b=b.actionState;a[b]==null&&(a[b]=0);a[b]++;return a},{});g==null?void 0:g.mark("apply_set_mutations_end",babelHelpers["extends"]({source:e,collectionName:a,count:w.length},C));d("WAWebSyncdMetricCriticalBootstrapStage").reportSyncdCriticalBootstrapStage(d("WAWebSyncdMetricCriticalBootstrapStage").SyncdCriticalBootstrapStageType.APPLIED_MUTATIONS);if(a===d("WASyncdConst").CollectionName.CriticalBlock){yield d("WAWebSyncdDbCallbacksApi").writeSyncdLog(a,f+" apply states for "+a+" v"+((v=h)!=null?v:"n/a")+": "+u.map(function(a){return a.actionState}).join(", "))}d("WALogger").LOG(k(),f,a,j);return{setMutationsToPersist:u,pendingSetMutationsToDrop:b}});return W.apply(this,arguments)}function cb(a,b,c){return X.apply(this,arguments)}function X(){X=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){var e=db(b);e=e.supportedMutations;e=gb(e);var f=new Set(b.map(function(a){return a.index})),g=(yield d("WAWebGetPendingMutation").getSyncPendingMutationsByCollectionInTransaction(a)).filter(function(a){return a.operation===d("WAServerSync.pb").SyncdMutation$SyncdOperation.REMOVE&&f.has(a.index)}).map(function(a){return a.id}).filter(Boolean);d("WALogger").LOG(j(),c,a);for(var h=0;h<e.length;h++){var k=e[h][0].actionHandler;yield k.applyMutations(e[h].map(function(b){return{operation:"remove",indexParts:Y(a,b.index)}}),{setMutationsPendingToPersist:[],allSupportedSetMutations:[]})}d("WALogger").LOG(i(),c,a);yield d("WAWebSyncdDbCallbacksApi").writeSyncdLog(a,c+" after apply remove mutations for "+a+". mutation count: "+b.length);return{pendingRemoveMutationsToDrop:g}});return X.apply(this,arguments)}function db(a){a=a.map(function(a){if(a.version>d("WAWebSyncdGetActionHandler").maxSupportedVersion())return{unsupported:a};var b=Y(a.collection,a.index),c=d("WASyncdConst").Actions.cast(b[0]);if(!c){d("WALogger").WARN(Qa(),b[0]);return{unsupported:a}}var e=d("WAWebSyncdGetActionHandler").getActionHandler(c);if(!e){d("WALogger").WARN(Pa(),c);return{unsupported:a}}a={collection:a.collection,index:a.index,indexMac:a.indexMac,keyId:a.keyId,binarySyncData:a.binarySyncData,valueMac:a.valueMac,version:a.version,indexArr:b,actionName:c,actionHandler:e};return{supported:a}});var b=[],c=[];a.map(function(a){var d=a.supported;a=a.unsupported;d!=null?b.push(d):a!=null&&c.push(a)});return{supportedMutations:b,unsupportedMutations:c}}function eb(a){var b=a.filter(function(a){return a.operation===d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET}),c=new Set(b.map(function(a){return a.index}));a=a.filter(function(a){return a.operation===d("WAServerSync.pb").SyncdMutation$SyncdOperation.REMOVE});a.forEach(function(a){c.has(a.index)||b.push(a)});return b}function fb(a,b){b=b.map(function(b){if(b.version>d("WAWebSyncdGetActionHandler").maxSupportedVersion())return{unsupported:b};var c=Y(a,b.index),e=d("WASyncdConst").Actions.cast(c[0]);if(!e){d("WALogger").WARN(Oa(),c[0]);return{unsupported:b}}var f=d("WAWebSyncdGetActionHandler").getActionHandler(e);if(!f){d("WALogger").WARN(Na(),e);return{unsupported:b}}return{supported:{collection:b.collection,index:b.index,indexMac:b.indexMac,keyId:b.keyId,timestamp:b.timestamp,binarySyncData:b.binarySyncData,valueMac:b.valueMac,version:b.version,indexArr:c,actionName:e,actionHandler:f}}});var c=[],e=[];b.map(function(a){var b=a.supported;a=a.unsupported;b!=null?c.push(b):a!=null&&e.push(a)});return{supportedMutations:c,unsupportedMutations:e}}function gb(a){return a.reduce(function(a,b){a.length!==0&&b.actionName===a[a.length-1][0].actionName?a[a.length-1].push(b):a.push([b]);return a},[])}function Y(a,b){try{b=JSON.parse(b);if(b.length<1)throw c("err")("");return b}catch(b){d("WAWebSyncdMetricFatalError").reportSyncdFatalError(d("WAWebSyncdMetricFatalError").SyncdFatalErrorType.INVALID_ACTION_INDEX,a);throw new(d("WAWebSyncdError").SyncdFatalError)("invalid action index")}}function Z(a,b,c,d,e){return $.apply(this,arguments)}function $(){$=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,d,e){d=(yield d.get(a));if(d!=null&&d.version>=b)return"["+e+"] syncd: processing old version for "+a+". processing: "+b+" already persisted: "+d.version+". context: "+c});return $.apply(this,arguments)}g.applyIndividualMutations=a;g.applyAppStateSyncResponse=e}),98); __d("WAWebSyncdDecryptMutationsWrapper",["Promise","WAServerSync.pb","WATextEncoding","WAWebEncryptionManagerSelector","WAWebSyncdDbCallbacksApi","WAWebSyncdError","WAWebSyncdKeyCache","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";var h,i=d("WATextEncoding").newTextDecoder();function a(a,c){return(h||(h=b("Promise"))).all(c.records.map(function(b){return j(a,d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET,b)}))}function c(a,c){return(h||(h=b("Promise"))).all(c.mutations.map(function(b){return j(a,b.operation,b.record)}))}function j(a,b,c){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){var e=d("WAWebEncryptionManagerSelector").syncdEncryptionManager().decryptMutation,f=c.keyId.id,g=(yield d("WAWebSyncdKeyCache").getKeyData(f));if(!g){if(b===d("WAServerSync.pb").SyncdMutation$SyncdOperation.REMOVE){yield d("WAWebSyncdDbCallbacksApi").writeSyncdLog(a,"exception: no key data for remove mutations");throw new(d("WAWebSyncdError").SyncdFatalError)("no key data for remove mutations")}throw new(d("WAWebSyncdError").SyncdMissingKeyError)()}e=(yield e(a,f,g,b,c));g=e.syncAction;c=e.indexMac;var h=e.valueMac;e=e.indexValueBinary;var j=g.index;g=g.version;return{index:i.decode(j),action:null,version:g,keyId:f,operation:b,indexMac:c,valueMac:h,collection:a,binarySyncData:e}});return k.apply(this,arguments)}g.tryDecryptSnapshot=a;g.tryDecryptPatch=c}),98); __d("WAWebSyncdMMSDownload",["WAWebSyncdDecode","WAWebSyncdNetCallbacksApi","WAWebSyncdValidateServerSyncProtobuf","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=(yield d("WAWebSyncdNetCallbacksApi").downloadSyncBlob(b,"snapshot",a));b=d("WAWebSyncdDecode").decodeSyncdSnapshot(a,b);return c("WAWebSyncdValidateServerSyncProtobuf").validateSnapshotProtobuf(a,b)});return h.apply(this,arguments)}function e(a,b){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=(yield d("WAWebSyncdNetCallbacksApi").downloadSyncBlob(b,"patch",a));b=d("WAWebSyncdDecode").decodeSyncdMutations(a,b).mutations;return b.map(function(b){return c("WAWebSyncdValidateServerSyncProtobuf").validateMutationProtobuf(a,b)})});return i.apply(this,arguments)}g.downloadSnapshot=a;g.downloadExternalPatch=e}),98); __d("WAWebKeyManagementSendKeyRequestApi",["Promise","WALogger","WASyncdKeyTypes","WAWebApiPeerMessageStore","WAWebKeyManagementUtils","WAWebMsgKey","WAWebMsgType","WAWebSendAppStateSyncMsgJob","WAWebSyncdCriticalBootstrapProcessingApi","WAWebSyncdCryptoUtils","WAWebUserPrefsMeUser","WAWebWamEnumBootstrapAppStateDataStageCode","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: send key request key id "," to peer deviceIds ",""]);i=function(){return a};return a}function a(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=(yield d("WAWebKeyManagementUtils").getPeerDevices()),f=a.map(function(a){return{keyId:d("WASyncdKeyTypes").fromSyncKeyId(a)}}),g={keyIds:f};f=e.map(function(a){var b=new(c("WAWebMsgKey"))({fromMe:!0,remote:d("WAWebUserPrefsMeUser").getMeUser(),id:c("WAWebMsgKey").newId_DEPRECATED()});return{id:b,to:a,type:"protocol",subtype:"app_state_sync_key_request",kind:d("WAWebMsgType").MsgKind.PeerMessage,appStateSyncKeyRequest:g}});e=e.map(function(a){return a.getDeviceId()});a=a.map(function(a){return d("WAWebSyncdCryptoUtils").syncKeyIdToHex(a)});d("WALogger").LOG(i(),a,e);yield d("WAWebApiPeerMessageStore").storePeerMessages(f);yield (h||(h=b("Promise"))).all(f.map(function(a){return d("WAWebSendAppStateSyncMsgJob").encryptAndSendKeyMsg(a)}));d("WAWebSyncdCriticalBootstrapProcessingApi").logCriticalBootstrapStageIfNecessary(d("WAWebWamEnumBootstrapAppStateDataStageCode").BOOTSTRAP_APP_STATE_DATA_STAGE_CODE.MISSING_KEYS_REQUESTED);return e});return j.apply(this,arguments)}g.sendAppStateSyncKeyRequest=a}),98); __d("WAWebKeyManagementSendKeyShareApi",["Promise","WALogger","WASyncdKeyTypes","WAWebApiPeerMessageStore","WAWebKeyManagementUtils","WAWebMsgKey","WAWebMsgType","WAWebSendAppStateSyncMsgJob","WAWebSyncdCryptoUtils","WAWebUserPrefsMeUser","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: send key share key id "," to peer deviceIds "," due to ",""]);i=function(){return a};return a}function a(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e,f;a.type==="key_rotation"?(e=k(a.keys),f=(yield d("WAWebKeyManagementUtils").getPeerDevices())):a.type==="missing_key"&&(e=k(a.keys,a.orphanKeys),f=[a.peerDeviceId]);if(f==null)return(h||(h=b("Promise"))).resolve();var g=f,j=g.map(function(a){var b=new(c("WAWebMsgKey"))({fromMe:!0,remote:d("WAWebUserPrefsMeUser").getMeUser(),id:c("WAWebMsgKey").newId_DEPRECATED()});return{id:b,to:a,type:"protocol",subtype:"app_state_sync_key_share",kind:d("WAWebMsgType").MsgKind.PeerMessage,appStateSyncKeyShare:e}});g=g.map(function(a){return a.getDeviceId()});var l=a.keys.map(function(a){return d("WAWebSyncdCryptoUtils").syncKeyIdToHex(a.keyId)});d("WALogger").LOG(i(),l,g,a.type);yield d("WAWebApiPeerMessageStore").storePeerMessages(j);yield (h||(h=b("Promise"))).all(j.map(function(a){return d("WAWebSendAppStateSyncMsgJob").encryptAndSendKeyMsg(a)}))});return j.apply(this,arguments)}function k(a,b){a=a.map(function(a){return{keyId:{keyId:d("WASyncdKeyTypes").fromSyncKeyId(a.keyId)},keyData:{keyData:d("WASyncdKeyTypes").fromSyncKeyData(a.keyData),fingerprint:{rawId:a.fingerprint.rawId,currentIndex:a.fingerprint.currentIndex,deviceIndexes:a.fingerprint.deviceIndexes},timestamp:a.timestamp}}});if(b){b=b.map(function(a){return{keyId:{keyId:d("WASyncdKeyTypes").fromSyncKeyId(a)},keyData:void 0}});a=a.concat(b)}return{keys:a}}g.sendAppStateSyncKeyShare=a}),98); __d("WAWebSyncdHandleMissingKeys",["Promise","WALogger","WASyncdKeyTypes","WAWebGetMissingKey","WAWebGetSyncKey","WAWebOfflineHandler","WAWebSyncdCryptoUtils","WAWebSyncdError","WAWebSyncdKeyCallbacksApi","WAWebSyncdStoreMissingKeys","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: requestAllMissingKeys: missing keys: [","]"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: _handleMissingKeys: missing keys after filter: [","]"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: _handleMissingKeys: missing keys [","]"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: _handleMissingKeys: skipping due to resume from restart in progress"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: collection ","'s patches has missing keys ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: handleMissingKeysInPatches: missing key: keyId: ",", patch version: ",", patch device id: ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: collection ","'s snapshot has missing keys ",""]);o=function(){return a};return a}var p=d("WASyncdKeyTypes").toSyncKeyId(new ArrayBuffer(0));function a(a,b){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=new Set(),e=(yield d("WAWebGetSyncKey").getAllSyncKeysInTransaction()).map(function(a){return d("WAWebSyncdCryptoUtils").syncKeyIdToHex(a.keyId)});b.records.forEach(function(a){a=a.keyId.id;if(d("WAWebSyncdCryptoUtils").syncKeyIdsEqual(a,p))throw new(d("WAWebSyncdError").SyncdFatalError)("snapshot has empty key");a=d("WAWebSyncdCryptoUtils").syncKeyIdToHex(a);e.includes(a)||c.add(a)});d("WALogger").LOG(o(),a,Array.from(c));yield s(c)});return q.apply(this,arguments)}function c(a,b){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=new Set(),e=(yield d("WAWebGetSyncKey").getAllSyncKeysInTransaction()).map(function(a){return d("WAWebSyncdCryptoUtils").syncKeyIdToHex(a.keyId)});b.forEach(function(a){var b=a.keyId.id;if(d("WAWebSyncdCryptoUtils").syncKeyIdsEqual(b,p))throw new(d("WAWebSyncdError").SyncdFatalError)("syncd: patch has empty key. patch device id: ${p.deviceIndex}");b=d("WAWebSyncdCryptoUtils").syncKeyIdToHex(b);e.includes(b)||(d("WALogger").LOG(n(),b,a.version.version,a.deviceIndex),c.add(b))});d("WALogger").LOG(m(),a,Array.from(c));yield s(c)});return r.apply(this,arguments)}function s(a){return t.apply(this,arguments)}function t(){t=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=d("WAWebOfflineHandler").OfflineMessageHandler.isResumeFromRestartComplete()?"idle":"processing";if(c!=="idle"){d("WALogger").LOG(l());return}c=Array.from(a);d("WALogger").LOG(k(),c);var e=new Set((yield d("WAWebGetMissingKey").bulkGetMissingKeysInTransaction(c)).filter(Boolean).map(function(a){return a.keyHex}));a=c.filter(function(a){return!e.has(a)});d("WALogger").LOG(j(),a);if(a.length===0)return(h||(h=b("Promise"))).resolve();c=a.map(function(a){return d("WASyncdKeyTypes").toSyncKeyId(d("WAWebSyncdCryptoUtils").hexToUint8Array(a).buffer)});a=(yield d("WAWebSyncdKeyCallbacksApi").sendSyncdKeyRequest(c));yield d("WAWebSyncdStoreMissingKeys").addMissingKeys(c,a)});return t.apply(this,arguments)}function e(){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield d("WAWebGetMissingKey").getAllMissingKeysInTransaction());d("WALogger").LOG(i(),a.map(function(a){return a.keyHex}));if(a.length===0)return;yield d("WAWebSyncdKeyCallbacksApi").sendSyncdKeyRequest(a.map(function(a){return a.keyId}))});return u.apply(this,arguments)}g.handleMissingKeysInSnapshot=a;g.handleMissingKeysInPatches=c;g.requestAllMissingKeys=e}),98); __d("WAWebSyncdRotateKey",["WAArrayBuffersConcat","WABaseGlobals","WAByteArray","WACryptoDependencies","WAJids","WASyncdKeyManagementUtils","WASyncdKeyTypes","WATimeUtils","WAWebSyncdGatingUtils","equalsSet"],(function(a,b,c,d,e,f,g){"use strict";var h=1,i=90;function a(a){a=a.timestamp;var b=Math.min(i,Math.max(h,d("WAWebSyncdGatingUtils").getSyncdKeyMaxUseDays()));b=b*d("WATimeUtils").DAY_MILLISECONDS;a=d("WATimeUtils").unixTimeMs()-a;return a>b}function b(a,b){a=a.fingerprint;var d=b.rawId,e=b.currentIndex;b=b.deviceIndexes;var f=new Set(a.deviceIndexes);for(var g=a.currentIndex+1;g<=e;g++)f.add(g);return a.rawId!==d||!c("equalsSet")(f,new Set(b))}function e(a,b){b=j(b);var c=b.keyId;b=b.keyEpoch;var e=k(),f=d("WATimeUtils").unixTimeMs();return{keyId:c,keyEpoch:b,keyData:e,fingerprint:a,timestamp:f}}function j(a){if(a==null){var b=new Uint8Array(16);d("WACryptoDependencies").getCrypto().getRandomValues(b);b=d("WASyncdKeyManagementUtils").generateNewKeyEpoch(d("WASyncdKeyTypes").toSyncKeyId(b.buffer))}else b=d("WASyncdKeyManagementUtils").generateNewKeyEpoch(a.keyId);a=d("WAJids").interpretAsNumber(d("WAJids").extractDeviceId(d("WABaseGlobals").getMyDeviceJid()));return{keyId:d("WASyncdKeyTypes").toSyncKeyId(new Uint8Array(d("WAArrayBuffersConcat").concatArrayBuffers(d("WAByteArray").intToBytes(2,a).buffer,d("WAByteArray").intToBytes(4,b).buffer)).buffer),keyEpoch:b}}function k(){return d("WASyncdKeyTypes").toSyncKeyData(d("WACryptoDependencies").getCrypto().getRandomValues(new Uint8Array(32)).buffer)}g.hasKeyExpired=a;g.hasADeviceBeenRemoved=b;g.rotateKey=e}),98); __d("WAWebSyncdKeyManagement",["WALogger","WAPromiseQueue","WASyncdKeyManagementUtils","WAWebGetSyncKey","WAWebSyncdCryptoUtils","WAWebSyncdKeyCallbacksApi","WAWebSyncdMetrics","WAWebSyncdRotateKey","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){"use strict";function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: key rotation due to no key present"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: key rotation due to device removal"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: key rotation due to key expiry"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: stored key rotation key id ",""]);k=function(){return a};return a}var l=new(d("WAPromiseQueue").PromiseQueue)();function a(a){a===void 0&&(a=!0);return l.enqueue(function(){return m(a)})}function m(a){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a===void 0&&(a=!0);var b=(yield o()),e=(yield d("WAWebSyncdKeyCallbacksApi").getDeviceFingerprint()),f=!1,g=!1;if(b!=null){f=d("WAWebSyncdRotateKey").hasKeyExpired(b);g=d("WAWebSyncdRotateKey").hasADeviceBeenRemoved(b,e);if(!a||!f&&!g)return{keyId:b.keyId,keyData:b.keyData}}else throw c("err")("syncd: No sync key available");e=d("WAWebSyncdRotateKey").rotateKey(e,b);d("WALogger").LOG(k(),d("WAWebSyncdCryptoUtils").syncKeyIdToHex(e.keyId));yield d("WAWebGetSyncKey").setSyncKeyInTransaction(e);yield d("WAWebSyncdKeyCallbacksApi").sendSyncdKeyRotation([e]);f&&(d("WALogger").LOG(j()),d("WAWebSyncdMetrics").reportSyncdKeyRotationEvent(d("WAWebSyncdMetrics").SyncdKeyRotationEventType.APP_STATE_SYNC_KEY_EXPIRY));g&&(d("WALogger").LOG(i()),d("WAWebSyncdMetrics").reportSyncdKeyRotationEvent(d("WAWebSyncdMetrics").SyncdKeyRotationEventType.DEVICE_DEREGISTERATION));b==null&&(d("WALogger").LOG(h()),d("WAWebSyncdMetrics").reportSyncdKeyRotationEvent(d("WAWebSyncdMetrics").SyncdKeyRotationEventType.NO_KEYS));return m(a)});return n.apply(this,arguments)}function o(){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield d("WAWebGetSyncKey").getAllSyncKeysInTransaction());if(a.length===0)return null;var b=a.map(function(a){return d("WASyncdKeyManagementUtils").getKeyEpoch(a.keyId)}),c=Math.max.apply(Math,b);b=a.filter(function(a){return d("WASyncdKeyManagementUtils").getKeyEpoch(a.keyId)===c});a=b.map(function(a){return d("WASyncdKeyManagementUtils").getKeyDeviceId(a.keyId)});var e=Math.min.apply(Math,a);a=a.indexOf(e);return b[a]});return p.apply(this,arguments)}g.getActiveKey=a;g.getNewestKeyPair=o}),98); __d("WAWebSyncdRequestBuilderUtils",[],(function(a,b,c,d,e,f){"use strict";function a(a){return g(a.reverse(),function(a){return a.index}).reverse()}function g(a,b){var c=new Set();return a.filter(function(a){a=b(a);if(c.has(a))return!1;c.add(a);return!0})}f.compactPatch=a}),66); __d("WAWebSyncdRequestBuilder",["Promise","WAWebGetPendingMutation","WAWebSyncdRequestBuilderBuild","WAWebSyncdRequestBuilderUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";var h;function a(a,b){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){var e=new Map(),f=new Map();yield (h||(h=b("Promise"))).all(a.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield d("WAWebGetPendingMutation").getSyncPendingMutationsByCollectionInTransaction(a)),c=b.map(function(a){return a.id}).filter(Boolean);f.set(a,c);c=d("WAWebSyncdRequestBuilderUtils").compactPatch(b);e.set(a,c)});return function(b){return a.apply(this,arguments)}}()));a=(yield d("WAWebSyncdRequestBuilderBuild").buildSyncIqNode(e,c));return{syncIqNode:a.syncIqNode,collectionWithPendingMutationsIds:f,collectionWithEncryptedMutations:a.collectionWithEncryptedMutations,localCollectionVersions:a.localCollectionVersions,collectionsToSkip:a.collectionsToSkip}});return i.apply(this,arguments)}g["default"]=a}),98); __d("WAWebSyncdEncryptMutationsWrapper",["WAServerSync.pb","WAWebEncryptionManagerSelector","WAWebGetSyncAction","WAWebSyncdCrypto","WAWebSyncdError","WAWebSyncdKeyCache","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=d("WAWebEncryptionManagerSelector").syncdEncryptionManager().encryptMutation,e=a.index,f=a.operation,g=b.keyId;b=b.keyData;switch(f){case d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET:break;case d("WAServerSync.pb").SyncdMutation$SyncdOperation.REMOVE:f=(yield d("WAWebGetSyncAction").getSyncActionInTransaction(e));if(!f)throw new(d("WAWebSyncdError").SyncdFatalError)("no corresponding set mutation");e=f.keyId;f=(yield d("WAWebSyncdKeyCache").getKeyData(e));if(f==null)throw new(d("WAWebSyncdError").SyncdFatalError)("no key data for corresponding mutation");g=e;b=f}e=(yield c(a,g,b));f=e.indexMac;c=e.indexAndValueCipherText;e=d("WAWebSyncdCrypto").valueMacFromIndexAndValueCipherText(c);return babelHelpers["extends"]({},a,{keyId:g,keyData:b,indexMac:f,indexAndValueCipherText:c,valueMac:e})});return h.apply(this,arguments)}g.encryptMutation=a}),98); __d("WAWebSyncdMMSUpload",["WAWebSyncdGatingUtils"],(function(a,b,c,d,e,f,g){"use strict";var h=100,i=2e3,j=10,k=100;function a(a){var b=Math.min(i,Math.max(d("WAWebSyncdGatingUtils").getSyncdInlineMutationsMaxCount(),h));return a.length>b}function b(a){var b=Math.min(k,Math.max(d("WAWebSyncdGatingUtils").getSyncdPatchProtobufMaxSize(),j))*1e3;return a.byteLength>b}g.exceedInlineMutationCount=a;g.exceedPatchProtobufSize=b}),98); __d("WAWebSyncdRequestBuilderBuild",["Promise","WABase64","WABaseGlobals","WAJids","WALogger","WAMediaCalculateFilehash","WAServerSync.pb","WASyncAction.pb","WASyncdConst","WASyncdKeyManagementUtils","WASyncdKeyTypes","WAWap","WAWebABProps","WAWebBrokerGlobalAppState","WAWebGetCollectionVersion","WAWebGetSyncAction","WAWebSyncdAntiTampering","WAWebSyncdCryptoUtils","WAWebSyncdEncryptMutationsWrapper","WAWebSyncdKeyManagement","WAWebSyncdMMSUpload","WAWebSyncdNetCallbacksApi","WAWebSyncdRequestBuilderTypesConverter","WAWebSyncdRequestEncode","WAWebSyncdWamAppState","asyncToGeneratorRuntime","encodeProtobuf","sortBy"],(function(a,b,c,d,e,f,g){"use strict";var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: end _buildCollectionNodes"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: skipping "," in sync iq patch because initial full sync\n is incomplete"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: start _buildCollectionNodes"]);k=function(){return a};return a}var l=5;function a(a,b){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=(yield o(a,b));b=a.collectionNodes;var c=a.collectionWithEncryptedMutations,e=a.localCollectionVersions;a=a.collectionsToSkip;b=n(d("WAWap").wap("sync",null,b));return{syncIqNode:b,collectionWithEncryptedMutations:c,localCollectionVersions:e,collectionsToSkip:a}});return m.apply(this,arguments)}function n(a){return d("WAWap").wap("iq",{id:d("WAWap").generateId(),to:d("WAWap").S_WHATSAPP_NET,type:"set",xmlns:"w:sync:app:state"},a)}function o(a,b){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){d("WALogger").LOG(k());var e=[],f=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var f=(yield d("WAWebGetCollectionVersion").getCollectionVersionInTransaction(a).then(function(a){return a==null?void 0:a.version})),g,h;if(b!=null&&b.length>0)if(f==null)d("WALogger").LOG(j(),a),e.push(a);else{b=(yield q(a,b,c));var i=b.patchNode;b=b.encryptedMutations;g=i;h=b}return{collection:a,version:f,patchNode:g,encryptedMutations:h}});return function(b,c){return a.apply(this,arguments)}}(),g=new Map(),l=new Map(),m=[];a.forEach(function(a,b){return m.push(f(b,a))});a=(yield (h||(h=b("Promise"))).all(m));a=a.map(function(a){var b=a.collection,c=a.version,e=a.patchNode;a=a.encryptedMutations;a&&l.set(b,a);g.set(b,c);return d("WAWap").wap("collection",{name:d("WAWap").CUSTOM_STRING(b),return_snapshot:c===void 0?"true":"false",version:d("WAWap").INT((a=c)!=null?a:d("WASyncdConst").DEFAULT_COLLECTION_VERSION)},e)});d("WALogger").LOG(i());return{collectionNodes:a,collectionWithEncryptedMutations:l,localCollectionVersions:g,collectionsToSkip:e}});return p.apply(this,arguments)}function q(a,b,c){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e){var f=(yield d("WAWebSyncdKeyManagement").getActiveKey(!s(c)));c=(yield z(a,c,f));c=c.map(function(a){return d("WAWebSyncdEncryptMutationsWrapper").encryptMutation(a,f)});c=(yield (h||(h=b("Promise"))).all(c));var g=c.map(function(a){return{indexMac:a.indexMac,valueMac:a.valueMac,operation:a.operation}});g=(yield d("WAWebSyncdAntiTampering").computeLtHash(a,g,e));e=g.ltHash;g=(yield d("WAWebSyncdAntiTampering").computeOutgoingSnapshotAndPatchMacs(a,e,c,f.keyData));var i=g.snapshotMac,j=g.patchMac;c.map(function(a){a.patchMac=j});a=c.map(function(a){return y(a.keyId,a.operation,a.indexMac,a.indexAndValueCipherText)});var k=x(a);e=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield d("WAWebSyncdNetCallbacksApi").uploadSyncExternalPatch(k));a=(yield t(a,k));return v(a,f.keyId,i,j)});return function(){return a.apply(this,arguments)}}();d("WAWebSyncdMMSUpload").exceedInlineMutationCount(a)?g=(yield e()):(g=w(a,f.keyId,i,j),d("WAWebSyncdMMSUpload").exceedPatchProtobufSize(g)&&(g=(yield e())));a=d("WAWap").wap("patch",null,g);return{patchNode:a,encryptedMutations:c}});return r.apply(this,arguments)}function s(a){return c("WAWebBrokerGlobalAppState").isLogoutInProgress&&a.some(function(a){return JSON.parse(a.index)[0]===d("WASyncdConst").Actions.Sentinel})}function t(a,b){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=a.mediaKey,e=a.directPath,f=a.encFilehash;a=a.handle;var g=(yield d("WAMediaCalculateFilehash").calculateFilehash(b));return{mediaKey:c,directPath:e,handle:a,fileSizeBytes:b.byteLength,fileSha256:d("WABase64").decodeB64(g),fileEncSha256:f}});return u.apply(this,arguments)}function v(a,b,c,e){var f=d("WAJids").extractDeviceId(d("WABaseGlobals").getMyDeviceJid());return d("WAWebSyncdRequestEncode").encodeSyncdPatch({keyId:{id:d("WASyncdKeyTypes").fromSyncKeyId(b)},externalMutations:a,snapshotMac:c,patchMac:e,deviceIndex:f})}function w(a,b,c,e){var f=d("WAJids").extractDeviceId(d("WABaseGlobals").getMyDeviceJid()),g=d("encodeProtobuf").encodeProtobuf(d("WASyncAction.pb").PatchDebugDataSpec,{isSenderPrimary:!1,senderPlatform:d("WASyncAction.pb").PatchDebugData$Platform.WEB}).readBuffer();return d("WAWebSyncdRequestEncode").encodeSyncdPatch({keyId:{id:d("WASyncdKeyTypes").fromSyncKeyId(b)},mutations:a,snapshotMac:c,patchMac:e,deviceIndex:f,clientDebugData:g})}function x(a){return d("WAWebSyncdRequestEncode").encodeSyncdMutations({mutations:a})}function y(a,b,c,e){return{operation:b,record:{keyId:{id:d("WASyncdKeyTypes").fromSyncKeyId(a)},index:{blob:c},value:{blob:e}}}}function z(a,b,c){return A.apply(this,arguments)}function A(){A=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){a=(yield d("WAWebGetSyncAction").getSyncActionsByCollectionsInTransaction([a]));var e=b;b=B(a,b,c.keyId);e=e.concat(b);b=C(a,e,c.keyId);d("WAWebSyncdWamAppState").addKeyRotationRemoveCount(b.length);e=e.concat(b);return e});return A.apply(this,arguments)}function B(a,b,e){a=a.filter(function(a){return!b.map(function(a){return a.index}).includes(a.index)&&!d("WAWebSyncdCryptoUtils").syncKeyIdsEqual(a.keyId,e)});a=c("sortBy")(a,function(a){return d("WASyncdKeyManagementUtils").getKeyEpoch(a.keyId)});var f=Math.min(l,d("WAWebABProps").getABPropConfigValue("syncd_additional_mutations_count"));a=a.slice(0,f);return d("WAWebSyncdRequestBuilderTypesConverter").syncActionsToPendingMutations(a,d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET)}function C(a,b,c){var e=b.filter(function(a){return a.operation===d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET}).map(function(a){return a.index});b=a.filter(function(a){return e.includes(a.index)});a=b.filter(function(a){return!d("WAWebSyncdCryptoUtils").syncKeyIdsEqual(a.keyId,c)});return d("WAWebSyncdRequestBuilderTypesConverter").syncActionsToPendingMutations(a,d("WAServerSync.pb").SyncdMutation$SyncdOperation.REMOVE)}g.buildSyncIqNode=a;g._generateMutationsToUpload=z}),98); __d("WAWebSyncdResolveMessages",["Promise","WAWebSchemaMessage","WAWebSyncdGetChat","WAWebSyncdIndexUtils","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function a(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=[],f=new Map();a=(yield (h||(h=b("Promise"))).all(a.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a.indexParts;var b=a[1],e=a[2],g=a[3];a=a[4];if(!b||!e||!g||!a)return null;if(!c("WAWebWid").isWid(b))return null;var h=(yield d("WAWebSyncdGetChat").resolveChatForMutationIndex(d("WAWebWidFactory").createWid(b)));if(!h.success)return;h=h.chat.id;f.set(b,h);return(b=d("WAWebSyncdIndexUtils").syncKeyToMsgKey(h,e,g,a,!1))==null?void 0:b.toString()});return function(b){return a.apply(this,arguments)}}()))).filter(Boolean);yield d("WAWebSchemaMessage").getMessageTable().startsWithAnyOf(["id"],a).then(function(a){return a.forEach(function(a){a&&e.push(a.id)})});return{messagesInDB:e,incomingRemoteToLocalChatId:f}});return i.apply(this,arguments)}g.resolveMessagesForMutations=a}),98); __d("WAWebSyncdUploadFatalErrorMetric",["WASyncAction.pb","WATimeUtils","WAWebABProps","WAWebMdFatalErrorWamEvent","WAWebSchemaSyncActions","WAWebSyncBootstrap","WAWebSyncdCollectionsStateMachine","WAWebSyncdUtils","WAWebUserPrefsAppStateSync","WAWebUserPrefsMultiDevice","asyncToGeneratorRuntime","decodeProtobuf"],(function(a,b,c,d,e,f,g){var h=d("WATimeUtils").unixTime();function a(a,b,c,d,e,f,g,h,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e,f,g,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D){a={mdFatalErrorCode:a,collection:b?d("WAWebSyncdUtils").collectionNameToMetric(b):void 0,isBootstrap:c("WAWebSyncBootstrap").isSyncDCriticalDataSyncInProcess()};b=d("WAWebUserPrefsMultiDevice").getPairingTimestamp();b=b!=null?(d("WATimeUtils").unixTime()-b)*1e3:void 0;a=babelHelpers["extends"]({},a,{timeSinceRefreshMs:(d("WATimeUtils").unixTime()-h)*1e3,timeSincePairingMs:b,patchSnapshotMutationCount:e,patchVersion:f,isFatal:g,isWebLthashConsistent:i,macFatalCollectionNameMismatch:j,macFatalCurrentLthashMismatch:k,macFatalNewLthashMismatch:l,macFatalPatchVersionMismatch:m,macFatalNewLthashSubtractMismatch:n,macFatalNumberHasOverrideMutation:o,macFatalNumberNumAddMutation:p,macFatalNumberNumRemoveMutation:q,macFatalSenderCurrentLthashToLocalCalculatedCurrentLthashMismatch:r,isPatchSenderPrimary:s,macFatalDidUseMacFetchFallback:t,macFatalHasMissingRemove:u,macFatalNumberAddMismatch:v,macFatalNumberRemoveMismatch:w,macFatalDidPreviousPatchFailPostSaveValidation:x,macFatalPreviousPatchNewLthashToCurrentPatchCurrentLthash:y,isPreviousPatchAnIncomingPatch:z,isPreviousPatchSenderPrimary:A,isSenderIndexSameAsPreviousSenderIndex:B,didBootstrapFromSnapshot:C,isThereAnotherSyncdCompanion:D});if(d("WAWebABProps").getABPropConfigValue("web_syncd_fatal_fields_from_L1104589PRV2")){b=(yield d("WAWebUserPrefsMultiDevice").getRecentMailboxAgeDays());e=(yield d("WAWebUserPrefsAppStateSync").getLastPeriodicAppStateSyncTs());f=c("WAWebSyncdCollectionsStateMachine").getCollectionMinFailureTime();a=babelHelpers["extends"]({},a,{mailboxAgeDays:b==null?void 0:b,daysSinceLastPeriodicSync:e==null?void 0:Math.trunc((d("WATimeUtils").unixTime()-e)/60/60/24),hoursSinceFirstFiniteFailure:f==null?void 0:Math.trunc((d("WATimeUtils").unixTimeMs()-f)/1e3/60/60)});g=(yield d("WAWebSchemaSyncActions").getSyncActionsTable().get('["primary_version","current"]'));i=(yield d("WAWebSchemaSyncActions").getSyncActionsTable().get('["primary_version","session_start"]'));if(g||i){j=d("decodeProtobuf").decodeProtobuf(d("WASyncAction.pb").SyncActionDataSpec,g==null?void 0:g.binarySyncData).value;k=d("decodeProtobuf").decodeProtobuf(d("WASyncAction.pb").SyncActionDataSpec,i==null?void 0:i.binarySyncData).value;a=babelHelpers["extends"]({},a,{currentPrimaryAppVersion:(m=j==null?void 0:(l=j.primaryVersionAction)==null?void 0:l.version)!=null?m:void 0,sessionStartPrimaryAppVersion:(o=k==null?void 0:(n=k.primaryVersionAction)==null?void 0:n.version)!=null?o:void 0})}}new(d("WAWebMdFatalErrorWamEvent").MdFatalErrorWamEvent)(a).commitAndWaitForFlush(!0)});return i.apply(this,arguments)}g.uploadFatalErrorMetric=a}),98); __d("WAWebApiPrivacyDisallowedList",["WALogger","WAWebSchemaPrivacyDisallowedList","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["privacy_settings_drawer: get all privacy disallowed lists failed"]);h=function(){return a};return a}function a(){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){try{var a=(yield d("WAWebSchemaPrivacyDisallowedList").getPrivacyDisallowedListTable().all());return j(a)}catch(a){d("WALogger").ERROR(h()).verbose().devConsole(a).sendLogs("privacy_settings_drawer: get all privacy disallowed lists failed");return{about:null,groupadd:null,last:null,profile:null}}});return i.apply(this,arguments)}function j(a){var b={about:null,groupadd:null,last:null,profile:null};a.forEach(function(a){switch(a.id){case d("WAWebSchemaPrivacyDisallowedList").PrivacyDisallowedListType.About:b.about=a;return;case d("WAWebSchemaPrivacyDisallowedList").PrivacyDisallowedListType.GroupAdd:b.groupadd=a;return;case d("WAWebSchemaPrivacyDisallowedList").PrivacyDisallowedListType.LastSeen:b.last=a;return;case d("WAWebSchemaPrivacyDisallowedList").PrivacyDisallowedListType.ProfilePicture:b.profile=a;return}});return b}g.queryDisallowedLists=a;g.disallowedRowsToLists=j}),98); __d("WAWebApiPrivacyEphemerality",["WALogger","WAWebABProps","WAWebSchemaChat","WAWebSchemaGroupMetadata","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["ephemerality_daily_logs: retrieving current ephemerality information failed"]);h=function(){return a};return a}function a(){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){try{var a=(yield d("WAWebSchemaChat").getChatTable().greaterThan(["ephemeralDuration"],0,{shouldDecrypt:!1})),b=a.length;a=a.filter(function(a){return a.disappearingModeInitiatedByMe===!0}).length;var c=(yield d("WAWebSchemaGroupMetadata").getGroupMetadataTable().greaterThan(["ephemeralDuration"],0));c=d("WAWebABProps").getABPropConfigValue("dm_initiator_trigger_groups")?c.filter(function(a){return a.disappearingModeInitiatedByMe===!0}).length:0;a=a+c;return{isEphemeralMessagingUser:a>0,countEphemeralThreadsEnabledByMe:a,countEphemeralThreads:b}}catch(a){d("WALogger").ERROR(h()).verbose().devConsole(a).sendLogs("ephemerality_daily_logs: retrieving current ephemerality information failed");return{isEphemeralMessagingUser:null,countEphemeralThreadsEnabledByMe:null,countEphemeralThreads:null}}});return i.apply(this,arguments)}g.queryEphemeralityDailyLogInfo=a}),98); __d("WAWebEstimateFtsStorageApi",["Promise","WALogger","WANullthrows","WAWebDbUsageApiUtils","WAWebIndexedDB","WAWebScanDbRowApi","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Estimated FTS "," size: "," KB, fetched rows: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Estimated FTS size: "," KB, fetched rows: "," took: "," ms"]);j=function(){return a};return a}var k="fts-storage",l=15e3;function a(a){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a===void 0?{sampleRows:l}:a;a=a.sampleRows;var e=Date.now(),f=a;a=c("WANullthrows")(c("WAWebIndexedDB"));a=(yield d("WAWebDbUsageApiUtils").getDatabase(a,k));var g=a.transaction(a.objectStoreNames,"readonly"),m=0,n=0;a=function*(a){var b=g.objectStore(a),c=(yield d("WAWebDbUsageApiUtils").promisifyRequest(b.count()));if(c===0)return"continue";var e=Math.min(f,c);n=e;var h=0;yield d("WAWebDbUsageApiUtils").objectStoreIterator(b,function(b){h+=d("WAWebScanDbRowApi").estimateSize(b,a);n--;return n>0});b=Math.round(h*(c/(e-n)));m+=b;d("WALogger").DEV(i(),a,b/1e3,e-n)};for(var o of g.objectStoreNames){var p=(yield* a(o));if(p==="continue")continue}p=Date.now()-e;d("WALogger").DEV(j(),m/1e3,n,p);return(h||(h=b("Promise"))).resolve(m)});return m.apply(this,arguments)}g.getEstimatedFTSDbSize=a}),98); __d("WAWebLidMigrationDailyWamEvent",["WAWebWamCodegenUtils"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({LidMigrationDaily:[5842,{completedMigrations:[1,a.TYPES.STRING],numberOfPnhCtwaThreadsKnownMapping:[2,a.TYPES.INTEGER],numberOfPnhCtwaThreadsMissingMapping:[3,a.TYPES.INTEGER],numberOfSplitThreads:[4,a.TYPES.INTEGER]},[1,1,1],"regular"]},{LidMigrationDaily:[]});g.LidMigrationDailyWamEvent=b}),98); __d("WAWebWamEnumInAppNotificationAlertStyle",[],(function(a,b,c,d,e,f){a=Object.freeze({NONE:1,BANNERS:2,ALERTS:3});f.IN_APP_NOTIFICATION_ALERT_STYLE=a}),66); __d("WAWebWamEnumNotificationSoundTone",[],(function(a,b,c,d,e,f){a=Object.freeze({DEFAULT:1,CUSTOM:2});f.NOTIFICATION_SOUND_TONE=a}),66); __d("WAWebWamEnumUnreadBadgeSettingType",[],(function(a,b,c,d,e,f){a=Object.freeze({CURRENT_UNREAD_COUNT:0,CLEAR_ON_APP_OPEN:1});f.UNREAD_BADGE_SETTING_TYPE=a}),66); __d("WAWebNotificationSettingWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumInAppNotificationAlertStyle","WAWebWamEnumNotificationSoundTone","WAWebWamEnumUnreadBadgeSettingType"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({NotificationSetting:[3684,{groupReactionNotification:[1,a.TYPES.BOOLEAN],groupShowNotification:[2,a.TYPES.BOOLEAN],groupSoundTone:[3,d("WAWebWamEnumNotificationSoundTone").NOTIFICATION_SOUND_TONE],inAppNotificationAlertStyle:[4,d("WAWebWamEnumInAppNotificationAlertStyle").IN_APP_NOTIFICATION_ALERT_STYLE],inAppNotificationSound:[5,a.TYPES.BOOLEAN],inAppNotificationVibrate:[6,a.TYPES.BOOLEAN],messageReactionNotification:[7,a.TYPES.BOOLEAN],messageShowNotification:[8,a.TYPES.BOOLEAN],messageSoundTone:[9,d("WAWebWamEnumNotificationSoundTone").NOTIFICATION_SOUND_TONE],offlineNotification:[11,a.TYPES.BOOLEAN],showPreview:[10,a.TYPES.BOOLEAN],statusReminderNotification:[12,a.TYPES.BOOLEAN],unreadBadgeSetting:[13,d("WAWebWamEnumUnreadBadgeSettingType").UNREAD_BADGE_SETTING_TYPE]},[1,1,1],"regular"]},{NotificationSetting:[]});g.NotificationSettingWamEvent=b}),98); __d("WAWebPnhDailyCtwaWamEvent",["WAWebWamCodegenUtils"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({PnhDailyCtwa:[4280,{matMessagesReceived:[1,a.TYPES.INTEGER],threadDs:[3,a.TYPES.STRING],threadId:[2,a.TYPES.STRING]},[1,1,1],"regular"]},{PnhDailyCtwa:[]});g.PnhDailyCtwaWamEvent=b}),98); __d("WAWebPnhDailyWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumTypeOfGroupEnum"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({PnhDaily:[3806,{communityId:[1,a.TYPES.STRING],mappingMissing:[7,a.TYPES.INTEGER],pnhIndicatorClicksChat:[2,a.TYPES.INTEGER],pnhIndicatorClicksInfoScreen:[3,a.TYPES.INTEGER],reactionDeleteCount:[4,a.TYPES.INTEGER],reactionOpenTrayCount:[5,a.TYPES.INTEGER],totalContacts:[8,a.TYPES.INTEGER],typeOfGroup:[6,d("WAWebWamEnumTypeOfGroupEnum").TYPE_OF_GROUP_ENUM]},[1,1,1],"regular"]},{PnhDaily:[]});g.PnhDailyWamEvent=b}),98); __d("WAWebWamEnumPrivacyHighlightCategoryEnum",[],(function(a,b,c,d,e,f){a=Object.freeze({E2EE:0});f.PRIVACY_HIGHLIGHT_CATEGORY_ENUM=a}),66); __d("WAWebWamEnumPrivacyHighlightSurfaceEnum",[],(function(a,b,c,d,e,f){a=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,SPLIT_VIEW_HOME_PLACEHOLDER:12});f.PRIVACY_HIGHLIGHT_SURFACE_ENUM=a}),66); __d("WAWebPrivacyHighlightDailyWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumPrivacyHighlightCategoryEnum","WAWebWamEnumPrivacyHighlightSurfaceEnum"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({PrivacyHighlightDaily:[3522,{dialogAppearCount:[1,a.TYPES.INTEGER],dialogSelectCount:[2,a.TYPES.INTEGER],narrativeAppearCount:[3,a.TYPES.INTEGER],privacyHighlightCategory:[4,d("WAWebWamEnumPrivacyHighlightCategoryEnum").PRIVACY_HIGHLIGHT_CATEGORY_ENUM],privacyHighlightSurface:[5,d("WAWebWamEnumPrivacyHighlightSurfaceEnum").PRIVACY_HIGHLIGHT_SURFACE_ENUM]},[1,1,1],"regular"]},{PrivacyHighlightDaily:[]});g.PrivacyHighlightDailyWamEvent=b}),98); __d("WAWebPttDailyWamEvent",["WAWebWamCodegenUtils"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({PttDaily:[2938,{pttCancelBroadcast:[9,a.TYPES.INTEGER],pttCancelGroup:[8,a.TYPES.INTEGER],pttCancelIndividual:[7,a.TYPES.INTEGER],pttCancelInterop:[42,a.TYPES.INTEGER],pttCancelNewsletter:[32,a.TYPES.INTEGER],pttDraftReviewBroadcast:[15,a.TYPES.INTEGER],pttDraftReviewGroup:[14,a.TYPES.INTEGER],pttDraftReviewIndividual:[13,a.TYPES.INTEGER],pttDraftReviewInterop:[43,a.TYPES.INTEGER],pttDraftReviewNewsletter:[33,a.TYPES.INTEGER],pttFastplaybackBroadcast:[21,a.TYPES.INTEGER],pttFastplaybackGroup:[20,a.TYPES.INTEGER],pttFastplaybackIndividual:[19,a.TYPES.INTEGER],pttFastplaybackInterop:[44,a.TYPES.INTEGER],pttFastplaybackNewsletter:[34,a.TYPES.INTEGER],pttLockBroadcast:[12,a.TYPES.INTEGER],pttLockGroup:[11,a.TYPES.INTEGER],pttLockIndividual:[10,a.TYPES.INTEGER],pttLockInterop:[45,a.TYPES.INTEGER],pttLockNewsletter:[35,a.TYPES.INTEGER],pttOutOfChatBroadcast:[29,a.TYPES.INTEGER],pttOutOfChatGroup:[30,a.TYPES.INTEGER],pttOutOfChatIndividual:[31,a.TYPES.INTEGER],pttOutOfChatInterop:[46,a.TYPES.INTEGER],pttOutOfChatNewsletter:[36,a.TYPES.INTEGER],pttPausedRecordBroadcast:[22,a.TYPES.INTEGER],pttPausedRecordGroup:[23,a.TYPES.INTEGER],pttPausedRecordIndividual:[24,a.TYPES.INTEGER],pttPausedRecordInterop:[47,a.TYPES.INTEGER],pttPausedRecordNewsletter:[37,a.TYPES.INTEGER],pttPlaybackBroadcast:[18,a.TYPES.INTEGER],pttPlaybackGroup:[17,a.TYPES.INTEGER],pttPlaybackIndividual:[16,a.TYPES.INTEGER],pttPlaybackInterop:[48,a.TYPES.INTEGER],pttPlaybackNewsletter:[38,a.TYPES.INTEGER],pttRecordBroadcast:[3,a.TYPES.INTEGER],pttRecordGroup:[2,a.TYPES.INTEGER],pttRecordIndividual:[1,a.TYPES.INTEGER],pttRecordInterop:[49,a.TYPES.INTEGER],pttRecordNewsletter:[39,a.TYPES.INTEGER],pttSendBroadcast:[6,a.TYPES.INTEGER],pttSendGroup:[5,a.TYPES.INTEGER],pttSendIndividual:[4,a.TYPES.INTEGER],pttSendInterop:[50,a.TYPES.INTEGER],pttSendNewsletter:[40,a.TYPES.INTEGER],pttStopTapBroadcast:[25,a.TYPES.INTEGER],pttStopTapGroup:[26,a.TYPES.INTEGER],pttStopTapIndividual:[27,a.TYPES.INTEGER],pttStopTapInterop:[51,a.TYPES.INTEGER],pttStopTapNewsletter:[41,a.TYPES.INTEGER]},[1,1,1],"regular"]},{PttDaily:[]});g.PttDailyWamEvent=b}),98); __d("WAWebScreenLockSettingsDataWamEvent",["WAWebWamCodegenUtils"],(function(a,b,c,d,e,f,g){a=d("WAWebWamCodegenUtils").defineEvents({ScreenLockSettingsData:[4802,{screenAutoLockDuration:[1,d("WAWebWamCodegenUtils").TYPES.INTEGER]},[1,1,1],"regular"]},{ScreenLockSettingsData:[]});g.ScreenLockSettingsDataWamEvent=a}),98); __d("WAWebChatLockDailyWamEvent",["WAWebWamCodegenUtils"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({ChatLockDaily:[4214,{folderChatsCount:[1,a.TYPES.INTEGER],folderOpenCount:[2,a.TYPES.INTEGER],lockFolderHidden:[5,a.TYPES.BOOLEAN],newAddChatCount:[3,a.TYPES.INTEGER],newRemoveChatCount:[4,a.TYPES.INTEGER],secretCodeActive:[6,a.TYPES.BOOLEAN]},[1,1,1],"regular"]},{ChatLockDaily:[]});g.ChatLockDailyWamEvent=b}),98); __d("WAWebSubmitChatLockDailyStats",["WAWebChatLockDailyWamEvent"],(function(a,b,c,d,e,f,g){"use strict";function a(a){var b=a.chatLockFolderChatsCount,c=a.chatLockFolderOpenCount,e=a.chatLockNewAddChatCount,f=a.chatLockNewRemoveChatCount,g=a.chatLockLockFolderHidden;a=a.chatLockSecretCodeActive;if(b===0||c===0||e===0||f===0)return;b=new(d("WAWebChatLockDailyWamEvent").ChatLockDailyWamEvent)({folderChatsCount:b,folderOpenCount:c,newAddChatCount:e,newRemoveChatCount:f});g!=null&&b.set({lockFolderHidden:g});a!=null&&b.set({secretCodeActive:a});b.commit()}g.submitChatLockDailyStats=a}),98); __d("WAWebUserPrefsContactManagement",["WAWebUserPrefsKeys","WAWebUserPrefsStore"],(function(a,b,c,d,e,f,g){var h=1;function i(){var a=c("WAWebUserPrefsStore").getUser(d("WAWebUserPrefsKeys").UserPrefs.SyncContactToAddressbookCounts);a=typeof a==="object"?a:null;var b=typeof (a==null?void 0:a.enabledCount)==="number"?a.enabledCount:0;a=typeof (a==null?void 0:a.disabledCount)==="number"?a.disabledCount:0;return{enabledCount:b,disabledCount:a}}function j(a){c("WAWebUserPrefsStore").setUser(d("WAWebUserPrefsKeys").UserPrefs.SyncContactToAddressbookCounts,a)}function a(a){var b=i(),c=k();c!==a?a?(b.enabledCount++,b.enabledCount>=h&&(b.disabledCount=0)):(b.disabledCount++,b.disabledCount>=h&&(b.enabledCount=0)):!a&&b.enabledCount<h?b.enabledCount=0:a&&b.disabledCount<h&&(b.disabledCount=0);j(b)}function k(){var a=i();return a.enabledCount>=h?!0:!1}g.setSyncToAddressbookLastSetting=a;g.getSyncToAddressbookDefaultSetting=k}),98); __d("WAWebWaFsSingleEmojiMessageDailyWamEvent",["WAWebWamCodegenUtils"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({WaFsSingleEmojiMessageDaily:[5602,{animatedEmojiEnabled:[1,a.TYPES.BOOLEAN],animatedEmojiReceiveCnt:[2,a.TYPES.INTEGER],animatedEmojiSendCnt:[3,a.TYPES.INTEGER],emojiClickCnt:[4,a.TYPES.INTEGER],emojiReplyCount:[5,a.TYPES.INTEGER],pauseAnimationCnt:[6,a.TYPES.INTEGER],replayAnimationCnt:[7,a.TYPES.INTEGER],singleEmojiReceiveCnt:[8,a.TYPES.INTEGER],singleEmojiSendCnt:[9,a.TYPES.INTEGER]},[1,1,1],"regular"]},{WaFsSingleEmojiMessageDaily:[]});g.WaFsSingleEmojiMessageDailyWamEvent=b}),98); __d("WAWebWamEnumPsTestEnumField",[],(function(a,b,c,d,e,f){a=Object.freeze({TEST_VALUE1:1,TEST_VALUE2:2});f.PS_TEST_ENUM_FIELD=a}),66); __d("WAWebTestAnonymousDailyIdWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumPsTestEnumField"],(function(a,b,c,d,e,f,g){a=d("WAWebWamCodegenUtils").defineEvents({TestAnonymousDailyId:[2958,{psTestEnumField:[1,d("WAWebWamEnumPsTestEnumField").PS_TEST_ENUM_FIELD],psTestFloatField:[2,d("WAWebWamCodegenUtils").TYPES.NUMBER]},[1,1,1],"private",248614979]},{TestAnonymousDailyId:[]});g.TestAnonymousDailyIdWamEvent=a}),98); __d("WAWebTestAnonymousDailyWamEvent",["WAWebWamCodegenUtils"],(function(a,b,c,d,e,f,g){a=d("WAWebWamCodegenUtils").defineEvents({TestAnonymousDaily:[2328,{},[1,1,1],"private",113760892]},{TestAnonymousDaily:[]});g.TestAnonymousDailyWamEvent=a}),98); __d("WAWebTestAnonymousIdLessWamEvent",["WAWebWamCodegenUtils"],(function(a,b,c,d,e,f,g){a=d("WAWebWamCodegenUtils").defineEvents({TestAnonymousIdLess:[3004,{psTimeSinceLastEventInMin:[1,d("WAWebWamCodegenUtils").TYPES.INTEGER]},[1,1,1],"private",0]},{TestAnonymousIdLess:[]});g.TestAnonymousIdLessWamEvent=a}),98); __d("WAWebTestAnonymousMonthlyIdWamEvent",["WAWebWamCodegenUtils"],(function(a,b,c,d,e,f,g){a=d("WAWebWamCodegenUtils").defineEvents({TestAnonymousMonthlyId:[2960,{},[1,20,1e3],"private",191000728]},{TestAnonymousMonthlyId:[]});g.TestAnonymousMonthlyIdWamEvent=a}),98); __d("WAWebTestAnonymousWeeklyIdWamEvent",["WAWebWamCodegenUtils"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({TestAnonymousWeeklyId:[2956,{psTestBooleanField:[2,a.TYPES.BOOLEAN],psTestStringField:[3,a.TYPES.STRING],psTimeSinceLastEventInMin:[1,a.TYPES.INTEGER]},[1,1,1],"private",42196056]},{TestAnonymousWeeklyId:[]});g.TestAnonymousWeeklyIdWamEvent=b}),98); __d("WAWebWamPrivateStatsUtils",["WAWebTestAnonymousDailyIdWamEvent","WAWebTestAnonymousDailyWamEvent","WAWebTestAnonymousIdLessWamEvent","WAWebTestAnonymousMonthlyIdWamEvent","WAWebTestAnonymousWeeklyIdWamEvent"],(function(a,b,c,d,e,f,g){function a(){new(d("WAWebTestAnonymousDailyWamEvent").TestAnonymousDailyWamEvent)().commit(),new(d("WAWebTestAnonymousWeeklyIdWamEvent").TestAnonymousWeeklyIdWamEvent)().commit(),new(d("WAWebTestAnonymousIdLessWamEvent").TestAnonymousIdLessWamEvent)().commit()}function b(){new(d("WAWebTestAnonymousDailyIdWamEvent").TestAnonymousDailyIdWamEvent)().commit(),new(d("WAWebTestAnonymousMonthlyIdWamEvent").TestAnonymousMonthlyIdWamEvent)().commit()}g.logDailyPrivateStatsTestEvents=a;g.logUiActionShadowPrivateStatsTestEvents=b}),98); __d("WAWebWebDynamicSamplingTestEventWithSamplingWamEvent",["WAWebWamCodegenUtils"],(function(a,b,c,d,e,f,g){a=d("WAWebWamCodegenUtils").defineEvents({WebDynamicSamplingTestEventWithSampling:[5320,{},[100,100,1e4],"regular"]},{WebDynamicSamplingTestEventWithSampling:[]});g.WebDynamicSamplingTestEventWithSamplingWamEvent=a}),98); __d("WAWebWebDynamicSamplingTestEventWithoutSamplingWamEvent",["WAWebWamCodegenUtils"],(function(a,b,c,d,e,f,g){a=d("WAWebWamCodegenUtils").defineEvents({WebDynamicSamplingTestEventWithoutSampling:[5322,{},[1,1,1],"regular"]},{WebDynamicSamplingTestEventWithoutSampling:[]});g.WebDynamicSamplingTestEventWithoutSamplingWamEvent=a}),98); __d("WAWebWebcFtsStorageWamEvent",["WAWebWamCodegenUtils"],(function(a,b,c,d,e,f,g){a=d("WAWebWamCodegenUtils").defineEvents({WebcFtsStorage:[3642,{ftsTotalSize:[1,d("WAWebWamCodegenUtils").TYPES.INTEGER]},[1,1,1],"regular"]},{WebcFtsStorage:[]});g.WebcFtsStorageWamEvent=a}),98); __d("WAWebTasksDailyStatsTask",["Promise","WALogger","WAStorageEstimator","WATimeUtils","WAWebABProps","WAWebApiPrivacyDisallowedList","WAWebApiPrivacyEphemerality","WAWebChatThreadLoggingUtils","WAWebCommunityHomeActionWamEvent","WAWebCommunityTabActionWamEvent","WAWebContactCollection","WAWebContactManagementGating","WAWebDailyAggregatedStatsCollection","WAWebDailyWamEvent","WAWebEphemeralityResolver","WAWebEstimateFtsStorageApi","WAWebKeepInChatNotifWamEvent","WAWebLid1X1MigrationGating","WAWebLidAwareContactsDB","WAWebLidContactsGatingUtils","WAWebLidMigrationDailyWamEvent","WAWebMediaStore","WAWebMuteCollection","WAWebNotificationConstants","WAWebNotificationEngagementWamEvent","WAWebNotificationSettingWamEvent","WAWebPnhDailyCtwaWamEvent","WAWebPnhDailyWamEvent","WAWebPrivacyHighlightDailyWamEvent","WAWebPttDailyWamEvent","WAWebScreenLockSettingsDataWamEvent","WAWebSubmitChatLockDailyStats","WAWebUserPrefsCartLidMigration","WAWebUserPrefsContactManagement","WAWebUserPrefsFavoritesLidMigration","WAWebUserPrefsGeneral","WAWebUserPrefsInfoStore","WAWebUserPrefsLabelAssociationsLidMigration","WAWebUserPrefsMultiDevice","WAWebUserPrefsNotifications","WAWebUserPrefsScreenLock","WAWebWaFsSingleEmojiMessageDailyWamEvent","WAWebWamEnumNotificationSettingType","WAWebWamEnumNotificationSoundTone","WAWebWamEnumPrivacyHighlightCategoryEnum","WAWebWamEnumPrivacyHighlightSurfaceEnum","WAWebWamEnumPrivacySettingsContactsBuckets","WAWebWamEnumPrivacySettingsValueType","WAWebWamEnumTypeOfGroupEnum","WAWebWamPrivateStatsUtils","WAWebWebDynamicSamplingTestEventWithSamplingWamEvent","WAWebWebDynamicSamplingTestEventWithoutSamplingWamEvent","WAWebWebcFtsStorageWamEvent","WAWebWebcStorageStatWamEvent","WAWebWid","asyncToGeneratorRuntime","gkx"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["WamDailyStats: "]);i=function(){return a};return a}function j(a){if(a.goldenBoxContactNarrativeAppearCount>0||a.goldenBoxContactDialogAppearCount>0||a.goldenBoxContactDialogSelectCount>0){var b=new(d("WAWebPrivacyHighlightDailyWamEvent").PrivacyHighlightDailyWamEvent)({privacyHighlightCategory:d("WAWebWamEnumPrivacyHighlightCategoryEnum").PRIVACY_HIGHLIGHT_CATEGORY_ENUM.E2EE,privacyHighlightSurface:d("WAWebWamEnumPrivacyHighlightSurfaceEnum").PRIVACY_HIGHLIGHT_SURFACE_ENUM.GOLDEN_BOX_CONTACT,narrativeAppearCount:a.goldenBoxContactNarrativeAppearCount,dialogAppearCount:a.goldenBoxContactDialogAppearCount,dialogSelectCount:a.goldenBoxContactDialogSelectCount});b.commit()}if(a.goldenBoxGroupNarrativeAppearCount>0||a.goldenBoxGroupDialogAppearCount>0||a.goldenBoxGroupDialogSelectCount>0){b=new(d("WAWebPrivacyHighlightDailyWamEvent").PrivacyHighlightDailyWamEvent)({privacyHighlightCategory:d("WAWebWamEnumPrivacyHighlightCategoryEnum").PRIVACY_HIGHLIGHT_CATEGORY_ENUM.E2EE,privacyHighlightSurface:d("WAWebWamEnumPrivacyHighlightSurfaceEnum").PRIVACY_HIGHLIGHT_SURFACE_ENUM.GOLDEN_BOX_GROUP,narrativeAppearCount:a.goldenBoxGroupNarrativeAppearCount,dialogAppearCount:a.goldenBoxGroupDialogAppearCount,dialogSelectCount:a.goldenBoxGroupDialogSelectCount});b.commit()}if(a.infoScreenGroupNarrativeAppearCount>0||a.infoScreenGroupDialogAppearCount>0||a.infoScreenGroupDialogSelectCount>0){b=new(d("WAWebPrivacyHighlightDailyWamEvent").PrivacyHighlightDailyWamEvent)({privacyHighlightCategory:d("WAWebWamEnumPrivacyHighlightCategoryEnum").PRIVACY_HIGHLIGHT_CATEGORY_ENUM.E2EE,privacyHighlightSurface:d("WAWebWamEnumPrivacyHighlightSurfaceEnum").PRIVACY_HIGHLIGHT_SURFACE_ENUM.INFO_SCREEN_GROUP,narrativeAppearCount:a.infoScreenGroupNarrativeAppearCount,dialogAppearCount:a.infoScreenGroupDialogAppearCount,dialogSelectCount:a.infoScreenGroupDialogSelectCount});b.commit()}if(a.chatsListNarrativeAppearCount>0||a.chatsListDialogAppearCount>0||a.chatsListDialogSelectCount>0){b=new(d("WAWebPrivacyHighlightDailyWamEvent").PrivacyHighlightDailyWamEvent)({privacyHighlightCategory:d("WAWebWamEnumPrivacyHighlightCategoryEnum").PRIVACY_HIGHLIGHT_CATEGORY_ENUM.E2EE,privacyHighlightSurface:d("WAWebWamEnumPrivacyHighlightSurfaceEnum").PRIVACY_HIGHLIGHT_SURFACE_ENUM.CHATS_LIST,narrativeAppearCount:a.chatsListNarrativeAppearCount,dialogAppearCount:a.chatsListDialogAppearCount,dialogSelectCount:a.chatsListDialogSelectCount});b.commit()}if(a.statusListNarrativeAppearCount>0||a.statusListDialogAppearCount>0||a.statusListDialogSelectCount>0){b=new(d("WAWebPrivacyHighlightDailyWamEvent").PrivacyHighlightDailyWamEvent)({privacyHighlightCategory:d("WAWebWamEnumPrivacyHighlightCategoryEnum").PRIVACY_HIGHLIGHT_CATEGORY_ENUM.E2EE,privacyHighlightSurface:d("WAWebWamEnumPrivacyHighlightSurfaceEnum").PRIVACY_HIGHLIGHT_SURFACE_ENUM.STATUS_LIST,narrativeAppearCount:a.statusListNarrativeAppearCount,dialogAppearCount:a.statusListDialogAppearCount,dialogSelectCount:a.statusListDialogSelectCount});b.commit()}if(a.callingScreenAudioNarrativeAppearCount>0||a.callingScreenAudioDialogAppearCount>0||a.callingScreenAudioDialogSelectCount>0){b=new(d("WAWebPrivacyHighlightDailyWamEvent").PrivacyHighlightDailyWamEvent)({privacyHighlightCategory:d("WAWebWamEnumPrivacyHighlightCategoryEnum").PRIVACY_HIGHLIGHT_CATEGORY_ENUM.E2EE,privacyHighlightSurface:d("WAWebWamEnumPrivacyHighlightSurfaceEnum").PRIVACY_HIGHLIGHT_SURFACE_ENUM.CALLING_SCREEN_AUDIO,narrativeAppearCount:a.callingScreenAudioNarrativeAppearCount,dialogAppearCount:a.callingScreenAudioDialogAppearCount,dialogSelectCount:a.callingScreenAudioDialogSelectCount});b.commit()}}function k(){var a=!d("WAWebMuteCollection").MuteCollection.globalReactionsMute(),b=!!d("WAWebUserPrefsNotifications").getIgnoreNondirectGroupMsg(),c=new(d("WAWebNotificationSettingWamEvent").NotificationSettingWamEvent)();c.set({groupReactionNotification:b&&a,groupShowNotification:b,groupSoundTone:d("WAWebWamEnumNotificationSoundTone").NOTIFICATION_SOUND_TONE.DEFAULT,inAppNotificationSound:d("WAWebUserPrefsNotifications").getGlobalSounds(),messageReactionNotification:a,messageShowNotification:d("WAWebUserPrefsNotifications").getGlobalNotifications(),messageSoundTone:d("WAWebWamEnumNotificationSoundTone").NOTIFICATION_SOUND_TONE.DEFAULT,showPreview:d("WAWebUserPrefsNotifications").getGlobalPreviews(),offlineNotification:d("WAWebUserPrefsNotifications").getGlobalOfflineNotifications()});c.commit()}function a(){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield m()),b=(yield p()),e=(yield t()),f=(yield v()),g=w(),h=(yield x());a=babelHelpers["extends"]({},a,b,e,g,h);d("WALogger").DEV(i()).devConsole(a);b=new(d("WAWebDailyWamEvent").DailyWamEvent)();b.set(a);b.commit();k();g=o();void new(d("WAWebLidMigrationDailyWamEvent").LidMigrationDailyWamEvent)(g).commit();h=new(d("WAWebWebcFtsStorageWamEvent").WebcFtsStorageWamEvent)();h.set({ftsTotalSize:f});h.commit();a=new(d("WAWebScreenLockSettingsDataWamEvent").ScreenLockSettingsDataWamEvent)();a.set(z());a.commit();b=d("WAWebUserPrefsMultiDevice").getPairingTimestamp();g=new(d("WAWebWebcStorageStatWamEvent").WebcStorageStatWamEvent)();g.set({webcStorageQuota:e.storageTotalSize,webcStorageUsage:e.storageUsed,webcAgeOfStorage:b!=null?d("WATimeUtils").unixTimeWithoutClockSkewCorrection()-b:-1,webcPackingEnabled:!1});void g.commit();f=(yield d("WAWebUserPrefsGeneral").getOfflineNotificationEngagement());if(f){new(d("WAWebNotificationEngagementWamEvent").NotificationEngagementWamEvent)({isWebBackgroundSyncNotif:!0,totalNotifShown:(h=f.totalNotifShown)!=null?h:0,totalNotifTapToOpen:(a=f.totalNotifTapToOpen)!=null?a:0}).commit();void d("WAWebUserPrefsGeneral").clearOfflineNotificationContentEngagement()}d("WAWebWamPrivateStatsUtils").logDailyPrivateStatsTestEvents();e=d("WAWebDailyAggregatedStatsCollection").DailyAggregatedStatsCollection.toArray().filter(function(a){return a.shouldBeSubmitted()});d("WAWebDailyAggregatedStatsCollection").DailyAggregatedStatsCollection.remove(e);e.forEach(function(a){var b=new(d("WAWebPttDailyWamEvent").PttDailyWamEvent)({pttCancelBroadcast:a.pttCancelBroadcast,pttCancelGroup:a.pttCancelGroup,pttCancelIndividual:a.pttCancelIndividual,pttCancelNewsletter:a.pttCancelNewsletter,pttDraftReviewBroadcast:a.pttDraftReviewBroadcast,pttDraftReviewGroup:a.pttDraftReviewGroup,pttDraftReviewIndividual:a.pttDraftReviewIndividual,pttDraftReviewNewsletter:a.pttDraftReviewNewsletter,pttFastplaybackBroadcast:a.pttFastplaybackBroadcast,pttFastplaybackGroup:a.pttFastplaybackGroup,pttFastplaybackIndividual:a.pttFastplaybackIndividual,pttFastplaybackNewsletter:a.pttFastplaybackNewsletter,pttLockBroadcast:a.pttLockBroadcast,pttLockGroup:a.pttLockGroup,pttLockIndividual:a.pttLockIndividual,pttLockNewsletter:a.pttLockNewsletter,pttOutOfChatBroadcast:a.pttOutOfChatBroadcast,pttOutOfChatGroup:a.pttOutOfChatGroup,pttOutOfChatIndividual:a.pttOutOfChatIndividual,pttOutOfChatNewsletter:a.pttOutOfChatNewsletter,pttPlaybackBroadcast:a.pttPlaybackBroadcast,pttPlaybackGroup:a.pttPlaybackGroup,pttPlaybackIndividual:a.pttPlaybackIndividual,pttPlaybackNewsletter:a.pttPlaybackNewsletter,pttRecordBroadcast:a.pttRecordBroadcast,pttRecordGroup:a.pttRecordGroup,pttRecordIndividual:a.pttRecordIndividual,pttRecordNewsletter:a.pttRecordNewsletter,pttSendBroadcast:a.pttSendBroadcast,pttSendGroup:a.pttSendGroup,pttSendIndividual:a.pttSendIndividual,pttSendNewsletter:a.pttSendNewsletter,pttPausedRecordBroadcast:a.pttPausedRecordBroadcast,pttPausedRecordGroup:a.pttPausedRecordGroup,pttPausedRecordIndividual:a.pttPausedRecordIndividual,pttPausedRecordNewsletter:a.pttPausedRecordNewsletter});b.commit();j(a);new(d("WAWebCommunityTabActionWamEvent").CommunityTabActionWamEvent)({communityTabGroupNavigations:a.communityTabGroupNavigations,communityTabToHomeViews:a.communityTabToHomeViews,communityTabViews:a.communityTabViews,communityTabViewsViaContextMenu:a.communityTabViewsViaContextMenu}).commit();a.communityHome!=null&&Object.keys(a.communityHome).forEach(function(b){var e=c("WAWebWid").user(b);if(e==null)return;b=a.communityHome[b];var f=b.communityHomeGroupDiscoveries,g=b.communityHomeGroupJoins,h=b.communityHomeGroupNavigations;b=b.communityHomeViews;new(d("WAWebCommunityHomeActionWamEvent").CommunityHomeActionWamEvent)({communityHomeId:e,communityHomeGroupDiscoveries:f,communityHomeGroupJoins:g,communityHomeGroupNavigations:h,communityHomeViews:b}).commit()});a.pnhCagActions!=null&&Object.keys(a.pnhCagActions).forEach(function(b){var c=a.pnhCagActions[b],e=c.pnhIndicatorClicksChat,f=c.pnhIndicatorClicksInfoScreen,g=c.reactionDeleteCount;c=c.reactionOpenTrayCount;new(d("WAWebPnhDailyWamEvent").PnhDailyWamEvent)({communityId:b,pnhIndicatorClicksChat:e,pnhIndicatorClicksInfoScreen:f,reactionDeleteCount:g,reactionOpenTrayCount:c,typeOfGroup:d("WAWebWamEnumTypeOfGroupEnum").TYPE_OF_GROUP_ENUM.DEFAULT_SUBGROUP}).commit()});a.pnhCtwaActions!=null&&Object.keys(a.pnhCtwaActions).forEach(function(b){new(d("WAWebPnhDailyCtwaWamEvent").PnhDailyCtwaWamEvent)({threadDs:d("WAWebChatThreadLoggingUtils").getThreadDs(a.startTime),threadId:b,matMessagesReceived:a.pnhCtwaActions[b]}).commit()});b=new(d("WAWebKeepInChatNotifWamEvent").KeepInChatNotifWamEvent)({kicGroupNotificationTaps:a.kicGroupNotificationTaps,kicGroupNotifications:a.kicGroupNotifications,kicNotificationTaps:a.kicNotificationTaps,kicNotifications:a.kicNotifications});b.commit();d("WAWebABProps").getABPropConfigValue("single_emoji_logging_enabled")&&new(d("WAWebWaFsSingleEmojiMessageDailyWamEvent").WaFsSingleEmojiMessageDailyWamEvent)({animatedEmojiSendCnt:a.animatedEmojiSend,emojiReplyCount:a.emojiReply,singleEmojiSendCnt:a.singleEmojiSend}).commit();d("WAWebSubmitChatLockDailyStats").submitChatLockDailyStats(a)});void new(d("WAWebWebDynamicSamplingTestEventWithoutSamplingWamEvent").WebDynamicSamplingTestEventWithoutSamplingWamEvent)().commit();void new(d("WAWebWebDynamicSamplingTestEventWithSamplingWamEvent").WebDynamicSamplingTestEventWithSamplingWamEvent)().commit()});return l.apply(this,arguments)}function m(){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield d("WAWebUserPrefsInfoStore").deviceInfo.get());return{languageCode:a.lg,locationCode:a.lc,osBuildNumber:a.osBuild,simMcc:parseInt(a.mcc,10),simMnc:parseInt(a.mnc,10)}});return n.apply(this,arguments)}function o(){var a=[];a.push("con");a.push("id");a.push("ss");a.push("sk");d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()&&a.push("ch_jid");d("WAWebUserPrefsFavoritesLidMigration").isFavoritesMigrationComplete()&&a.push("fav");d("WAWebUserPrefsCartLidMigration").isCartLidMigrationComplete()&&a.push("cart");d("WAWebUserPrefsLabelAssociationsLidMigration").isLabelAssociationsMigrationComplete()&&a.push("lab");return{completedMigrations:a.join(",")}}function p(){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a,b=d("WAWebUserPrefsGeneral").getUserPrivacySettings(),c={receiptsEnabled:b.readReceipts!=="none"},e=(yield d("WAWebApiPrivacyDisallowedList").queryDisallowedLists());c.privacySettingsAbout=r(b.about);c.privacySettingsAboutExceptNum=b.about==="contact_blacklist"?s((a=e.about)==null?void 0:a.disallowedList.length):null;c.privacySettingsGroups=r(b.groupAdd);c.privacySettingsGroupsExceptNum=b.groupAdd==="contact_blacklist"?s((a=e.groupadd)==null?void 0:a.disallowedList.length):null;c.privacySettingsLastSeen=r(b.lastSeen);c.privacySettingsLastSeenExceptNum=b.lastSeen==="contact_blacklist"?s((a=e.last)==null?void 0:a.disallowedList.length):null;c.privacySettingsProfilePhoto=r(b.profilePicture);c.privacySettingsProfilePhotoExceptNum=b.profilePicture==="contact_blacklist"?s((a=e.profile)==null?void 0:a.disallowedList.length):null;b=d("WAWebEphemeralityResolver").getEphemeralDurationForUser(d("WAWebContactCollection").ContactCollection.getMeContact());c.defaultDisappearingDuration=(e=b)!=null?e:0;if(d("WAWebABProps").getABPropConfigValue("dm_initiator_trigger_daily_logs")){c.isDefaultDisappearingMessagingUser=c.defaultDisappearingDuration!==0;a=(yield d("WAWebApiPrivacyEphemerality").queryEphemeralityDailyLogInfo());b=a.isEphemeralMessagingUser;e=a.countEphemeralThreadsEnabledByMe;a=a.countEphemeralThreads;c.isEphemeralMessagingUser=b;c.countEphemeralThreads=a;c.countEphemeralThreadsEnabledByMe=e}return c});return q.apply(this,arguments)}function r(a){if(a==null)return null;switch(a){case"all":return d("WAWebWamEnumPrivacySettingsValueType").PRIVACY_SETTINGS_VALUE_TYPE.EVERYONE;case"contacts":return d("WAWebWamEnumPrivacySettingsValueType").PRIVACY_SETTINGS_VALUE_TYPE.MY_CONTACTS;case"contact_blacklist":return d("WAWebWamEnumPrivacySettingsValueType").PRIVACY_SETTINGS_VALUE_TYPE.MY_CONTACTS_EXCEPT;case"none":return d("WAWebWamEnumPrivacySettingsValueType").PRIVACY_SETTINGS_VALUE_TYPE.NOBODY}}function s(a){if(a==null)return null;if(a===0)return d("WAWebWamEnumPrivacySettingsContactsBuckets").PRIVACY_SETTINGS_CONTACTS_BUCKETS.B0;if(a<5)return d("WAWebWamEnumPrivacySettingsContactsBuckets").PRIVACY_SETTINGS_CONTACTS_BUCKETS.B1;if(a<10)return d("WAWebWamEnumPrivacySettingsContactsBuckets").PRIVACY_SETTINGS_CONTACTS_BUCKETS.B5;if(a<15)return d("WAWebWamEnumPrivacySettingsContactsBuckets").PRIVACY_SETTINGS_CONTACTS_BUCKETS.B10;if(a<20)return d("WAWebWamEnumPrivacySettingsContactsBuckets").PRIVACY_SETTINGS_CONTACTS_BUCKETS.B15;if(a<30)return d("WAWebWamEnumPrivacySettingsContactsBuckets").PRIVACY_SETTINGS_CONTACTS_BUCKETS.B20;if(a<40)return d("WAWebWamEnumPrivacySettingsContactsBuckets").PRIVACY_SETTINGS_CONTACTS_BUCKETS.B30;if(a<50)return d("WAWebWamEnumPrivacySettingsContactsBuckets").PRIVACY_SETTINGS_CONTACTS_BUCKETS.B40;if(a<60)return d("WAWebWamEnumPrivacySettingsContactsBuckets").PRIVACY_SETTINGS_CONTACTS_BUCKETS.B50;if(a<70)return d("WAWebWamEnumPrivacySettingsContactsBuckets").PRIVACY_SETTINGS_CONTACTS_BUCKETS.B60;if(a<80)return d("WAWebWamEnumPrivacySettingsContactsBuckets").PRIVACY_SETTINGS_CONTACTS_BUCKETS.B70;if(a<90)return d("WAWebWamEnumPrivacySettingsContactsBuckets").PRIVACY_SETTINGS_CONTACTS_BUCKETS.B80;return a<100?d("WAWebWamEnumPrivacySettingsContactsBuckets").PRIVACY_SETTINGS_CONTACTS_BUCKETS.B90:d("WAWebWamEnumPrivacySettingsContactsBuckets").PRIVACY_SETTINGS_CONTACTS_BUCKETS.B100}function t(){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=c("WAWebLidAwareContactsDB").equals(["isAddressBookContact"],1).then(function(a){return a.filter(function(a){return!c("WAWebWid").isLid(a.id)||d("WAWebLidContactsGatingUtils").isLidContactOneOnOneChatEnabled()}).length}),e=d("WAStorageEstimator").estimateStorage(),f=d("WAWebMediaStore").LruMediaStore.count(),g=c("WAWebLidAwareContactsDB").count(),i=d("WAWebContactCollection").ContactCollection.getFilteredContacts({includeLidContacts:d("WAWebLidContactsGatingUtils").isLidContactOneOnOneChatEnabled()}).length;e=(yield (h||(h=b("Promise"))).all([e,a,f,g]));a=e[0];f=e[1];g=e[2];e=e[3];var j=0,k=0,l=0;if(a.success){a=a.value;var m=a.quota;a=a.usage;j=m-a;k=m;l=a}return{addressbookWhatsappSize:A(f,10),storageAvailSize:A(j,100),storageTotalSize:A(k,100),storageUsed:A(l,100),mediaFolderFileCount:g,webcContactsTableSize:A(e,10),webcFilteredContactsSize:i}});return u.apply(this,arguments)}function v(){return d("WAWebEstimateFtsStorageApi").getEstimatedFTSDbSize()}function w(){var a=d("WAWebWamEnumNotificationSettingType").NOTIFICATION_SETTING_TYPE.UNKNOWN;if(window.Notification!=null)switch(window.Notification.permission){case d("WAWebNotificationConstants").PERMISSION_ALLOWED:a=d("WAWebWamEnumNotificationSettingType").NOTIFICATION_SETTING_TYPE.ALLOWED;break;case d("WAWebNotificationConstants").PERMISSION_DENIED:a=d("WAWebWamEnumNotificationSettingType").NOTIFICATION_SETTING_TYPE.BLOCKED;break;default:a=d("WAWebWamEnumNotificationSettingType").NOTIFICATION_SETTING_TYPE.UNKNOWN}var b;d("WAWebContactManagementGating").contactManagementEnabled()&&(b=d("WAWebUserPrefsContactManagement").getSyncToAddressbookDefaultSetting());return{osNotificationSetting:a,isContactSyncToOsDefaultOn:b}}function x(){return y.apply(this,arguments)}function y(){y=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=[],b=[],c=window.navigator.mediaCapabilities;if(c!=null){var d={width:800,height:600,bitrate:1e4,framerate:30},e={type:"record"},f={type:"file"},g={contentType:'video/mp4; codecs="avc1.42000a"'},h={contentType:'video/mp4; codecs="hev1.1.6.L93.B0"'},i={contentType:'video/mp4; codecs="av01.0.00M.08"'},j={contentType:'video/mp4; codecs="vp09.00.51.08.01.01.01.01.00"'},k=babelHelpers["extends"]({},e,{video:babelHelpers["extends"]({},g,d)}),l=babelHelpers["extends"]({},e,{video:babelHelpers["extends"]({},h,d)}),m=babelHelpers["extends"]({},e,{video:babelHelpers["extends"]({},i,d)});e=babelHelpers["extends"]({},e,{video:babelHelpers["extends"]({},j,d)});g=babelHelpers["extends"]({},f,{video:babelHelpers["extends"]({},g,d)});h=babelHelpers["extends"]({},f,{video:babelHelpers["extends"]({},h,d)});i=babelHelpers["extends"]({},f,{video:babelHelpers["extends"]({},i,d)});f=babelHelpers["extends"]({},f,{video:babelHelpers["extends"]({},j,d)});if(c.encodingInfo!=null){try{(yield c.encodingInfo(k)).supported&&a.push("avc")}catch(a){}try{(yield c.encodingInfo(l)).supported&&a.push("hevc")}catch(a){}try{(yield c.encodingInfo(m)).supported&&a.push("av1")}catch(a){}try{(yield c.encodingInfo(e)).supported&&a.push("vp9")}catch(a){}}if(c.decodingInfo!=null){try{(yield c.decodingInfo(g)).supported&&b.push("avc")}catch(a){}try{(yield c.decodingInfo(h)).supported&&b.push("hevc")}catch(a){}try{(yield c.decodingInfo(i)).supported&&b.push("av1")}catch(a){}try{(yield c.decodingInfo(f)).supported&&b.push("vp9")}catch(a){}}}return{supportedEncoders:a.join(","),supportedDecoders:b.join(",")}});return y.apply(this,arguments)}function z(){return{screenAutoLockDuration:d("WAWebUserPrefsScreenLock").getScreenLockDurationForLogging()}}function A(a,b){return c("gkx")("26258")?Math.round(a/b)*b:a}g.logDailyStats=a;g.getLidMigrationStatus=o}),98); __d("WAWebApiTextStatus",["Promise","WATimeUtils","WAWebLidAwareContactsDB","WAWebModelStorageUtils","WAWebTextStatusGatingUtils","WAWebTextStatusUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function a(){var a=d("WATimeUtils").unixTime();return!d("WAWebTextStatusGatingUtils").receiveTextStatusEnabled()?(h||(h=b("Promise"))).resolve():d("WAWebModelStorageUtils").getStorage().lock(["contact"],b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var b=(yield c("WAWebLidAwareContactsDB").lessThan(["textStatusExpiryTs"],a));if(!b||b.length===0)return;b=b.map(function(a){return{id:a.id,textStatusString:void 0,textStatusEmoji:void 0,textStatusExpiryTs:void 0,textStatusEphemeralDuration:void 0,textStatusLastUpdateTime:d("WAWebTextStatusUtils").CLEAR_TEXT_STATUS_LAST_UPDATE_TIME_VAL}});return c("WAWebLidAwareContactsDB").bulkCreateOrMerge(b)}))}g.updateExpiredTextStatusOfContact=a}),98); __d("WAWebUtmBizPrefs",["WAWebUserPrefsKeys","WAWebUserPrefsStore"],(function(a,b,c,d,e,f,g){function a(a,b){var e=h(),f=Date.now();e[a]=babelHelpers["extends"]({addedTime:f},b);c("WAWebUserPrefsStore").setUser(d("WAWebUserPrefsKeys").KEYS.CHAT_UTM,JSON.stringify(e))}function b(a){var b=h();delete b[a];c("WAWebUserPrefsStore").setUser(d("WAWebUserPrefsKeys").KEYS.CHAT_UTM,JSON.stringify(b))}function e(a){var b=c("WAWebUserPrefsStore").getUser(d("WAWebUserPrefsKeys").KEYS.CHAT_UTM);if(b==null)return null;try{return JSON.parse(b)[a]}catch(a){return null}}function h(){var a=c("WAWebUserPrefsStore").getUser(d("WAWebUserPrefsKeys").KEYS.CHAT_UTM);if(a==null)return{};try{return(a=JSON.parse(a))!=null?a:{}}catch(a){return{}}}function f(){c("WAWebUserPrefsStore").setUser(d("WAWebUserPrefsKeys").KEYS.CHAT_UTM,JSON.stringify({}))}g.persistUtmtoLocalStorage=a;g.removeUtmFromLocalStorage=b;g.getUtmFromLocalStorage=e;g.getAllUtmsFromLocalStorage=h;g.clearAllUtmFromLocalStorage=f}),98); __d("WAWebUtmBizUtils",["WAWebBizGatingUtils","WAWebMsgGetters","WAWebStateUtils"],(function(a,b,c,d,e,f,g){function a(a,b){return a.contact.isEnterprise&&!j(b)&&!h(a,b)}function h(a,b){a=i(a);if(a==null||a.t==null)return!1;a=a.t*1e3;return a>b.addedTime}function i(a){a=d("WAWebStateUtils").unproxy(a);for(var b=a.msgs.length-1;b>=0;b--){var c=a.msgs.at(b);if(c&&!d("WAWebMsgGetters").getIsSentByMe(c))return c}return void 0}function j(a){var b=Date.now(),c=d("WAWebBizGatingUtils").utmTrackingExpirationInHours()*60*60*1e3;return a.addedTime+c<=b}g.isUtmValid=a;g.hasUtmExpired=j}),98); __d("WAWebCleanUtmJob",["WAJobOrchestratorTypes","WAPromiseCallSync","WAWebOrchestratorNonPersistedJob","WAWebUtmBizPrefs","WAWebUtmBizUtils"],(function(a,b,c,d,e,f,g){function a(){return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("cleanExpiredUtm",function(){return h()},{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.BEST_EFFORT}).waitUntilCompleted()}function h(){return d("WAPromiseCallSync").promiseCallSync(function(){var a=d("WAWebUtmBizPrefs").getAllUtmsFromLocalStorage();Object.keys(a).forEach(function(b){var c=a[b];d("WAWebUtmBizUtils").hasUtmExpired(c)&&d("WAWebUtmBizPrefs").removeUtmFromLocalStorage(b)})})}g.cleanExpiredUtmJob=a}),98); __d("WAWebDBPurgeExpiredRecords",["Promise","WAWeb-moment","WAWebDBMapOrphansToProviders","WAWebDBOrphanDbSerialization","WAWebMsgType","WAWebSchemaMessage","WAWebSchemaMessageOrphans","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function a(a,b){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){a=c("WAWeb-moment")().subtract(a,"days").unix();var f=c("WAWeb-moment")().subtract(e,"days").unix();e=(yield d("WAWebSchemaMessageOrphans").getMessageOrphanTable().between(["t"],0,a));a=new Set(e.map(function(a){return a.parentMsgKey}));a=(yield d("WAWebSchemaMessage").getMessageTable().bulkGet(Array.from(a)));var g=new Set(a.filter(function(a){return a&&a.type===d("WAWebMsgType").MSG_TYPE.UNKNOWN}).map(function(a){return a==null?void 0:a.id}));a=e.filter(function(a){return!g.has(a.parentMsgKey)||a.t<f}).map(d("WAWebDBOrphanDbSerialization").orphanFromDbRow);e=(yield d("WAWebDBMapOrphansToProviders").mapOrphansToProviders(a));var i=[];for(e of e.entries()){var j=e[0],k=e[1];j.onRecordsPurged!=null&&i.push(j.onRecordsPurged(k))}yield (h||(h=b("Promise"))).all(i);j=a.map(function(a){return a.msgKey});return d("WAWebSchemaMessageOrphans").getMessageOrphanTable().bulkRemove(j)});return i.apply(this,arguments)}g.purgeExpiredOrphanRecords=a}),98); __d("WAWebDownloads3PDSignalsDatabaseApi",["WATimeUtils","WAWebSchemaDownload3PDSignals","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h=30,i=30;function a(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){return d("WAWebSchemaDownload3PDSignals").getDownload3PDSignalsTable().createOrReplace(a)});return j.apply(this,arguments)}function c(){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){return d("WAWebSchemaDownload3PDSignals").getDownload3PDSignalsTable().all()});return k.apply(this,arguments)}function e(){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=h;a=d("WATimeUtils").unixTimeMs()-a*d("WATimeUtils").DAY_MILLISECONDS;return d("WAWebSchemaDownload3PDSignals").getDownload3PDSignalsTable().greaterThan(["timestamp"],a)});return l.apply(this,arguments)}function f(){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=d("WATimeUtils").unixTimeMs()-i*d("WATimeUtils").DAY_MILLISECONDS;a=(yield d("WAWebSchemaDownload3PDSignals").getDownload3PDSignalsTable().lessThan(["timestamp"],a));if(a.length===0)return;yield d("WAWebSchemaDownload3PDSignals").getDownload3PDSignalsTable().bulkRemove(a.map(function(a){return a.id}))});return m.apply(this,arguments)}g.addOrEdit3PDSignal=a;g.getAll3PDSignals=c;g.getRecent3PDSignals=e;g.cleanup3PDSignalsTable=f}),98); __d("WAWebReportDbVerionsJob",["WAJobOrchestratorTypes","WAWebLocalSchemaVersions","WAWebOrchestratorNonPersistedJob","WAWebSchemaVersions","WAWebWebDbVersionNonAnonymousWamEvent","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(){return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("reportDbVersions",b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield d("WAWebLocalSchemaVersions").getLocalSchemaVersions());a.forEach(function(a,b){new(d("WAWebWebDbVersionNonAnonymousWamEvent").WebDbVersionNonAnonymousWamEvent)({webDbName:d("WAWebSchemaVersions").convertDBName(b),webDbVersionNumber:a}).commit()})}),{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.BEST_EFFORT,maxTimeoutMs:1e3*30}).waitUntilCompleted()}g.reportDbVersionsJob=a}),98); __d("WAWebSyncdWamUtils",["WABase64","WASyncdConst","WATimeUtils","WAWebGetSyncKey","WAWebSchemaSyncActions","WAWebWamEnumMutationCountBucket","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){function a(){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=new Map(),b=(yield d("WAWebSchemaSyncActions").getSyncActionsTable().all());b.map(function(b){var c,e=JSON.parse(b.index)[0];c=(c=a.get(e))!=null?c:{action:e,applied:0,invalid:0,orphan:0,unsupported:0,failed:0};switch(b.actionState){case d("WASyncdConst").SyncActionState.Success:case d("WASyncdConst").SyncActionState.Skipped:c.applied++;break;case d("WASyncdConst").SyncActionState.Malformed:c.invalid++;break;case d("WASyncdConst").SyncActionState.Orphan:c.orphan++;break;case d("WASyncdConst").SyncActionState.Unsupported:c.unsupported++;break;case d("WASyncdConst").SyncActionState.Failed:c.failed++;break}a.set(e,c)});return a});return h.apply(this,arguments)}function e(a){if(a<0)throw c("err")("cannot convert negative number to a bucket");else if(a===0)return d("WAWebWamEnumMutationCountBucket").MUTATION_COUNT_BUCKET.ZERO;else if(a===1)return d("WAWebWamEnumMutationCountBucket").MUTATION_COUNT_BUCKET.ONE;else if(a<10)return d("WAWebWamEnumMutationCountBucket").MUTATION_COUNT_BUCKET.LT10;else if(a<100)return d("WAWebWamEnumMutationCountBucket").MUTATION_COUNT_BUCKET.LT100;else if(a<500)return d("WAWebWamEnumMutationCountBucket").MUTATION_COUNT_BUCKET.LT500;else if(a<1e3)return d("WAWebWamEnumMutationCountBucket").MUTATION_COUNT_BUCKET.LT1K;else if(a<5e3)return d("WAWebWamEnumMutationCountBucket").MUTATION_COUNT_BUCKET.LT5K;else return d("WAWebWamEnumMutationCountBucket").MUTATION_COUNT_BUCKET.GTE5K}function i(){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield d("WAWebSchemaSyncActions").getSyncActionsTable().get('["primary_version","session_start"]'));return a==null?void 0:a.timestamp});return j.apply(this,arguments)}function f(){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield d("WAWebGetSyncKey").getAllSyncKeysInTransaction()),b=(yield d("WAWebSchemaSyncActions").getSyncActionsTable().all()),c=(yield i());c=c==null?void 0:Math.round((d("WATimeUtils").unixTimeMs()-c)/(1e3*3600*24));return l(a,b,c)});return k.apply(this,arguments)}function l(a,b,c){b=b.map(function(a){return d("WABase64").encodeB64(a.keyId)});var e=Array.from(new Set(b)),f=new Map();for(b of b)f.set(b,(f.get(b)||0)+1);b=Array.from(f.values()).sort();f=b.length;var g=Math.floor(f*.8)-1;f=Math.floor(f*.95)-1;return{totalKeyCount:a.length,keysUsedInSnapshotCount:e.length,p80MuationsPerKey:b[g],p95MuationsPerKey:b[f],syncdSessionLengthDays:c}}g.generateActionStatCounts=a;g.convertToBucket=e;g.getKeyStats=f;g.getKeyStatsInternal=l}),98); __d("WAWebSyncdReportKeyStatsJob",["WAJobOrchestratorTypes","WAWebOrchestratorNonPersistedJob","WAWebSyncdKeyCountWamEvent","WAWebSyncdWamUtils","asyncToGeneratorRuntime","gkx"],(function(a,b,c,d,e,f,g){function a(){return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("reportSyncdKeyStats",b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(c("gkx")("26258"))return;var a=(yield d("WAWebSyncdWamUtils").getKeyStats()),b={keysUsedInSnapshotCount:a.keysUsedInSnapshotCount,p80MuationsPerKey:a.p80MuationsPerKey,p95MuationsPerKey:a.p95MuationsPerKey,totalKeyCount:a.totalKeyCount};a.syncdSessionLengthDays!=null&&(b.syncdSessionLengthDays=a.syncdSessionLengthDays);new(d("WAWebSyncdKeyCountWamEvent").SyncdKeyCountWamEvent)(b).commit()}),{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.BEST_EFFORT,maxTimeoutMs:1e3*30}).waitUntilCompleted()}g.reportSyncdKeyStatsJob=a}),98); __d("WAWebSyncdReportSyncdStatJob",["WAJobOrchestratorTypes","WAWebMdAppStateSyncMutationStatsWamEvent","WAWebOrchestratorNonPersistedJob","WAWebSyncdWamUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("reportSyncdStats",b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield d("WAWebSyncdWamUtils").generateActionStatCounts());for(a of a.values()){var b;new(d("WAWebMdAppStateSyncMutationStatsWamEvent").MdAppStateSyncMutationStatsWamEvent)({syncdAction:a.action,applied:(b=d("WAWebSyncdWamUtils")).convertToBucket(a.applied),invalid:b.convertToBucket(a.invalid),orphan:b.convertToBucket(a.orphan),unsupported:b.convertToBucket(a.unsupported),failed:b.convertToBucket(a.failed)}).commit()}}),{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.BEST_EFFORT,maxTimeoutMs:1e3*30}).waitUntilCompleted()});return h.apply(this,arguments)}g.reportSyncdStatsJob=a}),98); __d("WAWebTasksDefinitions",["$InternalEnum","Promise","WALogger","WATaskScheduler","WATimeUtils","WAWebABProps","WAWebABPropsLocalStorage","WAWebAbPropsSyncJob","WAWebApiChat","WAWebApiParticipantStore","WAWebApiTasksScheduledTime","WAWebApiTextStatus","WAWebBizGatingUtils","WAWebCleanUtmJob","WAWebContactSyncBridge","WAWebDBPurgeExpiredRecords","WAWebDBReportingTokenUtils","WAWebDownloads3PDSignalsDatabaseApi","WAWebFetchQuickPromotions","WAWebLogDailyStatsJob","WAWebLogHistorySyncStatusAfterPairingJob","WAWebMessagingGatingUtils","WAWebMobilePlatforms","WAWebNewsletterCleanupTasks","WAWebNonAddressBookContactsJob","WAWebNonMessageDataRequestMediaHandlingUtils","WAWebPersistedJobDefinitions","WAWebPersistedJobManager","WAWebReportDbVerionsJob","WAWebRestartRecentSyncJob","WAWebSyncContactsJob","WAWebSyncdAntiTampering","WAWebSyncdReportKeyStatsJob","WAWebSyncdReportSyncdStatJob","WAWebSyncdRequestAllSyncdMissingKeysJob","WAWebSyncdSyncAllCollectionsJob","WAWebUserPrefsHistorySync","WAWebUserPrefsMultiDevice","asyncToGeneratorRuntime","cr:4857","cr:4940","gkx"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["maybeRegisterTask: registering task ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["fetchQuickPromotions: fetching quick promotions"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["Failed to cleanup 3PD Signals table: ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["Failed to cleanup reporting token table: ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] do not schedule job for logging history sync status as we've logged for more than 4 times."]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["Failed to clean expired UTM: ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["Failed to delete the expired orphan reactions with error: ",""]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["Failed to delete the expired orphan add-on messages with error: ",""]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: syncdPeriodicSyncDays is 0, skipping sync"]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncContacts: contact sync failed, error: ",""]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["Failed to sync non-address book contacts with error: ",""]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["RotateKeyTask skip first run"]);t=function(){return a};return a}function u(){var a=babelHelpers.taggedTemplateLiteralLoose(["Failed to log daily stats: ",""]);u=function(){return a};return a}function v(){var a=babelHelpers.taggedTemplateLiteralLoose(["Failed to update the expired text status of contacts with error: ",""]);v=function(){return a};return a}function w(){var a=babelHelpers.taggedTemplateLiteralLoose(["Update expired text status skip first run"]);w=function(){return a};return a}function x(){var a=babelHelpers.taggedTemplateLiteralLoose(["Failed to delete the expired TcTokens with error: ",""]);x=function(){return a};return a}function y(){var a=babelHelpers.taggedTemplateLiteralLoose(["CleanTcToken skip first run"]);y=function(){return a};return a}var z=b("$InternalEnum")({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",REPORT_SYNCD_KEY_STATS:"reportSyncdKeyStats",SYNCD_SYNC_ALL_COLLECTIONS:"syncdSyncAllCollections",CLEAN_ORPHAN_ADD_ONS:"cleanOrphanAddOns",CLEAN_PAST_PARTICIPANTS:"cleanPastParticipants",CLEAN_EXPIRED_UTM:"cleanExpiredUtm",SEND_NON_MESSAGE_DATA_REQUEST:"sendNonMessageDataRequest",LOG_HISTORY_SYNC_STATUS_AFTER_PAIRING:"logHistorySyncStatusAfterPairing",DELETE_NEWSLETTER_PREVIEW_CHATS:"deleteNewsletterPreviewChats",REPORT_DB_VERSIONS:"reportDbVersions",UPDATE_EXPIRED_TEXT_STATUS:"updateExpiredTextStatus",RESTART_RECENT_SYNC:"restartRecentSync",CLEANUP_REPORTING_TABLE:"cleanupReportingTable",CLEANUP_3PD_SIGNALS_TABLE:"cleanup3PDSignalsTable",FETCH_QUICK_PROMOTIONS:"fetchQuickPromotions"}),A=[z.CLEAN_TC_TOKENS,z.LOG_DAILY_STATS,z.ROTATE_KEY,z.SYNC_AB_PROPS,z.SYNC_CONTACTS,z.MONITOR_DB_STORAGE,z.REPORT_SYNCD_ACTION_STAT,z.LT_HASH_CHECK,z.REQUEST_ALL_SYNCD_MISSING_KEYS,z.REPORT_SYNCD_KEY_STATS,z.SYNCD_SYNC_ALL_COLLECTIONS,z.CLEAN_ORPHAN_ADD_ONS,z.CLEAN_EXPIRED_UTM,z.SEND_NON_MESSAGE_DATA_REQUEST,z.LOG_HISTORY_SYNC_STATUS_AFTER_PAIRING,z.DELETE_NEWSLETTER_PREVIEW_CHATS,z.REPORT_DB_VERSIONS,z.UPDATE_EXPIRED_TEXT_STATUS,z.RESTART_RECENT_SYNC,z.CLEANUP_REPORTING_TABLE],B=[z.FETCH_QUICK_PROMOTIONS,z.CLEANUP_3PD_SIGNALS_TABLE],C=[z.LOG_DB_ROW_COUNTS];function D(a){switch(a){case z.MONITOR_DB_STORAGE:return function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(c("gkx")("26258"))return d("WATaskScheduler").DO_NOT_RESCHEDULE;a=(yield b("cr:4857")==null?void 0:b("cr:4857").shouldMonitorDbStorageUsageJob());return a?d("WATimeUtils").HOUR_SECONDS:d("WATaskScheduler").DO_NOT_RESCHEDULE});return function(b){return a.apply(this,arguments)}}();case z.CLEAN_TC_TOKENS:return function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a)d("WALogger").LOG(y());else try{yield d("WAWebApiChat").pruneExpiredTcTokens(),yield d("WAWebApiChat").pruneExpiredOrphanTcTokens()}catch(a){d("WALogger").ERROR(x(),a).verbose().devConsole(a)}return d("WATimeUtils").DAY_SECONDS});return function(b){return a.apply(this,arguments)}}();case z.UPDATE_EXPIRED_TEXT_STATUS:return function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a)d("WALogger").LOG(w());else try{yield d("WAWebApiTextStatus").updateExpiredTextStatusOfContact()}catch(a){d("WALogger").ERROR(v(),a).verbose().devConsole(a)}return d("WATimeUtils").DAY_SECONDS});return function(b){return a.apply(this,arguments)}}();case z.LOG_DAILY_STATS:return function(){return d("WAWebLogDailyStatsJob").logDailyStatsJob()["catch"](function(a){d("WALogger").ERROR(u(),a).verbose().devConsole(a)}).then(function(){return d("WATimeUtils").DAY_SECONDS})};case z.LOG_DB_ROW_COUNTS:if(!c("gkx")("26258")){var e=120,f=7200;return function(){self.setTimeout(function(){b("cr:4940")==null?void 0:b("cr:4940").logStorageTableRowCounts()},e*1e3);return(h||(h=b("Promise"))).resolve(f)}}else break;case z.ROTATE_KEY:return function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a?d("WALogger").LOG(t()):yield d("WAWebPersistedJobManager").getJobManager().waitUntilCompleted(d("WAWebPersistedJobDefinitions").jobSerializers.rotateKey());return 27*d("WATimeUtils").DAY_SECONDS});return function(b){return a.apply(this,arguments)}}();case z.SYNC_AB_PROPS:return function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a||(yield d("WAWebAbPropsSyncJob").syncABPropsTask());return d("WAWebABPropsLocalStorage").getRefresh()});return function(b){return a.apply(this,arguments)}}();case z.SYNC_CONTACTS:return function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!a){try{yield d("WAWebNonAddressBookContactsJob").getNonAddressBookContactsAndMarkAllContactsDirty()}catch(a){d("WALogger").ERROR(s(),a).verbose().devConsole(a)}try{yield d("WAWebContactSyncBridge").doFullContactSync()}catch(a){d("WALogger").ERROR(r(),a).verbose().tags("non-sad","contact-sync").sendLogs("syncContacts: contact sync failed")}}return d("WAWebSyncContactsJob").getContactSyncRefreshSeconds()});return function(b){return a.apply(this,arguments)}}();case z.REPORT_SYNCD_ACTION_STAT:return function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a||(yield d("WAWebSyncdReportSyncdStatJob").reportSyncdStatsJob());return d("WATimeUtils").DAY_SECONDS});return function(b){return a.apply(this,arguments)}}();case z.LT_HASH_CHECK:return function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=d("WAWebABProps").getABPropConfigValue("lthash_check_hours");if(b===0)return 24*d("WATimeUtils").HOUR_SECONDS;a||(yield d("WAWebSyncdAntiTampering").checkLtHash("abc"));return b*d("WATimeUtils").HOUR_SECONDS});return function(b){return a.apply(this,arguments)}}();case z.REQUEST_ALL_SYNCD_MISSING_KEYS:return function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a||(yield d("WAWebSyncdRequestAllSyncdMissingKeysJob").requestAllSyncdMissingKeysJob());return d("WATimeUtils").HOUR_SECONDS*6});return function(b){return a.apply(this,arguments)}}();case z.REPORT_SYNCD_KEY_STATS:return function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a||(yield d("WAWebSyncdReportKeyStatsJob").reportSyncdKeyStatsJob());return c("gkx")("26258")?d("WATimeUtils").DAY_SECONDS*3:d("WATimeUtils").DAY_SECONDS});return function(b){return a.apply(this,arguments)}}();case z.SYNCD_SYNC_ALL_COLLECTIONS:return function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=d("WAWebABProps").getABPropConfigValue("syncd_periodic_sync_days");if(b===0){d("WALogger").LOG(q());return d("WATimeUtils").DAY_SECONDS}a||(yield d("WAWebSyncdSyncAllCollectionsJob").syncdSyncAllCollectionsJob());return d("WATimeUtils").DAY_SECONDS*b});return function(b){return a.apply(this,arguments)}}();case z.CLEAN_ORPHAN_ADD_ONS:var g=30,i=90;return b("asyncToGeneratorRuntime").asyncToGenerator(function*(){try{yield d("WAWebDBPurgeExpiredRecords").purgeExpiredOrphanRecords(g,i)}catch(a){d("WALogger").ERROR(p(),a).verbose().devConsole(a)}return d("WATimeUtils").DAY_SECONDS});case z.CLEAN_PAST_PARTICIPANTS:return b("asyncToGeneratorRuntime").asyncToGenerator(function*(){try{yield d("WAWebApiParticipantStore").pruneExpiredPastParticipants()}catch(a){d("WALogger").ERROR(o(),a).verbose().devConsole(a)}return d("WATimeUtils").DAY_SECONDS});case z.CLEAN_EXPIRED_UTM:return function(){return!d("WAWebBizGatingUtils").isUtmTrackingEnabled()?(h||(h=b("Promise"))).resolve(d("WATaskScheduler").DO_NOT_RESCHEDULE):d("WAWebCleanUtmJob").cleanExpiredUtmJob()["catch"](function(a){d("WALogger").ERROR(n(),a).verbose().devConsole(a)}).then(function(){return d("WATimeUtils").DAY_SECONDS})};case z.SEND_NON_MESSAGE_DATA_REQUEST:return b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield d("WAWebNonMessageDataRequestMediaHandlingUtils").retryNonMessageDataRequestJob();return d("WATimeUtils").HOUR_SECONDS*23});case z.DELETE_NEWSLETTER_PREVIEW_CHATS:return b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield d("WAWebNewsletterCleanupTasks").deletePreviewNewsletters();return d("WATimeUtils").HOUR_SECONDS*4});case z.REPORT_DB_VERSIONS:return b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield d("WAWebReportDbVerionsJob").reportDbVersionsJob();return d("WATimeUtils").DAY_SECONDS*3});case z.LOG_HISTORY_SYNC_STATUS_AFTER_PAIRING:return b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=d("WAWebUserPrefsMultiDevice").getPairingTimestamp();if(a!=null){var b;b=(b=(yield d("WAWebUserPrefsHistorySync").getHistorySyncStatusAfterPairingLoggingCount()))!=null?b:0;if(b>=5){d("WALogger").LOG(m());return d("WATaskScheduler").DO_NOT_RESCHEDULE}yield d("WAWebLogHistorySyncStatusAfterPairingJob").logHistorySyncStatusAfterPairingJob(a,b);return b===0?d("WATimeUtils").MINUTE_SECONDS*5:d("WATimeUtils").MINUTE_SECONDS*10}return 10});case z.RESTART_RECENT_SYNC:return b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=d("WAWebUserPrefsMultiDevice").getPairingTimestamp();if(a!=null){a=(d("WATimeUtils").unixTime()-a)/60;a>=5&&(yield d("WAWebRestartRecentSyncJob").restartRecentSyncJob());return d("WATimeUtils").MINUTE_SECONDS*5}return 10});case z.CLEANUP_REPORTING_TABLE:return b("asyncToGeneratorRuntime").asyncToGenerator(function*(){try{yield d("WAWebDBReportingTokenUtils").cleanupReportingTable(d("WAWebMessagingGatingUtils").getReportingTagCleanupDays()),yield d("WAWebDBReportingTokenUtils").cleanupReportingTokenAndContent(d("WAWebMessagingGatingUtils").getReportingTokenCleanupDays())}catch(a){d("WALogger").ERROR(l(),a).tags("messaging","wa-ice","report-token").devConsole(a)}return d("WATimeUtils").DAY_SECONDS});case z.CLEANUP_3PD_SIGNALS_TABLE:return b("asyncToGeneratorRuntime").asyncToGenerator(function*(){try{d("WAWebABProps").getABPropConfigValue("ctwa_download_3pd_signals")&&(yield d("WAWebDownloads3PDSignalsDatabaseApi").cleanup3PDSignalsTable())}catch(a){d("WALogger").ERROR(k(),a).tags("3pd-signals").devConsole(a)}return d("WATimeUtils").DAY_SECONDS});case z.FETCH_QUICK_PROMOTIONS:return b("asyncToGeneratorRuntime").asyncToGenerator(function*(){d("WALogger").LOG(j());yield d("WAWebFetchQuickPromotions").fetchQuickPromotions();return d("WAWebBizGatingUtils").qpGraphQLFetchIntervalMinutes()*d("WATimeUtils").MINUTE_SECONDS})}}function E(){return{scheduledTimeResolver:{get:function(a){return d("WAWebApiTasksScheduledTime").getTaskScheduledTime(String(a))},set:function(a,b){return d("WAWebApiTasksScheduledTime").updateTaskScheduledTime(String(a),b)}}}}function F(a){var b=D(a);b!=null&&(d("WALogger").LOG(i(),a),d("WATaskScheduler").registerTask(a,b))}function a(){d("WATaskScheduler").startScheduler(E()),A.forEach(F),d("WAWebMobilePlatforms").isSMB()&&B.forEach(F),c("gkx")("26258")||C.forEach(F)}g.TaskType=z;g.getSchedulerOptions=E;g.maybeRegisterTask=F;g.registerTasks=a}),98); __d("WAWebElevatedPushNamesFlag",["WAWebABProps","WAWebChatGetters","WAWebContactGetters","WAWebFrontendChatGetters","WAWebFrontendContactGetters","WAWebStateUtils"],(function(a,b,c,d,e,f,g){function a(a){if(!a)return!1;a=d("WAWebStateUtils").unproxy(a);return d("WAWebChatGetters").getIsGroup(a)&&(d("WAWebFrontendChatGetters").getIsCAG(a)||a.getParticipantCount()>2)}function b(a){if(!a)return!1;a=d("WAWebStateUtils").unproxy(a);return d("WAWebChatGetters").getIsGroup(a)&&(d("WAWebFrontendChatGetters").getIsCAG(a)||a.getParticipantCount()>2)&&d("WAWebABProps").getABPropConfigValue("elevated_push_names_v2_m2_enabled")}function c(a){if(a==null)return!1;a=d("WAWebStateUtils").unproxy(a);var b=d("WAWebContactGetters").getNotifyName(a);return d("WAWebFrontendContactGetters").getFormattedName(a)===d("WAWebFrontendContactGetters").getFormattedPhone(a)&&b!=null&&b!==""}g.elevatedPushNamesEnabled=a;g.elevatedPushNamesM2Enabled=b;g.pushNameCanBeUsed=c}),98); __d("WAWebMediaTypes",["$InternalEnum"],(function(a,b,c,d,e,f){a=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",isLottie:"isLottie",isVcardOverMmsDocument:"isVcardOverMmsDocument",isViewOnce:"isViewOnce",waveform:"waveform",staticUrl:"staticUrl",accessibilityLabel:"accessibilityLabel"});c=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",isLottie:"isLottie",isVcardOverMmsDocument:"isVcardOverMmsDocument",isViewOnce:"isViewOnce",waveform:"waveform",staticUrl:"staticUrl",stickerPackId:"stickerPackId",stickerPackName:"stickerPackName",stickerPackPublisher:"stickerPackPublisher",accessibilityLabel:"accessibilityLabel"});d=Object.keys(c);e=["filehash","height","mimetype","size","type","width","stickerPackId","stickerPackName","stickerPackPublisher"];var g=[].concat(d,["deprecatedMms3Url","encFilehash","streamable"]),h=Object.freeze({VIDEO:Object.freeze(["aspectRatio","fullWidth","fullHeight","preview","duration","durationFloat","isViewOnce","fullPreviewData","staticUrl"]),PTV: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","isAvatar","isAiSticker","isLottie","isFirstParty","isFromStickerMaker","stickerPackId","stickerPackName","stickerPackPublisher","stickerMakerSourceType","fullWidth","fullHeight","preview","rgbaBuffer","rgbaWidth","rgbaHeight","aspectRatio","extractedLottieSticker"]),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([])}),i=["type","filename","caption","isGif","gifAttribution","mimetype","pageCount","sidecar","subtype","isViewOnce","accessibilityLabel"],j=b("$InternalEnum").Mirrored(["INIT","EXISTS","PREPARING","REUPLOADING","FETCHING","PROCESSING","NEED_POKE","ERROR_MISSING","ERROR_UNSUPPORTED","PROGRESSIVE_READY","RESOLVED"]),k=b("$InternalEnum").Mirrored(["INIT","PREPARING","UPLOADING","FINALIZING","NEED_UPLOAD","ERROR_FILE_NOT_READABLE","ERROR_MISSING","ERROR_TOO_LARGE","UPLOADED"]);b=b("$InternalEnum").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"]);var l={IMAGE:"image",VIDEO:"video",PTV:"ptv",AUDIO:"audio",PTT:"ptt",STICKER:"sticker",DOCUMENT:"document",PRODUCT:"product",BIZ_COVER_PHOTO:"biz-cover-photo",UNKNOWN:"unknown",STICKER_PACK:"sticker-pack"},m=Object.freeze({VIDEO:"VIDEO",PTV:"PTV",IMAGE:"IMAGE",AUDIO:"AUDIO",STICKER:"STICKER",DOCUMENT:"DOCUMENT",PRODUCT:"PRODUCT",BIZ_COVER_PHOTO:"BIZ_COVER_PHOTO"});f.MEDIA_TO_MSG=a;f.MSG_TO_MEDIA=c;f.MAPPED_MSG_PROPS=d;f.MAPPED_STICKER_PROPS=e;f.MEDIA_MSG_PROPS=g;f.FIELDS=h;f.MSG_SPECIFIC_FIELDS=i;f.DownloadStage=j;f.UploadStage=k;f.MediaDataStage=b;f.OUTWARD_TYPES=l;f.TYPE=m}),66); __d("WAWebOrderItemGetters",["WAWebGetters","WAWebGettersCaches","WAWebMediaData","WAWebMediaTypes"],(function(a,b,c,d,e,f,g){a=d("WAWebGetters").createGetterFactories({createCache:d("WAWebGettersCaches").createOrderItemCache});b=a.field;e=a.computed;f=a.clearCacheFor;a=f;f=b("thumbnailUrl");b=e(function(a){a=a[0];return new(c("WAWebMediaData"))({mediaStage:a!=null?d("WAWebMediaTypes").MediaDataStage.RESOLVED:d("WAWebMediaTypes").MediaDataStage.PREPARING,renderableUrl:a!=null?""+a:null})},[f]);g.clearOrderItemGetterCacheFor=a;g.getMediaData=b}),98); __d("WAWebMediaMetadata",["WALogger","WAWebMediaCryptoEligibilityUtils","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["id: "," type: ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["id: "," type: ",""]);i=function(){return a};return a}function a(a){var b=a.mediaObject;if(!b){d("WALogger").ERROR(i(),a.id.toString(),a.type).devConsole(a).sendLogs("media-fault: mediaMetadata msg without mediaObject");throw c("err")("msg.mediaMetadata with no mediaObject")}b=d("WAWebMediaCryptoEligibilityUtils").isMediaCryptoExpectedForMsg(a)?b.entries.getEntryByEncFilehash({encFilehash:a.encFilehash,deprecatedMms3Url:a.deprecatedMms3Url}):b.entries.getUnencryptedEntry(a.filehash,a.directPath);if(!b){d("WALogger").ERROR(h(),a.id.toString(),a.type).devConsole(a).sendLogs("media-fault: mediaMetadata no entry");throw c("err")("msg.mediaMetadata with entry mismatch")}var e=a.mediaData;return{url:d("WAWebMediaCryptoEligibilityUtils").isMediaCryptoExpectedForMsg(a)?b.deprecatedMms3Url:null,directPath:b.directPath,encFilehash:b.getEncfilehash(),mediaKey:b.getMediaKey(),mediaKeyTimestamp:b.getMediaKeyTimestamp(),filehash:a.filehash,type:e.type,mimetype:e.mimetype,filename:e.filename,duration:e.duration,width:e.fullWidth,height:e.fullHeight,firstFrameLength:e.firstFrameLength,isAnimated:e.isAnimated,isLottie:e.isLottie,thumbnailDirectPath:a.thumbnailDirectPath,thumbnailSha256:a.thumbnailSha256,thumbnailEncSha256:a.thumbnailEncSha256,thumbnailHeight:a.thumbnailHeight,thumbnailWidth:a.thumbnailWidth,waveform:a.waveform,staticUrl:a.staticUrl}}g.mediaMetadata=a}),98); __d("WAWebMediaProduct",["WAWebFileUtils","WAWebMmsMediaTypes","WAWebUploadManager","WAWebWamEnumUploadOriginType","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=(yield d("WAWebFileUtils").blobToArrayBuffer(a.forceToBlob()).then(function(a){return c("WAWebUploadManager").unencryptedUpload({file:a,hash:b,signal:new AbortController().signal,type:d("WAWebMmsMediaTypes").MEDIA_TYPES.PRODUCT_CATALOG_IMAGE,uploadOrigin:d("WAWebWamEnumUploadOriginType").UPLOAD_ORIGIN_TYPE.PRODUCT_CATALOG,isViewOnce:!1,generateThumbnailOnServer:!1})}));return new URL(a.directPath,"https://mmg.whatsapp.net").toString()});return h.apply(this,arguments)}g.uploadProductImage=a}),98); __d("WAWebMediaVideoStreaming",[],(function(a,b,c,d,e,f){function a(a){var b=a.mediaObject;return b?b.videoStreamingInfo(a.id.toString()):null}f.videoStreamingInfo=a}),66); __d("WAWebMedia",["WAWebCheckMediaExistence","WAWebClearMediaForChat","WAWebDownloadProgressiveJpegThumbnail","WAWebDownloadStatusThumbnail","WAWebDownloadVideoThumbnail","WAWebManuallySetMedia","WAWebMediaCancelDownloadMsg","WAWebMediaCancelUploadMsg","WAWebMediaDownloadMsg","WAWebMediaForwardMediaMsg","WAWebMediaMetadata","WAWebMediaMsgRegistration","WAWebMediaPrep","WAWebMediaProduct","WAWebMediaResumeUploadMsg","WAWebMediaStickers","WAWebMediaVideoStreaming","WAWebPrepRawMedia"],(function(a,b,c,d,e,f){a=importNamespace("WAWebDownloadVideoThumbnail").downloadVideoThumbnail;b=importNamespace("WAWebMediaPrep").MediaPrep;c=importNamespace("WAWebCheckMediaExistence").checkMediaExistence;d=importNamespace("WAWebClearMediaForChat").clearMediaForChat;e=importNamespace("WAWebMediaDownloadMsg").downloadMsg;var g=importNamespace("WAWebDownloadProgressiveJpegThumbnail").downloadProgressiveJpegThumbnail,h=importNamespace("WAWebDownloadStatusThumbnail").downloadStatusThumbnail,i=importNamespace("WAWebMediaForwardMediaMsg").forwardMediaMsg,j=importNamespace("WAWebManuallySetMedia").manuallySetMedia,k=importNamespace("WAWebPrepRawMedia").prepRawMedia,l=importNamespace("WAWebMediaResumeUploadMsg").resumeUploadMsg;Object.keys(importNamespace("WAWebMediaCancelDownloadMsg")).forEach(function(a){if(a==="default"||a==="__esModule")return;f[a]=importNamespace("WAWebMediaCancelDownloadMsg")[a]});Object.keys(importNamespace("WAWebMediaCancelUploadMsg")).forEach(function(a){if(a==="default"||a==="__esModule")return;f[a]=importNamespace("WAWebMediaCancelUploadMsg")[a]});Object.keys(importNamespace("WAWebMediaMetadata")).forEach(function(a){if(a==="default"||a==="__esModule")return;f[a]=importNamespace("WAWebMediaMetadata")[a]});Object.keys(importNamespace("WAWebMediaMsgRegistration")).forEach(function(a){if(a==="default"||a==="__esModule")return;f[a]=importNamespace("WAWebMediaMsgRegistration")[a]});Object.keys(importNamespace("WAWebMediaProduct")).forEach(function(a){if(a==="default"||a==="__esModule")return;f[a]=importNamespace("WAWebMediaProduct")[a]});Object.keys(importNamespace("WAWebMediaStickers")).forEach(function(a){if(a==="default"||a==="__esModule")return;f[a]=importNamespace("WAWebMediaStickers")[a]});Object.keys(importNamespace("WAWebMediaVideoStreaming")).forEach(function(a){if(a==="default"||a==="__esModule")return;f[a]=importNamespace("WAWebMediaVideoStreaming")[a]});f.downloadVideoThumbnail=a;f.MediaPrep=b;f.checkMediaExistence=c;f.clearMediaForChat=d;f.downloadMsg=e;f.downloadProgressiveJpegThumbnail=g;f.downloadStatusThumbnail=h;f.forwardMediaMsg=i;f.manuallySetMedia=j;f.prepRawMedia=k;f.resumeUploadMsg=l}),66); __d("WAWebWamEnumWebcRmrReasonCode",[],(function(a,b,c,d,e,f){a=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});f.WEBC_RMR_REASON_CODE=a}),66); __d("WAWebMediaAutoDownloadQueue",["$InternalEnum","WAConcurrentPriorityPromiseQueue","WALogger","WAWebMedia","WAWebMediaDownloadMmsThumbnail","WAWebMiscGatingUtils","WAWebMsgGetters","WAWebMsgModelPropUtils","WAWebMsgModelUtils","WAWebMsgType","WAWebStickerModel","WAWebUserPrefsGeneral","WAWebWamEnumWebcRmrReasonCode","asyncToGeneratorRuntime","gkx"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["mediaObject does not exist for media at download time ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["mediaObject does not exist for media at enqueue time ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Sticker mediaObject does not exist for media at download time ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["Sticker mediaObject does not exist for media at enqueue time ",""]);k=function(){return a};return a}var l=b("$InternalEnum")({MEDIA:"media",MMS_THUMBNAIL:"mms_thumbnail"}),m=32*1024*1024,n=512*1024,o=5,p=512,q=500*1024;function r(a){return d("WAWebMsgModelPropUtils").isTrusted(a.unsafe())}function s(a){switch(a.type){case d("WAWebMsgType").MSG_TYPE.AUDIO:case d("WAWebMsgType").MSG_TYPE.PTT:return d("WAWebUserPrefsGeneral").getAutoDownloadAudio();case d("WAWebMsgType").MSG_TYPE.STICKER:case d("WAWebMsgType").MSG_TYPE.IMAGE:return d("WAWebUserPrefsGeneral").getAutoDownloadPhotos();case d("WAWebMsgType").MSG_TYPE.VIDEO:case d("WAWebMsgType").MSG_TYPE.PTV:return a.isGif&&a.size<q?d("WAWebUserPrefsGeneral").getAutoDownloadPhotos():d("WAWebUserPrefsGeneral").getAutoDownloadVideos();case d("WAWebMsgType").MSG_TYPE.DOCUMENT:return d("WAWebUserPrefsGeneral").getAutoDownloadDocuments()}return!1}function t(a){switch(a.type){case d("WAWebMsgType").MSG_TYPE.IMAGE:case d("WAWebMsgType").MSG_TYPE.VIDEO:case d("WAWebMsgType").MSG_TYPE.PTV:case d("WAWebMsgType").MSG_TYPE.DOCUMENT:return a.size<=m;case d("WAWebMsgType").MSG_TYPE.AUDIO:case d("WAWebMsgType").MSG_TYPE.PTT:return a.size<n;case d("WAWebMsgType").MSG_TYPE.STICKER:return!0}return!1}a=function(){function a(){this.$1=new(c("WAConcurrentPriorityPromiseQueue"))(o,{photos:2,videos:1,audio:1,documents:1,mms_thumbnail:4})}var e=a.prototype;e.getEnqueuedTasksCount=function(){return this.$1.getEnqueuedTasksCount()};e.clearQueue=function(){this.$1.clearQueue()};e.$2=function(){return d("WAWebMiscGatingUtils").webMediaAutoDownloadEnabled()&&d("WAWebUserPrefsGeneral").getAutoDownloadPhotos()&&this.getEnqueuedTasksCount()<p};e.enqueue=function(a,b,c){if(a instanceof d("WAWebStickerModel").StickerModel){if(this.$2()){void this.$3({sticker:a});return!0}return!1}a=a;var e=d("WAWebMiscGatingUtils").webMediaAutoDownloadEnabled()&&b===l.MEDIA&&!d("WAWebMsgGetters").getIsNewsletterMsg(a)&&r(a)&&a.isNewMsg&&s(a)&&t(a)&&this.getEnqueuedTasksCount()<p;if(e)switch(a.type){case d("WAWebMsgType").MSG_TYPE.AUDIO:case d("WAWebMsgType").MSG_TYPE.PTT:this.$4({message:a,group:"audio",chat:c});return!0;case d("WAWebMsgType").MSG_TYPE.IMAGE:case d("WAWebMsgType").MSG_TYPE.STICKER:this.$4({message:a,group:"photos",chat:c});return!0;case d("WAWebMsgType").MSG_TYPE.VIDEO:case d("WAWebMsgType").MSG_TYPE.PTV:if(a.isGif&&a.size<q){this.$4({message:a,group:"photos",chat:c});return!0}this.$4({message:a,group:"videos",chat:c});return!0;case d("WAWebMsgType").MSG_TYPE.DOCUMENT:this.$4({message:a,group:"documents",chat:c});return!0}if(b===l.MMS_THUMBNAIL){if(a.type===d("WAWebMsgType").MSG_TYPE.DOCUMENT||d("WAWebMsgModelUtils").typeIsUrl(a)){this.$5({message:a,group:"mms_thumbnail",chat:c});return!0}if(a.type===d("WAWebMsgType").MSG_TYPE.IMAGE||a.type===d("WAWebMsgType").MSG_TYPE.VIDEO||a.type===d("WAWebMsgType").MSG_TYPE.PTV){this.$6({message:a,group:"mms_thumbnail"});return!0}}return!1};e.$3=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=a.sticker;if(!e.mediaObject){d("WALogger").ERROR(k(),c("gkx")("26258")?"":e.id).sendLogs("Sticker mediaObject does not exist for media at enqueue time");return}yield this.$1.enqueue(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(!e.mediaObject){d("WALogger").ERROR(j(),c("gkx")("26258")?"":e.id).sendLogs("Sticker mediaObject does not exist for media at download time");return}yield e.downloadMedia()}),{group:"photos",priority:1})});function e(b){return a.apply(this,arguments)}return e}();e.$4=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=a.message;a=a.group;if(!e.mediaObject){d("WALogger").ERROR(i(),c("gkx")("26258")?"":e.id).sendLogs("mediaObject does not exist for media at enqueue time");return}yield this.$1.enqueue(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(!e.mediaObject){d("WALogger").ERROR(h(),c("gkx")("26258")?"":e.id).sendLogs("mediaObject does not exist for media at download time",{sampling:0});return}if(!s(e))return;yield e.downloadMedia({downloadEvenIfExpensive:!1,rmrReason:d("WAWebWamEnumWebcRmrReasonCode").WEBC_RMR_REASON_CODE.OTHER,isUserInitiated:!1,isAutoDownload:!0})}),{group:a,priority:-e.t})});function e(b){return a.apply(this,arguments)}return e}();e.$5=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var d=a.message,e=a.chat;a=a.group;yield this.$1.enqueue(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield c("WAWebMediaDownloadMmsThumbnail")({msg:d,chat:e})}),{group:a,priority:-d.t})});function d(b){return a.apply(this,arguments)}return d}();e.$6=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=a.message;a=a.group;yield this.$1.enqueue(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield d("WAWebMedia").downloadStatusThumbnail({msg:c})}),{group:a,priority:-c.t})});function c(b){return a.apply(this,arguments)}return c}();return a}();e=new a();g.AutoDownloadTypes=l;g.MAX_AUTO_DOWNLOAD_SIZE=m;g.AUDIO_AUTO_DOWNLOAD_SIZE_LIMIT=n;g.shouldTrustMedia=r;g.shouldAutoDownloadMedia=s;g.validateMediaSize=t;g.AutoDownloadQueue=e}),98); __d("WAWebMediaData",["WAWebBaseModel","WAWebFeatureDetectionSwSupport","WAWebMediaCleanFileName","WAWebMediaInMemoryBlobCache","WAWebMediaTypes"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.type=d("WAWebBaseModel").prop(d("WAWebMediaTypes").OUTWARD_TYPES.UNKNOWN),c.directPath=d("WAWebBaseModel").prop(),c.mediaKey=d("WAWebBaseModel").prop(),c.mediaKeyTimestamp=d("WAWebBaseModel").prop(),c.encFilehash=d("WAWebBaseModel").prop(),c.mediaStage=d("WAWebBaseModel").prop(d("WAWebMediaTypes").MediaDataStage.INIT),c.size=d("WAWebBaseModel").prop(),c.loadedSize=d("WAWebBaseModel").prop(),c.filehash=d("WAWebBaseModel").prop(),c.mimetype=d("WAWebBaseModel").prop(),c.mediaBlob=d("WAWebBaseModel").prop(),c.renderableUrl=d("WAWebBaseModel").prop(),c.fullHeight=d("WAWebBaseModel").prop(),c.fullWidth=d("WAWebBaseModel").prop(),c.aspectRatio=d("WAWebBaseModel").prop(),c.rgbaBuffer=d("WAWebBaseModel").prop(),c.rgbaHeight=d("WAWebBaseModel").prop(),c.rgbaWidth=d("WAWebBaseModel").prop(),c.animationDuration=d("WAWebBaseModel").prop(0),c.animatedAsNewMsg=d("WAWebBaseModel").prop(!1),c.isAnimated=d("WAWebBaseModel").prop(),c.isFirstParty=d("WAWebBaseModel").prop(),c.isFromStickerMaker=d("WAWebBaseModel").prop(),c.isAvatar=d("WAWebBaseModel").prop(),c.isAiSticker=d("WAWebBaseModel").prop(),c.isLottie=d("WAWebBaseModel").prop(),c.stickerPackId=d("WAWebBaseModel").prop(),c.stickerPackName=d("WAWebBaseModel").prop(),c.stickerPackPublisher=d("WAWebBaseModel").prop(),c.stickerMakerSourceType=d("WAWebBaseModel").prop(),c.singleLoopDuration=d("WAWebBaseModel").prop(),c.firstFrameLength=d("WAWebBaseModel").prop(),c.firstFrameSidecar=d("WAWebBaseModel").prop(),c.emojis=d("WAWebBaseModel").prop(),c.progressiveStage=d("WAWebBaseModel").prop(),c.isViewOnce=d("WAWebBaseModel").prop(!1),c.staticUrl=d("WAWebBaseModel").prop(),c.preview=d("WAWebBaseModel").prop(),c.sidecar=d("WAWebBaseModel").prop(),c.duration=d("WAWebBaseModel").prop(),c.durationFloat=d("WAWebBaseModel").prop(),c.isGif=d("WAWebBaseModel").prop(),c.gifAttribution=d("WAWebBaseModel").prop(),c.accessibilityLabel=d("WAWebBaseModel").prop(),c.streamable=d("WAWebBaseModel").derived(function(){return this.isStreamable()},["isGif","isViewOnce","mediaStage","sidecar","type","_swStreamingSupported"]),c._swStreamingSupported=d("WAWebBaseModel").prop(!1),c._listeningToSwSupport=d("WAWebBaseModel").prop(!1),c.filename=d("WAWebBaseModel").prop(),c.pageCount=d("WAWebBaseModel").prop(),c.documentPreview=d("WAWebBaseModel").prop(),c.isVcardOverMmsDocument=d("WAWebBaseModel").prop(!1),c.parsedVcards=d("WAWebBaseModel").prop(),c.extractedLottieSticker=d("WAWebBaseModel").prop(),c.fullPreviewSize=d("WAWebBaseModel").prop(),c.fullPreviewData=d("WAWebBaseModel").prop(),c.subtype=d("WAWebBaseModel").prop(),c.waveform=d("WAWebBaseModel").prop(),b)||babelHelpers.assertThisInitialized(c)}var e=b.prototype;e.initialize=function(){a.prototype.initialize.call(this)};e.set=function(b,c,d){d=d;if(typeof b==="string"){var e;e=(e={},e[b]=c,e)}else e=b,d=c;e=i(e);return a.prototype.set.call(this,e,d)};e.isStreamable=function(){return this.isStreamableType()&&this.listenToServiceWorkerSupport()&&!this.isViewOnce};e._updateStreamingSupported=function(a){this._swStreamingSupported=a};e.listenToServiceWorkerSupport=function(){if(this._listeningToSwSupport)return this._swStreamingSupported;this.listenTo(c("WAWebFeatureDetectionSwSupport"),"change:streamingSupported",this._updateStreamingSupported);this._swStreamingSupported=Boolean(c("WAWebFeatureDetectionSwSupport").streamingSupported);this._listeningToSwSupport=!0;return this._swStreamingSupported};e.isStreamableType=function(){return this.type===d("WAWebMediaTypes").OUTWARD_TYPES.VIDEO&&!this.isGif&&(this.mediaStage===d("WAWebMediaTypes").MediaDataStage.INIT||this.mediaStage===d("WAWebMediaTypes").MediaDataStage.FETCHING||this.mediaStage===d("WAWebMediaTypes").MediaDataStage.DECRYPTING||this.mediaStage===d("WAWebMediaTypes").MediaDataStage.RESOLVED)&&this.fullWidth!=null&&this.fullHeight!=null&&Boolean(this.sidecar&&this.sidecar.byteLength>0)};e.isDownloadable=function(){return this.isViewOnce?!1:this.renderableUrl!=null||d("WAWebMediaInMemoryBlobCache").InMemoryMediaBlobCache.has(this.filehash)||this.mediaStage===d("WAWebMediaTypes").MediaDataStage.EXISTS||this.mediaStage===d("WAWebMediaTypes").MediaDataStage.PROGRESSIVE_READY};return b}(d("WAWebBaseModel").BaseModel);a.Proxy="mediaData";var h=d("WAWebBaseModel").defineModel(a);h.TYPE=d("WAWebMediaTypes").OUTWARD_TYPES;b=h;function i(a){if(a.filename&&a.type===h.TYPE.DOCUMENT){var b=d("WAWebMediaCleanFileName").cleanFilename(a.filename);return babelHelpers["extends"]({},a,{filename:b,caption:b})}return a}g["default"]=b}),98); __d("WAWebMediaOpaqueData",["Promise","WABase64","WALogger","WANullthrows","WAShiftTimer","WAWebFileUtils","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["OpaqueData:size returned 0"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose([""," called on unretained OpaqueData"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose([""," called on released OpaqueData"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["OpaqueData:autorelease too many release calls"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["OpaqueData:autorelease called on released object"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["OpaqueData:retain called on released OpaqueData"]);n=function(){return a};return a}var o=[],p=new(d("WAShiftTimer").ShiftTimer)(a),q=function(){function a(){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}var e=a.prototype;e.retain=function(){if(this.released){d("WALogger").WARN(n());throw c("err")("OpaqueData:retain called on released OpaqueData")}else this._retainCount++};e.autorelease=function(){this.released?d("WALogger").WARN(m()):this._retainCount===0?d("WALogger").WARN(l()):this._retainCount===1?(this._retainCount=0,this._inAutoreleasePool||(this._inAutoreleasePool=!0,o.push(this),p.onOrBefore(1e3))):this._retainCount--};e.autoreleaseWhenPromiseCompletes=function(a){var b=this,c=function(){b.autorelease()};a.then(c,c)};e.throwIfReleased=function(a){if(this.released){d("WALogger").ERROR(k(),a);throw c("err")(a+" called on released OpaqueData")}else this._retainCount===0&&d("WALogger").ERROR(j(),a)};e.url=function(){this.throwIfReleased("OpaqueData:url");if(this._url!=null&&this._url!=="")return this._url;if(this._b64!=null&&this._b64!==""){this._url="data:image/jpeg;base64,"+this._b64;return this._url}this._url=window.URL.createObjectURL(c("WANullthrows")(this.blob,"unexpected empty blob"));return this._url};e.getBlob=function(){return this.blob};e.getBase64=function(){return this._b64};e.validate=function(){if(this._released===!0)return(h||(h=b("Promise"))).resolve(!1);else if(this.blob)return d("WAWebFileUtils").validateBlob(this.blob);return(h||(h=b("Promise"))).resolve(!0)};e.size=function(){this.throwIfReleased("OpaqueData:size");if(this.blob)return this.blob.size;else if(this._b64!=null)return d("WABase64").sizeWhenB64Decoded(this._b64);d("WALogger").ERROR(i()).sendLogs("opaque-data-size-0");return 0};e.formData=function(a){this.throwIfReleased("OpaqueData:formData");return this.forceToBlob()};e.type=function(){this.throwIfReleased("OpaqueData:type");return this._mimetype!=null&&this._mimetype!==""?this._mimetype:"undefined"};e.forceToBlob=function(){this.throwIfReleased("OpaqueData:forceToBlob");var a=this.blob;if(a)return a;a=this._b64;if(a!=null&&a!==""){this._b64=void 0;this._url=void 0;var b=this._mimetype;return this.blob=new Blob([d("WABase64").decodeB64(a)],b!=null&&b!==""?{type:b}:void 0)}throw c("err")("OpaqueData:forceToBlob no b64 or blob")};e._releaseImpl=function(){this._mimetype=void 0;var a=this.blob;a?(this.blob=void 0,this._url!=null&&this._url!==""&&(window.URL.revokeObjectURL(this._url),this._url=void 0)):(this._b64=void 0,this._url=void 0)};e.isBlobEqual=function(a){return!a?!this.blob:this.blob===a.blob};return a}();q.createFromBase64Jpeg=function(a){return new(h||(h=b("Promise")))(function(b){var c=new q();c._b64=a;c._mimetype="image/jpeg";return b(c)})};q.createFromData=function(a,c){return new(h||(h=b("Promise")))(function(b){var d=new q();d.blob=a instanceof Blob&&a.type===c?a:new Blob([a],{type:c});d._mimetype=c;return b(d)})};function a(){var a=o;o=[];for(var b=0;b<a.length;b++){var c=a[b];c._inAutoreleasePool=!1;c._retainCount===0&&!c.released&&(c.released=!0,c._releaseImpl())}}g["default"]=q}),98); __d("WAWebGetThumbnailTypeForMediaChatMsg",["WAWebMmsMediaTypes","WAWebMsgGetters"],(function(a,b,c,d,e,f,g){function a(a){a=a.msg;a=d("WAWebMsgGetters").getIsNewsletterMsg(a);return a?d("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_THUMBNAIL_LINK:d("WAWebMmsMediaTypes").MEDIA_TYPES.THUMBNAIL_LINK}g["default"]=a}),98); __d("WAWebGetThumbnailTypeForMediaDocumentMsg",["WAWebMmsMediaTypes"],(function(a,b,c,d,e,f,g){function a(a){return d("WAWebMmsMediaTypes").MEDIA_TYPES.THUMBNAIL_DOCUMENT}g["default"]=a}),98); __d("WAWebGetThumbnailTypeForMediaImageMsg",["WAWebMmsMediaTypes"],(function(a,b,c,d,e,f,g){function a(a){return d("WAWebMmsMediaTypes").MEDIA_TYPES.THUMBNAIL_IMAGE}g["default"]=a}),98); __d("WAWebGetThumbnailTypeForMediaInteractiveMsg",["WAWebInteractiveMessageHeaderMediaType","WAWebMmsMediaTypes","err"],(function(a,b,c,d,e,f,g){function a(a){a=a.msg;a=a.interactiveHeader;if((a==null?void 0:a.mediaType)!=null)switch(a.mediaType){case d("WAWebInteractiveMessageHeaderMediaType").InteractiveMessageHeaderMediaType.DOCUMENT:return d("WAWebMmsMediaTypes").MEDIA_TYPES.THUMBNAIL_DOCUMENT;case d("WAWebInteractiveMessageHeaderMediaType").InteractiveMessageHeaderMediaType.VIDEO:return d("WAWebMmsMediaTypes").MEDIA_TYPES.THUMBNAIL_VIDEO;default:break}throw c("err")("getThumbnailTypeForMediaMsg: unsupported msg type")}g["default"]=a}),98); __d("WAWebGetThumbnailTypeForMediaStickerPackMsg",["WAWebMmsMediaTypes"],(function(a,b,c,d,e,f,g){function a(a){return d("WAWebMmsMediaTypes").MEDIA_TYPES.THUMBNAIL_STICKER_PACK}g["default"]=a}),98); __d("WAWebGetThumbnailTypeForMediaVideoMsg",["WAWebMmsMediaTypes"],(function(a,b,c,d,e,f,g){function a(a){return d("WAWebMmsMediaTypes").MEDIA_TYPES.THUMBNAIL_VIDEO}g["default"]=a}),98); __d("WAWebMessagePluginGetThumbnailTypeForMediaMsgRegistry",["WAWebGetThumbnailTypeForMediaChatMsg","WAWebGetThumbnailTypeForMediaDocumentMsg","WAWebGetThumbnailTypeForMediaImageMsg","WAWebGetThumbnailTypeForMediaInteractiveMsg","WAWebGetThumbnailTypeForMediaStickerPackMsg","WAWebGetThumbnailTypeForMediaVideoMsg"],(function(a,b,c,d,e,f,g){a=[{type:"album",subtype:void 0,getThumbnailTypeForMediaMsg:null},{type:"audio",subtype:void 0,getThumbnailTypeForMediaMsg:null},{type:"biz_content_placeholder",subtype:void 0,getThumbnailTypeForMediaMsg:null},{type:"buttons_response",subtype:void 0,getThumbnailTypeForMediaMsg:null},{type:"chat",subtype:"url",getThumbnailTypeForMediaMsg:c("WAWebGetThumbnailTypeForMediaChatMsg")},{type:"chat",subtype:void 0,getThumbnailTypeForMediaMsg:c("WAWebGetThumbnailTypeForMediaChatMsg")},{type:"ciphertext",subtype:"bot_unavailable_fanout",getThumbnailTypeForMediaMsg:null},{type:"ciphertext",subtype:"fanout",getThumbnailTypeForMediaMsg:null},{type:"ciphertext",subtype:"hosted_unavailable_fanout",getThumbnailTypeForMediaMsg:null},{type:"ciphertext",subtype:"view_once_unavailable_fanout",getThumbnailTypeForMediaMsg:null},{type:"ciphertext",subtype:void 0,getThumbnailTypeForMediaMsg:null},{type:"comment",subtype:void 0,getThumbnailTypeForMediaMsg:null},{type:"debug_placeholder",subtype:void 0,getThumbnailTypeForMediaMsg:null},{type:"document",subtype:void 0,getThumbnailTypeForMediaMsg:c("WAWebGetThumbnailTypeForMediaDocumentMsg")},{type:"event_creation",subtype:void 0,getThumbnailTypeForMediaMsg:null},{type:"event_edit_encrypted",subtype:void 0,getThumbnailTypeForMediaMsg:null},{type:"event_response",subtype:void 0,getThumbnailTypeForMediaMsg:null},{type:"groups_v4_invite",subtype:void 0,getThumbnailTypeForMediaMsg:null},{type:"hsm",subtype:void 0,getThumbnailTypeForMediaMsg:null},{type:"image",subtype:void 0,getThumbnailTypeForMediaMsg:c("WAWebGetThumbnailTypeForMediaImageMsg")},{type:"interactive",subtype:void 0,getThumbnailTypeForMediaMsg:c("WAWebGetThumbnailTypeForMediaInteractiveMsg")},{type:"interactive_response",subtype:void 0,getThumbnailTypeForMediaMsg:null},{type:"keep_in_chat",subtype:void 0,getThumbnailTypeForMediaMsg:null},{type:"list",subtype:void 0,getThumbnailTypeForMediaMsg:null},{type:"list_response",subtype:void 0,getThumbnailTypeForMediaMsg:null},{type:"location",subtype:void 0,getThumbnailTypeForMediaMsg:null},{type:"multi_vcard",subtype:void 0,getThumbnailTypeForMediaMsg:null},{type:"native_flow",subtype:void 0,getThumbnailTypeForMediaMsg:null},{type:"newsletter_admin_invite",subtype:void 0,getThumbnailTypeForMediaMsg:null},{type:"notification_template",subtype:"contact_info_card",getThumbnailTypeForMediaMsg:null},{type:"order",subtype:void 0,getThumbnailTypeForMediaMsg:null},{type:"payment",subtype:"ciphertext",getThumbnailTypeForMediaMsg:null},{type:"payment",subtype:"futureproof",getThumbnailTypeForMediaMsg:null},{type:"payment",subtype:"invite",getThumbnailTypeForMediaMsg:null},{type:"payment",subtype:"request",getThumbnailTypeForMediaMsg:null},{type:"payment",subtype:"send",getThumbnailTypeForMediaMsg:null},{type:"pin_message",subtype:void 0,getThumbnailTypeForMediaMsg:null},{type:"pinned_message",subtype:void 0,getThumbnailTypeForMediaMsg:null},{type:"poll_creation",subtype:void 0,getThumbnailTypeForMediaMsg:null},{type:"poll_result_snapshot",subtype:void 0,getThumbnailTypeForMediaMsg:null},{type:"poll_update",subtype:"poll_vote",getThumbnailTypeForMediaMsg:null},{type:"product",subtype:void 0,getThumbnailTypeForMediaMsg:null},{type:"protocol",subtype:"admin_revoke",getThumbnailTypeForMediaMsg:null},{type:"protocol",subtype:"bot_feedback",getThumbnailTypeForMediaMsg:null},{type:"protocol",subtype:"bot_memu_onboarding",getThumbnailTypeForMediaMsg:null},{type:"protocol",subtype:"bot_request_welcome",getThumbnailTypeForMediaMsg:null},{type:"protocol",subtype:"ephemeral_setting",getThumbnailTypeForMediaMsg:null},{type:"protocol",subtype:"ephemeral_sync_response",getThumbnailTypeForMediaMsg:null},{type:"protocol",subtype:"event_edit_decrypted",getThumbnailTypeForMediaMsg:null},{type:"protocol",subtype:"history_sync_notification",getThumbnailTypeForMediaMsg:null},{type:"protocol",subtype:"message_edit",getThumbnailTypeForMediaMsg:null},{type:"protocol",subtype:"sender_revoke",getThumbnailTypeForMediaMsg:null},{type:"protocol",subtype:"share_phone_number",getThumbnailTypeForMediaMsg:null},{type:"protocol",subtype:"status_group_mention_message",getThumbnailTypeForMediaMsg:null},{type:"protocol",subtype:"status_mention_message",getThumbnailTypeForMediaMsg:null},{type:"ptt",subtype:void 0,getThumbnailTypeForMediaMsg:null},{type:"ptv",subtype:void 0,getThumbnailTypeForMediaMsg:null},{type:"reaction",subtype:void 0,getThumbnailTypeForMediaMsg:null},{type:"reaction_enc",subtype:void 0,getThumbnailTypeForMediaMsg:null},{type:"request_phone_number",subtype:void 0,getThumbnailTypeForMediaMsg:null},{type:"revoked",subtype:"admin",getThumbnailTypeForMediaMsg:null},{type:"revoked",subtype:"sender",getThumbnailTypeForMediaMsg:null},{type:"rich_response",subtype:void 0,getThumbnailTypeForMediaMsg:null},{type:"status_notification",subtype:"status_notification_message",getThumbnailTypeForMediaMsg:null},{type:"sticker",subtype:void 0,getThumbnailTypeForMediaMsg:null},{type:"sticker-pack",subtype:void 0,getThumbnailTypeForMediaMsg:c("WAWebGetThumbnailTypeForMediaStickerPackMsg")},{type:"template_button_reply",subtype:void 0,getThumbnailTypeForMediaMsg:null},{type:"unknown",subtype:"payment_action_request_declined",getThumbnailTypeForMediaMsg:null},{type:"unknown",subtype:"payment_transaction_request_cancelled",getThumbnailTypeForMediaMsg:null},{type:"unknown",subtype:"phone",getThumbnailTypeForMediaMsg:null},{type:"unknown",subtype:"phone_only_feature",getThumbnailTypeForMediaMsg:null},{type:"unknown",subtype:void 0,getThumbnailTypeForMediaMsg:null},{type:"vcard",subtype:void 0,getThumbnailTypeForMediaMsg:null},{type:"video",subtype:void 0,getThumbnailTypeForMediaMsg:c("WAWebGetThumbnailTypeForMediaVideoMsg")}];g["default"]=a}),98); __d("WAWebMessagePluginGetThumbnailTypeForMediaMsg",["WAWebMessagePluginGetThumbnailTypeForMediaMsgRegistry","WAWebPluginCreateRegistryLookup"],(function(a,b,c,d,e,f,g){var h=d("WAWebPluginCreateRegistryLookup").createMsgTypeRegistryLookup(c("WAWebMessagePluginGetThumbnailTypeForMediaMsgRegistry"));function a(a){var b=a.msg;b=h(b.type,b.subtype);return b==null?void 0:b.getThumbnailTypeForMediaMsg==null?void 0:b.getThumbnailTypeForMediaMsg(a)}g.getThumbnailTypeForMediaMsg=a}),98); __d("WAWebMediaDownloadMmsThumbnail",["WAAbortError","WABase64","WALogger","WANullthrows","WAWebDownloadManager","WAWebFrontendMsgGetters","WAWebMediaCryptoEligibilityUtils","WAWebMediaOpaqueData","WAWebMessagePluginGetThumbnailTypeForMediaMsg","WAWebMmsMediaTypes","WAWebMsgType","WAWebSerializeError","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["media.downloadMmsThumbnail: error\n",""],["media.downloadMmsThumbnail: error\\n",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["media.downloadMmsThumbnail aborted"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["media.downloadMmsThumbnail: success"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["media.downloadMmsThumbnail: start"]);k=function(){return a};return a}function a(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.msg,e=a.chat,f=a.isPreload;a=a.signal;var g=b.thumbnailSha256,l=b.thumbnailEncSha256,m=b.thumbnailDirectPath,n=b.mediaKey,o=b.mediaKeyTimestamp;if(m==null||g==null)return;if(d("WAWebMediaCryptoEligibilityUtils").isMediaCryptoExpectedForMsg(b)&&(l==null||n==null||o==null))return;if((b.type===d("WAWebMsgType").MSG_TYPE.DOCUMENT||b.type===d("WAWebMsgType").MSG_TYPE.INTERACTIVE)&&d("WAWebMmsMediaTypes").getMsgMediaType(b)===d("WAWebMmsMediaTypes").MEDIA_TYPES.DOCUMENT&&(b.thumbnailHeight==null||b.thumbnailWidth==null))return;var p=d("WAWebFrontendMsgGetters").getAsUrl(b.unsafe());if(p&&(p.thumbnailHeight==null||p.thumbnailWidth==null))return;d("WALogger").LOG(k());try{m=(yield d("WAWebDownloadManager").downloadManager.downloadAndMaybeDecrypt({directPath:m,encFilehash:l,filehash:g,mediaKey:n,mediaKeyTimestamp:o,type:c("WANullthrows")(d("WAWebMessagePluginGetThumbnailTypeForMediaMsg").getThumbnailTypeForMediaMsg({msg:b})),signal:a||new AbortController().signal,userDownloadAttemptCount:0,isPreload:f,chatWid:e==null?void 0:e.id}));if(p)p.thumbnailHQ=d("WABase64").encodeB64(m);else{l=c("WANullthrows")(b.mediaObject,"mediaObject cannot be null for thumbnail download");g={fullPreviewData:yield c("WAWebMediaOpaqueData").createFromData(m,"image/jpeg")};b.type===d("WAWebMsgType").MSG_TYPE.DOCUMENT&&(g.fullPreviewSize={height:c("WANullthrows")(b.thumbnailHeight),width:c("WANullthrows")(b.thumbnailWidth)});l.consolidate(g)}d("WALogger").LOG(j())}catch(a){if(a.name===d("WAAbortError").ABORT_ERROR){d("WALogger").LOG(i());return}d("WALogger").WARN(h(),c("WAWebSerializeError")(a)).verbose()}});return l.apply(this,arguments)}g["default"]=a}),98); __d("WAWebMediaGetUploadOriginForChat",["WAWebChatGetters","WAWebFrontendChatGetters","WAWebStateUtils","WAWebWamEnumUploadOriginType"],(function(a,b,c,d,e,f,g){function a(a){if(!a)return d("WAWebWamEnumUploadOriginType").UPLOAD_ORIGIN_TYPE.UNKNOWN;a=d("WAWebStateUtils").unproxy(a);if(d("WAWebChatGetters").getIsNewsletter(a))return d("WAWebWamEnumUploadOriginType").UPLOAD_ORIGIN_TYPE.CHANNEL;return d("WAWebChatGetters").getIsGroup(a)?d("WAWebFrontendChatGetters").getIsCAG(a)?d("WAWebWamEnumUploadOriginType").UPLOAD_ORIGIN_TYPE.COMMUNITY:d("WAWebWamEnumUploadOriginType").UPLOAD_ORIGIN_TYPE.CHAT_GROUP:d("WAWebWamEnumUploadOriginType").UPLOAD_ORIGIN_TYPE.CHAT_PERSONAL}g["default"]=a}),98); __d("WAWebDownloadManagerErrors",["WAWebBackendErrors"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b;b=a.call(this,404)||this;b.name="MediaNotOnPhone";return b}return b}(d("WAWebBackendErrors").ServerStatusCodeError);g.MediaNotOnPhone=a}),98); __d("WAWebMediaEntry",["Promise","WABase64Equal","WAIsMediaKeyReusable","WALogger","WATimeUtils","WAWebMediaHosts","WAWebMmsClientFormatDownloadUrl","WAWebMmsOperationsConst","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Media type "," from "," is missing encFilehash"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["media-fault: mediaKey changed for the same MMS3 url. type:",". equal?:",". Debug:\n",""],["media-fault: mediaKey changed for the same MMS3 url. type:",". equal?:",". Debug:\\n",""]);j=function(){return a};return a}var k={PROBABLY_ON_SERVER:"PROBABLY_ON_SERVER",PROBABLY_OFF_SERVER:"PROBABLY_OFF_SERVER",UNKNOWN:"UNKNOWN"};a=function(){function a(b){this.useBackupUrl=!1;if(this.constructor===a)throw c("err")("AbstractMediaEntry is an abstract class");this.deprecatedMms3Url=b.deprecatedMms3Url;this.serverStatus=k.UNKNOWN;this.sidecar=b.sidecar;this.directPath=b.directPath;this.firstFrameSidecar=b.firstFrameSidecar;this.type=b.type;this.scansSidecar=b.scansSidecar;this.scanLengths=b.scanLengths;this.staticUrl=b.staticUrl}var b=a.prototype;b.markWhetherOnServer=function(a){this.serverStatus=a?k.PROBABLY_ON_SERVER:k.PROBABLY_OFF_SERVER};b.getMediaKey=function(){return null};b.getMediaKeyTimestamp=function(){return null};b.getEncfilehash=function(){return null};b.getFilehash=function(){return null};b.getThumbnailDirectPath=function(){return null};b.getThumbnailSha256=function(){return null};b.validateForDownloads=function(){return this.serverStatus!==k.PROBABLY_OFF_SERVER};return a}();var l=function(b){babelHelpers.inheritsLoose(a,b);function a(a){var c=a.filehash,d=a.handle,e=a.thumbnailDirectPath,f=a.thumbnailSha256;a=babelHelpers.objectWithoutPropertiesLoose(a,["filehash","handle","thumbnailDirectPath","thumbnailSha256"]);a=b.call(this,a)||this;a.filehash=c;a.handle=d;a.thumbnailDirectPath=e;a.thumbnailSha256=f;return a}var c=a.prototype;c.getFilehash=function(){return this.filehash};c.getThumbnailDirectPath=function(){return this.thumbnailDirectPath};c.getThumbnailSha256=function(){return this.thumbnailSha256};return a}(a),m=function(e){babelHelpers.inheritsLoose(a,e);function a(a){var b=a.mediaKey,c=a.mediaKeyTimestamp,d=a.encFilehash;a=babelHelpers.objectWithoutPropertiesLoose(a,["mediaKey","mediaKeyTimestamp","encFilehash"]);a=e.call(this,a)||this;a.mediaKey=b;a.mediaKeyTimestamp=c;a.encFilehash=d;return a}var f=a.prototype;f.canReuseMediaKey=function(){if(this.directPath==null)return!1;var a=d("WATimeUtils").castToUnixTime(this.mediaKeyTimestamp);return d("WAIsMediaKeyReusable").isMediaKeyReusable(a)};f.getMediaKey=function(){return this.mediaKey};f.getMediaKeyTimestamp=function(){return this.mediaKeyTimestamp};f.getEncfilehash=function(){return this.encFilehash};f.url=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a||{};var e=a.useFallback;a=a.forceHashUrl;var f=this.encFilehash;if(f==null||f==="")return(h||(h=b("Promise"))).reject(c("err")("media_entry: encFilehash does not exist"));var g=(yield d("WAWebMediaHosts").mediaHosts.getHostsInfo({operation:c("WAWebMmsOperationsConst").DOWNLOAD,encFilehash:f,type:this.type})),i=g.selectedHost;g=g.fallbackHost;e=Boolean(e)&&g?g:i;return c("WAWebMmsClientFormatDownloadUrl")({directPath:a?null:this.directPath,encFilehash:f,hostname:e.hostname,type:this.type})});function e(b){return a.apply(this,arguments)}return e}();return a}(a);e=function(){function a(){this.entries=[]}var b=a.prototype;b.$1=function(a){var b=a.foundEntry,c=a.mediaKey,e=a.mediaKeyTimestamp,f=a.encFilehash,g=a.sidecar,h=a.directPath,i=a.firstFrameSidecar,k=a.scansSidecar,l=a.scanLengths,n=a.deprecatedMms3Url;a=a.staticUrl;if(b instanceof m&&c!=null&&c!==""&&!d("WABase64Equal").b64Equal(b.mediaKey,c)){var o=b.mediaKey.replace("=","").split("\n")[0];c=c.replace("=","").split("\n")[0];d("WALogger").ERROR(j(),b.type,o===c,JSON.stringify({before:{hasDirectPath:Boolean(b.directPath),hasEncFilehash:Boolean(b.encFilehash),hasMediaKey:Boolean(b.mediaKey),hasDeprecatedMms3Url:Boolean(b.deprecatedMms3Url)},after:{hasDirectPath:Boolean(h),hasEncFilehash:Boolean(f),hasDeprecatedMms3Url:Boolean(n)}},null,2)).sendLogs("media-key-mismatch-same-mms3-url");return null}b instanceof m&&e!=null&&(b.mediaKeyTimestamp=e);g&&(b.sidecar=g);i&&(b.firstFrameSidecar=i);k&&(b.scansSidecar=k);(l==null?void 0:l.length)&&(b.scanLengths=l);a&&(b.staticUrl=a);b.directPath=h;return b};b.updateEntry=function(a){var b=a.deprecatedMms3Url,c=a.mediaKey,d=a.mediaKeyTimestamp,e=a.encFilehash;a.type;var f=a.sidecar,g=a.directPath,h=a.firstFrameSidecar,i=a.scansSidecar,j=a.scanLengths;a=a.staticUrl;var k=this.getEntryByEncFilehash({encFilehash:e,deprecatedMms3Url:b});if(!k)return;return this.$1({foundEntry:k,mediaKey:c,mediaKeyTimestamp:d,encFilehash:e,sidecar:f,directPath:g,firstFrameSidecar:h,scansSidecar:i,scanLengths:j,deprecatedMms3Url:b,staticUrl:a})};b.addUnencryptedEntry=function(a){var b=this.updateUnencryptedEntry({filehash:a.filehash,directPath:a.directPath});if(b){b.handle=a.handle;return b}b=new l({deprecatedMms3Url:a.directPath,filehash:a.filehash,type:a.type,directPath:a.directPath,handle:a.handle,thumbnailDirectPath:a.thumbnailDirectPath,thumbnailSha256:a.thumbnailSha256});this.entries.push(b);return b};b.updateUnencryptedEntry=function(a){var b=a.directPath!=null?this.getUnencryptedEntry(a.filehash,a.directPath):null;if(!b||!(b instanceof l))return null;a.directPath!=null&&(b.directPath=a.directPath);return b};b.addEntry=function(a){var b=a.deprecatedMms3Url,c=a.mediaKey,e=a.mediaKeyTimestamp,f=a.encFilehash,g=a.type,h=a.sidecar,j=a.directPath,k=a.firstFrameSidecar,l=a.scansSidecar,n=a.scanLengths,o=a.staticUrl,p=a.debugHint;f==null&&d("WALogger").ERROR(i(),g,p).devConsole(a).sendLogs("media-entry-missing-upload-hash-"+g+"-"+p);a=this.entries;p=this.getEntryByEncFilehash({encFilehash:f,deprecatedMms3Url:b});p=p?this.$1({foundEntry:p,mediaKey:c,mediaKeyTimestamp:e,encFilehash:f,sidecar:h,directPath:j,firstFrameSidecar:k,scansSidecar:l,scanLengths:n,deprecatedMms3Url:b,staticUrl:o}):null;if(p instanceof m)return p;if(!c)return null;p=new m({deprecatedMms3Url:b,mediaKey:c,mediaKeyTimestamp:e,encFilehash:f,type:g,sidecar:h,directPath:j,firstFrameSidecar:k,scansSidecar:l,scanLengths:n,staticUrl:o});a.push(p);return p};b.$2=function(a){var b=a.encFilehash;a=a.deprecatedMms3Url;return b==null?"mms3:"+a:b};b.has=function(a){return this.getEntryByEncFilehash(a)instanceof m};b.hasUnencryptedEntry=function(a){return a.filehash==null||a.directPath==null?!1:this.getUnencryptedEntry(a.filehash,a.directPath)instanceof l};b.getEntryByEncFilehash=function(a){var b=this,c=this.$2(a);return this.entries.find(function(a){return a instanceof m&&b.$2({encFilehash:a.encFilehash,deprecatedMms3Url:a.deprecatedMms3Url})===c})};b.getUnencryptedEntry=function(a,b){return this.entries.find(function(c){return c instanceof l&&c.filehash===a&&c.directPath===b})};b.$3=function(a){return this.entries.filter(function(b){return a?b instanceof m:b instanceof l})};b.getUploadEntry=function(a){n(this);return this.$3(a)[0]};b.getDownloadEntry=function(a){n(this);return this.$3(a).find(function(a){return a.validateForDownloads()})};b.clearEntries=function(){this.entries=[]};return a}();function n(a){a.entries.sort(function(a,b){var c=o(b)-o(a);if(c!==0)return c;a=a.getMediaKeyTimestamp();b=b.getMediaKeyTimestamp();return a==null||b==null?c:b-a})}function o(a){var b=0;switch(a.serverStatus){case k.PROBABLY_ON_SERVER:b+=200;break;case k.PROBABLY_OFF_SERVER:break;case k.UNKNOWN:b+=100;break}a.getEncfilehash()!=null&&(b+=20);return b}g.AbstractMediaEntry=a;g.UnencryptedMediaEntry=l;g.EncryptedMediaEntry=m;g.MediaEntryList=e}),98); __d("WAWebMmsConst",[],(function(a,b,c,d,e,f){a=100;f.FILE_PROGRESS_THROTTLE_WAIT_MS=a}),66); __d("WAWebWamEnumStickerErrorType",[],(function(a,b,c,d,e,f){a=Object.freeze({DECOMPRESSION:2,SENDER_VALIDATION:3,RECEIVER_VALIDATION:4});f.STICKER_ERROR_TYPE=a}),66); __d("WAWebStickerErrorWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumStickerErrorType"],(function(a,b,c,d,e,f,g){a=d("WAWebWamCodegenUtils").defineEvents({StickerError:[5024,{stickerErrorType:[1,d("WAWebWamEnumStickerErrorType").STICKER_ERROR_TYPE]},[1,1,1],"regular"]},{StickerError:[]});g.StickerErrorWamEvent=a}),98); __d("WAWebWamEnumStickerLatencyAction",[],(function(a,b,c,d,e,f){a=Object.freeze({DECOMPRESSION:2});f.STICKER_LATENCY_ACTION=a}),66); __d("WAWebStickerLatencyWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumStickerLatencyAction"],(function(a,b,c,d,e,f,g){a=d("WAWebWamCodegenUtils").defineEvents({StickerLatency:[5026,{size:[1,d("WAWebWamCodegenUtils").TYPES.INTEGER],stickerLatencyAction:[2,d("WAWebWamEnumStickerLatencyAction").STICKER_LATENCY_ACTION],stickerLatencyTtAction:[3,d("WAWebWamCodegenUtils").TYPES.INTEGER]},[1,1,1],"regular"]},{StickerLatency:[]});g.StickerLatencyWamEvent=a}),98); __d("WAWebWebcProgressiveImageWamEvent",["WAWebWamCodegenUtils"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({WebcProgressiveImage:[2226,{webcFirstRenderScans:[1,a.TYPES.INTEGER],webcFirstRenderT:[2,a.TYPES.TIMER],webcFullQualityT:[4,a.TYPES.TIMER],webcMidQualityT:[3,a.TYPES.TIMER]},[1,1,10],"regular"]},{WebcProgressiveImage:[]});g.WebcProgressiveImageWamEvent=b}),98); __d("WAWebMediaMmsV4Download",["WAAbortError","WABlobToArrayBuffer","WACustomError","WAFilteredCatch","WALogger","WANullthrows","WARaceSignal","WAWebABProps","WAWebCryptoImageStreamer","WAWebDownloadManager","WAWebDownloadManagerErrors","WAWebFileUtils","WAWebInMemoryLottieStickerCache","WAWebMediaCryptoEligibilityUtils","WAWebMediaDataUtils","WAWebMediaEntry","WAWebMediaInMemoryBlobCache","WAWebMediaLoad","WAWebMediaOpaqueData","WAWebMediaTypes","WAWebMimeTypes","WAWebMiscErrors","WAWebMmsClientErrors","WAWebMmsConst","WAWebMmsMediaTypes","WAWebStickerErrorWamEvent","WAWebStickerLatencyWamEvent","WAWebStickerMimeUtils","WAWebVcardParsingUtils","WAWebWamEnumStickerErrorType","WAWebWamEnumStickerLatencyAction","WAWebWebcProgressiveImageWamEvent","asyncToGeneratorRuntime","err","fflate","isStringNullOrEmpty","lodash"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["checkExistence: error"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Failed to extract Lottie Sticker zip file ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Failed to extract Lottie Sticker for trimmed-filehash: "," "]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["downloadMedia: error"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["Assertion failed! ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["downloadMedia: error: ",", ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["Assertion failed! ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["downloadMedia: error: ",", ",""]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["Assertion failed! ",""]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["downloadMedia: media unsupported error: ",", ",", ",""]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["Assertion failed!"]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["Unexpected download error: ",""]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["Assertion failed! ",""]);t=function(){return a};return a}function u(){var a=babelHelpers.taggedTemplateLiteralLoose(["downloadMedia: media unsupported error: ",", ",", ",""]);u=function(){return a};return a}function v(){var a=babelHelpers.taggedTemplateLiteralLoose(["Failed to retrieve blob text contents ",""]);v=function(){return a};return a}function w(){var a=babelHelpers.taggedTemplateLiteralLoose(["Assertion failed!"]);w=function(){return a};return a}var x=function(b){babelHelpers.inheritsLoose(a,b);function a(){return b.apply(this,arguments)||this}return a}(d("WACustomError").customError("NoEntryAfterRMR")),y=function(b){babelHelpers.inheritsLoose(a,b);function a(){return b.apply(this,arguments)||this}return a}(d("WACustomError").customError("MissingEncFilehash")),z={THUMBNAIL:1,LOW:2,MID:3,FULL:4},A=new WeakMap();function a(a){a.getDownloadPromises().forEach(function(a){var b;if(a==null)return;b=(b=A.get(a))==null?void 0:b.abort;if(b==null)return;A["delete"](a);b()})}function e(a){return B.apply(this,arguments)}function B(){B=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.mimetype,c=a.mediaObject,e=a.mediaBlob,f=a.mediaType,g=a.rmrReason,h=a.downloadOrigin;a=a.chatWid;if(c.mediaBlob)return;yield d("WAWebMediaDataUtils").gatherAndSetMetadata(c,e);yield E({mimetype:b,mediaObject:c,downloadEvenIfExpensive:!1,mediaType:f,rmrReason:g,downloadOrigin:h,chatWid:a})});return B.apply(this,arguments)}function C(a){return D.apply(this,arguments)}function D(){D=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.mimetype,e=c("lodash").throttle(function(b){a.mediaObject.consolidate({loadedSize:b.loaded})},d("WAWebMmsConst").FILE_PROGRESS_THROTTLE_WAIT_MS);e=(yield d("WAWebDownloadManager").downloadManager.downloadAndMaybeDecrypt({directPath:a.directPath,encFilehash:a.encFilehash,filehash:a.objFilehash,isFinalRmrRetry:a.isFinalRmrRetry,mediaKey:a.mediaKey,mediaKeyTimestamp:a.mediaKeyTimestamp,signal:a.signal,staticUrl:a.staticUrl,type:a.mediaType,onDecryptStart:function(){a.mediaObject.consolidate({downloadStage:d("WAWebMediaTypes").DownloadStage.PROCESSING})},onProgress:e,userDownloadAttemptCount:a.mediaObject.userDownloadAttemptCount,downloadOrigin:a.downloadOrigin,mode:a.mode,progressiveJpegOpts:L({scanLengths:a.scanLengths,scansSidecar:a.scansSidecar,mimetype:b,mediaObject:a.mediaObject,signal:a.signal}),isViewOnce:a.isViewOnce,imageDimensions:a.mediaType===d("WAWebMmsMediaTypes").MEDIA_TYPES.IMAGE?{fileHeight:(e=a.mediaObject.contentInfo.fullHeight)!=null?e:0,fileWidth:(e=a.mediaObject.contentInfo.fullWidth)!=null?e:0}:void 0,chatWid:a.chatWid}));b=b!=null&&b!==""?b:d("WAWebMimeTypes").getMediaMimeType(a.mediaType,new Uint8Array(e));return new Blob([e],{type:b})});return D.apply(this,arguments)}function E(a){return F.apply(this,arguments)}function F(){F=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=a.mimetype,f=a.mediaObject,g=a.downloadEvenIfExpensive,h=a.mediaType,i=a.signal,j=a.rmrReason,z=a.rmrData,B=a.downloadOrigin,D=a.shouldThrow,F=a.isVcardOverMmsDocument,G=a.mode,H=a.isAutoDownload,I=a.isFinalRmrRetry,J=a.isViewOnce,K=a.chatWid,L=D===!0,M=!H;if(!f)return;var N=f.filehash;if(c("isStringNullOrEmpty")(N))return;a=O(f,h);a&&M&&(a.shouldStoreInMemory=!0);D=f.getDownloadPromise(h);if(D)return D;if(f.downloadStage===d("WAWebMediaTypes").DownloadStage.ERROR_MISSING)return;if(f.downloadStage===d("WAWebMediaTypes").DownloadStage.PREPARING)return;if(f.mediaBlob){a=(yield f.mediaBlob.validate());if(a){f.consolidate({downloadStage:d("WAWebMediaTypes").DownloadStage.RESOLVED});return}f.clearBlob();f.consolidate({downloadStage:d("WAWebMediaTypes").DownloadStage.NEED_POKE});f.notifyMsgsAsync();return}var Q=d("WAWebMediaInMemoryBlobCache").InMemoryMediaBlobCache.get(N),R,S=new AbortController();return c("WARaceSignal")([S.signal,i].filter(Boolean),function(a){var i,T=function(){var i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(Q)D=Q;else{R=f.entries.getDownloadEntry(d("WAWebMediaCryptoEligibilityUtils").isMediaCryptoExpectedForMediaType(h));if(!R)if(g&&d("WAWebMediaCryptoEligibilityUtils").isRmrSupportedForMediaType(h)){yield d("WAWebDownloadManager").downloadManager.rmr({mediaObject:f,signal:a,rmrReason:j,rmrData:z});R=f.entries.getDownloadEntry(d("WAWebMediaCryptoEligibilityUtils").isMediaCryptoExpectedForMediaType(h));if(!R){if(h!==d("WAWebMmsMediaTypes").MEDIA_TYPES.STICKER)throw new x();return}}else{if(!d("WAWebMediaCryptoEligibilityUtils").isRmrSupportedForMediaType(h))throw new(d("WAWebDownloadManagerErrors").MediaNotOnPhone)();f.consolidate({downloadStage:d("WAWebMediaTypes").DownloadStage.NEED_POKE});return}f.consolidate({downloadStage:d("WAWebMediaTypes").DownloadStage.FETCHING});R=c("WANullthrows")(R);var b=R,i=b.scansSidecar,k=b.scanLengths,l=b.directPath;b=b.staticUrl;if(R instanceof d("WAWebMediaEntry").EncryptedMediaEntry&&R.getEncfilehash()==null){var m;(m=R)==null?void 0:m.markWhetherOnServer(!1);throw new y()}l=(yield C({directPath:l,encFilehash:(m=R)==null?void 0:m.getEncfilehash(),objFilehash:N,isFinalRmrRetry:I,mediaKey:(l=R)==null?void 0:l.getMediaKey(),mediaKeyTimestamp:(m=R)==null?void 0:m.getMediaKeyTimestamp(),signal:a,staticUrl:b,mediaType:h,mediaObject:f,downloadOrigin:B,mode:G,scanLengths:k,mimetype:e,scansSidecar:i,isViewOnce:J,chatWid:K}));P(h)?D=(yield d("WAWebMediaLoad").transcode(l)):D=l}D.type===d("WAWebStickerMimeUtils").WhatsAppLottieStickerMimeType&&(d("WAWebInMemoryLottieStickerCache").InMemoryLottieStickerCache.has(N)||(yield d("WAWebInMemoryLottieStickerCache").extractAndSetLottieJSONInMemoryCache(N,D)),f.consolidate({isLottie:!0}));if(D.type==="text/vcard"&&F===!0)try{m=(yield d("WAWebFileUtils").blobToText(D));if(m){b=d("WAWebVcardParsingUtils").parseMultiVcard(m);b.length>0?f.consolidate({parsedVcards:b}):d("WALogger").ERROR(w()).tags("non-sad").sendLogs("vcard_over_mms:Failed to parse vcard over mms contents")}}catch(a){d("WALogger").ERROR(v(),String(a)).tags("non-sad").sendLogs("vcard_over_mms:blobToText failed with error: "+String(a))}if(!d("WAWebMediaDataUtils").shouldUseMediaCache(h)){k=(yield c("WAWebMediaOpaqueData").createFromData(D,D.type));yield d("WAWebMediaDataUtils").gatherAndSetMetadata(f,k)}else{i=O(f,h);((i==null?void 0:i.shouldStoreInMemory)||M)&&(d("WAWebMediaInMemoryBlobCache").InMemoryMediaBlobCache.put(N,D),yield d("WAWebMediaDataUtils").gatherAndSetMetadataNoOpaque(f,D))}f.consolidate({downloadStage:d("WAWebMediaTypes").DownloadStage.RESOLVED});f.clearDownloadPromise(h);return f.resolveWhenConsolidated()});return function(){return i.apply(this,arguments)}}();T=T()["catch"]((T=d("WAFilteredCatch")).filteredCatch(d("WAWebMmsClientErrors").MediaNotFoundError,function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!R)throw a;R.markWhetherOnServer(!1);if(!g)throw a;yield d("WAWebDownloadManager").downloadManager.rmr({mediaObject:f,signal:new AbortController().signal,rmrReason:j,rmrData:z});f.clearDownloadPromise(h);return E({mimetype:e,mediaObject:f,downloadEvenIfExpensive:!1,mediaType:h,rmrReason:j,rmrData:z,downloadOrigin:B,isFinalRmrRetry:!0,isVcardOverMmsDocument:F,mode:G,isAutoDownload:H,chatWid:K})});return function(b){return a.apply(this,arguments)}}()))["catch"](T.filteredCatch(d("WAWebMiscErrors").MediaUnsupportedError,function(a){f.consolidate({downloadStage:d("WAWebMediaTypes").DownloadStage.ERROR_UNSUPPORTED});d("WALogger").WARN(u(),a.name,a.message,e||"");d("WALogger").ERROR(t(),a.message).tags("non-sad").sendLogs("downloadMedia: media unsupported error:");if(L)throw a}))["catch"](T.filteredCatch(d("WAWebDownloadManagerErrors").MediaNotOnPhone,function(a){f.consolidate({downloadStage:d("WAWebMediaTypes").DownloadStage.ERROR_MISSING});if(L)throw a}))["catch"](T.filteredCatch([x,y],function(a){f.consolidate({downloadStage:d("WAWebMediaTypes").DownloadStage.ERROR_MISSING});if(a===x&&h===d("WAWebMmsMediaTypes").MEDIA_TYPES.STICKER)return;d("WALogger").WARN(s(),a.name).devConsole(a.message,a.stack);d("WALogger").ERROR(r()).tags("non-sad").sendLogs("unexpected download error: "+a.name);if(L)throw a}))["catch"](T.filteredCatch([d("WAWebMiscErrors").MediaDecryptionError,d("WAWebMiscErrors").MediaHashMismatch],function(a){var b=f.progressiveStage;S.abort();f.consolidate({downloadStage:d("WAWebMediaTypes").DownloadStage.NEED_POKE,progressiveStage:null});f.notifyMsgsAsync();f["delete"]();d("WAWebCryptoImageStreamer").deleteFromInMemoryMediaBlobCache(N,b);if(L)throw a}))["catch"](function(a){f.consolidate({downloadStage:d("WAWebMediaTypes").DownloadStage.NEED_POKE});if(a instanceof d("WAWebMiscErrors").MediaLoadError){d("WALogger").WARN(q(),a.name,a.message,e||"");d("WALogger").ERROR(p(),a.message).tags("non-sad").sendLogs("downloadMedia: media load error:",{sampling:0});if(L)throw a;return}if(a instanceof d("WAWebMiscErrors").TranscodeBlobTooLargeError){d("WALogger").WARN(o(),a.message,e||"");d("WALogger").ERROR(n(),a.message).tags("non-sad").sendLogs("downloadMedia: transcode blob too large",{sampling:0});if(L)throw a;return}if(a instanceof d("WAWebMiscErrors").UnableToPlayVideoError){d("WALogger").WARN(m(),a.message,e||"");d("WALogger").ERROR(l(),a.message).tags("non-sad").sendLogs("downloadMedia: unable to play video",{sampling:0});if(L)throw a;return}if(a.name===d("WAAbortError").ABORT_ERROR){if(L)throw a;return}d("WALogger").LOG(k()).devConsole(a.name,a.message,a.stack);if(L)throw a})["finally"](function(){f.clearDownloadPromise(h)});A.set(T,{abort:function(){S.abort()},shouldStoreInMemory:((i=O(f,h))==null?void 0:i.shouldStoreInMemory)||M});f.setDownloadPromise(T,h);return T})});return F.apply(this,arguments)}var G=function(a){var b=/animation\/animation.json$/,c=Object.keys(a).find(function(a){return b.test(a)});return c!=null?a[c]:void 0};function f(a,b){return H.apply(this,arguments)}function H(){H=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){try{var e=new(d("WAWebStickerLatencyWamEvent").StickerLatencyWamEvent)({size:a.size,stickerLatencyAction:d("WAWebWamEnumStickerLatencyAction").STICKER_LATENCY_ACTION.DECOMPRESSION}),f=self.performance.now();a=(yield d("WABlobToArrayBuffer").blobToArrayBuffer(a));a=new Uint8Array(a);a=d("fflate").unzipSync(a);a=G(a);if(!a)throw c("err")("animationContents missing");if(a){a=new TextDecoder("utf-8").decode(a);e.stickerLatencyTtAction=Math.ceil(self.performance.now()-f);d("WAWebABProps").getABPropConfigValue("gimmick_phase_two_logging_enabled")&&e.commit();return a}}catch(a){d("WAWebABProps").getABPropConfigValue("gimmick_phase_two_logging_enabled")&&new(d("WAWebStickerErrorWamEvent").StickerErrorWamEvent)({stickerErrorType:d("WAWebWamEnumStickerErrorType").STICKER_ERROR_TYPE.DECOMPRESSION}).commit(),d("WALogger").DEV(j(),b.slice(0,10)),d("WALogger").ERROR(i(),String(a)).tags("non-sad").sendLogs("lottie_sticker:Failed to extract Lottie Sticker zip file")}});return H.apply(this,arguments)}function I(a){return J.apply(this,arguments)}function J(){J=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a.mimetype;var b=a.mediaObject;a=a.mediaType;var e=b.filehash;if(c("isStringNullOrEmpty")(e))return;if(b.downloadStage!==d("WAWebMediaTypes").DownloadStage.INIT)return;if(yield M(b))return;e=d("WAWebMediaInMemoryBlobCache").InMemoryMediaBlobCache.get(e);var f=new AbortController();if(e){b.downloadStage===d("WAWebMediaTypes").DownloadStage.INIT&&b.consolidate({downloadStage:d("WAWebMediaTypes").DownloadStage.EXISTS});return}e=b.entries.getDownloadEntry(d("WAWebMediaCryptoEligibilityUtils").isMediaCryptoExpectedForMediaType(a));if(!e){b.downloadStage===d("WAWebMediaTypes").DownloadStage.INIT&&b.consolidate({downloadStage:d("WAWebMediaTypes").DownloadStage.NEED_POKE});return}if(e instanceof d("WAWebMediaEntry").UnencryptedMediaEntry)return;var g=e.getEncfilehash();if(c("isStringNullOrEmpty")(g)){e.markWhetherOnServer(!1);b.downloadStage===d("WAWebMediaTypes").DownloadStage.INIT&&b.consolidate({downloadStage:d("WAWebMediaTypes").DownloadStage.NEED_POKE});return}try{yield d("WAWebDownloadManager").downloadManager.checkExistence({directPath:e.directPath,encFilehash:g,signal:f.signal,type:a}),b.downloadStage===d("WAWebMediaTypes").DownloadStage.INIT&&b.consolidate({downloadStage:d("WAWebMediaTypes").DownloadStage.EXISTS})}catch(a){b.downloadStage===d("WAWebMediaTypes").DownloadStage.INIT&&b.consolidate({downloadStage:d("WAWebMediaTypes").DownloadStage.NEED_POKE}),d("WALogger").LOG(h()).devConsole(a.name,a.message,a.stack)}});return J.apply(this,arguments)}function K(a,b){return!!(a&&b&&a.length>=2&&a.length*10===b.byteLength)}function L(a){var b=a.scanLengths,e=a.scansSidecar,f=a.mimetype,g=a.mediaObject,h=a.signal;if(!K(b,e))return null;var i=new(d("WAWebWebcProgressiveImageWamEvent").WebcProgressiveImageWamEvent)({webcFirstRenderScans:0});return{mimetype:f,scansSidecar:c("WANullthrows")(e),scanLengths:c("WANullthrows")(b),onProgressiveUpdate:function(a){if(h.aborted)return;if(g.downloadStage===d("WAWebMediaTypes").DownloadStage.RESOLVED)return;g.consolidate({downloadStage:d("WAWebMediaTypes").DownloadStage.PROGRESSIVE_READY,progressiveStage:a});i.webcFirstRenderScans||(i.webcFirstRenderScans=a,i.markWebcFirstRenderT());a>=z.MID&&!i.webcMidQualityT&&i.markWebcMidQualityT();a===z.FULL&&!i.webcFullQualityT&&(i.markWebcFullQualityT(),i.commit())}}}function M(a){return N.apply(this,arguments)}function N(){N=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!a.mediaBlob)return!1;var b=(yield a.mediaBlob.validate());if(b){a.consolidate({downloadStage:d("WAWebMediaTypes").DownloadStage.RESOLVED});return!0}a.clearBlob();a.consolidate({downloadStage:d("WAWebMediaTypes").DownloadStage.NEED_POKE});a.notifyMsgsAsync();return!1});return N.apply(this,arguments)}function O(a,b){a=a.getDownloadPromise(b);return a?A.get(a):null}function P(a){return a===d("WAWebMmsMediaTypes").MEDIA_TYPES.PTT||a===d("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_PTT||a===d("WAWebMmsMediaTypes").MEDIA_TYPES.AUDIO||a===d("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_AUDIO}g.NoEntryAfterRMR=x;g.MissingEncFilehash=y;g.cancelDownloadMedia=a;g.manuallySetMedia=e;g.downloadMedia=E;g.getContentsOfLottieJSONFile=G;g.extractLottieJSON=f;g.checkExistence=I}),98); __d("WAWebHDMediaUtils",["WAWebABProps"],(function(a,b,c,d,e,f,g){function a(a,b){a=Math.max(a,b);return a>=d("WAWebABProps").getABPropConfigValue("original_quality_image_min_edge")}function b(a,b){if(!d("WAWebABProps").getABPropConfigValue("hd_video_label_enabled"))return!1;a=[Math.max(a,b),Math.min(a,b)];b=a[0];a=a[1];return a>=d("WAWebABProps").getABPropConfigValue("hd_video_definition_min_edge")?!0:b>d("WAWebABProps").getABPropConfigValue("hd_video_definition_max_edge")&&a>=d("WAWebABProps").getABPropConfigValue("hd_video_definition_min_edge_with_max_edge")}g.isHdPhoto=a;g.isHdVideo=b}),98); __d("WAWebWamEnumDownloadOriginType",[],(function(a,b,c,d,e,f){a=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,COMMUNITY:12,CHANNEL:13,BROADCAST:14,INTEROP:15,WAMO_STATUS:16,WAMO_BIZ_PROFILE:17});f.DOWNLOAD_ORIGIN_TYPE=a}),66); __d("WAWebMediaGetDownloadOriginFromUploadOrigin",["WAWebWamEnumDownloadOriginType","WAWebWamEnumUploadOriginType"],(function(a,b,c,d,e,f,g){function a(a){switch(a){case d("WAWebWamEnumUploadOriginType").UPLOAD_ORIGIN_TYPE.CHAT_PERSONAL:return d("WAWebWamEnumDownloadOriginType").DOWNLOAD_ORIGIN_TYPE.CHAT_PERSONAL;case d("WAWebWamEnumUploadOriginType").UPLOAD_ORIGIN_TYPE.CHANNEL:return d("WAWebWamEnumDownloadOriginType").DOWNLOAD_ORIGIN_TYPE.CHANNEL;case d("WAWebWamEnumUploadOriginType").UPLOAD_ORIGIN_TYPE.COMMUNITY:return d("WAWebWamEnumDownloadOriginType").DOWNLOAD_ORIGIN_TYPE.COMMUNITY;default:return d("WAWebWamEnumDownloadOriginType").DOWNLOAD_ORIGIN_TYPE.CHAT_GROUP}}g.getDownloadOriginFromUploadOrigin=a}),98); __d("WAWebMediaMmsV4Upload",["Promise","WAAbortError","WAFilteredCatch","WALogger","WAMediaCalculateFilehash","WAWebCreateMediaUploadMetrics","WAWebDownloadManagerErrors","WAWebFileUtils","WAWebHDMediaUtils","WAWebMediaCryptoEligibilityUtils","WAWebMediaDataUtils","WAWebMediaEntry","WAWebMediaGatingUtils","WAWebMediaGetDownloadOriginFromUploadOrigin","WAWebMediaInMemoryBlobCache","WAWebMediaLoad","WAWebMediaMmsV4Download","WAWebMediaTypes","WAWebMiscErrors","WAWebMmsClientErrors","WAWebMmsConst","WAWebMmsMediaTypes","WAWebUploadManager","WAWebWamEnumWebcRmrReasonCode","asyncToGeneratorRuntime","err","lodash"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["MediaAlgo.uploadMedia: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["MediaAlgo.uploadMedia: canceled"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["MediaAlgo.uploadMedia: success"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[_uploadMediaAndManageErrors]: isNewEntry: "," uploadEntry.mediaKey length "," - mediaKeyInfo.mediaKey length ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["uploadEntry.mediaKey and mediaKeyInfo.mediaKey should be the same, mediaType: ",""]);m=function(){return a};return a}var n=new WeakMap();function a(a){a.getUploadPromises().forEach(function(a){if(a==null)return;var b=n.get(a);if(b==null)return;n["delete"](a);b()})}var o={SUCCESS:"success",CANCELLATION:"cancellation",ERROR:"error",TIMEOUT:"timeout"};function p(a){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.blob,e=a.canEnableFastForward;e=e===void 0?!0:e;var f=a.forwardedFromWeb,g=a.mediaKeyInfo,h=a.mediaObject,i=a.mediaType,j=a.signal,k=a.uploadEntry,l=a.uploadOrigin,m=a.isViewOnce;a=a.earlyUpload;if(k instanceof d("WAWebMediaEntry").EncryptedMediaEntry&&(k==null?void 0:k.canReuseMediaKey())&&e){c("WAWebCreateMediaUploadMetrics")(i,l,0,f,m).handleCheckExistingSuccess();return k}e=(yield a);if(e!=null)return h.entries.addEntry({deprecatedMms3Url:e.url,mediaKey:e.mediaKey,mediaKeyTimestamp:e.mediaKeyTimestamp,encFilehash:e.encFilehash,type:i,sidecar:e.sidecar,directPath:e.directPath,firstFrameSidecar:e.firstFrameSidecar,debugHint:"upload"});a=function(){h.consolidate({uploadStage:d("WAWebMediaTypes").UploadStage.FINALIZING})};e=c("lodash").throttle(function(a,b){a=a.loaded+b;Number.isFinite(a)&&h.consolidate({loadedSize:a})},d("WAWebMmsConst").FILE_PROGRESS_THROTTLE_WAIT_MS);var n=g?g.key:k==null?void 0:k.getMediaKey();g=g?g.timestamp:k==null?void 0:k.getMediaKeyTimestamp();n=(yield c("WAWebUploadManager").encryptAndUpload({blob:b,mediaKey:n,mediaKeyTimestamp:g,type:i,signal:j,userUploadAttemptCount:h.userUploadAttemptCount,forwardedFromWeb:f,uploadOrigin:l,onProgress:e,onFinalize:a,isViewOnce:m,isHdPhoto:i===d("WAWebMmsMediaTypes").MEDIA_TYPES.IMAGE&&d("WAWebHDMediaUtils").isHdPhoto((k=h.contentInfo.fullHeight)!=null?k:0,(b=h.contentInfo.fullWidth)!=null?b:0)}));g=n.directPath;j=n.encFilehash;f=n.mediaKey;l=n.mediaKeyTimestamp;e=n.url;a=n.sidecar;m=n.firstFrameSidecar;return h.entries.addEntry({deprecatedMms3Url:e,mediaKey:f,mediaKeyTimestamp:l,encFilehash:j,type:i,sidecar:a,directPath:g,firstFrameSidecar:m,debugHint:"upload"})});return q.apply(this,arguments)}function r(a){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.blob,e=a.mediaObject,f=a.mediaType,g=a.signal,h=a.uploadOrigin,i=a.isViewOnce;a=a.calculateToken;b=(yield d("WAWebFileUtils").blobToArrayBuffer(b));var j=(yield d("WAMediaCalculateFilehash").calculateFilehash(b));b=(yield c("WAWebUploadManager").unencryptedUpload({file:b,isViewOnce:i,signal:g,type:f,uploadOrigin:h,hash:j,token:yield a==null?void 0:a(j),generateThumbnailOnServer:d("WAWebMediaGatingUtils").isThumbnailGenerationOnServerEnabledForMediaType(f)}));return e.entries.addUnencryptedEntry({directPath:b.directPath,debugHint:"upload",filehash:j,type:f,handle:b.handle,thumbnailDirectPath:b.thumbnailDirectPath,thumbnailSha256:b.thumbnailSha256})});return s.apply(this,arguments)}function e(a){return t(a,p)}function f(a){return t(a,r)}function t(a,e){var f=a.mimetype,g=a.canEnableFastForward,p=g===void 0?!0:g,q=a.mediaObject,r=a.mediaType,s=a.forwardedFromWeb,t=a.uploadOrigin;g=a.mediaKeyInfo;var v=a.isViewOnce,w=a.earlyUpload,x=a.calculateToken,y=g;a=q.getUploadPromise(r);if(a)return a;var z=new AbortController(),A=z.signal;g=(h||(h=b("Promise"))).resolve().then(function(){q.consolidate({uploadStage:d("WAWebMediaTypes").UploadStage.UPLOADING})}).then(function(){return u({mediaObject:q,mimetype:f,mediaType:r,abortSignal:A,uploadOrigin:t})}).then(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b;p&&(b=q.entries.getUploadEntry(d("WAWebMediaCryptoEligibilityUtils").isMediaCryptoExpectedForMediaType(r)));if(b instanceof d("WAWebMediaEntry").EncryptedMediaEntry&&y&&b.mediaKey!==y.key){var f=y;d("WALogger").ERROR(m(),r).sendLogs("media-keys-not-the-same-"+r);var g=!q.entries.entries.some(function(a){return a.getMediaKey()===f.key});d("WALogger").LOG(l(),g,(g=b.mediaKey)==null?void 0:g.length,(g=f.key)==null?void 0:g.length);if(r===d("WAWebMmsMediaTypes").MEDIA_TYPES.STICKER)y=null;else throw c("err")("uploadEntry.mediaKey and mediaKeyInfo.mediaKey should be the same")}var h=(yield e({blob:a,canEnableFastForward:p,forwardedFromWeb:s,mediaKeyInfo:y,mediaObject:q,mediaType:r,signal:A,uploadEntry:b,uploadOrigin:t,isViewOnce:v,earlyUpload:w,calculateToken:x}));if(!h)throw c("err")("could not create media entry");if((r===d("WAWebMmsMediaTypes").MEDIA_TYPES.PTT||r===d("WAWebMmsMediaTypes").MEDIA_TYPES.AUDIO)&&!d("WAWebMediaDataUtils").canPlayOgg())if(d("WAWebMediaDataUtils").shouldUseMediaCache(r)){var i=q.filehash;if(i&&q.mediaBlob)return d("WAWebMediaLoad").transcode(q.mediaBlob.formData()).then(function(a){d("WAWebMediaInMemoryBlobCache").InMemoryMediaBlobCache.put(i,a)}).then(function(){return h})}else if(q.mediaBlob)return d("WAWebMediaDataUtils").gatherAndSetMetadata(q,q.mediaBlob).then(function(){return h});return h});return function(b){return a.apply(this,arguments)}}()).then(function(a){var b;if(A.aborted)throw new(d("WAAbortError").AbortError)();q.consolidate({uploadStage:d("WAWebMediaTypes").UploadStage.UPLOADED});d("WALogger").LOG(k()).devConsole((b=a.getEncfilehash())!=null?b:a.getFilehash());return{kind:o.SUCCESS,mediaEntry:a}})["catch"](function(a){a.name===d("WAAbortError").ABORT_ERROR?d("WALogger").LOG(j()).devConsole(a):d("WALogger").WARN(i(),a).devConsole(a);throw a})["finally"](function(){q.clearUploadPromise(r)})["catch"](d("WAFilteredCatch").filteredCatch(d("WAWebMiscErrors").FileNotReadableError,function(){q.consolidate({uploadStage:d("WAWebMediaTypes").UploadStage.ERROR_FILE_NOT_READABLE});return{kind:o.ERROR}}))["catch"](d("WAFilteredCatch").filteredCatch(d("WAWebDownloadManagerErrors").MediaNotOnPhone,function(){q.consolidate({uploadStage:d("WAWebMediaTypes").UploadStage.ERROR_MISSING});return{kind:o.ERROR}}))["catch"](d("WAFilteredCatch").filteredCatch(d("WAWebMmsClientErrors").MediaTooLargeError,function(){q.consolidate({uploadStage:d("WAWebMediaTypes").UploadStage.ERROR_TOO_LARGE});return{kind:o.ERROR}}))["catch"](function(a){q.consolidate({uploadStage:d("WAWebMediaTypes").UploadStage.NEED_UPLOAD});return a.name===d("WAAbortError").ABORT_ERROR?{kind:o.CANCELLATION}:{kind:o.ERROR}});n.set(g,function(){z.abort()});q.setUploadPromise(g,r);return g}function u(a){return v.apply(this,arguments)}function v(){v=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.mediaObject,e=a.mimetype,f=a.mediaType,g=a.abortSignal,h=a.uploadOrigin;a=a.chatWid;var i=w(b);if(i)return i;yield d("WAWebMediaMmsV4Download").downloadMedia({mimetype:e,mediaObject:b,downloadEvenIfExpensive:!0,mediaType:f,signal:g,rmrReason:d("WAWebWamEnumWebcRmrReasonCode").WEBC_RMR_REASON_CODE.UPLOAD,downloadOrigin:d("WAWebMediaGetDownloadOriginFromUploadOrigin").getDownloadOriginFromUploadOrigin(h),mode:"manual",chatWid:a});if(b.downloadStage===d("WAWebMediaTypes").DownloadStage.ERROR_MISSING)throw new(d("WAWebDownloadManagerErrors").MediaNotOnPhone)();i=w(b);if(i)return i;throw c("err")("cant upload media w/out mediaBlob after download")});return v.apply(this,arguments)}function w(a){var b=a.mediaBlob;if(b)return b.formData();if(!a.filehash)return;return d("WAWebMediaInMemoryBlobCache").InMemoryMediaBlobCache.get(a.filehash)}g.cancelUploadMedia=a;g.UploadMediaResultKind=o;g.uploadMedia=e;g.uploadUnencryptedMedia=f;g.getOrDownloadBlob=u;g.getBlobFromMediaObject=w}),98); __d("WAWebMediaObject",["Promise","WALogger","WANullthrows","WAShiftTimer","WAWebAck","WAWebCryptoCreateMediaKeys","WAWebInteractiveMessageHeaderMediaType","WAWebMedia","WAWebMediaCryptoEligibilityUtils","WAWebMediaDataUtils","WAWebMediaEntry","WAWebMediaOpaqueData","WAWebMediaTypes","WAWebMmsMediaTypes","WAWebMsgType","WAWebRequestMediaReuploadBridge","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Assertion failed!"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Assertion failed!"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["Assertion failed!"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["type: ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["Assertion failed!"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["Assertion failed!"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["The sticker associated message has been deleted."]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["Assertion failed!"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] mediaObject.downloadStage: ",""]);q=function(){return a};return a}e=function(){function a(){var a=this;this._msgs=[];this._notifyTimer=new(d("WAShiftTimer").ShiftTimer)(function(){u(a),D(a)});this._callOnConsolidate=null;this._keyedProcesses=null;this._pendingChangesCount=0;this._saveMedia=null;this._stickers=[];this._stickerPacks=[];this.entries=new(d("WAWebMediaEntry").MediaEntryList)();this.downloadStage=d("WAWebMediaTypes").DownloadStage.INIT;this.uploadStage=d("WAWebMediaTypes").UploadStage.INIT;this.userUploadAttemptCount=0;this.userDownloadAttemptCount=0;this._encryptedDownloadPromise=null;this._unencryptedDownloadPromise=null;this._encryptedUploadPromise=null;this._unencryptedUploadPromise=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;this.extractedLottieSticker=null}var e=a.prototype;e.consolidate=function(a){if(a.downloadStage){var b;d("WALogger").LOG(q(),(b=this.filehash)==null?void 0:b.slice(0,10),String(a.downloadStage))}if(r(this,a)){this.notifyMsgsAsync();return!0}return!1};e.clearBlob=function(a){var b=this.mediaBlob;b&&(this.mediaBlob=null,b.autorelease());(a==null?void 0:a.reset)===!0&&this._resetDownloadLoadStage()};e._resetDownloadLoadStage=function(){this.consolidate({downloadStage:d("WAWebMediaTypes").DownloadStage.INIT})};e.contentFields=function(){var a=this.type||d("WAWebMediaTypes").TYPE.DOCUMENT;return d("WAWebMediaTypes").FIELDS[a]};e.resolveWhenConsolidated=function(){var a=this;return this._notifyTimer.ts||this._pendingChanges?new(h||(h=b("Promise")))(function(b){a._callOnConsolidate?a._callOnConsolidate.push(b):a._callOnConsolidate=[b]}):(h||(h=b("Promise"))).resolve()};e.notifyMsgsAsync=function(){this._notifyTimer.debounce(0)};e.addMsg=function(a){var b=this._msgs;for(var c=0;c<b.length;c++){var e=b[c],f=e[0];e=e[1];f===a&&!e&&d("WALogger").ERROR(p()).sendLogs("redundant-media-msg")}b.push([a,!1]);this.notifyMsgsAsync()};e.removeMsg=function(a){var b=this._msgs,c=!1;for(var d=0;!c&&d<b.length;d++){var e=b[d],f=e[0];e=e[1];f===a&&!e&&(b[d][1]=!0,c=!0)}};e.hasAssociatedMsgsOrStickers=function(){var a=this._msgs;for(var b=0;b<a.length;b++)if(!a[b][1])return!0;return this.hasAssociatedStickers()||this.hasAssociatedStickerPacks()};e.associatedMsgs=function(){var a=this._msgs,b=[];for(var c=0;c<a.length;c++){var d=a[c],e=d[0];d=d[1];d||b.push(e)}return b};e.rmr=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=this.associatedStickers();if(e.length>0){e=this.associatedMsgs().filter(function(a){return a!=null});if(e.length===0){d("WALogger").LOG(o());return(h||(h=b("Promise"))).resolve(200)}}e=this._msgs.find(function(a){var b=a[0];a=a[1];return!a&&!b.isUnsentPhoneMsg()})||[null];e=e[0];if(!e){d("WALogger").ERROR(n()).sendLogs("media-fault: rmr called on MediaObject with no msg");return(h||(h=b("Promise"))).reject(c("err")("rmr called on MediaObject with no msg"))}a.onMsgSelect(e);a=(yield c("WAWebRequestMediaReuploadBridge")(e));if(a.status===200){var f=e.mediaData.type;if(f==="unknown")return(h||(h=b("Promise"))).reject(c("err")("rmr called on MediaData with unknown type"));e=a.isMD?this.entries.updateEntry({deprecatedMms3Url:e.deprecatedMms3Url,encFilehash:e.encFilehash,directPath:a.directPath}):this.entries.addEntry({deprecatedMms3Url:a.url,mediaKey:a.mediaKey||c("WANullthrows")(e.mediaKey),mediaKeyTimestamp:a.mediaKeyTimestamp,encFilehash:a.encFilehash,type:f,directPath:a.directPath,debugHint:"rmr"});e||d("WALogger").ERROR(m()).sendLogs("media-fault: rmr entry can not be found");e==null?void 0:e.markWhetherOnServer(!0)}return a.status});function e(b){return a.apply(this,arguments)}return e}();e.msgProps=function(a){var b={};v(b,this,d("WAWebMediaTypes").FIELDS.RAW);v(b,this.contentInfo,this.contentFields());v(b,a,d("WAWebMediaTypes").MSG_SPECIFIC_FIELDS);b.preview=this.contentInfo._preview;a={};for(var c in b){var e=d("WAWebMediaTypes").MEDIA_TO_MSG[c];e&&(a[e]=b[c])}return a};e["delete"]=function(){this._saveMedia=null,d("WAWebMedia").cancelDownloadMedia(this),d("WAWebMedia").cancelUploadMedia(this),this.clearBlob()};e.runProcessIfNotRunBefore=function(a,c,d){var e=this,f=this._keyedProcesses;f||(f=this._keyedProcesses={});if(Object.prototype.hasOwnProperty.call(f,a))return;this._pendingChangesCount++;f[a]=(h||(h=b("Promise"))).resolve(d).then(c).then(function(a){return void e.consolidate(a)})["finally"](function(){e._pendingChangesCount--,e._pendingChangesCount===0&&e.notifyMsgsAsync()})};e.getPendingProcess=function(a){return this._pendingChangesCount===0||!this._keyedProcesses||!Object.prototype.hasOwnProperty.call(this._keyedProcesses,a)?(h||(h=b("Promise"))).resolve():this._keyedProcesses[a]};e.videoStreamingInfo=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(this.type!==d("WAWebMediaTypes").TYPE.VIDEO){d("WALogger").ERROR(l(),String(this.type)).sendLogs("media-fault: media streaming info request for non-video type");return}var e=this.entries.getDownloadEntry(!0);if(!e||!e.sidecar||!(e instanceof d("WAWebMediaEntry").EncryptedMediaEntry))return null;var f=(yield (h||(h=b("Promise"))).all([c("WAWebCryptoCreateMediaKeys")(d("WAWebMmsMediaTypes").MEDIA_TYPES.VIDEO,e.mediaKey),e.url()])),g=f[0];f=f[1];return{cryptoKeys:babelHelpers["extends"]({},g,{cipherKey:g.encKey,sidecar:e.sidecar}),streamData:{clientUrl:f,size:this.size,msgKey:a}}});function e(b){return a.apply(this,arguments)}return e}();e.addStickerPack=function(a){var b=this._stickerPacks;for(var c=0;c<b.length;c++){var e=b[c],f=e[0];e=e[1];f===a&&!e&&d("WALogger").ERROR(k()).sendLogs("redundant-sticker-pack-add")}b.push([a,!1]);this.notifyMsgsAsync()};e.addSticker=function(a){var b=this._stickers;for(var c=0;c<b.length;c++){var e=b[c],f=e[0];e=e[1];f===a&&!e&&d("WALogger").ERROR(j()).sendLogs("redundant-sticker-add")}b.push([a,!1]);this.notifyMsgsAsync()};e.removeSticker=function(a){var b=this._stickers,c=!1;for(var d=0;!c&&d<b.length;d++){var e=b[d],f=e[0];e=e[1];f===a&&!e&&(b[d][1]=!0,c=!0)}};e.removeStickerPack=function(a){var b=this._stickerPacks,c=!1;for(var d=0;!c&&d<b.length;d++){var e=b[d],f=e[0];e=e[1];f===a&&!e&&(b[d][1]=!0,c=!0)}};e.hasAssociatedStickers=function(){return this._stickers.some(function(a){a[0];a=a[1];return!a})};e.hasAssociatedStickerPacks=function(){return this._stickerPacks.some(function(a){a[0];a=a[1];return!a})};e.associatedStickers=function(){return this._stickers.reduce(function(a,b){var c=b[0];b=b[1];return b?a:a.concat(c)},[])};e.getUploadPromise=function(a){return d("WAWebMediaCryptoEligibilityUtils").isMediaCryptoExpectedForMediaType(a)?this._encryptedUploadPromise:this._unencryptedUploadPromise};e.setUploadPromise=function(a,b){d("WAWebMediaCryptoEligibilityUtils").isMediaCryptoExpectedForMediaType(b)?this._encryptedUploadPromise=a:this._unencryptedUploadPromise=a};e.clearUploadPromise=function(a){d("WAWebMediaCryptoEligibilityUtils").isMediaCryptoExpectedForMediaType(a)?this._encryptedUploadPromise=null:this._unencryptedUploadPromise=null};e.getUploadPromises=function(){return[this._encryptedUploadPromise,this._unencryptedUploadPromise]};e.getDownloadPromise=function(a){return d("WAWebMediaCryptoEligibilityUtils").isMediaCryptoExpectedForMediaType(a)?this._encryptedDownloadPromise:this._unencryptedDownloadPromise};e.setDownloadPromise=function(a,b){d("WAWebMediaCryptoEligibilityUtils").isMediaCryptoExpectedForMediaType(b)?this._encryptedDownloadPromise=a:this._unencryptedDownloadPromise=a};e.clearDownloadPromise=function(a){d("WAWebMediaCryptoEligibilityUtils").isMediaCryptoExpectedForMediaType(a)?this._encryptedDownloadPromise=null:this._unencryptedDownloadPromise=null};e.getDownloadPromises=function(){return[this._encryptedDownloadPromise,this._unencryptedDownloadPromise]};e.toJSON=function(){return{mediaBlob:this.mediaBlob,size:this.size,filehash:this.filehash,type:this.type,contentInfo:this.contentInfo,downloadStage:this.downloadStage,uploadStage:this.uploadStage}};return a}();function r(a,b){var c=a.contentInfo,d=!1,e=s(b.type,b.subtype);e&&!a.type&&(a.type=e,d=!0);e=b.downloadStage;var f=b.uploadStage;e&&e!==a.downloadStage&&(a.downloadStage=e,d=!0);f&&f!==a.uploadStage&&(a.uploadStage=f,d=!0);b.resolvedPreview&&!c.preview&&(b.resolvedPreview.retain(),c.preview=b.resolvedPreview,d=!0);b.progressiveStage!==void 0&&b.progressiveStage!==a.progressiveStage&&(a.progressiveStage=b.progressiveStage,d=!0);e=b.mediaBlob;e&&!e.isBlobEqual(a.mediaBlob)&&(a.mediaBlob&&a.clearBlob(),e.retain(),a.mediaBlob=e,a.size=e.size(),d=!0);b.size!=null&&b.size!==0&&(a.size==null||b.size<a.size)&&(a.size=b.size,d=!0);f=b.loadedSize;f!=null&&f!==a.loadedSize&&(a.loadedSize=f,d=!0);b.filehash&&!a.filehash&&(a.filehash=b.filehash,d=!0);b.parsedVcards&&b.parsedVcards!==a.parsedVcards&&(a.parsedVcards=b.parsedVcards,d=!0);b.extractedLottieSticker!=null&&b.extractedLottieSticker!==a.extractedLottieSticker&&(a.extractedLottieSticker=b.extractedLottieSticker,d=!0);e=a.contentFields();for(f=0;f<e.length;f++){var g=e[f];switch(g){case"preview":b.preview&&!c._preview&&(a.runProcessIfNotRunBefore("preview",z,b.preview),c._preview=b.preview,d=!0);break;case"fullWidth":case"fullHeight":case"aspectRatio":var h=b[g];h!=null&&h!==0&&c[g]!==h&&(c[g]=h,d=!0);break;case"animationDuration":case"singleLoopDuration":h=b[g];h!=null&&h!==c[g]&&(c[g]=h,d=!0);break;default:h=b[g];h!==void 0&&c[g]===void 0&&(c[g]=h,d=!0)}}(c.aspectRatio==null||c.aspectRatio===0)&&(c.fullWidth!=null&&c.fullWidth!==0&&c.fullHeight!=null&&c.fullHeight!==0?(c.aspectRatio=c.fullWidth/c.fullHeight,d=!0):c.preview&&a.runProcessIfNotRunBefore("aspectRatio",B,c.preview));return d}function s(a,b){switch(a){case d("WAWebMediaTypes").OUTWARD_TYPES.IMAGE:case d("WAWebMediaTypes").OUTWARD_TYPES.PRODUCT:return d("WAWebMediaTypes").TYPE.IMAGE;case d("WAWebMediaTypes").OUTWARD_TYPES.VIDEO:return d("WAWebMediaTypes").TYPE.VIDEO;case d("WAWebMediaTypes").OUTWARD_TYPES.PTV:return d("WAWebMediaTypes").TYPE.PTV;case d("WAWebMediaTypes").OUTWARD_TYPES.STICKER:return d("WAWebMediaTypes").TYPE.STICKER;case d("WAWebMediaTypes").OUTWARD_TYPES.AUDIO:case d("WAWebMediaTypes").OUTWARD_TYPES.PTT:return d("WAWebMediaTypes").TYPE.AUDIO;case d("WAWebMediaTypes").OUTWARD_TYPES.DOCUMENT:default:return void 0}}function a(a){switch(a){case"VIDEO":case"PTV":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":throw c("err")("web media type is invalid: "+a);default:a;throw c("err")("web media type is invalid: "+a)}}function t(a){var b;if(((b=a.interactiveHeader)==null?void 0:b.mediaType)!=null)switch(a.interactiveHeader.mediaType){case d("WAWebInteractiveMessageHeaderMediaType").InteractiveMessageHeaderMediaType.DOCUMENT:return d("WAWebMediaTypes").OUTWARD_TYPES.DOCUMENT;case d("WAWebInteractiveMessageHeaderMediaType").InteractiveMessageHeaderMediaType.VIDEO:return d("WAWebMediaTypes").OUTWARD_TYPES.VIDEO;case d("WAWebInteractiveMessageHeaderMediaType").InteractiveMessageHeaderMediaType.IMAGE:return d("WAWebMediaTypes").OUTWARD_TYPES.IMAGE;case d("WAWebInteractiveMessageHeaderMediaType").InteractiveMessageHeaderMediaType.PRODUCT:return d("WAWebMediaTypes").OUTWARD_TYPES.PRODUCT}return void 0}function u(a){var b={};v(b,a,d("WAWebMediaTypes").FIELDS.RAW);v(b,a.contentInfo,a.contentFields());a.mediaBlob&&(b.renderableUrl=a.mediaBlob.url());var c=a._msgs,e=c.length;for(var f=0;f<e;f++){var g=c[f],h=g[0];g=g[1];if(h!=null&&!g){if(h.type!==d("WAWebMsgType").MSG_TYPE.CIPHERTEXT){b.mediaStage=w(h,a);for(g=0;g<d("WAWebMediaTypes").MSG_SPECIFIC_FIELDS.length;g++){var i=d("WAWebMediaTypes").MSG_SPECIFIC_FIELDS[g];b[i]=h.get(d("WAWebMediaTypes").MEDIA_TO_MSG[i])}b.type===d("WAWebMsgType").MSG_TYPE.INTERACTIVE&&(b.type=t(h))}else{delete b.mediaStage;for(i=0;i<d("WAWebMediaTypes").MSG_SPECIFIC_FIELDS.length;i++)delete b[d("WAWebMediaTypes").MSG_SPECIFIC_FIELDS[i]]}h.mediaData.set(b)}}for(g=c.length-1;g>=0;g--)c[g][1]&&c.splice(g,1);i=a._callOnConsolidate;!a._pendingChanges&&i&&(a._callOnConsolidate=null,i.forEach(function(a){return void a()}));a._saveMedia&&a._saveMedia(a)}function v(a,b,c){for(var d=0;d<c.length;d++){var e=c[d];a[e]=b[e]}}function w(a,b){if(!b.filehash)return d("WAWebMediaTypes").MediaDataStage.PREPARING;else if(a.id.fromMe&&a.ack<d("WAWebAck").ACK.SENT){a.local||d("WALogger").ERROR(i()).sendLogs("media-fault: unsent media system message not local");return y(b)}return x(b)}function x(a){switch(a.downloadStage){case d("WAWebMediaTypes").DownloadStage.INIT:return d("WAWebMediaTypes").MediaDataStage.INIT;case d("WAWebMediaTypes").DownloadStage.EXISTS:return d("WAWebMediaTypes").MediaDataStage.EXISTS;case d("WAWebMediaTypes").DownloadStage.PREPARING:return d("WAWebMediaTypes").MediaDataStage.PREPARING;case d("WAWebMediaTypes").DownloadStage.REUPLOADING:return d("WAWebMediaTypes").MediaDataStage.REUPLOADING;case d("WAWebMediaTypes").DownloadStage.FETCHING:return d("WAWebMediaTypes").MediaDataStage.FETCHING;case d("WAWebMediaTypes").DownloadStage.PROCESSING:return d("WAWebMediaTypes").MediaDataStage.DECRYPTING;case d("WAWebMediaTypes").DownloadStage.NEED_POKE:return d("WAWebMediaTypes").MediaDataStage.NEED_POKE;case d("WAWebMediaTypes").DownloadStage.ERROR_MISSING:return d("WAWebMediaTypes").MediaDataStage.ERROR_MISSING;case d("WAWebMediaTypes").DownloadStage.ERROR_UNSUPPORTED:return d("WAWebMediaTypes").MediaDataStage.ERROR_UNSUPPORTED;case d("WAWebMediaTypes").DownloadStage.RESOLVED:return d("WAWebMediaTypes").MediaDataStage.RESOLVED;case d("WAWebMediaTypes").DownloadStage.PROGRESSIVE_READY:return d("WAWebMediaTypes").MediaDataStage.PROGRESSIVE_READY}}function y(a){switch(a.uploadStage){case d("WAWebMediaTypes").UploadStage.INIT:return d("WAWebMediaTypes").MediaDataStage.PREPARING;case d("WAWebMediaTypes").UploadStage.PREPARING:return d("WAWebMediaTypes").MediaDataStage.PREPARING;case d("WAWebMediaTypes").UploadStage.UPLOADING:return d("WAWebMediaTypes").MediaDataStage.UPLOADING;case d("WAWebMediaTypes").UploadStage.NEED_UPLOAD:return d("WAWebMediaTypes").MediaDataStage.NEED_UPLOAD;case d("WAWebMediaTypes").UploadStage.ERROR_MISSING:return d("WAWebMediaTypes").MediaDataStage.ERROR_MISSING;case d("WAWebMediaTypes").UploadStage.ERROR_TOO_LARGE:return d("WAWebMediaTypes").MediaDataStage.ERROR_TOO_LARGE;case d("WAWebMediaTypes").UploadStage.UPLOADED:return d("WAWebMediaTypes").MediaDataStage.SENDING;case d("WAWebMediaTypes").UploadStage.ERROR_FILE_NOT_READABLE:return d("WAWebMediaTypes").MediaDataStage.ERROR_FILE_NOT_READABLE;case d("WAWebMediaTypes").UploadStage.FINALIZING:return d("WAWebMediaTypes").MediaDataStage.FINALIZING}}function z(a){return A.apply(this,arguments)}function A(){A=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield c("WAWebMediaOpaqueData").createFromBase64Jpeg(a));a.autorelease();return{resolvedPreview:a}});return A.apply(this,arguments)}function B(a){return C.apply(this,arguments)}function C(){C=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebMediaDataUtils").getImageWidthHeight(a));var b=a.width;a=a.height;return{aspectRatio:b/a}});return C.apply(this,arguments)}function D(a){var b={};v(b,a,d("WAWebMediaTypes").FIELDS.RAW);v(b,a.contentInfo,a.contentFields());a.mediaBlob&&(b.renderableUrl=a.mediaBlob.url());var c=x(a);a._stickers=a._stickers.filter(function(a){a[0];a=a[1];return!a});a._stickers.forEach(function(a){var d=a[0];a[1];d.mediaData.set(babelHelpers["extends"]({},b,{mediaStage:c}))});a._stickerPacks=a._stickerPacks.filter(function(a){a[0];a=a[1];return!a});a._stickerPacks.forEach(function(a){var d=a[0];a[1];d.mediaData.set(babelHelpers["extends"]({},b,{mediaStage:c}))});!a._pendingChanges&&a._callOnConsolidate&&(a._callOnConsolidate.forEach(function(a){return void a()}),a._callOnConsolidate=null);a._saveMedia&&a._saveMedia(a)}g.MediaObject=e;g.consolidate=r;g.webMediaTypeToWamMediaType=a;g.getInteractiveMsgMediaType=t}),98); __d("WAWebEncodeRgbaToWebp",["Promise","WAWebMiscErrors","WAWebRgbaToWebpWorkerResource","WorkerBundleResource"],(function(a,b,c,d,e,f,g){var h;function a(a,e,f,g){g=(g=g)!=null?g:{};var i=g.quality,j=i===void 0?90:i;i=g.ensureExtendedFormat;var k=i===void 0?!1:i;return new(h||(h=b("Promise")))(function(b,g){var h=d("WorkerBundleResource").createDedicatedWebWorker(c("WAWebRgbaToWebpWorkerResource"));h.onerror=function(a){h.terminate(),g(new(d("WAWebMiscErrors").EncodeWebpError)("worker error",a))};h.onmessageerror=function(a){h.terminate(),g(new(d("WAWebMiscErrors").EncodeWebpError)("worker message error",a))};h.onmessage=function(a){h.terminate(),b(a.data.blob)};h.postMessage({type:"message",message:{rgbaData:a,width:e,height:f,quality:j,ensureExtendedFormat:k}})})}g["default"]=a}),98); __d("WAWebImageGeometry",[],(function(a,b,c,d,e,f){function a(a,b){if(typeof a!=="number"||a<0||a!==a)return{width:b,height:b};else if(a>1)return{width:b,height:Math.max(b/a,1)};return{width:Math.max(b*a,1),height:b}}function b(a,b,c){b=b!=null?b:c;a=a!=null?a:c;b>a?b>c&&(a*=c/b,b=c):a>c&&(b*=c/a,a=c);return{width:Math.max(b,1),height:Math.max(a,1)}}f.aspectRatioScaled=a;f.boundHeightWidth=b}),66); __d("WAWebCanvasUtils",["Promise","WAWebABProps","WAWebDataUrlToBlob","WAWebEncodeRgbaToWebp","WAWebImageGeometry","WAWebMediaOpaqueData","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function a(a){if(c("WAWebEncodeRgbaToWebp")){var b=a.getContext("2d");b=b.getImageData(0,0,a.width,a.height);return c("WAWebEncodeRgbaToWebp")(b.data,a.width,a.height,{ensureExtendedFormat:!0})}return i(a,"image/webp")}function i(a,c){c===void 0&&(c="image/jpeg");if(Object.prototype.hasOwnProperty.call(HTMLCanvasElement.prototype,"toBlob")){var e=c==="image/jpeg"?d("WAWebABProps").getABPropConfigValue("web_jpeg_quality")/100:void 0;return new(h||(h=b("Promise")))(function(b){a.toBlob(b,c,e)})}return(h||(h=b("Promise"))).resolve(d("WAWebDataUrlToBlob").dataURLtoBlob(a.toDataURL(c)))}function e(a,b,c){b===void 0&&(b="image/jpeg");var e=a.toDataURL(b);e=d("WAWebDataUrlToBlob").dataURLtoBlob(e);if(e.size<=c)return a.toDataURL(b);for(e=.9;e>=.1;e-=.1){var f=a.toDataURL(b,e),g=d("WAWebDataUrlToBlob").dataURLtoBlob(f);if(g.size<=c)return f}return null}function f(a,b,c){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,d){var e;d=d||{};e=(e=d.mimetype)!=null?e:"image/jpeg";d=(d=d.maxAttempts)!=null?d:10;var f=.5,g=a,h=(yield i(g,e));for(var j=0;j<d;j++){if(h.size<=b)break;var k=Math.floor(a.width*f),l=Math.floor(a.height*f);g=q(k,l);var m=g.getContext("2d");m.drawImage(a,0,0,k,l);h=(yield i(g,e));f*=.5}return{opaqueData:yield c("WAWebMediaOpaqueData").createFromData(h,e),width:g.width,height:g.height,dataUrl:g.toDataURL("image/jpeg")}});return j.apply(this,arguments)}function k(a,b){var c=b.x||0,d=b.y||0;b.degrees&&(b.radians=b.degrees*(Math.PI/180));a.translate(c,d);a.rotate(b.radians);a.translate(-c,-d)}function l(a,b,c){var d=a.getContext("2d"),e=d.getImageData(0,0,b,c);a.width=b;a.height=c;d.putImageData(e,0,0)}function m(a){var b=a.getContext("2d"),c=a.width,d=a.height,e=b.getImageData(0,0,c,d),f=Math.max(c,d);a.width=f;a.height=f;a=(f-c)/2;f=(f-d)/2;b.clearRect(0,0,c,d);b.putImageData(e,a,f,0,0,c,d)}function n(a,b){var c=a.getContext("2d"),e=r(a);b=d("WAWebImageGeometry").aspectRatioScaled(a.width/a.height,b);var f=b.width;b=b.height;a.width=f;a.height=b;c.drawImage(e,0,0,f,b)}function o(a){var b=a.getContext("2d");b.fillStyle="rgb(247,247,247)";b.fillRect(0,0,a.width,a.height)}function p(a,b){b=d("WAWebImageGeometry").boundHeightWidth(a.height,a.width,b);var c=b.width;b=b.height;if(c>a.width&&b>a.height)return a;var e=document.createElement("canvas"),f=e.getContext("2d");e.width=c;e.height=b;f.drawImage(a,0,0,c,b);return e}function q(a,b){var c=document.createElement("canvas");c.width=a;c.height=b;return c}function r(a){var b=q(a.width,a.height),c=b.getContext("2d");c.drawImage(a,0,0);return b}function s(a){var b=a.getContext("2d");b=b.getImageData(0,0,a.width,a.height);a=b.data.length/4;var c;for(c=0;c<a;c++){var d=b.data[4*c+3];if(d!==0)return!1}return!0}function t(a){var b=a.getContext("2d");b=b.getImageData(0,0,a.width,a.height);var c=b.data.length/4,d=Infinity,e=Infinity,f=0,g=0,h;for(h=0;h<c;h++){var i=b.data[4*h+3];if(i===0)continue;i=h%a.width;var j=Math.floor(h/a.width);i<d&&(d=i);i>f&&(f=i);j<e&&(e=j);j>g&&(g=j)}return{left:d,top:e,right:f,bottom:g}}function u(a){if(s(a))return;var b=t(a),c=b.left,d=b.top,e=b.right;b=b.bottom;b=b-d;e=e-c;a=a.getContext("2d");a=a.getImageData(c,d,e,b);c=q(e,b);d=c.getContext("2d");d.putImageData(a,0,0);return c}function v(a,b,c){c===void 0&&(c="white");var d=document.createElement("canvas"),e=d.getContext("2d"),f=document.createElement("canvas"),g=f.getContext("2d");b=b*2;d.width=f.width=a.width+b*2;d.height=f.height=a.height+b*2;e.drawImage(a,b,b);g.shadowColor=c;g.shadowBlur=1;for(c=0;c<b;c++)g.drawImage(d,0,0),e.drawImage(f,0,0);g.shadowColor="rgba(0,0,0,0)";g.drawImage(a,b,b);return f}g.canvasToWebp=a;g.canvasToBlob=i;g.getResizedDataUrl=e;g.generateMicroThumb=f;g.rotate=k;g.resize=l;g.square=m;g.scale=n;g.fillBackgroundWithGray=o;g.contain=p;g.createCanvas=q;g.trim=u;g.addBorder=v}),98); __d("WAWebChatEphemerality",["WALogger","WAWebChatGetters","WAWebEphemeralityTypes","WAWebStateUtils","WAWebUserPrefsMultiDevice"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[ephemeral] invalid duration of "," for chat ",""]);h=function(){return a};return a}function i(a){var b;a=d("WAWebStateUtils").unproxy(a);b=d("WAWebChatGetters").getIsGroup(a)?(b=a.groupMetadata)==null?void 0:b.ephemeralDuration:a.ephemeralDuration;if(b==null||b===0)return null;if(b<0){d("WALogger").WARN(h(),b,a.id.toLogString());return null}return b}function a(a){a=d("WAWebStateUtils").unproxy(a);if(d("WAWebChatGetters").getIsGroup(a))return null;return a.ephemeralSettingTimestamp===0?null:a.ephemeralSettingTimestamp}function j(a){a=d("WAWebStateUtils").unproxy(a);a=i(a);return a!=null&&a!==0}function b(a){a=d("WAWebStateUtils").unproxy(a);if(d("WAWebUserPrefsMultiDevice").getIsHostedMeAccountFromLocalStorage()&&!d("WAWebChatGetters").getIsGroup(a))return!1;if(d("WAWebChatGetters").getIsPSA(a))return!1;if(a.id.isBot())return!1;if(d("WAWebChatGetters").getIsGroup(a)){var b;b=(b=a.groupMetadata)==null?void 0:b.participants.getSuperAdmin();if(b==null?void 0:b.contact.isEnterprise)return!1;if(!((b=a.groupMetadata)==null?void 0:b.canSetEphemeralSetting())&&!j(a))return!1}if(d("WAWebChatGetters").getIsBroadcast(a))return!1;return a.contact.isEnterprise?!1:!0}function c(a){a=d("WAWebStateUtils").unproxy(a);if(a.disappearingModeInitiator!=null)return a.disappearingModeInitiator;return j(a)?d("WAWebEphemeralityTypes").DisappearingModeInitiator.ChangedInChat:null}function e(a){a=d("WAWebStateUtils").unproxy(a);if(d("WAWebChatGetters").getIsGroup(a))return k(a);if(a.disappearingModeTrigger!=null)return a.disappearingModeTrigger;return j(a)?d("WAWebEphemeralityTypes").DisappearingModeTrigger.ChatSettings:null}function f(a){a=d("WAWebStateUtils").unproxy(a);if(d("WAWebChatGetters").getIsGroup(a))return l(a);return a.disappearingModeInitiatedByMe!=null?a.disappearingModeInitiatedByMe:null}function k(a){a=d("WAWebStateUtils").unproxy(a);a=(a=a.groupMetadata)==null?void 0:a.disappearingModeTrigger;return a==null?null:a}function l(a){a=d("WAWebStateUtils").unproxy(a);a=(a=a.groupMetadata)==null?void 0:a.disappearingModeInitiatedByMe;return a==null?null:a}function m(a){var b;a=d("WAWebStateUtils").unproxy(a);return a.ephemeralDuration==null&&a.ephemeralSettingTimestamp==null&&a.disappearingModeInitiator==null?null:{duration:(b=a.ephemeralDuration)!=null?b:0,settingTimestamp:a.ephemeralSettingTimestamp,initiator:a.disappearingModeInitiator,disappearingModeTrigger:a.disappearingModeTrigger,initiatedByMe:a.disappearingModeInitiatedByMe}}g.getEphemeralSetting=i;g.getEphemeralSettingTimestamp=a;g.isEphemeralSettingOn=j;g.shouldShowEphemeralSetting=b;g.getDisappearingModeInitiator=c;g.getDisappearingModeTrigger=e;g.getDisappearingModeInitiatedByMe=f;g.getDisappearingModeTriggerGroups=k;g.getDisappearingModeInitiatedByMeGroups=l;g.getChatEphemeralityFields=m}),98); __d("WAWebAddWebpMetadata",["WATypedArraysConcat","WAWebWebp","WAWebWebpMetadata","err"],(function(a,b,c,d,e,f,g){function a(a,b){a=new Uint8Array(a);if(!d("WAWebWebp").isExtendedFile(a))throw c("err")("Not extended");b=d("WAWebWebpMetadata").toRawWebpMetadata(b);b=i(b);a=d("WATypedArraysConcat").concatTypedArrays(Uint8Array,[a,b]);a.set(d("WAWebWebp").numberToLittleEndian(a.byteLength-8),4);b=a.buffer;return b}function h(a,b){return d("WATypedArraysConcat").concatTypedArrays(Uint8Array,[d("WAWebWebp").stringToUint8(a),d("WAWebWebp").numberToLittleEndian(b)])}function i(a){var b=new TextEncoder();a=JSON.stringify(a);b=b.encode(a);a=j(b);a=[h(d("WAWebWebp").Chunk.EXIF,a.byteLength),a];b.byteLength%2!==0&&a.push(new Uint8Array([0]));b=d("WATypedArraysConcat").concatTypedArrays(Uint8Array,a);return b}function j(a){var b;b=d("WATypedArraysConcat").concatTypedArrays(Uint8Array,[(b=d("WAWebWebp")).stringToUint8("II"),new Uint8Array([42,0]),b.numberToLittleEndian(8),new Uint8Array([1,0]),b.stringToUint8("AW"),new Uint8Array([7,0]),b.numberToLittleEndian(a.byteLength),b.numberToLittleEndian(22),a]);return b}g.addWebpMetadata=a}),98); __d("WAWebMediaJpeg",["WABinary","WAProgressiveJpegMarkers","err"],(function(a,b,c,d,e,f,g){function h(a){var b=new(d("WABinary").Binary)();b.writeBytes(255,216,255,224,0,16,74,70,73,70,0);b.writeUint16(a.version);b.writeUint8(a.densityUnits);b.writeUint16(a.xDensity);b.writeUint16(a.yDensity);b.writeBytes(0,0);return b.readByteArray()}function a(a){var b=new(d("WABinary").Binary)(a);a=new(d("WABinary").Binary)(a);var e=new(d("WABinary").Binary)(),f=2,g=2,i=!1,j=!1,k=!1,l=!1,m={version:257,densityUnits:0,xDensity:1,yDensity:1};if(!(b.readUint8()===d("WAProgressiveJpegMarkers").MARKER_PREFIX&&b.readUint8()===d("WAProgressiveJpegMarkers").MARKERS.SOI))throw c("err")("SOI marker not at the start of the file.");a.advance(f);var n=void 0;while(n!=null||b.size()){if(n===void 0){var o=b.readUint8();if(o!==d("WAProgressiveJpegMarkers").MARKER_PREFIX)throw c("err")("0x"+o.toString(16)+" is not a marker prefix.");n=b.readUint8()}switch(n){case d("WAProgressiveJpegMarkers").MARKERS.APP0:if(j)o=b.readUint16(),a.advance(o+f),b.advance(b.size()-a.size());else{o=b.readUint16();if(b.readString(5)!=="JFIF\0")throw c("err")("APP0 marker missing 'JFIF' magic bytes.");l=!0;m.version=b.readUint16();m.densityUnits=b.readUint8();m.xDensity=b.readUint16();m.yDensity=b.readUint16();a.advance(o+f);b.advance(b.size()-a.size());j=!0}break;case d("WAProgressiveJpegMarkers").MARKERS.SOS:if(!k&&!l)throw c("err")("Missing magic bytes marker.");b.advance(b.readUint16()-g);var p,q=void 0,r=b.readUint8();while(b.size()){q=b.readUint8();p=r===d("WAProgressiveJpegMarkers").MARKER_PREFIX&&!d("WAProgressiveJpegMarkers").SOS_STREAM.includes(q);if(p){n=q;break}r=q}e.writeByteArray(a.readByteArray(a.size()-b.size()-f));continue;case d("WAProgressiveJpegMarkers").MARKERS.APP1:o=b.readUint16();if(!k&&b.readString(6)!=="Exif\0\0")throw c("err")("APP1 marker missing 'EXIF' magic bytes.");k=!0;a.advance(o+f);b.advance(b.size()-a.size());break;case d("WAProgressiveJpegMarkers").MARKERS.APP13:case d("WAProgressiveJpegMarkers").MARKERS.COM:if(!k&&!l)throw c("err")("Missing magic bytes marker.");o=b.readUint16();a.advance(o+f);b.advance(b.size()-a.size());break;case d("WAProgressiveJpegMarkers").MARKERS.EOI:if(!k&&!l)throw c("err")("Missing magic bytes marker.");i=!0;e.writeByteArray(a.readByteArray(f));break;case d("WAProgressiveJpegMarkers").MARKERS.SOF0:case d("WAProgressiveJpegMarkers").MARKERS.SOF1:case d("WAProgressiveJpegMarkers").MARKERS.SOF2:case d("WAProgressiveJpegMarkers").MARKERS.SOF3:case d("WAProgressiveJpegMarkers").MARKERS.SOF5:case d("WAProgressiveJpegMarkers").MARKERS.SOF6:case d("WAProgressiveJpegMarkers").MARKERS.SOF7:case d("WAProgressiveJpegMarkers").MARKERS.SOF9:case d("WAProgressiveJpegMarkers").MARKERS.SOF10:case d("WAProgressiveJpegMarkers").MARKERS.SOF11:case d("WAProgressiveJpegMarkers").MARKERS.SOF13:case d("WAProgressiveJpegMarkers").MARKERS.SOF14:case d("WAProgressiveJpegMarkers").MARKERS.SOF15:case d("WAProgressiveJpegMarkers").MARKERS.DQT:case d("WAProgressiveJpegMarkers").MARKERS.DHT:case d("WAProgressiveJpegMarkers").MARKERS.DRI:if(!k&&!l)throw c("err")("Missing magic bytes marker.");o=b.readUint16();e.writeByteArray(a.readByteArray(f+o));b.advance(b.size()-a.size());break;case d("WAProgressiveJpegMarkers").MARKERS.APP2:case d("WAProgressiveJpegMarkers").MARKERS.APP3:case d("WAProgressiveJpegMarkers").MARKERS.APP4:case d("WAProgressiveJpegMarkers").MARKERS.APP5:case d("WAProgressiveJpegMarkers").MARKERS.APP6:case d("WAProgressiveJpegMarkers").MARKERS.APP7:case d("WAProgressiveJpegMarkers").MARKERS.APP8:case d("WAProgressiveJpegMarkers").MARKERS.APP9:case d("WAProgressiveJpegMarkers").MARKERS.APP10:case d("WAProgressiveJpegMarkers").MARKERS.APP11:case d("WAProgressiveJpegMarkers").MARKERS.APP12:case d("WAProgressiveJpegMarkers").MARKERS.APP14:case d("WAProgressiveJpegMarkers").MARKERS.APP15:throw c("err")("Received unexpected APP marker 0x"+n.toString(16));default:throw c("err")("Did not understand marker: 0x"+n.toString(16))}n=void 0;if(i)break}if(!i)throw c("err")("No EOI tag found.");p=h(m);return new Blob([p,e.readByteArray()],{type:"image/jpeg"})}g.cleanJPEG=a}),98); __d("WAWebStickerConstants",[],(function(a,b,c,d,e,f){a=512;b=8;c=36;d=156;e=20;var g=24*60*60;f.STICKER_DIMENSION=a;f.STICKER_BORDER_WIDTH=b;f.STICKER_PADDING=c;f.STICKER_LIST_ITEM_HEIGHT=d;f.STICKER_MAKER_IMAGE_PADDING=e;f.STICKER_PACK_FETCH_TIMEOUT=g}),66); __d("WAWebImageUtils",["Promise","WACustomError","WAExponentialBackoff","WALogger","WAPromiseProps","WAWebAddWebpMetadata","WAWebCanvasUtils","WAWebFileUtils","WAWebImageGeometry","WAWebMediaJpeg","WAWebMediaLoad","WAWebMiscErrors","WAWebModernizr","WAWebNoop","WAWebStickerConstants","WAWebUA","WAWebWebpMetadata","asyncToGeneratorRuntime","err","exif-component"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Webp sticker file generation failed: "]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["addMetadataToSticker: Unable to add metadata to Sticker"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["generateVideoThumbsAndDuration: Failed to generate video thumbnail from ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["generateVideoThumbsAndDuration: Failed to generate video thumbnail from ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["generateVideoThumbsAndDuration: Setting video.currentTime to 0 to attempt to unblock the video"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["Could not parse JPEG: ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["ImageUtils::rotateAndResize error: ",""]);o=function(){return a};return a}var p={DATA_URL:1<<0,BLOB:1<<1,CANVAS:1<<2},q=p.DATA_URL,r=p.BLOB,s=p.CANVAS,t=function(b){babelHelpers.inheritsLoose(a,b);function a(){return b.apply(this,arguments)||this}return a}(d("WACustomError").customError("BlackVideoThumbnailError"));t.message="Generated video thumbnail is black";var u=function(a){var b=a.video,c=a.fullWidth,e=a.fullHeight;a=a.maxDimension;var f=document.createElement("canvas");a=d("WAWebImageGeometry").boundHeightWidth(e,c,a);var g=a.width;a=a.height;f.width=g;f.height=a;var h=f.getContext("2d");h.drawImage(b,0,0,g,a);b=h.getImageData(0,0,g,a);h=f.toDataURL("image/jpeg");f={url:h,width:g,height:a,fullWidth:c,fullHeight:e};return{thumb:f,imageData:b}};function a(a){return v.apply(this,arguments)}function v(){v=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=a.file,f=a.maxDimensions,g=a.debugHint;a=a.throwOnBlack;var i=a===void 0?!1:a;a=(yield d("WAWebMediaLoad").loadVideo(e));var j=a.video,n=a.fullWidth,o=a.fullHeight;if(d("WAWebUA").UA.isBuggyVideoLoad){e=50;var p=5e3/e;return d("WAExponentialBackoff").exponentialBackoff({minTimeout:e,maxTimeout:e,retries:p,signal:new AbortController().signal,factor:1},function(a,e){var k=[],q;for(q of f){var r=u({video:j,fullHeight:o,fullWidth:n,maxDimension:q}),s=r.thumb;r=r.imageData;if(H(r)){if(e<p){e===0&&d("WALogger").LOG(m());j.currentTime=0;return a(c("err")("retry"))}d("WALogger").ERROR(l(),g).sendLogs("thumbnail-generation-failed-"+g,{sampling:.001});if(i)throw new t()}k.push(s)}r={duration:~~j.seekable.end(0),thumbs:k};d("WAWebMediaLoad").disposeVideo(j);return(h||(h=b("Promise"))).resolve(r)})}try{a=f.map(function(a){a=u({video:j,fullHeight:o,fullWidth:n,maxDimension:a});var b=a.thumb;a=a.imageData;if(H(a)){d("WALogger").ERROR(k(),g).sendLogs("thumbnail-generation-failed-"+g,{sampling:.001});if(i)throw new t()}return b});return{duration:~~j.seekable.end(0),thumbs:a}}finally{d("WAWebMediaLoad").disposeVideo(j)}});return v.apply(this,arguments)}function e(a,b,c,d,e,f,g,h){return w.apply(this,arguments)}function w(){w=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e,f,g,h,i){i===void 0&&(i=q);a=a instanceof HTMLCanvasElement?a:yield d("WAWebMediaLoad").loadImage(a);var j=document.createElement("canvas"),k=j.getContext("2d");g==null||h==null?(j.height=f,j.width=e,k.drawImage(a,b,c,e,f)):(j.height=h,j.width=g,k.drawImage(a,b,c,e,f,0,0,g,h));k={};E(k,j,i);a=(yield d("WAPromiseProps").promiseProps(k));return{images:a,width:e,height:f}});return w.apply(this,arguments)}function f(a,e,f,g){g=(g=g)!=null?g:{};var i=g.transparency,j=i===void 0?!1:i;i=g.fitToSquare;var k=i===void 0?!1:i;i=g.minDimension;var l=i===void 0?0:i,m=new ArrayBuffer(0),p;a instanceof HTMLCanvasElement?(g=(h||(h=b("Promise"))).resolve(a),i=h.resolve(m)):(p=window.URL.createObjectURL(a),g=d("WAWebMediaLoad").loadImage(p),i=d("WAWebFileUtils").blobToArrayBuffer(a)["catch"](function(a){d("WALogger").WARN(o(),a).devConsole(a);return m}));return d("WAPromiseProps").promiseProps({buffer:i,image:g}).then(function(a){var b,g=a.buffer;a=a.image;var h={};try{h=c("exif-component")(g)}catch(a){}var i=0;if(!((b=d("WAWebModernizr").getModernizr())==null?void 0:b.exiforientation))switch(h.orientation||"UNKNOWN"){case"right-top":i=1;break;case"left-bottom":i=-1;break;case"bottom-right":i=2;break}var m=document.createElement("canvas");b=a.naturalWidth||a.width;h=a.naturalHeight||a.height;var o=Math.max(b,h),p=m.getContext("2d"),q={};if(i)switch(i){case 1:case-1:var s=Math.max(b,h),t=s/2;m.width=m.height=s;j||d("WAWebCanvasUtils").fillBackgroundWithGray(m);d("WAWebCanvasUtils").rotate(p,{x:t,y:t,degrees:i*90});i===1?p.drawImage(a,0,s-h):p.drawImage(a,s-b,0);d("WAWebCanvasUtils").rotate(p,{x:t,y:t,degrees:i*-90});d("WAWebCanvasUtils").resize(m,h,b);k&&d("WAWebCanvasUtils").square(m);o<l&&d("WAWebCanvasUtils").scale(m,l);var u=d("WAWebCanvasUtils").contain(m,e);E(q,u,f,j);return d("WAPromiseProps").promiseProps(q).then(function(a){return{width:u.width,height:u.height,images:a}});case 2:s=d("WAWebImageGeometry").boundHeightWidth(h,b,e);t=m.width=s.width;s=m.height=s.height;j||d("WAWebCanvasUtils").fillBackgroundWithGray(m);d("WAWebCanvasUtils").rotate(p,{x:t/2,y:s/2,degrees:i*90});p.drawImage(a,0,0,t,s);d("WAWebCanvasUtils").rotate(p,{x:t/2,y:s/2,degrees:i*-90});k&&d("WAWebCanvasUtils").square(m);o<l&&d("WAWebCanvasUtils").scale(m,l);E(q,m,f,j);return d("WAPromiseProps").promiseProps(q).then(function(a){return{width:m.width,height:m.height,images:a}})}else{t=d("WAWebImageGeometry").boundHeightWidth(h,b,e);var v,w;s=f&r;if(g&&s&&b===t.width&&h===t.height)try{i=d("WAWebMediaJpeg").cleanJPEG(g);q.blob=i;s=!1;v=b;w=h}catch(a){d("WALogger").LOG(n(),a.message)}(s||f&~r)&&(m.width=t.width,m.height=t.height,j||d("WAWebCanvasUtils").fillBackgroundWithGray(m),p.drawImage(a,0,0,m.width,m.height),k&&(d("WAWebCanvasUtils").square(m),q.blob=void 0),o<l&&(d("WAWebCanvasUtils").scale(m,l),q.blob=void 0),v=m.width,w=m.height,E(q,m,f,j));return d("WAPromiseProps").promiseProps(q).then(function(a){return{width:v,height:w,images:a}})}})["finally"](c("WAWebNoop"))}function x(a,b){return y.apply(this,arguments)}function y(){y=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){try{var c=(yield a.arrayBuffer());c=d("WAWebAddWebpMetadata").addWebpMetadata(c,b);b=new Uint8Array(c);c=new Blob([b],{type:"image/webp"});return c}catch(b){d("WALogger").ERROR(j()).sendLogs("unable-to-add-sticker-metadata");return a}});return y.apply(this,arguments)}function z(a){return A.apply(this,arguments)}function A(){A=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){try{a=window.URL.createObjectURL(a);var b=(yield d("WAWebMediaLoad").loadImage(a));window.URL.revokeObjectURL(a);a=d("WAWebStickerConstants").STICKER_DIMENSION;var c=d("WAWebCanvasUtils").createCanvas(a,a),e=c.getContext("2d"),f=d("WAWebImageGeometry").aspectRatioScaled(b.width/b.height,a),g=f.width;f=f.height;var h=(a-g)/2;a=(a-f)/2;e.drawImage(b,h,a,g,f);e=(yield d("WAWebCanvasUtils").canvasToWebp(c));b=(yield x(e,{isFirstParty:!1,isFromStickerMaker:!0,emojis:[],stickerPackPublisher:"WhatsApp Sticker Maker",stickerMakerSourceType:d("WAWebWebpMetadata").StickerMakerSourceType.WebStickerMaker}));return b}catch(a){d("WALogger").LOG(i()).devConsole(a);throw a}});return A.apply(this,arguments)}function B(a){return C.apply(this,arguments)}function C(){C=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){try{var b=(yield d("WAWebMediaLoad").loadImage(a)),c=document.createElement("canvas");c.width=b.naturalWidth;c.height=b.naturalHeight;var e=c.getContext("2d");d("WAWebCanvasUtils").fillBackgroundWithGray(c);e.drawImage(b,0,0);return d("WAWebCanvasUtils").canvasToBlob(c)}catch(b){throw new(d("WAWebMiscErrors").MediaDragDropError)("unable to render image",a)}});return C.apply(this,arguments)}function D(a){if(!a)return!1;var b=new Image();b.src=a;return!!b.complete}function E(a,c,e,f){f===void 0&&(f=!1);f=f?"image/png":"image/jpeg";!a.blob&&e&r&&(a.blob=d("WAWebCanvasUtils").canvasToBlob(c,f));!a.dataUrl&&e&q&&(a.dataUrl=(h||(h=b("Promise"))).resolve(c.toDataURL(f)));!a.canvas&&e&s&&(a.canvas=(h||(h=b("Promise"))).resolve(c))}function F(a){return G.apply(this,arguments)}function G(){G=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebMediaLoad").loadImage(a));var b=d("WAWebCanvasUtils").createCanvas(a.width,a.height),c=b.getContext("2d");c.drawImage(a,0,0);return b});return G.apply(this,arguments)}function H(a){var b=a.data,c=a.width,d=a.height;for(var e=0;e<d;e++){var f=Math.round(e*(c/d));f=e*c+f;f=f*4;var g=b[f];if(g!==0)return!1;g=b[f+1];if(g!==0)return!1;g=a.data[f+2];if(g!==0)return!1;g=a.data[f+3];if(g!==0&&g!==255)return!1}return!0}g.DATA_URL=q;g.BLOB=r;g.CANVAS=s;g.BlackVideoThumbnailError=t;g.generateVideoThumbsAndDuration=a;g.crop=e;g.rotateAndResize=f;g.toWebpSticker=z;g.urlToFile=B;g.isCached=D;g.base64ImageToCanvas=F}),98); __d("WAWebMediaGatingShouldClearUploadedBlobs",["WAWebMmsMediaTypes"],(function(a,b,c,d,e,f,g){function a(a){return a===d("WAWebMmsMediaTypes").MEDIA_TYPES.DOCUMENT}g["default"]=a}),98); __d("WAWebMediaInMemoryKeyCache",["WALruCache"],(function(a,b,c,d,e,f,g){b=10;c={sizeLimit:b,getSize:function(a){return 1}};function a(){return!0}e=new(d("WALruCache").LruCache)(c);g.shouldUseMediaKeyCache=a;g.MediaKeyCache=e}),98); __d("WAWebMediaUpdateMsg",["WAWebDBUpdateMessageTable","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){yield d("WAWebDBUpdateMessageTable").updateMessageTable(a.id,b),a.set(b)});return h.apply(this,arguments)}g["default"]=a}),98); __d("WAWebSendMsgResultAction",["$InternalEnum"],(function(a,b,c,d,e,f){a=b("$InternalEnum").Mirrored(["OK","ERROR_NETWORK","ERROR_EXPIRED","ERROR_CANCELLED","ERROR_UPLOAD","ERROR_UNKNOWN"]);f.SendMsgResult=a}),66); __d("WAWebMediaPrep",["invariant","Promise","WALogger","WAMediaCalculateFilehash","WANullthrows","WAPromiseCallSync","WATimeUtils","WAWebABProps","WAWebAck","WAWebAttachMenuGatingUtils","WAWebCanvasUtils","WAWebChatEphemerality","WAWebChatGetters","WAWebCryptoCalculateFilehash","WAWebCryptoRandomMediaKey","WAWebFrontendChatGetters","WAWebImageUtils","WAWebMediaCryptoEligibilityUtils","WAWebMediaData","WAWebMediaDataUtils","WAWebMediaEntry","WAWebMediaGatingShouldClearUploadedBlobs","WAWebMediaGatingUtils","WAWebMediaGetUploadOriginForChat","WAWebMediaInMemoryBlobCache","WAWebMediaInMemoryKeyCache","WAWebMediaMmsV4Download","WAWebMediaMmsV4Upload","WAWebMediaOpaqueData","WAWebMediaStorage","WAWebMediaTypes","WAWebMediaUpdateMsg","WAWebMediaUploadMmsThumbnail","WAWebMessagePluginGenerateReportingTokenContent","WAWebMessagingGatingUtils","WAWebMmsMediaTypes","WAWebMsgDataUtils","WAWebMsgGetters","WAWebMsgType","WAWebNewsletterGatingUtils","WAWebNewsletterSendMsgAction","WAWebRecentStickerCollectionMd","WAWebSendMsgChatAction","WAWebSendMsgResultAction","WAWebSendStatusMsgAction","WAWebStateUtils","WAWebURLUtils","WAWebWamEnumDownloadOriginType","WAWebWamEnumMessageSendResultType","WAWebWamEnumWebcRmrReasonCode","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g,h){var i;function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Assertion failed!"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["Sticker:sendToChat failed with unknown error"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["Media:sendToChat error\nresult: ","\nuploadStage: ","\nuploadResultKind: ","\nerror: ",""],["Media:sendToChat error\\nresult: ","\\nuploadStage: ","\\nuploadResultKind: ","\\nerror: ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["Media:sendToChat canceled"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["Sticker:sendToChat failed with expressions panel enabled"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["Media:sendToChat chat ",""]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["Assertion failed!"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["upload failed: thumbnail data incomplete\nDebug info:",""],["upload failed: thumbnail data incomplete\\nDebug info:",""]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["Assertion failed!"]);r=function(){return a};return a}a=function(){function a(a,b){var e=this;this._baseType=a;this._mediaData=new(c("WAWebMediaData"))({mediaStage:d("WAWebMediaTypes").MediaDataStage.PREPARING});this._prepwork=b.then(function(a){e._mediaData.set(a);if(!a.filehash){a.mediaBlob||d("WALogger").ERROR(r()).sendLogs("media-fault: no hash or blob");return d("WAWebCryptoCalculateFilehash").calculateFilehashFromBlob(a.mediaBlob).then(function(a){e._mediaData.filehash=a})}},function(a){e._mediaData.mediaStage=d("WAWebMediaTypes").MediaDataStage.ERROR_UNSUPPORTED;throw a})}var e=a.prototype;e.sendToChat=function(a,b,c){return d("WAPromiseCallSync").promiseCallSync(B,null,this,a,b,c)};e.waitForPrep=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield this._prepwork;return this._mediaData});function c(){return a.apply(this,arguments)}return c}();return a}();function s(a,b){if(b.type==="product")return d("WAWebWamEnumDownloadOriginType").DOWNLOAD_ORIGIN_TYPE.PRODUCT_CATALOG;b=d("WAWebStateUtils").unproxy(a);if(d("WAWebChatGetters").getIsGroup(b))return d("WAWebFrontendChatGetters").getIsCAG(b)?d("WAWebWamEnumDownloadOriginType").DOWNLOAD_ORIGIN_TYPE.COMMUNITY:d("WAWebWamEnumDownloadOriginType").DOWNLOAD_ORIGIN_TYPE.CHAT_GROUP;return d("WAWebChatGetters").getIsNewsletter(b)?d("WAWebWamEnumDownloadOriginType").DOWNLOAD_ORIGIN_TYPE.CHANNEL:d("WAWebWamEnumDownloadOriginType").DOWNLOAD_ORIGIN_TYPE.CHAT_PERSONAL}function t(a){a=d("WAWebMmsMediaTypes").getMsgMediaType(a);return d("WAWebABProps").getABPropConfigValue("upload_document_thumb_mms_enabled")&&a===d("WAWebMmsMediaTypes").MEDIA_TYPES.DOCUMENT}var u=[d("WAWebMmsMediaTypes").MEDIA_TYPES.VIDEO,d("WAWebMmsMediaTypes").MEDIA_TYPES.IMAGE];function v(a){a=d("WAWebMmsMediaTypes").getMsgMediaType(a);return u.includes(a)}function w(a){if(a.type===d("WAWebMsgType").MSG_TYPE.DOCUMENT)return t(a);if(a.type===d("WAWebMsgType").MSG_TYPE.STICKER_PACK)return!0;return d("WAWebMsgGetters").getIsStatus(a)?v(a):!1}function x(a){switch(a.type){case d("WAWebMsgType").MSG_TYPE.DOCUMENT:return d("WAWebMmsMediaTypes").MEDIA_TYPES.THUMBNAIL_DOCUMENT;case d("WAWebMsgType").MSG_TYPE.IMAGE:return d("WAWebMmsMediaTypes").MEDIA_TYPES.THUMBNAIL_IMAGE;case d("WAWebMsgType").MSG_TYPE.VIDEO:return d("WAWebMmsMediaTypes").MEDIA_TYPES.THUMBNAIL_VIDEO;case d("WAWebMsgType").MSG_TYPE.STICKER_PACK:return d("WAWebMmsMediaTypes").MEDIA_TYPES.THUMBNAIL_STICKER_PACK;default:throw c("err")("_getMediaTypeForThumbnails: attempt to create thumbnail for unsupported media type")}}function y(a){var b=a.uploadThumbnailResult,e=a.mediaResultEntry,f=a.uploadEncryptedThumbnail,g=a.fullPreviewSize,h=a.mediaType;a=a.mediaObject;var i=b==null?void 0:b.mediaEntry;if(f===!0){if(i&&b&&g)return{thumbnailDirectPath:i.directPath,thumbnailSha256:b.filehash,thumbnailEncSha256:i.encFilehash,thumbnailHeight:g.height,thumbnailWidth:g.width};f={thumbnailResultEntry:i,uploadThumbnailResult:b,fullPreviewSize:g};d("WALogger").ERROR(q(),JSON.stringify(f)).devConsole(f).sendLogs("mms-thumbnail-data-incomplete");throw c("err")("upload failed: thumbnail data incomplete")}i=a.contentInfo;b=i.fullHeight;g=i.fullWidth;if(e.getThumbnailDirectPath()!=null&&e.getThumbnailSha256()!=null&&g!=null&&b!=null&&d("WAWebMediaGatingUtils").isThumbnailGenerationOnServerEnabledForMediaType(h))return{thumbnailDirectPath:e.getThumbnailDirectPath(),thumbnailSha256:e.getThumbnailSha256(),thumbnailHeight:b,thumbnailWidth:g}}function z(a){(a=a.wamMessageSendReporter)==null?void 0:a.postFailure({result:d("WAWebWamEnumMessageSendResultType").MESSAGE_SEND_RESULT_TYPE.ERROR_UPLOAD,isTerminal:!0});return d("WAWebSendMsgResultAction").SendMsgResult.ERROR_UPLOAD}function A(a,b,e,f){return a.waitForPrep().then(function(a){var b=a.mediaBlob;return b&&!(b instanceof c("WAWebMediaOpaqueData"))?c("WAWebMediaOpaqueData").createFromData(b,b.type).then(function(b){a.mediaBlob=b;return a}):a}).then(function(a){var g=a.filehash;g||d("WALogger").ERROR(p()).sendLogs("media-fault: sendToChat filehash undefined");var h=d("WAWebMediaStorage").getOrCreateMediaObject(g),i=h.mediaBlob;i&&(i.retain(),a.mediaBlob instanceof c("WAWebMediaOpaqueData")&&a.mediaBlob.autorelease(),a.mediaBlob=i);a.mediaBlob instanceof c("WAWebMediaOpaqueData")&&(a.renderableUrl=a.mediaBlob.url());h.consolidate(a.toJSON());a.mediaBlob instanceof c("WAWebMediaOpaqueData")&&a.mediaBlob.autorelease();i=d("WAWebMediaDataUtils").shouldUseMediaCache(d("WAWebMmsMediaTypes").castToV4(h.type));if(i&&a.mediaBlob instanceof c("WAWebMediaOpaqueData")){i=a.mediaBlob.formData();d("WAWebMediaInMemoryBlobCache").InMemoryMediaBlobCache.put(g,i)}d("WAWebMediaMmsV4Download").downloadMedia({mimetype:a.mimetype,mediaObject:h,downloadEvenIfExpensive:!0,mediaType:d("WAWebMmsMediaTypes").msgToMediaType({type:a.type,isGif:a.isGif,isNewsletter:d("WAWebChatGetters").getIsNewsletter(b)}),rmrReason:d("WAWebWamEnumWebcRmrReasonCode").WEBC_RMR_REASON_CODE.SEND_TO_CHAT,downloadOrigin:s(b,f),mode:"manual",chatWid:b.id});g=babelHelpers["extends"]({},h.msgProps(a));g.caption=e.caption;(e.caption==null||e.caption==="")&&a.type===d("WAWebMediaTypes").OUTWARD_TYPES.DOCUMENT&&(g.caption=a.filename);e.isViewOnce===!0&&(g.isViewOnce=!0);return g})}function B(a,b,c,d){return C.apply(this,arguments)}function C(){C=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e,f,g){var p,q;d("WALogger").LOG(o(),e.id.toLogString());var r=f.caption,s=f.footer,t=f.quotedMsg?f.quotedMsg.msgContextInfo(e.id):{};p=(p=f.productMsgOptions)!=null?p:{};var u=d("WAWebChatEphemerality").isEphemeralSettingOn(e)?d("WAWebChatEphemerality").getEphemeralSetting(e):void 0,v=d("WAWebChatEphemerality").getEphemeralSettingTimestamp(e),B=d("WAWebChatEphemerality").getDisappearingModeInitiator(e),C,D=!1;e.isCAGAdmin()&&(D=!0);q=(q=f.type)!=null?q:a._baseType;d("WAWebMessagingGatingUtils").isReportingTokenSendingEnabled()&&d("WAWebMessagePluginGenerateReportingTokenContent").isMsgTypeReportingTokenCompatible(q)&&(D=!0);D&&(C=self.crypto.getRandomValues(new Uint8Array(32)));var E=babelHelpers["extends"]({},yield d("WAWebMsgDataUtils").genOutgoingMsgData(e,q),{type:q,caption:r,footer:s,quotedMsg:t.quotedMsg,quotedParticipant:t.quotedParticipant,quotedStanzaID:t.quotedStanzaID,quotedRemoteJid:t.quotedRemoteJid,mentionedJidList:f.mentionedJidList,groupMentions:f.groupMentions,isForwarded:f.isForwarded,forwardingScore:f.forwardingScore,forwardedNewsletterMessageInfo:f.forwardedNewsletterMessageInfo,multicast:f.multicast,forwardedFromWeb:f.forwardedFromWeb,ctwaContext:f.ctwaContext,ephemeralDuration:u,ephemeralSettingTimestamp:v,disappearingModeInitiator:B,messageSecret:C,isAvatar:f.isAvatar,viewMode:f.viewMode,parentMsgKey:f.parentMsgKey,associationType:f.associationType},p);if(f.type===d("WAWebMsgType").MSG_TYPE.STICKER_PACK){E.description=f.description;E.isCaptionByUser=Boolean(f.caption);E.thumbnailSha256=f.thumbnailSha256;E.stickers=f.stickers;E.stickerPackPublisher=f.publisher;E.size=(D=f.fileLength)!=null?D:0;E.stickerPackId=f.stickerPackId;E.thumbnailDirectPath=f.thumbnailDirectPath;E.thumbnailEncSha256=f.thumbnailEncSha256;E.trayIconFileName=f.trayIconFileName;E.stickerPackSize=f.stickerPackSize}f.type===d("WAWebMsgType").MSG_TYPE.DOCUMENT&&Boolean(f.caption)&&(E.isCaptionByUser=!0);f.isWamoSub===!0&&(E.isWamoSub=!0);var F,G;function H(a){return I.apply(this,arguments)}function I(){I=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var k;F=a;var l=a.mediaObject;l||d("WALogger").ERROR(j()).sendLogs("media-fault: incorrect media object for created msg");l||h(0,56330);var m=d("WAWebMmsMediaTypes").getMsgMediaType(a),n;k=(k=f.canEnableFastForward)!=null?k:!0;k===!0&&(n=l.entries.getUploadEntry(d("WAWebMediaCryptoEligibilityUtils").isMediaCryptoExpectedForChat(e)));k=n instanceof d("WAWebMediaEntry").EncryptedMediaEntry?{key:n.mediaKey,timestamp:n.mediaKeyTimestamp}:c("WAWebCryptoRandomMediaKey")();var o=l.contentInfo,p=o.fullPreviewData;o=o.fullPreviewSize;var q=a.safe(),r=w(q),s=!p&&r,t=!o&&r,u=r,v=a.body;if((s||t||u)&&l.contentInfo.preview){s=(yield d("WAWebImageUtils").base64ImageToCanvas(l.contentInfo.preview.url()));t=(yield d("WAWebCanvasUtils").generateMicroThumb(s,1300,{mimetype:"image/jpeg",maxAttempts:10}));p=l.contentInfo.preview;o={width:t.width,height:t.height};v=c("WAWebURLUtils").parseDataURL(t.dataUrl).data}u=p&&o&&r;s=p&&u===!0?c("WAWebMediaUploadMmsThumbnail")({thumbnail:p,mediaKeyInfo:k,mediaType:c("WANullthrows")(x(q)),uploadOrigin:c("WAWebMediaGetUploadOriginForChat")(e),forwardedFromWeb:Boolean(a.forwardedFromWeb),isViewOnce:Boolean(a.isViewOnce)}):(i||(i=b("Promise"))).resolve(null);t={mimetype:a.mimetype,canEnableFastForward:f.canEnableFastForward,mediaObject:l,mediaType:m,forwardedFromWeb:Boolean(a.forwardedFromWeb),uploadOrigin:c("WAWebMediaGetUploadOriginForChat")(e),isViewOnce:Boolean(a.isViewOnce),earlyUpload:g};r=d("WAWebMediaCryptoEligibilityUtils").isMediaCryptoExpectedForChat(e)?d("WAWebMediaMmsV4Upload").uploadMedia(babelHelpers["extends"]({},t,{mediaKeyInfo:k})):d("WAWebMediaMmsV4Upload").uploadUnencryptedMedia(babelHelpers["extends"]({},t,{calculateToken:d("WAMediaCalculateFilehash").getRandomFilehash}));p=l.filehash;d("WAWebMediaInMemoryKeyCache").shouldUseMediaKeyCache()&&p!=null&&d("WAWebMediaInMemoryKeyCache").MediaKeyCache.put(p,k);q=(yield (i||(i=b("Promise"))).all([r,s]));a=q[0];t=a.kind;k=a.mediaEntry;r=q[1];c("WAWebMediaGatingShouldClearUploadedBlobs")(m)&&l.clearBlob({reset:!0});G=t;if(!k)throw c("err")("upload failed: media entry was not created");d("WAWebMediaInMemoryKeyCache").shouldUseMediaKeyCache()&&p!=null&&d("WAWebMediaInMemoryKeyCache").MediaKeyCache["delete"](p);a=(s=y({uploadThumbnailResult:r,mediaResultEntry:k,uploadEncryptedThumbnail:u,mediaObject:l,fullPreviewSize:o,mediaType:m}))!=null?s:{};yield c("WAWebMediaUpdateMsg")(F,babelHelpers["extends"]({deprecatedMms3Url:k.deprecatedMms3Url,directPath:k.directPath,mediaKey:k.getMediaKey(),mediaKeyTimestamp:k.getMediaKeyTimestamp(),filehash:l.filehash,encFilehash:k.getEncfilehash(),size:l.size,streamingSidecar:k.sidecar,firstFrameSidecar:k.firstFrameSidecar,body:v,stickerSentTs:d("WATimeUtils").unixTimeMs(),mediaHandle:k instanceof d("WAWebMediaEntry").UnencryptedMediaEntry?k.handle:null},a));return F});return I.apply(this,arguments)}if(f.addEvenWhilePreparing===!0){q=f.placeholderProps||{};r=babelHelpers["extends"]({},q,E);s=function(b){F=b;return A(a,e,f,E).then(function(a){return c("WAWebMediaUpdateMsg")(F,a)}).then(function(){return H(F)})};d("WAWebNewsletterGatingUtils").isNewsletterEnabled()&&d("WAWebChatGetters").getIsNewsletter(e)?t=d("WAWebNewsletterSendMsgAction").sendNewsletterMediaMsg(e,r,s):e.id.isStatus()?(d("WAWebSendStatusMsgAction").sendStatusMediaMsgAction(r,s),t=(i||(i=b("Promise"))).reject(c("err")("unsupported"))):t=d("WAWebSendMsgChatAction").addAndSendMsgToChat(e,r,s)[1]}else{u=A(a,e,f,E).then(function(a){var b=f.useBasePropsType===!0?E.type:a.type;return babelHelpers["extends"]({},E,a,{type:b})});d("WAWebNewsletterGatingUtils").isNewsletterEnabled()&&d("WAWebChatGetters").getIsNewsletter(e)?t=d("WAWebNewsletterSendMsgAction").sendNewsletterMediaMsg(e,yield u,H):e.id.isStatus()?(d("WAWebSendStatusMsgAction").sendStatusMediaMsgAction(yield u,H),t=(i||(i=b("Promise"))).reject(c("err")("unsupported"))):t=d("WAWebSendMsgChatAction").addAndSendMsgToChat(e,u,H)[1]}return t.then(function(a){return{result:a,error:null}})["catch"](function(a){return{result:null,error:a}}).then(function(a){var b,c=a.result;a=a.error;if((c==null?void 0:c.messageSendResult)===d("WAWebSendMsgResultAction").SendMsgResult.OK){F.type===d("WAWebMediaTypes").OUTWARD_TYPES.STICKER&&F.isAvatar!==!0&&d("WAWebRecentStickerCollectionMd").RecentStickerCollectionMd.addStickerWithMediaData(F);return{messageSendResult:d("WAWebSendMsgResultAction").SendMsgResult.OK}}F&&(F.ack=d("WAWebAck").ACK.FAILED);b=(b=F)==null?void 0:(b=b.mediaObject)==null?void 0:b.uploadStage;if(F&&d("WAWebMmsMediaTypes").getMsgMediaType(F)===d("WAWebMediaTypes").OUTWARD_TYPES.STICKER&&d("WAWebAttachMenuGatingUtils").areExpressionPanelsEnabledV2()){var e=b?b:"undefined";G===d("WAWebMediaMmsV4Upload").UploadMediaResultKind.ERROR&&d("WALogger").ERROR(n()).tags("non-sad").sendLogs("sticker-send-fail-with-expressions-panel-enabled-uploadStage-"+e,{sampling:.01})}if(G===d("WAWebMediaMmsV4Upload").UploadMediaResultKind.CANCELLATION){d("WALogger").LOG(m()).devConsole({result:c,uploadStage:b,error:a});(e=F.wamMessageSendReporter)==null?void 0:e.postFailure({result:d("WAWebWamEnumMessageSendResultType").MESSAGE_SEND_RESULT_TYPE.ERROR_CANCELLED,isTerminal:!0});return{messageSendResult:d("WAWebSendMsgResultAction").SendMsgResult.ERROR_CANCELLED}}d("WALogger").WARN(l(),c,b,G,String(a)).devConsole(a);if(b!=null)switch(b){case d("WAWebMediaTypes").UploadStage.NEED_UPLOAD:case d("WAWebMediaTypes").UploadStage.ERROR_TOO_LARGE:return{messageSendResult:z(F)};case d("WAWebMediaTypes").UploadStage.ERROR_MISSING:return{messageSendResult:d("WAWebSendMsgResultAction").SendMsgResult.ERROR_EXPIRED};default:}if(G===d("WAWebMediaMmsV4Upload").UploadMediaResultKind.ERROR)return{messageSendResult:z(F)};if(c!=null)return c;F&&d("WAWebMmsMediaTypes").getMsgMediaType(F)===d("WAWebMediaTypes").OUTWARD_TYPES.STICKER&&d("WALogger").ERROR(k()).sendLogs("sticker-send-fail-unknown-"+(d("WAWebAttachMenuGatingUtils").areExpressionPanelsEnabledV2()?"expression-panels":"old-panels"));return{messageSendResult:d("WAWebSendMsgResultAction").SendMsgResult.ERROR_UNKNOWN}})});return C.apply(this,arguments)}g.MediaPrep=a;g.sendMediaMsgToChat=B}),98); __d("WAWebMediaStorage",["WALogger","WAWebMediaDataUtils","WAWebMediaObject","WAWebMediaStore","WAWebMmsMediaTypes","isStringNullOrEmpty"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[Media Storage] removing data (ArrayBuffer) from persistent storage "]);h=function(){return a};return a}var i={};function a(a,b){a.addMsg(b)}function b(a,b){b.mediaObject=null;a.removeMsg(b);if(a.hasAssociatedMsgsOrStickers())return;o(a.filehash,d("WAWebMediaDataUtils").shouldUseLruMediaStore(d("WAWebMmsMediaTypes").getMsgMediaType(b)));a["delete"]()}function e(){var a=i;i={};for(var b in a)a[b]["delete"]()}function f(a){return Object.prototype.hasOwnProperty.call(i,a)?i[a]:i[a]=new(d("WAWebMediaObject").MediaObject)()}function j(a){}function k(a,b){a.addStickerPack(b)}function l(a,b){b.mediaObject=null;a.removeStickerPack(b);if(a.hasAssociatedMsgsOrStickers())return;o(a.filehash);a["delete"]()}function m(a,b){a.addSticker(b)}function n(a,b){b.mediaObject=null;a.removeSticker(b);if(a.hasAssociatedMsgsOrStickers())return;o(a.filehash);a["delete"]()}var o=function(a,b){b===void 0&&(b=!0);if(c("isStringNullOrEmpty")(a))return;delete i[a];b&&d("WAWebMediaStore").LruMediaStore.del(a)["catch"](function(a){d("WALogger").ERROR(h()).devConsole(a)})};g.associateMediaWithMsg=a;g.disassociateMediaFromMsg=b;g.delistAndDeleteAllMedia=e;g.getOrCreateMediaObject=f;g.clearMediaForChat=j;g.associateMediaWithStickerPack=k;g.disassociateMediaFromStickerPack=l;g.associateMediaWithSticker=m;g.disassociateMediaFromSticker=n}),98); __d("WAWebMediaUploadMmsThumbnail",["WAAbortError","WACustomError","WAPromiseRaceAbort","WAPromiseTimeout","WAWebCryptoCalculateFilehash","WAWebMediaCryptoEligibilityUtils","WAWebMediaMmsV4Upload","WAWebMediaObject","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=a.thumbnail,f=a.mediaType,g=a.mediaKeyInfo,h=a.uploadOrigin,i=a.forwardedFromWeb,j=a.timeout,k=a.signal,l=a.isViewOnce,m=new(d("WAWebMediaObject").MediaObject)();try{return j==null?yield n():yield d("WAPromiseTimeout").promiseTimeout(n(),j)}catch(b){a=b;if(a instanceof d("WACustomError").TimeoutError){d("WAWebMediaMmsV4Upload").cancelUploadMedia(m);return{kind:d("WAWebMediaMmsV4Upload").UploadMediaResultKind.TIMEOUT}}throw a}function n(){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){try{var a=(yield c("WAPromiseRaceAbort")(d("WAWebCryptoCalculateFilehash").calculateFilehashFromBlob(e),k));m.filehash=a;m.mediaBlob=e;var b=d("WAWebMediaCryptoEligibilityUtils").isMediaCryptoExpectedForMediaType(f)?d("WAWebMediaMmsV4Upload").uploadMedia:d("WAWebMediaMmsV4Upload").uploadUnencryptedMedia;b=(yield c("WAPromiseRaceAbort")(b({mimetype:"image/jpeg",mediaObject:m,mediaType:f,forwardedFromWeb:i,uploadOrigin:h,mediaKeyInfo:g,isViewOnce:l}),k));return b.kind===d("WAWebMediaMmsV4Upload").UploadMediaResultKind.SUCCESS?babelHelpers["extends"]({},b,{filehash:a}):{kind:b.kind}}catch(b){a=b;if(typeof a==="object"&&(b==null?void 0:b.name)===d("WAAbortError").ABORT_ERROR){d("WAWebMediaMmsV4Upload").cancelUploadMedia(m);return{kind:d("WAWebMediaMmsV4Upload").UploadMediaResultKind.CANCELLATION}}}});return o.apply(this,arguments)}});return h.apply(this,arguments)}g["default"]=a}),98); __d("WAWebMediaFileTooLargeError",["WACustomError","WAWebMiscErrors"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(b){var c;c=a.call(this,"File ("+b.type()+") size = "+b.size())||this;c.opaqueData=b;return c}return b}(d("WACustomError").customError("MediaFileTooLarge",!0,d("WAWebMiscErrors").MediaFileError));g["default"]=a}),98); __d("WAWebWamEnumDocumentType",[],(function(a,b,c,d,e,f){a=Object.freeze({OTHER:1,IMAGE:2,VIDEO:3,AUDIO:4,DOCUMENT:5,COMPRESSED_FILE:6,EXECUTABLE:7,VCARD:8});f.DOCUMENT_TYPE=a}),66); __d("WAWebSendDocumentWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumDocumentType"],(function(a,b,c,d,e,f,g){a=d("WAWebWamCodegenUtils").defineEvents({SendDocument:[2172,{documentSize:[1,d("WAWebWamCodegenUtils").TYPES.NUMBER],documentType:[2,d("WAWebWamEnumDocumentType").DOCUMENT_TYPE]},[1,1,1],"regular"]},{SendDocument:[]});g.SendDocumentWamEvent=a}),98); __d("WAWebProcessRawMediaLogging",["WAWebSendDocumentWamEvent","WAWebWamEnumDocumentType"],(function(a,b,c,d,e,f,g){var h=new Map([["ai",(b=d("WAWebWamEnumDocumentType")).DOCUMENT_TYPE.IMAGE],["ico",b.DOCUMENT_TYPE.IMAGE],["jpeg",b.DOCUMENT_TYPE.IMAGE],["jpg",b.DOCUMENT_TYPE.IMAGE],["png",b.DOCUMENT_TYPE.IMAGE],["ps",b.DOCUMENT_TYPE.IMAGE],["psd",b.DOCUMENT_TYPE.IMAGE],["svg",b.DOCUMENT_TYPE.IMAGE],["tif",b.DOCUMENT_TYPE.IMAGE],["tiff",b.DOCUMENT_TYPE.IMAGE],["3g2",b.DOCUMENT_TYPE.VIDEO],["3gp",b.DOCUMENT_TYPE.VIDEO],["avi",b.DOCUMENT_TYPE.VIDEO],["flv",b.DOCUMENT_TYPE.VIDEO],["h264",b.DOCUMENT_TYPE.VIDEO],["m4v",b.DOCUMENT_TYPE.VIDEO],["mkv",b.DOCUMENT_TYPE.VIDEO],["mov",b.DOCUMENT_TYPE.VIDEO],["mp4",b.DOCUMENT_TYPE.VIDEO],["mpg",b.DOCUMENT_TYPE.VIDEO],["mpeg",b.DOCUMENT_TYPE.VIDEO],["rm",b.DOCUMENT_TYPE.VIDEO],["vob",b.DOCUMENT_TYPE.VIDEO],["wmv",b.DOCUMENT_TYPE.AUDIO],["aif",b.DOCUMENT_TYPE.AUDIO],["cda",b.DOCUMENT_TYPE.AUDIO],["mpa",b.DOCUMENT_TYPE.AUDIO],["opus",b.DOCUMENT_TYPE.AUDIO],["ogg",b.DOCUMENT_TYPE.AUDIO],["wlp",b.DOCUMENT_TYPE.AUDIO],["amr",b.DOCUMENT_TYPE.AUDIO],["mp3",b.DOCUMENT_TYPE.AUDIO],["m4a",b.DOCUMENT_TYPE.AUDIO],["aac",b.DOCUMENT_TYPE.AUDIO],["wav",b.DOCUMENT_TYPE.AUDIO],["wma",b.DOCUMENT_TYPE.AUDIO],["pdf",b.DOCUMENT_TYPE.DOCUMENT],["doc",b.DOCUMENT_TYPE.DOCUMENT],["docx",b.DOCUMENT_TYPE.DOCUMENT],["ppt",b.DOCUMENT_TYPE.DOCUMENT],["pptx",b.DOCUMENT_TYPE.DOCUMENT],["xls",b.DOCUMENT_TYPE.DOCUMENT],["xlsx",b.DOCUMENT_TYPE.DOCUMENT],["txt",b.DOCUMENT_TYPE.DOCUMENT],["rtf",b.DOCUMENT_TYPE.DOCUMENT],["tex",b.DOCUMENT_TYPE.DOCUMENT],["csv",b.DOCUMENT_TYPE.DOCUMENT],["wpd",b.DOCUMENT_TYPE.DOCUMENT],["7z",b.DOCUMENT_TYPE.COMPRESSED_FILE],["arj",b.DOCUMENT_TYPE.COMPRESSED_FILE],["deb",b.DOCUMENT_TYPE.COMPRESSED_FILE],["pkg",b.DOCUMENT_TYPE.COMPRESSED_FILE],["rar",b.DOCUMENT_TYPE.COMPRESSED_FILE],["rpm",b.DOCUMENT_TYPE.COMPRESSED_FILE],["gz",b.DOCUMENT_TYPE.COMPRESSED_FILE],["z",b.DOCUMENT_TYPE.COMPRESSED_FILE],["zip",b.DOCUMENT_TYPE.COMPRESSED_FILE],["apk",b.DOCUMENT_TYPE.EXECUTABLE],["bat",b.DOCUMENT_TYPE.EXECUTABLE],["bin",b.DOCUMENT_TYPE.EXECUTABLE],["cgi",b.DOCUMENT_TYPE.EXECUTABLE],["pl",b.DOCUMENT_TYPE.EXECUTABLE],["com",b.DOCUMENT_TYPE.EXECUTABLE],["exe",b.DOCUMENT_TYPE.EXECUTABLE],["gadget",b.DOCUMENT_TYPE.EXECUTABLE],["jar",b.DOCUMENT_TYPE.EXECUTABLE],["msi",b.DOCUMENT_TYPE.EXECUTABLE],["py",b.DOCUMENT_TYPE.EXECUTABLE],["wsf",b.DOCUMENT_TYPE.EXECUTABLE]]);function a(a,b){a=a!=null?(a=h.get(a.split(".").pop()))!=null?a:d("WAWebWamEnumDocumentType").DOCUMENT_TYPE.OTHER:d("WAWebWamEnumDocumentType").DOCUMENT_TYPE.OTHER;b=new(d("WAWebSendDocumentWamEvent").SendDocumentWamEvent)({documentSize:b,documentType:a});b.commit()}g.logSendDocumentEvent=a}),98); __d("WAWebProcessRawMedia",["Promise","WAWebABProps","WAWebFileUtils","WAWebMediaDataUtils","WAWebMediaFileTooLargeError","WAWebMediaGatingUtils","WAWebMiscErrors","WAWebProcessRawMediaLogging","err"],(function(a,b,c,d,e,f,g){var h;function a(a,e){var f=(h||(h=b("Promise"))).resolve().then(function(){var b,f=a.size(),g;e.asDocument===!0?g=d("WAWebFileUtils").FILETYPE.DOCUMENT:e.asSticker===!0?g=d("WAWebFileUtils").FILETYPE.STICKER:e.asStickerPack===!0?g=d("WAWebFileUtils").FILETYPE.STICKER_PACK:g=d("WAWebFileUtils").typeFromMimetype(a.type());b=(b=e.isVcardOverMmsDocument)!=null?b:!1;var h=d("WAWebMediaGatingUtils").getUploadLimit(g,e.fileOrigin,b);g==="document"&&d("WAWebProcessRawMediaLogging").logSendDocumentEvent(e.filename,f);if(f>h)throw new(c("WAWebMediaFileTooLargeError"))(a);if(f<=0)throw new(d("WAWebMiscErrors").MediaFileEmpty)();var i;e.gifAttribution!=null?i=e.gifAttribution:e.asGif===!0&&(i=0);switch(g){case"image":return d("WAWebMediaDataUtils").processRawImage(a,{maxDimension:(h=e.maxDimension)!=null?h:d("WAWebABProps").getABPropConfigValue("web_image_max_edge"),minDimension:e.minDimension,transparency:e.transparency});case"sticker":return d("WAWebMediaDataUtils").processRawSticker(a);case"video":case"audio":return d("WAWebMediaDataUtils").processRawAudioVideo(a,!!e.isPtt,e.precomputedFields,e.asGif,i,a.type(),e.accessibilityLabel);case"document":case"sticker-pack":return d("WAWebMediaDataUtils").processRawDocument(a,e.filename,b,e.documentPageCount,g);default:g;throw c("err")("Received unsupported mediaType: "+g)}});a.retain();a.autoreleaseWhenPromiseCompletes(f);return f}g.processRawMedia=a}),98); __d("WAWebRequestMediaReuploadManager",["Promise","WALogger","WANullthrows","WAWebMiscErrors","WAWebMmsMediaTypes","WAWebMsgGetters","WAWebSendServerErrorReceiptJob","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["resolveMediaReupload: msgId (",") is not found in _rmrRequests"]);i=function(){return a};return a}a=function(){var a=this;this._rmrRequests=new Map();this.requestMediaReupload=function(){var e=b("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var f=e.id.id;if(d("WAWebMsgGetters").getIsNewsletterMsg(e))throw new(d("WAWebMiscErrors").RMRNotSupportedOnNewsletterMessagesError)(d("WAWebMmsMediaTypes").getMsgMediaType(e));var g=a._rmrRequests.get(f);if(g)return c("WANullthrows")(g.request);g=new(h||(h=b("Promise")))(function(b,c){a._rmrRequests.set(f,{resolve:b,reject:c,msg:e})});c("WANullthrows")(a._rmrRequests.get(f)).request=g;yield c("WAWebSendServerErrorReceiptJob")(e);return g});return function(a){return e.apply(this,arguments)}}();this.resolveMediaReupload=function(b){var c=b.msgId,e=b.result;b=b.directPath;var f=a._rmrRequests.get(c);f!=null?(f.resolve({result:e,directPath:b}),a._rmrRequests["delete"](c)):d("WALogger").WARN(i(),c)};this.getMediaKey=function(b){return(b=a._rmrRequests.get(b))==null?void 0:b.msg.mediaKey}};e=new a();g.RequestMediaReuploadManagerImpl=a;g.RequestMediaReuploadManager=e}),98); __d("WAWebDecodeWebpToRgba",["Promise","WAWebMiscErrors","WAWebWebpToRgbaWorkerResource","WorkerBundleResource"],(function(a,b,c,d,e,f,g){var h;function a(a){return new(h||(h=b("Promise")))(function(b,e){var f=d("WorkerBundleResource").createDedicatedWebWorker(c("WAWebWebpToRgbaWorkerResource"));f.onerror=function(a){f.terminate(),e(new(d("WAWebMiscErrors").DecodeWebpResultsError)("worker error",a))};f.onmessageerror=function(a){f.terminate(),e(new(d("WAWebMiscErrors").DecodeWebpResultsError)("worker message error",a))};f.onmessage=function(a){f.terminate();a=a.data;b(a)};f.postMessage({type:"message",message:{webpBuffer:a}},[a])})}g["default"]=a}),98); __d("WAXMultiSitePdfWorkerResourceControllerRouteBuilder",["jsRouteBuilder"],(function(a,b,c,d,e,f,g){a=c("jsRouteBuilder")("/static_resources/webworker/pdf-worker/",Object.freeze({}),void 0);b=a;g["default"]=b}),98); __d("WAWebPDFWorkerSrc",["WAXMultiSitePdfWorkerResourceControllerRouteBuilder"],(function(a,b,c,d,e,f,g){function a(){return c("WAXMultiSitePdfWorkerResourceControllerRouteBuilder").buildUri({}).toString()}g.getWorkerSrc=a}),98); __d("WAWebPDFUtils",["JSResourceForInteraction","Promise","WABackoffUtils","WAPromiseDelays","WAPromiseLoop","WAPromiseProps","WAWebABProps","WAWebCanvasUtils","WAWebConstantsDeprecated","WAWebImageUtils","WAWebMediaOpaqueData","WAWebMiscErrors","WAWebPDFWorkerSrc","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){return d("WAPromiseLoop").promiseLoop(function(a,b,e){var f=d("WAPromiseDelays").delayMs(d("WABackoffUtils").expBackoff(e,12e4,0,0));return c("JSResourceForInteraction")("pdfjs-dist").__setRef("WAWebPDFUtils").load().then(function(b){b.GlobalWorkerOptions.workerSrc=d("WAWebPDFWorkerSrc").getWorkerSrc(),a({GlobalWorkerOptions:b.GlobalWorkerOptions,getDocument:b.getDocument})})["catch"](function(){return f})})}function a(a){var b=URL.createObjectURL(a);return i().then(function(a){return a.getDocument({url:b,isEvalSupported:!1}).promise})}function e(a){return a.destroy()}function f(a,e){var f=document.createElement("canvas");return a.getPage(e).then(function(a){var b=a.getViewport({scale:1}),c=f.getContext("2d");f.height=b.height;f.width=b.width;c={canvasContext:c,viewport:b};return a.render(c).promise}).then(function(){var a;return d("WAPromiseProps").promiseProps({blob:d("WAWebCanvasUtils").canvasToBlob(f),thumbnail:(a=d("WAWebImageUtils")).rotateAndResize(f,c("WAWebConstantsDeprecated").DOC_THUMB_MAX_EDGE,a.DATA_URL|a.CANVAS|a.BLOB),microThumbnail:d("WAWebABProps").getABPropConfigValue("upload_document_thumb_mms_enabled")?d("WAWebCanvasUtils").generateMicroThumb(f,1300,{mimetype:"image/jpeg",maxAttempts:10}):(h||(h=b("Promise"))).resolve(null)})}).then(function(a){return a}).then(function(){var e=b("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var f=e.blob,g=e.thumbnail;e=e.microThumbnail;g=g.images;var b=g.canvas,h=g.blob;g=g.dataUrl;if(b==null||h==null||g==null)throw new(d("WAWebMiscErrors").MediaFileFailedLoad)();return{url:URL.createObjectURL(f),thumbUrl:g,width:b.width,height:b.height,fullPreviewData:yield c("WAWebMediaOpaqueData").createFromData(h,"image/jpeg"),fullPreviewSize:{width:b.width,height:b.height},pdfPages:a.numPages,microThumbnail:e}});return function(a){return e.apply(this,arguments)}}())}g.fileToPdf=a;g.releasePdf=e;g.pdfToImg=f}),98); __d("WAWebDocumentUploadEnrichment",["Promise","WALogger","WAPromiseTimeout","WAWebMimeTypes","WAWebPDFUtils"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["pdf preview generation failed"]);i=function(){return a};return a}function a(a,c){var e;switch(d("WAWebMimeTypes").previewType(c)){case"pdf":e=j(a);break;default:e=(h||(h=b("Promise"))).resolve()}return d("WAPromiseTimeout").promiseTimeout(e,3e3,"Document enrichment timeout")["catch"](function(){return null})}function j(a){var b;return d("WAWebPDFUtils").fileToPdf(a).then(function(a){b=a;return d("WAWebPDFUtils").pdfToImg(a,1)})["catch"](function(a){d("WALogger").LOG(i()).devConsole(a);return null})["finally"](function(){b&&d("WAWebPDFUtils").releasePdf(b)})}g.enrich=a;g.enrichPdf=j}),98); __d("WAWebSendMessageToMediaWorker",["Promise","WALogger","WAWebMediaWorkerResource","WebWorker"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["(via Milan) ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["MediaAnalyzer:sendMessageToMediaWorker"]);j=function(){return a};return a}var k=l();function a(a){var c;return new(h||(h=b("Promise")))(function(b,e){d("WALogger").LOG(j()),c=k&&m(k)?l():k,c.setMessageHandler(function(a){try{a.type==="log"?d("WALogger").LOG(i(),a.msg):b(a)}catch(a){e(a)}}).setErrorHandler(function(a){e(new Error("Milan.onerror = "+((a==null?void 0:a.message)?a.message:a)))}).execute(),c.postMessage(a)})["finally"](function(){c&&(c.terminate(),(!k||!k.isCurrentState("constructed"))&&(k=l()))})}function l(){return new(c("WebWorker"))(c("WAWebMediaWorkerResource")).setAllowCrossPageTransition(!0)}function m(a){return a.isCurrentState("preparing")||a.isCurrentState("executing")}g.sendMessageToMediaWorker=a}),98); __d("WAWebWebcMediaAnalyzedWamEvent",["WAWebWamCodegenUtils"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({WebcMediaAnalyzed:[912,{webcMediaAnalyzeT:[3,a.TYPES.TIMER],webcMediaExtensions:[2,a.TYPES.STRING],webcMediaSupported:[1,a.TYPES.BOOLEAN]},[1,1,1],"regular"]},{WebcMediaAnalyzed:[]});g.WebcMediaAnalyzedWamEvent=b}),98); __d("WAWebMediaAnalyzer",["WALogger","WAMediaWasmWorkerClient","WAWebMediaGatingUtils","WAWebSendMessageToMediaWorker","WAWebWebcMediaAnalyzedWamEvent","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[processVideoThroughWasm][error] unrecognised error ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[processVideoThroughWasm][error] error ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[processVideoThroughWasm][error] failed to repair video file"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[processVideoThroughWasm][success]"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[processVideoThroughWasm] start process video through wasm"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["MediaAnalyzer:checkAndRepair got error! ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["MediaAnalyzer:checkAndRepair rejected file (",")"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["MediaAnalyzer:checkAndRepair got parsing error! ",""]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["trouble parsing file "," (fossil ",") ",""]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["MediaAnalyzer:checkAndRepair approved file"]);q=function(){return a};return a}function a(a,b){var c=new(d("WAWebWebcMediaAnalyzedWamEvent").WebcMediaAnalyzedWamEvent)(),e=!1;b=d("WAWebMediaGatingUtils").shouldUseWasmMediaWorkerForFile(a)?r(a,b):d("WAWebSendMessageToMediaWorker").sendMessageToMediaWorker({type:"prep",file:a,asGif:b}).then(function(a){var b=a.type,c=a.result,f=a.error,g=a.filename;a=a.file;switch(b){case"result":d("WALogger").LOG(q());e=!!c;return c;case"parsingError":d("WALogger").LOG(p(),a,g,String(f));a&&d("WALogger").ERROR(o(),String(f)).sendLogs("media-parsing-error");d("WALogger").LOG(n(),String(f));return void 0}});return b["catch"](function(a){d("WALogger").ERROR(m(),String(a)).sendLogs("media-detection-error");return void 0})["finally"](function(){if(c){var b=void 0;if(a.name){var d=a.name.split(".");d.length>1&&(b=d[d.length-1])}c.set({webcMediaSupported:e,webcMediaExtensions:b});c.markWebcMediaAnalyzeT();c.commit()}})}function r(a,b){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){d("WALogger").LOG(l());a=(yield a.arrayBuffer());a=(yield d("WAMediaWasmWorkerClient").mp4RepairMuxInWorker({input:new Uint8Array(a),eventFlow:null}));if(a.success){d("WALogger").LOG(k()).devConsole(a);return{type:"video/mp4",file:new Blob([a.value],{type:"video/mp4"}),isGif:b}}switch(a.error){case"undefined-operation":case"worker-connection-runtime-error":case"invalid-media":case"runtime-error":case"internal-error":d("WALogger").WARN(j()).devConsole(a);break;case"worker-connection-timeout":d("WALogger").ERROR(i(),a.error).sendLogs("worker-connection-timeout-error");break;default:a.error;d("WALogger").ERROR(h(),a.error).sendLogs("media-analyzer-unrecognised-error");break}});return s.apply(this,arguments)}g.checkAndRepair=a}),98); __d("WAWebWamEnumVideoTranscoderAlgorithmType",[],(function(a,b,c,d,e,f){a=Object.freeze({WA_IPHONE:0,FB_IPHONE:1});f.VIDEO_TRANSCODER_ALGORITHM_TYPE=a}),66); __d("WAWebWamEnumVideoTranscoderResultType",[],(function(a,b,c,d,e,f){a=Object.freeze({UNKNOWN:0,SUCCEEDED:1,FAILED:2,CANCELLED:3});f.VIDEO_TRANSCODER_RESULT_TYPE=a}),66); __d("WAWebWamEnumVideoTranscoderSourceFormatType",[],(function(a,b,c,d,e,f){a=Object.freeze({SLOMO:0,VIDEO:1,GIF:2});f.VIDEO_TRANSCODER_SOURCE_FORMAT_TYPE=a}),66); __d("WAWebWamEnumVideoTranscoderTargetFormatType",[],(function(a,b,c,d,e,f){a=Object.freeze({IMAGE:0,VIDEO:1,GIF:2});f.VIDEO_TRANSCODER_TARGET_FORMAT_TYPE=a}),66); __d("WAWebVideoTranscoderWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumVideoTranscoderAlgorithmType","WAWebWamEnumVideoTranscoderResultType","WAWebWamEnumVideoTranscoderSourceFormatType","WAWebWamEnumVideoTranscoderTargetFormatType"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({VideoTranscoder:[1802,{sourceAudioBitRate:[12,a.TYPES.NUMBER],sourceDuration:[8,a.TYPES.TIMER],sourceFileSize:[7,a.TYPES.NUMBER],sourceFormat:[14,d("WAWebWamEnumVideoTranscoderSourceFormatType").VIDEO_TRANSCODER_SOURCE_FORMAT_TYPE],sourceFrameRate:[13,a.TYPES.NUMBER],sourceHeight:[10,a.TYPES.NUMBER],sourceVideoBitRate:[11,a.TYPES.NUMBER],sourceWidth:[9,a.TYPES.NUMBER],targetAudioBitRate:[20,a.TYPES.NUMBER],targetDuration:[16,a.TYPES.TIMER],targetFileSize:[15,a.TYPES.NUMBER],targetFormat:[22,d("WAWebWamEnumVideoTranscoderTargetFormatType").VIDEO_TRANSCODER_TARGET_FORMAT_TYPE],targetFrameRate:[21,a.TYPES.NUMBER],targetHeight:[18,a.TYPES.NUMBER],targetVideoBitRate:[19,a.TYPES.NUMBER],targetWidth:[17,a.TYPES.NUMBER],transcoderAlgorithm:[1,d("WAWebWamEnumVideoTranscoderAlgorithmType").VIDEO_TRANSCODER_ALGORITHM_TYPE],transcoderContainsVideocomposition:[5,a.TYPES.BOOLEAN],transcoderHasEdits:[6,a.TYPES.BOOLEAN],transcoderIsPassthrough:[4,a.TYPES.BOOLEAN],transcoderResult:[2,d("WAWebWamEnumVideoTranscoderResultType").VIDEO_TRANSCODER_RESULT_TYPE],transcoderT:[3,a.TYPES.TIMER]},[1,1,1],"regular"]},{VideoTranscoder:[]});g.VideoTranscoderWamEvent=b}),98); __d("WAWebWaveformUtils",["WAPttComposerScaleWaveform","WAWebNewsletterGatingUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";var h=64;function a(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!d("WAWebNewsletterGatingUtils").isAudioFileWaveformSenderEnabled())return null;a=(yield a.arrayBuffer());var b=new AudioContext({sampleRate:8e3});b=(yield b.decodeAudioData(a));a=j(b,h);return new Uint8Array(a)});return i.apply(this,arguments)}function j(a,b){a=a.getChannelData(0);return l(k(a,b))}function k(a,b){return c("WAPttComposerScaleWaveform")(Array.from(a,Math.abs),b)}function l(a){var b=Math.pow(Math.max.apply(Math,a),-1);a=a.map(function(a){return a*b});return a.map(function(a){return a*100})}g.computeWaveform=a}),98); __d("WAWebMediaDataUtils",["Promise","WABase64","WAFilteredCatch","WALogger","WANullthrows","WAPromiseCallSync","WAWebABProps","WAWebCanvasUtils","WAWebConstantsDeprecated","WAWebDecodeWebpToRgba","WAWebDocumentUploadEnrichment","WAWebFileUtils","WAWebImageUtils","WAWebMediaAnalyzer","WAWebMediaCleanFileName","WAWebMediaLoad","WAWebMediaOpaqueData","WAWebMediaTypes","WAWebMimeTypes","WAWebMiscErrors","WAWebMiscGatingUtils","WAWebMmsMediaTypes","WAWebNetworkGetResponseIfOnline","WAWebStickerUtils","WAWebURLUtils","WAWebVcardParsingUtils","WAWebVideoTranscoderWamEvent","WAWebWamEnumVideoTranscoderResultType","WAWebWamEnumVideoTranscoderSourceFormatType","WAWebWamEnumVideoTranscoderTargetFormatType","WAWebWaveformUtils","WAWebWebpParseWebp","WAWebXHR","asyncToGeneratorRuntime","err","file-type","isStringNullOrEmpty"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["object type: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Assertion failed!"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["Assertion failed!"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["processRawAudioVideo bad video file ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["processRawImage: Failed to reach max thumbnail size, preview will be null"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["MediaUtils error: ",""]);n=function(){return a};return a}var o=2e4;function a(a){return J(function(){var d=b("asyncToGeneratorRuntime").asyncToGenerator(function*(d){d(a);var e=new Image();yield new(h||(h=b("Promise")))(function(b,d){e.onload=b,e.onabort=function(){d(c("err")("getImageWidthHeight onabort"))},e.onerror=function(){d(c("err")("getImageWidthHeight onerror"))},e.src=a.url()});return{width:e.naturalWidth,height:e.naturalHeight}});return function(a){return d.apply(this,arguments)}}())}function p(a){return new(h||(h=b("Promise")))(function(b,d){var e=new Image(),f=window.URL.createObjectURL(a);e.onload=function(){var a={width:e.naturalWidth,height:e.naturalHeight};window.URL.revokeObjectURL(f);b(a)};e.onabort=function(){window.URL.revokeObjectURL(f),d(c("err")("getImageWidthHeight onabort"))};e.onerror=function(){window.URL.revokeObjectURL(f),d(c("err")("getImageWidthHeight onerror"))};e.src=f})}function q(a){return d("WAWebFileUtils").blobToArrayBuffer(a)["catch"](function(a){d("WALogger").WARN(n(),a).devConsole(a);throw a})}function e(a){return J(function(b){b(a);b=a.getBlob();if(b)return q(b);b=c("WANullthrows")(a.getBase64(),"b64 should be defined");return d("WABase64").decodeB64(b)})}function f(a){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield q(a));return c("WAWebDecodeWebpToRgba")(a)});return r.apply(this,arguments)}function s(a){return t.apply(this,arguments)}function t(){t=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield q(a));return d("WAWebWebpParseWebp").parseWebp(a)});return t.apply(this,arguments)}function u(a){return J(function(b){b(a);return d("WAWebMediaLoad").videoWidthHeightDuration(a.forceToBlob())})}function v(a){return d("WAWebMediaLoad").videoWidthHeightDuration(a)}function w(a,e){return J(function(){var f=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){b(a);var f=(yield d("WAWebMediaLoad").transcode(a.forceToBlob(),e).then(function(a){return c("WAWebMediaOpaqueData").createFromData(a,a.type)}));b(f);f.autorelease();return f});return function(a){return f.apply(this,arguments)}}())}function x(a,b){return y.apply(this,arguments)}function y(){y=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=b.transparency,e=b.minDimension;b=b.maxDimension;a=(yield d("WAWebImageUtils").rotateAndResize(a,b,d("WAWebImageUtils").BLOB,{transparency:c,minDimension:e}));b=a.width;c=a.height;e=a.images;if(e==null||e.blob==null)throw new(d("WAWebMiscErrors").MediaFileFailedLoad)();return{width:b,height:c,size:e.blob.size}});return y.apply(this,arguments)}function z(a,b){return A.apply(this,arguments)}function A(){A=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e=b.transparency,f=b.minDimension;b=b.maxDimension;a=a.forceToBlob();a=(yield d("WAWebImageUtils").rotateAndResize(a,b,d("WAWebImageUtils").BLOB|d("WAWebImageUtils").CANVAS,{transparency:e,minDimension:f}));b=a.width;e=a.height;f=a.images;if(f==null||f.canvas==null)throw new(d("WAWebMiscErrors").MediaFileFailedLoad)();a=(yield d("WAWebImageUtils").rotateAndResize(f.canvas,c("WAWebConstantsDeprecated").IMG_THUMB_MAX_EDGE,d("WAWebImageUtils").DATA_URL|d("WAWebImageUtils").CANVAS));a=a.images;if(a==null||a.canvas==null)throw new(d("WAWebMiscErrors").MediaFileFailedLoad)();a=d("WAWebCanvasUtils").getResizedDataUrl(a.canvas,"image/jpeg",o);a=a!=null&&a!==""?c("WAWebURLUtils").parseDataURL(a).data:null;(a==null||a==="")&&d("WALogger").LOG(m());return{type:d("WAWebMediaTypes").OUTWARD_TYPES.IMAGE,mediaBlob:f.blob,mimetype:(f=f.blob)==null?void 0:f.type,fullWidth:b,fullHeight:e,preview:a}});return A.apply(this,arguments)}function B(a){return C.apply(this,arguments)}function C(){C=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a.forceToBlob();a=(yield d("WAWebImageUtils").rotateAndResize(a,d("WAWebABProps").getABPropConfigValue("web_image_max_edge"),d("WAWebImageUtils").BLOB,{transparency:!0}));var b=a.width,e=a.height;a=a.images;if(a==null||a.blob==null)throw new(d("WAWebMiscErrors").MediaFileFailedLoad)();a=(yield d("WAWebImageUtils").toWebpSticker(a.blob));var f=(yield c("WAWebMediaOpaqueData").createFromData(a,a.type));return{type:d("WAWebMediaTypes").OUTWARD_TYPES.STICKER,mediaBlob:f,mimetype:a.type,fullWidth:b,fullHeight:e}});return C.apply(this,arguments)}function D(a,b,c,d,e,f,g){return E.apply(this,arguments)}function E(){E=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e,f,g,h,i){h=a.forceToBlob();a=new(d("WAWebVideoTranscoderWamEvent").VideoTranscoderWamEvent)({sourceHeight:e==null?void 0:e.fullHeight,sourceWidth:e==null?void 0:e.fullWidth,sourceDuration:e==null?void 0:e.duration,sourceFileSize:a.size(),sourceFormat:f===!0?d("WAWebWamEnumVideoTranscoderSourceFormatType").VIDEO_TRANSCODER_SOURCE_FORMAT_TYPE.GIF:d("WAWebWamEnumVideoTranscoderSourceFormatType").VIDEO_TRANSCODER_SOURCE_FORMAT_TYPE.VIDEO});a.startTranscoderT();var m=(yield d("WAWebMediaAnalyzer").checkAndRepair(h,!!f));a.markTranscoderT();if(!m){a.set({transcoderResult:d("WAWebWamEnumVideoTranscoderResultType").VIDEO_TRANSCODER_RESULT_TYPE.FAILED});a.commit();d("WALogger").WARN(l(),h.type).devConsole(h);throw new(d("WAWebMiscErrors").InvalidMediaCheckRepairFailedType)()}h=m.type;var n=m.file;a.set({targetFileSize:n.size});f=f===!0||m.isGif===!0;switch(d("WAWebFileUtils").typeFromMimetype(h)){case d("WAWebFileUtils").FILETYPE.VIDEO:if(b){a.set({transcoderResult:d("WAWebWamEnumVideoTranscoderResultType").VIDEO_TRANSCODER_RESULT_TYPE.FAILED});a.commit();d("WALogger").ERROR(k()).sendLogs("media-fault: ptt became video");throw new(d("WAWebMiscErrors").InvalidMediaFileType)()}a.set({targetFormat:d("WAWebWamEnumVideoTranscoderTargetFormatType").VIDEO_TRANSCODER_TARGET_FORMAT_TYPE.VIDEO,transcoderResult:d("WAWebWamEnumVideoTranscoderResultType").VIDEO_TRANSCODER_RESULT_TYPE.SUCCEEDED});m={type:d("WAWebMediaTypes").OUTWARD_TYPES.VIDEO,mediaBlob:n,mimetype:h,isGif:f,gifAttribution:f?g||0:void 0,accessibilityLabel:i};if(e&&e.duration!=null&&e.fullHeight!=null&&e.fullHeight!==0&&e.fullWidth!=null&&e.fullWidth!==0&&!c("isStringNullOrEmpty")(e.preview)){f=e.duration;a.set({sourceHeight:e.fullHeight,sourceWidth:e.fullWidth,sourceDuration:f});a.commit();return babelHelpers["extends"]({},m,{fullWidth:e.fullWidth,fullHeight:e.fullHeight,preview:e.preview,duration:f==null?void 0:f.toString()})}g=(yield d("WAWebImageUtils").generateVideoThumbsAndDuration({file:n,maxDimensions:[c("WAWebConstantsDeprecated").IMG_THUMB_MAX_EDGE,c("WAWebConstantsDeprecated").VIDEO_THUMB_MAX_EDGE],debugHint:"processRawAudioVideo"}));i=g.duration;f=g.thumbs;g=f[0];f=f[1];f=(yield c("WAWebMediaOpaqueData").createFromBase64Jpeg(c("WAWebURLUtils").parseDataURL(f.url).data));a.set({sourceHeight:g.fullHeight,sourceWidth:g.fullWidth,sourceDuration:i});a.commit();return babelHelpers["extends"]({},m,{fullWidth:g.fullWidth,fullHeight:g.fullHeight,preview:c("WAWebURLUtils").parseDataURL(g.url).data,fullPreviewData:f,duration:i.toString()});case d("WAWebFileUtils").FILETYPE.AUDIO:g=(m=e==null?void 0:e.duration)!=null?m:yield d("WAWebFileUtils").getAudioDuration(n);i=(f=e==null?void 0:e.waveform)!=null?f:yield d("WAWebWaveformUtils").computeWaveform(n);return{type:b?d("WAWebMediaTypes").OUTWARD_TYPES.PTT:d("WAWebMediaTypes").OUTWARD_TYPES.AUDIO,mediaBlob:n,mimetype:h,duration:g.toString(),waveform:i};default:a.set({transcoderResult:d("WAWebWamEnumVideoTranscoderResultType").VIDEO_TRANSCODER_RESULT_TYPE.FAILED});a.commit();d("WALogger").ERROR(j()).sendLogs("media-fault: audio/video became other");throw c("err")("audio/video became "+h)}});return E.apply(this,arguments)}function F(a,b){return G.apply(this,arguments)}function G(){G=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e=a.type;if(e){if(d("WAWebMimeTypes").DOC_MIMES==="*"||d("WAWebMimeTypes").DOC_MIMES.includes(e))return e;throw new(d("WAWebMiscErrors").InvalidMediaFileType)("disallowed mimetype "+e)}else{e=Math.min(d("WAWebMimeTypes").MIMETYPE_DETERMINING_LENGTH,a.size);e=(yield q(a.slice(0,e)));e=new Uint8Array(e);if(d("WAWebMimeTypes").isMsCompoundFileBinaryFormat(e.subarray(0,8))){var f;return b!=null?(f=d("WAWebFileUtils").getMimeTypeForFilepath(b))!=null?f:d("WAWebMimeTypes").MSCFB_MIME:d("WAWebMimeTypes").MSCFB_MIME}f=c("file-type")(e);if(f==null?void 0:f.mime){e=d("WAWebMimeTypes").isAllowedDocumentMimetype(f.mime,b,!0);if(e!==!1&&!c("isStringNullOrEmpty")(e))return e}else if(!c("isStringNullOrEmpty")(b)){f=d("WAWebFileUtils").getMimeTypeForFilepath(b);if(!c("isStringNullOrEmpty")(f))return f}throw new(d("WAWebMiscErrors").InvalidMediaFileType)("type: "+String(a.type)+" name: "+String(b))}});return G.apply(this,arguments)}function H(a,b,c,d,e){return I.apply(this,arguments)}function I(){I=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e,f,g,i){var j;a=a.forceToBlob();e=d("WAWebMediaCleanFileName").cleanFilename(a.name||((e=e)!=null?e:""));var k=(yield F(a,e)),l=f?d("WAWebFileUtils").blobToText(a):null;l=(yield (h||(h=b("Promise"))).all([d("WAWebDocumentUploadEnrichment").enrich(a,k),l]));var m=l[0];l=l[1];j=(j=m==null?void 0:(j=m.microThumbnail)==null?void 0:j.dataUrl)!=null?j:m==null?void 0:m.thumbUrl;j=c("isStringNullOrEmpty")(j)?null:c("WAWebURLUtils").parseDataURL(j).data;return{type:i,mediaBlob:yield c("WAWebMediaOpaqueData").createFromData(a,k),mimetype:k,filename:e||void 0,documentPreview:m,preview:j,fullPreviewData:m==null?void 0:m.fullPreviewData,fullPreviewSize:m?{width:m.width,height:m.height}:null,pageCount:(i=g)!=null?i:m==null?void 0:m.pdfPages,isVcardOverMmsDocument:f,parsedVcards:l?d("WAWebVcardParsingUtils").parseMultiVcard(l):null}});return I.apply(this,arguments)}function J(a){var b=[];function c(a){a.retain(),b.push(a)}return d("WAPromiseCallSync").promiseCallSync(a,null,c)["finally"](function(){for(var a=0;a<b.length;a++)b[a].autorelease()})}function K(a){return L.apply(this,arguments)}function L(){L=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield c("WAWebNetworkGetResponseIfOnline")(a,"GET",null,c("WAWebXHR").RESP_TYPE.ARRAY_BUFFER));return!a?(h||(h=b("Promise"))).resolve(null):(h||(h=b("Promise"))).resolve({result:a.response,status:a.status})});return L.apply(this,arguments)}function M(){return!!d("WAWebMediaLoad").canPlayOgg}function N(a,b){return O.apply(this,arguments)}function O(){O=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b.retain();var e,f;try{switch(a.type){case d("WAWebMediaTypes").TYPE.VIDEO:case d("WAWebMediaTypes").TYPE.PTV:var g=b.forceToBlob();g=(yield d("WAWebImageUtils").generateVideoThumbsAndDuration({file:g,maxDimensions:[c("WAWebConstantsDeprecated").VIDEO_THUMB_MAX_EDGE],debugHint:"gatherAndSetMetadata"}));var h=g.thumbs;h=h[0];g=g.duration;var j;d("WAWebMiscGatingUtils").isHighQualityVideoThumbnailsEnabled()&&(j=(yield c("WAWebMediaOpaqueData").createFromBase64Jpeg(c("WAWebURLUtils").parseDataURL(h.url).data)));e={mediaBlob:b,renderableUrl:b.url(),fullWidth:h.fullWidth,fullHeight:h.fullHeight,duration:g!==void 0?""+Math.ceil(g):void 0,durationFloat:g,fullPreviewData:j};break;case d("WAWebMediaTypes").TYPE.AUDIO:var k=(yield w(b));k.retain();e={mediaBlob:k,renderableUrl:k.url()};f=function(){return k.autorelease()};break;default:(a.type===d("WAWebMediaTypes").TYPE.IMAGE||a.type===d("WAWebMediaTypes").TYPE.STICKER)&&d("WALogger").ERROR(i(),a.type||"").sendLogs("Entering gatherAndSetMetadata (with OpaqueData) unexpectedly"),e={mediaBlob:b,renderableUrl:b.url()}}a.consolidate(e)}catch(c){if(c instanceof d("WAWebMiscErrors").MediaUnsupportedError)a.consolidate({mediaBlob:b,renderableUrl:b.url()});else throw c}finally{b.autorelease(),f!=null&&f()}});return O.apply(this,arguments)}function P(a,b){return Q.apply(this,arguments)}function Q(){Q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){var e=(yield (h||(h=b("Promise"))).resolve().then(function(){switch(a.type){case d("WAWebMediaTypes").TYPE.VIDEO:case d("WAWebMediaTypes").TYPE.PTV:return v(c).then(function(a){return{fullWidth:a.width,fullHeight:a.height,duration:a.duration!==void 0?""+Math.ceil(a.duration):void 0,durationFloat:a.duration}});case d("WAWebMediaTypes").TYPE.IMAGE:return a.contentInfo.fullHeight!=null&&a.contentInfo.fullWidth!=null&&a.size===c.size?null:p(c).then(function(a){return{fullWidth:a.width,fullHeight:a.height,size:c.size}});case d("WAWebMediaTypes").TYPE.STICKER:return d("WAWebStickerUtils").parseStickerMetadata(c,a);case d("WAWebMediaTypes").TYPE.AUDIO:return{};default:return{}}})["catch"](d("WAFilteredCatch").filteredCatch(d("WAWebMiscErrors").MediaUnsupportedError,function(b){a.consolidate({});throw b})));if(e==null)return;a.consolidate(e)});return Q.apply(this,arguments)}function R(a){return a===d("WAWebMmsMediaTypes").MEDIA_TYPES.STICKER||a===d("WAWebMmsMediaTypes").MEDIA_TYPES.IMAGE||a===d("WAWebMmsMediaTypes").MEDIA_TYPES.PRODUCT||a===d("WAWebMmsMediaTypes").MEDIA_TYPES.PTT||a===d("WAWebMmsMediaTypes").MEDIA_TYPES.AUDIO||a===d("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_IMAGE||a===d("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_PTT||a===d("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_STICKER||a===d("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_AUDIO}function S(a){var b=a===d("WAWebMmsMediaTypes").MEDIA_TYPES.STICKER||a===d("WAWebMmsMediaTypes").MEDIA_TYPES.IMAGE||a===d("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_IMAGE||a===d("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_STICKER;a=a===d("WAWebMmsMediaTypes").MEDIA_TYPES.AUDIO||a===d("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_AUDIO||a===d("WAWebMmsMediaTypes").MEDIA_TYPES.DOCUMENT||a===d("WAWebMmsMediaTypes").MEDIA_TYPES.GIF||a===d("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_GIF||a===d("WAWebMmsMediaTypes").MEDIA_TYPES.PPIC||a===d("WAWebMmsMediaTypes").MEDIA_TYPES.PRODUCT||a===d("WAWebMmsMediaTypes").MEDIA_TYPES.PTT||a===d("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_PTT||a===d("WAWebMmsMediaTypes").MEDIA_TYPES.VIDEO||a===d("WAWebMmsMediaTypes").MEDIA_TYPES.PTV||a===d("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_PTV||a===d("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_VIDEO||a===d("WAWebMmsMediaTypes").MEDIA_TYPES.TEMPLATE||a===d("WAWebMmsMediaTypes").MEDIA_TYPES.THUMBNAIL_DOCUMENT||a===d("WAWebMmsMediaTypes").MEDIA_TYPES.THUMBNAIL_IMAGE||a===d("WAWebMmsMediaTypes").MEDIA_TYPES.THUMBNAIL_LINK||a===d("WAWebMmsMediaTypes").MEDIA_TYPES.THUMBNAIL_VIDEO;return b||a}function T(a,c){return new(h||(h=b("Promise")))(function(b){var d=new Image();d.setAttribute("crossorigin","anonymous");d.onload=function(){var a=c.map(function(a){var b=a.width,c=a.height,e=a.minWidth,f=a.minHeight,g=a.imageFormat,h=a.imageFormatOptions;a=a.keepAspectRatio;if(e!=null&&d.width<e||f!=null&&d.height<f)return null;e=document.createElement("canvas");f=e.getContext("2d");var i=0,j=0,k;if(d.height>d.width){var l=d.height/d.width;k=b;l=l*b;j=-(l-c)/2}else{var m=d.width/d.height;l=c;k=m*c;i=-(k-b)/2}a===!0?(e.width=k,e.height=l):(e.width=b,e.height=c);f.drawImage(d,i,j,k,l);return{dataUrl:e.toDataURL(g,h).replace("data:image/jpeg;base64,",""),width:e.width,height:e.height}});b(a)};d.src=a})}function U(a){if(!a)return null;if(a.fullPreviewData)return a.fullPreviewData.url();return a.preview instanceof c("WAWebMediaOpaqueData")?a.preview.url():null}g.getImageWidthHeight=a;g.getImageWidthHeightNoOpaque=p;g.opaqueDataToArrayBuffer=e;g.decodeWebpToRGBANoOpaque=f;g.parseWebpNoOpaque=s;g.videoWidthHeightDuration=u;g.getImageMetadata=x;g.processRawImage=z;g.processRawSticker=B;g.processRawAudioVideo=D;g.getRawDocumentMimetype=F;g.processRawDocument=H;g.fetchMedia=K;g.canPlayOgg=M;g.gatherAndSetMetadata=N;g.gatherAndSetMetadataNoOpaque=P;g.shouldUseMediaCache=R;g.shouldUseLruMediaStore=S;g.getResizedThumbData=T;g.getHighestQualityThumbnailUrl=U}),98); __d("WAWebLruCacheMap",["WALruCache"],(function(a,b,c,d,e,f,g){a=function(){function a(a){var b=a.sizeLimit;a=a.getSize;this._lruCache=new(d("WALruCache").LruCache)({sizeLimit:b,getSize:(b=a)!=null?b:function(){return 1}})}var b=a.prototype;b.clear=function(){this._lruCache.clear()};b["delete"]=function(a){var b=this.has(a);if(!b)return!1;this._lruCache["delete"](a);return!0};b.get=function(a){return this._lruCache.get(a)};b.has=function(a){return this._lruCache.has(a)};b.set=function(a,b){this._lruCache.put(a,b);return this};babelHelpers.createClass(a,[{key:"size",get:function(){return this._lruCache.getCurrentSize()}}]);return a}();g.LruCacheMap=a}),98); __d("WAWebInMemoryLottieStickerCache",["WAWebABProps","WAWebLruCacheMap","WAWebMediaMmsV4Download","WAWebStickerErrorWamEvent","WAWebWamEnumStickerErrorType","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){c=5e3;var h=new(d("WAWebLruCacheMap").LruCacheMap)({sizeLimit:c});function a(a,b){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=(yield d("WAWebMediaMmsV4Download").extractLottieJSON(b,a));if(b==null)return null;try{b=JSON.parse(b);if(!j(b))return null;h.set(a,b);return b}catch(a){d("WAWebABProps").getABPropConfigValue("gimmick_phase_two_logging_enabled")&&new(d("WAWebStickerErrorWamEvent").StickerErrorWamEvent)({stickerErrorType:d("WAWebWamEnumStickerErrorType").STICKER_ERROR_TYPE.RECEIVER_VALIDATION}).commit();return null}});return i.apply(this,arguments)}function j(a){var b=["v","ip","op","layers","fr","w","h"];return b.every(function(b){return Object.prototype.hasOwnProperty.call(a,b)})}g.InMemoryLottieStickerCache=h;g.extractAndSetLottieJSONInMemoryCache=a}),98); __d("WAWebMediaInMemoryBlobCache",["WALogger","WALruCache","WAWebMediaStorage","WAWebMediaTypes","err","lodash"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["InMemoryMediaBlobCache: Cannot decrease the usageCount to a negative number."]);h=function(){return a};return a}var i=25e7;a=function(){function a(a){var b=this;a===void 0&&(a=i);this.$4=new Set();this.getOrCreateURL=function(a){if(b.$3[a]){b.touch(a);return b.$3[a]}var d=b.get(a);if(!d)throw c("err")("There is no blob matching filehash: "+a+".");d=window.URL.createObjectURL(d);b.$3[a]=d;return d};this.revokeURL=function(a,d){if(!d)return;if(b.$3[a]!==d)throw c("err")("The url provided does not match the filehash.");delete b.$3[a];window.URL.revokeObjectURL(d)};this.$6=c("lodash").throttle(function(){b.$4.forEach(function(a){window.URL.revokeObjectURL(b.$3[a]),delete b.$3[a]}),b.$4.clear()},0,{leading:!1});if(a!=null&&a<0)throw c("err")("Size limit cannot be a negative number.");this.$2={};this.$3={};this.$1=new(d("WALruCache").LruCache)({sizeLimit:a,getSize:function(a){return a.size},onEvict:function(a,c){b.$3[a]&&b.$5(a)===0&&(b.revokeURL(a,b.$3[a]),d("WAWebMediaStorage").getOrCreateMediaObject(a).consolidate({downloadStage:d("WAWebMediaTypes").DownloadStage.INIT,progressiveStage:null}))},shouldEvict:function(a,c){return b.$5(a)===0}})}var b=a.prototype;b.get=function(a){return this.$1.get(a)};b.has=function(a){return this.$1.has(a)};b.touch=function(a){this.get(a)};b.put=function(a,b){this.$1.put(a,b)};b["delete"]=function(a){this.$1["delete"](a)};b.clear=function(){var a=this;this.$6.flush();this.$2={};Object.keys(this.$3).forEach(function(b){a.$3[b]&&a.revokeURL(b,a.$3[b])});this.$3={};this.$1.clear()};b.increaseUsageCount=function(a){this.$2[a]=this.$5(a)+1,this.$4["delete"](a)};b.decreaseUsageCount=function(a){var b=this.$5(a);if(b<=0){d("WALogger").ERROR(h()).tags("media-in-memory-blob-cache").sendLogs("media-blob-cache-usage-count-negative-number");return}this.$2[a]=b-1;this.$2[a]===0&&(delete this.$2[a],this.$4.add(a),this.$6())};b.$5=function(a){return this.$2[a]||0};return a}();b=new a();g.InMemoryMediaBlobCacheImpl=a;g.InMemoryMediaBlobCache=b}),98); __d("WAWebCheckMediaExistence",["WALogger","WAWebMediaMmsV4Download","WAWebMmsMediaTypes","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["checkExistence msg without mediaObject, id: "," type: ",""]);h=function(){return a};return a}function a(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield a.waitForPhoneUpload();if(!a.mediaObject){d("WALogger").ERROR(h(),a.id.toString(),a.type).devConsole(a).sendLogs("media-fault: checkExistence msg without mediaObject");return}yield d("WAWebMediaMmsV4Download").checkExistence({mimetype:a.mimetype,mediaObject:a.mediaObject,mediaType:d("WAWebMmsMediaTypes").getMsgMediaType(a)})});return i.apply(this,arguments)}g.checkMediaExistence=a}),98); __d("WAWebClearMediaForChat",["WAWebMediaStorage"],(function(a,b,c,d,e,f,g){function a(a){d("WAWebMediaStorage").clearMediaForChat(a)}g.clearMediaForChat=a}),98); __d("WAWebConsolidateMediaUpdate",["WALogger","WAWebMediaCryptoEligibilityUtils","WAWebMediaGetDownloadOriginForMsg","WAWebMediaMmsV4Download","WAWebMediaObject","WAWebMediaOpaqueData","WAWebMediaStorage","WAWebMediaTypes","WAWebMmsMediaTypes","WAWebMsgGetters","WAWebMsgType"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["media:msg "," "," filehash"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["id: "," type: ",""]);i=function(){return a};return a}function j(a){var b={};d("WAWebMediaTypes").MAPPED_MSG_PROPS.forEach(function(c){var e=a[c];c=d("WAWebMediaTypes").MSG_TO_MEDIA[c];b[c]=e});b.type===d("WAWebMsgType").MSG_TYPE.INTERACTIVE&&(b.type=d("WAWebMediaObject").getInteractiveMsgMediaType(a));return b}function a(a,b){if(a.isUnsentPhoneMsg()){a.mediaObject&&d("WALogger").ERROR(i(),a.id.toString(),a.type).devConsole(a).sendLogs("media-fault: consolidateMediaUpdate unsent message");var e=j(a);if(Object.prototype.hasOwnProperty.call(e,"preview")){var f=e.preview;delete e.preview;f&&c("WAWebMediaOpaqueData").createFromBase64Jpeg(f).then(function(b){(a==null?void 0:a.mediaData)&&a.isUnsentPhoneMsg()&&(a.mediaData.preview=b)})}a.mediaData.set(babelHelpers["extends"]({},e,{mediaStage:d("WAWebMediaTypes").MediaDataStage.REMOTE_NEED_UPLOAD}))}else k(a,a,b)}function k(a,b,e,f){var g=j(b),i=a.mediaObject,k=b.filehash,l=d("WAWebMediaCryptoEligibilityUtils").isMediaCryptoExpectedForMsg(a);if(!i){k?i=d("WAWebMediaStorage").getOrCreateMediaObject(k):i=new(d("WAWebMediaObject").MediaObject)();var m=a.mediaData;m.aspectRatio!==void 0&&(g.aspectRatio=m.aspectRatio);a.mediaObject=i;d("WAWebMediaStorage").associateMediaWithMsg(i,a)}else k&&k!==i.filehash&&(d("WALogger").LOG(h(),a.id.toString(),i.filehash?"changed":"added"),d("WAWebMediaStorage").disassociateMediaFromMsg(i,a),i=d("WAWebMediaStorage").getOrCreateMediaObject(k),a.mediaObject=i,d("WAWebMediaStorage").associateMediaWithMsg(i,a));m=!1;var n=b.deprecatedMms3Url,o=b.mediaKey,p=b.mediaKeyTimestamp,q=b.encFilehash,r=b.type,s=b.streamingSidecar,t=b.firstFrameSidecar,u=b.directPath,v=b.scansSidecar,w=b.scanLengths,x=b.staticUrl;if(n||q||!l){var y;try{y=d("WAWebMmsMediaTypes").msgToMediaType({type:b.type,isGif:b.isGif,interactiveHeader:b.interactiveHeader,isNewsletter:d("WAWebMsgGetters").getIsNewsletterMsg(b)})}catch(a){y=~d("WAWebMmsMediaTypes").MEDIA_TYPE_VALUES.indexOf(r)?r:null}m=l?!i.entries.has({encFilehash:q,deprecatedMms3Url:n}):!i.entries.hasUnencryptedEntry({filehash:k,directPath:u});var z;!m?l&&o!=null&&o!==""?z=i.entries.updateEntry({deprecatedMms3Url:n,mediaKey:o,mediaKeyTimestamp:p,encFilehash:q,type:y,sidecar:s,directPath:u,firstFrameSidecar:t,scansSidecar:v,scanLengths:w,staticUrl:x}):!l&&k!=null&&(z=i.entries.updateUnencryptedEntry({filehash:k,directPath:u})):y!=null&&(q!=null||!l)?l&&o!=null?z=i.entries.addEntry({deprecatedMms3Url:n,mediaKey:o,mediaKeyTimestamp:p,encFilehash:q,type:y,sidecar:s,directPath:u,firstFrameSidecar:t,scansSidecar:v,scanLengths:w,debugHint:"consolidate",staticUrl:x}):!l&&u!=null&&k!=null&&(z=i.entries.addUnencryptedEntry({debugHint:"consolidate",directPath:u,filehash:k,type:y})):m=!1;z||(m=!1);m&&i.downloadStage===d("WAWebMediaTypes").DownloadStage.ERROR_MISSING&&(g.downloadStage=d("WAWebMediaTypes").DownloadStage.INIT)}i.consolidate(g)||i.notifyMsgsAsync();if(m&&i.downloadStage===d("WAWebMediaTypes").DownloadStage.NEED_POKE){var A;try{A=d("WAWebMmsMediaTypes").getMsgMediaType(a)}catch(c){if(!b.type)throw c;A=d("WAWebMmsMediaTypes").msgToMediaType({type:b.type,isGif:a.isGif,isNewsletter:d("WAWebMsgGetters").getIsNewsletterMsg(a)})}d("WAWebMediaMmsV4Download").downloadMedia({mimetype:b.mimetype,mediaObject:i,downloadEvenIfExpensive:!1,mediaType:A,rmrReason:e,downloadOrigin:c("WAWebMediaGetDownloadOriginForMsg")(a),chatWid:f})}}g.consolidateMediaUpdate=a;g.consolidateMediaUpdateWithValues=k}),98); __d("WAWebDownloadProgressiveJpegThumbnail",["WAAbortError","WALogger","WANullthrows","WAWebDownloadManager","WAWebMediaOpaqueData","WAWebMmsMediaTypes","WAWebSerializeError","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["media.downloadProgressiveJpegThumbnail: error\n",""],["media.downloadProgressiveJpegThumbnail: error\\n",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["media.downloadProgressiveJpegThumbnail aborted"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["media.downloadProgressiveJpegThumbnail: success"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["media.downloadProgressiveJpegThumbnail: start"]);k=function(){return a};return a}function a(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.msg,e=a.chat,f=a.isPreload;a=a.signal;d("WALogger").LOG(k());try{var g,l=(g=c("WANullthrows"))(b.scanLengths),m=g(b.scansSidecar),n=g(b.mediaObject);g=g(n.filehash);var o=b.encFilehash,p=b.directPath;p=(yield d("WAWebDownloadManager").downloadManager.downloadAndMaybeDecrypt({directPath:p,encFilehash:o,filehash:g,mediaKey:b.mediaKey,mediaKeyTimestamp:b.mediaKeyTimestamp,type:d("WAWebMmsMediaTypes").MEDIA_TYPES.IMAGE,signal:a||new AbortController().signal,userDownloadAttemptCount:0,progressiveJpegOpts:{mimetype:"image/jpeg",scansSidecar:m,scanLengths:l,scanCount:1},isPreload:f,chatWid:e==null?void 0:e.id}));n.consolidate({fullPreviewData:yield c("WAWebMediaOpaqueData").createFromData(p,"image/jpeg")});d("WALogger").LOG(j())}catch(a){if(a.name===d("WAAbortError").ABORT_ERROR){d("WALogger").LOG(i());return}d("WALogger").WARN(h(),c("WAWebSerializeError")(a)).sendLogs("download-pjpeg-thumbnail-failed")}});return l.apply(this,arguments)}g.downloadProgressiveJpegThumbnail=a}),98); __d("WAWebDownloadStatusThumbnail",["WAWebDownloadProgressiveJpegThumbnail","WAWebMediaDownloadMmsThumbnail","WAWebMsgType","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.msg,e=a.isPreload;a=a.signal;var f=b.encFilehash,g=b.thumbnailSha256,h=b.thumbnailEncSha256,i=b.thumbnailDirectPath;if(b.type===d("WAWebMsgType").MSG_TYPE.IMAGE&&b.scanLengths&&b.scansSidecar&&f){yield d("WAWebDownloadProgressiveJpegThumbnail").downloadProgressiveJpegThumbnail({msg:b,signal:a,isPreload:e});return}if(g&&h&&i){yield c("WAWebMediaDownloadMmsThumbnail")({msg:b,signal:a,isPreload:e,chat:null});return}});return h.apply(this,arguments)}g.downloadStatusThumbnail=a}),98); __d("WAWebDownloadVideoThumbnail",["WALogger","WANullthrows","WAWebConstantsDeprecated","WAWebDownloadManager","WAWebImageUtils","WAWebMediaCryptoEligibilityUtils","WAWebMediaOpaqueData","WAWebMmsMediaTypes","WAWebMsgGetters","WAWebMsgModelPropUtils","WAWebSerializeError","WAWebURLUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["media.downloadVideoThumbnail: error\n",""],["media.downloadVideoThumbnail: error\\n",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["media.downloadVideoThumbnail: black thumbnail was generated, fallback to blurred thumbnail"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["media.downloadVideoThumbnail: success"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["media.downloadVideoThumbnail: start"]);k=function(){return a};return a}function a(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.msg;a=a.chat;if(!d("WAWebMsgModelPropUtils").isTrusted(b.unsafe()))return;if(a.isSuspendedOrTerminated())return;var e=b.encFilehash,f=b.filehash,g=b.directPath;if(!f||!g)return;if(d("WAWebMediaCryptoEligibilityUtils").isMediaCryptoExpectedForMsg(b)&&!e)return;var l=b.mediaData,m=l.fullPreviewData,n=l.fullWidth;l=l.fullHeight;if(m&&n!=null&&l!=null)return;d("WALogger").LOG(k());try{m=Math.max(parseInt(b.mediaData.duration,10),1);n={video:{size:b.mediaData.size,duration:m},secondsToDownload:1};l=(yield d("WAWebDownloadManager").downloadManager.downloadAndMaybeDecrypt({directPath:g,encFilehash:e,filehash:f,mediaKey:b.mediaKey,mediaKeyTimestamp:b.mediaKeyTimestamp,type:d("WAWebMsgGetters").getIsNewsletterMsg(b)?d("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_VIDEO:d("WAWebMmsMediaTypes").MEDIA_TYPES.VIDEO,signal:new AbortController().signal,userDownloadAttemptCount:0,partialVideoOpts:n,isPreload:!0,chatWid:a.id}));m=new Blob([l],{type:"video/mp4"});g=(yield d("WAWebImageUtils").generateVideoThumbsAndDuration({file:m,maxDimensions:[c("WAWebConstantsDeprecated").VIDEO_THUMB_MAX_EDGE],debugHint:"downloadVideoThumbnail",throwOnBlack:!0}));e=g.thumbs;f=e[0];n=(yield c("WAWebMediaOpaqueData").createFromBase64Jpeg(c("WAWebURLUtils").parseDataURL(f.url).data));a=c("WANullthrows")(b.mediaObject,"mediaObject cannot be null for thumbnail download");l={fullPreviewData:n,fullWidth:f.fullWidth,fullHeight:f.fullHeight};a.consolidate(l);d("WALogger").LOG(j())}catch(a){if(a instanceof d("WAWebImageUtils").BlackVideoThumbnailError){d("WALogger").LOG(i());return}d("WALogger").WARN(h(),c("WAWebSerializeError")(a)).verbose()}});return l.apply(this,arguments)}g.downloadVideoThumbnail=a}),98); __d("WAWebManuallySetMedia",["WAWebMediaGetDownloadOriginForMsg","WAWebMediaMmsV4Download","WAWebMediaOpaqueData","WAWebMmsMediaTypes"],(function(a,b,c,d,e,f,g){function a(a){var b=a.msg,e=a.media,f=a.rmrReason,g=a.chatWid,h=b.mediaObject;if(!h)return;c("WAWebMediaOpaqueData").createFromData(e,b.mimetype).then(function(a){d("WAWebMediaMmsV4Download").manuallySetMedia({mimetype:b.mimetype,mediaObject:h,mediaBlob:a,mediaType:d("WAWebMmsMediaTypes").getMsgMediaType(b),rmrReason:f,downloadOrigin:c("WAWebMediaGetDownloadOriginForMsg")(b),chatWid:g})})}g.manuallySetMedia=a}),98); __d("WAWebMediaCancelDownloadMsg",["WALogger","WAWebMediaMmsV4Download"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["id: "," type: ",""]);h=function(){return a};return a}function i(a){d("WAWebMediaMmsV4Download").cancelDownloadMedia(a)}function a(a){a.mediaObject?i(a.mediaObject):a.mediaObject||d("WALogger").ERROR(h(),a.id.toString(),a.type).devConsole(a).sendLogs("media-fault: cancelDownloadMsg msg without mediaObject")}g.cancelDownloadMedia=i;g.cancelDownloadMsg=a}),98); __d("WAWebMediaCancelUploadMsg",["WALogger","WAWebMediaMmsV4Upload"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["id: "," type: ",""]);h=function(){return a};return a}function i(a){d("WAWebMediaMmsV4Upload").cancelUploadMedia(a)}function a(a){a.mediaObject?i(a.mediaObject):d("WALogger").ERROR(h(),a.id.toString(),a.type).devConsole(a).sendLogs("media-fault: cancelUploadMsg msg without mediaObject")}g.cancelUploadMedia=i;g.cancelUploadMsg=a}),98); __d("WAWebMediaDownloadMsg",["Promise","WALogger","WAWebMediaGetDownloadOriginForMsg","WAWebMediaMmsV4Download","WAWebMmsMediaTypes","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["id: "," type: ",""]);i=function(){return a};return a}function a(a){var e=a.msg,f=a.isUserClick,g=a.mode,j=a.downloadEvenIfExpensive,k=a.rmrReason,l=a.rmrData,m=a.isAutoDownload,n=a.chatWid,o=e.mediaObject;if(o){a=o.getPendingProcess("fromDisk");return a.then(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){f&&o.userDownloadAttemptCount++,yield d("WAWebMediaMmsV4Download").downloadMedia({mimetype:e.mimetype,mediaObject:o,downloadEvenIfExpensive:j,mediaType:d("WAWebMmsMediaTypes").getMsgMediaType(e),rmrReason:k,rmrData:l,downloadOrigin:c("WAWebMediaGetDownloadOriginForMsg")(e),isVcardOverMmsDocument:e.isVcardOverMmsDocument,mode:g,isAutoDownload:m,isViewOnce:Boolean(e.isViewOnce),chatWid:n}),o.userDownloadAttemptCount=0}))}d("WALogger").ERROR(i(),e.id.toString(),e.type).devConsole(e).sendLogs("media-fault: downloadMsg msg without mediaObject");return(h||(h=b("Promise"))).resolve()}g.downloadMsg=a}),98); __d("WAWebMediaFastForwardUtils",[],(function(a,b,c,d,e,f){"use strict";function a(a){var b=a.id;return!b.isPSA()&&!b.isCAPISupportAccount()&&!b.isBot()&&!b.isHosted()&&!b.isNewsletter()&&!a.isEnterprise}f.canEnableFastForward=a}),66); __d("WAWebWamEnumStickerSendMessageType",[],(function(a,b,c,d,e,f){a=Object.freeze({REGULAR:1,PAYMENTS:2});f.STICKER_SEND_MESSAGE_TYPE=a}),66); __d("WAWebWamEnumStickerSendOriginType",[],(function(a,b,c,d,e,f){a=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,AI_STICKER_CREATE:10,AI_STICKER_CREATE_TRAY:11,AI_STICKER_CREATE_CHAT:12,STATUS_QUICK_REPLY:13,DISCOVERY_PACK:14,STICKER_FROM_DEVICE_KEYBOARD:15,STICKER_PACK_INFO:16});f.STICKER_SEND_ORIGIN_TYPE=a}),66); __d("WAWebStickerSendWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumStickerMakerSourceType","WAWebWamEnumStickerSendMessageType","WAWebWamEnumStickerSendOriginType"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({StickerSend:[1840,{stickerIsAi:[7,a.TYPES.BOOLEAN],stickerIsAnimated:[3,a.TYPES.BOOLEAN],stickerIsAvatar:[6,a.TYPES.BOOLEAN],stickerIsFirstParty:[2,a.TYPES.BOOLEAN],stickerIsFromStickerMaker:[5,a.TYPES.BOOLEAN],stickerIsFromUserCreatedPack:[12,a.TYPES.BOOLEAN],stickerIsGiphy:[10,a.TYPES.BOOLEAN],stickerIsLottie:[9,a.TYPES.BOOLEAN],stickerIsTenor:[11,a.TYPES.BOOLEAN],stickerMakerSourceType:[8,d("WAWebWamEnumStickerMakerSourceType").STICKER_MAKER_SOURCE_TYPE],stickerSendMessageType:[4,d("WAWebWamEnumStickerSendMessageType").STICKER_SEND_MESSAGE_TYPE],stickerSendOrigin:[1,d("WAWebWamEnumStickerSendOriginType").STICKER_SEND_ORIGIN_TYPE]},[1,1,1],"regular"]},{StickerSend:[]});g.StickerSendWamEvent=b}),98); __d("WAWebMediaForwardMediaMsg",["Promise","WALogger","WAWebABProps","WAWebFrontendMsgGetters","WAWebGetNewsletterContextForForwardedMsg","WAWebMediaFastForwardUtils","WAWebMediaOpaqueData","WAWebMediaPrep","WAWebMediaTypes","WAWebMsgGetters","WAWebStickerSendWamEvent","WAWebWamEnumStickerSendOriginType","WAWebWebpMetadata","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["id: "," type: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Prepping media msg"]);j=function(){return a};return a}function a(a,b,c,d){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e,f,g){f===void 0&&(f=!1);g===void 0&&(g=!1);d("WALogger").LOG(j()).devConsole(a);var k=a.mediaObject;if(!k){d("WALogger").ERROR(i(),a.id.toString(),a.type).devConsole(a).sendLogs("media-fault: forwardMediaMsg msg without mediaObject");return(h||(h=b("Promise"))).reject(c("err")("non initialized media"))}var l=a.mediaData.toJSON();l.preview!=null&&(l.preview=k.contentInfo._preview);l.mediaBlob instanceof c("WAWebMediaOpaqueData")&&l.mediaBlob.retain();k={mimetype:l.mimetype};k=l.isGif?babelHelpers["extends"]({},k,{isGif:!0}):k;l.type===d("WAWebMediaTypes").OUTWARD_TYPES.PTT&&(l.type=d("WAWebMediaTypes").OUTWARD_TYPES.AUDIO);var m={businessOwnerJid:a.businessOwnerJid,productId:a.productId,currencyCode:a.currencyCode,priceAmount1000:a.priceAmount1000,salePriceAmount1000:a.salePriceAmount1000,retailerId:a.retailerId,url:a.url,productImageCount:a.productImageCount,title:a.title,description:a.description},n=l.type===d("WAWebMediaTypes").OUTWARD_TYPES.DOCUMENT&&(a.isFromTemplate||a.isDynamicReplyButtonsMsg);n=n||l.type===d("WAWebMediaTypes").OUTWARD_TYPES.PRODUCT?a.caption:void 0;g&&(l.type===d("WAWebMediaTypes").OUTWARD_TYPES.IMAGE||l.type===d("WAWebMediaTypes").OUTWARD_TYPES.VIDEO||l.type===d("WAWebMediaTypes").OUTWARD_TYPES.DOCUMENT||l.type===d("WAWebMediaTypes").OUTWARD_TYPES.STICKER_PACK)&&(n=a.caption);g=d("WAWebMediaFastForwardUtils").canEnableFastForward(e.contact);var o=d("WAWebMediaFastForwardUtils").canEnableFastForward(d("WAWebFrontendMsgGetters").getChat(a).contact);f={forwardedFromWeb:!0,canEnableFastForward:g&&o,caption:n,type:a.type,mentionedJidList:a.mentionedJidList,groupMentions:a.groupMentions,footer:l.type===d("WAWebMediaTypes").OUTWARD_TYPES.PRODUCT?a.footer:void 0,addEvenWhilePreparing:!0,placeholderProps:k,isForwarded:d("WAWebMsgGetters").getShouldDisplayAsForwarded(a),forwardingScore:a.getForwardingScoreWhenForwarded(),multicast:f,productMsgOptions:m,isAvatar:(g=a.isAvatar)!=null?g:!1,forwardedNewsletterMessageInfo:d("WAWebGetNewsletterContextForForwardedMsg").getNewsletterContextForForwardedMsg(a),stickers:(o=a.stickers)!=null?o:void 0,publisher:(n=a.stickerPackPublisher)!=null?n:void 0,fileLength:(k=a.size)!=null?k:void 0,description:l.type===d("WAWebMediaTypes").OUTWARD_TYPES.STICKER_PACK&&a.description!=null?a.description:"",stickerPackId:(f=a.stickerPackId)!=null?f:void 0,thumbnailDirectPath:(m=a.thumbnailDirectPath)!=null?m:void 0,thumbnailSha256:(g=a.thumbnailSha256)!=null?g:void 0,thumbnailEncSha256:(o=a.thumbnailEncSha256)!=null?o:void 0,trayIconFileName:(n=a.trayIconFileName)!=null?n:void 0,stickerPackSize:(k=a.stickerPackSize)!=null?k:void 0};m=(yield new(d("WAWebMediaPrep").MediaPrep)(l.type,(h||(h=b("Promise"))).resolve(l)).sendToChat(e,d("WAWebGetNewsletterContextForForwardedMsg").maybeStripNewsletterForwardMetadata({forwardable:f,destination:e.id,source:a.id.remote,isOriginalMsgForwarded:a.isForwarded})));if(l.type===d("WAWebMediaTypes").OUTWARD_TYPES.STICKER){k={stickerSendOrigin:d("WAWebWamEnumStickerSendOriginType").STICKER_SEND_ORIGIN_TYPE.FORWARD,stickerIsAnimated:Boolean((g=a.mediaData)==null?void 0:g.isAnimated),stickerIsFirstParty:Boolean((o=a.mediaData)==null?void 0:o.isFirstParty),stickerIsFromStickerMaker:Boolean((n=a.mediaData)==null?void 0:n.isFromStickerMaker)};if(d("WAWebABProps").getABPropConfigValue("gimmick_phase_two_logging_enabled")){k=babelHelpers["extends"]({},k,{stickerIsLottie:Boolean((f=a.mediaData)==null?void 0:f.isLottie)})}e=new(d("WAWebStickerSendWamEvent").StickerSendWamEvent)(k);g=d("WAWebWebpMetadata").getStickerMakerSourceType((l=a.mediaData)==null?void 0:l.stickerMakerSourceType);g!=null&&(e.stickerMakerSourceType=g);e.commit()}return m});return k.apply(this,arguments)}g.forwardMediaMsg=a}),98); __d("WAWebMediaGetDownloadOriginForMsg",["WAWebFrontendChatGetters","WAWebFrontendMsgGetters","WAWebMsgGetters","WAWebWamEnumDownloadOriginType"],(function(a,b,c,d,e,f,g){function a(a){if(d("WAWebFrontendMsgGetters").getAsProduct(a))return d("WAWebWamEnumDownloadOriginType").DOWNLOAD_ORIGIN_TYPE.PRODUCT_CATALOG;if(d("WAWebMsgGetters").getIsStatus(a))return d("WAWebWamEnumDownloadOriginType").DOWNLOAD_ORIGIN_TYPE.STATUS_USER;if(d("WAWebMsgGetters").getIsGroupMsg(a)){var b=d("WAWebFrontendMsgGetters").getChat(a);return b!=null&&d("WAWebFrontendChatGetters").getIsCAG(b)?d("WAWebWamEnumDownloadOriginType").DOWNLOAD_ORIGIN_TYPE.COMMUNITY:d("WAWebWamEnumDownloadOriginType").DOWNLOAD_ORIGIN_TYPE.CHAT_GROUP}return d("WAWebMsgGetters").getIsNewsletterMsg(a)?d("WAWebWamEnumDownloadOriginType").DOWNLOAD_ORIGIN_TYPE.CHANNEL:d("WAWebWamEnumDownloadOriginType").DOWNLOAD_ORIGIN_TYPE.CHAT_PERSONAL}g["default"]=a}),98); __d("WAWebMediaMsgRegistration",["Promise","WALogger","WAWebConsolidateMediaUpdate","WAWebMediaDataUtils","WAWebMediaOpaqueData","WAWebMediaStorage","WAWebMediaTypes","WAWebWamEnumWebcRmrReasonCode"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["id: "," type: ",""]);i=function(){return a};return a}var j="change:ack "+d("WAWebMediaTypes").MEDIA_MSG_PROPS.map(function(a){return"change:"+a}).join(" ");function k(a){d("WAWebConsolidateMediaUpdate").consolidateMediaUpdate(a,d("WAWebWamEnumWebcRmrReasonCode").WEBC_RMR_REASON_CODE.MSG_UPDATE)}function a(a){a.off(null,k);var b=a.mediaObject;b&&d("WAWebMediaStorage").disassociateMediaFromMsg(b,a)}function e(a){!a.mimetype&&a.type===d("WAWebMediaTypes").OUTWARD_TYPES.IMAGE&&(a.mimetype="image/jpeg"),!a.mimetype&&a.type===d("WAWebMediaTypes").OUTWARD_TYPES.STICKER&&(a.mimetype="image/webp"),a.on(j,k),d("WAWebConsolidateMediaUpdate").consolidateMediaUpdate(a,d("WAWebWamEnumWebcRmrReasonCode").WEBC_RMR_REASON_CODE.MSG_INIT)}function f(a,b){a.isUnsentPhoneMsg()&&d("WALogger").ERROR(i(),a.id.toString(),a.type).devConsole(a).sendLogs("media-fault: registerMsgEarly msg without mediaObject");var c={};for(var e=0;e<d("WAWebMediaTypes").MEDIA_MSG_PROPS.length;e++){var f=d("WAWebMediaTypes").MEDIA_MSG_PROPS[e],g=b[f];c[f]=g!==void 0?g:a[f]}!c.mimetype&&c.type===d("WAWebMediaTypes").OUTWARD_TYPES.IMAGE&&(b.mimetype=c.mimetype="image/jpeg");a.on(j,k);d("WAWebConsolidateMediaUpdate").consolidateMediaUpdateWithValues(a,c,d("WAWebWamEnumWebcRmrReasonCode").WEBC_RMR_REASON_CODE.MSG_UPDATE);g={};for(f=0;f<d("WAWebMediaTypes").MSG_SPECIFIC_FIELDS.length;f++){e=d("WAWebMediaTypes").MSG_SPECIFIC_FIELDS[f];g[e]=c[d("WAWebMediaTypes").MEDIA_TO_MSG[e]]}a.mediaData.set(g)}function l(a){var e=a.mediaObject;if(e)return e.resolveWhenConsolidated();e=a.mediaData;var f=e.preview;return f instanceof c("WAWebMediaOpaqueData")&&e.aspectRatio===void 0&&(e.fullWidth===void 0||e.fullHeight===void 0)?d("WAWebMediaDataUtils").getImageWidthHeight(f).then(function(b){var c=b.width;b=b.height;if(a.mediaObject)return;a.mediaData.set({aspectRatio:c/b})}):(h||(h=b("Promise"))).resolve()}g.deregisterMsg=a;g.registerMsg=e;g.registerMsgEarly=f;g.prepareMsg=l}),98); __d("WAWebMediaResumeUploadMsg",["Promise","WALogger","WAWebAck","WAWebFrontendMsgGetters","WAWebMediaEntry","WAWebMediaGetUploadOriginForChat","WAWebMediaInMemoryKeyCache","WAWebMediaMmsV4Upload","WAWebMediaUpdateMsg","WAWebMmsMediaTypes","WAWebMsgGetters","WAWebNewsletterSendMsgAction","WAWebSendMsgChatAction","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["id: "," type: ",""]);i=function(){return a};return a}function a(a){var e,f=a.mediaObject;if(!f){d("WALogger").ERROR(i(),a.id.toString(),a.type).devConsole(a).sendLogs("media-fault: resumeUploadMsg msg without mediaObject");return(h||(h=b("Promise"))).resolve()}f.userUploadAttemptCount++;var g=f.filehash;e=d("WAWebMediaInMemoryKeyCache").shouldUseMediaKeyCache()&&g!=null?(e=d("WAWebMediaInMemoryKeyCache").MediaKeyCache.get(g))!=null?e:void 0:void 0;a.ack=d("WAWebAck").ACK.CLOCK;var j=d("WAWebMsgGetters").getIsNewsletterMsg(a)?d("WAWebMediaMmsV4Upload").uploadUnencryptedMedia:d("WAWebMediaMmsV4Upload").uploadMedia,k=j({mimetype:a.mimetype,mediaObject:f,mediaKeyInfo:e,mediaType:d("WAWebMmsMediaTypes").getMsgMediaType(a),forwardedFromWeb:Boolean(a.forwardedFromWeb),uploadOrigin:c("WAWebMediaGetUploadOriginForChat")(d("WAWebFrontendMsgGetters").getChat(a)),isViewOnce:Boolean(a.isViewOnce)}).then(function(){var e=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){b=b.mediaEntry;d("WAWebMediaInMemoryKeyCache").shouldUseMediaKeyCache()&&g!=null&&d("WAWebMediaInMemoryKeyCache").MediaKeyCache["delete"](g);if(!b)throw c("err")("upload failed: media entry was not created");f.userUploadAttemptCount=0;var e={deprecatedMms3Url:b.deprecatedMms3Url,directPath:b.directPath,filehash:f.filehash,size:f.size,streamingSidecar:b.sidecar,firstFrameSidecar:b.firstFrameSidecar};b instanceof d("WAWebMediaEntry").EncryptedMediaEntry?(e.mediaKey=b.mediaKey,e.mediaKeyTimestamp=b.mediaKeyTimestamp,e.encFilehash=b.encFilehash):b instanceof d("WAWebMediaEntry").UnencryptedMediaEntry&&(e.mediaHandle=b.handle);yield c("WAWebMediaUpdateMsg")(a,e);return a});return function(a){return e.apply(this,arguments)}}());j=d("WAWebMsgGetters").getIsNewsletterMsg(a)?d("WAWebNewsletterSendMsgAction").sendNewsletterMediaMsg(d("WAWebFrontendMsgGetters").getChat(a),a,function(){return k}):d("WAWebSendMsgChatAction").resendMsgToChat(d("WAWebFrontendMsgGetters").getChat(a),k);return j["catch"](function(){a.ack=d("WAWebAck").ACK.FAILED})}g.resumeUploadMsg=a}),98); __d("WAWebMediaStickers",["Promise","WAFilteredCatch","WALogger","WAWebDownloadManager","WAWebMediaEntry","WAWebMediaMmsV4Download","WAWebMediaPrep","WAWebMediaStorage","WAWebMediaTypes","WAWebMiscErrors","WAWebMmsMediaTypes","WAWebRecentStickerCollectionMd","WAWebWamEnumDownloadOriginType","WAWebWamEnumWebcRmrReasonCode","asyncToGeneratorRuntime","err","gkx"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Unexpected RMR error for media type ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["id: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["Prepping sticker"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["encFileHash missing from sticker "," but deprecatedMms3Url exists"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["Unexpected sticker pack with no filehash"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["Unexpected sticker with no filehash"]);n=function(){return a};return a}var o=125;function p(a){var b={};d("WAWebMediaTypes").MAPPED_STICKER_PROPS.forEach(function(c){var e=a[c];c=d("WAWebMediaTypes").MSG_TO_MEDIA[c];b[c]=e});return b}function q(a){if(!a.filehash){d("WALogger").ERROR(n()).devConsole(a).sendLogs("sticker-filehash-error");return}var b=d("WAWebMediaStorage").getOrCreateMediaObject(a.filehash);d("WAWebMediaStorage").associateMediaWithSticker(b,a);return b}function r(a){if(!a.filehash){d("WALogger").ERROR(m()).devConsole(a).sendLogs("sticker-pack-filehash-error");return}var b=d("WAWebMediaStorage").getOrCreateMediaObject(a.filehash);d("WAWebMediaStorage").associateMediaWithStickerPack(b,a);return b}function s(a,b,e,f){var g=p(a);a.mediaData.set(g);if(!b)return;a.mediaObject=b;var h=a.deprecatedMms3Url,i=a.encFilehash;!c("gkx")("26258")&&!i&&h&&d("WALogger").ERROR(l(),f?"pack tray icon":"").devConsole(a).sendLogs("sticker-"+(f?"icon-":"")+"missing-upload-hash-but-url-exists");if((i||h)&&!b.entries.has({encFilehash:i,deprecatedMms3Url:h})){f=b.entries.addEntry({deprecatedMms3Url:h,mediaKey:a.mediaKey,mediaKeyTimestamp:a.mediaKeyTimestamp,encFilehash:i,type:e,directPath:a.directPath,debugHint:"setMediaObjectValues"});f&&b.downloadStage===d("WAWebMediaTypes").DownloadStage.ERROR_MISSING&&(g.downloadStage=d("WAWebMediaTypes").DownloadStage.INIT)}b.consolidate(g)}function a(a){s(a,a.mediaObject||q(a),d("WAWebMmsMediaTypes").MEDIA_TYPES.STICKER,!1)}function e(a){var b=a.mediaObject;b&&d("WAWebMediaStorage").disassociateMediaFromSticker(b,a)}function f(a){s(a,a.mediaObject||r(a),d("WAWebMmsMediaTypes").MEDIA_TYPES.IMAGE,!0)}function t(a){var b=a.mediaObject;b&&d("WAWebMediaStorage").disassociateMediaFromStickerPack(b,a)}function u(a,b,c){return v.apply(this,arguments)}function v(){v=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e,f){f===void 0&&(f=!0);if(a.isPlaceholder||a.isCreateButton){a.mediaData.mediaStage=d("WAWebMediaTypes").MediaDataStage.PREPARING;return(h||(h=b("Promise"))).resolve()}var g=a.mediaObject;if(!g)return(h||(h=b("Promise"))).reject(c("err")("media-fault: downloadStickerOrStickerPackIcon sticker/stickerPack without mediaObject"));var j=e==="STICKER"?d("WAWebWamEnumWebcRmrReasonCode").WEBC_RMR_REASON_CODE.STICKER_PANEL_STICKER:d("WAWebWamEnumWebcRmrReasonCode").WEBC_RMR_REASON_CODE.STICKER_PANEL_ICON;e=!1;yield g.getPendingProcess("fromDisk").then(function(){if(!a.filehash||!a.mediaKey||!a.encFilehash){e=!0;return d("WAWebDownloadManager").downloadManager.rmr({mediaObject:g,signal:new AbortController().signal,rmrReason:j})}}).then(function(){return d("WAWebMediaMmsV4Download").downloadMedia({mimetype:a.mimetype,mediaObject:a.mediaObject,downloadEvenIfExpensive:!0,mediaType:d("WAWebMmsMediaTypes").msgToMediaType({type:a.type,isGif:!1,isNewsletter:!1}),rmrReason:j,downloadOrigin:d("WAWebWamEnumDownloadOriginType").DOWNLOAD_ORIGIN_TYPE.STICKER_PICKER,shouldThrow:f})})["catch"](d("WAFilteredCatch").filteredCatch(d("WAWebMiscErrors").RMRNotSupportedOnNewsletterMessagesError,function(b){if(b.mediaType!==d("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_STICKER){d("WALogger").ERROR(i(),b.mediaType).devConsole(a,b).sendLogs("failed-to-download-sticker-rmr");throw b}}));var k=g.entries.getDownloadEntry(!0);e&&k instanceof d("WAWebMediaEntry").EncryptedMediaEntry&&d("WAWebRecentStickerCollectionMd").RecentStickerCollectionMd.updateStickerMediaData(a.filehash,k)});return v.apply(this,arguments)}function w(a){d("WALogger").LOG(k()).devConsole(a);var e=a.mediaObject,f=a.mediaData.toJSON();f.fullWidth=o;f.fullHeight=o;if(!e){d("WALogger").ERROR(j(),a.id).sendLogs("media-fault: prepSticker sticker without mediaObject");return new(d("WAWebMediaPrep").MediaPrep)(f.type,(h||(h=b("Promise"))).reject(c("err")("non initialized media")))}return new(d("WAWebMediaPrep").MediaPrep)(f.type,(h||(h=b("Promise"))).resolve(f))}g.registerSticker=a;g.deregisterSticker=e;g.registerStickerPackIcon=f;g.deregisterStickerPackIcon=t;g.downloadStickerOrStickerPackIcon=u;g.prepSticker=w}),98); __d("WAWebPrepRawMedia",["Promise","WALogger","WAWebMediaPrep","WAWebMediaTypes","WAWebProcessRawMedia"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Prepping raw media"]);i=function(){return a};return a}function a(a,c){d("WALogger").LOG(i());var e;c.isPtt===!0?e=d("WAWebMediaTypes").OUTWARD_TYPES.PTT:c.asDocument===!0?e=d("WAWebMediaTypes").OUTWARD_TYPES.DOCUMENT:c.asGif===!0?e=d("WAWebMediaTypes").OUTWARD_TYPES.VIDEO:c.isAudio===!0?e=d("WAWebMediaTypes").OUTWARD_TYPES.AUDIO:c.asSticker===!0?e=d("WAWebMediaTypes").OUTWARD_TYPES.STICKER:c.asStickerPack===!0?e=d("WAWebMediaTypes").OUTWARD_TYPES.STICKER_PACK:e=d("WAWebMediaTypes").OUTWARD_TYPES.UNKNOWN;var f=(h||(h=b("Promise"))).resolve(a).then(function(a){a.autoreleaseWhenPromiseCompletes(f);return d("WAWebProcessRawMedia").processRawMedia(a,c)});return new(d("WAWebMediaPrep").MediaPrep)(e,f)}g.prepRawMedia=a}),98); __d("WAWebCryptoCalculateFilehash",["WALogger","WAMediaCalculateFilehash","WAWebFileUtils","WAWebMediaDataUtils","WAWebMediaOpaqueData"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["calculateFilehashFromBlob error. Debug:\n",""],["calculateFilehashFromBlob error. Debug:\\n",""]);h=function(){return a};return a}function a(a){var b=a instanceof c("WAWebMediaOpaqueData")?d("WAWebMediaDataUtils").opaqueDataToArrayBuffer(a):d("WAWebFileUtils").blobToArrayBuffer(a);return b.then(function(a){return d("WAMediaCalculateFilehash").calculateFilehash(a)})["catch"](function(b){b={error:""+b,blobSize:a.size,isOpaqueData:a instanceof c("WAWebMediaOpaqueData")};d("WALogger").WARN(h(),JSON.stringify(b,null,2)).sendLogs("calculate-filehash-from-blob-error");return void 0})}g.calculateFilehashFromBlob=a}),98); __d("WAWebCryptoImageStreamer",["Promise","WAAlignChunkLengthsToMultipleOfAesBlockSize","WAArrayBufferUtils","WAArrayBuffersConcat","WACrypto","WACryptoAesCbc","WACryptoHmac","WACryptoUtils","WACustomError","WALogger","WANullthrows","WATypedArraysConcat","WAWebMediaInMemoryBlobCache","WAWebPromiseQueue","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["ImageStreamer:handleProgress error"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["ImageStreamer:handleProgress error: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["ImageStreamer:chunk validation error"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["ImageStreamer:chunk validation error: ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["ImageStreamer:handleProgress error: ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["ImageStreamer: [","] Generated progressive image using "," chunks of "," total"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["ImageStreamer: [","] Successfully decrypted chunk "," of "," total"]);o=function(){return a};return a}var p=function(b){babelHelpers.inheritsLoose(a,b);function a(a){return b.call(this,"Chunk "+a+" does not match sidecar")||this}return a}(d("WACustomError").customError("ChunkValidationError")),q=10,r=16,s=new Uint8Array([2,2]),t=new Uint8Array([255,217]);e=function(){function a(a){this._alignedScanLengths=[];this._increasingScanLengths=[];this._lastDecryptedChunk=0;this._promiseQueue=new(d("WAWebPromiseQueue").PromiseQueue)();this._downloadedBytes=new ArrayBuffer(0);var b=a.cryptoKeys,c=a.scanLengths,e=a.scansSidecar,f=a.filehash,g=a.mimetype,h=a.debugString;a=a.onProgressiveUpdate;this._cryptoKeys=b;this._scanLengths=c;this._scansSideCar=e;this._filehash=f;this._mimetype=g;this._nextChunkIV=(b=this._cryptoKeys)==null?void 0:b.iv;this._decryptedChunks=new Array(c.length);this._onProgressiveUpdate=a;this._debugString=h}var e=a.prototype;e.setCryptoKeys=function(a){this._cryptoKeys=a,this._nextChunkIV=a.iv};e._validateSidecar=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e){b===0&&(this._nextChunkIV=e.iv);e=e.macKey;var f=this._scansSideCar.slice(b*q,b*q+q),g=c("WANullthrows")(this._nextChunkIV);this._nextChunkIV=a.slice(0-r);g=d("WATypedArraysConcat").concatTypedArrays(Uint8Array,[new Uint8Array(g),new Uint8Array(a)]);a=(yield d("WACryptoHmac").hmacSha256(e,g,q));if(!d("WACryptoUtils").arrayBuffersEqual(a,f))throw new p(b)});function a(b,c,d){return a.apply(this,arguments)}return a}();e._cleanupCipherTextAndIV=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){a=a;var e=b===0,f=a.byteLength%r===0,g=!f;if(e)e=c.iv;else{b=this._increasingScanLengths[b-1];e=this._downloadedBytes.slice(b-r,b)}g&&(a=a.slice(0,a.byteLength-q));if(f){b=(yield u(a,c));return{cipherText:d("WATypedArraysConcat").concatTypedArrays(Uint8Array,[new Uint8Array(a),new Uint8Array(b)]),iv:e}}return{cipherText:a,iv:e}});function a(b,c,d){return a.apply(this,arguments)}return a}();e._getLastFullyLoadedChunkIndex=function(a){var b=0;for(var c=0;c<this._alignedScanLengths.length;c++){b+=this._alignedScanLengths[c];if(a<b)return c}return this._alignedScanLengths.length};e._handleChunk=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){yield this._validateSidecar(a,b,c);a=(yield this._cleanupCipherTextAndIV(a,b,c));var e=a.cipherText;a=a.iv;c=(yield d("WACryptoAesCbc").aesCbcDecrypt(c.encKey,a,e));a=(yield d("WACrypto").removeEncryptedPadding(c,s.buffer));d("WALogger").LOG(o(),this._debugString,b+1,this._scanLengths.length).devConsole({filehash:this._filehash});return a});function a(b,c,d){return a.apply(this,arguments)}return a}();e._generateBlobFromFullyLoadedChunks=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=(yield (h||(h=b("Promise"))).all(this._decryptedChunks.slice(0,a))),e=this._scanLengths.slice(0,a).reduce(function(a,b){return a+b},0);c=d("WATypedArraysConcat").concatTypedArrays(Uint8Array,c.map(function(a){return new Uint8Array(a)})).slice(0,e);e=d("WACryptoUtils").arrayBuffersEqual(t.buffer,c.slice(-t.length).buffer)?c:d("WATypedArraysConcat").concatTypedArrays(Uint8Array,[c,t]);c=[e];c=this._mimetype!=null?new Blob(c,{type:this._mimetype}):new Blob(c);var f=w(this._filehash,a);d("WAWebMediaInMemoryBlobCache").InMemoryMediaBlobCache.put(f,c);d("WALogger").LOG(n(),this._debugString,a,this._scanLengths.length).devConsole({filehash:this._filehash});this._onProgressiveUpdate==null?void 0:this._onProgressiveUpdate(a);this._lastDecryptedChunk=a;return e.buffer});function a(b){return a.apply(this,arguments)}return a}();e._decryptFullyLoadedChunks=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,d){for(var e=0;e<c;e++)if(!this._decryptedChunks[e]){var f=e===0?0:this._increasingScanLengths[e-1];f=a.slice(f,f+this._alignedScanLengths[e]);yield (h||(h=b("Promise"))).all(this._decryptedChunks);this._decryptedChunks[e]||(this._decryptedChunks[e]=this._handleChunk(f,e,d))}});function a(b,c,d){return a.apply(this,arguments)}return a}();e.handleProgress=function(a,c){var e=this;return this._promiseQueue.enqueue(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(!e._alignedScanLengths.length){e._alignedScanLengths=d("WAAlignChunkLengthsToMultipleOfAesBlockSize").alignChunkLengthsToMultipleOfAesBlockSize(e._scanLengths,a);for(var b=0;b<e._alignedScanLengths.length;b++){var f=e._alignedScanLengths[b];f=b===0?f:e._increasingScanLengths[b-1]+f;e._increasingScanLengths.push(f)}}f=typeof c==="string"?c.length:c.byteLength+e._downloadedBytes.byteLength;b=e._getLastFullyLoadedChunkIndex(f);f=e._cryptoKeys;if(b<=e._lastDecryptedChunk||f==null){e._downloadedBytes=d("WAArrayBuffersConcat").concatArrayBuffers(e._downloadedBytes,typeof c==="string"?yield d("WAArrayBufferUtils").largeStringToArrayBuffer(c.slice(e._downloadedBytes.byteLength)):c);return null}try{var g=typeof c==="string"?yield d("WAArrayBufferUtils").largeStringToArrayBuffer(c.slice(e._downloadedBytes.byteLength)):c;e._downloadedBytes=d("WAArrayBuffersConcat").concatArrayBuffers(e._downloadedBytes,g);yield e._decryptFullyLoadedChunks(e._downloadedBytes,b,f);return yield e._generateBlobFromFullyLoadedChunks(b)}catch(a){d("WALogger").WARN(m(),a.message).devConsole({error:a,filehash:e._filehash,scanLengths:e._scanLengths,scansSidecar:e._scansSideCar,mimetype:e._mimetype});g=a.message+", ["+e._debugString+"]"+("scanLengths length: "+e._scanLengths.length+", scansSidecar byteLength: "+e._scansSideCar.byteLength+".");a instanceof p?(d("WALogger").LOG(l(),g),d("WALogger").ERROR(k()).devConsole(a).tags("non-sad").sendLogs("ImageStreamer:chunk validation error",{sampling:.01})):(d("WALogger").LOG(j(),g),d("WALogger").ERROR(i()).devConsole(a).sendLogs("ImageStreamer:handleProgress error"))}}))};return a}();function u(a,b){return v.apply(this,arguments)}function v(){v=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=b.encKey;b=(yield d("WACryptoAesCbc").aesCbcEncrypt(b,s,new Uint8Array(a.slice(0-r))));return b.slice(0-r)});return v.apply(this,arguments)}function w(a,b){return a+"-progressive-"+b}function a(a,b){if(b!=null&&Number.isInteger(b)){b=b;while(b>0)d("WAWebMediaInMemoryBlobCache").InMemoryMediaBlobCache["delete"](w(a,b)),b--}d("WAWebMediaInMemoryBlobCache").InMemoryMediaBlobCache["delete"](a)}g.EOI_TAG=t;g.ImageStreamer=e;g.getProgressiveMediaCacheKey=w;g.deleteFromInMemoryMediaBlobCache=a}),98); __d("WAWebDownloadAndDecryptCache",["WALogger","WAWebMediaDataUtils","WAWebMediaStore","WAWebSerializeError","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["downloadManager.asyncCache.set error:\n",""],["downloadManager.asyncCache.set error:\\n",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["downloadManager.asyncCache.get error:\n",""],["downloadManager.asyncCache.get error:\\n",""]);i=function(){return a};return a}function j(a){var b,c;b=(b=a.progressiveJpegOpts)==null?void 0:b.scanCount;c=(c=a.progressiveJpegOpts)==null?void 0:c.scanLengths;if(b!=null&&!!c)return a.filehash+"-"+b+"/"+c.length+"-scans";else if(a.partialVideoOpts){b=a.partialVideoOpts.secondsToDownload;return a.filehash+"-"+b+"-seconds"}return a.filehash}a=function(){function a(){}var e=a.prototype;e.get=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if(!d("WAWebMediaDataUtils").shouldUseLruMediaStore(b.type))return null;try{return yield d("WAWebMediaStore").LruMediaStore.get(j(b))}catch(a){d("WALogger").WARN(i(),c("WAWebSerializeError")(a)).verbose();return null}});function e(b,c){return a.apply(this,arguments)}return e}();e.set=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e){if(!d("WAWebMediaDataUtils").shouldUseLruMediaStore(e.type))return;try{yield d("WAWebMediaStore").LruMediaStore.put(j(e),b)}catch(a){d("WALogger").WARN(h(),c("WAWebSerializeError")(a)).verbose()}});function e(b,c,d){return a.apply(this,arguments)}return e}();return a}();g.getLRUStoreKey=j;g.DownloadAndDecryptCache=a}),98); __d("WAWebWamEnumAiFetchMediaType",[],(function(a,b,c,d,e,f){a=Object.freeze({IMAGE_SINGLE:1,GRID_HIGH_RES:2,GRID_LOW_RES:3,INLINE_HIGH_RES:4,INLINE_LOW_RES:5});f.AI_FETCH_MEDIA_TYPE=a}),66); __d("WAWebWamEnumDownloadQualityType",[],(function(a,b,c,d,e,f){a=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});f.DOWNLOAD_QUALITY_TYPE=a}),66); __d("WAWebWamEnumExpressPathDownloadState",[],(function(a,b,c,d,e,f){a=Object.freeze({PARTIAL_OR_NONE:1,FULL:2,MEDIANOTIFY_RECEIVED_EP_DISABLED:3,SKIPPED_DIFF_POP:4,SKIPPED_AUTODOWNLOAD:5});f.EXPRESS_PATH_DOWNLOAD_STATE=a}),66); __d("WAWebMediaDownload2WamEvent",["WAWebWamCodegenUtils","WAWebWamEnumAiFetchMediaType","WAWebWamEnumBackendStoreType","WAWebWamEnumConnectionType","WAWebWamEnumDownloadOriginType","WAWebWamEnumDownloadQualityType","WAWebWamEnumExpressPathDownloadState","WAWebWamEnumHttpProtocolVersionType","WAWebWamEnumMediaDownloadModeType","WAWebWamEnumMediaDownloadResultType","WAWebWamEnumMediaType","WAWebWamEnumNetworkStackType","WAWebWamEnumPairedMediaType"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({MediaDownload2:[1590,{activeThreadCount:[55,a.TYPES.INTEGER],aiFetchMediaType:[62,d("WAWebWamEnumAiFetchMediaType").AI_FETCH_MEDIA_TYPE],appContext:[64,a.TYPES.STRING],appContextBitfield:[65,a.TYPES.INTEGER],clientMessageId:[50,a.TYPES.STRING],connectionType:[31,d("WAWebWamEnumConnectionType").CONNECTION_TYPE],daysSinceReceive:[46,a.TYPES.INTEGER],debugMediaException:[24,a.TYPES.STRING],debugMediaIp:[22,a.TYPES.STRING],debugUrl:[23,a.TYPES.STRING],deviceCount:[49,a.TYPES.INTEGER],downloadBytesTransferred:[20,a.TYPES.NUMBER],downloadConnectT:[15,a.TYPES.TIMER],downloadHttpCode:[18,a.TYPES.INTEGER],downloadIsReuse:[17,a.TYPES.BOOLEAN],downloadIsStreaming:[19,a.TYPES.BOOLEAN],downloadNetworkT:[16,a.TYPES.TIMER],downloadQuality:[37,d("WAWebWamEnumDownloadQualityType").DOWNLOAD_QUALITY_TYPE],downloadResumePoint:[14,a.TYPES.INTEGER],downloadTimeToFirstByteT:[21,a.TYPES.TIMER],estimatedBandwidth:[36,a.TYPES.NUMBER],estimatedBandwidthV2:[59,a.TYPES.NUMBER],expressPathBytesSaved:[42,a.TYPES.NUMBER],expressPathDownloadState:[56,d("WAWebWamEnumExpressPathDownloadState").EXPRESS_PATH_DOWNLOAD_STATE],expressPathTimeSavedMs:[43,a.TYPES.TIMER],fileHeight:[47,a.TYPES.INTEGER],fileWidth:[48,a.TYPES.INTEGER],hasLeveragedExpressPath:[44,a.TYPES.BOOLEAN],httpProtocolVersionType:[45,d("WAWebWamEnumHttpProtocolVersionType").HTTP_PROTOCOL_VERSION_TYPE],isProcessedVideo:[58,a.TYPES.BOOLEAN],isSenderPlatformCapi:[52,a.TYPES.BOOLEAN],isViewOnce:[41,a.TYPES.BOOLEAN],maxThreadCount:[57,a.TYPES.INTEGER],mediaId:[38,a.TYPES.INTEGER],networkStack:[30,d("WAWebWamEnumNetworkStackType").NETWORK_STACK_TYPE],overallAttemptCount:[4,a.TYPES.INTEGER],overallBackendStore:[39,d("WAWebWamEnumBackendStoreType").BACKEND_STORE_TYPE],overallConnBlockFetchT:[10,a.TYPES.TIMER],overallConnectionClass:[29,a.TYPES.STRING],overallCumT:[27,a.TYPES.TIMER],overallCumUserVisibleT:[60,a.TYPES.TIMER],overallCumV2T:[53,a.TYPES.TIMER],overallDecryptT:[12,a.TYPES.TIMER],overallDomain:[5,a.TYPES.STRING],overallDownloadMode:[11,d("WAWebWamEnumMediaDownloadModeType").MEDIA_DOWNLOAD_MODE_TYPE],overallDownloadOrigin:[35,d("WAWebWamEnumDownloadOriginType").DOWNLOAD_ORIGIN_TYPE],overallDownloadResult:[25,d("WAWebWamEnumMediaDownloadResultType").MEDIA_DOWNLOAD_RESULT_TYPE],overallFileValidationT:[13,a.TYPES.TIMER],overallIsEncrypted:[28,a.TYPES.BOOLEAN],overallIsFinal:[26,a.TYPES.BOOLEAN],overallMediaSize:[7,a.TYPES.NUMBER],overallMediaType:[1,d("WAWebWamEnumMediaType").MEDIA_TYPE],overallMmsVersion:[6,a.TYPES.INTEGER],overallQueueT:[9,a.TYPES.TIMER],overallRetryCount:[3,a.TYPES.INTEGER],overallT:[8,a.TYPES.TIMER],overallUserVisibleT:[61,a.TYPES.TIMER],pairedMediaType:[63,d("WAWebWamEnumPairedMediaType").PAIRED_MEDIA_TYPE],sleepModeAffected:[51,a.TYPES.BOOLEAN],timeDelayed:[54,a.TYPES.TIMER],usedFallbackHint:[40,a.TYPES.STRING]},[1,1,50],"regular"]},{MediaDownload2:[]});g.MediaDownload2WamEvent=b}),98); __d("WAWebCreateMediaDownloadMetrics",["WATimeUtils","WAWebABProps","WAWebMediaDownload2WamEvent","WAWebMmsDownloadUploadCrashLogger","WAWebMmsMediaTypes","WAWebWamEnumConnectionType","WAWebWamEnumMediaDownloadResultType","WAWebWamEnumNetworkStackType","WAWebWamGroupMetricCache","WAWebWamMediaMetricUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b,c=d("WAWebWamMediaMetricUtils").generateMediaEventId(),e=new(d("WAWebMediaDownload2WamEvent").MediaDownload2WamEvent)({mediaId:c,connectionType:d("WAWebWamEnumConnectionType").CONNECTION_TYPE.HOSTNAME,overallMediaType:d("WAWebWamMediaMetricUtils").getMetricMediaType(a.type),overallMmsVersion:4,networkStack:d("WAWebWamEnumNetworkStackType").NETWORK_STACK_TYPE.NATIVE,overallDownloadMode:d("WAWebWamMediaMetricUtils").getMetricOverallDownloadModeType(a.type,a.downloadMode,a.isPrefetch),overallAttemptCount:a.userDownloadAttemptCount,overallDownloadOrigin:a.downloadOrigin,overallBackendStore:(b=d("WAWebWamMediaMetricUtils").getMetricBackendStore(a.directPath))!=null?b:void 0,isViewOnce:a.isViewOnce});a.type===d("WAWebMmsMediaTypes").MEDIA_TYPES.IMAGE&&d("WAWebABProps").getABPropConfigValue("hqp_log_enabled")&&e.set(babelHelpers["extends"]({},a.imageDimensions));if(d("WAWebABProps").getABPropConfigValue("enable_days_since_receive_logging")&&a.mediaKeyTimestamp!=null){b=a.mediaKeyTimestamp;b=Math.floor((d("WATimeUtils").unixTime()-b)/(24*60*60));e.set({daysSinceReceive:b})}b=a.chatWid;if(b){a=(yield d("WAWebWamGroupMetricCache").getGroupMetrics(b));(a==null?void 0:a.deviceCount)!=null&&e.set({deviceCount:a.deviceCount})}d("WAWebMmsDownloadUploadCrashLogger").downloadUploadCrashLogger.mark(c,d("WAWebMmsDownloadUploadCrashLogger").ProgressType.DOWNLOAD_STARTED);b=function(a){var b=a.hostName,c=a.hostClass;a=a.failCount;e.set({overallDomain:b,overallConnectionClass:c,overallRetryCount:a})};a=function(a){e.set({overallMediaSize:a,overallDownloadResult:d("WAWebWamEnumMediaDownloadResultType").MEDIA_DOWNLOAD_RESULT_TYPE.OK,overallIsFinal:!0,downloadHttpCode:200}),d("WAWebMmsDownloadUploadCrashLogger").downloadUploadCrashLogger.mark(c,d("WAWebMmsDownloadUploadCrashLogger").ProgressType.DOWNLOAD_FINISHED,{overallMediaSize:a})};var f=function(a,b){e.set({overallDownloadResult:d("WAWebWamMediaMetricUtils").getMetricDownloadErrorResultType(a),overallIsFinal:b});b=d("WAWebWamMediaMetricUtils").getStatusCode(a);b!=null&&(e.downloadHttpCode=b);e.markOverallCumT();e.commit();d("WAWebWamMediaMetricUtils").logErrorUnknownDetails(e,a)},g=function(a){e.set({overallT:a})},h=function(a){var b=a.error,c=a.overallT;a=a.failCount;var f=new(d("WAWebMediaDownload2WamEvent").MediaDownload2WamEvent)(e.all);f.set({mediaId:d("WAWebWamMediaMetricUtils").generateMediaEventId(),overallDownloadResult:d("WAWebWamMediaMetricUtils").getMetricDownloadErrorResultType(b),overallIsFinal:!1,overallT:c,overallRetryCount:a});c=d("WAWebWamMediaMetricUtils").getStatusCode(b);c!=null&&(e.downloadHttpCode=c);e.markOverallCumT();f.commit();d("WAWebWamMediaMetricUtils").logErrorUnknownDetails(f,b)},i=function(){e.startOverallDecryptT()},j=function(){e.markOverallDecryptT()},k=function(){e.markOverallCumT(),e.commit()},l=function(){e.startDownloadNetworkT()},m=function(){e.markDownloadNetworkT()};return{mediaId:c,handleDownloadSuccess:a,handleDownloadHostFound:b,handleDownloadError:f,handleDownloadAttemptSuccess:g,handleDownloadAttemptError:h,handleDownloadAndDecryptSuccess:k,markDecryptionEnd:j,markDecryptionStart:i,startNetworkT:l,markNetworkT:m}});return h.apply(this,arguments)}g.createMediaDownloadMetrics=a}),98); __d("WAWebCryptoDecryptMedia",["Promise","WACryptoAesCbc","WACryptoHmac","WACryptoUtils","WALogger","WAMediaCalculateFilehash","WATypedArraysCast","WATypedArraysConcat","WAWebMiscErrors","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["decryptMedia: [","] error"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["decryptMedia: [","] success"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["decryptMedia: [","] start"]);k=function(){return a};return a}var l=10;function a(a){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=a.mediaKeys,e=a.ciphertextHmac,f=a.expectedPlaintextHash,g=a.debugString;yield (h||(h=b("Promise"))).resolve();var m={mediaKeys:c};d("WALogger").LOG(k(),g).devConsole(m);if(e.byteLength<l)throw new(d("WAWebMiscErrors").MediaDecryptionError)("ciphertext too short: "+e.byteLength);var n=c.iv,o=c.encKey;a=c.macKey;var p=d("WATypedArraysCast").castTypedArrays(Uint8Array,e);try{return yield d("WACryptoHmac").hmacSha256(a,d("WATypedArraysConcat").concatTypedArrays(Uint8Array,[new Uint8Array(n),p.subarray(0,0-l)]),l).then(function(a){var b=p.buffer.slice(0-l);if(!d("WACryptoUtils").arrayBuffersEqual(a,b))throw new(d("WAWebMiscErrors").MediaDecryptionError)("decryptMedia: hmac mismatch");return d("WACryptoAesCbc").aesCbcDecrypt(o,n,p.subarray(0,0-l))}).then(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(f==null)return a;var b=(yield d("WAMediaCalculateFilehash").calculateFilehash(a));if(b!==f)throw new(d("WAWebMiscErrors").MediaDecryptionError)("decryptMedia: plaintext hash mismatch");d("WALogger").LOG(j(),g).devConsole(m);return a});return function(b){return a.apply(this,arguments)}}())}catch(a){d("WALogger").WARN(i(),g).devConsole(m,a);if(a instanceof d("WAWebMiscErrors").MediaDecryptionError)throw a;throw new(d("WAWebMiscErrors").MediaDecryptionError)("decryption error: "+String(a)+"; stack: "+a.stack)}});return m.apply(this,arguments)}g["default"]=a}),98); __d("WAWebGetMediaDownloadByterange",["WAAlignChunkLengthsToMultipleOfAesBlockSize","WAWebCryptoDecryptPartialMedia"],(function(a,b,c,d,e,f,g){function a(a){var b=a.partialVideoOpts,c=a.progressiveJpegOpts;a=a.scanCount;if(c&&a!=null)return{start:0,end:d("WAAlignChunkLengthsToMultipleOfAesBlockSize").alignChunkLengthsToMultipleOfAesBlockSize(c.scanLengths).slice(0,a).reduce(function(a,b){return a+b},0)};if(b){c=b.video;a=c.size;c=c.duration;b=b.secondsToDownload;a=a*b/c;b=128*1024;c=Math.max(a,b);a=Math.ceil(c/d("WAWebCryptoDecryptPartialMedia").BLOCK_SIZE);return{start:0,end:a*d("WAWebCryptoDecryptPartialMedia").BLOCK_SIZE-1}}return null}g["default"]=a}),98); __d("WAWebNetworkType",[],(function(a,b,c,d,e,f){function a(){return navigator.connection&&typeof navigator.connection.effectiveType==="string"?navigator.connection.effectiveType:null}f.getEffectiveNetworkType=a}),66); __d("WAWebValidateMediaFilehash",["WAMediaCalculateFilehash","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=(yield d("WAMediaCalculateFilehash").calculateFilehash(a));return b===a});return h.apply(this,arguments)}g.validateFileash=a}),98); __d("WAWebWamEnumWebcChatType",[],(function(a,b,c,d,e,f){a=Object.freeze({INDIVIDUAL:0,GROUP:1,BROADCAST_LIST:2,COMMUNITY:3,NEWSLETTER:4});f.WEBC_CHAT_TYPE=a}),66); __d("WAWebWebcMediaRmrWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumMediaType","WAWebWamEnumWebcChatType","WAWebWamEnumWebcRmrReasonCode"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({WebcMediaRmr:[1906,{messageMediaType:[10,d("WAWebWamEnumMediaType").MEDIA_TYPE],webcBrowserNetworkType:[2,a.TYPES.STRING],webcBrowserStorageQuotaBytes:[11,a.TYPES.INTEGER],webcBrowserStorageQuotaUsedBytes:[12,a.TYPES.INTEGER],webcChatPosition:[1,a.TYPES.INTEGER],webcChatType:[9,d("WAWebWamEnumWebcChatType").WEBC_CHAT_TYPE],webcMediaRmrError:[8,a.TYPES.BOOLEAN],webcMediaRmrT:[6,a.TYPES.TIMER],webcMediaSize:[7,a.TYPES.INTEGER],webcMessageIndex:[3,a.TYPES.INTEGER],webcMessageT:[5,a.TYPES.TIMER],webcRmrReason:[14,d("WAWebWamEnumWebcRmrReasonCode").WEBC_RMR_REASON_CODE],webcRmrStatusCode:[13,a.TYPES.INTEGER]},[1,1,1],"regular"]},{WebcMediaRmr:[]});g.WebcMediaRmrWamEvent=b}),98); __d("WAWebDownloadManager",["Promise","WAAsyncCache","WAConcurrentPriorityPromiseQueue","WALogger","WAMemoizeConcurrent","WANullthrows","WAWebBackendErrors","WAWebCreateMediaDownloadMetrics","WAWebCryptoCreateMediaKeys","WAWebCryptoDecryptMedia","WAWebCryptoDecryptPartialMedia","WAWebCryptoImageStreamer","WAWebDownloadAndDecryptCache","WAWebDownloadManagerErrors","WAWebFrontendMsgGetters","WAWebGetMediaDownloadByterange","WAWebMediaCryptoEligibilityUtils","WAWebMediaDebugString","WAWebMediaObject","WAWebMediaTypes","WAWebMiscErrors","WAWebMmsClient","WAWebMmsClientErrors","WAWebMmsDownloadUploadCrashLogger","WAWebMmsMediaTypes","WAWebNetworkType","WAWebSerializeError","WAWebValidateMediaFilehash","WAWebWebcMediaRmrWamEvent","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["downloadManager.rmr: [","] error ","\n",""],["downloadManager.rmr: [","] error ","\\n",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["downloadManager.rmr: [","] error MediaNotOnPhone\n",""],["downloadManager.rmr: [","] error MediaNotOnPhone\\n",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["downloadManager.rmr: [","] error RMRNotSupportedOnNewsletterMessagesError","\n",""],["downloadManager.rmr: [","] error RMRNotSupportedOnNewsletterMessagesError","\\n",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["downloadManager.rmr: [","] status ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["downloadManager.rmr: [","] start"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["downloadManager.download: [","] error\n",""],["downloadManager.download: [","] error\\n",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["downloadManager.download: [","] expected error\n",""],["downloadManager.download: [","] expected error\\n",""]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["downloadManager.download: [","] success"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["downloadManager.download: [","] start"]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["[DownloadManager] expected encFilehash for media type ",""]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["[DownloadManager] expected media key for media type ",""]);s=function(){return a};return a}var t={PRELOAD_MMS_MEDIA:1,PRELOAD_MMS_THUMBNAIL:2},u=function(a){switch(a){case d("WAWebMmsMediaTypes").MEDIA_TYPES.THUMBNAIL_DOCUMENT:return t.PRELOAD_MMS_THUMBNAIL;case d("WAWebMmsMediaTypes").MEDIA_TYPES.HISTORY_SYNC:case d("WAWebMmsMediaTypes").MEDIA_TYPES.VIDEO:default:return t.PRELOAD_MMS_MEDIA}};a=function(){var a=this;this.preloader=new(c("WAConcurrentPriorityPromiseQueue"))(10,{thumbnail:4,histSyncChunk:3});this.downloadAndMaybeDecrypt=c("WAAsyncCache")(function(a){return d("WAWebDownloadAndDecryptCache").getLRUStoreKey(a)},new(d("WAWebDownloadAndDecryptCache").DownloadAndDecryptCache)(),function(b){return b.isPreload===!0?a.preloader.enqueue(function(){return v(b)},{priority:-u(b.type),group:b.type===d("WAWebMmsMediaTypes").MEDIA_TYPES.HISTORY_SYNC?"histSyncChunk":"thumbnail",signal:b.signal}):v(b)});this.rmr=c("WAMemoizeConcurrent")(function(a){return a.mediaObject.filehash||""},x);this.checkExistence=c("WAMemoizeConcurrent")(function(a){return a.encFilehash},z);d("WAWebMmsDownloadUploadCrashLogger").downloadUploadCrashLogger.init()};function v(a){return w.apply(this,arguments)}function w(){w=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=a.directPath,f=a.encFilehash,g=a.filehash,i=a.mediaKey,j=a.mediaKeyTimestamp,k=a.onDecryptStart,l=a.downloadOrigin,m=a.staticUrl,t=a.type,u=a.mode,v=a.progressiveJpegOpts,w=a.partialVideoOpts,x=a.onProgress,y=a.userDownloadAttemptCount,z=a.isViewOnce,A=a.imageDimensions,C=a.chatWid,D=d("WAWebMediaCryptoEligibilityUtils").isMediaCryptoExpectedForMediaType(t);if(i==null&&D){d("WALogger").ERROR(s(),t).tags("media").sendLogs("missing-media-key-for-media-type-"+t);throw new(d("WAWebMiscErrors").MediaDecryptionError)("decryptMedia: missing key for type "+t)}if(f==null&&D){d("WALogger").ERROR(r(),t).tags("media").sendLogs("missing-encfilehash-for-media-type-"+t);throw new(d("WAWebMiscErrors").MediaDecryptionError)("decryptMedia: missing encFilehash for type "+t)}var E=v==null?void 0:v.scanCount,F=v!=null&&(v.scanCount==null||v.scanCount===v.scanLengths.length);E=F?null:E;l=(yield d("WAWebCreateMediaDownloadMetrics").createMediaDownloadMetrics({directPath:e,downloadOrigin:l,type:t,userDownloadAttemptCount:y,isViewOnce:z,downloadMode:u,isPrefetch:v!=null&&!F,imageDimensions:A,chatWid:C,mediaKeyTimestamp:j}));y=l.handleDownloadSuccess;var G=l.handleDownloadHostFound;z=l.handleDownloadError;var H=l.handleDownloadAttemptSuccess,I=l.handleDownloadAttemptError;F=l.handleDownloadAndDecryptSuccess;A=l.markDecryptionStart;C=l.markDecryptionEnd;var J=l.startNetworkT,K=l.markNetworkT;j=l.mediaId;var L=a.signal||new AbortController().signal,M=d("WAWebMediaDebugString").getDebugString(g);l={directPath:e,encFilehash:f,staticUrl:m,type:t};d("WALogger").LOG(q(),M).devConsole(l);try{var N=B({progressiveJpegOpts:v,filehash:g,debugString:M}),O=function(a){I(a),N!=null&&(N=B({progressiveJpegOpts:v,filehash:g,debugString:M}))},P=c("WAWebGetMediaDownloadByterange")({partialVideoOpts:w,progressiveJpegOpts:v,scanCount:E}),Q=E==null&&v?function(a,b){var c;void ((c=N)==null?void 0:c.handleProgress(a.total,b))}:null;i=D&&i!=null?c("WAWebCryptoCreateMediaKeys")(t,i).then(function(a){var b;(b=N)==null?void 0:b.setCryptoKeys(a);return a}):(h||(h=b("Promise"))).resolve(null);i=(yield (h||(h=b("Promise"))).all([i,b("asyncToGeneratorRuntime").asyncToGenerator(function*(){J();try{return yield c("WAWebMmsClient").download({directPath:e,filehash:D?c("WANullthrows")(f):g,staticUrl:m,type:t,signal:L,mode:u,byteRange:P,onData:Q,onDownloadHostFound:G,onDownloadAttemptSuccess:H,onDownloadAttemptError:O,debugString:M,onProgress:x})}finally{K()}})()]));var R=i[0];i=i[1];y(i.byteLength);y=i;if(R!=null){d("WAWebMmsDownloadUploadCrashLogger").downloadUploadCrashLogger.mark(j,d("WAWebMmsDownloadUploadCrashLogger").ProgressType.DOWNLOAD_DECRYPTION_STARTED);k==null?void 0:k();A();if(E!=null&&P!=null){k=P.end-P.start;return c("WANullthrows")(yield (A=N)==null?void 0:A.handleProgress(k,i))}else w?y=(yield d("WAWebCryptoDecryptPartialMedia").decryptPartialMedia({mediaKeys:R,ciphertext:i})):y=(yield c("WAWebCryptoDecryptMedia")({mediaKeys:R,ciphertextHmac:i,expectedPlaintextHash:g,debugString:M}));C();d("WAWebMmsDownloadUploadCrashLogger").downloadUploadCrashLogger.mark(j,d("WAWebMmsDownloadUploadCrashLogger").ProgressType.DOWNLOAD_DECRYPTION_FINISHED)}else{E=w==null;if(E){A=(yield d("WAWebValidateMediaFilehash").validateFileash(y,g));if(!A)throw new(d("WAWebMiscErrors").MediaHashMismatch)()}}d("WALogger").LOG(p(),M).devConsole(l,y);F();return y}catch(b){b instanceof d("WAWebMmsClientErrors").MediaNotFoundError?(z(b,Boolean(a.isFinalRmrRetry)),d("WALogger").LOG(o(),M,c("WAWebSerializeError")(b)).verbose().devConsole(l)):(z(b,!0),d("WALogger").WARN(n(),M,c("WAWebSerializeError")(b)).verbose().devConsole(l));d("WAWebMmsDownloadUploadCrashLogger").downloadUploadCrashLogger.mark(j,d("WAWebMmsDownloadUploadCrashLogger").ProgressType.DOWNLOAD_ERROR);throw b}});return w.apply(this,arguments)}function x(a){return y.apply(this,arguments)}function y(){y=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.mediaObject,e=d("WAWebMediaDebugString").getDebugString(b.filehash),f={filehash:b.filehash,type:b.type};d("WALogger").LOG(m(),e).devConsole(f);b.consolidate({downloadStage:d("WAWebMediaTypes").DownloadStage.REUPLOADING});var g=self.performance.now(),h=new(d("WAWebWebcMediaRmrWamEvent").WebcMediaRmrWamEvent)(babelHelpers["extends"]({},a.rmrData,{webcRmrReason:a.rmrReason}));a=d("WAWebNetworkType").getEffectiveNetworkType();a!=null&&(h.webcBrowserNetworkType=a);b.type&&(h.messageMediaType=d("WAWebMediaObject").webMediaTypeToWamMediaType(b.type));b.size!=null&&(h.webcMediaSize=b.size);function n(a){var b=d("WAWebFrontendMsgGetters").getMaybeChat(a);h.webcChatType==null&&b&&(h.webcChatType=b.getWebcChatType());h.webcMessageT==null&&(h.webcMessageT=a.t);h.messageMediaType=a.getWamMediaType()}try{a=(yield b.rmr({onMsgSelect:n}));h.webcRmrStatusCode=a;d("WALogger").LOG(l(),e,a).devConsole(f);if(a===404)throw new(d("WAWebDownloadManagerErrors").MediaNotOnPhone)();if(a!==200)throw new(d("WAWebBackendErrors").ServerStatusCodeError)(a)}catch(a){h.webcMediaRmrError=!0;if(a instanceof d("WAWebMiscErrors").RMRNotSupportedOnNewsletterMessagesError){a.mediaType===d("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_STICKER?b.consolidate({downloadStage:d("WAWebMediaTypes").DownloadStage.RESOLVED}):d("WALogger").WARN(k(),e,a.message,a.stack).verbose().devConsole(f);throw a}else if(a instanceof d("WAWebDownloadManagerErrors").MediaNotOnPhone){d("WALogger").LOG(j(),e,c("WAWebSerializeError")(a)).verbose().devConsole(f);throw a}else{d("WALogger").WARN(i(),e,a.status||a.message,a.stack).verbose().devConsole(f);throw new(d("WAWebMiscErrors").MediaNeedsReupload)()}}finally{h.webcMediaRmrT=Math.ceil(self.performance.now()-g),h.commit()}});return y.apply(this,arguments)}function z(a){return A.apply(this,arguments)}function A(){A=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.directPath,d=a.encFilehash,e=a.signal;a=a.type;yield c("WAWebMmsClient").checkExistence({directPath:b,encFilehash:d,type:a,signal:e||new AbortController().signal})});return A.apply(this,arguments)}function B(a){var b=a.progressiveJpegOpts,c=a.filehash;a=a.debugString;return b==null?null:new(d("WAWebCryptoImageStreamer").ImageStreamer)({scanLengths:b.scanLengths,scansSidecar:b.scansSidecar,mimetype:b.mimetype,filehash:c,debugString:a,onProgressiveUpdate:b.onProgressiveUpdate})}e=new a();g.downloadManager=e}),98); __d("WAWebBaseCachePolicy",["WAWebEventEmitter"],(function(a,b,c,d,e,f,g){a={LOAD:"LOAD",NONE:"NONE"};b=function(a){babelHelpers.inheritsLoose(b,a);function b(b,c){var d;d=a.call(this)||this;d.collection=b;d.id=c;return d}var c=b.prototype;c.enableCaching=function(){};c.disableCaching=function(){};return b}(c("WAWebEventEmitter"));b.policy=a.NONE;g.CACHE_POLICY=a;g.BaseCachePolicy=b}),98); __d("WAWebLoadCachePolicy",["WAWebBaseCachePolicy","lodash"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(b,d){b=a.call(this,b,d.id)||this;b.$LoadCachePolicy$p_2=d.trigger||"all";b.$LoadCachePolicy$p_1=d.delay;b.$LoadCachePolicy$p_3=c("lodash").debounce(b.saveToCache,b.$LoadCachePolicy$p_1);return b}var d=b.prototype;d.saveToCache=function(){this.collection.saveToCache()};d.enableCaching=function(){this.listenTo(this.collection,this.$LoadCachePolicy$p_2,this.$LoadCachePolicy$p_3)};d.disableCaching=function(){this.stopListening(this.collection,this.$LoadCachePolicy$p_2,this.$LoadCachePolicy$p_3)};return b}(d("WAWebBaseCachePolicy").BaseCachePolicy);a.policy=d("WAWebBaseCachePolicy").CACHE_POLICY.LOAD;g["default"]=a}),98); __d("WAWebNoCachePolicy",["WAWebBaseCachePolicy"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(b,c){return a.call(this,b,c.id)||this}return b}(d("WAWebBaseCachePolicy").BaseCachePolicy);a.policy=d("WAWebBaseCachePolicy").CACHE_POLICY.NONE;g["default"]=a}),98); __d("WAWebCachePolicies",["WAWebLoadCachePolicy","WAWebNoCachePolicy"],(function(a,b,c,d,e,f,g){function a(a,b){switch(b.policy){case"LOAD":return new(c("WAWebLoadCachePolicy"))(a,b);case"NONE":return new(c("WAWebNoCachePolicy"))(a,b)}return new(c("WAWebNoCachePolicy"))(a,{id:"none",policy:"NONE"})}g.createCachePolicy=a}),98); __d("WAWebBaseCollection",["Promise","WAFilteredCatch","WALogger","WATypeUtils","WAWebBackendErrors","WAWebBaseCachePolicy","WAWebCachePolicies","WAWebCollection","WAWebConnModel","WAWebMiscErrors","WAWebSocketConstants","WAWebSocketModel","WAWebUserPrefsStore","asyncToGeneratorRuntime","cr:5292","err","gkx","uniqueID"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["baseCollection:initFromCache load: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["baseCollection:query query promise rejected: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["LogoutDrop error: ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["Called update without an id"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["Called find without an id"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["Detected UI change inside a transaction in collection ",".\n This can result in a consistency issue. See https://fburl.com/aleoj4tt item #1 for details."]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["baseCollection:saveToCache save: ",""]);o=function(){return a};return a}var p={QUERY:"QUERY",FIND:"FIND",UPDATE:"UPDATE"},q={}.toString(),r={id:"none",policy:d("WAWebBaseCachePolicy").CACHE_POLICY.NONE},s=function(b){babelHelpers.inheritsLoose(a,b);function a(a){var c;c=b.call(this,a)||this;c.name="CollectionSilentQueryError";c.message=a;return c}return a}(babelHelpers.wrapNativeSuper(Error));a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var b;b=a.call(this)||this;b._inflight={};b._cachePolicy=d("WAWebCachePolicies").createCachePolicy(babelHelpers.assertThisInitialized(b),b.constructor.cachePolicy||r);b._staleCollection=b.constructor.staleCollection||!1;b._staleCollection===!0&&b.listenTo(d("WAWebSocketModel").Socket,"change:stream",b._handleStreamChange);b._cachePolicy.enableCaching();b._cachePolicy.constructor.policy===d("WAWebBaseCachePolicy").CACHE_POLICY.LOAD&&(b.listenTo(d("WAWebConnModel").Conn,"me_ready",b._updateFromCache),d("WAWebConnModel").Conn.meReadyTriggered&&b._updateFromCache());return b}var f=e.prototype;f.initializeFromCache=function(a){this.add(a)};f.saveToCache=function(){if(!d("WAWebConnModel").Conn.shouldSaveToCache())return;var a=this._cachePolicy.id;d("WALogger").LOG(o(),String(a));c("WAWebUserPrefsStore").setCollection(a,this.toJSON())};f.add=function(e,f){var g=this;c("gkx")("26258")||(b("cr:5292")==null?void 0:b("cr:5292").currentTransaction)!=null&&d("WALogger").WARN(n(),this.constructor.name);if(e){if(d("WAWebConnModel").Conn.blockStoreAdds)throw new(d("WAWebBackendErrors").LogoutDrop)("adding to store when blocking store adds");var h=Array.isArray(e)?e:[e];if(h.every(function(a){return a==null?void 0:a.isState})){var i=h.filter(function(a){return!g.get(a.id)});i.length&&a.prototype.add.call(this,i,f);return h}}return a.prototype.add.call(this,e,f)};f.findQuery=function(a,b){return this._query(p.QUERY,a,b)};f.find=function(a,e){if(a)return this._query(p.FIND,a,e);d("WALogger").ERROR(m()).sendLogs("find-without-id");return(h||(h=b("Promise"))).reject(c("err")("called find without an id"))};f.update=function(a,e){if(a)return this._query(p.UPDATE,a,e);d("WALogger").ERROR(l()).sendLogs("update-without-id");return(h||(h=b("Promise"))).reject(c("err")("called update without an id"))};f.gadd=function(a,b){if(this.modelClass.prototype.isIdType(a)){var d=this.get(a);return d?d:this.add({id:a},b)[0]}if(a.id){d=b?b:{};d.merge=!0;return this.add(a,d)[0]}throw c("err")("gadd called without an id attr (id)")};f.gaddUp=function(a){var b=this._staleCollection;this.get(a.id)&&(b=!1);b=babelHelpers["extends"]({stale:b},a);a=this.add(b,{merge:!0})[0];if(a){b=a;a.stale&&this.find(a.id);return b}throw c("err")(".gaddUp called without an id attr (id)")};f["delete"]=function(){this._inflight={},this.reset()};f._handleResume=function(){switch(d("WAWebSocketModel").Socket.stream){case d("WAWebSocketConstants").SOCKET_STREAM.DISCONNECTED:if(!this._staleCollection)return;this.forEach(function(a){a&&(a.stale=!0)});break;case d("WAWebSocketConstants").SOCKET_STREAM.RESUMING:case d("WAWebSocketConstants").SOCKET_STREAM.SYNCING:case d("WAWebSocketConstants").SOCKET_STREAM.CONNECTED:break}};f._query=function(a,e,f){var g=this,i=d("WATypeUtils").isString(e)?e:e.toString();i===q&&(i=c("uniqueID")("collection_query_"));var l=a===p.QUERY?void 0:this.get(e),m="force-"+i;(this._inflight[m]&&a===p.FIND||a===p.UPDATE)&&(i=m);if(this._inflight[i])return a===p.FIND&&l&&!l.stale?(h||(h=b("Promise"))).resolve(l):this._inflight[i];return!l||l.stale||a===p.UPDATE?this._inflight[i]=this._serverQuery(a,e,f)["finally"](function(){delete g._inflight[i]})["catch"](d("WAFilteredCatch").filteredCatch(d("WAWebBackendErrors").LogoutDrop,function(a){d("WALogger").WARN(k(),a.toString()).devConsole(a)}))["catch"](function(a){if(a instanceof s)d("WALogger").LOG(j(),String(a));else throw a}):(h||(h=b("Promise"))).resolve(l)};f._serverQuery=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){var e;a===p.UPDATE?e=this._update(b,c):a===p.FIND?e=this.findImpl(b,c):e=this.findQueryImpl(b);a=(yield e);if(this._staleCollection){b=Array.isArray(a)?a:[a];b.filter(Boolean).forEach(function(a){typeof a.stale==="undefined"&&(a.stale=!1)})}(c==null?void 0:c.set)?e=this.set(a):e=this.add(a,{merge:!0});if(Array.isArray(a))return e;if(e[0])return e[0];throw new(d("WAWebMiscErrors").ModelCreateError)("Unknown",a)});function a(b,c,d){return a.apply(this,arguments)}return a}();f._update=function(a,b){return this.findImpl(a,b)};f._handleStreamChange=function(){this._handleResume(),this._cachePolicy.constructor.policy===d("WAWebBaseCachePolicy").CACHE_POLICY.LOAD&&this._updateFromCache()};f._updateFromCache=function(){var a=this._cachePolicy.id;this._cachePolicy.disableCaching();if(!d("WAWebConnModel").Conn.shouldSaveToCache())return;d("WALogger").LOG(i(),String(a));this.initializeFromCache(c("WAWebUserPrefsStore").getCollection(a));this._cachePolicy.enableCaching()};return e}(c("WAWebCollection"));g.CollectionSilentQueryError=s;g.BaseCollection=a}),98); __d("WAWebCollection",["WAArrayMove","WALogger","WAWebCollectionInternalUtils","WAWebEventEmitter","err","gkx"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["collection:_prepareModel for model "," exception: ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["no model with id ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Assertion failed!"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["collection:set model has no id"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["collection:set called with no models"]);l=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(b,a);function b(b,d){d===void 0&&(d={});b=a.call(this)||this;d.parent&&(b.parent=d.parent);d=b.constructor;var e=d.model;d=d.comparator;if(!e)throw c("err")("Collection initialized without model. It is likely that you have a circular dependency. Set a breakpoint to find it and use inline `require` instead of `import` to avoid it.");b.modelClass=e;d&&(b._comparator=d);b._reset();var f=babelHelpers.assertThisInitialized(b);Object.defineProperty(babelHelpers.assertThisInitialized(b),"length",{get:function(){return f._models.length}});return b}var e=b.prototype;e.add=function(a,b){var c;Array.isArray(a)?c=a.slice():c=a?[a]:[];return this.set(c,babelHelpers["extends"]({merge:!1,add:!0,remove:!1},b))};e.set=function(a,b){var c=this;if(!a){d("WALogger").WARN(l());return[]}var e=babelHelpers["extends"]({add:!0,remove:!0,merge:!0},b),f,g,h,i;b=this._comparator&&e.sort!==!1;var j=[],m=[],n={},o=e.add,p=e.merge,q=e.remove,r=e.at!=null?e.at:void 0,s=!b&&o===!0&&q===!0?[]:null;for(var t=0,u=a.length;t<u;t++){i=a[t];this.isModel(i)&&(g=i);f=i.id;if(!f){d("WALogger").WARN(k());continue}h=this.get(f);if(h)(function(){var b=h;q===!0&&(n[h.id.toString()]=!0);p===!0&&(i=g&&i===g?g.attributes:i,b.set(i,e),c._iterateAggregators(function(a){a.add([b])}));a[t]=b})();else if(o===!0){g=a[t]=this._prepareModel(i,e);if(g){f=g;j.push(f);this._addReference(f)}else continue}g=h||g;if(!g)continue;f=g;s&&(!g.id||!n[g.id.toString()])&&s.push(f);n[f.id.toString()]=!0}if(q===!0){for(f=0,o=this.length;f<o;f++){g=this._models[f];u=g;n[g.id.toString()]||m.push(u)}m.length&&this.remove(m,babelHelpers["extends"]({},e))}var v;if(j.length||Boolean(s==null?void 0:s.length)){b&&(v=!0);if(typeof r==="number"){(u=this._models).splice.apply(u,[r,0].concat(j))}else{f=s||j;for(o=0,m=f.length;o<m;o++)this._models.push(f[o])}this._iterateAggregators(function(a){a.add(j)})}v&&this.sort({silent:!0});if(!e.silent){for(b=0,u=j.length;b<u;b++)g=j[b],g.trigger?g.trigger("add",g,this,e):this.trigger("add",g,this,e);(v||Boolean(s==null?void 0:s.length))&&this.trigger("sort",this,e)}return a};e.remove=function(a,b){b===void 0&&(b={});var c,d;a=Array.isArray(a)?a.slice():[a];var e=[];for(var f=0,g=a.length;f<g;f++){d=a[f];if(!d)continue;d=d instanceof this.modelClass?d.id:d;d=e[f]=this.get(d);if(d){var h=d;this._deIndex(d);c=this._models.indexOf(d);this._models.splice(c,1);b.silent||(b.index=c,h.trigger?h.trigger("remove",d,this,b):this.trigger("remove",d,this,b));this._removeReference(h)}}this._iterateAggregators(function(a){a.remove(e)});return e};e.reset=function(){for(var a=0,b=this._models.length;a<b;a++)this._removeReference(this._models[a]);this._reset();this.trigger("reset",this)};e.sort=function(a){a===void 0&&(a={});if(!this._comparator)throw c("err")("Cannot sort without comparator");this._models.sort(this._comparator.bind(this));a.silent||this.trigger("sort",this,a);return this};e.replaceId=function(a,b){var c=this.get(a);if(!c)return;this._removeFromIndex(a);c.set({id:b});this._addIndex(c)};e.reorderMutate=function(a,b){d("WAArrayMove").arrayMoveMutate(this._models,a,b)};e.get=function(a){return this._index[a]};e.assertGet=function(a){var b=this._index[a];if(!b)if(c("gkx")("26258"))d("WALogger").ERROR(j()).sendLogs("Collection:assertGet no result");else{var e=this.constructor.name+":assertGet";d("WALogger").ERROR(i(),String(a)).sendLogs(e)}return b};e.at=function(a){return this._models[a]};e.serialize=function(){return this.map(function(a){return a.toJSON()})};e.toJSON=function(){return this.serialize()};e.isModel=function(a){return a instanceof this.modelClass};e.includes=function(a,b){b===void 0&&(b=0);return b===0?!(a instanceof this.modelClass)?!1:this.get(a.id)!=null:this._models.includes(a,b)};e.indexOf=function(a,b){return this._models.indexOf(a,b)};e.lastIndexOf=function(a,b){return this._models.lastIndexOf(a,b)};e.every=function(a){return this._models.every(a)};e.some=function(a){return this._models.some(a)};e.forEach=function(a){this._models.forEach(a)};e.map=function(a){return this._models.map(a)};e.filter=function(a){return this._models.filter(a)};e.findFirst=function(a){return this._models.find(a)};e.reduce=function(a,b){return this._models.reduce(a,b)};e.slice=function(a,b){return this._models.slice(a,b)};e.where=function(a){return this.filter(function(b){for(var c in a)if(a[c]!==b.get(c))return!1;return!0})};e.head=function(){return this._models[0]};e.last=function(){return this._models[this._models.length-1]};e.toArray=function(){return this._models.slice()};e.getModelsArray=function(){return this._models};e.reorder=function(a,b){return d("WAArrayMove").arrayMove(this._models,a,b)};e._reset=function(){this._models=[],this._index={},this._iterateAggregators(function(a){a.reset()},!1)};e._prepareModel=function(a,b){if(this.isModel(a)){a.collection||(a.collection=this);return a}b=babelHelpers["extends"]({},b,{collection:this});try{return new this.modelClass(a,b)}catch(c){d("WALogger").ERROR(h(),(b=this==null?void 0:(a=this.modelClass)==null?void 0:a.name)!=null?b:"",c.stack).sendLogs("collection-model-creation-error");return void 0}};e._addReference=function(a){this._addIndex(a),a.collection||(a.collection=this),a.on&&a.on("all",this._handleModelEvent,this)};e._removeReference=function(a){this===a.collection&&delete a.collection,this._deIndex(a),a.off&&a.off("all",this._handleModelEvent,this)};e._addIndex=function(a){this._index[a.id]=a};e._deIndex=function(a){delete this._index[a.id]};e._removeFromIndex=function(a){if(!this.get(a))return;delete this._index[a]};e._handleModelEvent=function(a,b,c,d){var e=a.indexOf(":"),f=e===-1?a:a.slice(0,e);if((f==="add"||f==="remove")&&c!==this)return;f==="destroy"&&this.remove(b,d);this.trigger.apply(this,arguments)};e._iterateAggregators=function(a,b){b===void 0&&(b=!0);if(this._aggregators==null){if(!b)return;this._aggregators=d("WAWebCollectionInternalUtils").groupMethodsByKind(this).aggregate}(b=this._aggregators)==null?void 0:b.forEach(a)};return b}(c("WAWebEventEmitter"));g["default"]=a}),98); __d("WAWebCollectionInternalUtils",["WAWebCollectionUtils"],(function(a,b,c,d,e,f,g){var h=function(a){return a!=null&&typeof a==="function"&&"kind"in a&&d("WAWebCollectionUtils").CollectionMethodKind.isValid(a.kind)?a:null};function a(a){var b=null;for(var c of Object.keys(a)){var e=h(a[c]);if(e)switch(e.kind){case d("WAWebCollectionUtils").CollectionMethodKind.Aggregate:b||(b=[]);b.push(e);break}}return{aggregate:b}}g.groupMethodsByKind=a}),98); __d("WAWebCollectionUtils",["$InternalEnum","WALogger","WAWebSimpleCollection"],(function(a,b,c,d,e,f,g){function a(){var b=babelHelpers.taggedTemplateLiteralLoose(["Aggregated utility generates a key with undefined value ",""]);a=function(){return b};return b}var h=b("$InternalEnum").Mirrored(["Aggregate"]);function i(a){return Array.isArray(a)?JSON.stringify(a.map(i)):String(a)}var j=function(b){babelHelpers.inheritsLoose(a,b);function a(a,c){var d;d=b.call(this)||this;d._isWaitingForCollection=!1;d._rootCollection=a;d._key=c;var e=babelHelpers.assertThisInitialized(d);Object.defineProperty(babelHelpers.assertThisInitialized(d),"_models",{get:function(){var a;return(a=(a=e._getAggregatedCollection())==null?void 0:a._models)!=null?a:[]}});Object.defineProperty(babelHelpers.assertThisInitialized(d),"_index",{get:function(){var a;return(a=(a=e._getAggregatedCollection())==null?void 0:a._index)!=null?a:{}}});return d}var c=a.prototype;c._getAggregatedCollection=function(){var a;return(a=this._rootCollection.get(this._key))==null?void 0:a.collection};c.on=function(a,c,d){b.prototype.on.call(this,a,c,d);this._maybeConnect();return this};c.off=function(a,c,d){b.prototype.off.call(this,a,c,d);this._maybeDisconnect();return this};c._hasListeners=function(){var a=this._events;if(a==null)return!1;for(var b in a)if(a[b]!=null&&a[b].length>0)return!0;return!1};c._maybeConnect=function(){var a=this,b=this._getAggregatedCollection();if(b==null){if(this._isWaitingForCollection)return;this._isWaitingForCollection=!0;this._rootCollection.on("add",this._maybeConnect,this);this._disconnect=function(){a._rootCollection.off("add",a._maybeConnect,a)};return}this._isWaitingForCollection&&(this._disconnect==null?void 0:this._disconnect(),this._isWaitingForCollection=!1);b.on("all",this._relayEvent,this);this._rootCollection.on("remove",this._handleCollectionRemove,this);this._disconnect=function(){b.off("all",a._relayEvent,a),a._rootCollection.off("remove",a._handleCollectionRemove,a)}};c._maybeDisconnect=function(){if(this._hasListeners())return;this._disconnect==null?void 0:this._disconnect();this._disconnect=null};c._handleCollectionRemove=function(a){this._key===a.id&&(this._disconnect==null?void 0:this._disconnect(),this._disconnect=null,this._maybeConnect())};c._relayEvent=function(a){for(var b=arguments.length,c=new Array(b>1?b-1:0),d=1;d<b;d++)c[d-1]=arguments[d];this.trigger.apply(this,[a].concat(c))};return a}(d("WAWebSimpleCollection").SimpleCollection);function c(a,b){b===void 0&&(b={});b=b;var c=b.subscribeToKey,e=b.subscribeToKeys,f=new(d("WAWebSimpleCollection").SimpleCollection)(),g=new Map(),k=function(a){if(c!=null){var b=function b(){var d=function(){a.off("change:"+c,b)};n(a,d)};a.on("change:"+c,b)}if(e!=null){var d=function b(){var c=function(){e.forEach(function(c){a.off("change:"+c,b)})};n(a,c)};e.forEach(function(b){a.on("change:"+b,d)})}},l=function(a,b){var c;c=(c=f.get(a))==null?void 0:c.collection;c&&(c.remove(b),c.length===0&&f.remove(a));g["delete"](b.id)},m=function(b){var c=a(b);if(c==null)return;var e=g.get(b.id);c=i(c);e!=null&&c!==e&&l(e,b);e=(e=f.get(c))==null?void 0:e.collection;e==null&&(e=new(d("WAWebSimpleCollection").SimpleCollection)(),f.add({id:c,collection:e}));e.add(b);g.set(b.id,c);k(b)},n=function(b,c){var d=g.get(b.id),e=a(b);if(e==null){d!=null&&(c(),l(d,b));return}if(d!==i(e)){c();return m(b)}};return Object.assign(function(a){return new j(f,i(a))},{kind:h.Aggregate,add:function(a){a.forEach(function(a){m(a)})},remove:function(b){b.filter(Boolean).forEach(function(b){var c=i(a(b));l(c,b)})},reset:function(){f.forEach(function(a){a=a.collection;a.reset()}),f.reset(),g.clear()}})}g.CollectionMethodKind=h;g.AggregatedProxyView=j;g.aggregated=c}),98); __d("WAWebSimpleCollection",["WAWebBaseCollection"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}return b}(d("WAWebBaseCollection").BaseCollection);a.model=Object;g.SimpleCollection=a}),98); __d("WAWebMsgModelFromData",["WAWebMsgModel"],(function(a,b,c,d,e,f,g){function h(a){return new(d("WAWebMsgModel").Msg)(babelHelpers["extends"]({},a,{paymentNoteMsg:a.paymentNoteMsg?h(a.paymentNoteMsg):void 0}))}g.msgModelFromMsgData=h}),98); __d("WAWebUserPrefsInfoStore",["Promise","WAArrayBufferUtils","WABase64","WABinary","WALogger","WAWebCmd","WAWebCryptoCurve25519","WAWebDbEncryptionKey","WAWebL10N","WAWebLockScreenResolver","WAWebLogoutReasonConstants","WAWebSocketConstants","WAWebSocketLogoutJob","WAWebUserPrefsMultiDevice","WAWebUserPrefsScreenLock","asyncToGeneratorRuntime","gkx"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["App lock iv array: "," is null"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["App lock iv array: "," is null"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[DB ENC CRITICAL ERROR] null returned for local app lock salt"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["Removing lock on Noise info failed."]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["Decrypted noise key was invalid."]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["Noise ivArray : "," is null"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["Noise Info: "," is null, so there is no lock to remove."]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["Error with decrypting the noise with the passcode derived key: ",""]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["Decrypted noise key was invalid."]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["Failed to lock noise info: ",""]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["Empty noiseInfo when trying to lock noise info with passcode."]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["Decrypted noise key failed validation."]);t=function(){return a};return a}function u(){var a=babelHelpers.taggedTemplateLiteralLoose(["Failed to lock noise info: ",""]);u=function(){return a};return a}function v(){var a=babelHelpers.taggedTemplateLiteralLoose(["Error serializing certificate chain: ",""]);v=function(){return a};return a}function w(){var a=babelHelpers.taggedTemplateLiteralLoose(["Decrypted noise key was invalid."]);w=function(){return a};return a}function x(){var a=babelHelpers.taggedTemplateLiteralLoose(["Noise ivArray : "," is null"]);x=function(){return a};return a}function y(){var a=babelHelpers.taggedTemplateLiteralLoose(["Noise encryptedNoiseInfo: "," is null"]);y=function(){return a};return a}function z(){var a=babelHelpers.taggedTemplateLiteralLoose(["Error parsing certificate chain: ",""]);z=function(){return a};return a}a=function(){function a(){this.$1=null}var d=a.prototype;d.get=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){this.$1==null&&(this.$1=(yield this.getOsRelease()));return{osVersion:this.$1,osBuild:"0.1",hardware:"desktop",manufacturer:"",device:"Desktop",lg:c("WAWebL10N").getLanguage(),lc:c("WAWebL10N").getRegion()||"",mcc:"000",mnc:"000",sim_mnc:"000",sim_mcc:"000"}});function d(){return a.apply(this,arguments)}return d}();d.getOsRelease=function(){var a="0.1";return(h||(h=b("Promise"))).resolve(a)};return a}();e=new a();var A=128,B="AES-GCM",C="PBKDF2",D=c("gkx")("26256")?1e4:6e5;f=function(){function a(){this.cachedPasscodeDerivedKey=null}var c=a.prototype;c.resetCachedPasscodeDerivedKey=function(){this.cachedPasscodeDerivedKey=null};c.getCertficateChain=function(a){a=d("WAArrayBufferUtils").arrayBufferToString(a);try{a=JSON.parse(a);var b=a.intermediate;a=a.leaf;return{intermediate:{key:d("WABase64").decodeB64(b.key),notAfter:Number(b.notAfter),notBefore:Number(b.notBefore)},leaf:{key:d("WABase64").decodeB64(a.key),notAfter:Number(a.notAfter),notBefore:Number(a.notBefore)}}}catch(a){d("WALogger").LOG(z(),a);return null}};c.get=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=d("WAWebUserPrefsMultiDevice").getNoiseInfo();if(!a){d("WALogger").DEV(y(),!a).tags("info-store");return null}var b=this.$1();if(!b){d("WALogger").DEV(x(),!b).tags("info-store");return null}a=(yield this.$2(a,b));if(d("WAWebUserPrefsScreenLock").getScreenLockEnabled()){d("WAWebCmd").Cmd.setSocketState(d("WAWebSocketConstants").SOCKET_STATE.SCREEN_LOCKED);b=(yield this.passcodeUnlockNoiseInfo(a));b&&(a=b)}if(!this.$3(a)){d("WALogger").LOG(w()).tags("info-store");return null}return a});function c(){return a.apply(this,arguments)}return c}();c.setCertificateChain=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield this.get());if(!b)return;try{var c=babelHelpers["extends"]({},a.intermediate,{key:d("WABase64").encodeB64(a.intermediate.key)});a=babelHelpers["extends"]({},a.leaf,{key:d("WABase64").encodeB64(a.leaf.key)});c=JSON.stringify({intermediate:c,leaf:a});b.certificateChainBuffer=d("WAArrayBufferUtils").stringToArrayBuffer(c);return this.set(b)}catch(a){d("WALogger").LOG(v(),a).sendLogs("handshake-serialization-failed")}});function c(b){return a.apply(this,arguments)}return c}();c.set=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=this;a=a;if(this.cachedPasscodeDerivedKey!=null){var e=this.cachedPasscodeDerivedKey,f=a,g=f.recoveryToken,i=f.staticKeyPair,j=i.pubKey;i=i.privKey;f=f.certificateChainBuffer;try{g=(yield (h||(h=b("Promise"))).all([g,j,i,f].map(function(a){return c.encryptNoiseWithPasscodeDerivedKey(a,e)})));g[0]&&g[1]&&g[2]&&(a={recoveryToken:g[0],staticKeyPair:{pubKey:g[1],privKey:g[2]},certificateChainBuffer:g[3]})}catch(a){d("WALogger").DEV(u(),a)}}j=new Uint8Array(16*4);self.crypto.getRandomValues(j);i=this.$4(j);yield this.$5(i);f=(yield (h||(h=b("Promise"))).all([this.$6(a.recoveryToken,i[0]),this.$6(a.staticKeyPair.pubKey,i[1]),this.$6(a.staticKeyPair.privKey,i[2]),a.certificateChainBuffer?this.$6(a.certificateChainBuffer,i[3]):(h||(h=b("Promise"))).resolve(void 0)]));g=f[0];j=f[1];i=f[2];f=f[3];a.recoveryToken=g;a.staticKeyPair.pubKey=j;a.staticKeyPair.privKey=i;a.certificateChainBuffer=f;return d("WAWebUserPrefsMultiDevice").setNoiseInfo(a)});function c(b){return a.apply(this,arguments)}return c}();c.$5=function(a){return d("WAWebUserPrefsMultiDevice").setNoiseInfoIv(a.map(d("WABase64").encodeB64))};c.$1=function(){var a=d("WAWebUserPrefsMultiDevice").getNoiseInfoIv();return!a?null:a.map(function(a){return new Uint8Array(d("WABase64").decodeB64(a))})};c.$4=function(a){a=new(d("WABinary").Binary)(a);return[a.readByteArray(16),a.readByteArray(16),a.readByteArray(16),a.readByteArray(16)]};c.$6=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=d("WAWebDbEncryptionKey").DbEncKeyStore.getEncKeys()[0];b=(yield self.crypto.subtle.encrypt({iv:b,name:"AES-CBC"},c.key,a));return b});function c(b,c){return a.apply(this,arguments)}return c}();c.$2=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){c=(yield (h||(h=b("Promise"))).all([this.$7(a.recoveryToken,c[0]),this.$7(a.staticKeyPair.pubKey,c[1]),this.$7(a.staticKeyPair.privKey,c[2]),a.certificateChainBuffer!=null?this.$7(a.certificateChainBuffer,c[3]):(h||(h=b("Promise"))).resolve(void 0)]));var d=c[0],e=c[1],f=c[2];c=c[3];a.certificateChainBuffer=c;a.recoveryToken=d;a.staticKeyPair.pubKey=e;a.staticKeyPair.privKey=f;return a});function c(b,c){return a.apply(this,arguments)}return c}();c.$7=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=d("WAWebDbEncryptionKey").DbEncKeyStore.getEncKeys()[0];b=(yield self.crypto.subtle.decrypt({iv:b,name:"AES-CBC"},c.key,a));return b});function c(b,c){return a.apply(this,arguments)}return c}();c.$3=function(a){var b=!0;try{var c=new Uint8Array(d("WAWebCryptoCurve25519").keyPair(a.staticKeyPair.privKey).pubKey);a=new Uint8Array(a.staticKeyPair.pubKey);for(var e=0;e<c.length;e++)if(c[e]!==a[e]){b=!1;break}}catch(a){d("WALogger").LOG(t()).tags("info-store"),b=!1}return b};c.lockNoiseInfo=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield this.deriveKeyFromPasscode(a));this.createScreenLockIv();var b=(yield this.get());if(!b||!b.staticKeyPair){d("WALogger").DEV(s()).tags("info-store");return!1}try{this.cachedPasscodeDerivedKey=a;yield this.set(b);return!0}catch(a){this.cachedPasscodeDerivedKey=null,d("WALogger").DEV(r(),a)}return!1});function c(b){return a.apply(this,arguments)}return c}();c.passcodeUnlockNoiseInfo=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b===void 0&&(b=!1);if(this.cachedPasscodeDerivedKey==null){!b?b=(yield d("WAWebLockScreenResolver").LockScreenResolvable.waitForPasscode()):b=(yield d("WAWebLockScreenResolver").LockScreenResolvable.waitForPasscodeAfterIncorrectAttempt());b=(yield this.deriveKeyFromPasscode(b))}else b=this.cachedPasscodeDerivedKey;var c=(yield this.getUnlockedNoiseInfo(a,b));if(!c||!this.$3(c)){d("WALogger").LOG(q()).tags("info-store");return this.passcodeUnlockNoiseInfo(a,!0)}d("WAWebLockScreenResolver").LockScreenResolvable.correctPasscodeEntered(b);d("WAWebCmd").Cmd.setSocketState(d("WAWebSocketConstants").SOCKET_STATE.OPENING);return c});function c(b,c){return a.apply(this,arguments)}return c}();c.getUnlockedNoiseInfo=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){var e=this,f=a.recoveryToken,g=a.staticKeyPair,i=g.pubKey;g=g.privKey;a=a.certificateChainBuffer;try{f=(yield (h||(h=b("Promise"))).all([f,i,g,a].map(function(a){return e.decryptNoiseWithPasscodeDerivedKey(a,c)})));if(f[0]&&f[1]&&f[2]){this.cachedPasscodeDerivedKey=c;return{recoveryToken:f[0],staticKeyPair:{pubKey:f[1],privKey:f[2]},certificateChainBuffer:f[3]}}}catch(a){d("WALogger").DEV(p(),a);return null}});function c(b,c){return a.apply(this,arguments)}return c}();c.removeLockOnNoiseInfo=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=d("WAWebUserPrefsMultiDevice").getNoiseInfo();if(!b){d("WALogger").DEV(o(),!b).tags("info-store");return!1}var c=this.$1();if(!c){d("WALogger").DEV(n(),!c).tags("info-store");return!1}b=(yield this.$2(b,c));c=(yield this.deriveKeyFromPasscode(a));a=(yield this.getUnlockedNoiseInfo(b,c));if(a!=null){if(!this.$3(a)){d("WALogger").LOG(m()).tags("info-store");return!1}this.cachedPasscodeDerivedKey=null;yield this.set(a);d("WAWebUserPrefsScreenLock").setScreenLockSalt(null);d("WAWebUserPrefsScreenLock").setScreenLockIvString("");yield d("WAWebUserPrefsScreenLock").setScreenLockIterations(null);return!0}d("WALogger").DEV(l());return!1});function c(b){return a.apply(this,arguments)}return c}();c.deriveKeyFromPasscode=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=new TextEncoder().encode(a);a=(yield self.crypto.subtle.importKey("raw",a,{name:C},!1,["deriveKey"]));var b=(yield this.getOrGenScreenLockSalt());b=(yield self.crypto.subtle.deriveKey({name:C,hash:"SHA-256",salt:b,iterations:yield this.getScreenLockIterationCount()},a,{name:B,length:A},!1,["encrypt","decrypt"]));return b});function c(b){return a.apply(this,arguments)}return c}();c.getOrGenScreenLockSalt=function(){var a=null;d("WAWebUserPrefsScreenLock").getScreenLockEnabled()||(a=new Uint8Array(A),self.crypto.getRandomValues(a),a=btoa(String.fromCharCode.apply(String,Array.from(new Uint8Array(a)))),d("WAWebUserPrefsScreenLock").setScreenLockSalt(a));a=d("WAWebUserPrefsScreenLock").getScreenLockSalt();a==null&&(d("WALogger").DEV(k()),void d("WAWebSocketLogoutJob").socketLogout(d("WAWebLogoutReasonConstants").LogoutReason.MissingScreenLockSalt));a=Uint8Array.from(atob(a),function(a){return a.charCodeAt(0)});return(h||(h=b("Promise"))).resolve(a)};c.createScreenLockIv=function(){var a=new Uint8Array(16);self.crypto.getRandomValues(a);a=new(d("WABinary").Binary)(a).readByteArray(16);d("WAWebUserPrefsScreenLock").setScreenLockIvString(d("WABase64").encodeB64(a))};c.getScreenLockIvArray=function(){var a=d("WAWebUserPrefsScreenLock").getScreenLockIvString();return!a?null:new Uint8Array(d("WABase64").decodeB64(a))};c.encryptNoiseWithPasscodeDerivedKey=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if(a==null)return null;var c=this.getScreenLockIvArray();if(!c){d("WALogger").DEV(j(),!c).tags("info-store");return null}c=(yield self.crypto.subtle.encrypt({iv:c,name:B},b,a));return c});function c(b,c){return a.apply(this,arguments)}return c}();c.decryptNoiseWithPasscodeDerivedKey=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if(a==null)return null;var c=this.getScreenLockIvArray();if(!c){d("WALogger").DEV(i(),!c).tags("info-store");return null}c=(yield self.crypto.subtle.decrypt({iv:c,name:B},b,a));return c});function c(b,c){return a.apply(this,arguments)}return c}();c.calculatePBKDF2Iterations=function(){var a=navigator.hardwareConcurrency;return D*Math.max(1,Number.isNaN(a)?1:a)};c.getScreenLockIterationCount=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield d("WAWebUserPrefsScreenLock").getScreenLockIterations());(!d("WAWebUserPrefsScreenLock").getScreenLockEnabled()||a==null)&&(a=this.calculatePBKDF2Iterations(),yield d("WAWebUserPrefsScreenLock").setScreenLockIterations(a));return a});function c(){return a.apply(this,arguments)}return c}();return a}();a=new f();g.deviceInfo=e;g.waNoiseInfo=a}),98); __d("WAWebDirectConnectionGatingUtils",["WALogger","WAWebABProps","WAWebBusinessProfileCollection","WAWebBusinessProfileVersioningBridge","WAWebMsgType","WAWebProtobufsE2E.pb","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[direct-connection] This web client cannot detect if the product list message recevied is coming from a direct connection business"]);h=function(){return a};return a}function i(){return(d("WAWebBusinessProfileVersioningBridge").getBusinessProfileQueryVersion()&d("WAWebBusinessProfileVersioningBridge").DIRECT_CONNECTION_FLAG)>0}function j(){return!d("WAWebABProps").getABPropConfigValue("web_abprop_direct_connection_md")}function k(a,b){return a===d("WAWebMsgType").MSG_TYPE.LIST&&b===d("WAWebProtobufsE2E.pb").Message$ListMessage$ListType.PRODUCT_LIST}function l(){return d("WAWebABProps").getABPropConfigValue("web_abprop_direct_connection_md")}function a(){return d("WAWebABProps").getABPropConfigValue("web_abprop_direct_connection_md")}function c(){var a=d("WAWebABProps").getABPropConfigValue("direct_connection_business_numbers");return typeof a==="string"&&a.length>0?a.split(","):[]}function m(a,b,c){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){if(j()||!k(a,b)||!c)return!1;if(!i()){d("WALogger").WARN(h());return"unknown"}a=d("WAWebWidFactory").createWid(c);b=d("WAWebBusinessProfileCollection").BusinessProfileCollection.get(a);(!b||!b.profileOptions)&&(b=(yield d("WAWebBusinessProfileCollection").BusinessProfileCollection.find(a)));return b.isBusinessDirectConnection()||!1});return n.apply(this,arguments)}function e(a,b,c){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){a=(yield m(a,b,c));return a===!0&&!l()?{requiresDirectConnection:a,type:d("WAWebMsgType").MSG_TYPE.UNKNOWN,subtype:"phone_only_feature"}:{requiresDirectConnection:a}});return o.apply(this,arguments)}g.supportsDirectConnection=l;g.enablePostcodeInCatalog=a;g.directConnectionBusinessNumbersFromAbprop=c;g.genDirectConnectionMessageModifiers=e}),98); __d("WAWebEmojiDownloadSuggestions",["JSResource","Promise","WAWebL10nGetRenderedLocale","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function a(){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){try{var a=new Set(["en_GB",d("WAWebL10nGetRenderedLocale").WAWebL10nGetRenderedLocale()]);a=(yield (h||(h=b("Promise"))).all(Array.from(a).map(j)));return a.filter(Boolean)}catch(a){return[]}});return i.apply(this,arguments)}function j(a){switch(a){case"en_GB":case"en_IN":case"en_OP":case"en_PI":case"en_UD":case"en_US":case"en_XA":return c("JSResource")("WAWebLocalesEmojiSuggestionEn").__setRef("WAWebEmojiDownloadSuggestions").load();case"pt_BR":case"pt_PT":return c("JSResource")("WAWebLocalesEmojiSuggestionPt").__setRef("WAWebEmojiDownloadSuggestions").load();case"de_DE":return c("JSResource")("WAWebLocalesEmojiSuggestionDe").__setRef("WAWebEmojiDownloadSuggestions").load();case"es_CL":case"es_CO":case"es_ES":case"es_LA":case"es_MX":case"es_VE":return c("JSResource")("WAWebLocalesEmojiSuggestionEs").__setRef("WAWebEmojiDownloadSuggestions").load();case"it_IT":return c("JSResource")("WAWebLocalesEmojiSuggestionIt").__setRef("WAWebEmojiDownloadSuggestions").load();case"ru_RU":return c("JSResource")("WAWebLocalesEmojiSuggestionRu").__setRef("WAWebEmojiDownloadSuggestions").load();case"ar_AR":return c("JSResource")("WAWebLocalesEmojiSuggestionAr").__setRef("WAWebEmojiDownloadSuggestions").load();case"tr_TR":return c("JSResource")("WAWebLocalesEmojiSuggestionTr").__setRef("WAWebEmojiDownloadSuggestions").load();case"uk_UA":return c("JSResource")("WAWebLocalesEmojiSuggestionUk").__setRef("WAWebEmojiDownloadSuggestions").load();case"bn_IN":return c("JSResource")("WAWebLocalesEmojiSuggestionBn").__setRef("WAWebEmojiDownloadSuggestions").load();case"hi_IN":case"hi_FB":return c("JSResource")("WAWebLocalesEmojiSuggestionHi").__setRef("WAWebEmojiDownloadSuggestions").load();case"hu_HU":return c("JSResource")("WAWebLocalesEmojiSuggestionHu").__setRef("WAWebEmojiDownloadSuggestions").load();case"ms_MY":return c("JSResource")("WAWebLocalesEmojiSuggestionMs").__setRef("WAWebEmojiDownloadSuggestions").load();case"pl_PL":return c("JSResource")("WAWebLocalesEmojiSuggestionPl").__setRef("WAWebEmojiDownloadSuggestions").load();case"ro_RO":return c("JSResource")("WAWebLocalesEmojiSuggestionRo").__setRef("WAWebEmojiDownloadSuggestions").load();case"th_TH":return c("JSResource")("WAWebLocalesEmojiSuggestionTh").__setRef("WAWebEmojiDownloadSuggestions").load();case"ur_PK":return c("JSResource")("WAWebLocalesEmojiSuggestionUr").__setRef("WAWebEmojiDownloadSuggestions").load();case"id_ID":return c("JSResource")("WAWebLocalesEmojiSuggestionId").__setRef("WAWebEmojiDownloadSuggestions").load();case"fa_IR":return c("JSResource")("WAWebLocalesEmojiSuggestionFa").__setRef("WAWebEmojiDownloadSuggestions").load();case"mr_IN":return c("JSResource")("WAWebLocalesEmojiSuggestionMr").__setRef("WAWebEmojiDownloadSuggestions").load();case"gu_IN":return c("JSResource")("WAWebLocalesEmojiSuggestionGu").__setRef("WAWebEmojiDownloadSuggestions").load();case"fr_FR":case"fr_CA":return c("JSResource")("WAWebLocalesEmojiSuggestionFr").__setRef("WAWebEmojiDownloadSuggestions").load();case"zh_TW":return c("JSResource")("WAWebLocalesEmojiSuggestionZhTw").__setRef("WAWebEmojiDownloadSuggestions").load();case"zh_CN":return c("JSResource")("WAWebLocalesEmojiSuggestionZhCn").__setRef("WAWebEmojiDownloadSuggestions").load();case"zh_HK":return c("JSResource")("WAWebLocalesEmojiSuggestionZhHk").__setRef("WAWebEmojiDownloadSuggestions").load();case"nl_NL":case"nl_BE":return c("JSResource")("WAWebLocalesEmojiSuggestionNl").__setRef("WAWebEmojiDownloadSuggestions").load();case"cs_CZ":return c("JSResource")("WAWebLocalesEmojiSuggestionCs").__setRef("WAWebEmojiDownloadSuggestions").load();case"sk_SK":return c("JSResource")("WAWebLocalesEmojiSuggestionSk").__setRef("WAWebEmojiDownloadSuggestions").load();default:return(h||(h=b("Promise"))).resolve(null)}}g.downloadEmojiSuggestions=a}),98); __d("WAWebEmojiKeywordToUnicode",["WAArraysShallowEqual","WALogger","WAWebEmojiDownloadSuggestions","WAWebEmojiSearch","WAWebEventsWaitForBbEvent","WAWebL10N","WAWebNoop","WAWebStreamModel","asyncToGeneratorRuntime","lodash"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[emoji-trie] subscription to locale_change failed: ",", stack: ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Emoji Trie is not loaded."]);i=function(){return a};return a}var j=null;function a(a){if(j!=null)return d("WAWebEmojiSearch").emojiSearch(a,j);d("WALogger").WARN(i()).sendLogs("Emoji Trie is not loaded");return[]}var k=null,l=[];function m(){o();var a=c("lodash").uniq(["en",c("WAWebL10N").getNormalizedLocale()]);if(c("WAArraysShallowEqual")(l,a))return;l=a;var e=d("WAWebEmojiDownloadSuggestions").downloadEmojiSuggestions().then(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(k!==e)return;j=(yield d("WAWebEmojiSearch").emojiLocaleDictsToTrie(a))});return function(b){return a.apply(this,arguments)}}())["catch"](c("WAWebNoop"))["finally"](function(){if(k!==e)return;k=null});k=e}var n=!1;function o(){if(n)return;try{c("WAWebL10N").on("locale_change",function(){m()})}catch(a){d("WALogger").WARN(h(),a,a.stack).sendLogs("[emoji-trie] subscription to locale_change failed: "+a.message)}void c("WAWebEventsWaitForBbEvent")(d("WAWebStreamModel").Stream,"change:mode",function(){return d("WAWebStreamModel").Stream.mode===d("WAWebStreamModel").StreamMode.MAIN}).then(function(){m()});n=!0}g.emojiKeywordToUnicodeSearch=a;g.updateEmojiTrie=m}),98); __d("WAWebEmojiSearch",["WALogger","WATrie","WAWebEmoji","WAWebRecentEmojiCollection","asyncToGeneratorRuntime","justknobx","once","requireDeferred"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["WAFtsMultiLangTokenizer not loaded"]);h=function(){return a};return a}var i=c("requireDeferred")("WAFtsMultiLangTokenizer").__setRef("WAWebEmojiSearch"),j=["\ud83d\ude02","\ud83e\udd23","\u2764","\ud83e\udd7a","\ud83e\udd70","\ud83d\ude18","\ud83d\ude2d","\ud83d\ude0d","\ud83d\ude01","\ud83d\ude4f","\ud83d\ude05","\ud83d\ude06","\ud83d\ude0a","\ud83d\ude42","\ud83d\ude14","\ud83e\udd73","\ud83d\ude12","\u263a","\ud83c\udf82","\ud83d\udc4d","\ud83d\udc96","\ud83d\ude22","\ud83d\ude44","\ud83d\ude0f","\ud83d\ude0e","\ud83d\udc8b","\ud83d\ude1e","\ud83d\ude09","\ud83d\udc4f","\ud83d\ude43","\ud83d\ude21","\ud83d\ude00","\ud83d\ude04","\ud83d\ude07","\ud83e\udd29","\ud83d\ude0c","\ud83e\udd14","\ud83c\udf39","\ud83d\ude0b","\ud83d\udc97","\ud83e\udd17","\ud83d\udc95","\ud83d\udc94","\ud83d\ude1a","\u2639","\ud83d\ude03","\ud83c\udf89","\ud83d\udd25","\ud83e\udd74","\ud83d\ude33"],k=["SMILEYS_PEOPLE","ANIMALS_NATURE","FOOD_DRINK","ACTIVITY","TRAVEL_PLACES","OBJECTS","SYMBOLS","FLAGS","VARIATION"];function a(a,b){var c=[];if(a){a=n(a.toLowerCase(),b);c=Array.from(new Set(a))}return c}function l(a,b){if(!b)return[];if(a.length<=5)return b.getMatches(a);var c=a.substring(0,5).trim();b=b.getMatches(c);b=b.filter(function(b){return b.keyword.startsWith(a)});return b}function m(a){return a.map(d("WAWebEmoji").EmojiUtil.normalizeEmoji).filter(Boolean)}function n(a,b){var e,f=i.getModuleIfRequireable();!f?d("WALogger").WARN(h()).sendLogs("WAFtsMultiLangTokenizer not loaded"):e=new f();var g;if(e&&c("justknobx")._("2148")){f=Array.from(e.tokenize(a));f=f.map(function(a){return l(a,b)});f.length===0?g=[]:f.length===1?g=f[0]:g=f.reduce(function(a,b){return a.filter(function(a){return b.map(function(a){return a.value}).includes(a.value)})},f[0])}else g=l(a,b);f=m(g.flatMap(function(a){return a.value}));g=m(g.filter(function(b){return b.keyword===a}).flatMap(function(a){return a.value}));var k=s(m(d("WAWebRecentEmojiCollection").RecentEmojiCollection.map(function(a){return a.id})),f),n=s(m(j),f),o=s(t(k,n),g);return t(o,p(g),k,n,p(f))}var o=c("once")(function(){var a=new Map(),b=0;for(var c of k){var e=d("WAWebEmoji").EmojiUtil.getEmojisInCategory(c);for(e of e)a.set(e,b),b++}return a});function p(a){var b=o();return a.toSorted(function(a,c){a=(a=b.get(a))!=null?a:Number.MAX_SAFE_INTEGER;c=(c=b.get(c))!=null?c:Number.MAX_SAFE_INTEGER;return a-c})}function e(a){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a[0];a.length>1&&(b=babelHelpers["extends"]({},b,a[1]));a=(yield i.load());var d=new a();c("justknobx")._("2148")?a=Object.entries(b).flatMap(function(a){var b=a[0],c=a[1];a=b.toLowerCase();b=Array.from(d.tokenize(a));return b.map(function(a){return{value:c,keyword:a,shortKeyword:a.substring(0,5)}})}):a=Object.entries(b).flatMap(function(a){var b=a[0];a=a[1];b=b.toLowerCase();var c=b.substring(0,5);return{value:a,keyword:b,shortKeyword:c}});return r(a,"shortKeyword")});return q.apply(this,arguments)}function r(a,b){var d=c("WATrie").fromForwardsStrings(a.map(function(a){return a[b]}),a);return{getMatches:function(a){return d.search(a)}}}function s(){for(var a=arguments.length,b=new Array(a),c=0;c<a;c++)b[c]=arguments[c];if(b.length===0)return[];return b.length===1?b[0]:b.reduce(function(a,b){return a.filter(function(a){return b.includes(a)})},b[0])}function t(){for(var a=arguments.length,b=new Array(a),c=0;c<a;c++)b[c]=arguments[c];return Array.from(new Set(b.flat(1)))}g.emojiSearch=a;g.emojiLocaleDictsToTrie=e}),98); __d("WAWebBrowserApi",[],(function(a,b,c,d,e,f){function a(){var a;a=(a=self.navigator)==null?void 0:a.deviceMemory;return a==null?a:a*1e3}function b(){var a;return(a=self.navigator)==null?void 0:a.hardwareConcurrency}f.getMemClass=a;f.getNumCpu=b}),66); __d("privateStatsToken",["Promise","WAACSTokenUtils","WADeprecatedSendIq","WADeprecatedWapParser","WAErrors","WALogger","WAPromiseRetryLoop","WATimeUtils","WAWamPrivateStatsToken","WAWamStorage","WAWap"],(function(a,b,c,d,e,f,g){"use strict";var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["issuePrivateStatsToken: Disconnected"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["issuePrivateStatsToken: failed to unblind the signed token"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["issuePrivateStatsToken: failed ",""]);k=function(){return a};return a}var l=3,m=new(c("WADeprecatedWapParser"))("issuePrivateStatsToken",function(a){a=a.child("sign_credential");var b=a.child("signed_credential");b=b.contentBytes();a=a.child("acs_public_key");a=a.contentBytes();return{signedCredential:b,acsPublicKey:a}});function n(a){switch(a.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"}}function o(a){var c=d("WATimeUtils").monotonicTime(),e={overallStartTime:c,retryStartTime:c,retryAttemptsLeft:l};c=d("WAACSTokenUtils").getBlindedToken();var f=c.token,g=c.blindedToken,o=c.blindingFactor;c=function(c){e.retryAttemptsLeft<l&&(e.retryStartTime=d("WATimeUtils").monotonicTime());var p=d("WAWap").wap("iq",{id:d("WAWap").generateId(),to:d("WAWap").S_WHATSAPP_NET,type:"get",xmlns:"privatestats"},d("WAWap").wap("sign_credential",{version:"1"},d("WAWap").wap("blinded_credential",null,g))),q=a||d("WADeprecatedSendIq").deprecatedSendIqWithoutRetry;return q(p,m).then(function(a){if(!a.success){var b=n(a);d("WALogger").WARN(k(),b);b!=="internal-server-error"||e.retryAttemptsLeft<=0?c({result:null,metric:babelHelpers["extends"]({},e,{result:b})}):e.retryAttemptsLeft--;return}b=a.result;a=b.signedCredential;b=b.acsPublicKey;a=d("WAWamPrivateStatsToken").unblindToken(a,o,b);if(a==null){d("WALogger").WARN(j());c({result:null,metric:babelHelpers["extends"]({},e,{result:"decryption-error"})});return}c({result:{token:f,sharedSecret:d("WAACSTokenUtils").getSharedSecret({token:f,unblindedSignedToken:a})},metric:babelHelpers["extends"]({},e,{result:"success"})})})["catch"](function(a){if(a instanceof d("WAErrors").Disconnected)d("WALogger").WARN(i()),e.retryAttemptsLeft<=0?c({result:null,metric:babelHelpers["extends"]({},e,{result:"disconnected"})}):e.retryAttemptsLeft--;else return(h||(h=b("Promise"))).reject(a)})};c=new(d("WAPromiseRetryLoop").PromiseRetryLoop)({name:"issuePrivateStatsToken",timer:{algo:{type:"exponential",first:250},max:1e3},code:c});c.start();return c.promise()}function a(a){return d("WAWamStorage").redeemPrivateStatsToken().then(function(b){return b?{result:b}:o(a).then(function(a){var b=babelHelpers["extends"]({},a);a=a.result;return a?d("WAWamStorage").savePrivateStatsToken(a).then(function(){return b}):b})})}g.issuePrivateStatsToken=o;g.getToken=a}),98); __d("WAWebIssuePrivateStatsToken",["WADeprecatedSendIq","WALogger","WASemaphore","WATimeUtils","WAWebSignCredentialWamEvent","WAWebWamEnumApplicationState","WAWebWamEnumSignCredentialResult","asyncToGeneratorRuntime","privateStatsToken"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Couldn't get a private stats token"]);h=function(){return a};return a}var i=3;function j(a){switch(a){case"success":return d("WAWebWamEnumSignCredentialResult").SIGN_CREDENTIAL_RESULT.SUCCESS;case"bad-request":return d("WAWebWamEnumSignCredentialResult").SIGN_CREDENTIAL_RESULT.ERROR_BAD_REQUEST;case"internal-server-error":return d("WAWebWamEnumSignCredentialResult").SIGN_CREDENTIAL_RESULT.ERROR_SERVER;case"disconnected":return d("WAWebWamEnumSignCredentialResult").SIGN_CREDENTIAL_RESULT.ERROR_CLIENT_NETWORK;default:a;return d("WAWebWamEnumSignCredentialResult").SIGN_CREDENTIAL_RESULT.ERROR_OTHER}}function k(a){var b=a.result,c=a.overallStartTime,e=a.retryStartTime;a=a.retryAttemptsLeft;var f=j(b);new(d("WAWebSignCredentialWamEvent").SignCredentialWamEvent)({signCredentialResult:f,overallT:d("WATimeUtils").monotonicTimeSince(c),signCredentialT:d("WATimeUtils").monotonicTimeSince(e),retryCount:i-a,waConnectedToChatd:b!=="disconnected",applicationState:document.visibilityState==="visible"?d("WAWebWamEnumApplicationState").APPLICATION_STATE.FOREGROUND:d("WAWebWamEnumApplicationState").APPLICATION_STATE.BACKGROUND}).commit()}var l=new(d("WASemaphore").Semaphore)(1);function a(){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield l.acquire());try{var b=(yield d("privateStatsToken").getToken(d("WADeprecatedSendIq").deprecatedSendIqWithoutRetry)),c=b.result;b=b.metric;b!=null&&k(b);c||d("WALogger").WARN(h());return c}finally{a.release()}});return m.apply(this,arguments)}g.getToken=a}),98); __d("privateStatsUpload",["Promise","WABase64","WACryptoHmac","WALogger","WAPromiseRetryLoop","WATimeUtils","WAWamStorage","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Unsupported code value in the error response 400 from PrivateStats upload request: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Unsupported subcode value in the error response 400 from PrivateStats upload request: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["Incorrect code or subcode in the error response 400 from PrivateStats upload request"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["Incorrect or missing error entry in the error response 400 from PrivateStats upload request"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["Unable to parse error response 400 from PrivateStats upload request or parsed response is not an object"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["Unsupported response status code from PrivateStats upload request: ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["Try to submit metrics without being connected to the VPN. The PrivateStats endpoint seems to reject VPN originating connections at the CORS check level"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["Upload of a private stats buffer failed: ",""]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["Couldn't get token to submit a private stats buffer"]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["Removing private stats buffer without submitting it (kill switch)"]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["Ran out of available retries for a private stats buffer submission"]);s=function(){return a};return a}var t="https://dit.whatsapp.net/deidentified_telemetry",u="245118376424571|3e7d275052f1522bf3200afcf53841a7",v=0,w="WAMEventBuffer.dat",x=3,y=9,z=111e3,A=3067002,B=3067003,C=3067004;function D(a){return{result:a.result,httpResponseCode:a.httpResponseCode,uploadTime:d("WATimeUtils").monotonicTimeSince(a.uploadStartTime)}}function E(a,b,c,d){return F.apply(this,arguments)}function F(){F=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e,f){if((yield d("WAWamStorage").privateStatsKillSwitchGetBlockedToken())===u){d("WALogger").LOG(r());return d("WAWamStorage").removeBufferByKey(e.key).then(function(){a()})}var g=d("WATimeUtils").monotonicTime();f=(yield f());if(f==null){d("WALogger").ERROR(q());a();return}var i=new FormData();i.append("access_token",u);var j=(yield d("WACryptoHmac").hmacSha256(f.sharedSecret,e.content));f=d("WABase64").encodeB64UrlSafe(f.token,!0);j=d("WABase64").encodeB64UrlSafe(j,!0);f=f+"+"+j;i.append("credential",f);i.append("message",new Blob([e.content],{type:"application/octet-stream"}),w);i.append("meta_data",JSON.stringify({t:d("WATimeUtils").unixTime(),p:v}));j={method:"POST",body:i,"Content-Type":"multipart/form-data"};var k;try{k=(yield fetch(t,j))}catch(a){d("WALogger").WARN(p(),a);d("WALogger").DEV(o());c({uploadStartTime:g,result:"error-other"});return}var l=k.status,m=function(b){a({uploadStartTime:g,httpResponseCode:l,result:b})};f=function(a){c({uploadStartTime:g,httpResponseCode:l,result:a})};switch(l){case 200:return d("WAWamStorage").removeBufferByKey(e.key).then(function(){m("success")});case 429:m("error-server-other");return;case 401:return(h||(h=b("Promise"))).all([d("WAWamStorage").privateStatsKillSwitchSet(u),d("WAWamStorage").removeBufferByKey(e.key)]).then(function(){m("error-access-token")});case 400:i=(yield G(k));j=i.result;e=i.shouldRetry;i={uploadStartTime:g,httpResponseCode:l,result:j};e==="retry"?c(i):a(i);return;case 500:f("error-server-other");return}d("WALogger").WARN(n(),l);f("error-other");return});return F.apply(this,arguments)}function G(a){return H.apply(this,arguments)}function H(){H=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield a.json()["catch"](function(){}));if(typeof a!=="object"){d("WALogger").WARN(m());return{result:"error-other",shouldRetry:"retry"}}a=a.error;if(typeof a!=="object"){d("WALogger").WARN(l());return{result:"error-other",shouldRetry:"retry"}}var b=a.code;a=a.error_subcode;if(typeof b!=="number"||typeof a!=="number"){d("WALogger").WARN(k());return{result:"error-other",shouldRetry:"retry"}}switch(b){case y:return{result:"error-server-other",shouldRetry:"no-retry"};case z:switch(a){case A:return{result:"error-parsing",shouldRetry:"retry"};case B:return{result:"error-decoding",shouldRetry:"retry"};case C:return{result:"error-credential",shouldRetry:"retry"};default:d("WALogger").WARN(j(),a);return{result:"error-other",shouldRetry:"retry"}}default:d("WALogger").WARN(i(),b);return{result:"error-other",shouldRetry:"retry"}}});return H.apply(this,arguments)}function I(a,c){a=a.map(function(a){var b=x,e=[],f=new(d("WAPromiseRetryLoop").PromiseRetryLoop)({name:"uploadPrivateStatsBuffer",timer:{algo:{type:"exponential",first:250},max:1e3},code:function(f){return E(f,function(a){a=D(a);e.push(a);b<=0?(d("WALogger").DEV(s()),f()):b--},a,c)}});f.start();return f.promise().then(function(b){if(b!=null){var c=D(b);e.push(c)}return{uploadedBufferKey:(b==null?void 0:b.result)==="success"?a.key:null,metrics:e}})});return(h||(h=b("Promise"))).all(a).then(function(a){var b=a.reduce(function(a,b){a.push.apply(a,b.metrics);return a},[]);a=a.reduce(function(a,b){b.uploadedBufferKey!=null&&a.push(b.uploadedBufferKey);return a},[]);return{uploadedBufferKeys:a,metrics:b}})}function a(a){return d("WAWamStorage").getFinishedStreamBuffers("private").then(function(b){return I(b,a)})}g.upload_UNSAFE_INTERNAL_DO_NOT_USE=I;g.uploadFinishedPrivateStatsBuffers=a}),98); __d("WAWebUploadPrivateStatsBackend",["WABackoffUtils","WABase64","WALogger","WAPromiseDelays","WAPromiseLoop","WAWebIssuePrivateStatsToken","WAWebNetworkStatus","WAWebPsBufferUploadWamEvent","WAWebWamEnumApplicationState","WAWebWamEnumPsBufferUploadResult","asyncToGeneratorRuntime","privateStatsUpload"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[wam] sendLogs retry on error: ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[wam] sendLogs failure error: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[wam] sendLogs success"]);j=function(){return a};return a}function a(a,c){var e=new Uint8Array(d("WABase64").decodeB64(a));return m(c,function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield d("privateStatsUpload").upload_UNSAFE_INTERNAL_DO_NOT_USE([{key:c,content:e}],d("WAWebIssuePrivateStatsToken").getToken)),f=b.uploadedBufferKeys;b=b.metrics;b.map(l);f.length===0&&a(c);d("WALogger").DEV(j());a(void 0)});return function(b){return a.apply(this,arguments)}}())}function k(a){switch(a){case"success":return d("WAWebWamEnumPsBufferUploadResult").PS_BUFFER_UPLOAD_RESULT.SUCCESS;case"error-server-other":return d("WAWebWamEnumPsBufferUploadResult").PS_BUFFER_UPLOAD_RESULT.ERROR_SERVER_OTHER;case"error-parsing":return d("WAWebWamEnumPsBufferUploadResult").PS_BUFFER_UPLOAD_RESULT.ERROR_PARSING;case"error-decoding":return d("WAWebWamEnumPsBufferUploadResult").PS_BUFFER_UPLOAD_RESULT.ERROR_DECODING;case"error-credential":return d("WAWebWamEnumPsBufferUploadResult").PS_BUFFER_UPLOAD_RESULT.ERROR_CREDENTIAL;case"error-other":return d("WAWebWamEnumPsBufferUploadResult").PS_BUFFER_UPLOAD_RESULT.ERROR_OTHER;default:a;return d("WAWebWamEnumPsBufferUploadResult").PS_BUFFER_UPLOAD_RESULT.ERROR_ACCESS_TOKEN}}function l(a){var b=a.result,c=a.uploadTime;a=a.httpResponseCode;b=k(b);new(d("WAWebPsBufferUploadWamEvent").PsBufferUploadWamEvent)({psBufferUploadResult:b,psBufferUploadT:c,psBufferUploadHttpResponseCode:a,applicationState:document.visibilityState==="visible"?d("WAWebWamEnumApplicationState").APPLICATION_STATE.FOREGROUND:d("WAWebWamEnumApplicationState").APPLICATION_STATE.BACKGROUND}).commit()}function m(a,e){return d("WAPromiseLoop").promiseLoop(function(){var f=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b,f,g){f=d("WAPromiseDelays").delayMs(d("WABackoffUtils").expBackoff(g,12e4,1e3,.1));try{yield c("WAWebNetworkStatus").waitIfOffline();return yield e(b)}catch(c){if(g>1){d("WALogger").WARN(i(),String(c)).devConsole(c);return b(a)}d("WALogger").DEV(h(),String(c));return f}});return function(a,b,c){return f.apply(this,arguments)}}())}g["default"]=a}),98); __d("WAWebStatsUploadJob",["Promise","WALogger","WASmaxStatsSendBufferRPC","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["SendBufferResponseErrorRetry: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["SendBufferResponseErrorNoRetry: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["fieldStatsUpload:sendSendBufferRPC SendBufferResponseSuccess"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["fieldStatsUpload:sendSendBufferRPC end"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["fieldStatsUpload:sendSendBufferRPC start"]);m=function(){return a};return a}function a(a,b){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){d("WALogger").LOG(m());c=(yield d("WASmaxStatsSendBufferRPC").sendSendBufferRPC({addT:c,addElementValue:a}));d("WALogger").LOG(l());if(c.name==="SendBufferResponseSuccess"){d("WALogger").LOG(k());return(h||(h=b("Promise"))).resolve()}else c.name==="SendBufferResponseErrorNoRetry"?(a=c.value.errorSendBufferNoRetryError.value,d("WALogger").DEV(j(),a.code)):(c.name,a=c.value.errorIQErrorServiceUnavailableMixin,d("WALogger").DEV(i(),a.code));c=a;a=c.code;c=c.text;return{errorCode:parseInt(a,10),errorText:c}});return n.apply(this,arguments)}g["default"]=a}),98); __d("WAWebUploadStatsBackend",["WABackoffUtils","WABase64","WALogger","WAPromiseDelays","WAPromiseLoop","WATimeUtils","WAWebBackendErrors","WAWebNetworkStatus","WAWebStatsUploadJob","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[wam] sendLogs retry on error: ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[wam] sendLogs failure error: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[wam] sendLogs success"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[wam] sendLogs b64len:",""]);k=function(){return a};return a}function a(a,e){d("WALogger").DEV(k(),a.length);var f=new Uint8Array(d("WABase64").decodeB64(a)),g=d("WATimeUtils").unixTime();return l(e,function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield c("WAWebStatsUploadJob")(f,g));if(b==null?void 0:b.errorCode)if(b.errorCode>=500)throw new(d("WAWebBackendErrors").ServerStatusCodeError)(b.errorCode,b.errorText);else a(e);d("WALogger").DEV(j());a(void 0)});return function(b){return a.apply(this,arguments)}}())}function l(a,e){return d("WAPromiseLoop").promiseLoop(function(){var f=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b,f,g){f=d("WAPromiseDelays").delayMs(d("WABackoffUtils").expBackoff(g,12e4,1e3,.1));try{yield c("WAWebNetworkStatus").waitIfOffline();return yield e(b)}catch(c){if(g>1){d("WALogger").WARN(i(),String(c)).devConsole(c);return b(a)}d("WALogger").DEV(h(),String(c));return f}});return function(a,b,c){return f.apply(this,arguments)}}())}g["default"]=a}),98); __d("WAWebWamClientErrorsWamEvent",["WAWebWamCodegenUtils"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({WamClientErrors:[1144,{isFromWamsys:[27,a.TYPES.BOOLEAN],wamClientBufferDropErrorCount:[28,a.TYPES.INTEGER],wamClientBufferFetchErrorCount:[29,a.TYPES.INTEGER],wamClientBufferRotateErrorCount:[43,a.TYPES.INTEGER],wamClientBufferStoreErrorCount:[30,a.TYPES.INTEGER],wamClientCorruptedBuffersCount:[42,a.TYPES.INTEGER],wamClientDroppedEventCount:[2,a.TYPES.INTEGER],wamClientDroppedEventCountNoEnoughStorage:[41,a.TYPES.INTEGER],wamClientDroppedEventSize:[3,a.TYPES.INTEGER],wamClientErrorFlags:[1,a.TYPES.BOOLEAN],wamClientMetadataReadErrorCount:[37,a.TYPES.INTEGER],wamClientMetadataWriteErrorCount:[38,a.TYPES.INTEGER],wamClientPrivateDroppedEventCount:[24,a.TYPES.INTEGER],wamClientPrivateDroppedEventSize:[25,a.TYPES.INTEGER],wamClientPrivateRealtimeDroppedEventCount:[34,a.TYPES.INTEGER],wamClientPrivateRealtimeDroppedEventSize:[35,a.TYPES.INTEGER],wamClientPrivateRealtimeRejectedEventCount:[36,a.TYPES.INTEGER],wamClientPrivateRejectedEventCount:[31,a.TYPES.INTEGER],wamClientRealtimeDroppedEventCount:[22,a.TYPES.INTEGER],wamClientRealtimeDroppedEventSize:[23,a.TYPES.INTEGER],wamClientRealtimeRejectedEventCount:[32,a.TYPES.INTEGER],wamClientRejectedEventCount:[33,a.TYPES.INTEGER],wamErrorBadCurrentEventBufferChecksum:[18,a.TYPES.BOOLEAN],wamErrorBadEventBuffer:[16,a.TYPES.BOOLEAN],wamErrorBadFileHeader:[15,a.TYPES.BOOLEAN],wamErrorBadFileSize:[8,a.TYPES.BOOLEAN],wamErrorBadHeaderChecksum:[17,a.TYPES.BOOLEAN],wamErrorBadRotatedEventBufferChecksum:[19,a.TYPES.BOOLEAN],wamErrorCloseFile:[11,a.TYPES.BOOLEAN],wamErrorCreateWamFile:[14,a.TYPES.BOOLEAN],wamErrorFseekFile:[9,a.TYPES.BOOLEAN],wamErrorOpenFile:[10,a.TYPES.BOOLEAN],wamErrorOpenPsUploadQueueFile:[26,a.TYPES.BOOLEAN],wamErrorOpenWamFile:[13,a.TYPES.BOOLEAN],wamErrorPersistence:[20,a.TYPES.BOOLEAN],wamErrorReadFile:[7,a.TYPES.BOOLEAN],wamErrorRemoveFile:[12,a.TYPES.BOOLEAN],wamErrorWriteEventBuffer:[6,a.TYPES.BOOLEAN],wamErrorWriteFile:[4,a.TYPES.BOOLEAN],wamErrorWriteHeader:[5,a.TYPES.BOOLEAN],wamFirstErrorReadMetadata:[39,a.TYPES.BOOLEAN],wamFirstErrorWriteMetadata:[40,a.TYPES.BOOLEAN]},[1,1,1],"regular"]},{WamClientErrors:[]});g.WamClientErrorsWamEvent=b}),98); __d("WAWebWamPrivateStats",["Promise","WALogger","WARandomHex","WAResolvable","WATimeUtils","WAWebWamEnumPsIdAction","WAWebWamGlobals","WAWebWamStorage","WAWebWamUtils","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["error while rotating PS ids ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["error while rotating PS id for key ",""]);j=function(){return a};return a}var k={},l={},m={};d("WAWebWamGlobals").PrivateStatsAllIds.map(function(a){k[a.keyHashInt]=a.key,l[a.key]=a.keyHashInt,m[a.key]={value:a.keyHashInt,rotationPeriodDays:a.rotationPeriodDays}});k[0]="none";l.none=0;m.none={value:"none",rotationPeriodDays:-1};var n=null;function a(){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(n!=null)return n.promise;var a=new(d("WAResolvable").Resolvable)();n=a;var b=[],e=(yield c("WAWebWamStorage").getPsMeta()),f=new Set();e.map(function(a){f.add(a.key),m[a.key]===void 0?b.push(a.key):m[a.key].value=a.value});e=Object.keys(m).filter(function(a){return!f.has(a)}).map(function(a){a!=="none"&&(m[a].value=d("WARandomHex").randomHex(16));return{key:a,value:m[a].value,rotateInDays:m[a].rotationPeriodDays,creationTs:d("WATimeUtils").unixTime()}});yield c("WAWebWamStorage").addPsMeta(e);yield c("WAWebWamStorage").removePsMeta(b);e.map(function(a){return d("WAWebWamUtils").logPsIdUpdate(d("WAWebWamEnumPsIdAction").PS_ID_ACTION.CREATED,l[a.key],a.rotateInDays)});b.map(function(a){return d("WAWebWamUtils").logPsIdUpdate(d("WAWebWamEnumPsIdAction").PS_ID_ACTION.DELETED,l[a],m[a].rotationPeriodDays)});a.resolve()});return o.apply(this,arguments)}function e(){var a=new Map();d("WAWebWamGlobals").PrivateStatsAllIds.forEach(function(b){a.set(b.keyHashInt,String(m[b.key].value))});return a}function f(a){if(n==null)throw c("err")("can't call getPrivateStatsKeyFromInt without initializing");return k[a]}function p(a){if(a==="regular")throw c("err")("tried to get psId for regular channel event");if(n==null)throw c("err")("can't call getLatestPrivateStatsIdValueFromKey without initializing");return m[a].value}function q(){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=[];if(n==null)throw c("err")("can't call maybeRotatePsIds without initializing");try{yield n.promise;var e=(yield c("WAWebWamStorage").getPsMeta());yield (h||(h=b("Promise"))).all(e.map(function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){try{var c=b.key,e=b.rotateInDays,f=b.creationTs;u(f,e)&&(a.push(c),yield s(c))}catch(a){d("WALogger").WARN(j(),b.key)}});return function(a){return c.apply(this,arguments)}}()))}catch(a){d("WALogger").WARN(i(),a)}return a});return r.apply(this,arguments)}function s(a){return t.apply(this,arguments)}function t(){t=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=d("WARandomHex").randomHex(16);m[a].value=b;yield c("WAWebWamStorage").updatePsMeta({key:a,rotateInDays:m[a].rotationPeriodDays,value:b,creationTs:d("WATimeUtils").unixTime()});d("WAWebWamUtils").logPsIdUpdate(d("WAWebWamEnumPsIdAction").PS_ID_ACTION.ROTATED,l[a],m[a].rotationPeriodDays)});return t.apply(this,arguments)}function u(a,b){if(b===-1||a==null)return!1;b=b*d("WATimeUtils").DAY_SECONDS;b=Math.floor(d("WATimeUtils").unixTime()/b)*b;return a<b}g.initPrivateStats=a;g.getPrivateStatsIdsForCoreWam=e;g.getPrivateStatsKeyFromInt=f;g.getLatestPrivateStatsIdValueFromKey=p;g.maybeRotatePsIds=q}),98); __d("WAWebWamInterop",["Promise","WACustomError","WATimeUtils","WAWamStorage","WAWebUserPrefsGeneral","WAWebWamPrivateStats","WAWebWamStorage","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h,i=function(a,c){return(h||(h=b("Promise"))).reject(new(d("WACustomError").UnimplementedMethod)("saveBuffer not implemented yet"))},j=function(a){return(h||(h=b("Promise"))).resolve()},k=function(a){return(h||(h=b("Promise"))).reject(new(d("WACustomError").UnimplementedMethod)("getStartingSequenceRow not implemented yet"))},l=function(){return(h||(h=b("Promise"))).reject(new(d("WACustomError").UnimplementedMethod)("getBuffers not implemented yet"))},m=function(){return(h||(h=b("Promise"))).reject(new(d("WACustomError").UnimplementedMethod)("nukeMetrics not implemented yet"))},n=function(a){return(h||(h=b("Promise"))).reject(new(d("WACustomError").UnimplementedMethod)("finishBuffer not implemented yet"))},o=function(){return(h||(h=b("Promise"))).reject(new(d("WACustomError").UnimplementedMethod)("updatePrivateStatsIds not implemented yet"))},p=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var d=(yield c("WAWebWamStorage").getPsToken());if(!d)return null;return!a({redeemCount:d.redeemCount,creationTs:d.creationTs},{maxExpirySeconds:86400})?(h||(h=b("Promise"))).resolve(null):c("WAWebWamStorage").savePsToken(babelHelpers["extends"]({},d,{redeemCount:d.redeemCount+1})).then(function(){return d.token})});return function(b){return a.apply(this,arguments)}}();function a(a){return c("WAWebWamStorage").savePsToken({key:"token",token:a,creationTs:d("WATimeUtils").unixTime(),redeemCount:1})}function e(){return(h||(h=b("Promise"))).resolve(d("WAWebUserPrefsGeneral").getPsKillSwitchToken())}function f(a){d("WAWebUserPrefsGeneral").setPsKillSwitchToken(a);return(h||(h=b("Promise"))).resolve()}var q={getStreamId:function(){return 1},saveBuffer:i,finishBuffer:n,getStartingSequenceRow:k,getBuffers:l,removeBufferByKey:j,nukeMetrics:m,updatePrivateStatsIds:o,redeemPrivateStatsToken:p,savePrivateStatsToken:a,privateStatsKillSwitchGetBlockedToken:e,privateStatsKillSwitchSet:f};function r(){d("WAWamStorage").startWamStorage(q)}g.startWamStore=r}),98); __d("WAWebWamBeaconing",["WATimeUtils","WAWebUserPrefsGeneral"],(function(a,b,c,d,e,f,g){"use strict";function a(a){var b=d("WAWebUserPrefsGeneral").getWamBeaconingSettings(),c=b.find(function(b){return b.key===a}),e=null;if(c==null||h(c.ts)){var f=d("WATimeUtils").unixTime(),g=Math.random()<=.01;g={key:a,ts:f,value:g?1:null};c==null?b.push(g):(c.value=g.value,c.ts=f);e=g.value}else if(c.value==null)return null;else e=++c.value;d("WAWebUserPrefsGeneral").setWamBeaconingSettings(b);return e}function h(a){var b=Math.floor(d("WATimeUtils").unixTime()/d("WATimeUtils").DAY_SECONDS);a=Math.floor(a/d("WATimeUtils").DAY_SECONDS);return b!==a}g.maybeGetEventSequenceNumber=a}),98); __d("WAWebWamLibProtocol",["WABinary"],(function(a,b,c,d,e,f,g){var h=8,i=0,j=1,k=2,l=4;function a(a,b,c){return m(a,b,c,i)}function b(a,b,c,d){d=d?j:j|l;return m(a,b,c,d)}function c(a,b,c,d){d=d?k:k|l;return m(a,b,c,d)}function m(a,b,c,e){if(c==null)e===i&&n(a,b,e);else if(typeof c==="number"&&c===(c|0))c===0?n(a,b,e|1<<4):c===1?n(a,b,e|2<<4):-128<=c&&c<128?(n(a,b,e|3<<4),a.writeInt8(c)):-32768<=c&&c<32768?(n(a,b,e|4<<4),a.writeInt16(c)):(n(a,b,e|5<<4),a.writeInt32(c));else if(typeof c==="number")n(a,b,e|7<<4),a.writeFloat64(c);else if(typeof c==="string"){var f=d("WABinary").numUtf8Bytes(c);f<256?(n(a,b,e|8<<4),a.writeUint8(f)):f<65536?(n(a,b,e|9<<4),a.writeUint16(f)):(n(a,b,e|10<<4),a.writeUint32(f));a.writeString(c)}}function n(a,b,c){b<256?(a.writeUint8(c),a.writeUint8(b)):(a.writeUint8(c|h),a.writeUint16(b))}g.writeGlobalAttribute=a;g.writeEvent=b;g.writeField=c}),98); __d("WAWebWamLibContext",["WABase64","WABinary","WALogger","WAWebEventSampling","WAWebWamBeaconing","WAWebWamCodegenUtils","WAWebWamConstants","WAWebWamLibProtocol","WAWebWamPrivateStats"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[wam] invalid value for timer field ",".",""]);h=function(){return a};return a}var i=47,j=3433,k=6005,l=0,m=2,n=2147483647;a=function(){function a(a,b,c){this.bufferKey=a,this.buffer=new(d("WABinary").Binary)(void 0,!0),this.buffer.writeString("WAM"),this.buffer.writeUint8(d("WAWebWamConstants").WAM_PROTOCOL_VERSION),this.buffer.writeUint8(1),this.buffer.writeUint16(b),this.bufferKey==="regular"?this.buffer.writeUint8(l):this.buffer.writeUint8(m),this.eventsWritten=0,this.prevGlobals={},this.dirtyGlobals={},this.unsavedPortion=null,this.saveKey=String(Math.random()*1e9|0),this.$1(c)}var b=a.prototype;b.size=function(){return this.buffer.size()};b.set=function(a,b){this.dirtyGlobals[String(a)]=b,this.unsavedPortion&&this.unsavedPortion.set(a,b)};b.write=function(a){var b=this.buffer;this.set(i,a.commitTime);var c=d("WAWebWamBeaconing").maybeGetEventSequenceNumber(this.bufferKey);c!=null&&this.set(j,c);a.wamChannel==="private"&&this.set(k,d("WAWebWamPrivateStats").getLatestPrivateStatsIdValueFromKey(this.bufferKey).toString());this.$2();c=a.all;var e=Object.keys(c),f=-1,g=!1;for(var l=0;l<e.length;l++){var m=c[e[l]];m!=null&&(f=l,g=!0)}l=(m=d("WAWebEventSampling").getClientEventSamplingWeight(a.id))!=null?m:a.weight;d("WAWebWamLibProtocol").writeEvent(b,a.id,-l,g);for(m=0;m<=f;m++){l=e[m];var o=d("WAWebWamCodegenUtils").metrics.getEvent(a.$className,l),p=o.id;o=o.type;var q=c[l];if(q==null)continue;typeof q==="boolean"&&(q=q?1:0);g=m<f;if(o==="timer"&&q>n){d("WALogger").ERROR(h(),a.$className,l).sendLogs("wam-event-validation-error");continue}d("WAWebWamLibProtocol").writeField(b,p,q,g)}this.eventsWritten++;this.unsavedPortion&&this.unsavedPortion.write(a)};b.stringBuffer=function(){return this.eventsWritten>0?d("WABase64").encodeB64(this.buffer.peek(function(a){return a.readByteArray()})):""};b.getBuffer=function(){return this.buffer};b.$1=function(a){var b=this.bufferKey==="regular"?"regular":"private";for(var c in a){var e=a[c],f=d("WAWebWamCodegenUtils").metrics.getGlobal(c);f=f.channels.includes(b);e!==void 0&&f&&this.set(d("WAWebWamCodegenUtils").metrics.getGlobal(c).id,e)}};b.$2=function(){var a=this.dirtyGlobals,b=this.prevGlobals;for(var c in a){var e=a[c];if(typeof e==="boolean")e=e?1:0;else if(e===void 0)e=null;else if(Number.isNaN(e))continue;if(e!==b[c]||c===String(i)||c===String(k)){b[c]=e;var f=parseInt(c,10);d("WAWebWamLibProtocol").writeGlobalAttribute(this.buffer,f,e)}}this.dirtyGlobals={}};return a}();g.WamContext=a}),98); __d("WAWebWam",["Promise","SiteData","WALogger","WANullthrows","WAResolvable","WAShiftTimer","WATimeUtils","WAWebABProps","WAWebABPropsLocalStorage","WAWebBrowserApi","WAWebBuildConstants","WAWebCrashlog","WAWebEventSampling","WAWebIsOfficialClient","WAWebMiscBrowserUtils","WAWebUploadPrivateStatsBackend","WAWebUploadStatsBackend","WAWebUserPrefsIsLoggedIn","WAWebUserPrefsTabMutex","WAWebWamClientErrorsWamEvent","WAWebWamConstants","WAWebWamEnumDeviceClassification","WAWebWamEnumPlatformType","WAWebWamEnumWebcWebPlatformType","WAWebWamGlobals","WAWebWamInterop","WAWebWamLibContext","WAWebWamPlatform","WAWebWamPrivateStats","WAWebWamRuntimeProvider","WAWebWamStorage","WAWebWamUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["sendLogs: uploadStats"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["sendLogs: uploadPrivateStats"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["wam dropped "," buffers! ("," bytes)"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["sendAllLogs: process failures success bufferKey ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["sendAllLogs: adding to WamStorage failed"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["sendAllLogs: process failures start bufferKey ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["sendAllLogs: sendLogs success"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["sendAllLogs: sendLogs start"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["[wam] sendAllLogs failed to read because ",""]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["[wam] save WamStorage failed to save ",""]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["[wam] save successfully saved new entry ",""]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["[wam] saveCurrentContext no unsavedPortion WamStorage.update end"]);t=function(){return a};return a}function u(){var a=babelHelpers.taggedTemplateLiteralLoose(["[wam] saveCurrentContext no unsavedPortion WamStorage.update start"]);u=function(){return a};return a}function v(){var a=babelHelpers.taggedTemplateLiteralLoose(["[wam] save other tab claimed buffer, cutting head"]);v=function(){return a};return a}function w(){var a=babelHelpers.taggedTemplateLiteralLoose(["[wam] save successfully updated ",""]);w=function(){return a};return a}function x(){var a=babelHelpers.taggedTemplateLiteralLoose(["[wam] saveCurrentContext has unsavedPortion WamStorage.update end"]);x=function(){return a};return a}function y(){var a=babelHelpers.taggedTemplateLiteralLoose(["[wam] saveCurrentContext has unsavedPortion WamStorage.update start"]);y=function(){return a};return a}function z(){var a=babelHelpers.taggedTemplateLiteralLoose(["[wam] _executePending error ",""]);z=function(){return a};return a}function A(){var a=babelHelpers.taggedTemplateLiteralLoose(["[wam] _executePending abandoned current buffer"]);A=function(){return a};return a}function B(){var a=babelHelpers.taggedTemplateLiteralLoose(["[wam] _executePending wam unauthed, didn't send"]);B=function(){return a};return a}function C(){var a=babelHelpers.taggedTemplateLiteralLoose(["[wam] _executePendingForContext drop the rest due to size limit: "," > ",""]);C=function(){return a};return a}function D(){var a=babelHelpers.taggedTemplateLiteralLoose(["[wam] _executePendingForContext failed to get context ",""]);D=function(){return a};return a}function E(){var a=babelHelpers.taggedTemplateLiteralLoose(["[wam] executePending "," jobs"]);E=function(){return a};return a}function F(){var a=babelHelpers.taggedTemplateLiteralLoose(["[wam] initialize"]);F=function(){return a};return a}function G(){var a=babelHelpers.taggedTemplateLiteralLoose(["wam enable processing"]);G=function(){return a};return a}function aa(){var a=babelHelpers.taggedTemplateLiteralLoose(["wam pause processing"]);aa=function(){return a};return a}function ba(){var a=babelHelpers.taggedTemplateLiteralLoose(["[wam] set "," = ",""]);ba=function(){return a};return a}function ca(){var a=babelHelpers.taggedTemplateLiteralLoose(["wam:commit ",""]);ca=function(){return a};return a}function da(){var a=babelHelpers.taggedTemplateLiteralLoose(["wam:commit: realtime channel is not supported yet"]);da=function(){return a};return a}function ea(){var a=babelHelpers.taggedTemplateLiteralLoose(["wam:commit redundant commit! ",""]);ea=function(){return a};return a}function fa(){var a=babelHelpers.taggedTemplateLiteralLoose(["[WAM] failed to execute pending jobs for wam runtime "]);fa=function(){return a};return a}function ga(){var a=babelHelpers.taggedTemplateLiteralLoose(["[wam] this tab is in the background, skipping WAM processing for now"]);ga=function(){return a};return a}function ha(){var a=babelHelpers.taggedTemplateLiteralLoose(["[WAM] failed to initialise private stats for wam runtime "]);ha=function(){return a};return a}var H,ia=[],I=[],ja=!1,ka="1",la={commit:e(f),set:e(pa),resumeJobs:e(ta),initialize:e(qa)};function a(){ia=d("WAWebWamGlobals").PrivateStatsAllIds.map(function(a){return a.key});d("WAWebWamPrivateStats").initPrivateStats()["catch"](function(a){d("WALogger").LOG(ha()).devConsole(a)});d("WAWebWamInterop").startWamStore();H=new(d("WAShiftTimer").ShiftTimer)(function(){if(!d("WAWebUserPrefsTabMutex").currentTabHasMutex()){d("WALogger").WARN(ga());return}ua()["catch"](function(a){d("WALogger").LOG(fa()).devConsole(a)})});d("WAWebWamRuntimeProvider").setWamRuntime(la);while(I.length){var a=I.pop();a&&a()}ja=!0}function e(a){return function(){for(var b=arguments.length,c=new Array(b),d=0;d<b;d++)c[d]=arguments[d];if(ja)return a.apply(void 0,c);I.push(function(){a.apply(void 0,c)})}}var J={},ma=0,K=[],L=!1,na=!1,M=null,N=new(d("WAResolvable").Resolvable)(),O=!1,P=!1;function f(a,c){var e;c===void 0&&(c=!1);if(a.commitTime!=null&&a.commitTime!==0){d("WALogger").WARN(ea(),a.$className);return(h||(h=b("Promise"))).resolve()}if(a.wamChannel==="realtime"){d("WALogger").WARN(da());return(h||(h=b("Promise"))).resolve()}a.wamChannel;e=(e=d("WAWebEventSampling").getClientEventSamplingWeight(a.id))!=null?e:a.weight;if(e!==0&&Math.random()*e>1){a.commitTime=d("WATimeUtils").unixTimeWithoutClockSkewCorrection();return(h||(h=b("Promise"))).resolve()}d("WALogger").DEV(ca(),a.$className).devConsole(a.all);oa(a);d("WAWebWamUtils").maybeForwardWamEventToJestE2e(a);return ra(a,c)}function oa(a,b){a.commitTime=b!=null?b:d("WATimeUtils").unixTimeWithoutClockSkewCorrection()}function pa(a,b){d("WALogger").DEV(ba(),a.name,String(b));d("WAWebWamUtils").maybeForwardWamAttributeToJestE2e(a.name,String(b));return ra([a,b])}function qa(a){return Q.apply(this,arguments)}function Q(){Q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(M&&!a)return(h||(h=b("Promise"))).resolve(M);var e=c("WAWebMiscBrowserUtils").info(),f={appVersion:d("WAWebBuildConstants").VERSION_BASE_WITH_WINDOWS_BUILD,appBuild:d("WAWebWamUtils").getAppBuild(),platform:d("WAWebWamEnumPlatformType").PLATFORM_TYPE.WEBCLIENT,appIsBetaRelease:yield d("WAWebWamUtils").getAppIsBetaRelease(),browser:e.name||null,browserVersion:e.ua||null,deviceName:e.os||null,deviceVersion:e.version||null,memClass:d("WAWebBrowserApi").getMemClass(),numCpu:d("WAWebBrowserApi").getNumCpu(),webcEnv:d("WAWebWamUtils").getWamEnv(),webcTabId:d("WAWebUserPrefsTabMutex").THIS_TAB,webcWebPlatform:d("WAWebWamEnumWebcWebPlatformType").WEBC_WEB_PLATFORM_TYPE[d("WAWebWamPlatform").getWamPlatform()],ocVersion:d("WAWebIsOfficialClient").isOfficialClient?1:0,deviceClassification:d("WAWebWamEnumDeviceClassification").DEVICE_CLASSIFICATION.DESKTOP,webcRevision:c("SiteData").client_revision,abKey2:d("WAWebABProps").getABPropConfigValue("wam_disable_abkey_attribute")?null:(e=d("WAWebABPropsLocalStorage").getABKey())!=null?e:""};M=f;a&&Object.assign(M,a);d("WALogger").DEV(F()).devConsole(M);d("WAWebWamGlobals").Global.commitOnSet=!1;d("WAWebWamGlobals").Global.set(M);d("WAWebWamGlobals").Global.commitOnSet=!0;Object.keys(f).forEach(function(a){return d("WAWebWamUtils").maybeForwardWamAttributeToJestE2e(a,String(f[a]))});return f});return Q.apply(this,arguments)}function ra(a,b){b===void 0&&(b=!1);K.push(a);L?b?(O=!1,P=!0,self.setTimeout(function(){return H.forceRunNow()},1)):H.onOrBefore(d("WAWebWamUtils").getInMemoryBufferingDurationInSecs()*1e3):b&&(H.cancel(),O=!0,P=!1);return N.promise}function sa(){d("WALogger").DEV(aa());L=!1;H.cancel();var a=N;N=new(d("WAResolvable").Resolvable)();return a}function ta(){d("WALogger").DEV(G()),L=!0,P=!1,K.length>0&&H.onOrBefore(d("WAWebWamUtils").getInMemoryBufferingDurationInSecs()*1e3),O&&(O=!1,P=!0,H.forceRunNow())}function ua(){return R.apply(this,arguments)}function R(){R=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=P,c=sa(),e=[].concat(K);K=[];try{var f=(yield qa()),g=(yield d("WAWebWamPrivateStats").maybeRotatePsIds());yield (h||(h=b("Promise"))).all(g.map(function(a){return va(a,f)}));d("WALogger").DEV(E(),e.length);yield h.all(["regular","none"].concat(ia).map(function(b){return xa(b,e,a,f)}))}finally{c.resolve(),ta()}});return R.apply(this,arguments)}function va(a,b){return S.apply(this,arguments)}function S(){S=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){yield X(a,b);J[a]=(yield T(a,b));return J[a]});return S.apply(this,arguments)}function T(a,b){return U.apply(this,arguments)}function U(){U=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){return new(d("WAWebWamLibContext").WamContext)(a,yield c("WAWebWamStorage").getNextSequenceNumberForStream(ka),b)});return U.apply(this,arguments)}function wa(a,b){return V.apply(this,arguments)}function V(){V=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c;c=(c=J[a])!=null?c:yield T(a,b);J[a]=c;return c});return V.apply(this,arguments)}function xa(a,b,c,d){return W.apply(this,arguments)}function W(){W=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e){var f=d("WAWebWamUtils").getChannelFromBufferKey(a),g;try{g=(yield wa(a,e))}catch(a){d("WALogger").WARN(D(),String((a==null?void 0:a.stack)?a.stack:a));return}try{for(var h=0;h<b.length;h++){if(g.size()>d("WAWebWamConstants").WAM_MAX_BUFFER_SIZE)if(d("WAWebABProps").getABPropConfigValue("web_wam_finalize_buffers_when_full")){var i=(yield va(a,e));if(i==null)break;g=i}else{d("WALogger").WARN(C(),g.size(),d("WAWebWamConstants").WAM_MAX_BUFFER_SIZE);break}i=b[h];if(!Array.isArray(i)){var j=i;(j.wamChannel==="regular"&&j.wamChannel===f||j.wamChannel==="private"&&a===d("WAWebWamPrivateStats").getPrivateStatsKeyFromInt(j.privateStatsIdInt))&&g.write(j)}else{j=i[0];i=i[1];j.channels.includes(f)&&(e[j.name]=i,g.set(j.id,i))}}j=d("WATimeUtils").unixTimeWithoutClockSkewCorrection();if(g.eventsWritten>0&&(c||g.size()>d("WAWebWamConstants").WAM_MAX_BUFFER_SIZE||j>=ma+d("WAWebWamUtils").getBufferRotateIntervalInSecs()||!na)){i=d("WAWebUserPrefsIsLoggedIn").isLoggedIn();if(!i){d("WALogger").DEV(B());g.buffer.size()>d("WAWebWamConstants").WAM_MAX_BUFFER_SIZE?(J[a]=null,d("WALogger").DEV(A())):yield X(a,e);return}yield ya(a)}else yield X(a,e)}catch(b){d("WALogger").WARN(z(),String((b==null?void 0:b.stack)?b.stack:b)).devConsole(b),void d("WAWebCrashlog").upload({reason:"wam-error"}),new(d("WAWebWamClientErrorsWamEvent").WamClientErrorsWamEvent)({wamClientBufferDropErrorCount:1}).commit(),J[a]=null}});return W.apply(this,arguments)}function X(a,b){return Y.apply(this,arguments)}function Y(){Y=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if(!J[a])return;var e=J[a].stringBuffer();if(!e)return;var f=c("WANullthrows")(J[a]).unsavedPortion;if(f&&f.eventsWritten===0)return;var g=c("WANullthrows")(J[a]).saveKey;try{if(f){d("WALogger").DEV(y());f=(yield c("WAWebWamStorage").update(g,a,e));d("WALogger").DEV(x());if(!J[a])return;if(f)d("WALogger").DEV(w(),g),c("WANullthrows")(J[a]).unsavedPortion=(yield T(a,b));else{J[a]=J[a].unsavedPortion;d("WALogger").DEV(v());yield X(a,b);return}}else{d("WALogger").DEV(u());yield c("WAWebWamStorage").add(g,a,e);d("WALogger").DEV(t());if(!J[a])return;d("WALogger").DEV(s(),g);c("WANullthrows")(J[a]).unsavedPortion=(yield T(a,b))}}catch(a){d("WALogger").WARN(r(),String(a)).devConsole(a)}});return Y.apply(this,arguments)}function ya(a){return Z.apply(this,arguments)}function Z(){Z=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e;try{e=(yield c("WAWebWamStorage").deleteAll(a))}catch(a){e={},d("WALogger").WARN(q(),String(a)).devConsole(a)}var f=e;if(J[a]){J[a].unsavedPortion&&!(J[a].saveKey in f)&&(J[a]=J[a].unsavedPortion);e=c("WANullthrows")(J[a]).saveKey;f[e]=c("WANullthrows")(J[a]).stringBuffer()}d("WALogger").DEV(p());e=(yield (h||(h=b("Promise"))).all(Object.entries(f).map(function(b){var c=b[0];b=b[1];return za(b,c,d("WAWebWamUtils").getChannelFromBufferKey(a))})));d("WALogger").DEV(o());var g=e.filter(Boolean);g.length!==e.length&&(ma=d("WATimeUtils").unixTimeWithoutClockSkewCorrection(),na=!0);J[a]&&!g.includes(J[a].saveKey)&&(J[a]=null);if(g.length===0)return;e=g.reduce(function(a,b){return a+f[b].length},0);e<d("WAWebWamConstants").WAM_MAX_BUFFER_SIZE?(d("WALogger").DEV(n(),a),yield (h||(h=b("Promise"))).all(g.map(function(){var e=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){try{yield c("WAWebWamStorage").add(b,a,f[b])}catch(a){d("WALogger").WARN(m())}});return function(a){return e.apply(this,arguments)}}())),d("WALogger").DEV(l(),a)):(J[a]=null,new(d("WAWebWamClientErrorsWamEvent").WamClientErrorsWamEvent)({wamClientBufferDropErrorCount:1}).commit(),d("WALogger").WARN(k(),g.length,e).devConsole(f))});return Z.apply(this,arguments)}function za(a,b,c){return $.apply(this,arguments)}function $(){$=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e,f){if(a==="")return(h||(h=b("Promise"))).resolve();if(a[0]==="[")return(h||(h=b("Promise"))).resolve();if(d("WAWebWamUtils").isWamBufferTooBigToUpload(a)){new(d("WAWebWamClientErrorsWamEvent").WamClientErrorsWamEvent)({wamClientBufferDropErrorCount:1}).commit();return(h||(h=b("Promise"))).resolve()}if(f==="private"){d("WALogger").DEV(j());return c("WAWebUploadPrivateStatsBackend")(a,e)}if(f==="regular"){d("WALogger").DEV(i());return c("WAWebUploadStatsBackend")(a,e)}return(h||(h=b("Promise"))).resolve()});return $.apply(this,arguments)}g.Wam=la;g.initWamRuntime=a;g.sendAllLogs=ya}),98); __d("WAWebLoggerDebugInfo",["WAWebABPropsSaga","WAWebConnModel","WAWebCrashlogConstants","WAWebEnvironment","WAWebL10N","WAWebLid1X1MigrationGating","WAWebTasksDailyStatsTask","WAWebUA","WAWebUIRefreshGatingUtils","WAWebUserPrefsGeneral","WAWebUserPrefsMeUser","WAWebWam","WAWebWamGlobals","asyncToGeneratorRuntime","gkx"],(function(a,b,c,d,e,f,g){var h=new Map([["appIsBetaRelease","is-beta"],["appVersion","version"],["browserVersion","browser-version"],["deviceName","os"],["mcc","phone-mcc"],["mnc","phone-mnc"],["webc_bucket","exp-bucket"],["webcPhoneAppVersion","phone-app-version"],["webcPhoneCharging","is-phone-charging"],["webcPhoneDeviceManufacturer","phone-manufacturer"],["webcPhoneDeviceModel","phone-model"],["webcPhoneOsVersion","phone-os-version"],["webcPhonePlatform","phone-os"],["webcWebPlatform","platform"],["webcProtoVersion","protocol-version"],["deviceID","device-id"],["webcWebArch","device-arch"],["webcWebDeviceManufacturer","device-manufacturer"],["webcWebDeviceModel","device-model"],["webcWebOsReleaseNumber","device-release"],["deviceVersion","os-version"],["userAgent","user-agent"],["mdEnabled","md-enabled"],["hasMdCompanion","has-md-companion"],["entityId","entity id"],["isLidMigrated","is_lid_migrated"],["lidCompletedMigrations","lid_completed_migrations"],["isUiRefreshEnabled","ui-refresh-enabled"]]);function a(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){void d("WAWebWam").Wam.initialize();var b=babelHelpers["extends"]({},d("WAWebWamGlobals").Global.all,{webcWebPlatform:d("WAWebCrashlogConstants").CLB_PLATFORM,webcPhonePlatform:d("WAWebConnModel").Conn.platform,webcProtoVersion:String(d("WAWebConnModel").Conn.protoVersion)});c("WAWebEnvironment").isWindows&&(b.subplatform=d("WAWebCrashlogConstants").CLB_SUBPLATFORM);c("gkx")("26259")?b.releaseChannel="intern":c("gkx")("26258")&&(b.releaseChannel="production");var e=d("WAWebUserPrefsMeUser").getMe();e&&(b.deviceID=e.toString());if(c("gkx")("11584")){b.saga_copy=d("WAWebABPropsSaga").getIsSagaCopyEnabled().toString();e=d("WAWebUserPrefsMeUser").getMeUser();b.pn=e.user.toString()}e={};for(var f in b){var g=b[f];g!=null&&(e[f]=g)}e.debugIsExternalBeta=(yield d("WAWebUserPrefsGeneral").getWhatsAppWebExternalBetaJoinedIdb());e.isLidMigrated=d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated();e.isUiRefreshEnabled=d("WAWebUIRefreshGatingUtils").uiRefreshM1Enabled();g=d("WAWebTasksDailyStatsTask").getLidMigrationStatus();g.completedMigrations!=null&&(e.lidCompletedMigrations=g.completedMigrations);if(a){f=a.supportTag;b=a.addUserAgentDetails;g=a.convertFields;var h=a.entityId;a=a.addLanguageFields;f!=null&&(e.context=f);h!=null&&(e.entityId=h);b===!0&&(e.userAgent=d("WAWebUA").UA.parser.getUA());a===!0&&(e.lc=c("WAWebL10N").getRegion(),e.lg=c("WAWebL10N").getLanguage());if(g===!0){f=j(e);return f}}return e});return i.apply(this,arguments)}function j(a){var b={};for(a of Object.entries(a)){var c,d=a[0],e=a[1];b[(c=h.get(d))!=null?c:d]=e}return b}g.getDebugInfo=a}),98); __d("WAWebPrivacyMode_WORKER_INCOMPATIBLE",["WAWebContactCollection","WAWebWid"],(function(a,b,c,d,e,f,g){function a(a){if(!c("WAWebWid").isUser(a))return;a=d("WAWebContactCollection").ContactCollection.get(a);return a==null?void 0:a.privacyMode}g.getPrivacyModeFromModel=a}),98); __d("WAWebUnifiedSession",["$InternalEnum","WALogger","WASmaxUnifiedSessionShareRPC","WATimeUtils","WAWebABProps","WAWebClock","WAWebSocketConstants","WAWebSocketModel","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[unified-session] failed to send session id: ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[unified-session] send to server successfully. session id: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[unified-session] sending to server. session id: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[unified-session] send session id skipped: id is alrady sent"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[unified-session] send session id skipped: session id is empty"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[unified-session] send session id skipped: offline"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["[unified-session] send session id skipped: Unified Session is not enabled"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["[unified-session] generated new session id. reason: ",". new ID ",". old ID ",""]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["[unified-session] generate session id skipped: Unified Session is not enabled"]);p=function(){return a};return a}var q=7*d("WATimeUtils").DAY_MILLISECONDS,r=3*d("WATimeUtils").DAY_MILLISECONDS;a=b("$InternalEnum")({InitialRender:"initial-render",Foreground:"foreground"});c=function(){function a(){var a=this;this.$1=null;this.$2=0;this.$3=!1;d("WAWebSocketModel").Socket.on("change:stream",function(){return a.$4()})}var c=a.prototype;c.getSessionId=function(){return this.$1};c.getSequence=function(){return++this.$2};c.clearSessionId=function(){this.$1=null};c.generateSessionId=function(a){if(!s()){d("WALogger").DEV(p());return}var b=(d("WAWebClock").Clock.getServerTimeMs()+r)%q,c=this.$1;this.$1=String(b);this.$3=!1;this.$2=0;d("WALogger").DEV(o(),a,this.$1,c);void this.$5()};c.$5=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(!s()){d("WALogger").DEV(n());return}if(d("WAWebSocketModel").Socket.stream!==d("WAWebSocketConstants").SOCKET_STREAM.CONNECTED){d("WALogger").DEV(m());return}var a=this.$1;if(a==null){d("WALogger").DEV(l());return}if(this.$3){d("WALogger").DEV(k());return}try{d("WALogger").DEV(j(),a),yield d("WASmaxUnifiedSessionShareRPC").sendShareRPC({unifiedSessionId:a}),this.$3=!0,d("WALogger").DEV(i(),a)}catch(a){d("WALogger").ERROR(h(),a).devConsole({err:a}).sendLogs("send-unified-session-id-failed")}});function c(){return a.apply(this,arguments)}return c}();c.$4=function(){d("WAWebSocketModel").Socket.stream===d("WAWebSocketConstants").SOCKET_STREAM.CONNECTED&&void this.$5()};return a}();function s(){return d("WAWebABProps").getABPropConfigValue("unified_session_version")===2}e=new c();g.UnifiedSessionGenReason=a;g.UnifiedSessionManager=e}),98); __d("WAWebWamEnumBlockEntryPoint",[],(function(a,b,c,d,e,f){a=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,BIZ_EXTENSION_MENU:25,VIEW_ONCE_VIEWER:26,STATUS_OVERFLOW_MENU_REPORT:27,ALBUM_MEDIA_MENU_REPORT:28,STATUS_POST_REPORT:29,MISSED_CALL_NOTIFICATION_BLOCK:30,CHAT_FMX_CARD_BLOCK:31,CHAT_FMX_CARD_BLOCK_SUSPICIOUS:32,CHAT_FMX_CARD_SAFETY_TOOLS_BLOCK:33,CHAT_FMX_CARD_SAFETY_TOOLS_BLOCK_SUSPICIOUS:34,CHAT_FMX_CARD_SAFETY_TOOLS_REPORT:35,CHAT_FMX_CARD_SAFETY_TOOLS_REPORT_SUSPICIOUS:36,ACCOUNT_INFO_BLOCK:37,CALL_LOG_BLOCK:38,BIZ_BLOCK_HEADER_CHAT:39,BIZ_OVERFLOW_MENU_BLOCK:40,PSA_BANNER_BLOCK:41,COMMENT_ACTIONS_BOTTOM_SHEET:42,CALL_SPAM_DIALOG_REPORT:43,CALL_SPAM_DIALOG_BLOCK:44,BIZ_ACCOUNT_INFO_BLOCK:45,BIZ_BLOCK_LIST:46,BIZ_CALL_LOG_BLOCK:47,ONGOING_CALL_LINK_BLOCK:48,ONE_TO_ONE_BLOCKED_CHAT_COMPOSER:49,CHAT_MORE_OPTIONS:50,CHAT_LONG_PRESS_OPTIONS:51,IAB_MENU_REPORT:52});f.BLOCK_ENTRY_POINT=a}),66); __d("WAWebWamEnumBlockEventActionType",[],(function(a,b,c,d,e,f){a=Object.freeze({BLOCK:0,UNBLOCK:1});f.BLOCK_EVENT_ACTION_TYPE=a}),66); __d("WAWebWamEnumCallResultType",[],(function(a,b,c,d,e,f){a=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,SILENCED:26,CALL_MISSED_SILENCED:27,CALL_DOES_NOT_EXIST_FOR_REJOIN:28});f.CALL_RESULT_TYPE=a}),66); __d("WAWebBlockEventsFsWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumBlockEntryPoint","WAWebWamEnumBlockEventActionType","WAWebWamEnumCallResultType"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({BlockEventsFs:[4288,{blockEntryPoint:[1,d("WAWebWamEnumBlockEntryPoint").BLOCK_ENTRY_POINT],blockEventActionType:[2,d("WAWebWamEnumBlockEventActionType").BLOCK_EVENT_ACTION_TYPE],blockEventIsSuspicious:[3,a.TYPES.BOOLEAN],blockEventIsUnsub:[4,a.TYPES.BOOLEAN],pastCall:[5,a.TYPES.BOOLEAN],pastCallResult:[6,d("WAWebWamEnumCallResultType").CALL_RESULT_TYPE]},[1,1,1],"regular"]},{BlockEventsFs:[]});g.BlockEventsFsWamEvent=b}),98); __d("WAWebWamBlockEventReporter",["WAWebABProps","WAWebBlockEventsFsWamEvent","WAWebChatCollection","WAWebContactGetters","WAWebWamEnumBlockEventActionType"],(function(a,b,c,d,e,f,g){function a(a){var b=a.contact,c=a.blockEntryPoint;a=a.isBlock;if(d("WAWebABProps").getABPropConfigValue("block_entry_point_logging_enabled")){var e;e=d("WAWebContactGetters").getIsMyContact(b)||((e=d("WAWebChatCollection").ChatCollection.get(b.id))==null?void 0:e.isTrusted());new(d("WAWebBlockEventsFsWamEvent").BlockEventsFsWamEvent)({blockEntryPoint:c,blockEventIsSuspicious:!e,blockEventIsUnsub:!d("WAWebContactGetters").getIsMyContact(b),blockEventActionType:a?d("WAWebWamEnumBlockEventActionType").BLOCK_EVENT_ACTION_TYPE.BLOCK:d("WAWebWamEnumBlockEventActionType").BLOCK_EVENT_ACTION_TYPE.UNBLOCK}).commit()}}g.logBlockEvent=a}),98); __d("WAWebWebcResourceLoadWamEvent",["WAWebWamCodegenUtils"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({WebcResourceLoad:[688,{webcResourceCached:[3,a.TYPES.BOOLEAN],webcResourceDuration:[2,a.TYPES.TIMER],webcResourceName:[1,a.TYPES.STRING]},[1,1e3,2e3],"regular"]},{WebcResourceLoad:[]});g.WebcResourceLoadWamEvent=b}),98); __d("WAWebWamResourceLoadReporter",["WALogger","WAWebWebcResourceLoadWamEvent"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["MetricReporter:logResourceLoads metrics not provided by browser!"]);h=function(){return a};return a}function a(){var a;a=(a=window.performance)==null?void 0:a.timing;if(!(a&&window.performance.getEntriesByType)){d("WALogger").LOG(h()).devConsole("red");return}var b=window.performance.timing.fetchStart===window.performance.timing.domainLookupEnd;a=window.performance.getEntriesByType("resource");var c=document.createElement("a");a.forEach(function(a){a.initiatorType!=="xmlhttprequest"&&(c.href=a.name,new(d("WAWebWebcResourceLoadWamEvent").WebcResourceLoadWamEvent)({webcResourceName:c.pathname+c.search+c.hash,webcResourceDuration:Math.round(a.duration),webcResourceCached:b}).commit())})}g["default"]=a}),98); __d("WAWebWamEnumWebcAppcacheStatusCode",[],(function(a,b,c,d,e,f){a=Object.freeze({UNCACHED:0,IDLE:1,CHECKING:2,DOWNLOADING:3,UPDATEREADY:4,OBSOLETE:5});f.WEBC_APPCACHE_STATUS_CODE=a}),66); __d("WAWebWamEnumWebcNavigationType",[],(function(a,b,c,d,e,f){a=Object.freeze({NAVIGATE_NEXT:0,RELOAD:1,BACK_FORWARD:2,UNDEFINED:255});f.WEBC_NAVIGATION_TYPE=a}),66); __d("WAWebWebcPageLoadWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumWebcAppcacheStatusCode","WAWebWamEnumWebcNavigationType"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({WebcPageLoad:[642,{webcAppcacheStatus:[29,d("WAWebWamEnumWebcAppcacheStatusCode").WEBC_APPCACHE_STATUS_CODE],webcCached:[30,a.TYPES.BOOLEAN],webcConnectEnd:[10,a.TYPES.TIMER],webcConnectStart:[9,a.TYPES.TIMER],webcDomComplete:[19,a.TYPES.TIMER],webcDomContentLoadedEventEnd:[18,a.TYPES.TIMER],webcDomContentLoadedEventStart:[17,a.TYPES.TIMER],webcDomInteractive:[16,a.TYPES.TIMER],webcDomLoading:[15,a.TYPES.TIMER],webcDomainLookupEnd:[8,a.TYPES.TIMER],webcDomainLookupStart:[7,a.TYPES.TIMER],webcExeDone:[23,a.TYPES.TIMER],webcExeStart:[22,a.TYPES.TIMER],webcFetchStart:[6,a.TYPES.TIMER],webcInitialMountT:[38,a.TYPES.TIMER],webcInitialNavMountT:[39,a.TYPES.TIMER],webcInitialPanel:[42,a.TYPES.STRING],webcInitialPanelMountStartT:[43,a.TYPES.TIMER],webcInitialPanelMountT:[40,a.TYPES.TIMER],webcInitialPanelRenderT:[46,a.TYPES.TIMER],webcJsLoadT:[37,a.TYPES.TIMER],webcLoadEventEnd:[21,a.TYPES.TIMER],webcLoadEventStart:[20,a.TYPES.TIMER],webcLoadInForeground:[53,a.TYPES.BOOLEAN],webcMainScriptEnd:[45,a.TYPES.TIMER],webcMainScriptStart:[44,a.TYPES.TIMER],webcNativeLoadT:[36,a.TYPES.TIMER],webcNavigation:[32,d("WAWebWamEnumWebcNavigationType").WEBC_NAVIGATION_TYPE],webcPageLoadId:[54,a.TYPES.STRING],webcPageLoadT:[34,a.TYPES.TIMER],webcParallellyFetched:[41,a.TYPES.BOOLEAN],webcQrCode:[31,a.TYPES.BOOLEAN],webcRedirectCount:[33,a.TYPES.NUMBER],webcRedirectEnd:[5,a.TYPES.TIMER],webcRedirectStart:[4,a.TYPES.TIMER],webcRequestStart:[12,a.TYPES.TIMER],webcResponseEnd:[14,a.TYPES.TIMER],webcResponseStart:[13,a.TYPES.TIMER],webcSecureConnectionStart:[11,a.TYPES.TIMER],webcUnloadEventEnd:[3,a.TYPES.TIMER],webcUnloadEventStart:[2,a.TYPES.TIMER],webcWsAttempts:[28,a.TYPES.NUMBER],webcWsNormal:[27,a.TYPES.TIMER],webcWsOpening:[24,a.TYPES.TIMER],webcWsPairing:[25,a.TYPES.TIMER],webcWsSyncing:[26,a.TYPES.TIMER]},[1,1,1],"regular"]},{WebcPageLoad:[]});g.WebcPageLoadWamEvent=b}),98); __d("WAWebWamPageLoadReporter",["Promise","WALogger","WAWebAppScreen","WAWebPageLoadLogging","WAWebStreamModel","WAWebWam","WAWebWamResourceLoadReporter","WAWebWebcPageLoadWamEvent","once"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["MetricReporter:logPageLoad delayed"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["MetricReporter:logPageLoad metrics not provided by browser!"]);j=function(){return a};return a}var k=new(d("WAWebWebcPageLoadWamEvent").WebcPageLoadWamEvent)(),l,m={},n,o,p=!1,q=!1;function a(){return{uiTimingComplete:p,wsTimingComplete:q}}b=new(h||(h=b("Promise")))(function(a){return n=function(){p=!0,a()}});var r=new h(function(a){return o=function(){q=!0,a()}}),s=!1,t;function e(a,b,c){u(a);var d=Math.floor(self.performance.now());m[a]=d;c&&(m.socketSequence=b,o())}function u(a){switch(a){case d("WAWebStreamModel").StreamInfo.OPENING:d("WAWebPageLoadLogging").addPageLoadQplPoint("webc_ws_opening");break;case d("WAWebStreamModel").StreamInfo.PAIRING:d("WAWebPageLoadLogging").addPageLoadQplPoint("webc_ws_pairing");break;case d("WAWebStreamModel").StreamInfo.NORMAL:d("WAWebPageLoadLogging").addPageLoadQplPoint("webc_ws_normal");break;default:return}}function v(a){d("WAWebPageLoadLogging").addPageLoadQplPoint("webc_initial_panel_mount_t"),l=a}function w(a){if(k==null)return;k.set({webcInitialPanel:a})}function x(){n()}window.document&&(t=!document.hidden,document.addEventListener("visibilitychange",z));h.all([b,r]).then(function(){A(),c("WAWebWamResourceLoadReporter")(),s||(s=!0,d("WAWebWam").Wam.resumeJobs())});function y(a){return!self.performance||!self.performance.timing||!self.performance.timing.navigationStart?null:a-self.performance.timing.navigationStart}function z(){if(!k)return;document.hidden&&(t=!1)}function A(){var a;if(!(((a=self.performance)==null?void 0:a.timing)&&self.performance.navigation)){d("WALogger").LOG(j()).devConsole("red");return}if(!k)return;a=k;var b=self.performance.timing,c=self.performance.navigation,e=b.navigationStart,f=b.loadEventEnd-e;if(f<=0){d("WALogger").LOG(i()).devConsole("blue");self.setTimeout(A,1e4);return}function g(a){a=b[a];return a&&y(a)}a.set({webcPageLoadT:f,webcUnloadEventStart:g("unloadEventStart"),webcUnloadEventEnd:g("unloadEventEnd"),webcRedirectStart:g("redirectStart"),webcRedirectEnd:g("redirectEnd"),webcFetchStart:g("fetchStart"),webcDomainLookupStart:g("domainLookupStart"),webcDomainLookupEnd:g("domainLookupEnd"),webcConnectStart:g("connectStart"),webcConnectEnd:g("connectEnd"),webcSecureConnectionStart:g("secureConnectionStart"),webcRequestStart:g("requestStart"),webcResponseStart:g("responseStart"),webcResponseEnd:g("responseEnd"),webcDomLoading:g("domLoading"),webcDomInteractive:g("domInteractive"),webcDomContentLoadedEventStart:g("domContentLoadedEventStart"),webcDomContentLoadedEventEnd:g("domContentLoadedEventEnd"),webcDomComplete:g("domComplete"),webcLoadEventStart:g("loadEventStart"),webcLoadEventEnd:g("loadEventEnd"),webcCached:b.fetchStart===b.domainLookupEnd,webcNavigation:c.type,webcRedirectCount:c.redirectCount,webcWsOpening:m.OPENING,webcWsPairing:m.PAIRING,webcWsSyncing:m.SYNCING,webcWsNormal:m.NORMAL,webcWsAttempts:m.socketSequence,webcQrCode:!m.SYNCING,webcInitialPanelMountT:l-e,webcLoadInForeground:t,webcPageLoadId:d("WAWebPageLoadLogging").getPageLoadId()});B(a);a.commit();window.document&&document.removeEventListener("visibilitychange",z);k=null}function B(a){var b;(b=d("WAWebPageLoadLogging")).addPageLoadValidationData("webc_ws_opening",{wam:a.webcWsOpening});b.addPageLoadValidationData("webc_ws_pairing",{wam:a.webcWsPairing});b.addPageLoadValidationData("webc_ws_normal",{wam:a.webcWsNormal});b.addPageLoadValidationData("webc_initial_panel_mount_t",{wam:a.webcInitialPanelMountT});b.addPageLoadValidationData("webc_initial_panel_mount_start_t",{wam:a.webcInitialPanelMountStartT});b.addPageLoadValidationData("webc_initial_panel_render_t",{wam:a.webcInitialPanelRenderT});b.setWamCompleteForValidation()}b=function(){function a(a){this.$4=!1,this.$3=a.label,this.$1=a.startProperty,this.$2=a.endProperty}var b=a.prototype;b.start=function(){var a;this.$4=!0;if(k==null)return;k.set((a={},a[this.$1]=y(Date.now()),a))};b.end=function(){var a;if(k==null)return;k.set((a={},a[this.$2]=y(Date.now()),a))};b.hasStarted=function(){return this.$4};return a}();function f(a){if(I.hasStarted())return;if(!C(a))return;w(a);I.start();d("WAWebPageLoadLogging").addPageLoadQplPoint("webc_initial_panel_mount_start_t");window.requestAnimationFrame(function(){I.end(),d("WAWebPageLoadLogging").addPageLoadQplPoint("webc_initial_panel_render_t"),F("initialPanelRenderTRecorded")})}function C(a){return a!==d("WAWebAppScreen").AppScreen.SYNCING}var D=!1,E=!1;function F(a){a==="initialPanelMountTRecorded"&&(D=!0),a==="initialPanelRenderTRecorded"&&(E=!0),D&&E&&x()}r=c("once")(function(){v(Date.now()),F("initialPanelMountTRecorded")});var G=new b({label:"PageLoad.webcExe",startProperty:"webcExeStart",endProperty:"webcExeDone"}),H=new b({label:"PageLoad.webcMainScript",startProperty:"webcMainScriptStart",endProperty:"webcMainScriptEnd"}),I=new b({label:"PageLoad.webcInitialPanelRender",startProperty:"webcInitialPanelMountStartT",endProperty:"webcInitialPanelRenderT"});g.getWamPageLoadTimingCompletion=a;g.streamInfoChange=e;g.logWamPageLoad=A;g.maybeLogInitialScreenRenderStart=f;g.logFirstRenderMountTimeOnce=r;g.exeTimer=G;g.mainScriptTimer=H}),98); __d("WAWebWamTimeSpentArray",["WALogger","WAShiftTimer","WAWebABProps","WAWebClock","WAWebUnifiedSession"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[time-spent] _initArray at time ",""]);h=function(){return a};return a}var i=2,j=i*32;a=function(){function a(a){var b=this;this.sequenceId=0;this.ship=function(a){var c=b.bitmap;if(!c)return;var e=Date.now();e>b.lastActiveInMS&&(b.bitmapLength=Math.min(j,Math.ceil(e/1e3-b.startTimeInSec)));c={sessionId:b.sessionId,startTime:b.startTimeInSec,bitmap:c,bitmapLen:b.bitmapLength,sessionSeq:b.sequenceId,sessionCum:b.cumulativeBitsSet,relativeStartTimeMs:(e=b.relativeStartTimeMs)!=null?e:void 0};if(d("WAWebABProps").getABPropConfigValue("unified_session_log_ts_event")){c.tsTimestampMs=d("WAWebClock").Clock.getServerTimeMs();e=d("WAWebUnifiedSession").UnifiedSessionManager.getSessionId();e!=null&&(c.unifiedSessionId=e)}e=a||b.loggingCallback;e(c);b.timer.cancel();b.bitmap=null};this.loggingCallback=a.loggingCallback;this.timer=new(d("WAShiftTimer").ShiftTimer)(this.ship);var c=a.getSessionData;a=a.postUpdate;c!=null&&(this.fetchAndUpdateSession=function(){var a=c(),d=a.id;a=a.relativeTimeMs;b.sessionId=d;b.relativeStartTimeMs=a;b.cumulativeBitsSet=0});this.postUpdate=a;this.$1();this.$2(Math.floor(Date.now()/1e3))}var b=a.prototype;b.$1=function(){this.fetchAndUpdateSession!=null?this.fetchAndUpdateSession():(this.sessionId=k(),this.cumulativeBitsSet=0,this.sequenceId=-1)};b.$2=function(a){this.fetchAndUpdateSession!=null&&this.fetchAndUpdateSession();d("WALogger").LOG(h(),a);this.startTimeInSec=a;this.lastActiveInMS=this.startTimeInSec*1e3;this.bitmap=new Int32Array(i);this.bitmap[0]=1;this.bitmapLength=1;this.cumulativeBitsSet+=1;this.sequenceId+=1;this.postUpdate==null?void 0:this.postUpdate();a=j*1e3;this.timer.debounceAndCap(a,a)};b.$3=function(a){var b=a-this.startTimeInSec;this.bitmap&&(b<0||b>=j)&&this.ship();!this.bitmap?this.$2(a):(this.bitmap[b>>5]|=1<<(b&31),this.bitmapLength=b+1,this.cumulativeBitsSet+=1,this.lastActiveInMS=a*1e3)};b.update=function(a){if(a>=this.lastActiveInMS&&a-this.lastActiveInMS<1e3)return;this.$3(Math.floor(a/1e3));this.postUpdate==null?void 0:this.postUpdate()};b.shipAndEndSession=function(a){this.ship(a),this.$1()};return a}();function k(){return Math.floor(2147483648*Math.random()).toString(36)}g["default"]=a}),98); __d("WAWebEditMessageSendWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumEditType","WAWebWamEnumMediaType","WAWebWamEnumMessageType","WAWebWamEnumTypeOfGroupEnum"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({EditMessageSend:[3990,{editDuration:[1,a.TYPES.INTEGER],editType:[2,d("WAWebWamEnumEditType").EDIT_TYPE],mediaType:[8,d("WAWebWamEnumMediaType").MEDIA_TYPE],messageSendResultIsTerminal:[3,a.TYPES.BOOLEAN],messageType:[4,d("WAWebWamEnumMessageType").MESSAGE_TYPE],resendCount:[5,a.TYPES.INTEGER],retryCount:[6,a.TYPES.INTEGER],typeOfGroup:[9,d("WAWebWamEnumTypeOfGroupEnum").TYPE_OF_GROUP_ENUM]},[1,1,1],"regular"]},{EditMessageSend:[]});g.EditMessageSendWamEvent=b}),98); __d("WAWebRevokeMessageSendWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumMessageType","WAWebWamEnumRevokeType"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({RevokeMessageSend:[3656,{messageSendResultIsTerminal:[1,a.TYPES.BOOLEAN],messageType:[2,d("WAWebWamEnumMessageType").MESSAGE_TYPE],resendCount:[3,a.TYPES.INTEGER],retryCount:[4,a.TYPES.INTEGER],revokeDuration:[5,a.TYPES.INTEGER],revokeType:[6,d("WAWebWamEnumRevokeType").REVOKE_TYPE]},[1,1,1],"regular"]},{RevokeMessageSend:[]});g.RevokeMessageSendWamEvent=b}),98); __d("WAWebMessageSendReporter",["WALogger","WANullthrows","WAWebABProps","WAWebChatCollection","WAWebContactCollection","WAWebEditMessageSendWamEvent","WAWebEphemeralityResolver","WAWebFrontendContactGetters","WAWebMessageSendWamEvent","WAWebMsgGetters","WAWebMsgType","WAWebNewsletterGatingUtils","WAWebRevokeMessageSendWamEvent","WAWebUsernameTypes","WAWebWamAddressingModeUtils","WAWebWamEnumChatOriginsType","WAWebWamEnumEditType","WAWebWamEnumMediaType","WAWebWamEnumMessageDistributionEnumType","WAWebWamEnumMessageSendResultType","WAWebWamEnumMessageType","WAWebWamEnumRevokeType","WAWebWamGroupMetricUtils","WAWebWamMsgUtils","WAWebWamNumberToSizeBucket"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["MessageSendReporter: skip posting, metric has already been posted"]);h=function(){return a};return a}b=function(){function a(a,b){this.$3=!1;this.$4=d("WAWebWamEnumMediaType").MEDIA_TYPE.NONE;this.$1=a.to;var e=Boolean(a.caption);a.type===d("WAWebMsgType").MSG_TYPE.DOCUMENT&&(e=d("WAWebMsgGetters").getIsCaptionByUser(a));this.$2=new(d("WAWebMessageSendWamEvent").MessageSendWamEvent)({messageType:d("WAWebWamMsgUtils").getWamMessageType(a),messageMediaType:d("WAWebWamMsgUtils").getWamMediaType(a),mediaCaptionPresent:e,fastForwardEnabled:!0,messageIsFanout:!0,messageIsForward:Boolean(a.isForwarded),messageIsRevoke:Boolean(d("WAWebMsgGetters").getIsRevoke(a)),isViewOnce:Boolean(a.isViewOnce),isAReply:d("WAWebMsgGetters").getIsReply(a),e2eBackfill:Boolean(b==null?void 0:b.isResend),messageDistributionType:d("WAWebWamEnumMessageDistributionEnumType").MESSAGE_DISTRIBUTION_ENUM_TYPE.REGULAR_MESSAGE,editType:d("WAWebMsgGetters").getWamEditType(a),botType:d("WAWebWamMsgUtils").getWamBotType(this.$1,a.bizBotType),isAComment:d("WAWebMsgGetters").getType(a)===d("WAWebMsgType").MSG_TYPE.COMMENT});e=d("WAWebContactCollection").ContactCollection.getMeContact();this.$2.hasUsername=(e==null?void 0:e.username)!=null&&e.username!=="";var f,g=d("WAWebChatCollection").ChatCollection.get(this.$1);if(g==null?void 0:g.lidOriginType)switch(g==null?void 0:g.lidOriginType){case d("WAWebUsernameTypes").LidOriginType.PNH_CTWA:f=d("WAWebWamEnumChatOriginsType").CHAT_ORIGINS_TYPE.LID_CTWA;break;case d("WAWebUsernameTypes").LidOriginType.USERNAME:f=d("WAWebWamEnumChatOriginsType").CHAT_ORIGINS_TYPE.LID_USERNAME;break;case d("WAWebUsernameTypes").LidOriginType.GENERAL:f=d("WAWebWamEnumChatOriginsType").CHAT_ORIGINS_TYPE.OTHERS;break}else this.$1.isLid()?f=d("WAWebWamEnumChatOriginsType").CHAT_ORIGINS_TYPE.LID_CTWA:f=d("WAWebWamEnumChatOriginsType").CHAT_ORIGINS_TYPE.OTHERS;f&&(this.$2.chatOrigins=f);if(e){g=d("WAWebFrontendContactGetters").getDisplayNameAndType(e).type;g&&(this.$2.oppositeVisibleIdentification=g)}a.ephemeralDuration!=null&&(this.$2.ephemeralityDuration=a.ephemeralDuration);if(!d("WAWebMsgGetters").getIsGroupMsg(a)&&d("WAWebABProps").getABPropConfigValue("dm_initiator_trigger")||d("WAWebMsgGetters").getIsGroupMsg(a)&&d("WAWebABProps").getABPropConfigValue("dm_initiator_trigger_groups")){e=d("WAWebMsgGetters").getWamDisappearingModeTrigger(a);e!=null&&(this.$2.ephemeralityTriggerAction=e);g=d("WAWebMsgGetters").getWamDisappearingModeInitiatedByMe(a);g!=null&&(this.$2.ephemeralityInitiator=g)}if(!d("WAWebMsgGetters").getIsGroupMsg(a)&&!d("WAWebMsgGetters").getIsNewsletterMsg(a)){this.$2.isLid=this.$1.isLid();e=d("WAWebEphemeralityResolver").getEphemeralDurationForUser(d("WAWebContactCollection").ContactCollection.getMeContact());e!=null&&(this.$2.senderDefaultDisappearingDuration=e);g=d("WAWebEphemeralityResolver").getEphemeralDurationForUser(d("WAWebContactCollection").ContactCollection.get(this.$1));g!=null&&(this.$2.receiverDefaultDisappearingDuration=g)}if(d("WAWebMsgGetters").getIsRevoke(a)){this.$2.revokeType=a.subtype==="admin_revoke"?d("WAWebWamEnumRevokeType").REVOKE_TYPE.ADMIN:d("WAWebWamEnumRevokeType").REVOKE_TYPE.SENDER;e=d("WAWebMsgGetters").getRevokeDuration(a);e!=null&&(this.$2.revokeDuration=e)}if(d("WAWebMsgGetters").getIsEditProtocolMsg(a)){g=c("WANullthrows")(b==null?void 0:b.originalMessage);this.$2.editDuration=d("WAWebMsgGetters").getT(a)-d("WAWebMsgGetters").getT(g);this.$4=g.getWamMediaType()}e=d("WAWebMsgGetters").getWamDisappearingModeInitiator(a);e!=null&&(this.$2.disappearingChatInitiator=e);g=d("WAWebWamMsgUtils").getWamAgentEngagementType(a);g!=null&&(this.$2.agentEngagementType=g);(b==null?void 0:b.groupData)!=null&&this.setGroupData(b.groupData);d("WAWebMsgGetters").getIsNewsletterMsg(a)&&d("WAWebNewsletterGatingUtils").isWamoSubLoggingEnabled()&&(this.$2.isPremium=Boolean(a.isWamoSub))}var b=a.prototype;b.setDeviceCount=function(a){this.$2.deviceCount=d("WAWebWamGroupMetricUtils").capCount(a),this.$2.deviceSizeBucket=c("WAWebWamNumberToSizeBucket")(a)};b.setGroupData=function(a){a.isLid!=null&&(this.$2.isLid=a.isLid),Object.assign(this.$2,d("WAWebWamAddressingModeUtils").getAddressingModeMetricsFromGroupMetadata(a)),a.wamTypeOfGroup!=null&&(this.$2.typeOfGroup=a.wamTypeOfGroup),a.participantCount!=null&&(this.$2.participantCount=a.participantCount),a.deviceCount!=null&&(this.$2.deviceCount=a.deviceCount),a.deviceSizeBucket!=null&&(this.$2.deviceSizeBucket=a.deviceSizeBucket)};b.setMessageDistributionType=function(a){this.$2.messageDistributionType=a};b.setMessageIsFirstUserMessage=function(a){this.$2.messageIsFirstUserMessage=a};b.postSuccess=function(){this.$2.messageSendResult=d("WAWebWamEnumMessageSendResultType").MESSAGE_SEND_RESULT_TYPE.OK,this.$2.messageSendResultIsTerminal=!1,this.$5()};b.postFailure=function(a){var b=a.result;a=a.isTerminal;this.$2.messageSendResult=b;this.$2.messageSendResultIsTerminal=a;this.$2.weight=0;this.$5()};b.$6=function(){new(d("WAWebRevokeMessageSendWamEvent").RevokeMessageSendWamEvent)({messageSendResultIsTerminal:this.$2.messageSendResultIsTerminal,messageType:this.$2.messageType,resendCount:this.$2.resendCount,retryCount:this.$2.retryCount,revokeDuration:this.$2.revokeDuration,revokeType:this.$2.revokeType}).commit()};b.$7=function(){new(d("WAWebEditMessageSendWamEvent").EditMessageSendWamEvent)({messageSendResultIsTerminal:this.$2.messageSendResultIsTerminal,messageType:this.$2.messageType,resendCount:this.$2.resendCount,retryCount:this.$2.retryCount,editType:this.$2.editType,editDuration:this.$2.editDuration,typeOfGroup:this.$2.typeOfGroup,mediaType:this.$4}).commit()};b.$5=function(){if(this.$3){d("WALogger").WARN(h());return}this.$3=!0;this.$2.markMessageSendT();this.$2.commit();this.$2.messageIsRevoke&&this.$2.messageType!==d("WAWebWamEnumMessageType").MESSAGE_TYPE.STATUS&&this.$6();this.$2.editType!==d("WAWebWamEnumEditType").EDIT_TYPE.NOT_EDITED&&this.$7()};return a}();function a(a){a=a.messageIsInvisible;var b=new(d("WAWebMessageSendWamEvent").MessageSendWamEvent)({messageIsInvisible:a});return{setGroupData:function(a){a.isLid!=null&&(b.isLid=a.isLid),a.wamTypeOfGroup!=null&&(b.typeOfGroup=a.wamTypeOfGroup),a.participantCount!=null&&(b.participantCount=a.participantCount),a.deviceCount!=null&&(b.deviceCount=a.deviceCount),a.deviceSizeBucket!=null&&(b.deviceSizeBucket=a.deviceSizeBucket)},post:function(){b.markMessageSendT(),b.commit()}}}g.MessageSendReporter=b;g.createMessageSendMetricReporter=a}),98); __d("WAWebFbtIntlList",["fbt","invariant","err","react"],(function(a,b,c,d,e,f,g,h,i){var j;a=j||c("react");var k={AND:"AND",NONE:"NONE",OR:"OR"},l={BULLET:"BULLET",COMMA:"COMMA",SEMICOLON:"SEMICOLON"},m=500;b=function(a,b,c){a=a.filter(Boolean);var d=a.length;if(d===0)return"";else if(d===1)return a[0];var e=a[d-1],f=a[0],g=0;for(var i=1;i<d-1;++i){if(i>=m){g=d-i;break}switch(c){case l.SEMICOLON:f=h._(/*BTDS*/"__JHASH__SCmuCOVb_Pg__JHASH__",[h._param("previous-items",f),h._param("following-items",a[i])]);break;case l.BULLET:f=h._(/*BTDS*/"__JHASH__f9RdP7tdSf8__JHASH__",[h._param("previous-items",f),h._param("following-items",a[i])]);break;default:f=h._(/*BTDS*/"__JHASH__4dM6sWMFHmU__JHASH__",[h._param("previous-items",f),h._param("following-items",a[i])])}}return g>0?n(f,g,b||k.AND,c||l.COMMA):o(f,e,b||k.AND,c||l.COMMA)};function n(a,b,c,d){if(d===l.COMMA)switch(c){case k.AND:return h._(/*BTDS*/"__JHASH__bssoxwHUctk__JHASH__",[h._param("previous-items",a),h._param("overflow-item-count",b)]);case k.OR:return h._(/*BTDS*/"__JHASH__FSmQmayqZTe__JHASH__",[h._param("previous-items",a),h._param("overflow-item-count",b)]);case k.NONE:return h._(/*BTDS*/"__JHASH__3D3R4jwPOsr__JHASH__",[h._param("previous-items",a),h._param("overflow-item-count",b)])}return h._(/*BTDS*/"__JHASH__0aBoHroKdnE__JHASH__",[h._param("previous-items",a)])}n.displayName=n.name+" [from "+f.id+"]";function o(a,b,d,e){switch(d){case k.AND:return h._(/*BTDS*/"__JHASH__2IRcYgoR_v3__JHASH__",[h._param("list-of-items",a),h._param("last-item",b)]);case k.OR:return h._(/*BTDS*/"__JHASH__3MgsQlJW7aL__JHASH__",[h._param("list-of-items",a),h._param("last-item",b)]);case k.NONE:switch(e){case l.SEMICOLON:return h._(/*BTDS*/"__JHASH__zUPNb-ryNTf__JHASH__",[h._param("previous-items",a),h._param("last-item",b)]);case l.BULLET:return h._(/*BTDS*/"__JHASH__Io9fLDWOknA__JHASH__",[h._param("list-of-items",a),h._param("last-item",b)]);default:return h._(/*BTDS*/"__JHASH__slIwsyEaO8M__JHASH__",[h._param("list-of-items",a),h._param("last-item",b)])}default:throw c("err")("[intlList] Invalid conjunction "+d+" provided to intlList")}}b.DELIMITERS=l;b.CONJUNCTIONS=k;d=b;e=d;g["default"]=e}),226); __d("WAWebAlbumsFormatAlbumMessageText",["fbt","WAWebAlbumMessageUtils","WAWebFbtIntlList","WAWebMessageAssociationUIUtils"],(function(a,b,c,d,e,f,g,h){function a(a){var b=a.associatedMessages;a=a.msg;b=d("WAWebAlbumMessageUtils").getAlbumPhotoAndVideoCountText((b=b)!=null?b:d("WAWebMessageAssociationUIUtils").getHiddenAssociatedMessages(a.id));return b.length===0?h._(/*BTDS*/"__JHASH__em91ZUotkiL__JHASH__"):c("WAWebFbtIntlList")(b,c("WAWebFbtIntlList").CONJUNCTIONS.NONE,c("WAWebFbtIntlList").DELIMITERS.COMMA).toString()}g["default"]=a}),226); __d("WAWebAlbumMessageUtils",["fbt","WAWebFrontendMsgGetters"],(function(a,b,c,d,e,f,g,h){function a(a){a=a.reduce(function(a,b){d("WAWebFrontendMsgGetters").getAsImage(b)?a.photoCount+=1:d("WAWebFrontendMsgGetters").getAsVideo(b)&&(a.videoCount+=1);return a},{photoCount:0,videoCount:0});var b=a.photoCount;a=a.videoCount;b=b>0?h._(/*BTDS*/"__JHASH__XKjxmsN1pjO__JHASH__",[h._plural(b,"photo-count")]):null;a=a>0?h._(/*BTDS*/"__JHASH__BE-csDTcCpf__JHASH__",[h._plural(a,"video-count")]):null;return[b,a].filter(Boolean)}g.getAlbumPhotoAndVideoCountText=a}),226); __d("WAWebBizAiAgentGating",["WAWebABProps"],(function(a,b,c,d,e,f,g){"use strict";function a(){return d("WAWebABProps").getABPropConfigValue("biz_ai_smb_agents_automatic_reply_enabled")}function b(){return d("WAWebABProps").getABPropConfigValue("smb_agent_chat_list_indicator_enabled")}function c(){return d("WAWebABProps").getABPropConfigValue("smb_agent_thread_control_notification_enabled")}g.isAiAgentAutoReplyEnabled=a;g.isAiAgentChatListIndicatorEnabled=b;g.isAiAgentThreadControlNotificationEnabled=c}),98); __d("WAWebBizAiAgentStatusUtils",["WAWebBizAiAgentGating","WAWebBusinessProfileCollection","WAWebContactGetters","WAWebMobilePlatforms","WAWebProtobufsE2E.pb","WAWebUserPrefsMeUser"],(function(a,b,c,d,e,f,g){function h(){var a=d("WAWebUserPrefsMeUser").getMeUser();a=d("WAWebBusinessProfileCollection").BusinessProfileCollection.get(a);return(a==null?void 0:a.isBizBot1p)===!0}function a(a){var b=d("WAWebContactGetters").getIsMe(a.contact);return d("WAWebMobilePlatforms").isSMB()&&d("WAWebBizAiAgentGating").isAiAgentAutoReplyEnabled()&&!b&&a.id.isUserNotPSA()&&h()}function i(a){return a.capiThreadControl===d("WAWebProtobufsE2E.pb").Message$CloudAPIThreadControlNotification$CloudAPIThreadControl.CONTROL_TAKEN}function b(a){return i(a)&&!a.forceDismissAiAgentBlockBar}function c(a){return i(a)&&d("WAWebBizAiAgentGating").isAiAgentThreadControlNotificationEnabled()}g.hasOnboardedAiAgent=h;g.isChatEligibleForAiAgent=a;g.isChatAiEnabled=i;g.shouldShowAiAgentBlockBar=b;g.shouldMuteNotification=c}),98); __d("WAWebMuteGetters",["WAWebGetters","WAWebGettersCaches"],(function(a,b,c,d,e,f,g){a=d("WAWebGetters").createGetterFactories({createCache:d("WAWebGettersCaches").createMuteCache});b=a.field;c=a.computed;e=a.clearCacheFor;f=e;d=b("callExpiration");a=b("expiration");e=c(function(a){a=a[0];return!!a},[a]);b=c(function(a){a=a[0];return!!a},[d]);g.clearMuteGetterCacheFor=f;g.getCallExpiration=d;g.getExpiration=a;g.getIsMuted=e;g.getIsCallMuted=b}),98); __d("WAWebNotificationMuteReason",["$InternalEnum"],(function(a,b,c,d,e,f){a=b("$InternalEnum").Mirrored(["ParentMsgMissing","GlobalMute","AppState","MutedChat","ArchivedChat","OfflineResumeInProgress","IgnoreGroupMsg","GroupFlood","ReactionFlood","NonHydratedReaction","MutedStatus","AlreadyNotifiedKic","KicOnNonEphemeralChat","KicOnNonOriginalMsg","KicByMe","UserLeftGroupKic","IgnoreAddedToCommunityHome","IgnoreFutureProof","IgnoreBizContentPlaceholder","IgnoreCallMsgs","IgnoreBotMsgs","IgnoreInternalSilentTag","IgnoreHiddenViewModeMsgs","AIRepliesOn","MutedStatusReaction","IgnoreViewedMsgs","GroupSafetyCheck"]);c=a;f["default"]=c}),66); __d("WAWebAiHandoffNotification",["fbt","WAWebBaseNotification","WAWebEnvironment","WAWebGetNotificationStrings","WAWebMuteCollection","WAWebMuteGetters","WAWebNotificationHelpers","WAWebNotificationIconUtils","WAWebNotificationMuteReason","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g,h){a=function(a){babelHelpers.inheritsLoose(e,a);function e(b){var c;b=b.chat;c=a.call(this)||this;c.chat=b;return c}var f=e.prototype;f.shouldMute=function(a){if(d("WAWebMuteGetters").getIsMuted(d("WAWebMuteCollection").MuteCollection.globalMute()))return c("WAWebNotificationMuteReason").GlobalMute;if(d("WAWebNotificationHelpers").shouldMuteDueToAppState(a))return c("WAWebNotificationMuteReason").AppState;if(d("WAWebMuteGetters").getIsMuted(this.chat.mute))return c("WAWebNotificationMuteReason").MutedChat;if(this.chat.archive)return c("WAWebNotificationMuteReason").ArchivedChat;return d("WAWebNotificationHelpers").isOfflineResumeInProgress()&&!c("WAWebEnvironment").isWindows?c("WAWebNotificationMuteReason").OfflineResumeInProgress:null};f.buildKey=function(){return"handoff:"+this.chat.id.toString()};f.getIcon=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){return d("WAWebNotificationIconUtils").getChatNotificationIcon(this.chat,this.abortController.signal)});function c(){return a.apply(this,arguments)}return c}();f.getBannerOptions=function(){return{wid:this.chat.id,title:i(),body:d("WAWebGetNotificationStrings").getNotificationBody(babelHelpers["extends"]({},j(this.chat)))}};return e}(d("WAWebBaseNotification").WABaseNotification);function i(){return h._(/*BTDS*/"__JHASH__l64AO3JRQp1__JHASH__").toString()}function j(a){a=a.contact.name;a=h._(/*BTDS*/"__JHASH__tPukcDl90lU__JHASH__",[h._param("name",a)]);return{body:a.toString()}}g.AiHandoffNotification=a;g.getNotificationTitle=i;g.getNotificationParts=j}),226); __d("WAWebRestoreBotProfilesFromDb",["WALogger","WAWebBotProfileCollection","WAWebSchemaBotProfile","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["restore-bot-profiles: commands parsing failed"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["restore-bot-profiles: commands are not an array"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["restore-bot-profiles: prompts parsing failed"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["restore-bot-profiles: prompts are not an array"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["restore-bot-profiles: invalid id"]);l=function(){return a};return a}function a(){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield d("WAWebSchemaBotProfile").getBotProfileTable().all());a.forEach(function(a){var b=a.id,c=a.prompts,e=a.commands;a=babelHelpers.objectWithoutPropertiesLoose(a,["id","prompts","commands"]);var f;try{f=d("WAWebWidFactory").createUserWid(b)}catch(a){d("WALogger").ERROR(l()).sendLogs("restore-bot-profiles: invalid id");return}b=[];if(c)try{b=JSON.parse(c),Array.isArray(b)||(b=[],d("WALogger").ERROR(k()).sendLogs("restore-bot-profiles: prompts are not an array"))}catch(a){d("WALogger").ERROR(j()).sendLogs("restore-bot-profiles: prompts parsing failed")}c=[];if(e!=null)try{c=JSON.parse(e),Array.isArray(c)||(c=[],d("WALogger").ERROR(i()).sendLogs("restore-bot-profiles: commands are not an array"))}catch(a){d("WALogger").ERROR(h()).sendLogs("restore-bot-profiles: commands parsing failed")}d("WAWebBotProfileCollection").BotProfileCollection.gadd(babelHelpers["extends"]({id:f,commands:c,prompts:b},a))})});return m.apply(this,arguments)}g.restoreBotProfilesFromDb=a}),98); __d("WAWebRequestBotList",["WALogger","WASmaxBotBotListRPC","WAWebWidFactory","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[bot] requestBotList failed"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[bot] requestBotList failed"]);i=function(){return a};return a}function a(){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield d("WASmaxBotBotListRPC").sendBotListRPC({botV:"2"}));switch(a.name){case"BotListResponseSuccessV2":var b=a.value,e=b.botDefaultJid;b=b.botSection;var f=[];b.forEach(function(a){a.bot.forEach(function(a){var b=a.jid;a=a.personaId;f.push({id:d("WAWebWidFactory").createWid(b),isDefault:b===e,personaId:a})})});return f;case"BotListResponseSuccessV3":throw c("err")(a.name+" is not implemented");case"BotListResponseError":b=a.value.errorBotListErrors.value;a=b.code;b=b.text;d("WALogger").ERROR(i()).devConsole("[bot] requestBotList failed with code "+a+", "+b);return[]}});return j.apply(this,arguments)}function e(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WASmaxBotBotListRPC").sendBotListRPC({botV:"3",botBhash:a}));switch(a.name){case"BotListResponseSuccessV3":var b=a.value,e=b.botDefault,f=b.botSection;b=b.botBhash;var g=[];f.forEach(function(a){a.bot.forEach(function(a){var b=a.jid;a=a.personaId;g.push({id:d("WAWebWidFactory").createWid(b),isDefault:b===e,personaId:a})})});return{botList:g,botBhash:b};case"BotListResponseSuccessV2":throw c("err")(a.name+" is not implemented");case"BotListResponseError":f=a.value.errorBotListErrors.value;b=f.code;a=f.text;d("WALogger").ERROR(h()).devConsole("[bot] requestBotList failed with code "+b+", "+a);return null}});return k.apply(this,arguments)}g.requestBotList=a;g.requestUgcBotList=e}),98); __d("WAWebBotProfileCategory",["$InternalEnum"],(function(a,b,c,d,e,f){a=b("$InternalEnum")({SYNTHETIC:"synthetic",LIVING:"living",FICTIONAL:"fictional",HISTORICAL:"historical"});f.BotProfileCategory=a}),66); __d("WAWebRequestBotProfiles",["Promise","WAWebBackendErrors","WAWebBotProfileCategory","WAWebUsync","WAWebUsyncUser","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h;function a(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a.length===0)return(h||(h=b("Promise"))).resolve([]);var e=new(d("WAWebUsync").USyncQuery)().withContext("interactive").withMode("query").withBotProfileProtocol();a.forEach(function(a){var b=a.id;a=a.personaId;e.withUser(new(d("WAWebUsyncUser").USyncUser)().withId(b).withPersonaId(a))});a=(yield e.execute());var f=a.error.all||a.error.status;if(f)throw new(d("WAWebBackendErrors").ServerStatusCodeError)(f.errorCode,f.errorText);f=a.list;return!f.length?(h||(h=b("Promise"))).reject(c("err")("no status data returned for user")):f.map(function(a){var b=a.bot;a=a.id;return{id:a,name:b.name,attrs:b.attributes,description:b.description,category:(a=d("WAWebBotProfileCategory").BotProfileCategory.cast(b.category))!=null?a:d("WAWebBotProfileCategory").BotProfileCategory.SYNTHETIC,isDefault:b.isDefault,prompts:b.prompts,personaId:b.personaId,commands:b.commands,commandsDescription:b.commandsDescription,isMetaCreated:b.isMetaCreated,creatorName:b.creatorName,creatorProfileUrl:b.creatorProfileUrl,lastUpdateTs:Date.now()}})});return i.apply(this,arguments)}g.requestBotProfiles=a}),98); __d("WAWebInitializeBots",["WALogger","WATimeUtils","WAWebABProps","WAWebBotGating","WAWebCmd","WAWebPersistBotProfiles","WAWebRequestBotList","WAWebRequestBotProfiles","WAWebRestoreBotProfilesFromDb","WAWebRuntimeEnvironmentUtils","WAWebUserPrefsBot","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["getBotProfilesFromServer: exceed max number of UGC bot: ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[bot] initializing bots complete, next fetch at ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[bot] restoring bots from DB"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[bot] requesting bots from server"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[bot] not initializing bots due to feature being disabled"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[bot] skipping bot initialization in worker"]);m=function(){return a};return a}function n(){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(d("WAWebRuntimeEnvironmentUtils").isWorker()){d("WALogger").LOG(m());return}if(!d("WAWebBotGating").isBotEnabled()){d("WALogger").LOG(l());return}var a=s(),c=d("WATimeUtils").unixTime(),e=d("WAWebABProps").getABPropConfigValue("bonsai_update_interval"),f;a+e<c?(d("WALogger").LOG(k()),yield q(),f=e):(d("WALogger").LOG(j()),yield d("WAWebRestoreBotProfilesFromDb").restoreBotProfilesFromDb(),f=a+e-c);self.setTimeout(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield n()}),f*1e3);d("WALogger").LOG(i(),c+f)});return o.apply(this,arguments)}var p=500;function q(){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=[];if(d("WAWebBotGating").isUgcBotEnabled()){var b=(yield d("WAWebRequestBotList").requestUgcBotList(d("WAWebUserPrefsBot").getUgcBotListLastBhash()));if(b){var c=b.botList.length;if(c>p){d("WALogger").ERROR(h(),c).sendLogs("exceed-max-ugc-bots");t();return}d("WAWebUserPrefsBot").setUgcBotListLastBhash(b.botBhash);a=b.botList}}else a=(yield d("WAWebRequestBotList").requestBotList());c=(yield d("WAWebRequestBotProfiles").requestBotProfiles(a));yield d("WAWebPersistBotProfiles").persistBotProfiles(c);t()});return r.apply(this,arguments)}d("WAWebCmd").Cmd.on("on_ab_props_update",function(){void n()});d("WAWebCmd").Cmd.on("ab_props_loaded",function(){void n()});function s(){return d("WAWebBotGating").isUgcBotEnabled()?d("WAWebUserPrefsBot").getUgcBotListLastRequestedTimestamp():d("WAWebUserPrefsBot").getBotListLastRequestedTimestamp()}function t(){d("WAWebBotGating").isUgcBotEnabled()?d("WAWebUserPrefsBot").setUgcBotListLastRequestedTimestamp(d("WATimeUtils").unixTime()):d("WAWebUserPrefsBot").setBotListLastRequestedTimestamp(d("WATimeUtils").unixTime())}g.initializeBots=n}),98); __d("WAWebPersistBotProfiles",["WAWebBotProfileCollection","WAWebSchemaBotProfile","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield d("WAWebSchemaBotProfile").getBotProfileTable().bulkCreateOrMerge(a.map(function(a){var b=a.id,c=a.prompts,d=a.commands;a=babelHelpers.objectWithoutPropertiesLoose(a,["id","prompts","commands"]);return babelHelpers["extends"]({id:b.toString(),prompts:JSON.stringify(c),commands:JSON.stringify(d)},a)})),a.forEach(function(a){return d("WAWebBotProfileCollection").BotProfileCollection.gadd(babelHelpers["extends"]({id:a.id},a))})});return h.apply(this,arguments)}g.persistBotProfiles=a}),98); __d("WAWebCreateBizBotSysMsgAction",["WAWebBotSystemMsg","WAWebBotTypes","WAWebDBProcessMessage","WAWebMsgModelFromData","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a.bizBotSystemMsgType===d("WAWebBotTypes").BizBotType.BIZ_1P)return;var b=d("WAWebBotSystemMsg").genBizBot1pDisclosureMessage(a.id);a.msgs.add(d("WAWebMsgModelFromData").msgModelFromMsgData(b));yield d("WAWebDBProcessMessage").storeMessages([b],a.id);yield a.updateBizBotSysMsgCreated(d("WAWebBotTypes").BizBotType.BIZ_1P)});return h.apply(this,arguments)}g.maybeCreateBizBot1pDisclosureSysMsg=a}),98); __d("WAWebHandleBizBotAutomatedTypeAction",["WALogger","WAWebApiBusinessProfile","WAWebBotGating","WAWebBotSystemMsg","WAWebBotTos","WAWebBotTypes","WAWebChatCollection","WAWebContactSystemMsg","WAWebDBProcessMessage","WAWebMsgModelFromData","WAWebPrivacyModeSystemMsg","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[biz-bot] created generic privacy system message for ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[biz-bot] created 3p system message for ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[biz-bot] created 1p system message for ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[biz-bot] handle automatedType transition for ",". prev: ",", next: ",""]);k=function(){return a};return a}function a(a,b,c){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){var e=d("WAWebChatCollection").ChatCollection.get(a);if(!e)return;b=b;if(!b){a=(yield d("WAWebApiBusinessProfile").getBusinessProfileRow(a.toString()));b=(a=d("WAWebBotTypes").BizBotAutomatedType.cast(a==null?void 0:a.automatedType))!=null?a:d("WAWebBotTypes").BizBotAutomatedType.UNKNOWN}c=(a=c)!=null?a:d("WAWebBotTypes").BizBotAutomatedType.UNKNOWN;if(b===c)return;d("WALogger").DEV(k(),e.id.toString(),b,c);b===d("WAWebBotTypes").BizBotAutomatedType.UNKNOWN&&c===d("WAWebBotTypes").BizBotAutomatedType.PARTIAL_1P?yield m(e):b===d("WAWebBotTypes").BizBotAutomatedType.UNKNOWN&&c===d("WAWebBotTypes").BizBotAutomatedType.FULL_3P?yield o(e):b===d("WAWebBotTypes").BizBotAutomatedType.FULL_3P&&c===d("WAWebBotTypes").BizBotAutomatedType.UNKNOWN&&(yield q(e))});return l.apply(this,arguments)}function m(a){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!d("WAWebBotTos").hasAcceptedBizBotTos()||a.bizBotSystemMsgType===d("WAWebBotTypes").BizBotType.BIZ_1P)return;var b=d("WAWebBotSystemMsg").genBizBot1pDisclosureMessage(a.id);yield d("WAWebDBProcessMessage").storeMessages([b],b.id.remote);if(d("WAWebBotGating").isBizBot1pEnabled()){b=d("WAWebMsgModelFromData").msgModelFromMsgData(b);a.msgs.add(b)}yield a.updateBizBotSysMsgCreated(d("WAWebBotTypes").BizBotType.BIZ_1P);d("WALogger").DEV(j(),a.id.toString())});return n.apply(this,arguments)}function o(a){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!d("WAWebBotTos").hasAcceptedBizBotTos()||a.bizBotSystemMsgType===d("WAWebBotTypes").BizBotType.BIZ_3P)return;var b=d("WAWebBotSystemMsg").genBizBot3pDisclosureMessage(a.id);yield d("WAWebDBProcessMessage").storeMessages([b],b.id.remote);b=d("WAWebMsgModelFromData").msgModelFromMsgData(b);a.msgs.add(b);yield a.updateBizBotSysMsgCreated(d("WAWebBotTypes").BizBotType.BIZ_3P);d("WALogger").DEV(i(),a.id.toString())});return p.apply(this,arguments)}function q(a){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a.bizBotSystemMsgType==null)return;var b=a.id,e,f=d("WAWebPrivacyModeSystemMsg").getReducedPrivacyMode(a.contact.privacyMode);switch(f){case d("WAWebPrivacyModeSystemMsg").ReducedPrivacyMode.E2EE:e=d("WAWebContactSystemMsg").genEncryptNotificationMsg(b,"encrypt_now");break;case d("WAWebPrivacyModeSystemMsg").ReducedPrivacyMode.BSP:e=d("WAWebContactSystemMsg").genNonE2ENotificationMsg(b,"biz_privacy_mode_to_bsp");break;case d("WAWebPrivacyModeSystemMsg").ReducedPrivacyMode.FB:e=d("WAWebContactSystemMsg").genNonE2ENotificationMsg(b,"biz_privacy_mode_to_fb");break;case d("WAWebPrivacyModeSystemMsg").ReducedPrivacyMode.HOSTED_GROUP:e=d("WAWebContactSystemMsg").genNonE2ENotificationMsg(b,"is_capi_hosted_group");break}if(!e)throw c("err")("Unhandled privacy mode");yield d("WAWebDBProcessMessage").storeMessages([e],e.id.remote);f=d("WAWebMsgModelFromData").msgModelFromMsgData(e);a.msgs.add(f);yield a.updateBizBotSysMsgCreated(null);d("WALogger").DEV(h(),a.id.toString())});return r.apply(this,arguments)}g.handleBizBotAutomatedTypeTransition=a}),98); __d("WAWebHandleBizBotWelcomeMsgProtocolModeAction",["WALogger","WAWebApiBusinessProfile","WAWebBotGating","WAWebBotTypes","WAWebBotWelcomeRequestSync","WAWebChatCollection","WAWebSyncdCoreApi","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[biz-bot] reset welcome msg request flag to false"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[biz-bot] handle welcomeMsgProtocolMode transition for ",". prev: ",", next: ",""]);i=function(){return a};return a}function a(a,b,c){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){if(!d("WAWebBotGating").isBizBot3pAvailable())return;var e=d("WAWebChatCollection").ChatCollection.get(a);if(!e)return;b=b;if(!b){a=(yield d("WAWebApiBusinessProfile").getBusinessProfileRowLidAware(a.toString()));b=(a=d("WAWebBotTypes").BotWelcomeMsgProtocolModeType.cast(a==null?void 0:a.welcomeMsgProtocolMode))!=null?a:d("WAWebBotTypes").BotWelcomeMsgProtocolModeType.NONE}c=(a=c)!=null?a:d("WAWebBotTypes").BotWelcomeMsgProtocolModeType.NONE;if(b===c)return;d("WALogger").DEV(i(),e.id.toString(),b,c);c===d("WAWebBotTypes").BotWelcomeMsgProtocolModeType.NONE&&(d("WALogger").DEV(h()),yield k(e))});return j.apply(this,arguments)}function k(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!a.hasRequestedWelcomeMsg)return;a.hasRequestedWelcomeMsg=!1;var e=(yield c("WAWebBotWelcomeRequestSync").getBotWelcomeRequestSetMutation(a.id,!1));yield d("WAWebSyncdCoreApi").lockForSync(["chat"],[e],function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){b=b[0];return b.merge(a.id.toString(),{hasRequestedWelcomeMsg:!1})});return function(a){return c.apply(this,arguments)}}())});return l.apply(this,arguments)}g.handleBizBotWelcomeMsgProtocolModeTransition=a}),98); __d("WAWebBotProfileAction",["WAWebRequestBotProfiles","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebRequestBotProfiles").requestBotProfiles([{id:a,isDefault:!1}]))[0];return a});return h.apply(this,arguments)}g.queryBotProfile=a}),98); __d("WAWebBotProfileCollection",["WALogger","WAWebBaseCollection","WAWebBotGating","WAWebBotProfileAction","WAWebBotProfileModel","WAWebPersistBotProfiles","WAWebWidFactory","asyncToGeneratorRuntime","cr:10195"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Unable to find bot profile with id"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[BotProfileCollection] query bot profile"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["_findAndParse only supports FBID bots"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[BotProfileCollection] updating bot profile"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[BotProfileCollection] skip updating bot profile"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["update only supports FBID bots"]);m=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(c,a);function c(){return a.apply(this,arguments)||this}var e=c.prototype;e.getDefaultBot=function(){return this.findFirst(function(a){return a.isDefault===!0})};e.findImpl=function(a){return this.$BotProfileCollectionImpl$p_1(a)};e.update=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if(!a.isFbidBot()){d("WALogger").ERROR(m()).devConsole(a);return}b=(b=(b=this.get(a))==null?void 0:b.lastUpdateTs)!=null?b:0;if(b+d("WAWebBotGating").ugcBotProfileSyncInterval()>Date.now()){d("WALogger").LOG(l()).devConsole({wid:a,lastUpdateTs:b});return}d("WALogger").LOG(k()).devConsole({wid:a,lastUpdateTs:b});yield this.$BotProfileCollectionImpl$p_1(a)});function c(b,c){return a.apply(this,arguments)}return c}();e.$BotProfileCollectionImpl$p_1=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=d("WAWebWidFactory").createWidFromWidLike(a);if(!b.isFbidBot()){d("WALogger").ERROR(j()).devConsole(b);return null}var c=(yield d("WAWebBotProfileAction").queryBotProfile(b));d("WALogger").LOG(i()).devConsole({wid:b,botProfile:c});if(!c){d("WALogger").WARN(h()).devConsole(a);return null}yield d("WAWebPersistBotProfiles").persistBotProfiles([c]);return babelHelpers["extends"]({},c)});function c(b){return a.apply(this,arguments)}return c}();return c}(d("WAWebBaseCollection").BaseCollection);a.model=c("WAWebBotProfileModel");e=new a();g.BotProfileCollection=e}),98); __d("WAWebBotProfileModel",["WAWebBaseModel","WAWebContactCollection","WAWebWid"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.name=d("WAWebBaseModel").prop(),c.attrs=d("WAWebBaseModel").prop(""),c.description=d("WAWebBaseModel").prop(),c.category=d("WAWebBaseModel").prop(),c.isDefault=d("WAWebBaseModel").prop(),c.prompts=d("WAWebBaseModel").prop(function(){return[]}),c.personaId=d("WAWebBaseModel").prop(),c.commands=d("WAWebBaseModel").prop(function(){return[]}),c.commandsDescription=d("WAWebBaseModel").prop(),c.isMetaCreated=d("WAWebBaseModel").prop(),c.creatorName=d("WAWebBaseModel").prop(),c.creatorProfileUrl=d("WAWebBaseModel").prop(),c.lastUpdateTs=d("WAWebBaseModel").prop(),c.contact=d("WAWebBaseModel").session(),b)||babelHelpers.assertThisInitialized(c)}var c=b.prototype;c.initialize=function(){a.prototype.initialize.call(this),this.addChild("contact",d("WAWebContactCollection").ContactCollection.gadd({id:this.id,name:this.name,verifiedName:this.name,shortName:this.name,pushName:this.name,isBusiness:!0,type:"out"}))};return b}(d("WAWebBaseModel").BaseModel);a.Proxy="botProfile";a.idClass=c("WAWebWid");b=d("WAWebBaseModel").defineModel(a);g["default"]=b}),98); __d("WAWebBizBotHeroIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k="biz-bot-hero";function a(a){var b=a.iconXstyle,e=a.height,f=a.width,g=a.viewBox;a=babelHelpers.objectWithoutPropertiesLoose(a,["iconXstyle","height","width","viewBox"]);var h;if(g){var l=g.x;l=l===void 0?0:l;var m=g.y;m=m===void 0?0:m;var n=g.width;n=n===void 0?0:n;g=g.height;g=g===void 0?0:g;h=[l,m,n,g].join(" ")}l=120;m=240;(e!=null||f!=null)&&(l=e,m=f);return j.jsx(d("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers["extends"]({name:k},a,{children:j.jsxs("svg",{viewBox:(n=h)!=null?n:"0 0 240 120",height:l,width:m,preserveAspectRatio:"xMidYMid meet",className:(i||(i=c("stylex")))(b),fill:"none",children:[j.jsx("title",{children:k}),j.jsxs("g",{clipPath:"url(#a)",children:[j.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m29.7 55.473 3.41.695-.655 3.178c-.423 1.963.859 3.872 2.836 4.281a3.66 3.66 0 0 0 4.336-2.795l.655-3.178 3.204.655a3.66 3.66 0 0 0 4.336-2.796c.423-1.963-.858-3.872-2.836-4.281l-3.204-.655.709-3.368c.423-1.964-.86-3.873-2.837-4.282a3.68 3.68 0 0 0-4.336 2.81l-.709 3.367-3.409-.695a3.68 3.68 0 0 0-4.336 2.81c-.423 1.963.859 3.872 2.836 4.281v-.027Z",fill:"#FCF5EB",stroke:"#316474",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),j.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m186 33.355-.914-9.969c-.081-1.022-.736-1.922-1.691-2.372a2.978 2.978 0 0 0-2.918.259l-8.291 5.768a2.867 2.867 0 0 0-1.227 2.618c.082 1.023.736 1.923 1.691 2.373l9.205 4.2a2.924 2.924 0 0 0 2.918-.26A2.867 2.867 0 0 0 186 33.356Z",fill:"#73F793",stroke:"#316474",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),j.jsx("path",{d:"M159.3 22.555c-.655-4.5-4.173-7.814-8.359-7.814H65.754c-4.145 0-7.704 3.3-8.359 7.814L53.837 47.29h.041c0 6.654 2.946 12.368 7.405 16.254V91.95c0 6.86 5.468 12.464 12.273 12.695v.028h69.177c7.009 0 12.723-5.714 12.723-12.723V63.545c4.472-3.886 7.404-9.613 7.404-16.295l-3.56-24.695Z",fill:"white"}),j.jsx("path",{d:"M159.3 22.555c-.655-4.5-4.173-7.814-8.359-7.814H65.754c-4.145 0-7.704 3.3-8.359 7.814L53.837 47.29h.041c0 6.654 2.946 12.368 7.405 16.254V91.95c0 6.86 5.468 12.464 12.273 12.695v.028h69.177c7.009 0 12.723-5.714 12.723-12.723V63.545c4.472-3.886 7.404-9.613 7.404-16.295l-3.56-24.695Z",fill:"#06CF9C",fillOpacity:.2}),j.jsx("path",{d:"M155.455 63.56v28.404c0 7.009-5.714 12.722-12.723 12.722H74.004c-7.009 0-12.722-5.713-12.722-12.722V63.79",stroke:"#316474",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),j.jsx("path",{d:"M95.332 67.486a9.398 9.398 0 0 1 1.636 5.319v31.868m-23.4.013V72.818c0-1.09.546-2.945.886-3.927m68.428-.001v14.046c0 5.196-4.214 9.41-9.409 9.41h-17.741c-5.196 0-9.409-4.214-9.409-9.41V70.964m44.659-56.224H65.768c-4.145 0-7.704 3.3-8.359 7.815L53.85 47.29h109.009L159.3 22.555c-.655-4.5-4.173-7.814-8.359-7.814h.041Z",stroke:"#316474",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),j.jsx("path",{d:"M162.859 47.264c0 15.804-16.418 26.318-30.75 19.663-3.436-1.595-5.577-3.136-5.577-3.136-1.459 1.364-7.882 7.036-17.823 7.173-10.377.136-17.114-5.878-18.505-7.173-.313.218-.831.573-1.5.968a43.912 43.912 0 0 1-4.077 2.168c-14.332 6.655-30.75-3.859-30.75-19.663h109.009M90.218 63.79l2.25-49.035m34.077 49.035-2.14-49.035",stroke:"#316474",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),j.jsx("path",{d:"M55.923 103.8c4.759 0 8.618-3.805 8.618-8.51 0-4.704-3.86-8.508-8.618-8.508-4.76 0-8.618 3.804-8.618 8.509 0 4.704 3.859 8.509 8.618 8.509Z",fill:"#fff",stroke:"#316474",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),j.jsx("path",{d:"m224.605 58.268-18.028-20.74c-2.195-2.196-5.972-.642-5.972 2.468v2.85h-22.132a7.525 7.525 0 0 0-7.528 7.527v20.454c0 4.132 3.341 7.5 7.473 7.528l22.173.272v2.85c0 3.11 3.764 4.678 5.973 2.468l18.027-20.74a3.505 3.505 0 0 0 0-4.95l.014.013Z",fill:"#FCF5EB",stroke:"#316474",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),j.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M180.559 88.132h-.027l-10.868-4.596c-.6-.259-1.05-.709-1.282-1.268l-4.664-10.677c-1.077-2.495-3.491-2.714-4.173-2.714-.681 0-3.109.232-4.172 2.741l-4.623 10.623c-.286.614-.736 1.064-1.309 1.295l-10.95 4.623c-2.496 1.036-2.755 3.327-2.755 4.091 0 .71.232 3.055 2.728 4.105l10.5 4.54c.545.246.995.682 1.268 1.241l5.073 11.019c1.104 2.386 3.368 2.618 4.131 2.618.696 0 3.082-.205 4.173-2.687l4.732-10.895c.286-.614.736-1.064 1.295-1.296l10.896-4.595h.027c2.427-1.09 2.7-3.327 2.7-4.105 0-.736-.245-3.027-2.7-4.104h-.014l.014.04Z",fill:"#fff",stroke:"#316474",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]}),j.jsx("defs",{children:j.jsx("clipPath",{id:"a",children:j.jsx("path",{fill:"#fff",d:"M0 0h240v120H0z"})})})]})}))}a.displayName=a.name+" [from "+f.id+"]";g.BizBotHeroIcon=a}),98); __d("WAWebWamEnumBotBizActionType",[],(function(a,b,c,d,e,f){a=Object.freeze({BOT_BIZ_CARD_CLICK:1,BOT_BIZ_CARD_MESSAGE_CLICK:2,BOT_BIZ_CARD_VIEW_AI_CLICK:3,BOT_BIZ_DEEPLINK_CLICK:4,BOT_BIZ_NUX_APPEAR:5,BOT_BIZ_NUX_DISMISS:6,BOT_BIZ_NUX_SELECT:7,BOT_BIZ_INFO_CHAT_CLICK:8,BOT_BIZ_NUX_CONTINUE_CLICKED:9,BOT_BIZ_NUX_DISMISS_AUTO_ACCEPT:10,BOT_BIZ_NUX_APPEAR_MERGED:11,BOT_BIZ_NUX_APPEAR_NEW:12});f.BOT_BIZ_ACTION_TYPE=a}),66); __d("WAWebWamEnumBotBizEntryPoint",[],(function(a,b,c,d,e,f){a=Object.freeze({SHARED_BOT_BIZ_CARD:1,SHARED_BOT_BIZ_DEEPLINK:2,BOT_BIZ_CHAT:3});f.BOT_BIZ_ENTRY_POINT=a}),66); __d("WAWebWamEnumBotBizType",[],(function(a,b,c,d,e,f){a=Object.freeze({BOT_BIZ_3P:1,BOT_BIZ_1P:2});f.BOT_BIZ_TYPE=a}),66); __d("WAWebBotBizJourneyWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumBotBizActionType","WAWebWamEnumBotBizEntryPoint","WAWebWamEnumBotBizType","WAWebWamEnumBotType"],(function(a,b,c,d,e,f,g){a=d("WAWebWamCodegenUtils").defineEvents({BotBizJourney:[4868,{appSessionId:[1,d("WAWebWamCodegenUtils").TYPES.STRING],botBizActionType:[5,d("WAWebWamEnumBotBizActionType").BOT_BIZ_ACTION_TYPE],botBizEntryPoint:[6,d("WAWebWamEnumBotBizEntryPoint").BOT_BIZ_ENTRY_POINT],botBizType:[7,d("WAWebWamEnumBotBizType").BOT_BIZ_TYPE],botType:[4,d("WAWebWamEnumBotType").BOT_TYPE]},[1,1,1],"regular"]},{BotBizJourney:[]});g.BotBizJourneyWamEvent=a}),98); __d("WAWebGetSharedSessionId",["WAWebPonyfillsCryptoRandomUUID"],(function(a,b,c,d,e,f,g){var h=c("WAWebPonyfillsCryptoRandomUUID")();function a(){return h}g.getSharedSessionId=a}),98); __d("WAWebBizBotLogging",["WAWebBotBizJourneyWamEvent","WAWebBotGating","WAWebChatEntryPoint","WAWebGetSharedSessionId","WAWebWamEnumBotBizActionType","WAWebWamEnumBotBizEntryPoint","WAWebWamEnumBotBizType","WAWebWamEnumBotType"],(function(a,b,c,d,e,f,g){function a(a){if(!d("WAWebBotGating").isBizBot3pEnabled())return;a=new(d("WAWebBotBizJourneyWamEvent").BotBizJourneyWamEvent)({appSessionId:d("WAWebGetSharedSessionId").getSharedSessionId(),botBizEntryPoint:d("WAWebWamEnumBotBizEntryPoint").BOT_BIZ_ENTRY_POINT.SHARED_BOT_BIZ_CARD,botBizActionType:j(a),botBizType:h("3p"),botType:i("3p")});a.commit()}function b(){if(!d("WAWebBotGating").isBizBot3pEnabled())return;var a=new(d("WAWebBotBizJourneyWamEvent").BotBizJourneyWamEvent)({appSessionId:d("WAWebGetSharedSessionId").getSharedSessionId(),botBizEntryPoint:d("WAWebWamEnumBotBizEntryPoint").BOT_BIZ_ENTRY_POINT.SHARED_BOT_BIZ_DEEPLINK,botBizActionType:d("WAWebWamEnumBotBizActionType").BOT_BIZ_ACTION_TYPE.BOT_BIZ_DEEPLINK_CLICK,botBizType:h("3p"),botType:i("3p")});a.commit()}function c(a,b,c){if(a==="3p"&&!d("WAWebBotGating").isBizBot3pEnabled()||a==="1p"&&!d("WAWebBotGating").isBizBot1pEnabled())return;var e;switch(c){case d("WAWebChatEntryPoint").ChatEntryPoint.Vcard:e=d("WAWebWamEnumBotBizEntryPoint").BOT_BIZ_ENTRY_POINT.SHARED_BOT_BIZ_CARD;break;case d("WAWebChatEntryPoint").ChatEntryPoint.Chatlist:e=d("WAWebWamEnumBotBizEntryPoint").BOT_BIZ_ENTRY_POINT.BOT_BIZ_CHAT;break;default:e=void 0}c=new(d("WAWebBotBizJourneyWamEvent").BotBizJourneyWamEvent)({appSessionId:d("WAWebGetSharedSessionId").getSharedSessionId(),botBizActionType:j(b),botBizEntryPoint:e,botBizType:h(a),botType:i(a)});c.commit()}function h(a){switch(a){case"1p":return d("WAWebWamEnumBotBizType").BOT_BIZ_TYPE.BOT_BIZ_1P;case"3p":return d("WAWebWamEnumBotBizType").BOT_BIZ_TYPE.BOT_BIZ_3P}}function i(a){switch(a){case"1p":return d("WAWebWamEnumBotType").BOT_TYPE.BOT_1P_BIZ;case"3p":return d("WAWebWamEnumBotType").BOT_TYPE.BOT_3P_BIZ}}function j(a){switch(a){case"card_click":return d("WAWebWamEnumBotBizActionType").BOT_BIZ_ACTION_TYPE.BOT_BIZ_CARD_CLICK;case"message_click":return d("WAWebWamEnumBotBizActionType").BOT_BIZ_ACTION_TYPE.BOT_BIZ_CARD_MESSAGE_CLICK;case"view_ai_click":return d("WAWebWamEnumBotBizActionType").BOT_BIZ_ACTION_TYPE.BOT_BIZ_CARD_VIEW_AI_CLICK;case"nux_appear":return d("WAWebWamEnumBotBizActionType").BOT_BIZ_ACTION_TYPE.BOT_BIZ_NUX_APPEAR;case"nux_dismiss":return d("WAWebWamEnumBotBizActionType").BOT_BIZ_ACTION_TYPE.BOT_BIZ_NUX_DISMISS;case"nux_select":return d("WAWebWamEnumBotBizActionType").BOT_BIZ_ACTION_TYPE.BOT_BIZ_NUX_SELECT;case"nux_view_new":return d("WAWebWamEnumBotBizActionType").BOT_BIZ_ACTION_TYPE.BOT_BIZ_NUX_APPEAR_NEW;case"nux_view_merged":return d("WAWebWamEnumBotBizActionType").BOT_BIZ_ACTION_TYPE.BOT_BIZ_NUX_APPEAR_MERGED;case"nux_dismiss_auto_accept":return d("WAWebWamEnumBotBizActionType").BOT_BIZ_ACTION_TYPE.BOT_BIZ_NUX_DISMISS_AUTO_ACCEPT;case"nux_continue_clicked":return d("WAWebWamEnumBotBizActionType").BOT_BIZ_ACTION_TYPE.BOT_BIZ_NUX_CONTINUE_CLICKED}}g.logBizBot3pContactCardJourneyEvent=a;g.logBizBot3pDeepLinkClickEvent=b;g.logBizBotNuxJourneyEvent=c}),98); __d("WAWebAiSignalIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k="ai-signal";function a(a){var b=a.iconXstyle,e=a.height,f=a.width,g=a.viewBox;a=babelHelpers.objectWithoutPropertiesLoose(a,["iconXstyle","height","width","viewBox"]);var h;if(g){var l=g.x;l=l===void 0?0:l;var m=g.y;m=m===void 0?0:m;var n=g.width;n=n===void 0?0:n;g=g.height;g=g===void 0?0:g;h=[l,m,n,g].join(" ")}l=13;m=12;(e!=null||f!=null)&&(l=e,m=f);return j.jsx(d("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers["extends"]({name:k},a,{children:j.jsxs("svg",{viewBox:(n=h)!=null?n:"0 0 12 13",height:l,width:m,preserveAspectRatio:"xMidYMid meet",className:(i||(i=c("stylex")))(b),fill:"none",children:[j.jsx("title",{children:k}),j.jsxs("g",{fill:"currentColor",children:[j.jsx("path",{d:"M6.216 3.376a1.428 1.428 0 1 0 0-2.856 1.428 1.428 0 0 0 0 2.856Zm5.244 1.956a15.06 15.06 0 0 0-1.251-2.185.542.542 0 0 0-.447-.24.542.542 0 0 0-.447.24 14.955 14.955 0 0 0-1.25 2.185.542.542 0 0 0 .017.508c.09.154.248.252.433.267.413.033.832.05 1.247.048.415.001.834-.015 1.247-.048a.542.542 0 0 0 .432-.267.542.542 0 0 0 .018-.508Z"}),j.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.293 8.077h.002-.002Zm2.224-3.45a.69.69 0 0 1 .641-.427.69.69 0 0 1 .64.423l.716 1.662a.366.366 0 0 0 .198.195h.002l1.671.714.004.002a.694.694 0 0 1 .415.64.69.69 0 0 1-.415.637l-.004.002-1.673.714a.382.382 0 0 0-.2.202l-.726 1.695a.689.689 0 0 1-.64.418.691.691 0 0 1-.636-.407v-.002l-.78-1.716a.392.392 0 0 0-.196-.193L.92 8.479A.688.688 0 0 1 .5 7.84c0-.119.04-.475.423-.637l1.681-.719a.387.387 0 0 0 .2-.2l.713-1.656Z"})]})]})}))}a.displayName=a.name+" [from "+f.id+"]";g.AiSignalIcon=a}),98); __d("WAWebAiSignalOutlineIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k="ai-signal-outline";function a(a){var b=a.iconXstyle,e=a.height,f=a.width,g=a.viewBox;a=babelHelpers.objectWithoutPropertiesLoose(a,["iconXstyle","height","width","viewBox"]);var h;if(g){var l=g.x;l=l===void 0?0:l;var m=g.y;m=m===void 0?0:m;var n=g.width;n=n===void 0?0:n;g=g.height;g=g===void 0?0:g;h=[l,m,n,g].join(" ")}l=20;m=20;(e!=null||f!=null)&&(l=e,m=f);return j.jsx(d("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers["extends"]({name:k},a,{children:j.jsxs("svg",{viewBox:(n=h)!=null?n:"0 0 20 20",height:l,width:m,preserveAspectRatio:"xMidYMid meet",className:(i||(i=c("stylex")))(b),fill:"none",color:"#54656F",children:[j.jsx("title",{children:k}),j.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.19034 10.2424L7.79758 7.00011C7.4331 6.15148 6.22737 6.15148 5.86289 7.00011L4.4701 10.2424C4.36364 10.4904 4.16571 10.6878 3.9173 10.7941L0.637898 12.1963C-0.208188 12.5581 -0.213946 13.7529 0.628605 14.1227L3.78312 15.5076C4.02005 15.6115 4.21025 15.7991 4.31737 16.0342L5.84374 19.3845C6.22211 20.215 7.40911 20.2021 7.76927 19.3636L9.19034 16.0552C9.29686 15.8073 9.49472 15.6099 9.74322 15.5036L12.9929 14.114C13.8434 13.7503 13.8434 12.5473 12.9929 12.1837L9.74322 10.7941C9.49472 10.6878 9.29686 10.4904 9.19034 10.2424ZM4.58674 13.6761C4.58686 13.6762 4.58697 13.6762 4.58709 13.6763C5.27402 13.9778 5.82616 14.5219 6.13738 15.205L6.13739 15.205L6.77638 16.6076L7.3527 15.2659L7.35274 15.2658C7.66229 14.5452 8.23699 13.9725 8.9568 13.6647L8.95686 13.6647L10.1632 13.1488L8.95686 12.633L8.95679 12.633C8.237 12.3251 7.66229 11.7524 7.35274 11.0319L7.35271 11.0318L6.83023 9.81548L6.30784 11.0316C6.30781 11.0316 6.30777 11.0317 6.30773 11.0318C5.99811 11.7527 5.4232 12.3252 4.70395 12.6329L4.7036 12.633L3.44069 13.173L4.58674 13.6761ZM7.70052 7.7895C7.70046 7.78964 7.7004 7.78979 7.70033 7.78993L7.70052 7.7895ZM12.2066 12.275L12.2065 12.2751L12.2066 12.275ZM5.93202 18.5733C5.93188 18.5737 5.93175 18.574 5.93162 18.5743L5.93162 18.5743L5.93202 18.5733ZM10.9046 3.45455C11.3049 3.45455 11.6308 3.12973 11.6308 2.72728C11.6308 2.32481 11.3049 2 10.9046 2C10.5044 2 10.1785 2.32485 10.1785 2.72728C10.1785 3.12969 10.5044 3.45455 10.9046 3.45455ZM17.2133 6.97379L17.6637 8.98554L15.697 8.36987L17.2133 6.97379ZM13.6308 2.72728C13.6308 4.23351 12.4103 5.45455 10.9046 5.45455C9.39905 5.45455 8.17847 4.23352 8.17847 2.72728C8.17847 1.22104 9.39905 0 10.9046 0C12.4103 0 13.6308 1.22105 13.6308 2.72728ZM18.0943 4.15827C18.4524 4.2704 18.7236 4.56517 18.8056 4.93156L19.9746 10.1529C20.0566 10.5193 19.937 10.9016 19.6609 11.1559C19.3847 11.4101 18.9939 11.4977 18.6358 11.3855L13.5313 9.78762C13.1732 9.67549 12.902 9.38071 12.82 9.01433C12.7379 8.64795 12.8575 8.26561 13.1337 8.01136L17.0692 4.38795C17.3453 4.1337 17.7361 4.04614 18.0943 4.15827Z",fill:"currentColor"})]})}))}a.displayName=a.name+" [from "+f.id+"]";g.AiSignalOutlineIcon=a}),98); __d("WAWebBusinessDataSharingIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k="business-data-sharing";function a(a){var b=a.iconXstyle,e=a.height,f=a.width,g=a.viewBox;a=babelHelpers.objectWithoutPropertiesLoose(a,["iconXstyle","height","width","viewBox"]);var h;if(g){var l=g.x;l=l===void 0?0:l;var m=g.y;m=m===void 0?0:m;var n=g.width;n=n===void 0?0:n;g=g.height;g=g===void 0?0:g;h=[l,m,n,g].join(" ")}l=18;m=20;(e!=null||f!=null)&&(l=e,m=f);return j.jsx(d("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers["extends"]({name:k},a,{children:j.jsxs("svg",{viewBox:(n=h)!=null?n:"0 0 20 18",height:l,width:m,preserveAspectRatio:"xMidYMid meet",className:(i||(i=c("stylex")))(b),fill:"none",children:[j.jsx("title",{children:k}),j.jsx("path",{d:"M14.3 9.30005C14.1 9.10005 14 8.86238 14 8.58705C14 8.31238 14.0917 8.08338 14.275 7.90005L16.175 6.00005H2.00005C1.71672 6.00005 1.47938 5.90405 1.28805 5.71205C1.09605 5.52072 1.00005 5.28338 1.00005 5.00005C1.00005 4.71672 1.09605 4.47905 1.28805 4.28705C1.47938 4.09572 1.71672 4.00005 2.00005 4.00005H16.175L14.275 2.10005C14.0917 1.91672 14 1.68738 14 1.41205C14 1.13738 14.1 0.900049 14.3 0.700049C14.4834 0.516716 14.7167 0.425049 15 0.425049C15.2834 0.425049 15.5167 0.516716 15.7 0.700049L19.3 4.30005C19.4 4.40005 19.4711 4.50838 19.5131 4.62505C19.5544 4.74172 19.5751 4.86672 19.5751 5.00005C19.5751 5.13338 19.5544 5.25838 19.5131 5.37505C19.4711 5.49172 19.4 5.60005 19.3 5.70005L15.7 9.30005C15.5 9.50005 15.2627 9.59572 14.988 9.58705C14.7127 9.57905 14.4834 9.48338 14.3 9.30005ZM4.30005 17.3L0.700049 13.7C0.600049 13.6 0.529382 13.4917 0.488049 13.375C0.446049 13.2584 0.425049 13.1334 0.425049 13C0.425049 12.8667 0.446049 12.7417 0.488049 12.625C0.529382 12.5084 0.600049 12.4 0.700049 12.3L4.30005 8.70005C4.48338 8.51672 4.71272 8.42071 4.98805 8.41205C5.26272 8.40405 5.50005 8.50005 5.70005 8.70005C5.90005 8.88338 6.00405 9.11238 6.01205 9.38705C6.02072 9.66238 5.92505 9.90005 5.72505 10.1L3.82505 12H18C18.2834 12 18.5207 12.0957 18.712 12.287C18.904 12.479 19 12.7167 19 13C19 13.2834 18.904 13.5207 18.712 13.712C18.5207 13.904 18.2834 14 18 14H3.82505L5.72505 15.9C5.90838 16.0834 6.00405 16.3167 6.01205 16.6C6.02072 16.8834 5.92505 17.1167 5.72505 17.3C5.54172 17.5 5.30838 17.6 5.02505 17.6C4.74172 17.6 4.50005 17.5 4.30005 17.3Z",fill:"currentColor"})]})}))}a.displayName=a.name+" [from "+f.id+"]";g.BusinessDataSharingIcon=a}),98); __d("WAWebDoubleChevronInCircleIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k="double-chevron-in-circle";function a(a){var b=a.iconXstyle,e=a.height,f=a.width,g=a.viewBox;a=babelHelpers.objectWithoutPropertiesLoose(a,["iconXstyle","height","width","viewBox"]);var h;if(g){var l=g.x;l=l===void 0?0:l;var m=g.y;m=m===void 0?0:m;var n=g.width;n=n===void 0?0:n;g=g.height;g=g===void 0?0:g;h=[l,m,n,g].join(" ")}l=19;m=19;(e!=null||f!=null)&&(l=e,m=f);return j.jsx(d("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers["extends"]({name:k},a,{children:j.jsxs("svg",{viewBox:(n=h)!=null?n:"0 0 19 19",height:l,width:m,preserveAspectRatio:"xMidYMid meet",className:(i||(i=c("stylex")))(b),fill:"none",children:[j.jsx("title",{children:k}),j.jsx("path",{d:"M5.79303 5.94909C6.10056 5.64155 6.59918 5.64155 6.90672 5.94909L9.87657 8.91893C10.1841 9.22647 10.1841 9.72509 9.87657 10.0326L6.90672 13.0025C6.59918 13.31 6.10056 13.31 5.79303 13.0025C5.48549 12.6949 5.48549 12.1963 5.79303 11.8888L8.20603 9.47578L5.79303 7.06278C5.48549 6.75524 5.48549 6.25662 5.79303 5.94909Z",fill:"currentColor"}),j.jsx("path",{d:"M9.99302 5.94909C10.3006 5.64155 10.7992 5.64155 11.1067 5.94909L14.0766 8.91893C14.3841 9.22647 14.3841 9.72509 14.0766 10.0326L11.1067 13.0025C10.7992 13.31 10.3006 13.31 9.99302 13.0025C9.68549 12.6949 9.68549 12.1963 9.99302 11.8888L12.406 9.47578L9.99302 7.06278C9.68549 6.75524 9.68549 6.25662 9.99302 5.94909Z",fill:"currentColor"}),j.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.2569 9.5037C18.2569 14.3372 14.3386 18.2555 9.50517 18.2555C4.67171 18.2555 0.753418 14.3372 0.753418 9.5037C0.753418 4.67024 4.67171 0.751953 9.50517 0.751953C14.3386 0.751953 18.2569 4.67024 18.2569 9.5037ZM16.6819 9.5037C16.6819 13.4673 13.4688 16.6805 9.50517 16.6805C5.54156 16.6805 2.32842 13.4673 2.32842 9.5037C2.32842 5.54009 5.54156 2.32695 9.50517 2.32695C13.4688 2.32695 16.6819 5.54009 16.6819 9.5037Z",fill:"currentColor"})]})}))}a.displayName=a.name+" [from "+f.id+"]";g.DoubleChevronInCircleIcon=a}),98); __d("WAWebLightningIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k="lightning";function a(a){var b=a.iconXstyle,e=a.height,f=a.width,g=a.viewBox;a=babelHelpers.objectWithoutPropertiesLoose(a,["iconXstyle","height","width","viewBox"]);var h;if(g){var l=g.x;l=l===void 0?0:l;var m=g.y;m=m===void 0?0:m;var n=g.width;n=n===void 0?0:n;g=g.height;g=g===void 0?0:g;h=[l,m,n,g].join(" ")}l=24;m=24;(e!=null||f!=null)&&(l=e,m=f);return j.jsx(d("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers["extends"]({name:k},a,{children:j.jsxs("svg",{viewBox:(n=h)!=null?n:"0 0 13 22",height:l,width:m,preserveAspectRatio:"xMidYMid meet",className:(i||(i=c("stylex")))(b),children:[j.jsx("title",{children:k}),j.jsx("path",{d:"M4.48313 22C4.05536 22 3.72536 21.6211 3.78647 21.1933L4.88647 13.4444H0.608689C-0.466867 13.4444 0.205356 12.5278 0.2298 12.4911C1.7698 9.76556 4.0798 5.73222 7.13536 0.354444C7.25758 0.134444 7.50202 0 7.74647 0C8.17424 0 8.50424 0.378889 8.44313 0.806667L7.34313 8.55556H11.6331C12.122 8.55556 12.3909 8.78778 12.122 9.36222C8.10091 16.3778 5.76647 20.4722 5.09424 21.6456C4.97202 21.8656 4.7398 22 4.48313 22Z",fill:"currentColor"})]})}))}a.displayName=a.name+" [from "+f.id+"]";g.LightningIcon=a}),98); __d("WAWebWdsPictoMetaDataDoubleChevronIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k="wds-picto-meta-data-double-chevron";function a(a){var b=a.iconXstyle,e=a.height,f=a.width,g=a.name,h=a.viewBox;a=babelHelpers.objectWithoutPropertiesLoose(a,["iconXstyle","height","width","name","viewBox"]);var l;if(h){var m=h.x;m=m===void 0?0:m;var n=h.y;n=n===void 0?0:n;var o=h.width;o=o===void 0?0:o;h=h.height;h=h===void 0?0:h;l=[m,n,o,h].join(" ")}m=70;n=70;(e!=null||f!=null)&&(m=e,n=f);return j.jsx(d("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers["extends"]({name:(o=g)!=null?o:k},a,{children:j.jsxs("svg",{viewBox:(h=l)!=null?h:"0 0 70 70",height:m,width:n,preserveAspectRatio:"xMidYMid meet",className:(i||(i=c("stylex")))(b),fill:"none",children:[j.jsx("title",{children:(e=g)!=null?e:k}),j.jsx("path",{d:"M19.8366 43.656L28.5011 34.983L19.8498 26.3365C18.5433 25.03 18.5433 22.9195 19.8498 21.613C21.1563 20.3065 23.2668 20.3065 24.5733 21.613L35.6031 32.638C36.9096 33.9445 36.9096 36.055 35.6031 37.3615L24.5601 48.413C23.2536 49.7195 21.1431 49.7195 19.8366 48.413C18.5636 47.1065 18.5301 44.9625 19.8366 43.656Z",fill:"#25D366"}),j.jsx("path",{d:"M45.2512 34.983L36.5867 43.656C35.2802 44.9625 35.3137 47.1065 36.5867 48.413C37.8932 49.7195 40.0037 49.7195 41.3102 48.413L52.3532 37.3615C53.6597 36.055 53.6597 33.9445 52.3532 32.638L41.3234 21.613C40.0169 20.3065 37.9064 20.3065 36.5999 21.613C35.2934 22.9195 35.2934 25.03 36.5999 26.3365L45.2512 34.983Z",fill:"#25D366"}),j.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M68.5 35C68.5 16.508 53.492 1.5 35 1.5C16.508 1.5 1.5 16.508 1.5 35C1.5 53.492 16.508 68.5 35 68.5C53.492 68.5 68.5 53.492 68.5 35ZM8.2 35C8.2 20.193 20.193 8.2 35 8.2C49.807 8.2 61.8 20.193 61.8 35C61.8 49.807 49.807 61.8 35 61.8C20.193 61.8 8.2 49.807 8.2 35Z",fill:"#25D366"}),j.jsx("path",{d:"M19.8366 43.656L28.5011 34.983L19.8498 26.3365C18.5433 25.03 18.5433 22.9195 19.8498 21.613C21.1563 20.3065 23.2668 20.3065 24.5733 21.613L35.6031 32.638C36.9096 33.9445 36.9096 36.055 35.6031 37.3615L24.5601 48.413C23.2536 49.7195 21.1431 49.7195 19.8366 48.413C18.5636 47.1065 18.5301 44.9625 19.8366 43.656Z",stroke:"#111B21",strokeWidth:1.5}),j.jsx("path",{d:"M45.2512 34.983L36.5867 43.656C35.2802 44.9625 35.3137 47.1065 36.5867 48.413C37.8932 49.7195 40.0037 49.7195 41.3102 48.413L52.3532 37.3615C53.6597 36.055 53.6597 33.9445 52.3532 32.638L41.3234 21.613C40.0169 20.3065 37.9064 20.3065 36.5999 21.613C35.2934 22.9195 35.2934 25.03 36.5999 26.3365L45.2512 34.983Z",stroke:"#111B21",strokeWidth:1.5}),j.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M68.5 35C68.5 16.508 53.492 1.5 35 1.5C16.508 1.5 1.5 16.508 1.5 35C1.5 53.492 16.508 68.5 35 68.5C53.492 68.5 68.5 53.492 68.5 35ZM8.2 35C8.2 20.193 20.193 8.2 35 8.2C49.807 8.2 61.8 20.193 61.8 35C61.8 49.807 49.807 61.8 35 61.8C20.193 61.8 8.2 49.807 8.2 35Z",stroke:"#111B21",strokeWidth:1.5})]})}))}a.displayName=a.name+" [from "+f.id+"]";g.WdsPictoMetaDataDoubleChevronIcon=a}),98); __d("WAWebBizBotTosContent.react",["fbt","WAWebAiSignalIcon.react","WAWebAiSignalOutlineIcon.react","WAWebBizGatingUtils","WAWebBox.react","WAWebBusinessDataSharingIcon.react","WAWebDoubleChevronInCircleIcon.react","WAWebExternalLink.react","WAWebFaqUrl","WAWebFlex.react","WAWebLightningIcon.react","WAWebText.react","WAWebUISpacing","WAWebWdsPictoMetaDataDoubleChevronIcon.react","react","stylex"],(function(a,b,c,d,e,f,g,h){"use strict";var i,j,k=j||d("react"),l={iconUpdatedUI:{color:"x110helo",$$css:!0},lightningIconWrapper:{stroke:"xc35cvv",strokeWidth:"xvlca1e",$$css:!0},lightningIcon:{color:"x19co3pv",$$css:!0},sectionIcon:{width:"xvy4d1p",$$css:!0},sectionDescription:{color:"xw2npq5",$$css:!0}};function a(a){a=a.isLearnMoreScreen;var b=d("WAWebBizGatingUtils").isUpdatedConsumerDisclosureUiIndiaEnabled(),e=d("WAWebBizGatingUtils").isNonBlockingConsumerTosAbpropEnabled()&&!a;a=function(){return b?null:k.jsx(d("WAWebFlex.react").FlexItem,{xstyle:d("WAWebUISpacing").uiMargin.vert16,children:k.jsx(d("WAWebWdsPictoMetaDataDoubleChevronIcon.react").WdsPictoMetaDataDoubleChevronIcon,{width:67})})};var f=function(){return e?k.jsx(d("WAWebText.react").WAWebTextLarge,{weight:"medium",textAlign:"center",children:h._(/*BTDS*/"__JHASH__-rlZoAuGunM__JHASH__")}):k.jsxs(k.Fragment,{children:[k.jsx(d("WAWebText.react").WAWebTextLarge,{weight:"medium",children:h._(/*BTDS*/"__JHASH__5GF9K7qcCPR__JHASH__")}),k.jsx(d("WAWebText.react").WAWebTextTitle,{testid:void 0,children:h._(/*BTDS*/"__JHASH__pdGI1lbWB1J__JHASH__",[h._implicitParam("=m2",k.jsx(d("WAWebExternalLink.react").ExternalLink,{href:d("WAWebFaqUrl").getBizBotTosLearnMoreUrl(),children:h._(/*BTDS*/"__JHASH__KEnzO0LyHYx__JHASH__")}))])})]})},g={icon:k.jsx(d("WAWebLightningIcon.react").LightningIcon,{width:24,height:24,viewBox:{x:0,y:-1,width:13,height:24},xstyle:l.lightningIconWrapper,iconXstyle:[l.iconUpdatedUI,l.lightningIcon]}),title:h._(/*BTDS*/"__JHASH__gsqsWTK1MMY__JHASH__")},j={icon:k.jsx(d("WAWebAiSignalIcon.react").AiSignalIcon,{width:24,height:24,iconXstyle:l.iconUpdatedUI}),title:h._(/*BTDS*/"__JHASH__Izsa08-onRd__JHASH__")},m={icon:k.jsx(d("WAWebAiSignalOutlineIcon.react").AiSignalOutlineIcon,{width:24,height:24,iconXstyle:l.iconUpdatedUI}),title:h._(/*BTDS*/"__JHASH__OWRd10vZ9hY__JHASH__")},n={icon:k.jsx(d("WAWebDoubleChevronInCircleIcon.react").DoubleChevronInCircleIcon,{width:24,height:24,iconXstyle:l.iconUpdatedUI}),title:h._(/*BTDS*/"__JHASH__e6M2AzYpHMl__JHASH__",[h._implicitParam("=m2",k.jsx(d("WAWebExternalLink.react").ExternalLink,{href:d("WAWebFaqUrl").getBizBotTosLearnMoreUrl(),children:h._(/*BTDS*/"__JHASH__XFSWgnVStXL__JHASH__")}))])},o={icon:k.jsx(d("WAWebBusinessDataSharingIcon.react").BusinessDataSharingIcon,{width:24,height:24,iconXstyle:l.iconUpdatedUI}),title:h._(/*BTDS*/"__JHASH__VYBV31pegmq__JHASH__",[h._implicitParam("=m2",k.jsx(d("WAWebExternalLink.react").ExternalLink,{href:d("WAWebFaqUrl").getBizBotTosLearnMoreUrl(),children:h._(/*BTDS*/"__JHASH__5igNA_N_Eso__JHASH__")}))])},p=function(){return e?m:g},q=function(){return e?null:j},r=function(){return b?[p(),e?o:{icon:k.jsx(d("WAWebBusinessDataSharingIcon.react").BusinessDataSharingIcon,{width:24,height:24,iconXstyle:l.iconUpdatedUI}),title:h._(/*BTDS*/"__JHASH__Bj2UxRfmBb2__JHASH__")},q()]:[p(),e?n:{icon:k.jsx(d("WAWebDoubleChevronInCircleIcon.react").DoubleChevronInCircleIcon,{width:24,height:24,iconXstyle:l.iconUpdatedUI}),title:h._(/*BTDS*/"__JHASH__mwr_6tsA4uY__JHASH__")},q()]};return k.jsxs(k.Fragment,{children:[a(),k.jsx(d("WAWebBox.react").Box,{flex:!0,direction:"vertical",rowGap:8,xstyle:[d("WAWebUISpacing").uiMargin.top16,d("WAWebUISpacing").uiMargin.bottom8],children:f()}),r().filter(Boolean).map(function(a,b){var e=a.icon;a=a.title;return k.jsxs(d("WAWebFlex.react").FlexRow,{columnGap:24,className:(i||(i=c("stylex")))(d("WAWebUISpacing").uiMargin.vert10,d("WAWebUISpacing").uiPadding.horiz8),align:"center",children:[k.jsx(d("WAWebFlex.react").FlexItem,{shrink:0,xstyle:l.sectionIcon,children:e}),k.jsx(d("WAWebFlex.react").FlexItem,{xstyle:l.sectionDescription,children:a})]},b)})]})}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),226); __d("WAWebBotLightBulbIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k="bot-light-bulb";function a(a){var b=a.iconXstyle,e=a.height,f=a.width,g=a.viewBox;a=babelHelpers.objectWithoutPropertiesLoose(a,["iconXstyle","height","width","viewBox"]);var h;if(g){var l=g.x;l=l===void 0?0:l;var m=g.y;m=m===void 0?0:m;var n=g.width;n=n===void 0?0:n;g=g.height;g=g===void 0?0:g;h=[l,m,n,g].join(" ")}l=24;m=24;(e!=null||f!=null)&&(l=e,m=f);return j.jsx(d("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers["extends"]({name:k},a,{children:j.jsxs("svg",{viewBox:(n=h)!=null?n:"0 0 24 24",height:l,width:m,preserveAspectRatio:"xMidYMid meet",className:(i||(i=c("stylex")))(b),fill:"none",children:[j.jsx("title",{children:k}),j.jsx("path",{d:"M12 22C12.55 22 13.0208 21.8042 13.4125 21.4125C13.8042 21.0208 14 20.55 14 20H10C10 20.55 10.1958 21.0208 10.5875 21.4125C10.9792 21.8042 11.45 22 12 22ZM15 19C15.2833 19 15.5208 18.9042 15.7125 18.7125C15.9042 18.5208 16 18.2833 16 18C16 17.7167 15.9042 17.4792 15.7125 17.2875C15.5208 17.0958 15.2833 17 15 17H9C8.71667 17 8.47917 17.0958 8.2875 17.2875C8.09583 17.4792 8 17.7167 8 18C8 18.2833 8.09583 18.5208 8.2875 18.7125C8.47917 18.9042 8.71667 19 9 19H15ZM15.75 16C16.9 15.3167 17.8125 14.4 18.4875 13.25C19.1625 12.1 19.5 10.85 19.5 9.5C19.5 7.41667 18.7708 5.64583 17.3125 4.1875C15.8542 2.72917 14.0833 2 12 2C9.91667 2 8.14583 2.72917 6.6875 4.1875C5.22917 5.64583 4.5 7.41667 4.5 9.5C4.5 10.85 4.8375 12.1 5.5125 13.25C6.1875 14.4 7.1 15.3167 8.25 16H15.75ZM15.15 14H8.85C8.1 13.4667 7.52083 12.8083 7.1125 12.025C6.70417 11.2417 6.5 10.4 6.5 9.5C6.5 7.96667 7.03333 6.66667 8.1 5.6C9.16667 4.53333 10.4667 4 12 4C13.5333 4 14.8333 4.53333 15.9 5.6C16.9667 6.66667 17.5 7.96667 17.5 9.5C17.5 10.4 17.2958 11.2417 16.8875 12.025C16.4792 12.8083 15.9 13.4667 15.15 14Z",fill:"currentColor"})]})}))}a.displayName=a.name+" [from "+f.id+"]";g.BotLightBulbIcon=a}),98); __d("WAWebCatalogEntrypointIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k="catalog-entrypoint";function a(a){var b=a.iconXstyle,e=a.height,f=a.width,g=a.viewBox;a=babelHelpers.objectWithoutPropertiesLoose(a,["iconXstyle","height","width","viewBox"]);var h;if(g){var l=g.x;l=l===void 0?0:l;var m=g.y;m=m===void 0?0:m;var n=g.width;n=n===void 0?0:n;g=g.height;g=g===void 0?0:g;h=[l,m,n,g].join(" ")}l=24;m=24;(e!=null||f!=null)&&(l=e,m=f);return j.jsx(d("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers["extends"]({name:k},a,{children:j.jsxs("svg",{viewBox:(n=h)!=null?n:"0 0 24 24",height:l,width:m,preserveAspectRatio:"xMidYMid meet",className:(i||(i=c("stylex")))(b),version:"1.1",children:[j.jsx("title",{children:"catalog"}),j.jsx("desc",{children:"Created with Sketch."}),j.jsxs("g",{id:"catalog",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",children:[j.jsx("g",{id:"Group",transform:"translate(23.000000, 20.000000)"}),j.jsxs("g",{id:"Group-2",transform:"translate(0.000000, 2.000000)",fill:"currentColor",children:[j.jsx("path",{d:"M19.5231962,0.25 L4.4768038,0.25 C3.24356655,0.25 2.16113263,1.07099996 1.82863822,2.25856957 L0.633237306,6.52818064 C0.372658667,7.45888884 0.915906016,8.42461764 1.84661422,8.68519628 C2.00019949,8.72819691 2.15894223,8.75 2.31843358,8.75 L21.6815664,8.75 C22.6480647,8.75 23.4315664,7.96649831 23.4315664,7 C23.4315664,6.84050865 23.4097633,6.68176591 23.3667627,6.52818064 L22.1713618,2.25856957 C21.8388674,1.07099996 20.7564335,0.25 19.5231962,0.25 Z M19.5231962,1.75 C20.0837586,1.75 20.575774,2.1231818 20.7269078,2.66298617 L21.9223087,6.93259723 C21.9284517,6.95453799 21.9315664,6.97721552 21.9315664,7 C21.9315664,7.13807119 21.8196376,7.25 21.6815664,7.25 L2.31843358,7.25 C2.2956491,7.25 2.27297157,7.24688527 2.25103082,7.24074233 C2.1180725,7.20351681 2.04046574,7.06555555 2.07769126,6.93259723 L3.27309217,2.66298617 C3.424226,2.1231818 3.91624141,1.75 4.4768038,1.75 L19.5231962,1.75 Z",id:"Path",fillRule:"nonzero"}),j.jsx("path",{d:"M23,8 L23,8.39401172 C23,9.28097201 22.0068112,10.5 20.7816587,10.5 C19.6338274,10.5 18.701177,9.36689087 18.5866935,8.55847255 C18.4710113,9.36689087 17.5383609,10.5 16.391129,10.5 C15.2426983,10.5 14.3106473,9.36689087 14.1955645,8.55847255 C14.0804817,9.36689087 13.1478313,10.5 12,10.5 C10.8515693,10.5 9.91951831,9.36689087 9.80443548,8.55847255 C9.68995205,9.36689087 8.75670227,10.5 7.60887097,10.5 C6.46103967,10.5 5.52898867,9.36689087 5.41390584,8.55847255 C5.29882302,9.36689087 4.36557323,10.5 3.21834133,10.5 C1.99318875,10.5 1,9.28097201 1,8.39401172 L1,8 L23,8 Z",id:"Fill-9"}),j.jsx("path",{d:"M2,12.75 L2,17.75 C2,18.7164983 2.78350169,19.5 3.75,19.5 L15.75,19.5 C16.7164983,19.5 17.5,18.7164983 17.5,17.75 L17.5,12.75 C17.5,12.3357864 17.1642136,12 16.75,12 C16.3357864,12 16,12.3357864 16,12.75 L16,17.75 C16,17.8880712 15.8880712,18 15.75,18 L3.75,18 C3.61192881,18 3.5,17.8880712 3.5,17.75 L3.5,12.75 C3.5,12.3357864 3.16421356,12 2.75,12 C2.33578644,12 2,12.3357864 2,12.75 Z",id:"Path-2",fillRule:"nonzero"}),j.jsx("path",{d:"M21.5,18.75 L21.5,12.75 C21.5,12.3357864 21.1642136,12 20.75,12 C20.3357864,12 20,12.3357864 20,12.75 L20,18.75 C20,19.1642136 20.3357864,19.5 20.75,19.5 C21.1642136,19.5 21.5,19.1642136 21.5,18.75 Z",id:"Path-2",fillRule:"nonzero"})]})]})]})}))}a.displayName=a.name+" [from "+f.id+"]";g.CatalogEntrypointIcon=a}),98); __d("WAWebFbtCommon",["fbt","err"],(function(a,b,c,d,e,f,g,h){var i={WhatsApp:function(){return h._(/*BTDS*/"__JHASH__8FnQiGCU0cZ__JHASH__")},"WhatsApp Business":function(){return h._(/*BTDS*/"__JHASH__tE-mC59jtHg__JHASH__")},"WhatsApp Web":function(){return h._(/*BTDS*/"__JHASH__Ble0GykrsjR__JHASH__")},"WhatsApp for Desktop":function(){return h._(/*BTDS*/"__JHASH__i5YHkS2gqwR__JHASH__")},"WhatsApp for Windows":function(){return h._(/*BTDS*/"__JHASH__LeL2MMnodGl__JHASH__")},"WhatsApp Business on Web":function(){return h._(/*BTDS*/"__JHASH__xMBeTj53laL__JHASH__")},BETA:function(){return h._(/*BTDS*/"__JHASH__5lk1d0Kzlru__JHASH__")},Message:function(){return h._(/*BTDS*/"__JHASH__px9QxJJJ77K__JHASH__")},Block:function(){return h._(/*BTDS*/"__JHASH__cF6ZN_TJlBb__JHASH__")},Report:function(){return h._(/*BTDS*/"__JHASH__01-F89WUyRW__JHASH__")},Next:function(){return h._(/*BTDS*/"__JHASH__vRWsqOUoPca__JHASH__")},Cancel:function(){return h._(/*BTDS*/"__JHASH__JomY4EcHzcJ__JHASH__")},Close:function(){return h._(/*BTDS*/"__JHASH__MluKGl4ExfF__JHASH__")},Continue:function(){return h._(/*BTDS*/"__JHASH__W-f9s-29pjX__JHASH__")},Unblock:function(){return h._(/*BTDS*/"__JHASH___EbhNXdETcW__JHASH__")},"Learn more":function(){return h._(/*BTDS*/"__JHASH__ofSKbj4p0iW__JHASH__")},"Archive instead":function(){return h._(/*BTDS*/"__JHASH__3N0IoHfMf6y__JHASH__")},Submit:function(){return h._(/*BTDS*/"__JHASH__onXvWlek8By__JHASH__")},"Try again":function(){return h._(/*BTDS*/"__JHASH__qnKrjacRQZc__JHASH__")},Search:function(){return h._(/*BTDS*/"__JHASH__iGqQJ4Ediub__JHASH__")},Undo:function(){return h._(/*BTDS*/"__JHASH__WNjbF_NufjN__JHASH__")},OK:function(){return h._(/*BTDS*/"__JHASH__0fTkBdoJkur__JHASH__")},"GOT IT":function(){return h._(/*BTDS*/"__JHASH__hvpXlCIOxfk__JHASH__")},Unfollow:function(){return h._(/*BTDS*/"__JHASH__oxlbFnQU7GK__JHASH__")},"Untitled Channel":function(){return h._(/*BTDS*/"__JHASH__4T0Gc-4XQyT__JHASH__")},Admin:function(){return h._(/*BTDS*/"__JHASH__GD6YAS4e7Bl__JHASH__")},"In Your Contacts":function(){return h._(/*BTDS*/"__JHASH__HDnCDAfXSOj__JHASH__")},"In your contacts":function(){return h._(/*BTDS*/"__JHASH__bjKsjXwDIwY__JHASH__")},"Search name or number":function(){return h._(/*BTDS*/"__JHASH__GIMBITBn0nq__JHASH__")},"Not in your contacts":function(){return h._(/*BTDS*/"__JHASH__VxtSU3IAlJC__JHASH__")},"No results found":function(){return h._(/*BTDS*/"__JHASH__YAwYkWHb9oV__JHASH__")},"Request review":function(){return h._(/*BTDS*/"__JHASH__RSaLV9cWzRO__JHASH__")},Followers:function(){return h._(/*BTDS*/"__JHASH__qpK9qiHmzb3__JHASH__")},"Try Again":function(){return h._(/*BTDS*/"__JHASH__riT9KFcSRXN__JHASH__")},"End-to-end encrypted":function(){return h._(/*BTDS*/"__JHASH__nI4iCuHWHaE__JHASH__")},"Leave Group":function(){return h._(/*BTDS*/"__JHASH__4UuwozywR5c__JHASH__")},"Exit Group":function(){return h._(/*BTDS*/"__JHASH__BA0mOGeOyXA__JHASH__")},"Exit Community":function(){return h._(/*BTDS*/"__JHASH__nykgp7dyzm___JHASH__")},"Report to WhatsApp":function(){return h._(/*BTDS*/"__JHASH__4pBw7PKB2Wx__JHASH__")},Archive:function(){return h._(/*BTDS*/"__JHASH__3ShPmxkDjGN__JHASH__")},Add:function(){return h._(/*BTDS*/"__JHASH__zNsCZyppTxA__JHASH__")},"Context menu":function(){return h._(/*BTDS*/"__JHASH__YjpyvfIbeIH__JHASH__")}};function a(a){var b=i[a];if(b)return b();throw c("err")("Unknown FbtCommon string "+a)}g["default"]=a}),226); __d("WAWebModalManager",["Promise","WAWebEventEmitter"],(function(a,b,c,d,e,f,g){var h;a=function(a){babelHelpers.inheritsLoose(c,a);function c(){return a.apply(this,arguments)||this}var d=c.prototype;d.open=function(a,b){this.trigger("open_modal",a,b)};d.exists=function(a){this.trigger("exists_modal",a)};d.existsAsync=function(){var a=this;return new(h||(h=b("Promise")))(function(b){a.exists(b)})};d.close=function(a){this.trigger("close_modal",a)};d.openMedia=function(a,b){this.trigger("open_media",a,b)};d.existsMedia=function(a){this.trigger("exists_media",a)};d.closeMedia=function(){this.trigger("close_media")};d.openAlert=function(a,b){this.trigger("open_alert",a,b)};d.existsAlert=function(a){this.trigger("exists_alert",a)};d.closeAlert=function(a){this.trigger("close_alert",a)};d.getRef=function(a){this.trigger("get_ref",a)};return c}(c("WAWebEventEmitter"));d=new a();g.ModalManager=d}),98); __d("useWAWebFocusOnMount",["WAWebFocusTracer","react"],(function(a,b,c,d,e,f,g){var h;b=h||d("react");var i=b.useEffect,j=b.useRef;function a(){var a=j();i(function(){c("WAWebFocusTracer").focus(a.current)},[]);return a}g["default"]=a}),98); __d("WAWebBizBotTos.react",["fbt","WAWebBizBotHeroIcon.react","WAWebBizBotLogging","WAWebBizBotTosContent.react","WAWebBizGatingUtils","WAWebBotGating","WAWebBotLightBulbIcon.react","WAWebBotTos","WAWebBotTypes","WAWebBox.react","WAWebBusinessDataSharingIcon.react","WAWebCatalogEntrypointIcon.react","WAWebConfirmPopup.react","WAWebExternalLink.react","WAWebFaqUrl","WAWebFbtCommon","WAWebFlex.react","WAWebModal.react","WAWebModalManager","WAWebText.react","WAWebTos","WAWebUISpacing","asyncToGeneratorRuntime","react","stylex","useWAWebFocusOnMount","useWAWebListener"],(function(a,b,c,d,e,f,g,h){var i,j,k;e=k||d("react");var l=i||(i=c("react")),m=e.useEffect,n=e.useImperativeHandle,o=e.useState,p={centerText:{textAlign:"x2b8uid",$$css:!0},startText:{textAlign:"x1yc453h",$$css:!0},icon:{color:"xfect85",$$css:!0},sectionIcon:{width:"xvy4d1p",$$css:!0},sectionTitle:{width:"xdzyupr",lineHeight:"x1o2sk6j",$$css:!0},divider:{width:"xw90zxv",height:"xjm9jq1",backgroundColor:"xxnau4b",$$css:!0}};function a(a){var e=a.ref;a=babelHelpers.objectWithoutPropertiesLoose(a,["ref"]);var f=a.onAccept,g=a.onCancel,i=a.automatedType,k=a.chatEntryPoint;a=o(!1);var q=a[0],r=a[1],s=i===d("WAWebBotTypes").BizBotAutomatedType.PARTIAL_1P,t=d("WAWebBotGating").isBizBot1pMergeTosEnabled()&&d("WAWebBotTos").hasSeenBotTos(),u=d("WAWebBizGatingUtils").isNonBlockingConsumerTosAbpropEnabled()&&s;d("useWAWebListener").useListener(d("WAWebTos").TosManager,"change",function(){d("WAWebBotTos").hasAcceptedBizBotTos()&&d("WAWebModalManager").ModalManager.close()});n(e,function(){return{close:function(){d("WAWebModalManager").ModalManager.close()}}});var v=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=!1;r(!0);try{yield d("WAWebBotTos").acceptBizBotTos(),yield f==null?void 0:f(),a=!0}finally{r(!1)}a&&d("WAWebModalManager").ModalManager.close();return a});return function(){return a.apply(this,arguments)}}();a=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){d("WAWebBizBotLogging").logBizBotNuxJourneyEvent(s?"1p":"3p","nux_continue_clicked",k),yield v().then(function(a){a&&d("WAWebBizBotLogging").logBizBotNuxJourneyEvent(s?"1p":"3p","nux_select",k)})});return function(){return a.apply(this,arguments)}}();var w=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){d("WAWebBizBotLogging").logBizBotNuxJourneyEvent(s?"1p":"3p","nux_dismiss",k);if(u||d("WAWebBotGating").isBizBot1pMergeTosEnabled()&&d("WAWebBotTos").hasSeenBotTos()){yield v().then(function(a){a&&d("WAWebBizBotLogging").logBizBotNuxJourneyEvent(s?"1p":"3p","nux_dismiss_auto_accept",k)});return}d("WAWebBotTos").dismissBizBotTos();d("WAWebModalManager").ModalManager.close();g==null?void 0:g()});return function(){return a.apply(this,arguments)}}();i=function(){void w()};e=c("useWAWebFocusOnMount")();m(function(){d("WAWebBizBotLogging").logBizBotNuxJourneyEvent(s?"1p":"3p",t?"nux_view_merged":"nux_view_new",k)},[]);var x=d("WAWebBizGatingUtils").isUpdatedConsumerDisclosureUiRowEnabled(),y=d("WAWebBizGatingUtils").isUpdatedConsumerDisclosureUiIndiaEnabled();x=x||y;y=[{icon:l.jsx(d("WAWebBotLightBulbIcon.react").BotLightBulbIcon,{width:24,height:24,iconXstyle:p.icon}),title:h._(/*BTDS*/"__JHASH__HMHCWuhzmBc__JHASH__"),subtitle:h._(/*BTDS*/"__JHASH__LvB9FyGZyAG__JHASH__")},{icon:l.jsx(d("WAWebCatalogEntrypointIcon.react").CatalogEntrypointIcon,{width:20,height:20,iconXstyle:p.icon}),title:h._(/*BTDS*/"__JHASH__hxzaf0mNKXM__JHASH__"),subtitle:h._(/*BTDS*/"__JHASH__oWQHiqprQlR__JHASH__")},{icon:l.jsx(d("WAWebBusinessDataSharingIcon.react").BusinessDataSharingIcon,{width:20,height:20,iconXstyle:p.icon}),title:h._(/*BTDS*/"__JHASH__bDdAJ8li-Xu__JHASH__"),subtitle:h._(/*BTDS*/"__JHASH__cOsTwdA4_l5__JHASH__")}];var z=null;u?z=h._(/*BTDS*/"__JHASH__94o_dtyTnx-__JHASH__",[h._implicitParam("=m2",l.jsx(d("WAWebExternalLink.react").ExternalLink,{href:d("WAWebFaqUrl").getBotTermsUrl(),children:h._(/*BTDS*/"__JHASH__9-H2Bhl6ReI__JHASH__")})),h._implicitParam("=m5",l.jsx(d("WAWebExternalLink.react").ExternalLink,{href:d("WAWebFaqUrl").getBotPrivacyPolicyUrl(),children:h._(/*BTDS*/"__JHASH__36GvLEqgM0U__JHASH__")}))]):t?z=h._(/*BTDS*/"__JHASH__od2Mb1xt3nS__JHASH__",[h._implicitParam("=m2",l.jsx(d("WAWebExternalLink.react").ExternalLink,{href:d("WAWebFaqUrl").getBotPrivacyPolicyUrl(),children:h._(/*BTDS*/"__JHASH__e3st_ZR7Z9i__JHASH__")})),h._implicitParam("=m4",l.jsx(d("WAWebExternalLink.react").ExternalLink,{href:d("WAWebFaqUrl").getBotTermsUrl(),children:h._(/*BTDS*/"__JHASH__c6U07mMJ7OO__JHASH__")}))]):z=h._(/*BTDS*/"__JHASH__xe-QMV4CAG7__JHASH__",[h._implicitParam("=m2",l.jsx(d("WAWebExternalLink.react").ExternalLink,{href:d("WAWebFaqUrl").getBotPrivacyPolicyUrl(),children:h._(/*BTDS*/"__JHASH__zlbn2Z_9wUI__JHASH__")})),h._implicitParam("=m5",l.jsx(d("WAWebExternalLink.react").ExternalLink,{href:d("WAWebFaqUrl").getBMBotTermsUrl(),children:h._(/*BTDS*/"__JHASH__ef9jELPtjko__JHASH__")}))]);var A=null;u?A=c("WAWebFbtCommon")("OK"):x?A=c("WAWebFbtCommon")("Continue"):A=h._(/*BTDS*/"__JHASH__Q0WqZOj894A__JHASH__");return l.jsx(d("WAWebConfirmPopup.react").ConfirmPopup,{testid:void 0,okText:A,onOK:a,okSpinner:q===!0,cancelText:h._(/*BTDS*/"__JHASH__NpPH2jpgc_j__JHASH__"),onCancel:u?void 0:w,onOverlayClick:i,type:x?void 0:d("WAWebModal.react").ModalTheme.Promote,ref:e,children:l.jsxs(d("WAWebFlex.react").FlexColumn,{align:"center",xstyle:[d("WAWebUISpacing").uiMargin.vertAuto,!x&&d("WAWebUISpacing").uiPadding.bottom16],children:[x?l.jsx(c("WAWebBizBotTosContent.react"),{isLearnMoreScreen:!1}):l.jsxs(l.Fragment,{children:[l.jsx(d("WAWebFlex.react").FlexItem,{xstyle:d("WAWebUISpacing").uiPadding.start10,children:l.jsx(d("WAWebBizBotHeroIcon.react").BizBotHeroIcon,{width:200})}),l.jsx(d("WAWebBox.react").Box,{xstyle:[p.centerText,d("WAWebUISpacing").uiMargin.horiz8,d("WAWebUISpacing").uiMargin.top16,d("WAWebUISpacing").uiMargin.bottom8],children:l.jsx(d("WAWebText.react").WAWebTextLarge,{weight:"bold",children:h._(/*BTDS*/"__JHASH__i7DXhnmyR34__JHASH__")})}),y.map(function(a,b){var e=a.icon,f=a.title;a=a.subtitle;return l.jsxs(d("WAWebFlex.react").FlexRow,{columnGap:16,className:(j||(j=c("stylex")))(d("WAWebUISpacing").uiMargin.horiz8,d("WAWebUISpacing").uiMargin.vert16,d("WAWebUISpacing").uiPadding.horiz8),children:[l.jsx(d("WAWebFlex.react").FlexItem,{shrink:0,xstyle:p.sectionIcon,children:e}),l.jsxs(d("WAWebFlex.react").FlexItem,{xstyle:p.sectionTitle,children:[l.jsx(d("WAWebText.react").WAWebTextTitle,{children:f}),l.jsx(d("WAWebText.react").WAWebTextMuted,{children:a})]})]},b)}),l.jsx("div",babelHelpers["extends"]({},(j||(j=c("stylex"))).props(p.divider,d("WAWebUISpacing").uiMargin.vert16)))]}),l.jsx(d("WAWebBox.react").Box,{xstyle:[!x&&d("WAWebUISpacing").uiMargin.horiz8,d("WAWebUISpacing").uiMargin.vert8],children:l.jsx(d("WAWebText.react").WAWebTextMuted,{xstyle:u?p.centerText:p.startText,children:z})})]})})}a.displayName=a.name+" [from "+f.id+"]";g.BizBotTos=a}),226); __d("WAWebBizBotTosUtils",["Promise","WAWebBizBotTos.react","WAWebBotGating","WAWebBotTos","WAWebBotTypes","WAWebChatEntryPoint","WAWebContactGetters","WAWebCreateBizBotSysMsgAction","WAWebModalManager","asyncToGeneratorRuntime","react"],(function(a,b,c,d,e,f,g){var h,i,j=i||c("react");function a(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c;if(!d("WAWebBotGating").isBizBot1pEnabled()||!((c=a.contact.businessProfile)==null?void 0:c.isBizBot1p)||d("WAWebBotTos").hasSeenBizBotTos(d("WAWebBotTypes").BizBotType.BIZ_1P)||d("WAWebContactGetters").getIsMe(a.contact))return;return new(h||(h=b("Promise")))(function(c){var e;d("WAWebModalManager").ModalManager.open(j.jsx(d("WAWebBizBotTos.react").BizBotTos,{automatedType:d("WAWebBotTypes").BizBotAutomatedType.PARTIAL_1P,onAccept:b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield d("WAWebCreateBizBotSysMsgAction").maybeCreateBizBot1pDisclosureSysMsg(a),c()}),onCancel:c,chatEntryPoint:(e=a.chatEntryPoint)!=null?e:d("WAWebChatEntryPoint").ChatEntryPoint.Unknown}),{blockClose:!0})})});return k.apply(this,arguments)}g.maybeShowBizBot1pTos=a}),98); __d("WAWebChatLockSettingsSync",["WALogger","WAProtobufsUserPassword.pb","WASyncdAction","WASyncdConst","WAWebChatLockSettings","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["ChatLockSettingsSync: received mutations but could not parse"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["ChatLockSettingsSync: saving chatlock settings"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["ChatLockSettingsSync: malformed mutation: transformer args missing"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["ChatLockSettingsSync: malformed mutation: transformer type incompatible"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["ChatLockSettingsSync: malformed mutation: secret data missing"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["ChatLockSettingsSync: malformed mutation: hideLockedChats is null"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["ChatLockSettingsSync: malformed mutation: settings is null"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["ChatLockSettingsSync: operation not supported: ",""]);o=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(c,a);function c(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=null,b)||babelHelpers.assertThisInitialized(c)}var e=c.prototype;e.getVersion=function(){return 7};e.getAction=function(){return d("WASyncdConst").Actions.ChatLockSettings};e.applyMutations=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b,c=a.map(function(a){if(a.operation!=="set"){d("WALogger").WARN(o(),a.operation);return{actionState:d("WASyncdConst").SyncActionState.Malformed}}a=a.value.chatLockSettings;if(a==null){d("WALogger").WARN(n());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}var c=a.secretCode;a=a.hideLockedChats;if(a==null){d("WALogger").WARN(m());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}b={hideLockedChats:a,secretCode:null};if(c!=null){a=c.transformedData;var e=c.transformer,f=c.transformerArg;c=c.encoding;if(f==null||e==null||a==null||c==null){d("WALogger").WARN(l());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}if(e!==d("WAProtobufsUserPassword.pb").UserPassword$Transformer.PBKDF2_HMAC_SHA512){d("WALogger").WARN(k());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}f=f.reduce(function(a,b){if(b.value==null)return a;b.key==="iterations"?a.iterations=b.value.asUnsignedInteger:b.key==="salt"&&(a.salt=b.value.asBlob);return a},{});if(f.iterations==null||f.salt==null){d("WALogger").WARN(j());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}b.secretCode={iterations:f.iterations,encoding:c,salt:f.salt,transformer:e,data:a}}return{actionState:d("WASyncdConst").SyncActionState.Success}});if(b!=null){d("WALogger").LOG(i()).devConsole({chatlockSettings:b,mutations:a});var e=d("WAWebChatLockSettings").getChatLockSettings();e.updateAndSave(b)}else d("WALogger").WARN(h()).devConsole(a);return c});function c(b){return a.apply(this,arguments)}return c}();return c}(d("WASyncdAction").SyncActionBase);c=new a();g["default"]=c}),98); __d("WAWebLockChatSync",["Promise","WALogger","WAServerSync.pb","WASyncdAction","WASyncdConst","WATimeUtils","WAWebArchiveChatSync","WAWebChatLockAction","WAWebPinChatSync","WAWebSyncdActionUtils","WAWebSyncdCoreApi","WAWebSyncdGetChat","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["LockChatSync: update lock status for chat"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["LockChatSync: malformed mutation chatJid is not wid"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["LockChatSync: malformed mutation locked is null"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["LockChatSync: operation not supported: ",""]);l=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=1,b)||babelHelpers.assertThisInitialized(c)}var f=e.prototype;f.getVersion=function(){return 7};f.getAction=function(){return d("WASyncdConst").Actions.LockChat};f.applyMutations=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=[];a=(yield (h||(h=b("Promise"))).all(a.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a.operation!=="set"){d("WALogger").WARN(l(),a.operation);return{actionState:d("WASyncdConst").SyncActionState.Malformed}}var b=a.indexParts[1];a=(a=a.value.lockChatAction)==null?void 0:a.locked;if(a==null){d("WALogger").WARN(k());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}if(!c("WAWebWid").isWid(b)){d("WALogger").WARN(j());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}b=(yield d("WAWebSyncdGetChat").resolveChatForMutationIndex(d("WAWebWidFactory").createWid(b)));if(!b.success)return{actionState:d("WASyncdConst").SyncActionState.Orphan,orphanModel:b.orphanModel};b=d("WAWebWidFactory").createWid(b.chat.id);e.push({isLocked:a,chatId:b});return{actionState:d("WASyncdConst").SyncActionState.Success}});return function(b){return a.apply(this,arguments)}}())));yield h.all(e.map(function(a){d("WALogger").LOG(i()).devConsole(a);return a.isLocked?d("WAWebChatLockAction").setChatAsLocked(a.chatId,{syncWithPrimaries:!1}):d("WAWebChatLockAction").setChatAsUnlocked(a.chatId,{syncWithPrimaries:!1})}));return a});function e(b){return a.apply(this,arguments)}return e}();f.getChatLockMutation=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){return d("WAWebSyncdActionUtils").buildPendingMutation({collection:d("WASyncdConst").CollectionName.RegularLow,indexArgs:[yield d("WAWebSyncdGetChat").getChatJidMutationIndexForChat(c)],value:{lockChatAction:{locked:b}},version:this.getVersion(),operation:d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET,timestamp:a,action:this.getAction()})});function c(b,c,d){return a.apply(this,arguments)}return c}();f.sendLockMutation=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){e=e.isLocked;var f=d("WATimeUtils").unixTimeMs(),g=[];e&&g.push(c("WAWebArchiveChatSync").getArchiveChatMutation(f,!1,a),d("WAWebPinChatSync").PinChatSync.getPinMutation(f,!1,a));g.push(this.getChatLockMutation(f,e,a));yield d("WAWebSyncdCoreApi").lockForSync([],yield (h||(h=b("Promise"))).all(g),function(){return(h||(h=b("Promise"))).resolve()})});function e(b,c){return a.apply(this,arguments)}return e}();return e}(d("WASyncdAction").SyncActionBase);e=new a();g["default"]=e}),98); __d("WAWebUserPrefsChatLock",["WAArrayBufferUtils","WALogger","WAProtobufsUserPassword.pb","WAWebUserPrefsKeys","WAWebUserPrefsStore"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["getSecretCodeFromStorage: could not deserialize chat lock secret code: ",""]);h=function(){return a};return a}function i(a,b){c("WAWebUserPrefsStore").setUser(a,b,{shouldWriteToIdb:!1})}function j(a){return c("WAWebUserPrefsStore").getUser(a)}function k(a){return btoa(String.fromCharCode.apply(null,new Uint8Array(a)))}function l(a){a=atob(a);return d("WAArrayBufferUtils").stringToArrayBuffer(a)}function m(a){return{transformer:a.transformer,encoding:a.encoding,iterations:a.iterations,salt:k(a.salt),data:k(a.data)}}function n(a){var b;return{transformer:(b=d("WAProtobufsUserPassword.pb").UserPassword$Transformer.cast(a.transformer))!=null?b:d("WAProtobufsUserPassword.pb").UserPassword$Transformer.NONE,encoding:(b=d("WAProtobufsUserPassword.pb").UserPassword$Encoding.cast(a.encoding))!=null?b:d("WAProtobufsUserPassword.pb").UserPassword$Encoding.UTF8,iterations:a.iterations,salt:l(a.salt),data:l(a.data)}}function o(){var a=j(d("WAWebUserPrefsKeys").UserPrefs.ChatLockHide);return typeof a==="boolean"?a:null}function p(){try{var a=j(d("WAWebUserPrefsKeys").UserPrefs.ChatLockSecretCode);if(typeof a==="string"){a=JSON.parse(a);if(a==null||a.transformer==null||a.iterations==null||a.salt==null||a.data==null)return;return n(a)}}catch(a){d("WALogger").WARN(h(),a)}}function a(){return{hideLockedChats:o(),secretCode:p()}}function b(a){if(a==null){i(d("WAWebUserPrefsKeys").UserPrefs.ChatLockHide,null);i(d("WAWebUserPrefsKeys").UserPrefs.ChatLockSecretCode,null);return}i(d("WAWebUserPrefsKeys").UserPrefs.ChatLockHide,a.hideLockedChats);a=a.secretCode;if(a!=null){a=JSON.stringify(m(a));i(d("WAWebUserPrefsKeys").UserPrefs.ChatLockSecretCode,a)}else i(d("WAWebUserPrefsKeys").UserPrefs.ChatLockSecretCode,null)}g.getChatLockSettingsFromStorage=a;g.saveChatLockSettingsToStorage=b}),98); __d("WAWebChatLockSettings",["WAWebBaseModel","WAWebChatLockUpdateDailyStats","WAWebModelUtils","WAWebUserPrefsChatLock"],(function(a,b,c,d,e,f,g){"use strict";b=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.hideLockedChats=d("WAWebModelUtils").prop(),c.secretCode=d("WAWebModelUtils").prop(),b)||babelHelpers.assertThisInitialized(c)}var c=b.prototype;c.initialize=function(){var b=this;a.prototype.initialize.call(this);this.updateDailyStats();this.on("change",function(){b.updateDailyStats()})};c.updateDailyStats=function(){d("WAWebChatLockUpdateDailyStats").updateChatLockDailyStats({secretCodeActive:this.secretCode!=null,lockFolderHidden:this.hideLockedChats})};c.updateAndSave=function(a){this.set(a),d("WAWebUserPrefsChatLock").saveChatLockSettingsToStorage({hideLockedChats:this.hideLockedChats,secretCode:this.secretCode})};return b}(d("WAWebBaseModel").BaseModel);b.Proxy="chat_lock_settings";var h=d("WAWebBaseModel").defineModel(b);function i(){var a=d("WAWebUserPrefsChatLock").getChatLockSettingsFromStorage();a=new h(a);d("WAWebChatLockUpdateDailyStats").updateChatLockDailyStats({secretCodeActive:a.secretCode!=null,lockFolderHidden:a.hideLockedChats===!0});return a}var j;function a(){j==null&&(j=i());return j}g.getChatLockSettings=a}),98); __d("WAWebChatLockUpdateDailyStats",["WAWebDailyAggregatedStatsCollection"],(function(a,b,c,d,e,f,g){"use strict";function a(a){a===void 0&&(a={});var b=d("WAWebDailyAggregatedStatsCollection").DailyAggregatedStatsCollection.gaddForToday();a.totalFolderChatsCount!=null&&(b.chatLockFolderChatsCount=a.totalFolderChatsCount);a.incFolderOpenCount!=null&&(b.chatLockFolderOpenCount+=a.incFolderOpenCount);a.lockFolderHidden!=null&&(b.chatLockLockFolderHidden=a.lockFolderHidden);a.incNewAddChatCount!=null&&(b.chatLockNewAddChatCount+=a.incNewAddChatCount);a.incNewRemoveChatCount!=null&&(b.chatLockNewRemoveChatCount+=a.incNewRemoveChatCount);a.secretCodeActive!=null&&(b.chatLockSecretCodeActive=a.secretCodeActive)}g.updateChatLockDailyStats=a}),98); __d("WAWebChatLockAction",["WAWebChatCollection","WAWebDBUpdateChatTable","WAWebLockChatSync","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(a,b){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=b?{isLocked:b,archive:!1,pin:void 0}:{isLocked:b};yield d("WAWebDBUpdateChatTable").updateChatTable(a,b);(a=d("WAWebChatCollection").ChatCollection.get(a))==null?void 0:a.set(b)});return i.apply(this,arguments)}function j(a,b,c){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,d){d=(d=d)!=null?d:{};d=d.syncWithPrimaries;d=d===void 0?!0:d;d&&void c("WAWebLockChatSync").sendLockMutation(a,{isLocked:b});return h(a,b)});return k.apply(this,arguments)}function a(a,b){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){return j(a,!0,b)});return l.apply(this,arguments)}function e(a,b){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){return j(a,!1,b)});return m.apply(this,arguments)}g.setChatAsLocked=a;g.setChatAsUnlocked=e}),98); __d("WAWebAddOnModel",["WAWebBaseModel","WAWebModelUtils"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.ack=d("WAWebModelUtils").prop(),c.isSendFailure=d("WAWebModelUtils").session(),b)||babelHelpers.assertThisInitialized(c)}return b}(d("WAWebBaseModel").BaseModel);g.AddOnBaseModel=a}),98); __d("WAWebCommentModel",["WAWebAck","WAWebAddOnModel","WAWebBaseModel","WAWebUserPrefsMeUser"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.parentMsgKey=d("WAWebBaseModel").prop(),c.t=d("WAWebBaseModel").prop(),c.author=d("WAWebBaseModel").prop(),c.read=d("WAWebBaseModel").prop(),c.ack=d("WAWebBaseModel").prop(),c.body=d("WAWebBaseModel").prop(),c.id=d("WAWebBaseModel").prop(),c.isSendFailure=d("WAWebBaseModel").prop(),c.isFailed=d("WAWebBaseModel").derived(function(){var a=d("WAWebUserPrefsMeUser").isMeAccount(this.author)&&this.ack!=null&&this.ack<d("WAWebAck").ACK.CLOCK;return a||Boolean(this.isSendFailure)},["ack","isSendFailure"]),c.subtype=d("WAWebBaseModel").prop(),c.protocolMessageKey=d("WAWebBaseModel").prop(),c.revokeTimestamp=d("WAWebBaseModel").prop(),c.isOverwrittenByRevoke=d("WAWebBaseModel").prop(),c.revokeSender=d("WAWebBaseModel").session(),c.startOfDaySkew=d("WAWebBaseModel").session(),c.startOfDay=d("WAWebBaseModel").session(),c.links=d("WAWebBaseModel").session(function(){return[]}),c.linksIndexParsed=d("WAWebBaseModel").session(0),c.phoneNumbers=d("WAWebBaseModel").session(function(){return[]}),c.phoneNumbersIndexParsed=d("WAWebBaseModel").session(0),c.type=d("WAWebBaseModel").prop(),c.messageSecret=d("WAWebBaseModel").prop(),b)||babelHelpers.assertThisInitialized(c)}return b}(d("WAWebAddOnModel").AddOnBaseModel);a.Proxy="comment";b=d("WAWebBaseModel").defineModel(a);g.Comment=b}),98); __d("WAWebCommentCollection",["WAWebBaseCollection","WAWebCollectionUtils","WAWebCommentModel","WAWebMsgGetters","WAWebMsgType"],(function(a,b,c,d,e,f,g){e=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.byParent=d("WAWebCollectionUtils").aggregated(function(a){return a.parentMsgKey}),b)||babelHelpers.assertThisInitialized(c)}var c=b.prototype;c.getByMsgKey=function(a){return this.findFirst(function(b){return b.id.equals(a)})};return b}(d("WAWebBaseCollection").BaseCollection);e.model=d("WAWebCommentModel").Comment;function a(a){return new(d("WAWebCommentModel").Comment)({ack:a.ack,body:a.body,id:a.id,parentMsgKey:a.parentMsgKey,author:a.author,t:a.t,type:"comment",read:a.read,messageSecret:a.messageSecret})}function b(a){return new(d("WAWebCommentModel").Comment)({t:a.t,parentMsgKey:a.parentMsgKey,id:a.id,subtype:a.subtype,protocolMessageKey:a.protocolMessageKey,revokeTimestamp:a.revokeTimestamp,isOverwrittenByRevoke:!0,type:d("WAWebMsgType").MSG_TYPE.REVOKED,author:d("WAWebMsgGetters").getSender(a),revokeSender:a.revokeSender})}function c(a){return new(d("WAWebCommentModel").Comment)({t:a.t,parentMsgKey:a.parentMsgKey,id:a.id,type:"ciphertext",author:a.author,ack:a.ack})}f=new e();g.createCommentModel=a;g.createCommentModelFromRevoke=b;g.createCommentModelFromPlaceholder=c;g.CommentCollection=f}),98); __d("WAWebCommentNotification",["fbt","WANullthrows","WAWebBaseNotification","WAWebContactCollection","WAWebEnvironment","WAWebFrontendContactGetters","WAWebFrontendMsgGetters","WAWebGetNotificationStrings","WAWebMsgCollection","WAWebMuteCollection","WAWebMuteGetters","WAWebNotificationHelpers","WAWebNotificationIconUtils","WAWebNotificationMuteReason","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g,h){a=function(a){babelHelpers.inheritsLoose(e,a);function e(b){var c;b=b.commentMsg;c=a.call(this)||this;c.commentMsg=b;b=d("WAWebMsgCollection").MsgCollection.get(c.commentMsg.parentMsgKey);b!=null&&(c.parentMsg=b);return c}var f=e.prototype;f.shouldMute=function(a){if(this.parentMsg==null)return c("WAWebNotificationMuteReason").ParentMsgMissing;if(d("WAWebMuteGetters").getIsMuted(d("WAWebMuteCollection").MuteCollection.globalMute()))return c("WAWebNotificationMuteReason").GlobalMute;if(d("WAWebNotificationHelpers").shouldMuteDueToAppState(a))return c("WAWebNotificationMuteReason").AppState;if(d("WAWebNotificationHelpers").isMutedAndNotMentioned(this.parentMsg))return c("WAWebNotificationMuteReason").MutedChat;if(d("WAWebNotificationHelpers").isArchivedAndNotMentioned(this.parentMsg))return c("WAWebNotificationMuteReason").ArchivedChat;return d("WAWebNotificationHelpers").isOfflineResumeInProgress()&&!c("WAWebEnvironment").isWindows?c("WAWebNotificationMuteReason").OfflineResumeInProgress:null};f.shouldPlaySound=function(){var b=d("WAWebFrontendMsgGetters").getChat(this.commentMsg);return a.prototype.shouldPlaySound.call(this)&&!d("WAWebNotificationHelpers").shouldSquelch(b,!1)};f.getBannerOptions=function(){var a=d("WAWebFrontendMsgGetters").getChat(this.commentMsg);return{wid:a.id,title:d("WAWebNotificationHelpers").getNotificationTitle(a),body:d("WAWebGetNotificationStrings").getNotificationBody(babelHelpers["extends"]({},i(this.commentMsg)))}};f.buildKey=function(){return"comment:"+this.commentMsg.id.toString()};f.getIcon=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=d("WAWebFrontendMsgGetters").getChat(this.commentMsg);return d("WAWebNotificationIconUtils").getChatNotificationIcon(a,this.abortController.signal)});function c(){return a.apply(this,arguments)}return c}();return e}(d("WAWebBaseNotification").WABaseNotification);function i(a){a=d("WAWebContactCollection").ContactCollection.get(c("WANullthrows")(a.author,"comment author cannot be null"));a=a?d("WAWebFrontendContactGetters").getFormattedUser(a):"";a=h._(/*BTDS*/"__JHASH__e6dfjfD8_tA__JHASH__",[h._param("name",a)]);return{body:a.toString()}}g.WACommentNotification=a}),226); __d("WAWebProtobufsQuickPromotionSurfaces.pb",["$InternalEnum","WAProtoConst"],(function(a,b,c,d,e,f,g){a=b("$InternalEnum")({TRUE:1,FALSE:2,UNKNOWN:3});c=b("$InternalEnum")({PASS_BY_DEFAULT:1,FAIL_BY_DEFAULT:2});e=b("$InternalEnum")({AND:1,OR:2,NOR:3});f={};b={};var h={},i={};f.internalSpec={};b.internalSpec={clauseType:[1,(d=d("WAProtoConst")).FLAGS.REQUIRED|d.TYPES.ENUM,e],clauses:[2,d.FLAGS.REPEATED|d.TYPES.MESSAGE,b],filters:[3,d.FLAGS.REPEATED|d.TYPES.MESSAGE,h]};h.internalSpec={filterName:[1,d.FLAGS.REQUIRED|d.TYPES.STRING],parameters:[2,d.FLAGS.REPEATED|d.TYPES.MESSAGE,i],filterResult:[3,d.TYPES.ENUM,a],clientNotSupportedConfig:[4,d.FLAGS.REQUIRED|d.TYPES.ENUM,c]};i.internalSpec={key:[1,d.TYPES.STRING],value:[2,d.TYPES.STRING]};g.QP$FilterResult=a;g.QP$FilterClientNotSupportedConfig=c;g.QP$ClauseType=e;g.QPSpec=f;g.QP$FilterClauseSpec=b;g.QP$FilterSpec=h;g.QP$FilterParametersSpec=i}),98); __d("WAWebParseQPSurfacesNotification",["WALogger","WASmaxQpSurfacesQPNotificationRPC","WATimeUtils","WAWebProtobufsQuickPromotionSurfaces.pb","decodeProtobuf"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["loadQuickPromotions: Malformed filter rules node. Skipping the promotion"]);h=function(){return a};return a}function a(a){a=d("WASmaxQpSurfacesQPNotificationRPC").receiveQPNotificationRPC(a);var b=a.parsedRequest;a=a.makeQPNotificationResponseAck;var c=b.surfacesQPSurfacesMixin;b=b.t;c=c.surface;c=c.map(function(a){var b=a.promotion.reduce(function(a,b){var c=b.qpConfigFilterRules;if(c==null){b.qpConfigFilterRules;var e=babelHelpers.objectWithoutPropertiesLoose(b,["qpConfigFilterRules"]);a.push(e);return a}try{e=d("decodeProtobuf").decodeProtobuf(d("WAWebProtobufsQuickPromotionSurfaces.pb").QP$FilterClauseSpec,c.elementValue);b.qpConfigFilterRules;c=babelHelpers.objectWithoutPropertiesLoose(b,["qpConfigFilterRules"]);b=babelHelpers["extends"]({},c,{qpConfigFilterRules:e});a.push(b)}catch(a){d("WALogger").WARN(h())}return a},[]);return{id:a.id,promotions:b}});return{surfaces:c,ts:d("WATimeUtils").castToUnixTime(b),makeAck:a}}g.parseQPSurfacesNotification=a}),98); __d("WAWebHandleQPSurfacesNotification",["WALogger","WAWebBizGatingUtils","WAWebCTWAConstants","WAWebJobUpdateQPSurfaces","WAWebParseQPSurfacesNotification","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleQPSurfacesNotification: skipping QP surface ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleQPSurfacesNotification: unknown QP surface ",""]);i=function(){return a};return a}function a(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=d("WAWebParseQPSurfacesNotification").parseQPSurfacesNotification(a);var b=a.surfaces,c=a.makeAck;a=a.ts;c=c();var e;d("WAWebBizGatingUtils").qpGraphQLEnabled()?e=b.filter(function(a){var b=d("WAWebCTWAConstants").KNOWN_QP_SURFACES.get(a.id);if(b==null){d("WALogger").WARN(i(),a.id);return!1}b=!d("WAWebBizGatingUtils").qpSurfaceIdsUsingGraphQL().has(b);b||d("WALogger").WARN(h(),a.id);return b}):e=b;yield d("WAWebJobUpdateQPSurfaces").updateQPSurfacesFromNotification(e,a);return c});return j.apply(this,arguments)}g.handleQPSurfacesNotification=a}),98); __d("WAWebJobLoadQuickPromotions",["WATaskScheduler","WAWebBackendApi","WAWebBizGatingUtils","WAWebCTWAConstants","WAWebFetchQuickPromotions","WAWebSchemaQuickPromotions","WAWebTasksDefinitions"],(function(a,b,c,d,e,f,g){function a(a){return d("WAWebBackendApi").frontendSendAndReceive("getUserLocale").then(function(b){return d("WAWebSchemaQuickPromotions").getQuickPromotionsTable().all().then(function(c){c.sort(function(a,b){return a.data.qpConfigPriority-b.data.qpConfigPriority});if(d("WAWebBizGatingUtils").qpGraphQLEnabled()){var e=d("WAWebBizGatingUtils").qpSurfaceIdsUsingGraphQL(),f=c.filter(function(a){if(a==null)return!1;var c=d("WAWebCTWAConstants").KNOWN_QP_SURFACES.get(a.surfaceId);if(c==null)return!1;c=e.has(c);return c&&a.locale!==b});if(f.length>0){if(a==="app-launch"){void d("WAWebFetchQuickPromotions").fetchQuickPromotions().then(function(){d("WATaskScheduler").rescheduleNow(d("WAWebTasksDefinitions").TaskType.FETCH_QUICK_PROMOTIONS)});return}if(a==="fetch-success")return;a}}d("WAWebBackendApi").frontendFireAndForget("loadedQuickPromotions",{promotions:c})})})}g.loadQuickPromotions=a}),98); __d("WAWebJobUpdateQPSurfaces",["Promise","WALogger","WATimeUtils","WAWebCTWAConstants","WAWebJobLoadQuickPromotions","WAWebModelStorageUtils","WAWebOrchestratorNonPersistedJob","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["updateQPSurfaces: found duplicated surface"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["updateQPSurfaces: no surfaces"]);j=function(){return a};return a}function k(a){var b;a=(a=a.qpConfigPacing)==null?void 0:a.userInfo;return{impressions:(b=a==null?void 0:a.impressionCount)!=null?b:0,primaryClicks:(b=a==null?void 0:a.primaryClickCount)!=null?b:0,secondaryClicks:(b=a==null?void 0:a.secondaryClickCount)!=null?b:0,dismisses:(b=a==null?void 0:a.dismissClickCount)!=null?b:0}}function l(a,b){var c,d,e,f;a=a.tracking;c=(c=b.qpConfigPacing)==null?void 0:c.userInfo;b=k(b);d=a.dismisses-((d=c==null?void 0:c.dismissClickCount)!=null?d:0);e=a.primaryClicks-((e=c==null?void 0:c.primaryClickCount)!=null?e:0);f=a.secondaryClicks-((f=c==null?void 0:c.secondaryClickCount)!=null?f:0);c=a.impressions-((c=c==null?void 0:c.impressionCount)!=null?c:0);d>0&&(b.dismisses+=d);e>0&&(b.primaryClicks+=e);f>0&&(b.secondaryClicks+=f);c>0&&(b.impressions+=c);d=a.lastImpressionTs;e=a.lastPrimaryClickTs;f=a.lastSecondaryClickTs;c=a.lastDismissTs;d!=null&&(b.lastImpressionTs=d);e!=null&&(b.lastPrimaryClickTs=e);f!=null&&(b.lastSecondaryClickTs=f);c!=null&&(b.lastDismissTs=c);return b}function m(a,b,c){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e){if(a.length===0){d("WALogger").LOG(j());return(h||(h=b("Promise"))).resolve()}var f=a.map(function(a){return a.id}),g=new Set(f);if(g.size!==f.length){d("WALogger").WARN(i());return(h||(h=b("Promise"))).resolve()}var m=new Map();a.forEach(function(a){if(!d("WAWebCTWAConstants").KNOWN_QP_SURFACES.has(a.id))return;a.promotions.forEach(function(b){m.set(b.id,{promotion:b,surfaceId:a.id})})});yield d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("updateQPSurfaces",function(){return d("WAWebModelStorageUtils").getStorage().lock(["quick-promotions"],function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var d=a[0];a=(yield d.anyOf(["surfaceId"],f));var g=e==null?void 0:e.locale;a=a.map(function(a){var b=a.id,e=m.get(b);if(e==null)return d.remove(b);a=l(a,e.promotion);e={data:e.promotion,ts:c,tracking:a};g!=null&&(e.locale=g);m["delete"](b);return d.merge(b,e)});yield (h||(h=b("Promise"))).all(a);a=Array.from(m.values());a=a.map(function(a){var b=a.promotion;a=a.surfaceId;a={id:b.id,surfaceId:a,data:b,ts:c,tracking:k(b)};g!=null&&(a=babelHelpers["extends"]({},a,{locale:g}));return a});yield d.bulkCreate(a)});return function(b){return a.apply(this,arguments)}}())}).waitUntilCompleted();yield d("WAWebJobLoadQuickPromotions").loadQuickPromotions("fetch-success")});return n.apply(this,arguments)}function a(a,b){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){return m(a,b)});return o.apply(this,arguments)}function c(a,b){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=d("WATimeUtils").unixTime();return m(a,c,{locale:b})});return p.apply(this,arguments)}g.updateQPSurfacesFromNotification=a;g.updateQPSurfacesFromGraphQLFetch=c}),98); __d("WAWebConsumerTransparencyInfoIconModel",["WAMd5","WATypeUtils","WAWebApiContact","WAWebLid1X1MigrationGating","WAWebUserPrefsKeys","WAWebUserPrefsStore","WAWebWid"],(function(a,b,c,d,e,f,g){var h=function(a){var b;b=((b=c("WAWebUserPrefsStore").getMe())!=null?b:"").toString();a=a.toString();return c("WAMd5")(b+"-"+a)};a=function(){function a(){this.chatIds=new Set();var a=c("WAWebUserPrefsStore").getUser(d("WAWebUserPrefsKeys").KEYS.CTWA_CONSUMER_TRANSPARENCY_INFO_ICON);a instanceof Array&&(this.chatIds=new Set(a.filter(d("WATypeUtils").isString)))}var b=a.prototype;b.add=function(a){this.chatIds.add(h(a)),c("WAWebUserPrefsStore").setUser(d("WAWebUserPrefsKeys").KEYS.CTWA_CONSUMER_TRANSPARENCY_INFO_ICON,Array.from(this.chatIds))};b.shouldShowIcon=function(a){var b=this,e=[a];if(d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()&&c("WAWebWid").isUserWid(a)){a=d("WAWebApiContact").getAlternateUserWid(a);a!=null&&e.push(a)}return e.some(function(a){return b.chatIds.has(h(a))})};return a}();b=new a();g.ConsumerTransparencyInfoIconModel=b}),98); __d("WAWebCommonCTWAConsumerTransparency",["WAWebBizGatingUtils","WAWebCommonCTWADataSharing","WAWebConsumerTransparencyInfoIconModel"],(function(a,b,c,d,e,f,g){a=function(a){if(!a.contact.isBusiness)return!1;var b=d("WAWebConsumerTransparencyInfoIconModel").ConsumerTransparencyInfoIconModel.shouldShowIcon(a.id);return!b&&c("WAWebCommonCTWADataSharing").getCTWAEligibilityFromChat(a)==null?!1:d("WAWebBizGatingUtils").isConsumerTransparencyEnabled()};b=function(){return!d("WAWebBizGatingUtils").isConsumerTransparencyEnabled()?!1:!d("WAWebBizGatingUtils").isUpdatedConsumerDisclosureUiIndiaEnabled()&&d("WAWebBizGatingUtils").isUpdatedConsumerDisclosureUiRowEnabled()};e=function(a,b,c){if(b==null||c==null)return;if(!a.contact.isBusiness||!d("WAWebBizGatingUtils").isConsumerTransparencyEnabled())return;b=d("WAWebConsumerTransparencyInfoIconModel").ConsumerTransparencyInfoIconModel.shouldShowIcon(a.id);if(b)return;d("WAWebConsumerTransparencyInfoIconModel").ConsumerTransparencyInfoIconModel.add(a.id)};g.shouldShowConsumerTransparencyDisclosure=a;g.shouldShowUpdatedConsumerDisclosure=b;g.handleConsumerTransparencyForNewMsg=e}),98); __d("WAWebCTWABizDataSharingJob",["WALogger","WASmaxBizSettingsGetPrivacySettingRPC","WASmaxBizSettingsSetPrivacySettingRPC","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[ctwa][data_sharing] GetPrivacySettingResponseError: changing data sharing setting returned null value"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[ctwa][data_sharing] SetPrivacySettingResponseError: changing data sharing setting failed"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[ctwa][data_sharing] GetPrivacySettingResponseError: fetch data sharing setting failed"]);j=function(){return a};return a}function a(){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield d("WASmaxBizSettingsGetPrivacySettingRPC").sendGetPrivacySettingRPC());switch(a.name){case"GetPrivacySettingResponseError":var b=a.value.errorPrivacySettingErrors.value,c=b.code;b=b.text;d("WALogger").ERROR(j()).devConsole("[ctwa][data_sharing] GetPrivacySettingResponseError: fetch data sharing setting failed "+c+", "+b);return null;default:a.name;return a.value.privacySmbDataSharingSettingMixin.value}});return k.apply(this,arguments)}function c(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a={smbDataSharingSettingMixinArgs:{anyValue:a}};a=(yield d("WASmaxBizSettingsSetPrivacySettingRPC").sendSetPrivacySettingRPC(a));switch(a.name){case"SetPrivacySettingResponseError":var b=a.value.errorPrivacySettingErrors.value,c=b.code;b=b.text;d("WALogger").ERROR(i()).devConsole("[ctwa][data_sharing] GetPrivacySettingResponseError: changing data sharing setting failed "+c+", "+b);return null;default:a.name;a.value.privacySmbDataSharingSettingMixin==null&&d("WALogger").ERROR(h()).devConsole("[ctwa][data_sharing] GetPrivacySettingResponseError: changing data sharing setting returned null value");return(b=(c=a.value.privacySmbDataSharingSettingMixin)==null?void 0:c.value)!=null?b:null}});return l.apply(this,arguments)}g.getCtwaBizDataSharingSettingJob=a;g.setCtwaBizDataSharingSettingJob=c}),98); __d("WAWebCTWADataSharingModel",["WAWebEventEmitter"],(function(a,b,c,d,e,f,g){var h=null,i=new(c("WAWebEventEmitter"))();a=function(a){h=a,i.trigger("update",h)};b=function(){return h};d=function(a){i.on("update",a)};e=function(a){i.off("update",a)};f={subscribeForUpdates:d,unsubscribeFromUpdates:e,setValue:a,getValue:b};g.CTWADataSharingModel=f}),98); __d("WAWebDataSharingOptInCoolOffModel",["WATimeUtils","WAWebBizGatingUtils","WAWebUserPrefsKeys","WAWebUserPrefsStore","gkx"],(function(a,b,c,d,e,f,g){var h=null;a=function(){var a=d("WAWebBizGatingUtils").smbDataSharingOptInCoolOffSeconds();if(h==null){var b=c("WAWebUserPrefsStore").get(d("WAWebUserPrefsKeys").KEYS.CTWA_DATA_SHARING_COOL_OFF);h=d("WATimeUtils").castToUnixTime(typeof b==="number"?b:0)}return d("WATimeUtils").isInFuture(d("WATimeUtils").futureUnixTime(a,h))};b=function(){h=d("WATimeUtils").unixTime(),c("WAWebUserPrefsStore").set(d("WAWebUserPrefsKeys").KEYS.CTWA_DATA_SHARING_COOL_OFF,h)};e=function(){c("gkx")("26258")||(h=null,c("WAWebUserPrefsStore").set(d("WAWebUserPrefsKeys").KEYS.CTWA_DATA_SHARING_COOL_OFF,null))};f={isCoolOffActive:a,startCoolOff:b,resetCoolOffStartTimestamp:e};g.DataSharingOptInCoolOffModel=f}),98); __d("WAWebDataSharingUpsellModel",["WAWebUserPrefsKeys","WAWebUserPrefsStore"],(function(a,b,c,d,e,f,g){var h=null;a=function(){if(h==null){var a=c("WAWebUserPrefsStore").get(d("WAWebUserPrefsKeys").KEYS.CTWA_DATA_SHARING_UPSELL_ACTIVE);h=a===!0}return h};b=function(){h!==!0&&(h=!0,c("WAWebUserPrefsStore").set(d("WAWebUserPrefsKeys").KEYS.CTWA_DATA_SHARING_UPSELL_ACTIVE,!0))};e={isUpsellEnabled:a,enableUpsell:b};g["default"]=e}),98); __d("WAWebCommonCTWADataSharing",["WALogger","WASmaxInBizSettingsEnums","WAWebBizGatingUtils","WAWebCTWABizDataSharingJob","WAWebCTWADataSharingModel","WAWebChatModel","WAWebConversionTupleCollection","WAWebDataSharingOptInCoolOffModel","WAWebDataSharingUpsellModel","WAWebFrontendMsgGetters","WAWebGetCTWAEligibilityFromConversion","WAWebMsgModel","WAWebUserPrefsGeneral","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[ctwa][data_sharing] fetchDataSharingSettingAndUpdateModel: fetch data sharing setting failed"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[ctwa][data_sharing] shouldShowLabelDataSharingDialog: target value must be a chat or a message"]);i=function(){return a};return a}var j={CHAT:"CHAT",MESSAGE:"MESSAGE"},k=function(a){a=c("WAWebConversionTupleCollection").get(a.id);if(!a)return null;var b=a.conversionData;a=a.conversionSource;return d("WAWebGetCTWAEligibilityFromConversion").getCTWAEligibilityFromConversion({conversionData:b,conversionSource:a})};a=function(a){a=c("WAWebConversionTupleCollection").get(a.id);if(!a)return;return a.ctwaSignals};e=function(){var a=d("WAWebCTWADataSharingModel").CTWADataSharingModel.getValue(),b=d("WAWebUserPrefsGeneral").getCTWADataSharingCoolOffTimestamp();b=b!=null;b=b&&d("WAWebBizGatingUtils").showDataSharingInSettingsAfterNuxDismiss();var c=d("WAWebUserPrefsGeneral").getCTWAMessageReceived();c=c&&d("WAWebBizGatingUtils").showDataSharingInSettingsAfterCtwaMessageReceived();return(a===d("WASmaxInBizSettingsEnums").ENUM_FALSE_NOTSET_TRUE["true"]||a===d("WASmaxInBizSettingsEnums").ENUM_FALSE_NOTSET_TRUE["false"]||b||c)&&d("WAWebBizGatingUtils").shouldShowSMBDataSharingSettings()};f=function(a){return k(a)==null||!d("WAWebBizGatingUtils").smbDataSharingConsentEnabled()||d("WAWebDataSharingOptInCoolOffModel").DataSharingOptInCoolOffModel.isCoolOffActive()?!1:d("WAWebCTWADataSharingModel").CTWADataSharingModel.getValue()===d("WASmaxInBizSettingsEnums").ENUM_FALSE_NOTSET_TRUE.notset};var l=function(a,b){var c;if(b===j.CHAT)c=d("WAWebBizGatingUtils").isSMBLabelsDataSharingEnabledForChats;else if(b===j.MESSAGE)c=d("WAWebBizGatingUtils").isSMBLabelsDataSharingEnabledForMessages;else{d("WALogger").ERROR(i());return!1}return k(a)==null||!c()||d("WAWebDataSharingOptInCoolOffModel").DataSharingOptInCoolOffModel.isCoolOffActive()?!1:d("WAWebCTWADataSharingModel").CTWADataSharingModel.getValue()===d("WASmaxInBizSettingsEnums").ENUM_FALSE_NOTSET_TRUE.notset},m=function(a,b,e){if(e<1||!d("WAWebBizGatingUtils").smbDataSharingConsentEnabled()||c("WAWebConversionTupleCollection").get(a.id)==null)return!1;e=d("WAWebCTWADataSharingModel").CTWADataSharingModel.getValue();a=e===d("WASmaxInBizSettingsEnums").ENUM_FALSE_NOTSET_TRUE["true"];e=e===d("WASmaxInBizSettingsEnums").ENUM_FALSE_NOTSET_TRUE["false"]&&b==="order-create"&&c("WAWebDataSharingUpsellModel").isUpsellEnabled();return a||e},n=function(a){if(a.length===0)return!1;var b=[],e=a[0];if(e instanceof d("WAWebMsgModel").Msg){if(!d("WAWebBizGatingUtils").isSMBLabelsDataSharingEnabledForMessages())return!1;b.push(d("WAWebFrontendMsgGetters").getChat(e))}else{if(!d("WAWebBizGatingUtils").isSMBLabelsDataSharingEnabledForChats())return!1;a.forEach(function(a){a instanceof d("WAWebChatModel").Chat&&b.push(a)})}e=b.some(function(a){return k(a)!=null});if(!e)return!1;a=d("WAWebCTWADataSharingModel").CTWADataSharingModel.getValue();e=a===d("WASmaxInBizSettingsEnums").ENUM_FALSE_NOTSET_TRUE["true"];a=a===d("WASmaxInBizSettingsEnums").ENUM_FALSE_NOTSET_TRUE["false"]&&c("WAWebDataSharingUpsellModel").isUpsellEnabled();return e||a},o=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(!d("WAWebBizGatingUtils").smbDataSharingConsentEnabled())return null;try{var a=(yield d("WAWebCTWABizDataSharingJob").getCtwaBizDataSharingSettingJob());a&&(d("WAWebCTWADataSharingModel").CTWADataSharingModel.setValue(a),a===d("WASmaxInBizSettingsEnums").ENUM_FALSE_NOTSET_TRUE["false"]&&c("WAWebDataSharingUpsellModel").enableUpsell());return a}catch(a){d("WALogger").ERROR(h()).devConsole(a);return null}});return function(){return a.apply(this,arguments)}}();a={SMB_DATA_SHARING_ALLOWED_SOURCE:d("WAWebGetCTWAEligibilityFromConversion").SMB_DATA_SHARING_ALLOWED_SOURCE,SmbDataSharingLabelTargetValues:j,getCTWAEligibilityFromChat:k,getCTWASignalsValueFromChat:a,shouldDisplayDataSharingSetting:e,shouldShowOrderDataSharingDialog:f,shouldShowLabelDataSharingDialog:l,shouldDisplayDataSharingOrderOptOutOrUpsell:m,shouldDisplayDataSharingLabelOptOutOrUpsell:n,fetchDataSharingSettingAndUpdateModel:o};g["default"]=a}),98); __d("WAWebWamEnumCallInitiatorType",[],(function(a,b,c,d,e,f){a=Object.freeze({BUSINESS:0,CONSUMER:1});f.CALL_INITIATOR_TYPE=a}),66); __d("WAWebWamEnumCtwaConversionType",[],(function(a,b,c,d,e,f){a=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,FIRST_MESSAGE_CONTINUATION:10,FIRST_BIZ_REPLY_CONTINUATION:11,SECOND_MESSAGE_CONTINUATION:12,SECOND_BIZ_REPLY_CONTINUATION:13,THIRD_MESSAGE_CONTINUATION:14});f.CTWA_CONVERSION_TYPE=a}),66); __d("WAWebDeepLinkConversionWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumCallInitiatorType","WAWebWamEnumCtwaChatCreationMode","WAWebWamEnumCtwaConversionType","WAWebWamEnumTrustBannerAction"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({DeepLinkConversion:[1432,{callInitiator:[8,d("WAWebWamEnumCallInitiatorType").CALL_INITIATOR_TYPE],ctwaChatCreationMode:[4,d("WAWebWamEnumCtwaChatCreationMode").CTWA_CHAT_CREATION_MODE],ctwaConversionType:[3,d("WAWebWamEnumCtwaConversionType").CTWA_CONVERSION_TYPE],ctwaSignals:[9,a.TYPES.STRING],deepLinkConversionData:[2,a.TYPES.STRING],deepLinkConversionSource:[1,a.TYPES.STRING],isPriority:[7,a.TYPES.BOOLEAN],trustBannerAction:[5,d("WAWebWamEnumTrustBannerAction").TRUST_BANNER_ACTION],trustBannerType:[6,a.TYPES.STRING]},[1,1,1],"regular"]},{DeepLinkConversion:[]});g.DeepLinkConversionWamEvent=b}),98); __d("WAWebCommonCTWALogging",["WAArrayBufferUtils","WALogger","WATimeUtils","WAWebABProps","WAWebConnModel","WAWebConversionTupleModel","WAWebDeepLinkConversionWamEvent","WAWebFrontendMsgGetters","WAWebGetCTWAEligibilityFromConversion","WAWebMsgType","WAWebUserPrefsGeneral","WAWebUserPrefsMeUser","WAWebWamEnumCtwaConversionType"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["ctwa:dc-logging: Cannot get current user"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["ctwa:dc-logging: THIRD_MESSAGE"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["ctwa:dc-logging: SECOND_MESSAGE"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["ctwa:dc-logging: FIRST_MESSAGE"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["ctwa:dc-logging: DEEP_CONVERSATION"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["ctwa:dc-logging: SECOND_BIZ_REPLY"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["ctwa:dc-logging: FIRST_BIZ_REPLY"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["ctwa:dc-logging: Attempted to log a DC with no CTWA conversion data or source"]);o=function(){return a};return a}function p(a){var b=d("WATimeUtils").unixTime()-d("WAWebConversionTupleModel").ConversionTupleExpiry;return a.t<b}function q(a,b){a=b.indexOf(a);return a>=0?b[a-1]:null}function r(a,b){b=q(a,b);return((a=a.from)==null?void 0:a.toString())===(b==null?void 0:(a=b.from)==null?void 0:a.toString())}function s(a){var b=0,c=a[a.length-1];while(c&&b<=6){var e;if(p(c))return[null,b];else if(c.ctwaContext)return[c,b];var f=q(c,a);if(!f)break;var g=!d("WAWebMsgType").SYSTEM_MESSAGE_TYPES.includes(c.type);e=((e=c.from)==null?void 0:e.toString())!==((e=f.from)==null?void 0:e.toString());g&&e&&b++;c=f}return[c,b]}function t(a,b){a=(a=a.ctwaContext)!=null?a:{};var c=a.conversionData;a=a.conversionSource;if(c==null||a==null){d("WALogger").WARN(o());return}b={ctwaConversionType:d("WAWebWamEnumCtwaConversionType").CTWA_CONVERSION_TYPE[b],deepLinkConversionData:d("WAArrayBufferUtils").arrayBufferToString(c),deepLinkConversionSource:a};void new(d("WAWebDeepLinkConversionWamEvent").DeepLinkConversionWamEvent)(b).commitAndWaitForFlush(!0)}function u(a,b){b===1?(d("WALogger").DEV(n()),t(a,"FIRST_BIZ_REPLY")):b===3?(d("WALogger").DEV(m()),t(a,"SECOND_BIZ_REPLY")):b===5&&(d("WALogger").DEV(l()),t(a,"DEEP_CONVERSATION"))}function v(a,b){b===0?(d("WALogger").DEV(k()),t(a,"FIRST_MESSAGE")):b===2?(d("WALogger").DEV(j()),t(a,"SECOND_MESSAGE")):b===4&&(d("WALogger").DEV(i()),t(a,"THIRD_MESSAGE"))}function a(a){var b;if(!d("WAWebConnModel").Conn.isSMB)return;if(a.ctwaContext==null)return;if(a.ctwaContext.conversionSource!==d("WAWebGetCTWAEligibilityFromConversion").SMB_DATA_SHARING_ALLOWED_SOURCE||a.ctwaContext.conversionData==null)return;b=(b=d("WAWebUserPrefsMeUser").getMaybeMeUser())==null?void 0:b.toString();if(b!==((b=a.to)==null?void 0:b.toString()))return;if(!d("WAWebABProps").getABPropConfigValue("ctwa_show_ads_data_sharing_after_message"))return;a=d("WAWebUserPrefsGeneral").getCTWAMessageReceived();a!==!0&&d("WAWebUserPrefsGeneral").setCTWAMessageReceived(!0)}function b(a){var b,c,e;if(!d("WAWebABProps").getABPropConfigValue("wa_ctwa_web_dc_logging_enabled"))return;if(!a||a.isNewMsg!==!0)return;if(!d("WAWebConnModel").Conn.isSMB)return;b=(b=d("WAWebUserPrefsMeUser").getMaybeMeUser())==null?void 0:b.toString();if(b==null){d("WALogger").WARN(h()).sendLogs("ctwa:dc-logging: Cannot get current user");return}c=(c=(c=d("WAWebFrontendMsgGetters").getChat(a))==null?void 0:c.msgs.toArray())!=null?c:[];if(c.length===0)return;if(a.ctwaContext==null&&r(a,c))return;c=s(c);var f=c[0];c=c[1];if(!f)return;if(c>5)return;b===((e=a.from)==null?void 0:e.toString())?u(f,c):b===((e=a.to)==null?void 0:e.toString())&&v(f,c)}g.maybeSetCtwaMessageReceivedInUserPreferenceStore=a;g.logDeepConversation=b}),98); __d("WAWebAdModel",["WAWebBaseModel"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.ad=d("WAWebBaseModel").prop(),b)||babelHelpers.assertThisInitialized(c)}return b}(d("WAWebBaseModel").BaseModel);a.Proxy="Ad";b=d("WAWebBaseModel").defineModel(a);g.AdModel=b}),98); __d("WAWebFetchAdsQuery_facebookRelayOperation",[],(function(a,b,c,d,e,f){e.exports="9191121574326058"}),null); __d("WAWebFetchAdsQuery.graphql",["WAWebFetchAdsQuery_facebookRelayOperation"],(function(a,b,c,d,e,f){"use strict";a=function(){var a={defaultValue:null,kind:"LocalArgument",name:"options"},c={defaultValue:null,kind:"LocalArgument",name:"page_id"},d=[{kind:"Variable",name:"options",variableName:"options"},{kind:"Variable",name:"page_id",variableName:"page_id"}],e={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},f={kind:"InlineFragment",selections:[e],type:"Node",abstractKey:"__isNode"},g=[{kind:"Literal",name:"supported",value:"304s3R"}],h={alias:null,args:null,kind:"ScalarField",name:"formatted_for_lwi",storageKey:null},i={alias:null,args:[{kind:"Literal",name:"height",value:64},{kind:"Literal",name:"width",value:64}],kind:"ScalarField",name:"thumbnail_image_url",storageKey:"thumbnail_image_url(height:64,width:64)"},j=[{kind:"Literal",name:"metrics",value:["REACH","RESULTS"]}],k={alias:null,args:null,kind:"ScalarField",name:"reach",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"results",storageKey:null},m={alias:null,args:null,concreteType:"AdInsightsNode",kind:"LinkedField",name:"node",plural:!1,selections:[k,l],storageKey:null},n={alias:null,args:null,kind:"ScalarField",name:"boosting_status",storageKey:null},o={alias:null,args:null,concreteType:"AdsCreativeSpecification",kind:"LinkedField",name:"creative",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"body",storageKey:null}],storageKey:null},p={alias:null,args:null,concreteType:"AdsLWIAdGroupSpec",kind:"LinkedField",name:"adgroup_spec",plural:!0,selections:[o],storageKey:null},q={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null};o=[e,{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"boosting_info",plural:!1,selections:[q,{alias:null,args:null,concreteType:"CurrencyQuantity",kind:"LinkedField",name:"spent",plural:!1,selections:[h],storageKey:null},i],storageKey:null},{alias:null,args:null,concreteType:"AdCampaignGroup",kind:"LinkedField",name:"campaign_group",plural:!1,selections:[e,{alias:null,args:j,concreteType:"AdInsightsConnection",kind:"LinkedField",name:"ad_insights",plural:!1,selections:[{alias:null,args:null,concreteType:"AdInsightsEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[m],storageKey:null}],storageKey:'ad_insights(metrics:["REACH","RESULTS"])'}],storageKey:null},{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"spec",plural:!1,selections:[q,n,{alias:null,args:null,concreteType:"AdsLWIAdGroupSpec",kind:"LinkedField",name:"adgroup_spec",plural:!0,selections:[o,e],storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:[a,c],kind:"Fragment",metadata:null,name:"WAWebFetchAdsQuery",selections:[{kind:"RequiredField",field:{alias:null,args:null,concreteType:"CTWAAPI",kind:"LinkedField",name:"ctwa",plural:!1,selections:[{kind:"RequiredField",field:{alias:null,args:d,concreteType:"CTWAAPIAllPageAdsConnection",kind:"LinkedField",name:"all_page_ads",plural:!1,selections:[{alias:null,args:null,concreteType:"CTWAAPIAllPageAdsEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{kind:"RequiredField",field:{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[f,{kind:"RequiredField",field:{alias:null,args:g,concreteType:null,kind:"LinkedField",name:"wrapper_renderer",plural:!1,selections:[{kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"CTWABoostedComponentWrapper",kind:"LinkedField",name:"boosted_component",plural:!1,selections:[{kind:"RequiredField",field:e,action:"THROW",path:"ctwa.all_page_ads.edges.node.wrapper_renderer.boosted_component.id"},{kind:"RequiredField",field:{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"boosting_info",plural:!1,selections:[{kind:"RequiredField",field:{alias:null,args:null,concreteType:"CurrencyQuantity",kind:"LinkedField",name:"spent",plural:!1,selections:[{kind:"RequiredField",field:h,action:"THROW",path:"ctwa.all_page_ads.edges.node.wrapper_renderer.boosted_component.boosting_info.spent.formatted_for_lwi"}],storageKey:null},action:"THROW",path:"ctwa.all_page_ads.edges.node.wrapper_renderer.boosted_component.boosting_info.spent"},{kind:"RequiredField",field:i,action:"THROW",path:"ctwa.all_page_ads.edges.node.wrapper_renderer.boosted_component.boosting_info.thumbnail_image_url"}],storageKey:null},action:"THROW",path:"ctwa.all_page_ads.edges.node.wrapper_renderer.boosted_component.boosting_info"},{kind:"RequiredField",field:{alias:null,args:null,concreteType:"AdCampaignGroup",kind:"LinkedField",name:"campaign_group",plural:!1,selections:[{kind:"RequiredField",field:e,action:"THROW",path:"ctwa.all_page_ads.edges.node.wrapper_renderer.boosted_component.campaign_group.id"},{alias:null,args:j,concreteType:"AdInsightsConnection",kind:"LinkedField",name:"ad_insights",plural:!1,selections:[{alias:null,args:null,concreteType:"AdInsightsEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{kind:"RequiredField",field:m,action:"THROW",path:"ctwa.all_page_ads.edges.node.wrapper_renderer.boosted_component.campaign_group.ad_insights.edges.node"}],storageKey:null}],storageKey:'ad_insights(metrics:["REACH","RESULTS"])'}],storageKey:null},action:"THROW",path:"ctwa.all_page_ads.edges.node.wrapper_renderer.boosted_component.campaign_group"},{kind:"RequiredField",field:{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"spec",plural:!1,selections:[{kind:"RequiredField",field:n,action:"THROW",path:"ctwa.all_page_ads.edges.node.wrapper_renderer.boosted_component.spec.boosting_status"},{kind:"RequiredField",field:p,action:"THROW",path:"ctwa.all_page_ads.edges.node.wrapper_renderer.boosted_component.spec.adgroup_spec"}],storageKey:null},action:"THROW",path:"ctwa.all_page_ads.edges.node.wrapper_renderer.boosted_component.spec"}],storageKey:null}],type:"CTWAAdsManagementBoostedComponent",abstractKey:null},{kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"BoostedComponentAsyncWrapper",kind:"LinkedField",name:"async_request",plural:!1,selections:[{kind:"RequiredField",field:e,action:"THROW",path:"ctwa.all_page_ads.edges.node.wrapper_renderer.async_request.id"},{kind:"RequiredField",field:{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"boosting_info",plural:!1,selections:[{kind:"RequiredField",field:{alias:null,args:null,concreteType:"CurrencyQuantity",kind:"LinkedField",name:"spent",plural:!1,selections:[{kind:"RequiredField",field:h,action:"THROW",path:"ctwa.all_page_ads.edges.node.wrapper_renderer.async_request.boosting_info.spent.formatted_for_lwi"}],storageKey:null},action:"THROW",path:"ctwa.all_page_ads.edges.node.wrapper_renderer.async_request.boosting_info.spent"},{kind:"RequiredField",field:i,action:"THROW",path:"ctwa.all_page_ads.edges.node.wrapper_renderer.async_request.boosting_info.thumbnail_image_url"}],storageKey:null},action:"THROW",path:"ctwa.all_page_ads.edges.node.wrapper_renderer.async_request.boosting_info"},{kind:"RequiredField",field:{alias:null,args:null,concreteType:"AdCampaignGroup",kind:"LinkedField",name:"campaign_group",plural:!1,selections:[{kind:"RequiredField",field:e,action:"THROW",path:"ctwa.all_page_ads.edges.node.wrapper_renderer.async_request.campaign_group.id"},{alias:null,args:j,concreteType:"AdInsightsConnection",kind:"LinkedField",name:"ad_insights",plural:!1,selections:[{alias:null,args:null,concreteType:"AdInsightsEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{kind:"RequiredField",field:{alias:null,args:null,concreteType:"AdInsightsNode",kind:"LinkedField",name:"node",plural:!1,selections:[{kind:"RequiredField",field:k,action:"THROW",path:"ctwa.all_page_ads.edges.node.wrapper_renderer.async_request.campaign_group.ad_insights.edges.node.reach"},l],storageKey:null},action:"THROW",path:"ctwa.all_page_ads.edges.node.wrapper_renderer.async_request.campaign_group.ad_insights.edges.node"}],storageKey:null}],storageKey:'ad_insights(metrics:["REACH","RESULTS"])'}],storageKey:null},action:"THROW",path:"ctwa.all_page_ads.edges.node.wrapper_renderer.async_request.campaign_group"},{kind:"RequiredField",field:{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"spec",plural:!1,selections:[{kind:"RequiredField",field:n,action:"THROW",path:"ctwa.all_page_ads.edges.node.wrapper_renderer.async_request.spec.boosting_status"},{kind:"RequiredField",field:p,action:"THROW",path:"ctwa.all_page_ads.edges.node.wrapper_renderer.async_request.spec.adgroup_spec"}],storageKey:null},action:"THROW",path:"ctwa.all_page_ads.edges.node.wrapper_renderer.async_request.spec"}],storageKey:null}],type:"LWIAdsManagementBoostedComponentAsyncRequest",abstractKey:null}],storageKey:'wrapper_renderer(supported:"304s3R")'},action:"THROW",path:"ctwa.all_page_ads.edges.node.wrapper_renderer"}],storageKey:null},action:"THROW",path:"ctwa.all_page_ads.edges.node"}],storageKey:null}],storageKey:null},action:"THROW",path:"ctwa.all_page_ads"}],storageKey:null},action:"THROW",path:"ctwa"}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[c,a],kind:"Operation",name:"WAWebFetchAdsQuery",selections:[{alias:null,args:null,concreteType:"CTWAAPI",kind:"LinkedField",name:"ctwa",plural:!1,selections:[{alias:null,args:d,concreteType:"CTWAAPIAllPageAdsConnection",kind:"LinkedField",name:"all_page_ads",plural:!1,selections:[{alias:null,args:null,concreteType:"CTWAAPIAllPageAdsEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[q,f,{alias:null,args:g,concreteType:null,kind:"LinkedField",name:"wrapper_renderer",plural:!1,selections:[q,{kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"CTWABoostedComponentWrapper",kind:"LinkedField",name:"boosted_component",plural:!1,selections:o,storageKey:null}],type:"CTWAAdsManagementBoostedComponent",abstractKey:null},{kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"BoostedComponentAsyncWrapper",kind:"LinkedField",name:"async_request",plural:!1,selections:o,storageKey:null}],type:"LWIAdsManagementBoostedComponentAsyncRequest",abstractKey:null}],storageKey:'wrapper_renderer(supported:"304s3R")'}],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}]},params:{id:b("WAWebFetchAdsQuery_facebookRelayOperation"),metadata:{},name:"WAWebFetchAdsQuery",operationKind:"query",text:null}}}();e.exports=a}),null); __d("WAWebFetchAds",["Promise","WACustomError","WALogger","WAPromiseTimeout","WAQplTypes","WAWebBizGatingUtils","WAWebCTWAConstants","WAWebCommonAdsTypes","WAWebFetchAdAccountToken","WAWebFetchAdsQuery.graphql","WAWebOrchestratorNonPersistedJob","WAWebQplQuickPerformanceLoggerMarkerIds","WAWebQplQuickPerformanceLoggerModule","WAWebRelayClient"],(function(a,b,c,d,e,f,g){var h,i;function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["fetchAdsWithToken: Relay parser error ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["fetchAdsWithTimeout: timeout"]);k=function(){return a};return a}var l={type:"error"},m=h!==void 0?h:h=b("WAWebFetchAdsQuery.graphql"),n=90;function a(a){return!d("WAWebBizGatingUtils").adManagementEnabled()?(i||(i=b("Promise"))).resolve({type:"not-enabled"}):d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("fetchAds",function(){return o(a)}).waitUntilCompleted()}function o(a){return d("WAPromiseTimeout").promiseTimeout(p(a),d("WAWebCTWAConstants").MANAGE_ADS_FETCH_TIMEOUT_MS)["catch"](function(a){if(a instanceof d("WACustomError").TimeoutError){d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.MANAGE_ADS_FETCH_ADS,"fetch_ads_end");d("WAWebQplQuickPerformanceLoggerModule").QPL.markerEnd(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.MANAGE_ADS_FETCH_ADS,d("WAQplTypes").QuickLogActionType.ABORTED);d("WALogger").WARN(k());return{type:"timeout"}}throw a})}function p(a){d("WAWebQplQuickPerformanceLoggerModule").QPL.markerStart(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.MANAGE_ADS_FETCH_ADS);d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.MANAGE_ADS_FETCH_ADS,"fetch_ads_start");return d("WAWebFetchAdAccountToken").fetchToken().then(function(b){if(b.type==="success")return q({token:b.token,pageId:a}).then(function(a){d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.MANAGE_ADS_FETCH_ADS,"fetch_ads_end");a.type!=="success"?(d("WAWebQplQuickPerformanceLoggerModule").QPL.markerEnd(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.MANAGE_ADS_FETCH_ADS,d("WAQplTypes").QuickLogActionType.FAIL),a.type==="auth-failure"?d("WAWebFetchAdAccountToken").markTokenAsInvalid():a.type):(a.type,d("WAWebQplQuickPerformanceLoggerModule").QPL.markerEnd(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.MANAGE_ADS_FETCH_ADS,d("WAQplTypes").QuickLogActionType.SUCCESS));return a});b.type;return b})}function q(a){var b=a.token;a=a.pageId;return d("WAWebRelayClient").fetchQuery(m,{page_id:a,options:{from_n_days_ago:n}},{environmentType:"facebook",accessToken:b}).then(function(a){if(a==null)return l;a=a.ctwa;a=a.all_page_ads;a=a.edges;var b=a.reduce(function(a,b){b=b.node;b=b.wrapper_renderer;var c=b.boosted_component;b=b.async_request;[c,b].forEach(function(b){if(b==null)return;b=r(b);b!=null&&a.push(b)});return a},[]);return b.length<a.length?l:{type:"success",ads:b}})["catch"](function(a){var b;if(d("WAWebFetchAdAccountToken").hasGraphQLAuthError(a))return{type:"auth-failure"};(a==null?void 0:(b=a.message)==null?void 0:b.startsWith("Relay:"))===!0&&d("WALogger").ERROR(j(),a.message).sendLogs("fetch-ads-relay-parser-error");return l})}function r(a){var b,c=a.id,e=a.boosting_info,f=a.spec;a=a.campaign_group;var g=e.thumbnail_image_url;e=e.spent;var h=f.adgroup_spec;f=f.boosting_status;e=e.formatted_for_lwi;var i=a.id;a=s(a);b=(b=a==null?void 0:a.reach)!=null?b:0;a=(a=a==null?void 0:a.conversations)!=null?a:0;g={adId:d("WAWebCommonAdsTypes").asAdId(c),thumbnailUrl:g,boostingStatus:(c=d("WAWebCommonAdsTypes").BoostingStatusEnum.cast(f))!=null?c:d("WAWebCommonAdsTypes").BoostingStatusEnum.UNKNOWN,budget:e,campaignGroupId:d("WAWebCommonAdsTypes").asAdCampaignGroupId(i),conversations:a,reach:b};f=h[0];if(f!=null){c=f.creative;if(c!=null){e=c.body;e!=null&&(g.creativeText=e)}}return g}function s(a){a=a.ad_insights;if(a==null)return;a=a.edges;a=a.reduce(function(a,b){b=b.node;var c=b.reach;b=b.results;a.push({reach:(c=c)!=null?c:0,conversations:(c=b)!=null?c:0});return a},[]);if(a.length===0)return;return a[0]}g.fetchAds=a}),98); __d("WAWebAdCollection",["WAWebAdModel","WAWebBaseCollection","WAWebFetchAds","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(c,a);function c(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.loadingInfo=null,b)||babelHelpers.assertThisInitialized(c)}var e=c.prototype;e.loadAds=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=this;if(this.loadingInfo!=null&&this.loadingInfo.pageId===a)return this.loadingInfo.promise;this.reset();var c=d("WAWebFetchAds").fetchAds(a).then(function(c){var d;c.type==="success"?(b.set(c.ads.map(function(a){return{id:a.adId,ad:a}})),d={result:"success",pageId:a}):c.type==="recovery-required"?d={result:"recovery-required",pageId:a,emailMask:c.emailMask}:(c.type,d={result:c.type,pageId:a});b.trigger("ads-loaded",d)})["finally"](function(){b.loadingInfo=null});this.loadingInfo={promise:c,pageId:a};return c});function c(b){return a.apply(this,arguments)}return c}();return c}(d("WAWebBaseCollection").BaseCollection);a.model=d("WAWebAdModel").AdModel;c=new a();g.AdCollection=c}),98); __d("WAWebDeviceCapabilitiesSync",["Promise","WALogger","WAServerSync.pb","WASyncAction.pb","WASyncdAction","WASyncdConst","WATimeUtils","WAWebABProps","WAWebCmd","WAWebEventsWaitForOfflineDeliveryEnd","WAWebLid1x1MigrationTimeout","WAWebSyncdActionUtils","WAWebSyncdCoreApi","WAWebSyncdDb","WAWebUserPrefsMeUser","asyncToGeneratorRuntime","decodeProtobuf"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["DeviceCapabilitiesSync: not syncing capabilities due to no change"]);i=function(){return a};return a}var j=!1;a=function(a){babelHelpers.inheritsLoose(c,a);function c(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=null,b)||babelHelpers.assertThisInitialized(c)}var e=c.prototype;e.getVersion=function(){return 7};e.getAction=function(){return d("WASyncdConst").Actions.DeviceCapabilities};e.getJidIndex=function(){return d("WAWebUserPrefsMeUser").assertGetMe().toString({legacy:!0})};e.capabilitiesHaveChanged=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield d("WAWebSyncdDb").getSyncActionsRows(["index"],[a.index]));b=b.reduce(function(a,b){if(b.actionState===d("WASyncdConst").SyncActionState.Success){a=d("decodeProtobuf").decodeProtobuf(d("WASyncAction.pb").SyncActionDataSpec,b.binarySyncData);b=a.value;if(b==null?void 0:b.deviceCapabilities)return b.deviceCapabilities}},{});a=d("decodeProtobuf").decodeProtobuf(d("WASyncAction.pb").SyncActionValueSpec,a.binarySyncAction);a=a.deviceCapabilities;return{hasChanged:JSON.stringify(b)!==JSON.stringify(a),currentCapabilities:b,newCapabilities:a}});function c(b){return a.apply(this,arguments)}return c}();e.checkLidTimeout=function(){if(j)return;d("WAWebCmd").Cmd.on(d("WAWebCmd").APP_STATE_SYNC_COMPLETED,function(a){a.some(function(a){return a.name===d("WASyncdConst").CollectionName.RegularLow})&&d("WAWebEventsWaitForOfflineDeliveryEnd").isOfflineDeliveryEnd()&&void d("WAWebLid1x1MigrationTimeout").scheduleLogoutIfNeeded("syncd")});j=!0};e.applyMutations=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){void this.checkLidTimeout();return a.map(function(){return{actionState:d("WASyncdConst").SyncActionState.Success}})});function c(b){return a.apply(this,arguments)}return c}();e.getMutation=function(a,b){return d("WAWebSyncdActionUtils").buildPendingMutation({collection:d("WASyncdConst").CollectionName.RegularLow,indexArgs:[this.getJidIndex()],value:{deviceCapabilities:babelHelpers["extends"]({},b)},version:this.getVersion(),operation:d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET,timestamp:a,action:this.getAction()})};e.sendMutation=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!d("WAWebABProps").getABPropConfigValue("device_capabilities_sync_enabled"))return;a=this.getMutation(d("WATimeUtils").unixTimeMs(),a);var c=(yield this.capabilitiesHaveChanged(a));if(!c.hasChanged){d("WALogger").LOG(i()).devConsole(c);return}yield d("WAWebSyncdCoreApi").lockForSync([],[a],function(){return(h||(h=b("Promise"))).resolve()})});function c(b){return a.apply(this,arguments)}return c}();return c}(d("WASyncdAction").SyncActionBase);c=new a();g["default"]=c}),98); __d("WAWebBackoff",["err"],(function(a,b,c,d,e,f,g){a=function(){function a(a,b){this.backoffIntervals=[].concat(a);this.cache=new Map();this.resetInterval=(a=b==null?void 0:b.resetInterval)!=null?a:null}var b=a.prototype;b.add=function(a){if(this.get(a))throw c("err")("This entry already exists in the backoff cache");this.cache.set(a,{lastAttempt:Date.now(),intervals:[].concat(this.backoffIntervals),attempts:1})};b.remove=function(a){this.cache["delete"](a)};b.get=function(a){return this.cache.get(a)};b.reset=function(a){this.remove(a),this.add(a)};b.shouldBackoff=function(a){var b=this.get(a);if(this.resetInterval!=null&&b!=null){var c=this.resetInterval,d=Date.now()-b.lastAttempt;if(d>=c){this.remove(a);return!1}}if(b!=null){d=b.intervals[0];if(d!=null){c=Date.now()-b.lastAttempt;if(c<d)return!0}}return!1};b.markAttemptAndShiftInterval=function(a){a=this.get(a);a!=null&&(a.lastAttempt=Date.now(),a.intervals.shift(),a.attempts++)};b.test=function(a){if(this.shouldBackoff(a))return!0;else this.get(a)!=null?this.markAttemptAndShiftInterval(a):this.add(a);return!1};b.getCurrentInterval=function(a){a=this.get(a);if(a!=null)return a.intervals[0]};return a}();g.BackoffCache=a}),98); __d("WAWebEphemeralGenerateSystemMessage",["WAWebContactSystemMsg","WAWebHandleMsgTypes.flow","WAWebHandleSingleMsg","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b,c){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){a=d("WAWebContactSystemMsg").genDisappearingModeUpdateSystemMsg(a.id,b,c);yield d("WAWebHandleSingleMsg").handleSingleMsg(a.from,a,"ephemeralSystemMsg",d("WAWebHandleMsgTypes.flow").MessageOverwriteOption.NO_OVERWRITE,!1)});return h.apply(this,arguments)}function c(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=d("WAWebContactSystemMsg").genDisappearingModeUnsupportedSystemMsg(a.id);yield d("WAWebHandleSingleMsg").handleSingleMsg(a.from,a,"ephemeralUnsupportedSystemMsg",d("WAWebHandleMsgTypes.flow").MessageOverwriteOption.NO_OVERWRITE,!1)});return i.apply(this,arguments)}g.generateEphemeralNotificationTemplateSystemMessage=a;g.generateEphemeralUnsupportedNotificationTemplateSystemMessage=c}),98); __d("WAWebEphemeralIsDurationAllowed",[],(function(a,b,c,d,e,f){var g=[86400,604800,7776e3];function a(a){if(a<0)return!1;return a===0?!0:g.includes(a)}f.isEphemeralDurationAllowed=a}),66); __d("WAWebEphemeralOutOfSyncInfoWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumClientGroupSizeBucket"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({EphemeralOutOfSyncInfo:[3892,{groupSizeBucket:[1,d("WAWebWamEnumClientGroupSizeBucket").CLIENT_GROUP_SIZE_BUCKET],incomingMessageEphemeralityDuration:[2,a.TYPES.INTEGER],isAGroup:[3,a.TYPES.BOOLEAN],isNewThreadForUser:[5,a.TYPES.BOOLEAN],otherDefaultModeDuration:[6,a.TYPES.INTEGER],threadEphemeralityDuration:[7,a.TYPES.INTEGER],threadId:[8,a.TYPES.STRING],userDefaultModeDuration:[9,a.TYPES.INTEGER]},[1,1,1],"regular"]},{EphemeralOutOfSyncInfo:[]});g.EphemeralOutOfSyncInfoWamEvent=b}),98); __d("WAWebWamEnumEsrFailureReasonType",[],(function(a,b,c,d,e,f){a=Object.freeze({ESR_ABPROP_OFF:1,DM_RELIABILITY_ABPROP_OFF:2,INVALID_MESSAGE_TYPE:3,OLDER_EPHEMERAL_SETTING_TIMESTAMP:4,NO_EPHEMERAL_INFO:5,ATTEMPTS_EXHAUSTED:6,NO_USER_INFO:7,NO_CHAT_SESSION:8,INVALID_EPHEMERAL_DURATION:9});f.ESR_FAILURE_REASON_TYPE=a}),66); __d("WAWebWamEnumEsrSendResultType",[],(function(a,b,c,d,e,f){a=Object.freeze({SUCCESS:1,ERROR:2});f.ESR_SEND_RESULT_TYPE=a}),66); __d("WAWebEphemeralSyncResponseReceiveWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumDisappearingChatInitiatorType","WAWebWamEnumEphemeralityInitiatorType","WAWebWamEnumEphemeralityTriggerActionType","WAWebWamEnumEsrFailureReasonType","WAWebWamEnumEsrSendResultType"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({EphemeralSyncResponseReceive:[4780,{clientDisappearingModeInitiator:[1,d("WAWebWamEnumDisappearingChatInitiatorType").DISAPPEARING_CHAT_INITIATOR_TYPE],clientEphemeralityDuration:[2,a.TYPES.INTEGER],clientEphemeralityInitiator:[3,d("WAWebWamEnumEphemeralityInitiatorType").EPHEMERALITY_INITIATOR_TYPE],clientEphemeralitySettingTimestamp:[4,a.TYPES.INTEGER],clientEphemeralityTriggerAction:[5,d("WAWebWamEnumEphemeralityTriggerActionType").EPHEMERALITY_TRIGGER_ACTION_TYPE],esrDisappearingModeInitiator:[6,d("WAWebWamEnumDisappearingChatInitiatorType").DISAPPEARING_CHAT_INITIATOR_TYPE],esrEphemeralityDuration:[7,a.TYPES.INTEGER],esrEphemeralityInitiator:[8,d("WAWebWamEnumEphemeralityInitiatorType").EPHEMERALITY_INITIATOR_TYPE],esrEphemeralitySettingTimestamp:[9,a.TYPES.INTEGER],esrEphemeralityTriggerAction:[10,d("WAWebWamEnumEphemeralityTriggerActionType").EPHEMERALITY_TRIGGER_ACTION_TYPE],esrFailureReason:[11,d("WAWebWamEnumEsrFailureReasonType").ESR_FAILURE_REASON_TYPE],esrResolveResult:[12,d("WAWebWamEnumEsrSendResultType").ESR_SEND_RESULT_TYPE],isAGroup:[13,a.TYPES.BOOLEAN],threadId:[14,a.TYPES.STRING]},[1,1,1],"regular"]},{EphemeralSyncResponseReceive:[]});g.EphemeralSyncResponseReceiveWamEvent=b}),98); __d("WAWebEphemeralSyncResponseSendWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumDisappearingChatInitiatorType","WAWebWamEnumEphemeralityInitiatorType","WAWebWamEnumEphemeralityTriggerActionType","WAWebWamEnumEsrFailureReasonType","WAWebWamEnumEsrSendResultType"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({EphemeralSyncResponseSend:[4778,{clientDisappearingModeInitiator:[1,d("WAWebWamEnumDisappearingChatInitiatorType").DISAPPEARING_CHAT_INITIATOR_TYPE],clientEphemeralityDuration:[2,a.TYPES.INTEGER],clientEphemeralityInitiator:[3,d("WAWebWamEnumEphemeralityInitiatorType").EPHEMERALITY_INITIATOR_TYPE],clientEphemeralitySettingTimestamp:[4,a.TYPES.INTEGER],clientEphemeralityTriggerAction:[5,d("WAWebWamEnumEphemeralityTriggerActionType").EPHEMERALITY_TRIGGER_ACTION_TYPE],esrDisappearingModeInitiator:[6,d("WAWebWamEnumDisappearingChatInitiatorType").DISAPPEARING_CHAT_INITIATOR_TYPE],esrEphemeralityDuration:[7,a.TYPES.INTEGER],esrEphemeralityInitiator:[8,d("WAWebWamEnumEphemeralityInitiatorType").EPHEMERALITY_INITIATOR_TYPE],esrEphemeralitySettingTimestamp:[9,a.TYPES.INTEGER],esrEphemeralityTriggerAction:[10,d("WAWebWamEnumEphemeralityTriggerActionType").EPHEMERALITY_TRIGGER_ACTION_TYPE],esrFailureReason:[11,d("WAWebWamEnumEsrFailureReasonType").ESR_FAILURE_REASON_TYPE],esrSendAttempt:[12,a.TYPES.INTEGER],esrSendResult:[13,d("WAWebWamEnumEsrSendResultType").ESR_SEND_RESULT_TYPE],isAGroup:[14,a.TYPES.BOOLEAN],messageDisappearingModeInitiator:[15,d("WAWebWamEnumDisappearingChatInitiatorType").DISAPPEARING_CHAT_INITIATOR_TYPE],messageEphemeralityDuration:[16,a.TYPES.INTEGER],messageEphemeralityInitiator:[17,d("WAWebWamEnumEphemeralityInitiatorType").EPHEMERALITY_INITIATOR_TYPE],messageEphemeralitySettingTimestamp:[18,a.TYPES.INTEGER],messageEphemeralityTriggerAction:[19,d("WAWebWamEnumEphemeralityTriggerActionType").EPHEMERALITY_TRIGGER_ACTION_TYPE],threadId:[20,a.TYPES.STRING]},[1,1,1],"regular"]},{EphemeralSyncResponseSend:[]});g.EphemeralSyncResponseSendWamEvent=b}),98); __d("WAWebEphemeralSyncResponseWAM",["WAWebABProps","WAWebChatThreadLogging","WAWebEphemeralSyncResponseReceiveWamEvent","WAWebEphemeralSyncResponseSendWamEvent","WAWebEphemeralityWAMUtils","WAWebWamEnumEsrSendResultType","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){return d("WAWebABProps").getABPropConfigValue("dm_reliability_logging")}function a(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.to,c=a.changes,e=a.incomingMsgSettings,f=a.localChatSettings;a=a.attempts;if(!h())return;b=new(d("WAWebEphemeralSyncResponseSendWamEvent").EphemeralSyncResponseSendWamEvent)({threadId:yield d("WAWebChatThreadLogging").getChatThreadID(b.toJid()),esrSendResult:d("WAWebWamEnumEsrSendResultType").ESR_SEND_RESULT_TYPE.SUCCESS,isAGroup:!1,esrDisappearingModeInitiator:d("WAWebEphemeralityWAMUtils").getWamDisappearingModeInitiator(c.initiator),esrEphemeralityDuration:c.duration,esrEphemeralityInitiator:d("WAWebEphemeralityWAMUtils").getWamDisappearingModeInitiatedByMe(c.initiatedByMe),esrEphemeralitySettingTimestamp:c.settingTimestamp,esrEphemeralityTriggerAction:d("WAWebEphemeralityWAMUtils").getWamDisappearingModeTrigger(c.disappearingModeTrigger)});f!=null&&(f.initiator!=null&&b.set({clientDisappearingModeInitiator:d("WAWebEphemeralityWAMUtils").getWamDisappearingModeInitiator(f.initiator)}),f.disappearingModeTrigger!=null&&b.set({clientEphemeralityTriggerAction:d("WAWebEphemeralityWAMUtils").getWamDisappearingModeTrigger(f.disappearingModeTrigger)}),b.set({clientEphemeralityDuration:f.duration,clientEphemeralityInitiator:d("WAWebEphemeralityWAMUtils").getWamDisappearingModeInitiatedByMe(f.initiatedByMe),clientEphemeralitySettingTimestamp:f.settingTimestamp}));e!=null&&(e.initiator!=null&&b.set({messageDisappearingModeInitiator:d("WAWebEphemeralityWAMUtils").getWamDisappearingModeInitiator(e.initiator)}),e.disappearingModeTrigger!=null&&b.set({messageEphemeralityTriggerAction:d("WAWebEphemeralityWAMUtils").getWamDisappearingModeTrigger(e.disappearingModeTrigger)}),b.set({messageEphemeralityDuration:e.duration,messageEphemeralityInitiator:d("WAWebEphemeralityWAMUtils").getWamDisappearingModeInitiatedByMe(e.initiatedByMe),messageEphemeralitySettingTimestamp:e.settingTimestamp}));a!=null&&b.set({esrSendAttempt:a});b.commit()});return i.apply(this,arguments)}function c(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.to,c=a.error;a=a.attempts;if(!h())return;b=new(d("WAWebEphemeralSyncResponseSendWamEvent").EphemeralSyncResponseSendWamEvent)({threadId:yield d("WAWebChatThreadLogging").getChatThreadID(b.toJid()),esrFailureReason:c,esrSendResult:d("WAWebWamEnumEsrSendResultType").ESR_SEND_RESULT_TYPE.ERROR});a!=null&&b.set({esrSendAttempt:a});b.commit()});return j.apply(this,arguments)}function e(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.chat,c=a.incomingESRSettings,e=a.localChatSettings;a=a.failureReason;if(!h())return;b=new(d("WAWebEphemeralSyncResponseReceiveWamEvent").EphemeralSyncResponseReceiveWamEvent)({threadId:yield d("WAWebChatThreadLogging").getChatThreadID(b.id.toJid()),isAGroup:!1});c!=null&&(c.initiator!=null&&b.set({esrDisappearingModeInitiator:d("WAWebEphemeralityWAMUtils").getWamDisappearingModeInitiator(c.initiator)}),c.disappearingModeTrigger!=null&&b.set({esrEphemeralityTriggerAction:d("WAWebEphemeralityWAMUtils").getWamDisappearingModeTrigger(c.disappearingModeTrigger)}),b.set({esrEphemeralityDuration:c.duration,esrEphemeralityInitiator:d("WAWebEphemeralityWAMUtils").getWamDisappearingModeInitiatedByMe(c.initiatedByMe),esrEphemeralitySettingTimestamp:c.settingTimestamp}));e!=null&&(e.initiator!=null&&b.set({clientDisappearingModeInitiator:d("WAWebEphemeralityWAMUtils").getWamDisappearingModeInitiator(e.initiator)}),e.disappearingModeTrigger!=null&&b.set({clientEphemeralityTriggerAction:d("WAWebEphemeralityWAMUtils").getWamDisappearingModeTrigger(e.disappearingModeTrigger)}),b.set({clientEphemeralityDuration:e.duration,clientEphemeralityInitiator:d("WAWebEphemeralityWAMUtils").getWamDisappearingModeInitiatedByMe(e.initiatedByMe),clientEphemeralitySettingTimestamp:e.settingTimestamp}));a!=null?b.set({esrResolveResult:d("WAWebWamEnumEsrSendResultType").ESR_SEND_RESULT_TYPE.ERROR,esrFailureReason:a}):b.set({esrResolveResult:d("WAWebWamEnumEsrSendResultType").ESR_SEND_RESULT_TYPE.SUCCESS});b.commit()});return k.apply(this,arguments)}g.sendEphemeralSyncResponseSendWamEvent=a;g.sendEphemeralSyncResponseSendErrorWamEvent=c;g.sendEphemeralSyncResponseReceiveWamEvent=e}),98); __d("WAWebUpdateEphemeralSettingChatAction",["WALogger","WAWebDBChatEphemeralExemptionData","WAWebDBUpdateChatTable","WAWebEphemeralGenerateSystemMessage","WAWebEphemeralityTypes","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[DMResolve] updateChatEphemeralSettings"]);h=function(){return a};return a}function i(a,b){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){d("WALogger").LOG(h()).devConsole(babelHelpers["extends"]({chat:a.id},b)),yield d("WAWebDBUpdateChatTable").updateChatTable(a.id,babelHelpers["extends"]({},b,{disappearingModeInitiator:b.disappearingModeInitiator,disappearingModeTrigger:b.disappearingModeTrigger!=null?b.disappearingModeTrigger:null})),a.set(b),d("WAWebDBChatEphemeralExemptionData").updateEphemeralDurationCache(a.id,a.ephemeralDuration)});return j.apply(this,arguments)}function a(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield i(a,{ephemeralDuration:0,ephemeralSettingTimestamp:Date.now(),disappearingModeInitiator:d("WAWebEphemeralityTypes").DisappearingModeInitiator.ChangedInChat}),yield d("WAWebEphemeralGenerateSystemMessage").generateEphemeralUnsupportedNotificationTemplateSystemMessage(a)});return k.apply(this,arguments)}g.updateChatEphemeralSettings=i;g.setChatAsEphemeralityUnsupported=a}),98); __d("WAWebEphemeralSyncResponse",["WAJobOrchestratorTypes","WALogger","WATimeUtils","WAWebABProps","WAWebBackoff","WAWebChatCollection","WAWebChatEphemerality","WAWebChatGetters","WAWebChatThreadLogging","WAWebCommonMsgUtils","WAWebContactCollection","WAWebDBChatEphemeralExemptionData","WAWebDBUpdateChatTable","WAWebDBUpdateMessageTable","WAWebEphemeralGenerateSystemMessage","WAWebEphemeralIsDurationAllowed","WAWebEphemeralOutOfSyncInfoWamEvent","WAWebEphemeralSyncResponseWAM","WAWebEphemeralityResolver","WAWebMsgCollection","WAWebMsgEphemerality","WAWebMsgKey","WAWebMsgModel","WAWebMsgType","WAWebOrchestratorNonPersistedJob","WAWebSendMsgRecordAction","WAWebUpdateEphemeralSettingChatAction","WAWebUserPrefsMeUser","WAWebWamEnumEsrFailureReasonType","asyncToGeneratorRuntime","err","gkx"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[DMResolve] other party is out-of-sync, sending EPHEMERAL_SYNC_RESPONSE"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[DMResolve] rendering DM system message as duration has changed"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[DMResolve] local is out-of-sync, updating local chat DM settings"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[DMResolve] ESR resolution details: ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[DMResolve] neither party is out-of-sync"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[DMResolve] resolving ephemerality using existing chat DM settings:"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["[DMResolve] dropping msg from ephemeral sync"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["[DMResolve] Sending out EPHEMERAL_SYNC_RESPONSE"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["[DMResolve] Not sending ESR to "," due to back off limit"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["[DMResolve] skip sending ESR: disabled or unsupported chat"]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["[DMResolve] Updating chat due to EPHEMERAL_SYNC_RESPONSE"]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["[DMResolve] Received ESR, but chat and msg settings are already the same"]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["[DMResolve] processEphemeralSyncResponse called with invalid setting "," seconds for chat ",""]);t=function(){return a};return a}function u(){var a=babelHelpers.taggedTemplateLiteralLoose(["[DMResolve] processing EPHEMERAL_SYNC_RESPONSE"]);u=function(){return a};return a}function v(){var a=babelHelpers.taggedTemplateLiteralLoose(["[DMResolve] cannot process EPHEMERAL_SYNC_RESPONSE for enterprise contact ",""]);v=function(){return a};return a}function w(){var a=babelHelpers.taggedTemplateLiteralLoose(["[DMResolve] EPHEMERAL_SYNC_RESPONSE should not be processed for group chats ",""]);w=function(){return a};return a}function x(){var a=babelHelpers.taggedTemplateLiteralLoose(["[DMResolve] setting ephemeralOutOfSync on msg"]);x=function(){return a};return a}function y(){return d("WAWebABProps").getABPropConfigValue("ephemeral_sync_response")}function z(){d("WAWebABProps").getABPropConfigValue("ephemeral_sync_response"),d("WAWebABProps").getABPropConfigValue("dm_reliability_logging")}function A(a){return B.apply(this,arguments)}function B(){B=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){d("WALogger").LOG(x()).devConsole({msg:a});var b={ephemeralOutOfSync:!0};y()&&(yield d("WAWebDBUpdateMessageTable").updateMessageTable(a.id,b));a.ephemeralOutOfSync=!0;a=d("WAWebMsgCollection").MsgCollection.get(a.id);a&&a.set(b)});return B.apply(this,arguments)}function a(a){return C.apply(this,arguments)}function C(){C=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=d("WAWebChatCollection").ChatCollection.get(a.id.remote);if(!b)throw c("err")("[DMResolve] chat model not found for ESR message");if(d("WAWebChatGetters").getIsGroup(b)){d("WALogger").ERROR(w(),b.id.toLogString()).sendLogs("handle-ephemeral-sync-response");return}z();if(!y()){void d("WAWebEphemeralSyncResponseWAM").sendEphemeralSyncResponseReceiveWamEvent({chat:b,failureReason:d("WAWebWamEnumEsrFailureReasonType").ESR_FAILURE_REASON_TYPE.ESR_ABPROP_OFF});return}if(b.contact.isEnterprise){d("WALogger").LOG(v(),b.id.toLogString());return}d("WALogger").LOG(u()).devConsole({chat:b,msg:a});a={id:a.id,type:a.type,kind:a.kind,ephemeralDuration:a.ephemeralDuration,ephemeralSettingTimestamp:a.ephemeralSettingTimestamp,disappearingModeInitiator:a.disappearingModeInitiator,disappearingModeTrigger:a.disappearingModeTrigger,disappearingModeInitiatedByMe:a.disappearingModeInitiatedByMe};a=d("WAWebMsgEphemerality").getMsgEphemeralitySettings(a);if(a!=null){if(!d("WAWebEphemeralIsDurationAllowed").isEphemeralDurationAllowed(a.duration)){d("WALogger").LOG(t(),a.duration,b.id.toLogString());void d("WAWebEphemeralSyncResponseWAM").sendEphemeralSyncResponseReceiveWamEvent({chat:b,failureReason:d("WAWebWamEnumEsrFailureReasonType").ESR_FAILURE_REASON_TYPE.INVALID_EPHEMERAL_DURATION});return}var e=d("WAWebChatEphemerality").getChatEphemeralityFields(b);if(d("WAWebEphemeralityResolver").compareEphemeralityFields(e,a)){d("WALogger").LOG(s()).devConsole({originalChatEphemeralSetting:e,msgEphemeralSetting:a});return}d("WALogger").LOG(r()).devConsole({originalChatEphemeralSetting:e,msgEphemeralSetting:a});b.ephemeralDuration=a.duration;b.ephemeralSettingTimestamp=d("WAWebEphemeralityResolver").resolveSettingTimestamp(a.settingTimestamp);var f=d("WAWebEphemeralityResolver").resolveDisappearingModeTrigger(a.disappearingModeTrigger),g=d("WAWebEphemeralityResolver").resolveDisappearingModeInitiator(a.initiator);b.disappearingModeInitiator=g;b.disappearingModeTrigger=f;b.disappearingModeInitiatedByMe=d("WAWebEphemeralityResolver").resolveDisappearingModeInitiatedByMe(a.initiatedByMe,a.initiator);yield d("WAWebDBUpdateChatTable").updateChatTable(b.id,{ephemeralDuration:b.ephemeralDuration,ephemeralSettingTimestamp:b.ephemeralSettingTimestamp,disappearingModeInitiator:g,disappearingModeTrigger:f,disappearingModeInitiatedByMe:b.disappearingModeInitiatedByMe});d("WAWebDBChatEphemeralExemptionData").updateEphemeralDurationCache(b.id,b.ephemeralDuration);g=d("WAWebEphemeralityResolver").resolveEphermalityDuration(e==null?void 0:e.duration)!==d("WAWebEphemeralityResolver").resolveEphermalityDuration(a==null?void 0:a.duration);g&&(yield d("WAWebEphemeralGenerateSystemMessage").generateEphemeralNotificationTemplateSystemMessage(b,a.duration,null));void d("WAWebEphemeralSyncResponseWAM").sendEphemeralSyncResponseReceiveWamEvent({chat:b,incomingESRSettings:a,localChatSettings:e})}});return C.apply(this,arguments)}var D=new(d("WAWebBackoff").BackoffCache)([1e3*60*3,1e3*60*15,Infinity],{resetInterval:d("WATimeUtils").DAY_SECONDS});function E(a,b,c,d){return F.apply(this,arguments)}function F(){F=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e,f){z();if(!y()||!a.isUser()||a.isPSA()||a.isBot()){d("WALogger").LOG(q());return}if(c("gkx")("26256")){var g;window.esrCount=((g=window.esrCount)!=null?g:0)+1}g=a.toString();if(D.test(g)){var h;d("WALogger").LOG(p(),a).devConsole({currentBackoff:D.get(a.toString())});h=(h=D.get(g))==null?void 0:h.attempts;h!=null&&void d("WAWebEphemeralSyncResponseWAM").sendEphemeralSyncResponseSendErrorWamEvent({to:a,error:d("WAWebWamEnumEsrFailureReasonType").ESR_FAILURE_REASON_TYPE.ATTEMPTS_EXHAUSTED,attempts:h});return}h=b.duration;var i=b.settingTimestamp,j=b.initiator,k=d("WAWebUserPrefsMeUser").getMeUser(),l=new(c("WAWebMsgKey"))({fromMe:!0,remote:a,id:yield c("WAWebMsgKey").newId(),participant:void 0});l={id:l,from:k,to:a,t:d("WATimeUtils").unixTime(),type:d("WAWebMsgType").MSG_TYPE.PROTOCOL,subtype:"ephemeral_sync_response",ephemeralDuration:h,ephemeralSettingTimestamp:i,disappearingModeInitiator:j};var m=new(d("WAWebMsgModel").Msg)(l);d("WALogger").LOG(o()).devConsole({messageData:l});void d("WAWebEphemeralSyncResponseWAM").sendEphemeralSyncResponseSendWamEvent({to:a,changes:b,incomingMsgSettings:e,localChatSettings:f,attempts:(k=D.get(g))==null?void 0:k.attempts});return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("sendMessage",function(){return d("WAWebSendMsgRecordAction").sendMsgRecord(m)},{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()});return F.apply(this,arguments)}function G(a,b){return d("WAWebChatGetters").getIsUser(b)&&!b.contact.isEnterprise&&!a.id.fromMe&&d("WAWebMsgEphemerality").messageSupportsEphemerality(a.type)?!0:!1}function H(a,b){return I.apply(this,arguments)}function I(){I=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c;if(!d("WAWebABProps").getABPropConfigValue("out_of_sync_disappearing_messages_logging"))return;c=(c=d("WAWebChatEphemerality").getEphemeralSetting(b))!=null?c:0;var e=d("WAWebEphemeralityResolver").getEphemeralDurationForUser(d("WAWebContactCollection").ContactCollection.getMeContact()),f=d("WAWebEphemeralityResolver").getEphemeralDurationForUser(b.contact);new(d("WAWebEphemeralOutOfSyncInfoWamEvent").EphemeralOutOfSyncInfoWamEvent)({incomingMessageEphemeralityDuration:(a=a)!=null?a:0,isAGroup:d("WAWebChatGetters").getIsGroup(b),threadEphemeralityDuration:c,otherDefaultModeDuration:(a=f)!=null?a:0,userDefaultModeDuration:(c=e)!=null?c:0,threadId:yield d("WAWebChatThreadLogging").getChatThreadID(b.id.toJid()),isNewThreadForUser:b.msgs.length===0}).commit()});return I.apply(this,arguments)}function e(a,b){return J.apply(this,arguments)}function J(){J=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=a.type===d("WAWebMsgType").MSG_TYPE.PROTOCOL&&a.subtype==="ephemeral_setting";if(!G(a,b)&&!c){d("WALogger").LOG(n()).devConsole({msg:a,chat:b});return}var e=d("WAWebMsgEphemerality").getMsgEphemeralitySettings(a),f=d("WAWebChatEphemerality").getChatEphemeralityFields(b);d("WALogger").LOG(m()).devConsole({incomingMsgSettings:e,localChatSettings:f,msg:a});var g=d("WAWebEphemeralityResolver").resolveExistingChatDMSettings(e,f),o=d("WAWebEphemeralityResolver").compareEphemeralityFields(f,g),p=d("WAWebEphemeralityResolver").compareEphemeralityFields(e,g);if(g==null||o&&p)d("WALogger").LOG(l()).devConsole(g),D.remove(b.id.toString());else{d("WALogger").LOG(k(),JSON.stringify({msgId:a.id.toString(),resolution:g,incomingMsgSettings:e,localChatSettings:f}));if(!o){d("WALogger").LOG(j());yield d("WAWebUpdateEphemeralSettingChatAction").updateChatEphemeralSettings(b,{ephemeralSettingTimestamp:g.settingTimestamp,ephemeralDuration:g.duration,disappearingModeInitiator:g.initiator,disappearingModeTrigger:g.disappearingModeTrigger,disappearingModeInitiatedByMe:g.initiatedByMe});!c&&g.duration!==((o=f==null?void 0:f.duration)!=null?o:0)&&(d("WALogger").LOG(i()),yield d("WAWebEphemeralGenerateSystemMessage").generateEphemeralNotificationTemplateSystemMessage(b,g.duration,null))}if(!p){d("WALogger").LOG(h());if(!d("WAWebCommonMsgUtils").isNotificationType(a.type,a.subtype)){o=(c=e==null?void 0:e.duration)!=null?c:0;g.duration!==o&&(A(a),H(e==null?void 0:e.duration,b));void E(a.from,g,e,f)}}}});return J.apply(this,arguments)}f=E;g.processEphemeralSyncResponse=a;g.syncEphemeralSetting=e;g._sendEphemeralSyncResponse=f}),98); __d("WAWebEphemeralFbtKic",["fbt","$InternalEnum","WALogger","WAWebContactCollection","WAWebContactGetters","WAWebFrontendContactGetters","WAWebMiscGatingUtils","WAWebWidFormat"],(function(a,b,c,d,e,f,g,h){function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["getEphemeralOnDaysL10nComponent is given type "," and name ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["getEphemeralOnHoursL10nComponent is given type "," and name ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["getEphemeralOnMinutesL10nComponent is given type "," and name ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["getEphemeralOnSecondsL10nComponent is given type "," and name ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["getEphemeralOffL10nComponent is given invalid type ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["getEphemeralString "," is given invalid duration ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["getEphemeralOnDaysString is given type "," and name ",""]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["getEphemeralOnHoursString is given type "," and name ",""]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["getEphemeralOnMinutesString is given type "," and name ",""]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["getEphemeralOnSecondsString is given type "," and name ",""]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["getEphemeralOffString is given invalid type ",""]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["getEphemeralString "," is given invalid duration ",""]);t=function(){return a};return a}var u=b("$InternalEnum").Mirrored(["SettingChangeByOthers","SettingChangeByYou","SettingChangeByUnknown","SettingChangeByOthersAsAdmin","SettingChangeByYouAsAdmin","SettingChangeByUnknownAsAdmin","Duration","OutOfSyncInfo","Explanation","ModeChangeByOthers","ModeChangeByYou"]);function a(a,b){a===void 0&&(a=0);return F(u.SettingChangeByOthers,a,b)}function c(a,b){a===void 0&&(a=0);return L(u.SettingChangeByOthers,a,b)}function e(a){a===void 0&&(a=0);return F(u.SettingChangeByYou,a)}function v(a){a===void 0&&(a=0);return F(u.SettingChangeByUnknown,a)}function w(a,b){a===void 0&&(a=0);return F(u.SettingChangeByOthersAsAdmin,a,b)}function x(a,b){a===void 0&&(a=0);return L(u.SettingChangeByOthersAsAdmin,a,b)}function y(a){a===void 0&&(a=0);return F(u.SettingChangeByYouAsAdmin,a)}function z(a){a===void 0&&(a=0);return F(u.SettingChangeByUnknownAsAdmin,a)}function A(a){a===void 0&&(a=0);return F(u.Duration,a)}function B(a){a===void 0&&(a=0);return F(u.OutOfSyncInfo,a)}function C(a){a===void 0&&(a=0);return F(u.Explanation,a)}function D(a,b){a===void 0&&(a=0);return F(u.ModeChangeByOthers,a,b)}function E(a){a===void 0&&(a=0);return F(u.ModeChangeByYou,a)}function F(a,b,c){b===void 0&&(b=0);if(b<0){d("WALogger").ERROR(t(),a,b).sendLogs("invalid-duration");return""}if(b===0)return G(a,c);else if(b<=60)return H(a,b,c);else if(b<=60*60){var e=Math.floor(b/60);return I(a,e,c)}else if(b<=24*60*60){e=Math.floor(b/60/60);return J(a,e,c)}e=Math.floor(b/24/60/60);return K(a,e,c)}function G(a,b){if(a===u.SettingChangeByOthers&&b!=null)return h._(/*BTDS*/"__JHASH__XWbPvNSlQCC__JHASH__",[h._param("person-name",b)]);else if(a===u.SettingChangeByYou)return h._(/*BTDS*/"__JHASH__RRF0AyAKv8N__JHASH__");else if(a===u.SettingChangeByUnknown)return h._(/*BTDS*/"__JHASH__50HV2D2aXA0__JHASH__");else if(a===u.SettingChangeByOthersAsAdmin&&b!=null)return h._(/*BTDS*/"__JHASH__s_ZWObRGdEP__JHASH__",[h._param("person-name",b)]);else if(a===u.SettingChangeByYouAsAdmin)return h._(/*BTDS*/"__JHASH__c44jOyWGfs3__JHASH__");else if(a===u.SettingChangeByUnknownAsAdmin)return h._(/*BTDS*/"__JHASH__mckEto0DfZp__JHASH__");else if(a===u.Duration)return h._(/*BTDS*/"__JHASH__S2-YY9UxuU1__JHASH__");else if(a===u.OutOfSyncInfo)return h._(/*BTDS*/"__JHASH__kUA6z_kYrHc__JHASH__");d("WALogger").ERROR(s(),a).sendLogs("invalid-ephemeral-string-type");return""}function H(a,b,c){var e=d("WAWebMiscGatingUtils").isDefaultDisappearingMessagesEnabled();if(a===u.SettingChangeByOthers&&c!=null)return h._(/*BTDS*/"__JHASH__nZ7ycWZo0Ji__JHASH__",[h._plural(b,"number_of_seconds"),h._param("person-name",c)]);else if(a===u.SettingChangeByYou)return h._(/*BTDS*/"__JHASH__L0v_2ruqOVs__JHASH__",[h._plural(b,"number_of_seconds")]);else if(a===u.SettingChangeByUnknown)return h._(/*BTDS*/"__JHASH__YjAMTi1O3g3__JHASH__",[h._plural(b,"number_of_seconds")]);else if(a===u.SettingChangeByOthersAsAdmin&&c!=null)return h._(/*BTDS*/"__JHASH__taiMLAUangQ__JHASH__",[h._plural(b,"number_of_seconds"),h._param("person-name",c)]);else if(a===u.SettingChangeByYouAsAdmin)return h._(/*BTDS*/"__JHASH__nGzbhtoeWCV__JHASH__",[h._plural(b,"number_of_seconds")]);else if(a===u.SettingChangeByUnknownAsAdmin)return h._(/*BTDS*/"__JHASH__WCGt76eiMmw__JHASH__",[h._plural(b,"number_of_seconds")]);else if(a===u.Duration)return h._(/*BTDS*/"__JHASH__XNqQQETy3nP__JHASH__",[h._plural(b,"number_of_seconds")]);else if(a===u.OutOfSyncInfo)return h._(/*BTDS*/"__JHASH__p3WER9rB99r__JHASH__",[h._plural(b,"number_of_seconds")]);else if(a===u.Explanation)return h._(/*BTDS*/"__JHASH__Xf_H8aZPO1J__JHASH__",[h._plural(b,"number_of_seconds")]);else if(a===u.ModeChangeByOthers)return e?h._(/*BTDS*/"__JHASH__DaOeDCZlt4p__JHASH__",[h._plural(b,"number_of_seconds"),h._param("person-name",c)]):h._(/*BTDS*/"__JHASH__2-D11Ernnq-__JHASH__",[h._plural(b,"number_of_seconds"),h._param("person-name",c)]);else if(a===u.ModeChangeByYou&&e)return h._(/*BTDS*/"__JHASH__qHF3corMRtj__JHASH__",[h._plural(b,"number_of_seconds")]);d("WALogger").ERROR(r(),a,c).sendLogs("invalid-ephemeral-string-type");return""}function I(a,b,c){var e=d("WAWebMiscGatingUtils").isDefaultDisappearingMessagesEnabled();if(a===u.SettingChangeByOthers&&c!=null)return h._(/*BTDS*/"__JHASH__c4YpgAbTxna__JHASH__",[h._plural(b,"number_of_minutes"),h._param("person-name",c)]);else if(a===u.SettingChangeByYou)return h._(/*BTDS*/"__JHASH__u7C72myD4eF__JHASH__",[h._plural(b,"number_of_minutes")]);else if(a===u.SettingChangeByUnknown)return h._(/*BTDS*/"__JHASH__cdRuIP5qYU0__JHASH__",[h._plural(b,"number_of_minutes")]);else if(a===u.SettingChangeByOthersAsAdmin&&c!=null)return h._(/*BTDS*/"__JHASH__QZ1i7_BqFeQ__JHASH__",[h._plural(b,"number_of_minutes"),h._param("person-name",c)]);else if(a===u.SettingChangeByYouAsAdmin)return h._(/*BTDS*/"__JHASH__yYIRKxjNXoR__JHASH__",[h._plural(b,"number_of_minutes")]);else if(a===u.SettingChangeByUnknownAsAdmin)return h._(/*BTDS*/"__JHASH__E9p49DHoq8-__JHASH__",[h._plural(b,"number_of_minutes")]);else if(a===u.Duration)return h._(/*BTDS*/"__JHASH__-uNN6r6Ma2B__JHASH__",[h._plural(b,"number_of_minutes")]);else if(a===u.OutOfSyncInfo)return h._(/*BTDS*/"__JHASH__yJgSN0P5jFG__JHASH__",[h._plural(b,"number_of_minutes")]);else if(a===u.Explanation)return h._(/*BTDS*/"__JHASH__oJuooivv0Is__JHASH__",[h._plural(b,"number_of_minutes")]);else if(a===u.ModeChangeByOthers)return e?h._(/*BTDS*/"__JHASH__W0DCsl1kD7C__JHASH__",[h._plural(b,"number_of_minutes"),h._param("person-name",c)]):h._(/*BTDS*/"__JHASH__ENTLrIb8Qr5__JHASH__",[h._plural(b,"number_of_minutes"),h._param("person-name",c)]);else if(a===u.ModeChangeByYou&&e)return h._(/*BTDS*/"__JHASH__affNmtbqWyp__JHASH__",[h._plural(b,"number_of_minutes")]);d("WALogger").ERROR(q(),a,c).sendLogs("invalid-ephemeral-string-type");return""}function J(a,b,c){var e=d("WAWebMiscGatingUtils").isDefaultDisappearingMessagesEnabled();if(a===u.SettingChangeByOthers&&c!=null)return h._(/*BTDS*/"__JHASH__Joly1kXzpeI__JHASH__",[h._plural(b,"number_of_hours"),h._param("person-name",c)]);else if(a===u.SettingChangeByYou)return h._(/*BTDS*/"__JHASH__MnR6u1x6y0O__JHASH__",[h._plural(b,"number_of_hours")]);else if(a===u.SettingChangeByUnknown)return h._(/*BTDS*/"__JHASH__iQMXnP9KyEF__JHASH__",[h._plural(b,"number_of_hours")]);else if(a===u.SettingChangeByOthersAsAdmin&&c!=null)return h._(/*BTDS*/"__JHASH__OZssBN6H8xO__JHASH__",[h._plural(b,"number_of_hours"),h._param("person-name",c)]);else if(a===u.SettingChangeByYouAsAdmin)return h._(/*BTDS*/"__JHASH__BBFnr9AuGXD__JHASH__",[h._plural(b,"number_of_hours")]);else if(a===u.SettingChangeByUnknownAsAdmin)return h._(/*BTDS*/"__JHASH__9eaDqw8qPJY__JHASH__",[h._plural(b,"number_of_hours")]);else if(a===u.Duration)return h._(/*BTDS*/"__JHASH__HKCQRs3Kvo9__JHASH__",[h._plural(b,"number_of_hours")]);else if(a===u.OutOfSyncInfo)return h._(/*BTDS*/"__JHASH__EK94IoBpRcJ__JHASH__",[h._plural(b,"number_of_hours")]);else if(a===u.Explanation)return h._(/*BTDS*/"__JHASH__DhiaCA2YliP__JHASH__",[h._plural(b,"number_of_hours")]);else if(a===u.ModeChangeByOthers)return e?h._(/*BTDS*/"__JHASH__Qz-4OXPn2zD__JHASH__",[h._plural(b,"number_of_hours"),h._param("person-name",c)]):h._(/*BTDS*/"__JHASH__py-7zWollUg__JHASH__",[h._plural(b,"number_of_hours"),h._param("person-name",c)]);else if(a===u.ModeChangeByYou&&e)return h._(/*BTDS*/"__JHASH__vhWiIEa5KpU__JHASH__",[h._plural(b,"number_of_hours")]);d("WALogger").ERROR(p(),a,c).sendLogs("invalid-ephemeral-string-type");return""}function K(a,b,c){var e=d("WAWebMiscGatingUtils").isDefaultDisappearingMessagesEnabled();if(a===u.SettingChangeByOthers&&c!=null)return h._(/*BTDS*/"__JHASH__LIxtBMA5Z9q__JHASH__",[h._plural(b,"number_of_days"),h._param("person-name",c)]);else if(a===u.SettingChangeByYou)return h._(/*BTDS*/"__JHASH__K5J1wJ2w08S__JHASH__",[h._plural(b,"number_of_days")]);else if(a===u.SettingChangeByUnknown)return h._(/*BTDS*/"__JHASH__sJcsckQWHhT__JHASH__",[h._plural(b,"number_of_days")]);else if(a===u.SettingChangeByOthersAsAdmin&&c!=null)return h._(/*BTDS*/"__JHASH__ZmrWUXclNg1__JHASH__",[h._plural(b,"number_of_days"),h._param("person-name",c)]);else if(a===u.SettingChangeByYouAsAdmin)return h._(/*BTDS*/"__JHASH__88NGDNM7L5m__JHASH__",[h._plural(b,"number_of_days")]);else if(a===u.SettingChangeByUnknownAsAdmin)return h._(/*BTDS*/"__JHASH__R9gaKjd3Z-z__JHASH__",[h._plural(b,"number_of_days")]);else if(a===u.Duration)return h._(/*BTDS*/"__JHASH__qLDr_XB1lMU__JHASH__",[h._plural(b,"number_of_days")]);else if(a===u.OutOfSyncInfo)return h._(/*BTDS*/"__JHASH__bu1DRVlFPHN__JHASH__",[h._plural(b,"number_of_days")]);else if(a===u.Explanation)return h._(/*BTDS*/"__JHASH__0T_GoQ_saZy__JHASH__",[h._plural(b,"number_of_days")]);else if(a===u.ModeChangeByOthers)return e?h._(/*BTDS*/"__JHASH__f3PEPS7N5DB__JHASH__",[h._plural(b,"number_of_days"),h._param("person-name",c)]):h._(/*BTDS*/"__JHASH__3y-hR-lnhGN__JHASH__",[h._plural(b,"number_of_days"),h._param("person-name",c)]);else if(a===u.ModeChangeByYou&&e)return h._(/*BTDS*/"__JHASH__VSUKzBqVmiJ__JHASH__",[h._plural(b,"number_of_days")]);d("WALogger").ERROR(o(),a,c).sendLogs("invalid-ephemeral-string-type");return""}function L(a,b,c){b===void 0&&(b=0);if(b<0){d("WALogger").ERROR(n(),a,b).sendLogs("invalid-duration");return""}if(b===0)return M(a,c);else if(b<=60)return N(a,b,c);else if(b<=60*60){var e=Math.floor(b/60);return O(a,e,c)}else if(b<=24*60*60){e=Math.floor(b/60/60);return P(a,e,c)}e=Math.floor(b/24/60/60);return Q(a,e,c)}function M(a,b){if(a===u.SettingChangeByOthers&&b!=null)return h._(/*BTDS*/"__JHASH__XWbPvNSlQCC__JHASH__",[h._param("person-name",b)]);else if(a===u.SettingChangeByOthersAsAdmin&&b!=null)return h._(/*BTDS*/"__JHASH__s_ZWObRGdEP__JHASH__",[h._param("person-name",b)]);d("WALogger").ERROR(m(),a).sendLogs("invalid-ephemeral-string-type");return""}function N(a,b,c){if(a===u.SettingChangeByOthers&&c!=null)return h._(/*BTDS*/"__JHASH__nZ7ycWZo0Ji__JHASH__",[h._plural(b,"number_of_seconds"),h._param("person-name",c)]);else if(a===u.SettingChangeByOthersAsAdmin&&c!=null)return h._(/*BTDS*/"__JHASH__taiMLAUangQ__JHASH__",[h._plural(b,"number_of_seconds"),h._param("person-name",c)]);d("WALogger").ERROR(l(),a,c).sendLogs("invalid-ephemeral-string-type");return""}function O(a,b,c){if(a===u.SettingChangeByOthers&&c!=null)return h._(/*BTDS*/"__JHASH__c4YpgAbTxna__JHASH__",[h._plural(b,"number_of_minutes"),h._param("person-name",c)]);else if(a===u.SettingChangeByOthersAsAdmin&&c!=null)return h._(/*BTDS*/"__JHASH__QZ1i7_BqFeQ__JHASH__",[h._plural(b,"number_of_minutes"),h._param("person-name",c)]);d("WALogger").ERROR(k(),a,c).sendLogs("invalid-ephemeral-string-type");return""}function P(a,b,c){if(a===u.SettingChangeByOthers&&c!=null)return h._(/*BTDS*/"__JHASH__Joly1kXzpeI__JHASH__",[h._plural(b,"number_of_hours"),h._param("person-name",c)]);else if(a===u.SettingChangeByOthersAsAdmin&&c!=null)return h._(/*BTDS*/"__JHASH__OZssBN6H8xO__JHASH__",[h._plural(b,"number_of_hours"),h._param("person-name",c)]);d("WALogger").ERROR(j(),a,c).sendLogs("invalid-ephemeral-string-type");return""}function Q(a,b,c){if(a===u.SettingChangeByOthers&&c!=null)return h._(/*BTDS*/"__JHASH__LIxtBMA5Z9q__JHASH__",[h._plural(b,"number_of_days"),h._param("person-name",c)]);else if(a===u.SettingChangeByOthersAsAdmin&&c!=null)return h._(/*BTDS*/"__JHASH__ZmrWUXclNg1__JHASH__",[h._plural(b,"number_of_days"),h._param("person-name",c)]);d("WALogger").ERROR(i(),a,c).sendLogs("invalid-ephemeral-string-type");return""}function R(a){var b=d("WAWebContactCollection").ContactCollection.assertGet(a);if(d("WAWebContactGetters").getIsMe(b))return h._(/*BTDS*/"__JHASH__KK00-Kd1ADD__JHASH__");b=d("WAWebContactGetters").getIsMyContact(b)?d("WAWebFrontendContactGetters").getFormattedName(b):d("WAWebWidFormat").widToFormattedUser(a);return h._(/*BTDS*/"__JHASH__XqBDVhnY1eL__JHASH__",[h._param("person-name",b)])}R.displayName=R.name+" [from "+f.id+"]";g.getDisappearingMessageSettingOthersStringKic=a;g.getDisappearingMessageSettingOthersGroupStringKic=c;g.getDisappearingMessageSettingYouStringKic=e;g.getDisappearingMessageSettingUnknownStringKic=v;g.getDisappearingMessageSettingOthersAsAdminStringKic=w;g.getDisappearingMessageSettingOthersAsAdminGroupStringKic=x;g.getDisappearingMessageSettingYouAsAdminStringKic=y;g.getDisappearingMessageSettingUnknownAsAdminStringKic=z;g.getDisappearingMessageDurationStringKic=A;g.getDisappearingMessageOutOfSyncInfoStringKic=B;g.getDisappearingMessageExplanationStringKic=C;g.getDisappearingModeOtherStringKic=D;g.getDisappearingModeYouStringKic=E;g.getKeptByString=R}),226); __d("WAWebDBEventInvalidateChatEvents",["WAWebDBMessageUtils","WAWebModelStorageUtils","WAWebMsgType","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return d("WAWebModelStorageUtils").getStorage().lock(["message"],function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){b=b[0];var c=(yield b.between(["internalId"],d("WAWebDBMessageUtils").beginningOfChat(a),d("WAWebDBMessageUtils").endOfChat(a)));yield b.bulkCreateOrMerge(c.filter(function(a){return a.type===d("WAWebMsgType").MSG_TYPE.EVENT_CREATION&&!a.eventInvalidated}).map(function(a){return{id:a.id,eventInvalidated:!0}}))});return function(a){return c.apply(this,arguments)}}())}g.invalidateChatEvents=a}),98); __d("WAWebInvalidateEventsAction",["WALogger","WAWebDBEventInvalidateChatEvents","WAWebFrontendMsgGetters","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[EVENTS] Failed to invalidate events with error: ",""]);h=function(){return a};return a}function a(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){try{yield d("WAWebDBEventInvalidateChatEvents").invalidateChatEvents(a.id),a.msgs.filter(function(a){return d("WAWebFrontendMsgGetters").getAsEventCreation(a)&&!a.eventInvalidated}).forEach(function(a){a.eventInvalidated=!0})}catch(a){d("WALogger").ERROR(h(),a).devConsole(a)}});return i.apply(this,arguments)}g.invalidateEventMsgsForChat=a}),98); __d("WAWebCollectionConstants",[],(function(a,b,c,d,e,f){a="collection_has_synced";b=50;c=20;f.COLLECTION_HAS_SYNCED=a;f.PAGE_SIZE=b;f.MSG_PRELOAD_THRESHOLD=c}),66); __d("WAWebEventMsgsCollection",["Promise","WAFilteredCatch","WALogger","WAWebBackendErrors","WAWebBaseCollection","WAWebCollectionConstants","WAWebFrontendMsgGetters","WAWebMsgCollection","WAWebMsgModel","WAWebNoop","WAWebSocketConstants","WAWebSocketModel"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Event msg sync error: "]);i=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(e,a);function e(b){var c;c=a.call(this)||this;c.syncPromise=null;c.isFullySynced=!1;c.isInitialized=!1;c.chat=b;c.listenTo(d("WAWebSocketModel").Socket,"change:stream",function(){d("WAWebSocketModel").Socket.stream===d("WAWebSocketConstants").SOCKET_STREAM.DISCONNECTED?c.isFullySynced=!1:d("WAWebSocketModel").Socket.stream===d("WAWebSocketConstants").SOCKET_STREAM.CONNECTED&&c["delete"]()});return c}var f=e.prototype;f.initialize=function(){if(this.isInitialized)return(h||(h=b("Promise"))).resolve();var a=this.chat.msgs;if(a==null)return(h||(h=b("Promise"))).resolve();a.length&&this.add(a.filter(j));a=(h||(h=b("Promise"))).resolve();this.chat.msgs.msgLoadState.noEarlierMsgs?this.isFullySynced=!0:a=this.queryEvents({recurse:!1});this.isInitialized=!0;return a};f["delete"]=function(){this.isFullySynced=!1,this.isInitialized=!1,a.prototype["delete"].call(this)};f.queryEvents=function(a){var e=this,f=a.recurse;if(this.syncPromise)return this.syncPromise;if(this.isFullySynced)return(h||(h=b("Promise"))).resolve();var g;a=this.last();a&&(g=a.id);a=(this.syncPromise=d("WAWebMsgCollection").MsgCollection.getEventMsgs(this.chat.id,d("WAWebCollectionConstants").PAGE_SIZE,g).then(function(a){(!a||a.length<d("WAWebCollectionConstants").PAGE_SIZE)&&(e.isFullySynced=!0),e.add(a.filter(j))}).then(function(){e.syncPromise=null;if(e.isFullySynced)e.trigger(d("WAWebCollectionConstants").COLLECTION_HAS_SYNCED);else if(f===!0){e.trigger("partial_sync");return e.queryEvents({recurse:!0})}})["catch"](d("WAFilteredCatch").filteredCatch(d("WAWebBackendErrors").E404,c("WAWebNoop")))["catch"](function(a){d("WALogger").WARN(i()).devConsole(a)}))["finally"](function(){e.syncPromise=null});return a};return e}(d("WAWebBaseCollection").BaseCollection);a.model=d("WAWebMsgModel").Msg;a.comparator=function(a,b){return b.t-a.t};function j(a){return d("WAWebFrontendMsgGetters").getAsEventCreation(a)!=null}g.EventMsgsCollection=a}),98); __d("WAWebEventResponseGetters",["WAWebGetters","WAWebGettersCaches"],(function(a,b,c,d,e,f,g){a=d("WAWebGetters").createGetterFactories({createCache:d("WAWebGettersCaches").createEventResponseCache});b=a.field;c=a.unsafeIdentityGetter;e=a.clearCacheFor;f=e;d=c;a=b("sender");e=b("senderTimestampMs");g.clearEventResponseGetterCacheFor=f;g.getEventResponseUnsafe=d;g.getSender=a;g.getSenderTimestampMs=e}),98); __d("WAWebFrontendEventResponseGetters",["WAWebEventResponseGetters","WAWebGetters","WAWebGettersCaches"],(function(a,b,c,d,e,f,g){a=d("WAWebGetters").createGetterFactories({root:d("WAWebEventResponseGetters").getEventResponseUnsafe,createCache:d("WAWebGettersCaches").createFrontendEventResponseCache});b=a.clearCacheFor;c=b;g.clearFrontendEventResponseGetterCacheFor=c}),98); __d("WAWebEventResponseModel",["WAWebAddOnModel","WAWebBaseModel","WAWebEventResponseGetters","WAWebFrontendEventResponseGetters"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.parentMsgKey=d("WAWebBaseModel").prop(),c.eventResponse=d("WAWebBaseModel").prop(),c.senderTimestampMs=d("WAWebBaseModel").prop(),c.t=d("WAWebBaseModel").prop(),c.sender=d("WAWebBaseModel").prop(),c.read=d("WAWebBaseModel").prop(),b)||babelHelpers.assertThisInitialized(c)}var c=b.prototype;c["delete"]=function(){a.prototype["delete"].call(this),d("WAWebEventResponseGetters").clearEventResponseGetterCacheFor(this),d("WAWebFrontendEventResponseGetters").clearFrontendEventResponseGetterCacheFor(this)};return b}(d("WAWebAddOnModel").AddOnBaseModel);b=d("WAWebBaseModel").defineModel(a);g.EventResponse=b}),98); __d("WAWebEventResponseCollection",["WANullthrows","WAWebAck","WAWebBaseCollection","WAWebCollectionUtils","WAWebEventResponseModel","WAWebMsgGetters","WAWebUserPrefsMeUser"],(function(a,b,c,d,e,f,g){b=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.byParent=d("WAWebCollectionUtils").aggregated(function(a){return a.parentMsgKey}),c.byIsFailedByMe=d("WAWebCollectionUtils").aggregated(function(a){return a.isSendFailure===!0||d("WAWebUserPrefsMeUser").isMeAccount(a.sender)&&a.ack!=null&&a.ack<d("WAWebAck").ACK.CLOCK}),b)||babelHelpers.assertThisInitialized(c)}return b}(d("WAWebBaseCollection").BaseCollection);b.model=d("WAWebEventResponseModel").EventResponse;function a(a){return new(d("WAWebEventResponseModel").EventResponse)(babelHelpers["extends"]({},a,{sender:c("WANullthrows")(d("WAWebMsgGetters").getSender(a))}))}e=new b();g.createEventResponseModel=a;g.EventResponseCollection=e}),98); __d("WAWebInitFavoritesFromStorage",["WAWebDBFavoriteDatabaseApi","WAWebFavoriteCollection"],(function(a,b,c,d,e,f,g){function a(){return d("WAWebDBFavoriteDatabaseApi").getAllFavorites().then(function(a){d("WAWebFavoriteCollection").FavoriteCollection.initializeFromCache([].concat(a))})}g.restoreFavorites=a}),98); __d("WAWebActionToast.react",["WAAbortError","WAPromiseDelays","WAWebNonEmptyString","WAWebNoop","WAWebToast.react","WAWebToastManager","err","react","uniqueID","useWAWebPrevious"],(function(a,b,c,d,e,f,g){var h,i;b=i||d("react");var j=h||(h=c("react")),k=b.useEffect,l=b.useRef,m=b.useState,n=5e3,o={LEFT:"LEFT",RIGHT:"RIGHT"};e=function(a,b){if(!a)throw c("err")("ActionType must have text!");this.text=a;b&&(this.action=b.actionText,this.handler=b.actionHandler)};function p(a){return d("WAWebNonEmptyString").asNonEmptyString(c("uniqueID")((a=d("WAWebNonEmptyString").asMaybeNonEmptyString(a))!=null?a:"action_toast"))}function a(a){var b=a.settleDuration,e=b===void 0?n:b;b=a.toastPosition;b=b===void 0?o.LEFT:b;var f=a.initialAction,g=a.pendingAction;a=a.id;var h=a===void 0?p():a;a=m(f);var i=a[0],q=a[1];a=m(f);var r=a[0],s=a[1];a=m(!0);var t=a[0],u=a[1],v=c("useWAWebPrevious")(i),w=l(null);a=function(){if(!r)return;if(!r.handler)return;r.handler()["catch"](c("WAWebNoop"))};k(function(){f!==v&&(q(f),s(f),u(!0))},[f,v]);i=function(){d("WAWebToastManager").ToastManager.close(h)};var x=function(a){w.current&&w.current.controller.abort();var b=new AbortController(),f=b.signal;a=a.then(function(a){if(f.aborted)throw new(d("WAAbortError").AbortError)();s(a);u(!1)})["catch"](function(a){if(a.name!==d("WAAbortError").ABORT_ERROR)s(a),u(!1);else throw a}).then(function(){return d("WAPromiseDelays").delayMs(e)}).then(function(){if(f.aborted)throw new(d("WAAbortError").AbortError)();d("WAWebToastManager").ToastManager.close(h)})["catch"](d("WAAbortError").catchAbort(c("WAWebNoop")));w.current={promise:a,controller:b}};k(function(){x(g)},[g]);if(!r)return null;var y;r.action!=null&&r.handler!=null&&(y=j.jsx(d("WAWebToast.react").ToastActionBtn,{buttonText:r.action,onClick:a}));var z;t||(z=j.jsx(d("WAWebToast.react").ToastDismissBtn,{onClick:i}));return j.jsx(d("WAWebToast.react").ToastBody,{toastPosition:b,actionText:r.text,actionButtons:y,dismissButton:z})}a.displayName=a.name+" [from "+f.id+"]";g.ToastPosition=o;g.ActionType=e;g.genId=p;g.ActionToast=a}),98); __d("WAWebAddToFavoritesAction",["fbt","WALogger","WATimeUtils","WAWebABProps","WAWebActionToast.react","WAWebConfirmPopup.react","WAWebDBFavoriteDatabaseApi","WAWebFavoriteCollection","WAWebFavoritesLogging","WAWebFavoritesSync","WAWebFbtCommon","WAWebInboxFiltersGatingUtils","WAWebL10NHelpers","WAWebListsGatingUtils","WAWebModalManager","WAWebSyncdCoreApi","WAWebToastManager","asyncToGeneratorRuntime","react"],(function(a,b,c,d,e,f,g,h){var i;function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[Favorites] addToFavoritesAction, mutation generated"]);j=function(){return a};return a}var k=i||c("react");function l(){return d("WAWebListsGatingUtils").isListsEnabled()?d("WAWebL10NHelpers").isUsingSupportedBritishEnglishLocale()?h._(/*BTDS*/"__JHASH___cJoTmDNKah__JHASH__"):h._(/*BTDS*/"__JHASH__8xwkuD5DsjN__JHASH__"):d("WAWebL10NHelpers").isUsingSupportedBritishEnglishLocale()?h._(/*BTDS*/"__JHASH__zptlCSz2-CD__JHASH__"):h._(/*BTDS*/"__JHASH___JOn6e6QyNj__JHASH__")}function m(){return d("WAWebListsGatingUtils").isListsEnabled()?d("WAWebL10NHelpers").isUsingSupportedBritishEnglishLocale()?h._(/*BTDS*/"__JHASH__AbAut4nj4wL__JHASH__"):h._(/*BTDS*/"__JHASH__Nsb9A3Xp2bd__JHASH__"):d("WAWebL10NHelpers").isUsingSupportedBritishEnglishLocale()?h._(/*BTDS*/"__JHASH__Nhi8kiJvyem__JHASH__"):h._(/*BTDS*/"__JHASH__KKweanAUjAO__JHASH__")}function a(a,b){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){var f;if(!d("WAWebInboxFiltersGatingUtils").inboxFavoritesEnabled())return;var g=(yield d("WAWebDBFavoriteDatabaseApi").getAllFavorites());f=(f=d("WAWebABProps").getABPropConfigValue("favorites_limit"))!=null?f:100;if(g.length+(Array.isArray(a)?a.length:1)>f){d("WAWebModalManager").ModalManager.open(k.jsx(d("WAWebConfirmPopup.react").ConfirmPopup,{onOK:function(){return d("WAWebModalManager").ModalManager.close()},okText:c("WAWebFbtCommon")("OK"),children:d("WAWebL10NHelpers").isUsingSupportedBritishEnglishLocale()?h._(/*BTDS*/"__JHASH__HnDSyWBaoKF__JHASH__",[h._param("favorites_limit",f)]):h._(/*BTDS*/"__JHASH__e_HjADbrcWY__JHASH__",[h._param("favorites_limit",f)])}));return}var i;if(Array.isArray(a)){var n=(yield d("WAWebDBFavoriteDatabaseApi").getNextFavoriteOrderIndex());i=a.map(function(a){return{id:a.toJid(),orderIndex:n++}})}else i=[babelHelpers["extends"]({},a)];e.entryPoint!=null&&d("WAWebFavoritesLogging").logAddingMessagingFavorites(i,e.entryPoint);f=g.concat(i);a=d("WATimeUtils").unixTime();g=(yield c("WAWebFavoritesSync").getFavoritesMutation(f,a));d("WALogger").LOG(j()).devConsole(g);f=d("WAWebSyncdCoreApi").lockForSync(["favorite","chat"],[g],b("asyncToGeneratorRuntime").asyncToGenerator(function*(){return d("WAWebDBFavoriteDatabaseApi").addOrEditFavorites(i)})).then(function(){return d("WAWebFavoriteCollection").FavoriteCollection.add(i)});if(e.suppressToast===!0)yield f;else{a=new(d("WAWebActionToast.react").ActionType)(l());g=f.then(function(){return new(d("WAWebActionToast.react").ActionType)(m())});d("WAWebToastManager").ToastManager.open(k.jsx(d("WAWebActionToast.react").ActionToast,{id:d("WAWebActionToast.react").genId(),initialAction:a,pendingAction:g}))}});return n.apply(this,arguments)}g.addToFavoritesAction=a}),226); __d("WAWebRemoveFromFavoritesAction",["fbt","WALogger","WATimeUtils","WAWebActionToast.react","WAWebAddToFavoritesAction","WAWebDBFavoriteDatabaseApi","WAWebFavoriteCollection","WAWebFavoritesLogging","WAWebFavoritesSync","WAWebInboxFiltersGatingUtils","WAWebL10NHelpers","WAWebListsGatingUtils","WAWebSyncdCoreApi","WAWebToastManager","asyncToGeneratorRuntime","react"],(function(a,b,c,d,e,f,g,h){var i;function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[Favorites] removeFromFavoritesAction, mutation generated"]);j=function(){return a};return a}var k=i||c("react");function l(){return d("WAWebListsGatingUtils").isListsEnabled()?d("WAWebL10NHelpers").isUsingSupportedBritishEnglishLocale()?h._(/*BTDS*/"__JHASH__AIKi3Pd1K_9__JHASH__"):h._(/*BTDS*/"__JHASH__IESoQE1mWQM__JHASH__"):d("WAWebL10NHelpers").isUsingSupportedBritishEnglishLocale()?h._(/*BTDS*/"__JHASH__6zhgAN2hyu1__JHASH__"):h._(/*BTDS*/"__JHASH__m5o3Oy3Si7s__JHASH__")}function m(){return d("WAWebListsGatingUtils").isListsEnabled()?d("WAWebL10NHelpers").isUsingSupportedBritishEnglishLocale()?h._(/*BTDS*/"__JHASH__jlaRaEtTzAS__JHASH__"):h._(/*BTDS*/"__JHASH__Ygfw8IoV-a4__JHASH__"):d("WAWebL10NHelpers").isUsingSupportedBritishEnglishLocale()?h._(/*BTDS*/"__JHASH__pifz_vaKCSp__JHASH__"):h._(/*BTDS*/"__JHASH__whnsedosYdI__JHASH__")}function a(a,b){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){if(!d("WAWebInboxFiltersGatingUtils").inboxFavoritesEnabled())return;var f=a.toJid();e.entryPoint!=null&&d("WAWebFavoritesLogging").logRemovingMessagingFavorites([f],e.entryPoint);a=(yield d("WAWebDBFavoriteDatabaseApi").getAllFavorites());var g=a.find(function(a){a=a.id;return a===f});a=a.filter(function(a){a=a.id;return a!==f});var i=d("WATimeUtils").unixTime();a=(yield c("WAWebFavoritesSync").getFavoritesMutation(a,i));d("WALogger").LOG(j()).devConsole(a);i=d("WAWebSyncdCoreApi").lockForSync(["favorite","chat"],[a],b("asyncToGeneratorRuntime").asyncToGenerator(function*(){return d("WAWebDBFavoriteDatabaseApi").removeFavorites([f])})).then(function(){return d("WAWebFavoriteCollection").FavoriteCollection.remove([f])});if(e.suppressToast===!0)yield i;else{a=new(d("WAWebActionToast.react").ActionType)(l());i=i.then(function(){return new(d("WAWebActionToast.react").ActionType)(m(),g?{actionText:h._(/*BTDS*/"__JHASH__mpD8GydGn1Q__JHASH__"),actionHandler:function(){return d("WAWebAddToFavoritesAction").addToFavoritesAction(g,{entryPoint:e.entryPoint})}}:void 0)});d("WAWebToastManager").ToastManager.open(k.jsx(d("WAWebActionToast.react").ActionToast,{id:d("WAWebActionToast.react").genId(),initialAction:a,pendingAction:i}))}});return n.apply(this,arguments)}g.removeFromFavoritesAction=a}),226); __d("WAWebFavoriteCollection",["WAWebBaseCollection","WAWebContactCollection","WAWebFavoriteModel","WAWebWidFactory"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b;b=a.call(this)||this;b.listenTo(babelHelpers.assertThisInitialized(b),"add",function(a){a=d("WAWebContactCollection").ContactCollection.get(d("WAWebWidFactory").createWid(a.id));a&&a.set("isFavorite",!0)});b.listenTo(babelHelpers.assertThisInitialized(b),"remove",function(a){a=d("WAWebContactCollection").ContactCollection.get(d("WAWebWidFactory").createWid(a.id));a&&a.set("isFavorite",!1)});return b}return b}(d("WAWebBaseCollection").BaseCollection);a.model=d("WAWebFavoriteModel").Favorite;b=new a();g.FavoriteCollection=b}),98); __d("WAWebFavoriteModel",["WAWebBaseModel","WAWebFavoriteCollection"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.orderIndex=d("WAWebBaseModel").prop(),b)||babelHelpers.assertThisInitialized(c)}var c=b.prototype;c.getCollection=function(){return d("WAWebFavoriteCollection").FavoriteCollection};return b}(d("WAWebBaseModel").BaseModel);a.Proxy="favorite";b=d("WAWebBaseModel").defineModel(a);g.Favorite=b}),98); __d("WAWebWamEnumFavoritesUpdateEntryPoint",[],(function(a,b,c,d,e,f){a=Object.freeze({CONTACT_INFO:1,GROUP_INFO:2,CHAT_MORE_OPTIONS:3,CHAT_LONG_PRESS_OPTIONS:4,MESSAGE_FAVORITES_CONTACT_PICKER:5,FAVORITE_SETTINGS:6,FILTER_CONTEXT_MENU:7,FILTER_EMPTY_STATE_ACTION:8,FILTER_MANAGE_FAVORITE_ACTION:9,CALLING_TAB_FAVORITE_PICKER:10,CALLING_TAB_FAVORITE_EDIT:11,CHAT_CONTEXT_MENU:12,CHAT_HEADER_CONTEXT_MENU:13});f.FAVORITES_UPDATE_ENTRY_POINT=a}),66); __d("WAWebMessagingFavoritesUpdateWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumFavoritesUpdateEntryPoint"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({MessagingFavoritesUpdate:[5460,{contactFavCountAfterUpdate:[1,a.TYPES.INTEGER],contactFavCountBeforeUpdate:[2,a.TYPES.INTEGER],favoritesUpdateEntryPoint:[3,d("WAWebWamEnumFavoritesUpdateEntryPoint").FAVORITES_UPDATE_ENTRY_POINT],groupFavCountAfterUpdate:[4,a.TYPES.INTEGER],groupFavCountBeforeUpdate:[5,a.TYPES.INTEGER]},[1,1,1],"regular"]},{MessagingFavoritesUpdate:[]});g.MessagingFavoritesUpdateWamEvent=b}),98); __d("WAWebFavoritesLogging",["WALogger","WAWebFavoriteCollection","WAWebMessagingFavoritesUpdateWamEvent","WAWebWid"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[Favorites] logRemovingMessagingFavorites, error: ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[Favorites] logAddingMessagingFavorites, error: ",""]);i=function(){return a};return a}function a(a,b){try{var e=0,f=0,g=0,h=0;d("WAWebFavoriteCollection").FavoriteCollection.forEach(function(a){c("WAWebWid").isGroup(a.id)?g++:e++});f=e;h=g;a.forEach(function(a){c("WAWebWid").isGroup(a.id)?h++:f++});new(d("WAWebMessagingFavoritesUpdateWamEvent").MessagingFavoritesUpdateWamEvent)({favoritesUpdateEntryPoint:b,contactFavCountBeforeUpdate:e,contactFavCountAfterUpdate:f,groupFavCountBeforeUpdate:g,groupFavCountAfterUpdate:h}).commit()}catch(a){d("WALogger").LOG(i(),a).sendLogs("logAddingMessagingFavorites")}}function b(a,b){try{var e=0,f=0,g=0,i=0;d("WAWebFavoriteCollection").FavoriteCollection.forEach(function(a){c("WAWebWid").isGroup(a.id)?g++:e++});f=e;i=g;a.forEach(function(a){c("WAWebWid").isGroup(a)?i--:f--});f=Math.max(f,0);i=Math.max(i,0);new(d("WAWebMessagingFavoritesUpdateWamEvent").MessagingFavoritesUpdateWamEvent)({favoritesUpdateEntryPoint:b,contactFavCountBeforeUpdate:e,contactFavCountAfterUpdate:f,groupFavCountBeforeUpdate:g,groupFavCountAfterUpdate:i}).commit()}catch(a){d("WALogger").LOG(h(),a).sendLogs("logRemovingMessagingFavorites")}}g.logAddingMessagingFavorites=a;g.logRemovingMessagingFavorites=b}),98); __d("WAWebPsGroupOpenedWamEvent",["WAWebWamCodegenUtils"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({PsGroupOpened:[6236,{integrityGroupUserHashedId:[4,a.TYPES.STRING],isGroupSafetyCheckAbpropEnabled:[2,a.TYPES.BOOLEAN],isPartOfGroupSafetyCheckExperiment:[3,a.TYPES.BOOLEAN],openedGroupJid:[1,a.TYPES.STRING]},[1,1,1],"private",216763284]},{PsGroupOpened:[]});g.PsGroupOpenedWamEvent=b}),98); __d("WAWebPsGroupSafetyCheckEnabledWamEvent",["WAWebWamCodegenUtils"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({PsGroupSafetyCheckEnabled:[6238,{didJoinByGil:[3,a.TYPES.BOOLEAN],integrityGroupUserHashedId:[4,a.TYPES.STRING],psSafetyCheckGroupJid:[1,a.TYPES.STRING],psWasSafetyCheckGroupInitiallyMuted:[2,a.TYPES.BOOLEAN],wasAddedByContact:[5,a.TYPES.BOOLEAN],willSafetyCheckBeSeen:[6,a.TYPES.BOOLEAN]},[1,1,1],"private",216763284]},{PsGroupSafetyCheckEnabled:[]});g.PsGroupSafetyCheckEnabledWamEvent=b}),98); __d("WAWebWamEnumPsGroupSafetyCheckExitDialogActions",[],(function(a,b,c,d,e,f){a=Object.freeze({GROUP_EXIT_DIALOG_DISMISS:0,GROUP_EXIT_DIALOG_EXIT:1,GROUP_EXIT_DIALOG_EXIT_AND_REPORT:2,COMMUNITY_EXIT_DIALOG_DISMISS:3,COMMUNITY_EXIT_DIALOG_EXIT:4,COMMUNITY_EXIT_DIALOG_EXIT_AND_DELETE:5});f.PS_GROUP_SAFETY_CHECK_EXIT_DIALOG_ACTIONS=a}),66); __d("WAWebPsGroupSafetyCheckExitDialogWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumPsGroupSafetyCheckExitDialogActions"],(function(a,b,c,d,e,f,g){a=d("WAWebWamCodegenUtils").defineEvents({PsGroupSafetyCheckExitDialog:[6252,{integrityGroupUserHashedId:[3,d("WAWebWamCodegenUtils").TYPES.STRING],psGroupSafetyCheckExitDialogAction:[1,d("WAWebWamEnumPsGroupSafetyCheckExitDialogActions").PS_GROUP_SAFETY_CHECK_EXIT_DIALOG_ACTIONS],psSafetyCheckGroupJid:[2,d("WAWebWamCodegenUtils").TYPES.STRING]},[1,1,1],"private",216763284]},{PsGroupSafetyCheckExitDialog:[]});g.PsGroupSafetyCheckExitDialogWamEvent=a}),98); __d("WAWebPsGroupSafetyCheckSheetSeenWamEvent",["WAWebWamCodegenUtils"],(function(a,b,c,d,e,f,g){a=d("WAWebWamCodegenUtils").defineEvents({PsGroupSafetyCheckSheetSeen:[6240,{integrityGroupUserHashedId:[2,d("WAWebWamCodegenUtils").TYPES.STRING],psSafetyCheckGroupJid:[1,d("WAWebWamCodegenUtils").TYPES.STRING]},[1,1,1],"private",216763284]},{PsGroupSafetyCheckSheetSeen:[]});g.PsGroupSafetyCheckSheetSeenWamEvent=a}),98); __d("WAWebWamEnumPsGroupSafetyCheckUiInteractions",[],(function(a,b,c,d,e,f){a=Object.freeze({SEE_CHAT:0,EXIT_GROUP:1,EXIT_COMMUNITY:2,SEE_SCAM_EXAMPLES:3,PRIVACY_SETTINGS:4,HOW_TO_REPORT:5,DOUBLE_CHECK_LINKS:6,DISMISS:7,DRAG_DISMISS:8,X_BUTTON:9,BACK_BUTTON:10});f.PS_GROUP_SAFETY_CHECK_UI_INTERACTIONS=a}),66); __d("WAWebPsGroupSafetyCheckUiInteractionsWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumPsGroupSafetyCheckUiInteractions"],(function(a,b,c,d,e,f,g){a=d("WAWebWamCodegenUtils").defineEvents({PsGroupSafetyCheckUiInteractions:[6242,{integrityGroupUserHashedId:[3,d("WAWebWamCodegenUtils").TYPES.STRING],psSafetyCheckGroupJid:[1,d("WAWebWamCodegenUtils").TYPES.STRING],psSafetyCheckInteraction:[2,d("WAWebWamEnumPsGroupSafetyCheckUiInteractions").PS_GROUP_SAFETY_CHECK_UI_INTERACTIONS]},[1,1,1],"private",216763284]},{PsGroupSafetyCheckUiInteractions:[]});g.PsGroupSafetyCheckUiInteractionsWamEvent=a}),98); __d("WAWebGroupSafetyCheckModalLoggingUtils",["WAWebGroupSafetyCheckGatingUtils","WAWebPsGroupOpenedWamEvent","WAWebPsGroupSafetyCheckEnabledWamEvent","WAWebPsGroupSafetyCheckExitDialogWamEvent","WAWebPsGroupSafetyCheckSheetSeenWamEvent","WAWebPsGroupSafetyCheckUiInteractionsWamEvent"],(function(a,b,c,d,e,f,g){"use strict";function a(a){a=a.groupJid;d("WAWebGroupSafetyCheckGatingUtils").groupSafetyCheckLoggingEnabled()&&new(d("WAWebPsGroupOpenedWamEvent").PsGroupOpenedWamEvent)({isGroupSafetyCheckAbpropEnabled:d("WAWebGroupSafetyCheckGatingUtils").groupSafetyCheckM2Enabled(),isPartOfGroupSafetyCheckExperiment:d("WAWebGroupSafetyCheckGatingUtils").groupSafetyCheckIsPartOfExperiment(),openedGroupJid:a}).commit()}function b(a){var b=a.groupJid;a=a.initiallyMuted;d("WAWebGroupSafetyCheckGatingUtils").groupSafetyCheckM2Enabled()&&new(d("WAWebPsGroupSafetyCheckEnabledWamEvent").PsGroupSafetyCheckEnabledWamEvent)({psSafetyCheckGroupJid:b,psWasSafetyCheckGroupInitiallyMuted:a}).commit()}function c(a){a=a.groupJid;new(d("WAWebPsGroupSafetyCheckSheetSeenWamEvent").PsGroupSafetyCheckSheetSeenWamEvent)({psSafetyCheckGroupJid:a}).commit()}function e(a){var b=a.groupJid;a=a.interaction;new(d("WAWebPsGroupSafetyCheckUiInteractionsWamEvent").PsGroupSafetyCheckUiInteractionsWamEvent)({psSafetyCheckGroupJid:b,psSafetyCheckInteraction:a}).commit()}function f(a){var b=a.groupJid;a=a.interaction;new(d("WAWebPsGroupSafetyCheckExitDialogWamEvent").PsGroupSafetyCheckExitDialogWamEvent)({psSafetyCheckGroupJid:b,psGroupSafetyCheckExitDialogAction:a}).commit()}g.logGroupOpenEvent=a;g.logGroupSafetyCheckEnabledEvent=b;g.logGroupSafetyCheckModalSeenEvent=c;g.logGroupSafetyCheckUIInteractionsEvent=e;g.logGroupSafetyCheckExitDialogUIInteractionsEvent=f}),98); __d("WAWebGroupSafetyCheckUtils",["WAWebChatGetters","WAWebCmd","WAWebFrontendMsgGetters","WAWebGroupSafetyCheckGatingUtils","WAWebGroupSafetyCheckModalLoadable","WAWebGroupSafetyCheckModalLoggingUtils","WAWebModalManager","WAWebMuteGetters","WAWebNotificationHelpers","WAWebStateUtils","react"],(function(a,b,c,d,e,f,g){"use strict";var h,i=h||c("react");function j(a){if(!a)return!1;a=d("WAWebStateUtils").unproxy(a);return d("WAWebChatGetters").getIsGroup(a)&&!!((a=a.groupMetadata)==null?void 0:a.groupSafetyCheck)}function a(a,b,c){var e=c===!0&&!b;c=c===!1&&!b;e&&d("WAWebGroupSafetyCheckModalLoggingUtils").logGroupSafetyCheckEnabledEvent({groupJid:a.id.toJid(),initiallyMuted:d("WAWebMuteGetters").getIsMuted(a.mute)});k(a,e,c)}function b(a,b){a=d("WAWebStateUtils").unproxy(a);var c=a.groupMetadata;if(c){c=c.groupSafetyCheck;if(c===!0){c=!b;k(a,c,!c)}}}function e(a){d("WAWebModalManager").ModalManager.open(i.jsx(d("WAWebGroupSafetyCheckModalLoadable").GroupSafetyCheckModalLoadable,{chat:a}),{transition:"modal-flow"})}function f(a){var b=d("WAWebFrontendMsgGetters").getChat(a);return d("WAWebNotificationHelpers").isMeUserMentionedOrQuoted(a)&&l(b)}function k(a,b,c){if(!d("WAWebGroupSafetyCheckGatingUtils").groupSafetyCheckM2Enabled())return;b?d("WAWebCmd").Cmd.muteChat(a,b,!1,!1):c&&d("WAWebCmd").Cmd.muteChat(a,!1,!1,!1)}function l(a){return j(a)&&!a.isTrusted()&&d("WAWebGroupSafetyCheckGatingUtils").groupSafetyCheckM2Enabled()}g.isGroupSafetyChecked=j;g.handleGroupSafetyCheckStateUpdate=a;g.handleIsTrustedChangeForGroupSafety=b;g.openGroupSafetyCheckModal=e;g.shouldMuteMentionWhileGroupSafetyChecked=f;g.shouldShowGroupSafetyCheckUI=l}),98); __d("WAWebDisableLinkPreviewsSync",["Promise","WALogger","WAServerSync.pb","WASyncdAction","WASyncdConst","WATimeUtils","WAWebDisableLinkPreviewsAction","WAWebSyncdActionUtils","WAWebSyncdCoreApi","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["DisableLinkPreviewsSync: updating prefs: isPreviewsDisabled: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["DisableLinkPreviewsSync: mutation value is null"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["DisableLinkPreviewsSync: operation not supported: ",""]);k=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(c,a);function c(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=null,b)||babelHelpers.assertThisInitialized(c)}var e=c.prototype;e.getVersion=function(){return 8};e.getAction=function(){return d("WASyncdConst").Actions.DisableLinkPreviews};e.applyMutations=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b;a=a.map(function(a){if(a.operation!=="set"){d("WALogger").WARN(k(),a.operation);return{actionState:d("WASyncdConst").SyncActionState.Malformed}}a=(a=a.value.privacySettingDisableLinkPreviewsAction)==null?void 0:a.isPreviewsDisabled;if(a==null){d("WALogger").WARN(j());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}b=a;return{actionState:d("WASyncdConst").SyncActionState.Success}});b!=null&&(d("WALogger").LOG(i(),b),d("WAWebDisableLinkPreviewsAction").setDisableLinkPreviewsToUserPrefs(b));return a});function c(b){return a.apply(this,arguments)}return c}();e.getMutation=function(a,b){return d("WAWebSyncdActionUtils").buildPendingMutation({collection:d("WASyncdConst").CollectionName.Regular,indexArgs:[],value:{privacySettingDisableLinkPreviewsAction:{isPreviewsDisabled:b}},version:this.getVersion(),operation:d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET,timestamp:a,action:this.getAction()})};e.sendMutation=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield d("WAWebSyncdCoreApi").lockForSync([],[this.getMutation(d("WATimeUtils").unixTimeMs(),a)],function(){return(h||(h=b("Promise"))).resolve()})});function c(b){return a.apply(this,arguments)}return c}();return c}(d("WASyncdAction").SyncActionBase);c=new a();g["default"]=c}),98); __d("WAWebDisableLinkPreviewsAction",["WAWebDisableLinkPreviewsSync","WAWebUserPrefsGeneral"],(function(a,b,c,d,e,f,g){"use strict";function h(a){d("WAWebUserPrefsGeneral").setUserPrivacySettings(babelHelpers["extends"]({},d("WAWebUserPrefsGeneral").getUserPrivacySettings(),{disableLinkPreviews:a}))}function a(a){h(a);return c("WAWebDisableLinkPreviewsSync").sendMutation(a)}g.setDisableLinkPreviewsToUserPrefs=h;g.setDisableLinkPreviews=a}),98); __d("WAWebLabelConstants",[],(function(a,b,c,d,e,f){a=["#FF9485","#64C4FF","#FFD429","#DFAEF0","#99B6C1","#55CCB3","#FF9DFF","#D3A91D","#6D7CCE","#D7E752","#00D0E2","#FFC5C7","#93CEAC","#F74848","#00A0F2","#83E422","#FFAF04","#B5EBFF","#9BA6FF","#9368CF"];b=["#A62C71","#90A841","#C1A03F","#792138","#AE8774","#F0B330","#B6B327","#C69FCC","#8B6990","#FF8A8C","#54C265","#FF7B6B","#26C4DC","#57C9FF","#74676A","#7E90A3","#5696FF","#6E257E","#7ACBA5","#243640"];var g=Object.freeze({NEW_CUSTOMER:1,NEW_ORDER:2,PENDING_PAYMENT:3,PAID:4,ORDER_COMPLETE:5,IMPORTANT:6,FOLLOW_UP:7,LEAD:8}),h=Object.freeze({NEW_CUSTOMER:"New customer",NEW_ORDER:"New order",PENDING_PAYMENT:"Pending payment",PAID:"Paid",ORDER_COMPLETE:"Order complete",IMPORTANT:"Important",FOLLOW_UP:"Follow up",LEAD:"Lead"});c=function(a){switch(a){case h.NEW_CUSTOMER:return g.NEW_CUSTOMER;case h.NEW_ORDER:return g.NEW_ORDER;case h.PENDING_PAYMENT:return g.PENDING_PAYMENT;case h.PAID:return g.PAID;case h.ORDER_COMPLETE:return g.ORDER_COMPLETE;case h.IMPORTANT:return g.IMPORTANT;case h.FOLLOW_UP:return g.FOLLOW_UP;case h.LEAD:return g.LEAD;default:return void 0}};d=100;e=72;f.ANDROID_LABEL_COLOR_PALETTE=a;f.IPHONE_LABEL_COLOR_PALETTE=b;f.PREDEFINED_LABEL_NAMES=h;f.mapLabelNameToPredefinedId=c;f.LABEL_NAME_MAX_LENGTH=d;f.LISTS_ROW_HEIGHT=e}),66); __d("WAWebLabelUtils",["fbt","WAWebBizGatingUtils","WAWebConnModel","WAWebLabelCollection","WAWebLabelConstants","WAWebMobilePlatforms","WAWebSchemaLabel"],(function(a,b,c,d,e,f,g,h){var i=20,j=22;function k(){return d("WAWebConnModel").Conn.platform===d("WAWebMobilePlatforms").PLATFORMS.SMBI?d("WAWebLabelConstants").IPHONE_LABEL_COLOR_PALETTE:d("WAWebLabelConstants").ANDROID_LABEL_COLOR_PALETTE}function a(a){return k()[a]}var l=function(a,b){a=parseInt(a.id,10);b=parseInt(b.id,10);return Number.isNaN(a)||Number.isNaN(b)?0:a-b},m=function(a){a.sort(l)};f=function(a){if(!d("WAWebBizGatingUtils").isLabelReorderingSyncFromPrimaryEnabled()){m(a);return}a.sort(function(a,b){var c=a.orderIndex-b.orderIndex;return c===0?l(a,b):c})};var n=new Set([d("WAWebSchemaLabel").ListType.UNREAD,d("WAWebSchemaLabel").ListType.GROUPS,d("WAWebSchemaLabel").ListType.FAVORITES]);function b(a){return a==null?!1:n.has(a)}function o(){return d("WAWebBizGatingUtils").isCTWADetectedOutcomeWS1Enabled()&&d("WAWebLabelCollection").LabelCollection.getServerAssignedLabelIds().size>0?j:i}function c(a){if(d("WAWebBizGatingUtils").isCTWADetectedOutcomeWS1Enabled()){var b=o();return a?h._(/*BTDS*/"__JHASH__cOzPd_PUeGk__JHASH__",[h._param("max_count",b)]):h._(/*BTDS*/"__JHASH__y-uNdoWEwzM__JHASH__",[h._param("max_count",b)])}return a?h._(/*BTDS*/"__JHASH__AWYdl5yr7ha__JHASH__"):h._(/*BTDS*/"__JHASH__cwDKKAjq1PN__JHASH__")}function e(a){var b=h._(/*BTDS*/"__JHASH__X1RYrkTHfMP__JHASH__");if(d("WAWebBizGatingUtils").isCTWADetectedOutcomeWS1Enabled()){var c=o();return a?b:h._(/*BTDS*/"__JHASH__y-uNdoWEwzM__JHASH__",[h._param("max_count",c)])}return a?b:h._(/*BTDS*/"__JHASH__cwDKKAjq1PN__JHASH__")}g.getAllLabelColors=k;g.colorIndexToHex=a;g.sortLabels=f;g.isBuiltInList=b;g.getMaxLabelCount=o;g.getReachMaxLabelCountTextForBizLabelDrawer=c;g.getReachMaxLabelCountText=e}),226); __d("WAWebLabelGetters",["WAWebGetters","WAWebGettersCaches","WAWebLabelUtils"],(function(a,b,c,d,e,f,g){a=d("WAWebGetters").createGetterFactories({createCache:d("WAWebGettersCaches").createLabelsCache});b=a.field;c=a.computed;e=b("colorIndex");f=b("color");a=c(function(a){a[0];a=a[1];if(a==null)return;return d("WAWebLabelUtils").colorIndexToHex(a)},[f,e]);g.getHexColor=a}),98); __d("WAWebLabelFilledIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k="label-filled";function a(a){var b=a.iconXstyle,e=a.height,f=a.width,g=a.viewBox;a=babelHelpers.objectWithoutPropertiesLoose(a,["iconXstyle","height","width","viewBox"]);var h;if(g){var l=g.x;l=l===void 0?0:l;var m=g.y;m=m===void 0?0:m;var n=g.width;n=n===void 0?0:n;g=g.height;g=g===void 0?0:g;h=[l,m,n,g].join(" ")}l=24;m=24;(e!=null||f!=null)&&(l=e,m=f);return j.jsx(d("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers["extends"]({name:k},a,{children:j.jsxs("svg",{viewBox:(n=h)!=null?n:"0 0 24 24",height:l,width:m,preserveAspectRatio:"xMidYMid meet",className:(i||(i=c("stylex")))(b),fill:"none",children:[j.jsx("title",{children:k}),j.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M15.393 5C16.314 5 17.167 5.447 17.685 6.182L21.812 12L21.346 12.657L17.686 17.816C17.166 18.553 16.314 19 15.393 19L5.81 18.992C4.262 18.992 3 17.738 3 16.19V7.81C3 6.261 4.262 5.008 5.809 5.008L15.393 5Z"})]})}))}a.displayName=a.name+" [from "+f.id+"]";g.LabelFilledIcon=a}),98); __d("useWAWebForceUpdate",["react"],(function(a,b,c,d,e,f,g){"use strict";var h,i=(h||d("react")).useReducer;function a(){var a=i(function(a){return a+1},0);a[0];a=a[1];return a}g.useForceUpdateDONOTUSE=a}),98); __d("WAWebLabels.react",["WAWebBizGatingUtils","WAWebEmojiText.react","WAWebLabelCollection","WAWebLabelFilledIcon.react","WAWebLabelGetters","WAWebListsGatingUtils","WAWebUISpacing","react","stylex","useWAWebForceUpdate","useWAWebListener"],(function(a,b,c,d,e,f,g){var h,i,j,k=j||c("react"),l=(h||(h=d("react"))).useMemo,m={container:{display:"x1rg5ohu",flexShrink:"x2lah0s",verticalAlign:"x16dsc37",$$css:!0},name:{flexShrink:"x2lah0s",fontSize:"x1f6kntn",lineHeight:"xggjnk3",color:"xzwifym",$$css:!0},labelFilter:{maxWidth:"x193iq5w",overflowX:"x6ikm8r",overflowY:"x10wlt62",$$css:!0},labelFilterIconContainer:{display:"x78zum5",flexShrink:"x2lah0s",alignItems:"x6s0dn4",justifyContent:"xl56j7k",width:"xvy4d1p",height:"xxk0z11",$$css:!0},labelFilterPillIconContainer:{width:"xw4jnvo",height:"x1qx5ct2",$$css:!0},labelFilterName:{flexGrow:"x1iyjqo2",flexShrink:"xs83m0k",flexBasis:"xdl72j9",overflowX:"x6ikm8r",overflowY:"x10wlt62",lineHeight:"x1o2sk6j",textOverflow:"xlyipyv",whiteSpace:"xuxw1ft",$$css:!0},labelFilterPillName:{color:"xdxn8r",lineHeight:"x1fc57z9",maxWidth:"x18tx2qf",$$css:!0},drawerTitle:{maxWidth:"x193iq5w",$$css:!0},drawerTitleIconContainer:{flexShrink:"x2lah0s",$$css:!0},drawerTitleName:{flexGrow:"x1iyjqo2",flexShrink:"xs83m0k",flexBasis:"xdl72j9",overflowX:"x6ikm8r",overflowY:"x10wlt62",fontSize:"x1jchvi3",textOverflow:"xlyipyv",whiteSpace:"xuxw1ft",$$css:!0},containerFull:{display:"x3nfvp2",alignItems:"x6s0dn4",$$css:!0},containerFullCircleIcon:{display:"x1rg5ohu",flexShrink:"x2lah0s",marginTop:"x1y332i5",color:"xfect85",$$css:!0},circleIconContainer:{display:"x78zum5",alignItems:"x6s0dn4",justifyContent:"xl56j7k",width:"x100vrsf",height:"x1vqgdyp",borderTopStartRadius:"x14yjl9h",borderTopEndRadius:"xudhj91",borderBottomEndRadius:"x18nykt9",borderBottomStartRadius:"xww2gxu",$$css:!0},circleIcon:{color:"x7o08j2",$$css:!0},circleIconSVG:{width:"xw4jnvo",height:"x1qx5ct2",$$css:!0},elipsifyName:{overflowX:"x6ikm8r",overflowY:"x10wlt62",whiteSpace:"xuxw1ft",textOverflow:"xlyipyv",maxWidth:"xw5ewwj",$$css:!0}};function n(a){if(a.length===0)return;var b=Math.max.apply(Math,a.map(function(a){return parseInt(a,10)}));return Number.isNaN(b)?a[0]:b.toString()}function o(a){a=n(a);return a==null?null:d("WAWebLabelCollection").LabelCollection.get(a)}function p(a){var b=a.color,e=a.name,f=a.renderAsCircle;f=f===void 0?!1:f;var g=a.theme,h=a.iconXstyle;a=e!=null?k.jsx("span",babelHelpers["extends"]({},(i||(i=c("stylex"))).props(m.name,d("WAWebUISpacing").uiMargin.start3,(a.theme==="label-filter"||a.theme==="label-pill")&&m.labelFilterName,a.theme==="label-pill"&&m.labelFilterPillName,(a.theme==="label-filter"||a.theme==="label-pill")&&d("WAWebUISpacing").uiMargin.start8,a.theme==="drawer-title"&&m.drawerTitleName,a.theme==="drawer-title"&&d("WAWebUISpacing").uiMargin.start0,a.theme==="user-profile"&&m.elipsifyName),{children:k.jsx(d("WAWebEmojiText.react").EmojiText,{text:e})})):null;var j=(i||(i=c("stylex")))(e==null&&!f&&m.container,f&&m.containerFull,e!=null&&!f&&m.containerFull,g==="label-filter"&&m.labelFilter,g==="drawer-title"&&m.drawerTitle),l=f&&b!=null?{backgroundColor:b}:{};b=f?k.jsx(d("WAWebLabelFilledIcon.react").LabelFilledIcon,{xstyle:m.circleIcon,iconXstyle:m.circleIconSVG}):k.jsx(q,{hexColor:b,xstyle:[e!=null&&m.containerFullCircleIcon,h]});return k.jsxs("div",{className:j,children:[k.jsx("div",{"data-testid":void 0,className:i(f&&m.circleIconContainer,g==="drawer-title"&&m.drawerTitleIconContainer,g==="drawer-title"&&d("WAWebUISpacing").uiMargin.end20,g==="drawer-title"&&d("WAWebUISpacing").uiMargin.start4,(g==="label-filter"||g==="label-pill")&&m.labelFilterIconContainer,g==="label-pill"&&m.labelFilterPillIconContainer),style:l,children:b}),a]})}p.displayName=p.name+" [from "+f.id+"]";function a(a){var b=a.labels,c=a.showName;c=c===void 0?!1:c;var e=a.renderAsCircle;e=e===void 0?!1:e;var f=a.theme;a=a.iconXstyle;var g=d("useWAWebForceUpdate").useForceUpdateDONOTUSE(),h=l(function(){return n(b)},[b]);d("useWAWebListener").useListener(h!=null?d("WAWebLabelCollection").LabelCollection:null,"label_updated_"+((h=h)!=null?h:""),g);if(!d("WAWebBizGatingUtils").canDisplayLabel()&&!d("WAWebListsGatingUtils").isListsEnabled())return null;h=o(b);if(!h||!h.name)return null;if(b.length===1){g=d("WAWebLabelGetters").getHexColor(h);c=c?h.name:null;return k.jsx(p,{color:g,name:c,renderAsCircle:e,theme:f,iconXstyle:a})}return k.jsx("div",babelHelpers["extends"]({className:"x1rg5ohu x2lah0s x16dsc37"},{"data-testid":void 0,children:k.jsxs("svg",{width:"18px",height:"15px",viewBox:"0 0 18 15",children:[k.jsx("path",{fill:d("WAWebLabelGetters").getHexColor(h),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"}),k.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"})]})}))}a.displayName=a.name+" [from "+f.id+"]";function q(a){var b=a.hexColor;b=b===void 0?"#ffffff":b;a=a.xstyle;return k.jsx("svg",babelHelpers["extends"]({width:"18px",height:"12px",viewBox:"0 0 18 12"},(i||(i=c("stylex"))).props(a),{children:k.jsx("path",{fill:b,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"})}))}q.displayName=q.name+" [from "+f.id+"]";g.getVisibleLabelId=n;g.Label=p;g.Labels=a;g.LabelSvg=q}),98); __d("WAWebBizLabelUtils",["WALogger","WAWebBizGatingUtils","WAWebBizLabelItemParentType","WAWebChatCollection","WAWebChatModel","WAWebContactCollection","WAWebContactModel","WAWebLabelCollection","WAWebMsgCollection","WAWebMsgModel","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["labelItemCollection does not exist for lableId ",""]);h=function(){return a};return a}function a(a){var b=i(a);a.labels=d("WAWebLabelCollection").LabelCollection.getLabelsForModel(a.id.toString(),b)}function b(a,b,c){b&&b.length>0&&b.forEach(function(b){if(d("WAWebBizGatingUtils").isCTWADetectedOutcomeWS1Enabled()&&d("WAWebLabelCollection").LabelCollection.getServerAssignedLabelIds().has(b))return;var e=d("WAWebLabelCollection").LabelCollection.gadd({id:b});e.labelItemCollection.gadd({id:j(a,b,c),labelId:b,parentId:a,parentType:c});c===d("WAWebBizLabelItemParentType").LabelItemParentType.Chat&&e.labelItemCollection.gadd({id:j(a,b,d("WAWebBizLabelItemParentType").LabelItemParentType.Contact),labelId:b,parentId:a,parentType:d("WAWebBizLabelItemParentType").LabelItemParentType.Contact})})}function e(a,b,c){var e=d("WAWebLabelCollection").LabelCollection.get(b);e=e==null?void 0:e.labelItemCollection;if(!e){d("WALogger").WARN(h(),b);return}e.remove(j(a,b,c));c===d("WAWebBizLabelItemParentType").LabelItemParentType.Chat&&e.remove(j(a,b,d("WAWebBizLabelItemParentType").LabelItemParentType.Contact))}function f(a){switch(a){case d("WAWebBizLabelItemParentType").LabelItemParentType.Chat:return d("WAWebChatCollection").ChatCollection;case d("WAWebBizLabelItemParentType").LabelItemParentType.Contact:return d("WAWebContactCollection").ContactCollection;case d("WAWebBizLabelItemParentType").LabelItemParentType.Msg:return d("WAWebMsgCollection").MsgCollection}}function i(a){if(a instanceof d("WAWebChatModel").Chat)return d("WAWebBizLabelItemParentType").LabelItemParentType.Chat;else if(a instanceof c("WAWebContactModel"))return d("WAWebBizLabelItemParentType").LabelItemParentType.Contact;else if(a instanceof d("WAWebMsgModel").Msg)return d("WAWebBizLabelItemParentType").LabelItemParentType.Msg;throw c("err")("getParentTypeFromModel: model is invalid")}function j(a,b,c){return a+"_"+b+"_"+c}g.initializeLabels=a;g.addToLabelCollection=b;g.removeLabelFromCollection=e;g.getParentCollection=f;g.getParentTypeFromModel=i;g.createLabelItemId=j}),98); __d("WAWebLabelCollection",["fbt","$InternalEnum","WALogger","WAWebActionToast.react","WAWebAddToFavoritesAction","WAWebBaseCollection","WAWebBizGatingUtils","WAWebBizLabelItemParentType","WAWebBizLabelUtils","WAWebChatCollection","WAWebEditLabelAssociationBridge","WAWebLabelModel","WAWebLabelUtils","WAWebListsGatingUtils","WAWebMsgModel","WAWebNoop","WAWebRemoveFromFavoritesAction","WAWebSchemaLabel","WAWebSchemaLabelAssociation","WAWebToastManager","WAWebWid","lodash","react"],(function(a,b,c,d,e,f,g,h){var i;function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["addingNewLabel dropped"]);j=function(){return a};return a}var k=i||c("react"),l=b("$InternalEnum").Mirrored(["IN_PROGRESS","SUCCESS","ERROR"]);function m(a,b){if(b)switch(a){case l.IN_PROGRESS:return h._(/*BTDS*/"__JHASH__03MHoavr4a3__JHASH__");case l.SUCCESS:return h._(/*BTDS*/"__JHASH__ixFuXwKmozJ__JHASH__");case l.ERROR:return h._(/*BTDS*/"__JHASH__pzpymZzeBbn__JHASH__")}else switch(a){case l.IN_PROGRESS:return h._(/*BTDS*/"__JHASH__EPG-ZmL0OjD__JHASH__");case l.SUCCESS:return h._(/*BTDS*/"__JHASH__06XuFGrPAhY__JHASH__");case l.ERROR:return h._(/*BTDS*/"__JHASH__M8zYvsNF4oq__JHASH__")}}a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b;b=a.call(this)||this;b.$LabelCollectionImpl$p_1=new Set();b.listenTo(babelHelpers.assertThisInitialized(b),"remove",n);return b}var e=b.prototype;e.initializeFromCache=function(b){var c=this;if(d("WAWebBizGatingUtils").isCTWADetectedOutcomeWS1Enabled()){var e=b.filter(function(a){var b=a.type===d("WAWebSchemaLabel").ListType.SERVER_ASSIGNED;b&&c.$LabelCollectionImpl$p_1.add(a.id);return!b});e=e.map(function(a){var b=a.id;a=babelHelpers.objectWithoutPropertiesLoose(a,["id"]);return babelHelpers["extends"]({id:b},a)});this.add(e)}else a.prototype.initializeFromCache.call(this,b)};e.initializeAssociationsFromCache=function(a){a.forEach(function(a){var b=a.labelId,c=a.associationId;a=a.type;d("WAWebBizLabelUtils").addToLabelCollection(c,[b],a===d("WAWebSchemaLabelAssociation").LabelAssociationType.Jid?d("WAWebBizLabelItemParentType").LabelItemParentType.Chat:d("WAWebBizLabelItemParentType").LabelItemParentType.Msg)})};e.removeAllLabelsMD=function(a){return this.addOrRemoveLabelsMD((a.labels||[]).map(function(a){return{type:"remove",id:a}}),[a])};e.addOrRemoveLabelsMD=function(a,b){a.forEach(function(a){var e=a.id,f=a.listType,g=a.type;b.forEach(function(a){var b=d("WAWebBizLabelUtils").getParentTypeFromModel(a),h=a.id.toString();f===d("WAWebSchemaLabel").ListType.FAVORITES?a.id instanceof c("WAWebWid")&&(g==="add"?d("WAWebAddToFavoritesAction").addToFavoritesAction([a.id],{suppressToast:!0})["catch"](c("WAWebNoop")):d("WAWebRemoveFromFavoritesAction").removeFromFavoritesAction(a.id,{suppressToast:!0})["catch"](c("WAWebNoop"))):g==="add"?d("WAWebBizLabelUtils").addToLabelCollection(h,[e],b):d("WAWebBizLabelUtils").removeLabelFromCollection(h,e,b)})})};e.addOrRemoveLabels=function(a,b){var c=this;if(a.length===0||b.length===0)return;var e=d("WAWebListsGatingUtils").isListsEnabled(),f=e&&b.some(function(a){var b;return((b=(b=a.labels)==null?void 0:b.length)!=null?b:0)>0||!(a instanceof d("WAWebMsgModel").Msg)&&a.isFavorite}),g=d("WAWebActionToast.react").genId(),i=new(d("WAWebActionToast.react").ActionType)(e?m(l.IN_PROGRESS,!f):h._(/*BTDS*/"__JHASH__GQS0v2O6esz__JHASH__",[h._plural(a.length),h._param("count",a.length)])),n=d("WAWebEditLabelAssociationBridge").editLabelAssociation(a,b).then(function(){c.addOrRemoveLabelsMD(a,b)}).then(function(){return new(d("WAWebActionToast.react").ActionType)(e?m(l.SUCCESS,!f):h._(/*BTDS*/"__JHASH__hkdrpzCqCGJ__JHASH__",[h._plural(a.length,"count")]))})["catch"](function(b){d("WALogger").WARN(j()).devConsole(b);return new(d("WAWebActionToast.react").ActionType)(e?m(l.ERROR,!f):h._(/*BTDS*/"__JHASH__QV9X4H4eKfo__JHASH__",[h._plural(a.length)]))});d("WAWebToastManager").ToastManager.open(k.jsx(d("WAWebActionToast.react").ActionToast,{id:g,initialAction:i,pendingAction:n}))};e.getLabelsForModel=function(a,b){return this.filter(function(c){return c.labelItemCollection.get(d("WAWebBizLabelUtils").createLabelItemId(a,c.id,b))}).map(function(a){return a.id})};e.getNextAvailableColor=function(){var a=d("WAWebLabelUtils").getAllLabelColors(),b=this.map(function(a){return a.colorIndex}).sort(function(a,b){return Number(a)-Number(b)});if(b.length===0)return 0;b=b.findIndex(function(a,b){return a!==b});return b>=0?b:Math.floor(Math.random()*a.length)};e.getChatLabelsWithUnarchivedAssociations=function(){return this.filter(function(a){return a.count===0?!1:a.labelItemCollection.some(function(a){switch(a.parentType){case d("WAWebBizLabelItemParentType").LabelItemParentType.Chat:a=d("WAWebChatCollection").ChatCollection.get(a.parentId);return a==null||a.archive===!0||a.isLocked===!0?!1:!0;case d("WAWebBizLabelItemParentType").LabelItemParentType.Contact:case d("WAWebBizLabelItemParentType").LabelItemParentType.Msg:return!1}})})};e.getMessageLabelCount=function(){return this.reduce(function(a,b){b=b.labelItemCollection.reduce(function(a,b){return b.parentType===d("WAWebBizLabelItemParentType").LabelItemParentType.Msg?a+1:a},0);return a+b},0)};e.getActiveLists=function(){return this.filter(function(a){return a.isActive!==!1})};e.getChatLists=function(){return this.filter(function(a){return a.labelItemCollection.length===0?!0:a.labelItemCollection.some(function(a){switch(a.parentType){case d("WAWebBizLabelItemParentType").LabelItemParentType.Chat:a=d("WAWebChatCollection").ChatCollection.get(a.parentId);return a==null?!1:a.isLocked===!0?!1:!0;case d("WAWebBizLabelItemParentType").LabelItemParentType.Contact:case d("WAWebBizLabelItemParentType").LabelItemParentType.Msg:return!1}})})};e.getServerAssignedLabelIds=function(){return this.$LabelCollectionImpl$p_1};e.addToServerAssignedLabelIds=function(a){this.$LabelCollectionImpl$p_1.add(a)};return b}(d("WAWebBaseCollection").BaseCollection);a.model=d("WAWebLabelModel").Label;a.staleCollection=!0;function n(a){a=a.labelItemCollection;a.toArray().forEach(function(a){var b=a.parentId,e=a.parentType,f=a.labelId;a=d("WAWebBizLabelUtils").getParentCollection(e).get(b);a&&(a.labels=c("lodash").remove(a.labels,function(a){return a!==f}))})}e=new a();g.LabelCollection=e}),226); __d("WAWebLabelItemModel",["WAWebBaseModel"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.parentType=d("WAWebBaseModel").prop(),c.parentId=d("WAWebBaseModel").prop(),c.labelId=d("WAWebBaseModel").prop(),b)||babelHelpers.assertThisInitialized(c)}return b}(d("WAWebBaseModel").BaseModel);a.Proxy="labelItem";b=d("WAWebBaseModel").defineModel(a);g["default"]=b}),98); __d("WAWebLabelItemCollection",["WAWebBaseCollection","WAWebBizLabelUtils","WAWebLabelItemModel","lodash"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b;b=a.call(this)||this;b.listenTo(babelHelpers.assertThisInitialized(b),"add",h);b.listenTo(babelHelpers.assertThisInitialized(b),"remove",i);return b}return b}(d("WAWebBaseCollection").BaseCollection);a.model=c("WAWebLabelItemModel");function h(a){j(a,!0)}function i(a){j(a,!1)}function j(a,b){var e=d("WAWebBizLabelUtils").getParentCollection(a.parentType).get(a.parentId);if(!e)return;var f=e.labels||[];b?f.includes(a.labelId)||(e.labels=[a.labelId].concat(f)):e.labels=c("lodash").without(f,a.labelId)}g.LabelItemCollection=a}),98); __d("WAWebLabelModel",["Promise","WAWebBaseModel","WAWebBizLabelItemParentType","WAWebLabelCollection","WAWebLabelItemCollection"],(function(a,b,c,d,e,f,g){var h;a=function(a){babelHelpers.inheritsLoose(c,a);function c(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.name=d("WAWebBaseModel").prop(),c.colorIndex=d("WAWebBaseModel").prop(),c.color=d("WAWebBaseModel").prop(),c.count=d("WAWebBaseModel").prop(0),c.messageCount=d("WAWebBaseModel").prop(0),c.chatCount=d("WAWebBaseModel").prop(0),c.orderIndex=d("WAWebBaseModel").prop(),c.predefinedId=d("WAWebBaseModel").prop(),c.isActive=d("WAWebBaseModel").prop(),c.type=d("WAWebBaseModel").prop(),c.isImmutable=d("WAWebBaseModel").prop(),c.stale=d("WAWebBaseModel").session(!0),b)||babelHelpers.assertThisInitialized(c)}var e=c.prototype;e.initialize=function(){a.prototype.initialize.call(this),this.labelItemCollection=new(d("WAWebLabelItemCollection").LabelItemCollection)(),this.$LabelImpl$p_1(),this.listenTo(this,"change:name",this.$LabelImpl$p_1),this.listenTo(this,"change:color",this.$LabelImpl$p_1),this.listenTo(this,"change:colorIndex",this.$LabelImpl$p_1),this.listenTo(this,"change:count",this.$LabelImpl$p_1),this.listenTo(this.labelItemCollection,"add",this.$LabelImpl$p_2),this.listenTo(this.labelItemCollection,"remove",this.$LabelImpl$p_2),this.orderIndex==null&&(this.orderIndex=Number(this.id))};e.findImpl=function(a){return(h||(h=b("Promise"))).resolve({id:a})};e.$LabelImpl$p_1=function(){if(!this.name)return;d("WAWebLabelCollection").LabelCollection.trigger("label_updated_"+this.id)};e.$LabelImpl$p_2=function(){var a=this.labelItemCollection.reduce(function(a,b){switch(b.parentType){case d("WAWebBizLabelItemParentType").LabelItemParentType.Chat:a[0]++;return a;case d("WAWebBizLabelItemParentType").LabelItemParentType.Msg:a[1]++;return a;default:b.parentType;return a}},[0,0]),b=a[0];a=a[1];this.messageCount=a;this.chatCount=b;this.count=b+a};return c}(d("WAWebBaseModel").BaseModel);a.Proxy="label";c=d("WAWebBaseModel").defineModel(a);g.Label=c}),98); __d("WAWebMessageAssociationUIUtils",["WAWebFrontendMsgGetters","WAWebMessageAssociation.flow","WAWebMsgCollection","WAWebMsgType","WAWebPollCreationUtils","WAWebViewMode.flow","WAWebViewModeUtils"],(function(a,b,c,d,e,f,g){"use strict";var h=new Set([d("WAWebMsgType").MSG_TYPE.ALBUM,d("WAWebMsgType").MSG_TYPE.POLL_CREATION]);function a(a,b,c){return a==null?null:c&&h.has(b)?Math.min.apply(Math,[a].concat(c.map(function(a){a=a.ack;return a}))):a}function i(a,b){b===void 0&&(b=d("WAWebViewMode.flow").ViewModeSurface.CHAT);return j(d("WAWebMsgCollection").MsgCollection.byParentMessage(a),b)}function b(a,b){b===void 0&&(b=d("WAWebViewMode.flow").ViewModeSurface.CHAT);return d("WAWebMsgCollection").MsgCollection.byChat(a).filter(function(a){a=a.viewMode;return!d("WAWebViewModeUtils").isViewModeVisibleInSurface(b,a)})}function j(a,b){return a.filter(function(a){var c=a.associationType,e=a.parentMsgKey,f=a.viewMode;a=a.pendingDeleteForMe;return c!=null&&e!=null&&!a&&!d("WAWebViewModeUtils").isViewModeVisibleInSurface(b,f)})}function k(a){var b=a.parentMsgKey;a=a.duringDetach;a=a===void 0?!1:a;a=a?1:0;return i(b).length-a>0}function l(a){var b=a.parentMsg;a=a.duringDetach;a=a===void 0?!1:a;switch(b.type){case d("WAWebMsgType").MSG_TYPE.POLL_CREATION:var c=d("WAWebFrontendMsgGetters").getAsPollCreation(b);return c==null?!0:c.pollContentType===d("WAWebPollCreationUtils").PollContentType.IMAGE&&i(b.id).length!==c.pollOptions.length;case d("WAWebMsgType").MSG_TYPE.ALBUM:default:return!k({parentMsgKey:b.id,duringDetach:a})}}function c(a){var b=a.associationType;if(!b)return!0;a=a.parentMsgKey?d("WAWebMsgCollection").MsgCollection.get(a.parentMsgKey):null;switch(b){case d("WAWebMessageAssociation.flow").MessageAssociationType.MEDIA_POLL:return a!=null&&a.type===d("WAWebMsgType").MSG_TYPE.POLL_CREATION&&!l({parentMsg:a});default:return!0}}g.getLowestAckState=a;g.getHiddenAssociatedMessages=i;g.getHiddenViewModeMessagesForChat=b;g.filterOutVisibleAssociatedMessages=j;g.hasHiddenAssociatedMessages=k;g.shouldHideParentMessage=l;g.shouldDisplayOrphanMessage=c}),98); __d("WAWebGenerateProtocolMessageEditProto",["WAWebE2EProtoGenerator","WAWebE2EProtoUtils","WAWebMsgType","WAWebProtobufsE2E.pb","err","gkx"],(function(a,b,c,d,e,f,g){function a(a){var b,e=a.json;a=a.contextInfo;var f=Boolean(e.matchedText||e.description||e.title),g;b=(b=e.editMsgType)!=null?b:d("WAWebMsgType").MSG_TYPE.CHAT;switch(b){case d("WAWebMsgType").MSG_TYPE.CHAT:f=babelHelpers["extends"]({},e,{type:d("WAWebMsgType").MSG_TYPE.CHAT,subtype:f?"url":void 0});g=d("WAWebE2EProtoGenerator").getProtobufMessage(f,void 0,a);break;case d("WAWebMsgType").MSG_TYPE.IMAGE:g={imageMessage:{caption:e.caption,contextInfo:a}};break;case d("WAWebMsgType").MSG_TYPE.VIDEO:g={videoMessage:{caption:e.caption,contextInfo:a}};break;case d("WAWebMsgType").MSG_TYPE.DOCUMENT:g={documentWithCaptionMessage:{message:{documentMessage:{caption:e.caption,contextInfo:a}}}};break;default:if(!c("gkx")("26258")&&b===d("WAWebMsgType").MSG_TYPE.AUDIO)g={audioMessage:{}};else throw c("err")("Unsupported edit msg type: "+b)}return{protocolMessage:{key:d("WAWebE2EProtoUtils").encodeKey(e.protocolMessageKey),type:d("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.MESSAGE_EDIT,timestampMs:e.latestEditSenderTimestampMs,editedMessage:g}}}g["default"]=a}),98); __d("WAWebGetMyAddOnsRPC",["WASmaxNewslettersMyAddOnsRPC","WAWebBackendErrors","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.count;a=a.newsletterJid;b=(yield d("WASmaxNewslettersMyAddOnsRPC").sendMyAddOnsRPC({myAddonsLimit:b,myAddonsJid:a}));switch(b.name){case"MyAddOnsResponseSuccess":return{messagesByNewsletter:b.value.myAddonsMessages};case"MyAddOnsResponseServerError":a=b.value.errorIQErrorInternalServerErrorMixin;var c=a.code;a=a.text;throw new(d("WAWebBackendErrors").ServerStatusCodeError)(Number(c),a);case"MyAddOnsResponseClientError":c=b.value.myAddonsClientErrors;switch(c.name){case"ItemNotFoundIQErrorResponse":a=c.value.errorIQErrorItemNotFoundMixin;b=a.code;a=a.text;throw new(d("WAWebBackendErrors").ServerStatusCodeError)(Number(b),a);case"RateLimitedIQErrorResponse":b=c.value.errorIQErrorRateOverlimitMixin;a=b.code;b=b.text;throw new(d("WAWebBackendErrors").ServerStatusCodeError)(Number(a),b);case"BadRequestIQErrorResponse":a=c.value.errorIQErrorBadRequestMixin;b=a.code;a=a.text;throw new(d("WAWebBackendErrors").ServerStatusCodeError)(Number(b),a);case"UnauthorizedIQErrorResponse":b=c.value.errorIQErrorNotAuthorizedMixin;a=b.code;c=b.text;throw new(d("WAWebBackendErrors").ServerStatusCodeError)(Number(a),c)}}});return h.apply(this,arguments)}g.getMyNewsletterAddOnsRPC=a}),98); __d("WAWebNewsletterGetMyAddOnsJob",["Promise","WAJobOrchestratorTypes","WAWebCRUDOperationsNewsletterMyVotes","WAWebDBCreateOrUpdateReactions","WAWebGetMyAddOnsRPC","WAWebNewsletterDBUtils","WAWebOrchestratorNonPersistedJob","WAWebPollOptionHashUtils","WAWebUserPrefsMeUser","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function a(a){return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("getMyNewsletterAddOns",b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var b=(yield d("WAWebGetMyAddOnsRPC").getMyNewsletterAddOnsRPC(a));b=b.messagesByNewsletter;return i(b,a.newsletterJid)}),{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()}function i(a,b){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){a=a.reduce(function(a,b){var d=b.message;b=b.jid;var e=(b=b)!=null?b:c;if(e==null)return a;d.forEach(function(b){var c=k(b,e);c!=null&&a.reactions.push(c);c=l(b,e);c!=null&&a.pollVotes.push(c)});return a},{reactions:[],pollVotes:[]});yield (h||(h=b("Promise"))).all([d("WAWebDBCreateOrUpdateReactions").createOrUpdateReactions(a.reactions),d("WAWebCRUDOperationsNewsletterMyVotes").bulkCreateOrUpdateMyVotes(a.pollVotes)]);return a});return j.apply(this,arguments)}function k(a,b){var c;b=d("WAWebNewsletterDBUtils").craftNewsletterMsgKeyFromServerId(a.serverId,b).toString();c=a==null?void 0:(c=a.newsletterMyReactionMixin)==null?void 0:c.reactionCode;a=a==null?void 0:(a=a.newsletterMyReactionMixin)==null?void 0:a.reactionT;return c==null||a==null?null:{parentMsgKey:b,senderUserJid:d("WAWebUserPrefsMeUser").getMeUser().toString(),reactionText:c,timestamp:a*1e3,orphan:0,msgKey:b}}function l(a,b){var c=a.newsletterMyPollVoteMixin;if(c==null)return null;var e=c.votesT;c=c.votesVote;return{chatJid:b,msgServerId:a.serverId,serverTimestampMs:e*1e3,t:e,msgKey:d("WAWebNewsletterDBUtils").craftNewsletterMsgKeyFromServerId(a.serverId,b).toString(),votes:c.map(function(a){return d("WAWebPollOptionHashUtils").bufferToHex(a.elementValue)})}}g.getMyNewsletterAddOnsJob=a}),98); __d("WAWebNewsletterLoadingStageManager",["$InternalEnum","WAWebBaseModel","WAWebModelUtils"],(function(a,b,c,d,e,f,g){var h=b("$InternalEnum").Mirrored(["None","Loading","Finished","Failed"]);a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.stage=d("WAWebModelUtils").prop(h.None),b)||babelHelpers.assertThisInitialized(c)}var c=b.prototype;c.start=function(){this.stage=h.Loading};c.fail=function(){this.stage=h.Failed};c.end=function(){this.stage=h.Finished};return b}(d("WAWebBaseModel").BaseModel);a.Proxy="newsletterLoadingStage";c=d("WAWebBaseModel").defineModel(a);e=new c({id:"1"});g.NewsletterLoadingStage=h;g.NewsletterLoadingStageManager=e}),98); __d("WAWebBootstrapNewsletter",["WALogger","WAQplTypes","WAWebNewsletterGatingUtils","WAWebNewsletterGetMyAddOnsJob","WAWebNewsletterLoadingStageManager","WAWebPrimaryFeaturesModel","WAWebQplQuickPerformanceLoggerMarkerIds","WAWebQplQuickPerformanceLoggerModule","WAWebQueryAndUpdateNewslettersMetadataAction","WAWebSyncdOrphan","WAWebUserPrefsMultiDevice","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletter-bootstrap] Bootstrap failed"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletter-bootstrap] Bootstrap failed"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletter-bootstrap] Bootstrap completed"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletter] Failed to retrieve my reactions on bootstrap"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletter-bootstrap] Bootstrap started"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletter-bootstrap] Bootstrap already ongoing, returning"]);m=function(){return a};return a}var n=5e3,o=null;function a(){if(!d("WAWebNewsletterGatingUtils").isNewsletterEnabled())return;if(o!=null){d("WALogger").LOG(m());return o}if(d("WAWebUserPrefsMultiDevice").getNewsletterWasBootstrapped())return;if(d("WAWebNewsletterGatingUtils").isNewsletterEnabledOnPrimary()){o=p();return o}d("WAWebPrimaryFeaturesModel").PrimaryFeatures.on("change:newsletter",function(){if(d("WAWebNewsletterGatingUtils").isNewsletterEnabledOnPrimary()){o=p();return o}})}function p(){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){d("WALogger").LOG(l());var a=d("WAWebQplQuickPerformanceLoggerModule").QPL.markerStart(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.NEWSLETTER_BOOSTRAP);d("WAWebNewsletterLoadingStageManager").NewsletterLoadingStageManager.start();try{var b=(yield d("WAWebQueryAndUpdateNewslettersMetadataAction").queryAndUpdateAllNewsletterMetadataAction(d("WAWebQueryAndUpdateNewslettersMetadataAction").NewsletterMetadataUpdateEntryPoint.Bootstrap,{messageCount:1,addSystemMsgs:!0,qplEvent:a}));d("WAWebNewsletterGatingUtils").isNewsletterReactionEnabled()&&(yield d("WAWebNewsletterGetMyAddOnsJob").getMyNewsletterAddOnsJob({count:n})["catch"](function(a){d("WALogger").ERROR(k()).tags("newsletter").devConsole(a).sendLogs("newsletter-bootstrap-my-reactions-failed")}));d("WAWebUserPrefsMultiDevice").setNewsletterWasBootstrapped();b.success?(yield d("WAWebSyncdOrphan").checkOrphanChats(b.chats.map(function(a){return a.id.toString()})),d("WAWebNewsletterLoadingStageManager").NewsletterLoadingStageManager.end(),a.end(d("WAQplTypes").QuickLogActionType.SUCCESS),d("WALogger").LOG(j())):(a.end(d("WAQplTypes").QuickLogActionType.FAIL),d("WAWebNewsletterLoadingStageManager").NewsletterLoadingStageManager.fail(),d("WALogger").ERROR(i()).tags("newsletter").sendLogs("newsletter-bootstrap-failed"))}catch(b){a.end(d("WAQplTypes").QuickLogActionType.FAIL),d("WAWebNewsletterLoadingStageManager").NewsletterLoadingStageManager.fail(),d("WALogger").ERROR(h()).tags("newsletter").devConsole(b).sendLogs("newsletter-bootstrap-failed")}finally{o=null}});return q.apply(this,arguments)}g.bootstrapNewsletterBackend=a}),98); __d("WAWebNewsletterStorageUtils",["WAWebCommonNewsletterEnums","WAWebNewsletterDBConstants"],(function(a,b,c,d,e,f,g){function h(a){switch(a){case d("WAWebCommonNewsletterEnums").NewsletterMembershipType.Subscriber:return d("WAWebNewsletterDBConstants").NewsletterDBMembership.Subscriber;case d("WAWebCommonNewsletterEnums").NewsletterMembershipType.Admin:return d("WAWebNewsletterDBConstants").NewsletterDBMembership.Admin;case d("WAWebCommonNewsletterEnums").NewsletterMembershipType.Guest:return d("WAWebNewsletterDBConstants").NewsletterDBMembership.Guest;case d("WAWebCommonNewsletterEnums").NewsletterMembershipType.Owner:return d("WAWebNewsletterDBConstants").NewsletterDBMembership.Owner}}function i(a){switch(a){case d("WAWebCommonNewsletterEnums").NewsletterPrivacy.Public:return 0;case d("WAWebCommonNewsletterEnums").NewsletterPrivacy.Private:return 1}}function j(a){switch(a){case d("WAWebCommonNewsletterEnums").WamoSubStatus.ACTIVE:return 0;case d("WAWebCommonNewsletterEnums").WamoSubStatus.INACTIVE:return 1}}function a(a){var b={id:a.id.toString()};a.creationTime!=null&&(b.creationTime=a.creationTime);a.name!=null&&(b.name=a.name);a.nameUpdateTime!=null&&(b.nameUpdateTime=a.nameUpdateTime);a.description!=null&&(b.description=a.description);a.descriptionUpdateTime!=null&&(b.descriptionUpdateTime=a.descriptionUpdateTime);a.handle!=null&&(b.handle=a.handle);a.inviteCode!=null&&(b.inviteCode=a.inviteCode);a.size!=null&&(b.size=a.size);a.verified!=null&&(b.verified=a.verified);a.membershipType!=null&&(b.membershipType=h(a.membershipType));a.privacy!=null&&(b.privacy=i(a.privacy));if(a.website!=null){var c;b.website=(c=a.website)==null?void 0:c.href}a.reactionCodesSetting!=null&&(b.reactionCodesSetting=a.reactionCodesSetting);a.adminCount!=null&&(b.adminCount=a.adminCount);a.capabilities!=null&&(b.capabilities=new Set(Array.from(a.capabilities).map(function(a){return a})));a.suspended!=null&&(b.suspended=a.suspended);a.geosuspended!=null&&(b.geosuspended=a.geosuspended);a.terminated!=null&&(b.terminated=a.terminated);a.wamoSubPlanId!=null&&(b.wamoSubPlanId=a.wamoSubPlanId);a.wamoSubStatus!=null&&(b.wamoSubStatus=j(a.wamoSubStatus));return b}g.mapNewsletterMembershipTypeForStorage=h;g.mapNewsletterWamoSubStatusForStorage=j;g.createNewsletterMetadataObjectForStorage=a}),98); __d("WAWebNewsletterCleanupTasks",["WAWebBackendApi","WAWebCommonNewsletterEnums","WAWebNewsletterDeleteChatJob","WAWebNewsletterStorageUtils","WAWebSchemaNewsletterMetadata","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h=d("WAWebNewsletterStorageUtils").mapNewsletterMembershipTypeForStorage(d("WAWebCommonNewsletterEnums").NewsletterMembershipType.Guest);function a(){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield d("WAWebBackendApi").frontendSendAndReceive("getActiveNewsletter")),b=a==null?void 0:a.toJid();a=(yield d("WAWebSchemaNewsletterMetadata").getNewsletterMetadataTable().all());a=a.filter(function(a){return a.membershipType===h&&a.id!==b}).map(function(a){return a.id});yield d("WAWebNewsletterDeleteChatJob").bulkDeleteNewsletterChats(a.map(d("WAWebWidFactory").createWid))});return i.apply(this,arguments)}g.deletePreviewNewsletters=a}),98); __d("WAWebNewsletterNotificationQueue",["WAPromiseQueue"],(function(a,b,c,d,e,f,g){a=new(d("WAPromiseQueue").PromiseQueueMap)();g["default"]=a}),98); __d("WAWebHandleNewsletterNotification",["$InternalEnum","WADeprecatedWapParser","WALogger","WAParsableWapNode","WAWebNewsletterHandleLiveUpdatesNotification","WAWebNewsletterNotificationQueue","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletter][notification] Failed to parse notification"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletter][notification] Unexpected from "]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletter][notification] Failed to cast ",""]);j=function(){return a};return a}var k=b("$InternalEnum")({LiveUpdates:"live_updates"}),l=new(c("WADeprecatedWapParser"))("incomingNewsletterNotificationParser",function(a){var b=a.mapFirstChild(function(a){return a.tag()}),e=k.cast(b),f=a.attrFromJid();if(e==null){d("WALogger").ERROR(j(),b).tags("newsletter").devConsole(a,b).sendLogs("newsletter-failed-to-cast-notification");throw c("err")("Failed to cast "+b)}if(f.type!=="newsletter"){d("WALogger").ERROR(i()).tags("newsletter").devConsole(f).sendLogs("newsletter-wrong-notification-sender-type-"+f.type);throw c("err")("Unexpected from "+f.type)}return{firstChildTag:e,from:f.newsletterJid}});function a(a){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){try{var b=l.parseOrThrow(a),e=b.firstChildTag;b=b.from;return yield c("WAWebNewsletterNotificationQueue").enqueue(b,function(){switch(e){case k.LiveUpdates:return d("WAWebNewsletterHandleLiveUpdatesNotification").handleNewsletterLiveUpdatesNotification(a)}})}catch(a){d("WALogger").ERROR(h()).tags("newsletter").devConsole(a).sendLogs("failed-to-parse-newsletter-notification");throw new(d("WAParsableWapNode").XmppParsingFailure)("incomingNewsletterNotificationParser",a instanceof Error?a.name:typeof a+" was thrown rather than an Error")}});return m.apply(this,arguments)}g["default"]=a}),98); __d("WAWebNewsletterHandleLiveUpdatesNotification",["WALogger","WANullthrows","WASmaxNewslettersLiveUpdatesNotificationRPC","WAWebBackendApi","WAWebNewsletterBackendAddOnsUtils","WAWebNewsletterGatingUtils","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletter][live-updates-notification] Failed to handle the notification"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[liveUpdate] start"]);i=function(){return a};return a}function a(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){d("WALogger").DEV(i());a=d("WASmaxNewslettersLiveUpdatesNotificationRPC").receiveLiveUpdatesNotificationRPC(a);var b=a.makeLiveUpdatesNotificationResponseAck;a=a.parsedRequest;try{if(!d("WAWebNewsletterGatingUtils").isNewsletterReactionEnabled())return b();var e=a.liveUpdatesMessagesNewsletterMessageResponsePayloadMixin.message,f=a.from;a=a.t;e=(yield d("WAWebNewsletterBackendAddOnsUtils").getMsgsAndAddOnsFromUpdates(e,d("WAWebWidFactory").createWid(c("WANullthrows")(f)),a));yield d("WAWebNewsletterBackendAddOnsUtils").updateAddOnDbRecords(babelHelpers["extends"]({},e,{timestamp:a}));d("WAWebBackendApi").frontendFireAndForget("updateNewsletterMessages",e);return b()}catch(a){d("WALogger").ERROR(h()).tags("newsletter").devConsole(a).sendLogs("newsletter-live-updates-db");return b()}});return j.apply(this,arguments)}g.handleNewsletterLiveUpdatesNotification=a}),98); __d("WAWebNewsletterHandleMessageDeliveryUpdateNotification",["WAJobOrchestratorTypes","WAWebBackendApi","WAWebJidToWid","WAWebNewsletterMessageDeliveryUpdateToModelUtils","WAWebNewsletterMetadataJob","WAWebNux","WAWebUserPrefsNuxPreferences","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=d("WAWebJidToWid").newsletterJidToWid(a);b=b.reduce(function(a,b){if(b.issueCode===0)a.updatesToRemove.push(b.serverId);else{b={id:b.serverId,code:b.issueCode};a.updatesToAdd.push(b)}return a},{updatesToAdd:[],updatesToRemove:[]});var e=b.updatesToAdd;b=b.updatesToRemove;void d("WAWebNewsletterMetadataJob").updateNewsletterMessageDeliveryUpdates(a,e,b,d("WAJobOrchestratorTypes").JOB_PRIORITY.HIGH);e=(yield d("WAWebNewsletterMessageDeliveryUpdateToModelUtils").getMessageDeliveryUpdatesModelToUpdate(a,e,b));b=e.modelUpdatesToAdd;e=e.modelUpdatesToRemove;yield d("WAWebBackendApi").frontendSendAndReceive("updateNewsletterMessageDeliveryUpdate",{id:c,modelUpdatesToAdd:b,modelUpdatesToRemove:e});c=d("WAWebNux").getNewsletterAlertsBannerNuxKey(a);d("WAWebUserPrefsNuxPreferences").resetNux(c)});return h.apply(this,arguments)}g.handleNewsletterMessageDeliveryUpdateNotificationImpl=a}),98); __d("WAWebMexNewsletterAdminNotificationHandler",["WALogger","WAWebBackendApi","WAWebCommonNewsletterEnums","WAWebCountriesUtils","WAWebJidToWid","WAWebNewsletterAdminNotificationJob","WAWebNewsletterHandleMessageDeliveryUpdateNotification","WAWebNewsletterValidationUtils","WAWebNux","WAWebUserPrefsNuxPreferences","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[mex][newsletter][notification][hide-channel] Failed to persist metadata notification information for hide channel on db"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[mex][newsletter][notification][geosuspension] Failed to persist metadata notification information for geosuspension on db"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[mex][newsletter][notification][admin-metadata] Failed to persist admin metadata notification information on db"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["unexpected null id in xwa2_notify_newsletter_on_admin_metadata_update"]);k=function(){return a};return a}function a(a,b){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=b.xwa2_notify_newsletter_on_admin_metadata_update;b=a.id;var c=a.thread_metadata;a=a.messages;try{if(b==null){d("WALogger").ERROR(k()).tags("mex","newsletter").devConsole("unexpected null id in xwa2_notify_newsletter_on_admin_metadata_update").sendLogs("newsletter-mex-admin-metadata-notification-unexpected-null-id");return}yield m(b,c);yield o(b,a)}catch(a){d("WALogger").ERROR(j()).tags("mex","newsletter").devConsole(a).sendLogs("mex-newsletter-admin-metadata-notification-db-fail")}});return l.apply(this,arguments)}function m(a,b){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if((b==null?void 0:b.geo_states)==null)return;b=b.geo_states;a=d("WAWebNewsletterValidationUtils").toNewsletterJidOrThrow(a);var c=d("WAWebJidToWid").newsletterJidToWid(a);b=b.reduce(function(a,b){var c=b.country_code!=null?d("WAWebCountriesUtils").asISOCountryCode(b.country_code):null;if(c==null)return a;d("WAWebCommonNewsletterEnums").NewsletterState.cast((b=b.state.type)==null?void 0:b.toLowerCase())===d("WAWebCommonNewsletterEnums").NewsletterState.GeoSuspended?a.countriesToAdd.push(c):a.countriesToRemove.push(c);return a},{countriesToAdd:[],countriesToRemove:[]});var e=b.countriesToAdd;b=b.countriesToRemove;try{if(e.length>0){yield d("WAWebNewsletterAdminNotificationJob").updateGeosuspendedCountry(a,e,!0);d("WAWebBackendApi").frontendFireAndForget("updateGeosuspendedCountry",{id:c,countryCodes:e,toAdd:!0});e=d("WAWebNux").getNewsletterAlertsBannerNuxKey(a);d("WAWebUserPrefsNuxPreferences").resetNux(e)}b.length>0&&(yield d("WAWebNewsletterAdminNotificationJob").updateGeosuspendedCountry(a,b,!1),d("WAWebBackendApi").frontendFireAndForget("updateGeosuspendedCountry",{id:c,countryCodes:b,toAdd:!1}))}catch(a){d("WALogger").ERROR(i()).tags("mex","newsletter").devConsole(a).sendLogs("mex-newsletter-admin-metadata-notification-geosuspension-db-fail")}});return n.apply(this,arguments)}function o(a,b){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if(b==null)return;try{a=d("WAWebNewsletterValidationUtils").toNewsletterJidOrThrow(a);b=b.edges.map(function(a){a=a.node;var b=a.message_delivery_update.issue.code,d;switch(b){case"NEEDS_REVIEW":d=1;break;case"NONE":d=0;break;default:throw c("err")("Unexpected mex issue code: "+b)}return{serverId:parseInt(a.server_id,10),issueCode:d}});yield d("WAWebNewsletterHandleMessageDeliveryUpdateNotification").handleNewsletterMessageDeliveryUpdateNotificationImpl(a,b)}catch(a){d("WALogger").ERROR(h()).tags("mex","newsletter").devConsole(a).sendLogs("mex-newsletter-admin-metadata-notification-hidechannel-db-fail")}});return p.apply(this,arguments)}g.mexHandleNewsletterAdminNotification=a}),98); __d("WAWebNewsletterBackendQueues",["WAWebPromiseQueue"],(function(a,b,c,d,e,f,g){b=new((a=d("WAWebPromiseQueue")).PromiseQueue)();c=new a.PromiseQueue();e=new a.PromiseQueue();f=new a.PromiseQueue();g.newsletterCreationQueue=b;g.newsletterSubscribeQueue=c;g.newsletterDeleteQueue=e;g.newsletterJoinNotificationQueue=f}),98); __d("WAWebNewsletterUpdateNewslettersRecordsJob",["WAJobOrchestratorTypes","WAWebOrchestratorNonPersistedJob","WAWebSchemaChat"],(function(a,b,c,d,e,f,g){function a(a){return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("updateNewsletterChatRecords",function(){return d("WAWebSchemaChat").getChatTable().bulkCreateOrMerge(a)},{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()}g.updateNewsletterChatRecords=a}),98); __d("WAWebMexNewsletterJoinHandler",["Promise","WALogger","WATimeUtils","WAWebBackendApi","WAWebCreateChat","WAWebMexNewsletterParseUtils","WAWebNewsletterBackendAddOnsUtils","WAWebNewsletterBackendQueues","WAWebNewsletterGatingUtils","WAWebNewsletterGetMessagesJob","WAWebNewsletterMetadataJob","WAWebNewsletterModelUtils","WAWebNewsletterStorageUtils","WAWebNewsletterSystemMessages","WAWebNewsletterUpdateMsgsRecordsJob","WAWebNewsletterUpdateNewslettersRecordsJob","WAWebViewMode.flow","WAWebViewModeUtils","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[mex][newsletter][notification][join]"]);i=function(){return a};return a}function a(a,b){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){yield (h||(h=b("Promise"))).all([d("WAWebNewsletterBackendQueues").newsletterCreationQueue.wait(),d("WAWebNewsletterBackendQueues").newsletterSubscribeQueue.wait()]);if(!d("WAWebNewsletterGatingUtils").isNewsletterEnabled())return;var f=d("WAWebMexNewsletterParseUtils").parseMexNewsletterResponse(e.xwa2_notify_newsletter_on_join);if(f==null)throw c("err")("cannot parse xwa2_notify_newsletter_on_join response");a=d("WAWebNewsletterModelUtils").mapNewsletterToModels(f);var g=a.chat,j=a.metadata,l=a.pic;return d("WAWebNewsletterBackendQueues").newsletterJoinNotificationQueue.enqueue(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){try{return yield k(g,j,l,f.idJid)}catch(a){d("WALogger").ERROR(i()).tags("mex","newsletter").devConsole(a).sendLogs("mex-newsletter-notification-join-fail")}}))});return j.apply(this,arguments)}function k(a,b,c,d){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e){e=(yield m({chat:a,metadata:b,newsletterJid:e}));var f=e.msgsToStore;e=e.noEarlierMsgs;yield d("WAWebNewsletterUpdateNewslettersRecordsJob").updateNewsletterChatRecords([d("WAWebCreateChat").createNewsletterObjectForStorage(a)]);yield d("WAWebNewsletterMetadataJob").updateNewsletterMetadata(d("WAWebNewsletterStorageUtils").createNewsletterMetadataObjectForStorage(b));yield d("WAWebBackendApi").frontendSendAndReceive("joinNewsletter",{newsletter:a,metadata:b,pic:c,msgs:f,noEarlierMsgs:e})});return l.apply(this,arguments)}function m(a){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.chat,c=a.metadata;a=a.newsletterJid;try{var e=d("WAWebNewsletterSystemMessages").genNewsletterCreationSystemMessages({id:b.id,name:b.name,t:c.creationTime,role:c.membershipType});a=(yield d("WAWebNewsletterGetMessagesJob").getNewsletterMessages(a,1));var f=a.msgs,g=f.length===0,h=f.every(function(a){return!d("WAWebViewModeUtils").isViewModeVisibleInSurface(d("WAWebViewMode.flow").ViewModeSurface.CHAT,a.viewMode)});h=f.length>0&&!h?f:[].concat(e,f);b.t=o(c.creationTime,h);f.length>0&&(yield d("WAWebNewsletterBackendAddOnsUtils").updateAddOnDbRecords(a));yield d("WAWebNewsletterUpdateMsgsRecordsJob").addNewsletterMsgsRecords(h);return{msgsToStore:h,noEarlierMsgs:g}}catch(a){return{msgsToStore:[],noEarlierMsgs:!1}}});return n.apply(this,arguments)}function o(a,b){return d("WATimeUtils").castToUnixTime(Math.min(Math.max((a=a)!=null?a:0,Math.max.apply(Math,b.map(function(a){return(a=a.t)!=null?a:0}))),Date.now()/1e3))}g.mexHandleNewsletterJoin=a}),98); __d("WAWebdbCRUDOperationsNewsletterReaction",["WAWebModelStorageUtils","WAWebSchemaNewsletterReactions","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){var c=new Map();a.forEach(function(a){var b=a.parentMsgKey;b=b;var d=c.get(b);d?d.serverTimestamp<=a.serverTimestamp&&c.set(b,a):c.set(b,a)});return d("WAWebModelStorageUtils").getStorage().lock(["newsletter-reactions"],function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a[0];var b=Array.from(c.values()).map(function(a){return a.parentMsgKey});b=(yield a.anyOf(["parentMsgKey"],b));b.forEach(function(a){var b=a.parentMsgKey,d=c.get(b);d&&(d.serverTimestamp<=a.serverTimestamp&&c["delete"](b))});yield a.bulkCreateOrReplace(Array.from(c.values()))});return function(b){return a.apply(this,arguments)}}())}function c(a){return d("WAWebModelStorageUtils").getStorage().lock(["newsletter-reactions"],function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){b=b[0];var c=a.parentMsgKey;c=(yield h(c));if(c)yield b.bulkCreateOrReplace([c]);else{c=babelHelpers["extends"]({emojiCountMap:new Map(),serverTimestamp:0},a);yield b.createOrReplace(c)}});return function(a){return c.apply(this,arguments)}}())}function e(a){return d("WAWebSchemaNewsletterReactions").getTable().remove(a)}function f(a){return d("WAWebSchemaNewsletterReactions").getTable().bulkRemove(a)}function h(a){return d("WAWebSchemaNewsletterReactions").getTable().get(a)}g.createOrUpdateNewsletterReactions=a;g.createOrUpdateNewsletterReaction=c;g.removeNewsletterReactionsForParentMsg=e;g.bulkRemoveNewsletterReactionsForParentMsg=f;g.getNewsletterReaction=h}),98); __d("WAWebNewsletterDeleteMessageAddOns",["Promise","WAJobOrchestratorTypes","WAWebOrchestratorNonPersistedJob","WAWebSchemaMessage","WAWebdbCRUDOperationsNewsletterReaction","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h,i=[function(a){return d("WAWebdbCRUDOperationsNewsletterReaction").bulkRemoveNewsletterReactionsForParentMsg(a.map(function(a){return a}))}];function a(a){return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("deleteNewsletterMessageAddOns",b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var c=a.toString();c=(yield d("WAWebSchemaMessage").getMessageTable().startsWithAnyOf(["internalId"],[c]));var e=c.map(function(a){return a.id});yield (h||(h=b("Promise"))).all(i.map(function(a){return a(e)}))}),{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()}g.deleteNewsletterMessageAddOns=a}),98); __d("WAWebMexNewsletterLeaveHandler",["WAJids","WALogger","WAWebBackendApi","WAWebJidToWid","WAWebNewsletterDBUtils","WAWebNewsletterDeleteChatJob","WAWebNewsletterDeleteMessageAddOns","WAWebNewsletterMetadataJob","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[mex][newsletter][notification][leave]"]);h=function(){return a};return a}function a(a,b){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=b.xwa2_notify_newsletter_on_leave.id;if(a==null)throw c("err")("unexpected null id in xwa2_notify_newsletter_on_leave");b=d("WAJids").toNewsletterJid(a);a=d("WAWebJidToWid").newsletterJidToWid(b);if(!(yield d("WAWebNewsletterDBUtils").doesNewsletterExistInStorage(b))){d("WAWebBackendApi").frontendFireAndForget("updateNewsletterSubscriberCount",{id:a,update:{increment:-1}});return}try{yield d("WAWebNewsletterMetadataJob").deleteNewsletterMetadata(b),yield d("WAWebNewsletterDeleteMessageAddOns").deleteNewsletterMessageAddOns(b),yield d("WAWebNewsletterDeleteChatJob").deleteNewsletterChat(a),d("WAWebBackendApi").frontendFireAndForget("deleteNewsletter",{id:a,keep:!0})}catch(a){d("WALogger").ERROR(h()).tags("mex","newsletter").devConsole(a).sendLogs("mex-newsletter-notification-leave-fail")}});return i.apply(this,arguments)}g.mexHandleNewsletterLeave=a}),98); __d("WAWebMexNewsletterMetadataUpdateNotificationHandler",["WAJids","WALogger","WAWebApiChat","WAWebJidToWid","WAWebMexNewsletterParseUtils","WAWebNewsletterMetadataUpdateUtils","WAWebNewsletterModelUtils","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[mex][newsletter][notification][metadata-update] Failed to update metadata change"]);h=function(){return a};return a}function a(a,b){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=b.xwa2_notify_newsletter_on_metadata_update;b=a.id;if(b==null)throw c("err")("unexpected null id in xwa2_notify_newsletter_on_metadata_update");b=d("WAJids").toNewsletterJid(b);b=d("WAWebJidToWid").newsletterJidToWid(b);b=(yield d("WAWebApiChat").getChatRecord(b));if(b==null)return;b=d("WAWebMexNewsletterParseUtils").parseMexNewsletterResponse(a);if(b==null)throw c("err")("Unexpected null metadata for newsletter update notification");try{a=d("WAWebNewsletterModelUtils").mapNewsletterToModels(b);b=a.chat;var e=a.metadata;a=a.pic;yield d("WAWebNewsletterMetadataUpdateUtils").updateNewsletterMetadataAndPic(b,e,a)}catch(a){d("WALogger").ERROR(h()).tags("mex","newsletter").devConsole(a).sendLogs("mex-newsletter-notification-metadata-update-fail")}});return i.apply(this,arguments)}g.mexHandleNewsletterMetadataUpdate=a}),98); __d("WAWebMexFetchAllNewslettersMetadataJobQuery.graphql",[],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"fetch_wamo_sub"}],b={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},c={alias:null,args:null,kind:"ScalarField",name:"type",storageKey:null},d=[b,{alias:null,args:null,kind:"ScalarField",name:"text",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"update_time",storageKey:null}],e=[b,c,{alias:null,args:null,kind:"ScalarField",name:"direct_path",storageKey:null}];b=[{alias:null,args:null,concreteType:"XWA2Newsletter",kind:"LinkedField",name:"xwa2_newsletter_subscribed",plural:!0,selections:[b,{alias:null,args:null,concreteType:"XWA2NewsletterState",kind:"LinkedField",name:"state",plural:!1,selections:[c],storageKey:null},{alias:null,args:null,concreteType:"XWA2NewsletterThreadMetadata",kind:"LinkedField",name:"thread_metadata",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"creation_time",storageKey:null},{alias:null,args:null,concreteType:"XWA2NewsletterName",kind:"LinkedField",name:"name",plural:!1,selections:d,storageKey:null},{alias:null,args:[{kind:"Literal",name:"type",value:"IMAGE"}],concreteType:"XWA2Picture",kind:"LinkedField",name:"picture",plural:!1,selections:e,storageKey:'picture(type:"IMAGE")'},{alias:"preview",args:[{kind:"Literal",name:"type",value:"PREVIEW"}],concreteType:"XWA2Picture",kind:"LinkedField",name:"picture",plural:!1,selections:e,storageKey:'picture(type:"PREVIEW")'},{alias:null,args:null,concreteType:"XWA2NewsletterDescription",kind:"LinkedField",name:"description",plural:!1,selections:d,storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"invite",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"handle",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"verification",storageKey:null},{alias:null,args:null,concreteType:"XWA2NewsletterThreadSettings",kind:"LinkedField",name:"settings",plural:!1,selections:[{alias:null,args:null,concreteType:"XWA2NewsletterReactionCodesSetting",kind:"LinkedField",name:"reaction_codes",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null}],storageKey:null}],storageKey:null},{condition:"fetch_wamo_sub",kind:"Condition",passingValue:!0,selections:[{alias:null,args:null,concreteType:"XWA2NewsletterWamoSubMetadata",kind:"LinkedField",name:"wamo_sub",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"plan_id",storageKey:null}],storageKey:null}]}],storageKey:null},{alias:null,args:null,concreteType:"XWA2NewsletterViewerMetadata",kind:"LinkedField",name:"viewer_metadata",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"mute",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"role",storageKey:null},{condition:"fetch_wamo_sub",kind:"Condition",passingValue:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"wamo_sub_status",storageKey:null}]}],storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"WAWebMexFetchAllNewslettersMetadataJobQuery",selections:b,type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"WAWebMexFetchAllNewslettersMetadataJobQuery",selections:b},params:{id:"7985160834917309",metadata:{},name:"WAWebMexFetchAllNewslettersMetadataJobQuery",operationKind:"query",text:null}}}();e.exports=a}),null); __d("WAWebMexFetchAllNewslettersMetadataJob",["WALogger","WAWebBackendErrors","WAWebMexClient","WAWebMexFetchAllNewslettersMetadataJobQuery.graphql","WAWebMexNewsletterParseUtils","WAWebNewsletterGatingUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[MEX][NEWSLETTER] fetched all newsletters job"]);i=function(){return a};return a}function j(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=h!==void 0?h:h=b("WAWebMexFetchAllNewslettersMetadataJobQuery.graphql");c=(yield d("WAWebMexClient").fetchQuery(c,{fetch_wamo_sub:(a==null?void 0:a.fetchWamoSub)===!0}));d("WALogger").LOG(i()).tags("GQL","MEX").devConsole({response:c});return c});return k.apply(this,arguments)}function a(){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield j({fetchWamoSub:d("WAWebNewsletterGatingUtils").isWamoSubExperienceEnabled()})),b=a==null?void 0:a.xwa2_newsletter_subscribed;if(a==null||b==null)throw new(d("WAWebBackendErrors").ServerStatusCodeError)(500,"Mex unexpected null response for fetching all metadata");if(b.length===0)return{newsletters:[]};var c=[],e=[];b.filter(function(a){return a!=null}).map(function(a){var b=d("WAWebMexNewsletterParseUtils").parseMexNewsletterResponse(a);if(b!=null){(a==null?void 0:(a=a.state)==null?void 0:a.type)==="DELETED"?b!=null&&e.push({jid:b.idJid}):c.push(b)}});return c.length>0||e.length>0?{newsletters:c,deletedNewsletters:e.length>0?{id:e}:null}:{newsletters:[]}});return l.apply(this,arguments)}g.mexFetchAllNewsletters=j;g.handleMexGetAllNewsletters=a}),98); __d("WAWebMexFetchNewsletterDehydratedJobQuery.graphql",[],(function(a,b,c,d,e,f){"use strict";a=function(){var a={defaultValue:null,kind:"LocalArgument",name:"fetch_wamo_sub"},b={defaultValue:null,kind:"LocalArgument",name:"input"},c=[{alias:null,args:[{kind:"Variable",name:"input",variableName:"input"}],concreteType:"XWA2Newsletter",kind:"LinkedField",name:"xwa2_newsletter",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,concreteType:"XWA2NewsletterThreadMetadata",kind:"LinkedField",name:"thread_metadata",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"subscribers_count",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"verification",storageKey:null},{alias:null,args:null,concreteType:"XWA2NewsletterThreadSettings",kind:"LinkedField",name:"settings",plural:!1,selections:[{alias:null,args:null,concreteType:"XWA2NewsletterReactionCodesSetting",kind:"LinkedField",name:"reaction_codes",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null}],storageKey:null}],storageKey:null},{condition:"fetch_wamo_sub",kind:"Condition",passingValue:!0,selections:[{alias:null,args:null,concreteType:"XWA2NewsletterWamoSubMetadata",kind:"LinkedField",name:"wamo_sub",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"plan_id",storageKey:null}],storageKey:null}]}],storageKey:null},{condition:"fetch_wamo_sub",kind:"Condition",passingValue:!0,selections:[{alias:null,args:null,concreteType:"XWA2NewsletterViewerMetadata",kind:"LinkedField",name:"viewer_metadata",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"wamo_sub_status",storageKey:null}],storageKey:null}]}],storageKey:null}];return{fragment:{argumentDefinitions:[a,b],kind:"Fragment",metadata:null,name:"WAWebMexFetchNewsletterDehydratedJobQuery",selections:c,type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[b,a],kind:"Operation",name:"WAWebMexFetchNewsletterDehydratedJobQuery",selections:c},params:{id:"8688194357969491",metadata:{},name:"WAWebMexFetchNewsletterDehydratedJobQuery",operationKind:"query",text:null}}}();e.exports=a}),null); __d("WAWebMexFetchNewsletterDehydratedJob",["WALogger","WAWebMexClient","WAWebMexFetchNewsletterDehydratedJobQuery.graphql","WAWebWid","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[MEX][NEWSLETTER] fetched verification, subscribers count and wamo sub for ",""]);i=function(){return a};return a}function a(a,b,c){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e,f){var g=h!==void 0?h:h=b("WAWebMexFetchNewsletterDehydratedJobQuery.graphql"),j=c("WAWebWid").isNewsletter(a)?"JID":"INVITE";j={input:{key:a,type:j,view_role:e},fetch_wamo_sub:f.fetchWamoSub===!0};e=(yield d("WAWebMexClient").fetchQuery(g,j));d("WALogger").LOG(i(),a).tags("GQL","MEX").devConsole({response:e});return e});return j.apply(this,arguments)}g.mexGetNewsletterDehydrated=a}),98); __d("WAWebMexFetchNewsletterJobQuery.graphql",[],(function(a,b,c,d,e,f){"use strict";a=function(){var a={defaultValue:null,kind:"LocalArgument",name:"fetch_creation_time"},b={defaultValue:null,kind:"LocalArgument",name:"fetch_full_image"},c={defaultValue:null,kind:"LocalArgument",name:"fetch_viewer_metadata"},d={defaultValue:null,kind:"LocalArgument",name:"fetch_wamo_sub"},e={defaultValue:null,kind:"LocalArgument",name:"input"},f={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},g={alias:null,args:null,kind:"ScalarField",name:"type",storageKey:null},h=[f,{alias:null,args:null,kind:"ScalarField",name:"text",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"update_time",storageKey:null}],i=[f,g,{alias:null,args:null,kind:"ScalarField",name:"direct_path",storageKey:null}];f=[{alias:null,args:[{kind:"Variable",name:"input",variableName:"input"}],concreteType:"XWA2Newsletter",kind:"LinkedField",name:"xwa2_newsletter",plural:!1,selections:[f,{alias:null,args:null,concreteType:"XWA2NewsletterState",kind:"LinkedField",name:"state",plural:!1,selections:[g],storageKey:null},{alias:null,args:null,concreteType:"XWA2NewsletterThreadMetadata",kind:"LinkedField",name:"thread_metadata",plural:!1,selections:[{condition:"fetch_creation_time",kind:"Condition",passingValue:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"creation_time",storageKey:null}]},{alias:null,args:null,concreteType:"XWA2NewsletterName",kind:"LinkedField",name:"name",plural:!1,selections:h,storageKey:null},{condition:"fetch_full_image",kind:"Condition",passingValue:!0,selections:[{alias:null,args:[{kind:"Literal",name:"type",value:"IMAGE"}],concreteType:"XWA2Picture",kind:"LinkedField",name:"picture",plural:!1,selections:i,storageKey:'picture(type:"IMAGE")'}]},{alias:"preview",args:[{kind:"Literal",name:"type",value:"PREVIEW"}],concreteType:"XWA2Picture",kind:"LinkedField",name:"picture",plural:!1,selections:i,storageKey:'picture(type:"PREVIEW")'},{alias:null,args:null,concreteType:"XWA2NewsletterDescription",kind:"LinkedField",name:"description",plural:!1,selections:h,storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"invite",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"handle",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"subscribers_count",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"verification",storageKey:null},{alias:null,args:null,concreteType:"XWA2NewsletterThreadSettings",kind:"LinkedField",name:"settings",plural:!1,selections:[{alias:null,args:null,concreteType:"XWA2NewsletterReactionCodesSetting",kind:"LinkedField",name:"reaction_codes",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null}],storageKey:null}],storageKey:null},{condition:"fetch_wamo_sub",kind:"Condition",passingValue:!0,selections:[{alias:null,args:null,concreteType:"XWA2NewsletterWamoSubMetadata",kind:"LinkedField",name:"wamo_sub",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"plan_id",storageKey:null}],storageKey:null}]}],storageKey:null},{condition:"fetch_viewer_metadata",kind:"Condition",passingValue:!0,selections:[{alias:null,args:null,concreteType:"XWA2NewsletterViewerMetadata",kind:"LinkedField",name:"viewer_metadata",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"mute",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"role",storageKey:null},{condition:"fetch_wamo_sub",kind:"Condition",passingValue:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"wamo_sub_status",storageKey:null}]}],storageKey:null}]}],storageKey:null}];return{fragment:{argumentDefinitions:[a,b,c,d,e],kind:"Fragment",metadata:null,name:"WAWebMexFetchNewsletterJobQuery",selections:f,type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[e,c,b,a,d],kind:"Operation",name:"WAWebMexFetchNewsletterJobQuery",selections:f},params:{id:"28415961998003187",metadata:{},name:"WAWebMexFetchNewsletterJobQuery",operationKind:"query",text:null}}}();e.exports=a}),null); __d("WAWebMexFetchNewsletterJob",["WALogger","WAWebMexClient","WAWebMexFetchNewsletterJobQuery.graphql","WAWebWid","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[MEX][NEWSLETTER] fetched get newsletter job for ",""]);i=function(){return a};return a}function a(a,b,c){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e,f){var g=h!==void 0?h:h=b("WAWebMexFetchNewsletterJobQuery.graphql"),j=c("WAWebWid").isNewsletter(a)?"JID":"INVITE",k=j!=="INVITE";j={input:{key:a,type:j,view_role:e},fetch_viewer_metadata:f.fetchViewerMetadata,fetch_full_image:k,fetch_creation_time:f.fetchCreationTime===!0,fetch_wamo_sub:f.fetchWamoSub===!0};e=(yield d("WAWebMexClient").fetchQuery(g,j));d("WALogger").LOG(i(),a).tags("GQL","MEX").devConsole({response:e});return e});return j.apply(this,arguments)}g.mexGetNewsletter=a}),98); __d("WAWebMexNewsletterUtils",["WAJids","WAWebBackendErrors","WAWebCommonNewsletterEnums","WAWebMexFetchNewsletterDehydratedJob","WAWebMexFetchNewsletterJob","WAWebMexNewsletterParseUtils","WAWebNewsletterGatingUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b,c,e;b=(b=a.queryPayloadsArgs.jidQueryIQPayload)==null?void 0:b.anyJid;c=(c=a.queryPayloadsArgs.inviteQueryIQPayload)==null?void 0:c.anyKey;e=(e=(e=a.queryPayloadsArgs.jidQueryIQPayload)==null?void 0:e.anyViewRole)!=null?e:(e=a.queryPayloadsArgs.inviteQueryIQPayload)==null?void 0:e.anyViewRole;b=b!=null?b:c;if(b!=null){l(a)?c=(yield d("WAWebMexFetchNewsletterDehydratedJob").mexGetNewsletterDehydrated(b,i(e),{fetchWamoSub:d("WAWebNewsletterGatingUtils").isWamoSubExperienceEnabled()})):c=(yield d("WAWebMexFetchNewsletterJob").mexGetNewsletter(b,i(e),{fetchViewerMetadata:j(a),fetchCreationTime:k("hasNewsletterCreationTimeField",a),fetchWamoSub:d("WAWebNewsletterGatingUtils").isWamoSubExperienceEnabled()}));if(c==null)return;b=d("WAWebMexNewsletterParseUtils").parseMexNewsletterResponse(c.xwa2_newsletter);return b}});return h.apply(this,arguments)}function i(a){if(a==null)return"GUEST";switch(a){case"admin":return"ADMIN";case"owner":return"OWNER";case"subscriber":return"SUBSCRIBER";default:return"GUEST"}}function c(a){switch(a){case"OWNER":return d("WAWebCommonNewsletterEnums").NewsletterMembershipType.Owner;case"SUBSCRIBER":return d("WAWebCommonNewsletterEnums").NewsletterMembershipType.Subscriber;case"ADMIN":return d("WAWebCommonNewsletterEnums").NewsletterMembershipType.Admin;case"GUEST":return d("WAWebCommonNewsletterEnums").NewsletterMembershipType.Guest}}function e(a){switch(a){case d("WAWebCommonNewsletterEnums").NewsletterReactionCodesSetting.All:return"ALL";case d("WAWebCommonNewsletterEnums").NewsletterReactionCodesSetting.Basic:return"BASIC";case d("WAWebCommonNewsletterEnums").NewsletterReactionCodesSetting.None:return"NONE";case d("WAWebCommonNewsletterEnums").NewsletterReactionCodesSetting.Blocklist:return"BLOCKLIST"}}function f(a){if(a!=null&&a.id!=null){var b,c,e;((b=a.state)==null?void 0:b.type)==="SUSPENDED"&&(e={error:"423"});((b=a.state)==null?void 0:b.type)==="NON_EXISTING"&&(c={error:"404"});return{jid:d("WAJids").toNewsletterJid(a.id),subscriberNotFoundMixin:c,newsletterSuspendedErrorMixin:e}}throw new(d("WAWebBackendErrors").ServerStatusCodeError)(500,"unexpected_mex_mutation_response")}function j(a){var b,c;b=(b=a.queryPayloadsArgs.jidQueryIQPayload)==null?void 0:(b=b.allNewsletterMetadataIQRequestPayloadMixinArgs)==null?void 0:b.hasNewsletterMutedField;if(b===!0)return!0;b=(c=a.queryPayloadsArgs.deprecatedInviteQueryIQPayload)==null?void 0:(c=c.allNewsletterMetadataIQRequestPayloadMixinArgs)==null?void 0:c.hasNewsletterMutedField;if(b===!0)return!0;c=(c=a.queryPayloadsArgs.jidQueryIQPayload)==null?void 0:(b=c.allNewsletterMetadataIQRequestPayloadMixinArgs)==null?void 0:b.hasNewsletterMembershipField;if(c===!0)return!0;c=(b=a.queryPayloadsArgs.deprecatedInviteQueryIQPayload)==null?void 0:(a=b.allNewsletterMetadataIQRequestPayloadMixinArgs)==null?void 0:a.hasNewsletterMembershipField;return c===!0?!0:!1}function k(a,b){var c;c=(c=(c=b.queryPayloadsArgs.jidQueryIQPayload)==null?void 0:c.allNewsletterMetadataIQRequestPayloadMixinArgs)!=null?c:b.queryPayloadsArgs.inviteQueryIQPayload;return c==null||((b=Object.getOwnPropertyDescriptor(c,a))==null?void 0:b.value)===!0}function l(a){a=a.queryPayloadsArgs.jidQueryIQPayload;if(a!=null){a=a.allNewsletterMetadataIQRequestPayloadMixinArgs;return a.hasNewsletterCreationTimeField!==!0&&a.hasNewsletterNameField!==!0&&a.hasNewsletterDescriptionField!==!0&&a.hasNewsletterInviteLinkField!==!0&&a.hasNewsletterHandleField!==!0&&a.hasNewsletterPrivacyField!==!0&&a.hasNewsletterLinkedAccountsField!==!0&&a.hasNewsletterStateField!==!0&&a.newsletterPictureFieldMixinArgs==null&&a.hasNewsletterMembershipField!==!0&&a.hasNewsletterMutedField!==!0&&a.hasNewsletterVerificationField===!0&&a.hasNewsletterSubscribersField===!0}return!1}g.handleMexGetNewsletter=a;g.mapRoleToMembership=c;g.mapReactionCodesSettingToMexInput=e;g.convertMutationResponse=f}),98); __d("WAWebMexUpdateNewsletterJobMutation.graphql",[],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"newsletter_id"},{defaultValue:null,kind:"LocalArgument",name:"updates"}],b={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},c={alias:null,args:null,kind:"ScalarField",name:"type",storageKey:null},d=[b,{alias:null,args:null,kind:"ScalarField",name:"text",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"update_time",storageKey:null}],e=[b,c,{alias:null,args:null,kind:"ScalarField",name:"direct_path",storageKey:null}];b=[{alias:null,args:[{kind:"Variable",name:"newsletter_id",variableName:"newsletter_id"},{kind:"Variable",name:"updates",variableName:"updates"}],concreteType:"XWA2Newsletter",kind:"LinkedField",name:"xwa2_newsletter_update",plural:!1,selections:[b,{alias:null,args:null,concreteType:"XWA2NewsletterState",kind:"LinkedField",name:"state",plural:!1,selections:[c],storageKey:null},{alias:null,args:null,concreteType:"XWA2NewsletterThreadMetadata",kind:"LinkedField",name:"thread_metadata",plural:!1,selections:[{alias:null,args:null,concreteType:"XWA2NewsletterName",kind:"LinkedField",name:"name",plural:!1,selections:d,storageKey:null},{alias:null,args:null,concreteType:"XWA2NewsletterDescription",kind:"LinkedField",name:"description",plural:!1,selections:d,storageKey:null},{alias:null,args:[{kind:"Literal",name:"type",value:"IMAGE"}],concreteType:"XWA2Picture",kind:"LinkedField",name:"picture",plural:!1,selections:e,storageKey:'picture(type:"IMAGE")'},{alias:"preview",args:[{kind:"Literal",name:"type",value:"PREVIEW"}],concreteType:"XWA2Picture",kind:"LinkedField",name:"picture",plural:!1,selections:e,storageKey:'picture(type:"PREVIEW")'},{alias:null,args:null,kind:"ScalarField",name:"invite",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"handle",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"verification",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"creation_time",storageKey:null},{alias:null,args:null,concreteType:"XWA2NewsletterThreadSettings",kind:"LinkedField",name:"settings",plural:!1,selections:[{alias:null,args:null,concreteType:"XWA2NewsletterReactionCodesSetting",kind:"LinkedField",name:"reaction_codes",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"WAWebMexUpdateNewsletterJobMutation",selections:b,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"WAWebMexUpdateNewsletterJobMutation",selections:b},params:{id:"7150902998257522",metadata:{},name:"WAWebMexUpdateNewsletterJobMutation",operationKind:"mutation",text:null}}}();e.exports=a}),null); __d("WAWebMexUpdateNewsletterJob",["WALogger","WAWebMexClient","WAWebMexNewsletterUtils","WAWebMexUpdateNewsletterJobMutation.graphql","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[MEX][NEWSLETTER] newsletter updated via mex"]);i=function(){return a};return a}function a(a,b,c,d,e){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e,f,g){var j=h!==void 0?h:h=b("WAWebMexUpdateNewsletterJobMutation.graphql");a={newsletter_id:a,updates:{name:c,description:e,picture:f,settings:g!=null?{reaction_codes:{value:d("WAWebMexNewsletterUtils").mapReactionCodesSettingToMexInput(g)}}:null}};c=(yield d("WAWebMexClient").fetchQuery(j,a));d("WALogger").DEV(i()).tags("GQL","MEX").devConsole({response:c});return c});return j.apply(this,arguments)}g.mexUpdateNewsletter=a}),98); __d("WAWebNewsletterMetadataQueryJob",["WABase64","WAWebMexFetchAllNewslettersMetadataJob","WAWebMexNewsletterParseUtils","WAWebMexNewsletterUtils","WAWebMexUpdateNewsletterJob","WAWebNewsletterQueryUtils","WAWebNewsletterRpcUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(){var a=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){return d("WAWebMexFetchAllNewslettersMetadataJob").handleMexGetAllNewsletters()});return function(){return a.apply(this,arguments)}}();return d("WAWebNewsletterRpcUtils").runWithBackoff(a)}function c(a,b){var c=d("WAWebNewsletterQueryUtils").getNewsletterMetadataQueryParamArgs(a,b,{creationTime:!0,name:!0,picture:!0,description:!0,inviteLink:!0,handle:!0,subscribers:!0,privacy:!0,verification:!0,linkedAccounts:!0,state:!0});return d("WAWebNewsletterRpcUtils").runWithBackoff(function(){return h(c)})}function e(a,b,c){var e=d("WAWebNewsletterQueryUtils").getNewsletterMetadataQueryParamArgs(a,b,c);return d("WAWebNewsletterRpcUtils").runWithBackoff(function(){return h(e)})}function h(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){return d("WAWebMexNewsletterUtils").handleMexGetNewsletter(a)});return i.apply(this,arguments)}function f(a,b,c){return k(a,b,c)}function j(a){return{idJid:a,newsletterMutedMetadataMixin:null,newsletterCreationTimeMetadataMixin:null,newsletterNameMetadataMixin:null,newsletterPictureMetadataMixin:null,newsletterDescriptionMetadataMixin:null,newsletterInviteLinkMetadataMixin:null,newsletterSubscribersMetadataMixin:null,newsletterPrivacyMetadataMixin:null,newsletterVerificationMetadataMixin:null,hasNewsletterLinkedAccountsMetadataMixin:!1,newsletterMembershipMetadataMixin:null,newsletterStateMetadataMixin:null}}function k(a,b,c){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){var e=b.editName,f=b.editDescription,g=b.editPicture;b=b.editReactionCodesSetting;var h=c.name,i=c.description,j=c.picture;c=c.reactionCodesSetting;var k;j!=null&&(k=d("WABase64").encodeB64(j));var l=m(g,k),n=m(e,h),o=m(f,i),p=b===!0?c:null;j=(yield d("WAWebNewsletterRpcUtils").runWithBackoff(function(){return d("WAWebMexUpdateNewsletterJob").mexUpdateNewsletter(a,n,o,l,p)}));return d("WAWebMexNewsletterParseUtils").parseMexNewsletterResponse(j.xwa2_newsletter_update)});return l.apply(this,arguments)}function m(a,b){if(a===!0)return b!=null?b:""}g.queryAllNewslettersMetadata=a;g.queryNewsletterMetadataByInviteCode=c;g.queryNewsletterMetadataByJid=e;g.editNewsletterMetadataQuery=f;g.emptyNewsletterMetadataType=j}),98); __d("WAWebMexNewsletterMutedChangeHandler",["WAJids","WALogger","WAWebBackendApi","WAWebCreateChat","WAWebNewsletterMetadataQueryJob","WAWebNewsletterModelUtils","WAWebNewsletterUpdateNewslettersRecordsJob","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[mex][newsletter][notification][mute-unmute]"]);h=function(){return a};return a}function a(a,b){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=b.xwa2_notify_newsletter_on_mute_change;b=a.id;a=a.mute;if(b==null)throw c("err")("unexpected null id in xwa2_notify_newsletter_on_mute_change");var e;switch(a){case"ON":e="on";break;case"OFF":e="off";break;default:e="undefined"}a=d("WAWebNewsletterMetadataQueryJob").emptyNewsletterMetadataType(d("WAJids").toNewsletterJid(b));b=babelHelpers["extends"]({},a,{newsletterMutedMetadataMixin:{mutedState:e}});a=d("WAWebNewsletterModelUtils").mapNewsletterToModels(b);b=a.chat;var f=a.metadata;a=a.pic;try{yield d("WAWebNewsletterUpdateNewslettersRecordsJob").updateNewsletterChatRecords([d("WAWebCreateChat").createNewsletterObjectForStorage(b)]),yield d("WAWebBackendApi").frontendSendAndReceive("updateNewsletterMetadata",{metadata:f,newsletter:b,pic:a})}catch(a){d("WALogger").ERROR(h()).tags("mex","newsletter").devConsole(a).sendLogs("mex-newsletter-notification-mute-unmute-fail")}});return i.apply(this,arguments)}g.mexHandleNewsletterMutedChange=a}),98); __d("WAWebTimedCache",["WALogger","WATimeUtils","WAWebApiHydrateWidsUtil","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Failed to remove cache value"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Failed to set cache value"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Failed to get cache value"]);j=function(){return a};return a}function k(a,b){if(a==null)return null;var c=d("WATimeUtils").unixTimeMs(),e=a.timestamp;a=a.value;c=c-e;return c<b?a:null}function l(a){return{timestamp:d("WATimeUtils").unixTimeMs(),value:a}}a=function(){function a(a){var b=a.mapLoad,c=a.mapStore;a=a.getCacheTtlMs;this.$1=b;this.$2=c;this.$3=a}var c=a.prototype;c.get=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){try{var b=this.$1();a=(a=JSON.stringify(a))!=null?a:"";b=b==null?void 0:b.get(a);a=d("WAWebApiHydrateWidsUtil").hydrateWids(b);return k(a,this.$3())}catch(a){d("WALogger").ERROR(j()).tags("newsletter").devConsole(a).sendLogs("[TimedMapCache] Failed to get value from cache");return null}});function c(b){return a.apply(this,arguments)}return c}();c.set=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){try{var c;c=(c=this.$1())!=null?c:new Map();a=(a=JSON.stringify(a))!=null?a:"";b=l(b);c==null?void 0:c.set(a,b);yield this.$2(c)}catch(a){d("WALogger").ERROR(i()).tags("newsletter").devConsole(a).sendLogs("[TimedMapCache] Failed to set value in cache");return}});function c(b,c){return a.apply(this,arguments)}return c}();c.remove=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){try{var b=this.$1();if(b==null)return;a=(a=JSON.stringify(a))!=null?a:"";b==null?void 0:b["delete"](a);yield this.$2(b)}catch(a){d("WALogger").ERROR(h()).tags("newsletter").devConsole(a).sendLogs("[TimedMapCache] Failed to remove value from cache");return}});function c(b){return a.apply(this,arguments)}return c}();return a}();g.getTimedCacheItemValue=k;g.createTimedCacheItem=l;g.TimedMapCache=a}),98); __d("WAWebUserPrefsNewsletter",["$InternalEnum","WAWebNewsletterGatingUtils","WAWebTimedCache","WAWebUserPrefsIndexedDBStorage","WAWebUserPrefsKeys","WAWebUserPrefsStore","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(){var a=c("WAWebUserPrefsStore").get(d("WAWebUserPrefsKeys").MD_KEYS.NEWSLETTER_TAB_LAST_SEEN_TIMESTAMP);a=typeof a==="number"?a:0;return a}function e(a){c("WAWebUserPrefsStore").set(d("WAWebUserPrefsKeys").MD_KEYS.NEWSLETTER_TAB_LAST_SEEN_TIMESTAMP,a)}function f(){var a=d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.get(d("WAWebUserPrefsKeys").KEYS.WA_WEB_CACHED_RECOMMENDED_NEWSLETTERS);return d("WAWebTimedCache").getTimedCacheItemValue(a,d("WAWebNewsletterGatingUtils").getRecommendedNewslettersRefreshInterval())}function h(a){a=d("WAWebTimedCache").createTimedCacheItem(a);return d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.set(d("WAWebUserPrefsKeys").KEYS.WA_WEB_CACHED_RECOMMENDED_NEWSLETTERS,a)}var i=b("$InternalEnum").Mirrored(["FULL","LIMITED"]),j=new(d("WAWebTimedCache").TimedMapCache)({mapLoad:function(){return d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.get(d("WAWebUserPrefsKeys").KEYS.WA_WEB_CACHED_NEWSLETTERS_SUBSCRIBERS)},mapStore:function(a){return d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.set(d("WAWebUserPrefsKeys").KEYS.WA_WEB_CACHED_NEWSLETTERS_SUBSCRIBERS,a)},getCacheTtlMs:d("WAWebNewsletterGatingUtils").getNewsletterSubscriberListCacheRefreshMs});function k(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b={view:i.LIMITED,newsletterJid:a};a={view:i.FULL,newsletterJid:a};yield j.remove(b);yield j.remove(a)});return l.apply(this,arguments)}var m=new(d("WAWebTimedCache").TimedMapCache)({mapLoad:function(){return d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.get(d("WAWebUserPrefsKeys").KEYS.WA_WEB_CACHED_NEWSLETTER_DIRECTORY_PAGES)},mapStore:function(a){return d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.set(d("WAWebUserPrefsKeys").KEYS.WA_WEB_CACHED_NEWSLETTER_DIRECTORY_PAGES,a)},getCacheTtlMs:d("WAWebNewsletterGatingUtils").getNewsletterDirectoryPageRefreshInterval}),n=new(d("WAWebTimedCache").TimedMapCache)({mapLoad:function(){return d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.get(d("WAWebUserPrefsKeys").KEYS.WA_WEB_CACHED_NEWSLETTER_DIRECTORY_CATERGORY_PREVIEW)},mapStore:function(a){return d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.set(d("WAWebUserPrefsKeys").KEYS.WA_WEB_CACHED_NEWSLETTER_DIRECTORY_CATERGORY_PREVIEW,a)},getCacheTtlMs:d("WAWebNewsletterGatingUtils").getNewsletterDirectoryCategoriesPreviewRefreshIntervalMs});g.getNewsletterTabLastSeenTimestamp=a;g.setNewsletterTabLastSeenTimestamp=e;g.getCachedRecommendedNewsletters=f;g.setCachedRecommendedNewsletters=h;g.ValidCachedNewsletterSubscriberKeys=i;g.NewsletterSubscribersCache=j;g.flushCachedNewsletterSubscribers=k;g.NewsletterDirectoryPageCache=m;g.NewsletterDirectoryCategoriesPreviewCache=n}),98); __d("WAWebMexNewsletterRoleChangeNotificationHandler",["WALogger","WAWebBackendApi","WAWebMexNewsletterUtils","WAWebNewsletterMetadataJob","WAWebNewsletterStorageUtils","WAWebNewsletterValidationUtils","WAWebUserPrefsMeUser","WAWebUserPrefsNewsletter","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[mex][newsletter][notification][admin-","] Failed to process "," notification, error parsing jid"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[mex][newsletter][notification][admin-","] Failed to process "," notification, null payload"]);i=function(){return a};return a}function a(a,b){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c;a=b.xwa2_notify_newsletter_admin_promote!=null?"promote":"demote";c=(c=b.xwa2_notify_newsletter_admin_promote)!=null?c:b.xwa2_notify_newsletter_admin_demote;if(c==null){d("WALogger").ERROR(i(),a,a).tags("mex","newsletter").sendLogs("mex-newsletternotification-state-change-fail");return}try{var e=d("WAWebNewsletterValidationUtils").toNewsletterJidOrThrow(c.id),f=c.user.pn;if(f==null)return;f=d("WAWebWidFactory").createWid(f);c=d("WAWebMexNewsletterUtils").mapRoleToMembership(c.user_new_role);if(c==null)return;f.equals(d("WAWebUserPrefsMeUser").getMeUser())?(yield d("WAWebNewsletterMetadataJob").updateNewsletterMetadata({id:e,membershipType:d("WAWebNewsletterStorageUtils").mapNewsletterMembershipTypeForStorage(c)}),d("WAWebBackendApi").frontendFireAndForget("handleMyRoleChangeNotification",{jid:e})):f.equals(d("WAWebUserPrefsMeUser").getMeUser())||d("WAWebBackendApi").frontendFireAndForget("handleOtherUserRoleChangeNotification",{jid:e,userId:f,newRole:c});yield d("WAWebUserPrefsNewsletter").flushCachedNewsletterSubscribers(e);d("WAWebBackendApi").frontendFireAndForget("displayRoleChangeDesktopNotification",{notification:b})}catch(b){d("WALogger").ERROR(h(),a,a).tags("mex","newsletter").devConsole(b).sendLogs("mex-newsletternotification-state-change-fail-"+a)}});return j.apply(this,arguments)}g.mexHandleNewsletterRoleChange=a}),98); __d("WAWebMexNewsletterStateChangeHandler",["WAJids","WALogger","WAWebApiChat","WAWebBackendApi","WAWebJidToWid","WAWebNewsletterBackendQueues","WAWebNewsletterDeleteChatJob","WAWebNewsletterMetadataJob","WAWebNewsletterMetadataQueryJob","WAWebNewsletterModelUtils","WAWebNewsletterStorageUtils","WAWebNewsletterSystemMessages","WAWebNewsletterUpdateMsgsRecordsJob","WAWebNux","WAWebUserPrefsNuxPreferences","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[mex][newsletter][notification][state-change] Failed to update to "," state"]);h=function(){return a};return a}function i(a){switch(a){case"ACTIVE":return"active";case"SUSPENDED":return"suspended";case"GEOSUSPENDED":return"geosuspended"}}function a(a,b){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){yield d("WAWebNewsletterBackendQueues").newsletterJoinNotificationQueue.wait();a=b.xwa2_notify_newsletter_on_state_change;b=a.id;var e=a.is_requestor;a=a.state;if(b==null)throw c("err")("unexpected null id in xwa2_notify_newsletter_on_state_change");b=d("WAJids").toNewsletterJid(b);var f=d("WAWebJidToWid").newsletterJidToWid(b);e=e===!0;a=a==null?void 0:a.type;var g=(yield d("WAWebApiChat").getChatRecord(f));if(g==null)return;try{switch(a){case"DELETED":yield d("WAWebNewsletterBackendQueues").newsletterDeleteQueue.wait();return yield k(e,b,f,g.name);case"ACTIVE":case"SUSPENDED":case"GEOSUSPENDED":e=i(a);f=d("WAWebNewsletterMetadataQueryJob").emptyNewsletterMetadataType(b);g=babelHelpers["extends"]({},f,{newsletterStateMetadataMixin:{stateType:e}});b=d("WAWebNewsletterModelUtils").mapNewsletterToModels(g);f=b.chat;e=b.metadata;g=b.pic;yield d("WAWebNewsletterMetadataJob").updateNewsletterMetadata(d("WAWebNewsletterStorageUtils").createNewsletterMetadataObjectForStorage(e));if(e.suspended===!0){b=d("WAWebNux").getNewsletterAlertsBannerNuxKey(e.id.toString());d("WAWebUserPrefsNuxPreferences").resetNux(b)}yield d("WAWebBackendApi").frontendSendAndReceive("updateNewsletterMetadata",{metadata:e,newsletter:f,pic:g});break;default:b=a==null?"null or undefined":a;throw c("err")("Unexpected state change type: "+b)}}catch(b){d("WALogger").ERROR(h(),a).tags("mex","newsletter").devConsole(b).sendLogs("mex-newsletternotification-state-change-fail")}});return j.apply(this,arguments)}function k(a,b,c,d){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,d){return a?m(b,c):o(b,c,d)});return l.apply(this,arguments)}function m(a,b){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){yield d("WAWebNewsletterMetadataJob").deleteNewsletterMetadata(a.toString()),yield d("WAWebNewsletterDeleteChatJob").deleteNewsletterChat(b),yield d("WAWebNewsletterMetadataJob").deleteNewsletterPicture(a.toString()),yield d("WAWebBackendApi").frontendSendAndReceive("deleteNewsletter",{id:b,keep:!0})});return n.apply(this,arguments)}function o(a,b,c){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){c=d("WAWebNewsletterSystemMessages").genNewsletterDeletionSystemMessages({id:a,name:c});yield d("WAWebNewsletterMetadataJob").updateNewsletterMetadata({id:a,terminated:!0});yield d("WAWebNewsletterUpdateMsgsRecordsJob").addNewsletterMsgsRecords(c);yield d("WAWebBackendApi").frontendSendAndReceive("terminateNewsletter",{id:b,msgs:c})});return p.apply(this,arguments)}g.mexHandleNewsletterStateChange=a}),98); __d("WAWebMexNewsletterWamoSubStatusChangeNotificationHandler",["WAJids","WALogger","WAWebApiChat","WAWebBackendApi","WAWebCommonNewsletterEnums","WAWebJidToWid","WAWebNewsletterMetadataJob","WAWebNewsletterStorageUtils","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[mex][newsletter][notification][wamo-sub-status-change] Failed to handle "," Wamo Sub status change"]);h=function(){return a};return a}function a(a,b){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=b.xwa2_notify_newsletter_on_wamo_sub_status_change;b=a.newsletter_id;a=a.wamo_sub_event;if(b==null)throw c("err")("unexpected null newsletter_id in xwa2_notify_newsletter_on_wamo_sub_status_change");b=d("WAJids").toNewsletterJid(b);var e=d("WAWebJidToWid").newsletterJidToWid(b);e=(yield d("WAWebApiChat").getChatRecord(e));if(e==null)return;try{var f;switch(a){case"SUBSCRIPTION_CREATED":f=d("WAWebCommonNewsletterEnums").WamoSubStatus.ACTIVE;break;case"SUBSCRIPTION_PAUSED":case"SUBSCRIPTION_ON_HOLD":case"SUBSCRIPTION_EXPIRED":f=d("WAWebCommonNewsletterEnums").WamoSubStatus.INACTIVE;break;case"SUBSCRIPTION_CANCELLED":case"SUBSCRIPTION_IN_GRACE_PERIOD":case"SUBSCRIPTION_PENDING_REVOKE":case"SUBSCRIPTION_RENEWED":case"SUBSCRIPTION_TO_RENEW_SOON":case"SUBSCRIPTION_XGRADE":break;default:e=a==null?"null or undefined":a;throw c("err")("Unexpected Wamo Sub event: "+e)}if(f==null)return;yield d("WAWebNewsletterMetadataJob").updateNewsletterMetadata({id:b,wamoSubStatus:d("WAWebNewsletterStorageUtils").mapNewsletterWamoSubStatusForStorage(f)});d("WAWebBackendApi").frontendFireAndForget("handleNewsletterWamoSubStatusChangeNotification",{jid:b,wamoSubStatus:f})}catch(b){d("WALogger").ERROR(h(),a).tags("mex","newsletter").devConsole(b).sendLogs("mex-newsletter-notification-wamo-sub-status-change-fail")}});return i.apply(this,arguments)}g.mexHandleNewsletterWamoSubStatusChange=a}),98); __d("WAWebMexFetchNewsletterEnforcementsJobQuery.graphql",[],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"newsletter_id"}],b=[{kind:"Variable",name:"channel_id",variableName:"newsletter_id"}],c={alias:null,args:null,kind:"ScalarField",name:"enforcement_creation_time",storageKey:null},d={alias:null,args:null,kind:"ScalarField",name:"appeal_creation_time",storageKey:null},e={alias:null,args:null,kind:"ScalarField",name:"appeal_state",storageKey:null},f={alias:null,args:null,kind:"ScalarField",name:"enforcement_violation_category",storageKey:null},g={alias:null,args:null,kind:"ScalarField",name:"enforcement_source",storageKey:null},h={alias:null,args:null,kind:"ScalarField",name:"enforcement_id",storageKey:null},i={kind:"RequiredField",field:h,action:"THROW"},j={alias:null,args:null,kind:"ScalarField",name:"appeal_form_url",storageKey:null},k={alias:null,args:null,concreteType:"XWA2IPViolationReportData",kind:"LinkedField",name:"ip_violation_report_data",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"report_fbid",storageKey:null},j,{alias:null,args:null,kind:"ScalarField",name:"reporter_email",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"reporter_name",storageKey:null}],storageKey:null},l={alias:null,args:null,concreteType:"XWA2EnforcementExtraData",kind:"LinkedField",name:"enforcement_extra_data",plural:!1,selections:[k],storageKey:null},m={alias:null,args:null,kind:"ScalarField",name:"server_msg_id",storageKey:null},n={kind:"InlineFragment",selections:[m],type:"XWA2ChannelServerMsgData",abstractKey:null},o={alias:null,args:null,concreteType:null,kind:"LinkedField",name:"enforcement_target_data",plural:!1,selections:[n],storageKey:null};j={alias:null,args:null,concreteType:"XWA2AppealExtraData",kind:"LinkedField",name:"appeal_extra_data",plural:!1,selections:[j],storageKey:null};var p={alias:null,args:null,concreteType:"XWA2EnforcingEntityData",kind:"LinkedField",name:"enforcing_entity_data",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null}],storageKey:null},q={alias:null,args:null,kind:"ScalarField",name:"enforcement_origin_workflow",storageKey:null},r={alias:null,args:null,kind:"ScalarField",name:"enforcement_origin_legal_basis",storageKey:null},s={alias:null,args:null,kind:"ScalarField",name:"country_code",storageKey:null},t={alias:null,args:null,kind:"ScalarField",name:"country_codes",storageKey:null};n={alias:null,args:null,concreteType:null,kind:"LinkedField",name:"enforcement_target_data",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},n],storageKey:null};return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"WAWebMexFetchNewsletterEnforcementsJobQuery",selections:[{alias:null,args:b,concreteType:"XWA2ChannelEnforcementsResponse",kind:"LinkedField",name:"xwa2_channel_enforcements",plural:!1,selections:[{alias:null,args:null,concreteType:"XWA2BaseEnforcementData",kind:"LinkedField",name:"profile_picture_deletions",plural:!0,selections:[c,d,e,f,g,i,l],storageKey:null},{alias:null,args:null,concreteType:"XWA2BaseEnforcementData",kind:"LinkedField",name:"suspensions",plural:!0,selections:[d,c,e,f,i,g,{alias:null,args:null,concreteType:"XWA2EnforcementExtraData",kind:"LinkedField",name:"enforcement_extra_data",plural:!1,selections:[k,o,j],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XWA2ViolatingMessagesEnforcementData",kind:"LinkedField",name:"violating_messages",plural:!0,selections:[{alias:null,args:null,concreteType:"XWA2BaseEnforcementData",kind:"LinkedField",name:"base_enforcement_data",plural:!1,selections:[c,d,e,i,f,g,l],storageKey:null},{kind:"RequiredField",field:m,action:"THROW"}],storageKey:null},{alias:null,args:null,concreteType:"XWA2GeosuspendedEnforcementData",kind:"LinkedField",name:"geosuspensions",plural:!0,selections:[{alias:null,args:null,concreteType:"XWA2BaseEnforcementData",kind:"LinkedField",name:"base_enforcement_data",plural:!1,selections:[{kind:"RequiredField",field:c,action:"THROW"},d,e,i,f,g,{alias:null,args:null,concreteType:"XWA2EnforcementExtraData",kind:"LinkedField",name:"enforcement_extra_data",plural:!1,selections:[k,o,j,p,q,r],storageKey:null}],storageKey:null},{kind:"RequiredField",field:s,action:"THROW"},t],storageKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"WAWebMexFetchNewsletterEnforcementsJobQuery",selections:[{alias:null,args:b,concreteType:"XWA2ChannelEnforcementsResponse",kind:"LinkedField",name:"xwa2_channel_enforcements",plural:!1,selections:[{alias:null,args:null,concreteType:"XWA2BaseEnforcementData",kind:"LinkedField",name:"profile_picture_deletions",plural:!0,selections:[c,d,e,f,g,h,l],storageKey:null},{alias:null,args:null,concreteType:"XWA2BaseEnforcementData",kind:"LinkedField",name:"suspensions",plural:!0,selections:[d,c,e,f,h,g,{alias:null,args:null,concreteType:"XWA2EnforcementExtraData",kind:"LinkedField",name:"enforcement_extra_data",plural:!1,selections:[k,n,j],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XWA2ViolatingMessagesEnforcementData",kind:"LinkedField",name:"violating_messages",plural:!0,selections:[{alias:null,args:null,concreteType:"XWA2BaseEnforcementData",kind:"LinkedField",name:"base_enforcement_data",plural:!1,selections:[c,d,e,h,f,g,l],storageKey:null},m],storageKey:null},{alias:null,args:null,concreteType:"XWA2GeosuspendedEnforcementData",kind:"LinkedField",name:"geosuspensions",plural:!0,selections:[{alias:null,args:null,concreteType:"XWA2BaseEnforcementData",kind:"LinkedField",name:"base_enforcement_data",plural:!1,selections:[c,d,e,h,f,g,{alias:null,args:null,concreteType:"XWA2EnforcementExtraData",kind:"LinkedField",name:"enforcement_extra_data",plural:!1,selections:[k,n,j,p,q,r],storageKey:null}],storageKey:null},s,t],storageKey:null}],storageKey:null}]},params:{id:"9808120992618220",metadata:{},name:"WAWebMexFetchNewsletterEnforcementsJobQuery",operationKind:"query",text:null}}}();e.exports=a}),null); __d("WAWebMexFetchNewsletterEnforcementsJob",["WALogger","WATimeUtils","WAWebCommonNewsletterEnums","WAWebCountriesUtils","WAWebLocaleModules","WAWebMexClient","WAWebMexFetchNewsletterEnforcementsJobQuery.graphql","asyncToGeneratorRuntime","filterNulls"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[MEX][NEWSLETTER][WA-ICE][DSA] MEX enforcements query returned empty response."]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[MEX][NEWSLETTER][WA-ICE][DSA] fetched all enforcements"]);j=function(){return a};return a}var k=h!==void 0?h:h=b("WAWebMexFetchNewsletterEnforcementsJobQuery.graphql");function a(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b={newsletter_id:a};b=(yield d("WAWebMexClient").fetchQuery(k,b));d("WALogger").DEV(j()).tags("GQL","MEX","wa-ice","DSA").devConsole({newsletterJid:a,response:b});a=b==null?void 0:b.xwa2_channel_enforcements;if(a==null){d("WALogger").DEV(i()).tags("GQL","MEX","wa-ice","DSA");return null}var e={profilePictureDeletions:[],suspensions:[],violatingMessages:[],geoSuspensions:[]};if(a.profile_picture_deletions!=null){var f=[];a.profile_picture_deletions.forEach(function(a){if(m(a))return;f.push(o(a,d("WAWebCommonNewsletterEnums").EnforcementType.PROFILE_PICTURE_DELETION))});e.profilePictureDeletions=f}if(a.suspensions!=null){var g=[];a.suspensions.forEach(function(a){var b;if(m(a))return;a=o(a,d("WAWebCommonNewsletterEnums").EnforcementType.SUSPEND);a.enforcementType=((b=a.enforcementExtraData)==null?void 0:(b=b.enforcementTargetData)==null?void 0:b.serverId)!=null?d("WAWebCommonNewsletterEnums").EnforcementType.SUSPEND_INFORM:d("WAWebCommonNewsletterEnums").EnforcementType.SUSPEND;g.push(a)});e.suspensions=g}if(a.violating_messages!=null){var h=[];a.violating_messages.forEach(function(a){if(m(a.base_enforcement_data))return;h.push(babelHelpers["extends"]({},o(a.base_enforcement_data,d("WAWebCommonNewsletterEnums").EnforcementType.VIOLATING_MSG),{serverId:parseInt(a.server_msg_id,10)}))});e.violatingMessages=h}var l=a.geosuspensions;if(l!=null){var n=[];yield d("WAWebLocaleModules").getCountryData().then(function(a){l.forEach(function(b){var e;if(m(b.base_enforcement_data))return;e=(e=b.country_codes)==null?void 0:e.map(function(b){var c=d("WAWebCountriesUtils").asISOCountryCode(b);b=a[b.toUpperCase()];return c!=null&&b!=null?{countryCode:c,countryName:b}:null});var f=d("WAWebCountriesUtils").asISOCountryCode(b.country_code),g=f!=null?a[f.toUpperCase()]:null;f=g!=null&&f!=null?{countryCode:f,countryName:g}:null;var h;e!=null?h=c("filterNulls")(e):f!=null&&(h=[f]);g=o(b.base_enforcement_data,d("WAWebCommonNewsletterEnums").EnforcementType.GEOSUSPEND);g.enforcementType=((e=g.enforcementExtraData)==null?void 0:(f=e.enforcementTargetData)==null?void 0:f.serverId)!=null?d("WAWebCommonNewsletterEnums").EnforcementType.GEOSUSPEND_INFORM:d("WAWebCommonNewsletterEnums").EnforcementType.GEOSUSPEND;h!=null&&((b=h)==null?void 0:b.length)>0&&n.push(babelHelpers["extends"]({},g,{countryCodes:h}))})})["finally"](function(){e.geoSuspensions=n})}return e});return l.apply(this,arguments)}function m(a){return a.appeal_creation_time==null&&a.appeal_state!=="NOT_APPEALED"&&a.appeal_state!=="NON_APPEALABLE"}function n(a){if(a==null)return null;var b=a==null?void 0:a.ip_violation_report_data,c=a==null?void 0:a.enforcement_target_data,d=a==null?void 0:a.enforcing_entity_data,e=a==null?void 0:a.appeal_extra_data,f=a==null?void 0:a.enforcement_origin_workflow;a=a==null?void 0:a.enforcement_origin_legal_basis;var g=null;b!=null&&(g={ipViolationReportData:{reportFbid:b.report_fbid,appealFormUrl:b.appeal_form_url,reporterEmail:b.reporter_email,reporterName:b.reporter_name}});c!=null&&(g=babelHelpers["extends"]({},g,{enforcementTargetData:{serverId:parseInt(c.server_msg_id,10)}}));e!=null&&e.appeal_form_url!=null&&(g=babelHelpers["extends"]({},g,{appealExtraData:{appealFormUrl:e.appeal_form_url}}));d!=null&&d.name!=null&&(g=babelHelpers["extends"]({},g,{enforcingEntityData:{name:d.name}}));f!=null&&(g=babelHelpers["extends"]({},g,{enforcementOriginWorkflow:f}));a!=null&&(g=babelHelpers["extends"]({},g,{enforcementOriginLegalBasis:a}));return g}function o(a,b){var c;return{appealCreationTime:d("WATimeUtils").castToUnixTime(parseInt((c=a.appeal_creation_time)!=null?c:0,10)),enforcementCreationTime:d("WATimeUtils").castToUnixTime(parseInt(a.enforcement_creation_time,10)),appealState:a.appeal_state,enforcementViolationCategory:a.enforcement_violation_category,enforcementId:a.enforcement_id,enforcementType:b,enforcementSource:(c=a.enforcement_source)!=null?c:null,enforcementExtraData:n(a.enforcement_extra_data)}}g.mexFetchNewsletterEnforcements=a}),98); __d("WAWebGetNewsletterEnforcementsJob",["WAJobOrchestratorTypes","WALogger","WAWebMexFetchNewsletterEnforcementsJob","WAWebOrchestratorNonPersistedJob","WAWebSchemaNewsletterMetadata","WAWebSuspendInformDataModelUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[MEX][NEWSLETTER] GET list of all enforcements for the given newsletter"]);h=function(){return a};return a}function a(a,c){c===void 0&&(c=d("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION);return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("getNewsletterEnforcements",b("asyncToGeneratorRuntime").asyncToGenerator(function*(){try{var b=(yield d("WAWebSchemaNewsletterMetadata").getNewsletterMetadataTable().get(a));if(b==null)return;b=(yield d("WAWebMexFetchNewsletterEnforcementsJob").mexFetchNewsletterEnforcements(a));var c=(yield d("WAWebSuspendInformDataModelUtils").populateMsgModels(Array.from(l(b)).sort(function(a,b){return a-b}),a));return{enforcementData:b,msgModelMap:c}}catch(a){d("WALogger").ERROR(h()).tags("GQL","MEX","DSA").devConsole({e:a});throw a}}),{priority:c}).waitUntilCompleted()}function i(a){a=a==null?void 0:(a=a.filter(function(a){return((a=a.enforcementExtraData)==null?void 0:(a=a.enforcementTargetData)==null?void 0:a.serverId)!=null}))==null?void 0:a.map(function(a){return(a=(a=a.enforcementExtraData)==null?void 0:(a=a.enforcementTargetData)==null?void 0:a.serverId)!=null?a:0});return a!=null&&a.length>0?a:[]}function j(a){a=a==null?void 0:a.flatMap(function(a){return a.serverId});return a!=null&&a.length>0?a:[]}function k(a){return a==null?[]:a.reduce(function(a,b){b=(b=b.enforcementExtraData)==null?void 0:(b=b.enforcementTargetData)==null?void 0:b.serverId;b!=null&&a.push(b);return a},[])}function l(a){if(a==null)return new Set([]);var b=a.suspensions,c=a.violatingMessages;a=a.geoSuspensions;return new Set([].concat(i(b),j(c),k(a)))}g.getNewsletterEnforcements=a}),98); __d("WAWebMexCreateNewsletterJobMutation.graphql",[],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"input"}],b={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},c={alias:null,args:null,kind:"ScalarField",name:"type",storageKey:null},d=[b,{alias:null,args:null,kind:"ScalarField",name:"text",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"update_time",storageKey:null}],e=[b,c,{alias:null,args:null,kind:"ScalarField",name:"direct_path",storageKey:null}];b=[{alias:null,args:[{kind:"Variable",name:"newsletter_input",variableName:"input"}],concreteType:"XWA2Newsletter",kind:"LinkedField",name:"xwa2_newsletter_create",plural:!1,selections:[b,{alias:null,args:null,concreteType:"XWA2NewsletterState",kind:"LinkedField",name:"state",plural:!1,selections:[c],storageKey:null},{alias:null,args:null,concreteType:"XWA2NewsletterThreadMetadata",kind:"LinkedField",name:"thread_metadata",plural:!1,selections:[{alias:null,args:null,concreteType:"XWA2NewsletterName",kind:"LinkedField",name:"name",plural:!1,selections:d,storageKey:null},{alias:null,args:null,concreteType:"XWA2NewsletterDescription",kind:"LinkedField",name:"description",plural:!1,selections:d,storageKey:null},{alias:null,args:[{kind:"Literal",name:"type",value:"IMAGE"}],concreteType:"XWA2Picture",kind:"LinkedField",name:"picture",plural:!1,selections:e,storageKey:'picture(type:"IMAGE")'},{alias:"preview",args:[{kind:"Literal",name:"type",value:"PREVIEW"}],concreteType:"XWA2Picture",kind:"LinkedField",name:"picture",plural:!1,selections:e,storageKey:'picture(type:"PREVIEW")'},{alias:null,args:null,kind:"ScalarField",name:"invite",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"handle",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"verification",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"subscribers_count",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"creation_time",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XWA2NewsletterViewerMetadata",kind:"LinkedField",name:"viewer_metadata",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"mute",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"role",storageKey:null}],storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"WAWebMexCreateNewsletterJobMutation",selections:b,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"WAWebMexCreateNewsletterJobMutation",selections:b},params:{id:"6996806640408138",metadata:{},name:"WAWebMexCreateNewsletterJobMutation",operationKind:"mutation",text:null}}}();e.exports=a}),null); __d("WAWebMexCreateNewsletterJob",["WALogger","WAWebMexClient","WAWebMexCreateNewsletterJobMutation.graphql","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[MEX][NEWSLETTER] newsletter created via mex"]);i=function(){return a};return a}function a(a,b,c){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e){var f=h!==void 0?h:h=b("WAWebMexCreateNewsletterJobMutation.graphql");a={input:{name:a,description:c,picture:e}};c=(yield d("WAWebMexClient").fetchQuery(f,a));d("WALogger").DEV(i()).tags("GQL","MEX").devConsole({response:c});return c});return j.apply(this,arguments)}g.mexCreateNewsletter=a}),98); __d("WAWebNewsletterCreateQueryJob",["WASmaxNewslettersCreateRPC","WAWebBackendErrors","WAWebMexCreateNewsletterJob","WAWebMexNewsletterParseUtils","WAWebNewsletterRpcUtils","WAWebURLUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){var b=a.name,c=a.description;a=a.picture;return h(b,c,a)}function e(){e=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.name,c=a.description;a=a.picture;var e=[{pictureType:"image"},{pictureType:"preview"}];b=(yield d("WASmaxNewslettersCreateRPC").sendCreateRPC({createRequestMixinMixinArgs:{setNameMixinMixinArgs:{nameElementValue:b},setNewDescriptionMixinMixinArgs:c!=null?{descriptionElementValue:c}:void 0,setNewPictureMixinMixinArgs:a!=null?{pictureElementValue:a}:void 0,allNewsletterMetadataIQRequestPayloadMixinArgs:{hasNewsletterCreationTimeField:!0,hasNewsletterNameField:!0,newsletterPictureFieldMixinArgs:{pictureArgs:e},hasNewsletterDescriptionField:!0,hasNewsletterInviteLinkField:!0,hasNewsletterHandleField:!0,hasNewsletterSubscribersField:!0,hasNewsletterPrivacyField:!0,hasNewsletterVerificationField:!0,hasNewsletterLinkedAccountsField:!0,hasNewsletterMembershipField:!0,hasNewsletterMutedField:!0}}}));switch(b.name){case"CreateResponseSuccess":return b.value.newsletterNewsletterWithMetadataIQResponsePayloadMixin;case"CreateResponseClientError":c=b.value.badRequestOrRateLimitedIQErrorResponseMixinGroup;switch(c.name){case"BadRequestIQErrorResponse":a=c.value.errorIQErrorBadRequestMixin;e=a.code;a=a.text;throw new(d("WAWebBackendErrors").ServerStatusCodeError)(Number(e),a);case"RateLimitedIQErrorResponse":e=c.value.errorIQErrorRateOverlimitMixin;a=e.code;c=e.text;throw new(d("WAWebBackendErrors").ServerStatusCodeError)(Number(a),c)}break;case"CreateResponseServerError":e=b.value.errorIQErrorInternalServerErrorMixin;a=e.code;c=e.text;throw new(d("WAWebBackendErrors").ServerStatusCodeError)(Number(a),c)}});return e.apply(this,arguments)}function h(a,b,c){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e){var f;e!=null&&(f=c("WAWebURLUtils").parseDataURL(e).data);e=(yield d("WAWebNewsletterRpcUtils").runWithBackoff(function(){return d("WAWebMexCreateNewsletterJob").mexCreateNewsletter(a,b,f)}));return d("WAWebMexNewsletterParseUtils").parseMexNewsletterResponse(e.xwa2_newsletter_create)});return i.apply(this,arguments)}g.createNewsletterQuery=a}),98); __d("WAWebNewsletterCreateJob",["WABase64","WAJobOrchestratorTypes","WALogger","WAWebCreateChat","WAWebNewsletterCreateQueryJob","WAWebNewsletterMetadataJob","WAWebNewsletterModelUtils","WAWebNewsletterStorageUtils","WAWebNewsletterSystemMessages","WAWebNewsletterUpdateMsgsRecordsJob","WAWebNewsletterUpdateNewslettersRecordsJob","WAWebOrchestratorNonPersistedJob","WAWebURLUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletter][join-notification] Failed to update the db records"]);h=function(){return a};return a}function a(a){return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("createNewsletter",function(){return d("WAWebNewsletterCreateQueryJob").createNewsletterQuery(a).then(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a==null)return null;var b=d("WAWebNewsletterModelUtils").mapNewsletterToModels(a),c=b.chat;b=b.metadata;try{var e=d("WAWebNewsletterSystemMessages").genNewsletterCreationSystemMessages({id:c.id,name:c.name,t:b.creationTime,role:b.membershipType});yield d("WAWebNewsletterUpdateNewslettersRecordsJob").updateNewsletterChatRecords([d("WAWebCreateChat").createNewsletterObjectForStorage(c)]);yield d("WAWebNewsletterUpdateMsgsRecordsJob").addNewsletterMsgsRecords(e);yield d("WAWebNewsletterMetadataJob").updateNewsletterMetadata(d("WAWebNewsletterStorageUtils").createNewsletterMetadataObjectForStorage(b));return{newsletter:a,msgs:e}}catch(a){d("WALogger").ERROR(h()).tags("newsletter").devConsole(a).sendLogs("newsletter-join-notification-db-fail")}});return function(b){return a.apply(this,arguments)}}())},{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()}function e(a){if(a==null)return null;a=c("WAWebURLUtils").parseDataURL(a).data;a=d("WABase64").decodeB64(a);return new Uint8Array(a)}g.createNewsletter=a;g.encodePicture=e}),98); __d("WAWebNewsletterDeleteChatJob",["Promise","WALogger","WAWebChatDeleteBridge","WAWebNewsletterDeleteMessageAddOns","WAWebOrchestratorNonPersistedJob","WAWebSchemaNewsletterMetadata","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[deleteNewsletterChat][job] Trying to delete a non-newsletter chat"]);i=function(){return a};return a}function a(a){return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("deleteNewsletterChat",function(){if(!a.isNewsletter()){d("WALogger").ERROR(i()).tags("newsletter").devConsole(a).sendLogs("delete-non-newsletter-chat");return(h||(h=b("Promise"))).resolve()}return d("WAWebChatDeleteBridge").deleteFromStorage(a)}).waitUntilCompleted()}function c(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=a.map(function(a){return a.toJid()});yield (h||(h=b("Promise"))).all(a.map(function(a){return d("WAWebNewsletterDeleteMessageAddOns").deleteNewsletterMessageAddOns(a)}));yield h.all(a.map(function(a){return d("WAWebChatDeleteBridge").deleteFromStorage(a)}));yield d("WAWebSchemaNewsletterMetadata").getNewsletterMetadataTable().bulkRemove(c)});return j.apply(this,arguments)}g.deleteNewsletterChat=a;g.bulkDeleteNewsletterChats=c}),98); __d("WAWebNewsletterGetAdminCapabilitiesJob",["WAJobOrchestratorTypes","WALogger","WAWebMexFetchNewsletterAdminCapabilitiesJob","WAWebOrchestratorNonPersistedJob","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[NEWSLETTER][getNewsletterAdminCapabilities] Fetching admin capabilities failed, returning default value of empty array"]);h=function(){return a};return a}function a(a){return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("getNewsletterAdminCapabilities",b("asyncToGeneratorRuntime").asyncToGenerator(function*(){try{return d("WAWebMexFetchNewsletterAdminCapabilitiesJob").mexFetchNewsletterAdminCapabilities(a)}catch(a){d("WALogger").ERROR(h()).devConsole({e:a});return new Set()}}),{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()}g.getNewsletterAdminCapabilities=a}),98); __d("WAWebMexFetchNewsletterAdminCountJobQuery.graphql",[],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"newsletter_id"}],b=[{kind:"Variable",name:"newsletter_id",variableName:"newsletter_id"}],c={alias:null,args:null,kind:"ScalarField",name:"admin_count",storageKey:null};return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"WAWebMexFetchNewsletterAdminCountJobQuery",selections:[{alias:null,args:b,concreteType:"XWA2NewsletterAdmin",kind:"LinkedField",name:"xwa2_newsletter_admin",plural:!1,selections:[c],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"WAWebMexFetchNewsletterAdminCountJobQuery",selections:[{alias:null,args:b,concreteType:"XWA2NewsletterAdmin",kind:"LinkedField",name:"xwa2_newsletter_admin",plural:!1,selections:[c,{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null}],storageKey:null}]},params:{id:"7130823597031706",metadata:{},name:"WAWebMexFetchNewsletterAdminCountJobQuery",operationKind:"query",text:null}}}();e.exports=a}),null); __d("WAWebMexFetchNewsletterAdminCountJob",["WALogger","WAWebMexClient","WAWebMexFetchNewsletterAdminCountJobQuery.graphql","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[MEX][NEWSLETTER] fetched admin count"]);i=function(){return a};return a}var j=h!==void 0?h:h=b("WAWebMexFetchNewsletterAdminCountJobQuery.graphql");function a(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b={newsletter_id:a};b=(yield d("WAWebMexClient").fetchQuery(j,b));d("WALogger").DEV(i()).tags("GQL","MEX").devConsole({newsletterJid:a,response:b});return(a=b.xwa2_newsletter_admin)==null?void 0:a.admin_count});return k.apply(this,arguments)}g.mexFetchNewsletterAdminCount=a}),98); __d("WAWebNewsletterGetAdminCountJob",["WAJobOrchestratorTypes","WALogger","WAWebMexFetchNewsletterAdminCountJob","WAWebNewsletterModelUtils","WAWebOrchestratorNonPersistedJob","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[NEWSLETTER][getNewsletterAdminCount] Fetching admin count failed, returning default value of 0"]);h=function(){return a};return a}function a(a){return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("getNewsletterAdminCount",b("asyncToGeneratorRuntime").asyncToGenerator(function*(){try{var b=(yield d("WAWebMexFetchNewsletterAdminCountJob").mexFetchNewsletterAdminCount(a));return(b=b)!=null?b:d("WAWebNewsletterModelUtils").DEFAULT_NEWSLETTER_ADMIN_COUNT}catch(a){d("WALogger").ERROR(h()).devConsole({e:a});return d("WAWebNewsletterModelUtils").DEFAULT_NEWSLETTER_ADMIN_COUNT}}),{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()}g.getNewsletterAdminCount=a}),98); __d("WAWebNewsletterGetMessageUpdatesQuery",["Promise","WANullthrows","WASmaxNewslettersGetNewsletterMessageUpdatesRPC","WATimeUtils","WAWebBackendErrors","WAWebNewsletterRpcUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function a(a,b){return d("WAWebNewsletterRpcUtils").runWithBackoff(function(){return i(a,b)})}function i(a,b){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){var e=c.since,f=c.count;c=c.cursor;a=(yield d("WASmaxNewslettersGetNewsletterMessageUpdatesRPC").sendGetNewsletterMessageUpdatesRPC({iqTo:a,messageUpdatesCount:f,messageUpdatesSince:e,messageUpdatesBeforeOrAfterMixinMixinGroupArgs:k(c)}));switch(a.name){case"GetNewsletterMessageUpdatesResponseSuccess":f=a.value.messageUpdatesMessagesNewsletterMessageResponsePayloadMixin;return{updates:f.message,timestamp:(e=f.t)!=null?e:d("WATimeUtils").unixTime()};case"GetNewsletterMessageUpdatesResponseServerError":c=a.value.errorIQErrorInternalServerErrorMixin;f=c.code;e=c.text;throw new(d("WAWebBackendErrors").ServerStatusCodeError)(Number(f),e);case"GetNewsletterMessageUpdatesResponseClientError":c=a.value.getNewsletterMessageUpdatesClientErrors;switch(c.name){case"ItemNotFoundIQErrorResponse":f=c.value.errorIQErrorItemNotFoundMixin;e=f.code;a=f.text;return(h||(h=b("Promise"))).reject(new(d("WAWebBackendErrors").ServerStatusCodeError)(Number(e),a));case"RateLimitedIQErrorResponse":f=c.value.errorIQErrorRateOverlimitMixin;e=f.code;a=f.text;return(h||(h=b("Promise"))).reject(new(d("WAWebBackendErrors").ServerStatusCodeError)(Number(e),a));case"BadRequestIQErrorResponse":f=c.value.errorIQErrorBadRequestMixin;e=f.code;a=f.text;return(h||(h=b("Promise"))).reject(new(d("WAWebBackendErrors").ServerStatusCodeError)(Number(e),a));case"SuspendedIQErrorResponse":f=c.value.errorIQErrorLockedMixin;e=f.code;a=f.text;return(h||(h=b("Promise"))).reject(new(d("WAWebBackendErrors").ServerStatusCodeError)(Number(e),a));case"UnavailableForLegalReasonsResponse":f=c.value.errorIQErrorUnavailableForLegalReasonsGenericMixin;e=f.code;a=f.text;return(h||(h=b("Promise"))).reject(new(d("WAWebBackendErrors").ServerStatusCodeError)(Number(e),a))}}});return j.apply(this,arguments)}function k(a){return a.after!=null?{messageUpdatesAfterMixin:{messageUpdatesAfter:a.after}}:{messageUpdatesBeforeMixin:{messageUpdatesBefore:c("WANullthrows")(a.before)}}}g.getNewsletterMessageUpdatesQuery=a}),98); __d("WAWebNewsletterGetMessageUpdatesJob",["WAJobOrchestratorTypes","WAWebNewsletterBackendAddOnsUtils","WAWebNewsletterGetMessageUpdatesQuery","WAWebOrchestratorNonPersistedJob","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,c){return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("getNewsletterMessageUpdates",b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var b=c.ids,e=babelHelpers.objectWithoutPropertiesLoose(c,["ids"]);e=(yield d("WAWebNewsletterGetMessageUpdatesQuery").getNewsletterMessageUpdatesQuery(a,e));var f=e.updates;e=e.timestamp;f=(yield d("WAWebNewsletterBackendAddOnsUtils").getMsgsAndAddOnsFromUpdates(f,d("WAWebWidFactory").createWid(a),e));yield d("WAWebNewsletterBackendAddOnsUtils").updateAddOnDbRecords(babelHelpers["extends"]({},f,{ids:b,timestamp:e}));return babelHelpers["extends"]({},f,{timestamp:e,ids:b})}),{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()}g.getNewsletterMessageUpdates=a}),98); __d("WAWebNewsletterGetMessagesQueryJob",["Promise","WALogger","WASmaxNewslettersGetNewsletterMessagesRPC","WATimeUtils","WAWebBackendErrors","WAWebNewsletterGatingUtils","WAWebNewsletterQueryUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[queryNewsletterMessages] "," messages requested"]);i=function(){return a};return a}function j(a){if((a==null?void 0:a.before)!=null)return{beforeMixin:{messagesBefore:a.before}};return(a==null?void 0:a.after)!=null?{afterMixin:{messagesAfter:a.after}}:void 0}function a(a,b,c){a=d("WAWebNewsletterQueryUtils").getNewsletterMessagesQueryParams(a);return k(a,b,c)}function c(a,b,c){a=d("WAWebNewsletterQueryUtils").getNewsletterMessagesQueryParams(a);return k(a,b,c)}function k(a,b,c){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e){e=j(e);c>d("WAWebNewsletterGatingUtils").getMaxMsgCountFromServer()&&d("WALogger").WARN(i(),c).tags("newsletter").sendLogs("newsletter-server-msg-count-exceeded");a=(yield d("WASmaxNewslettersGetNewsletterMessagesRPC").sendGetNewsletterMessagesRPC({queryNewsletterParamsMixinArgs:{queryNewsletterParamsArgs:a},newsletterMessageRequestPayloadMixinArgs:{messagesCount:Math.min(c,d("WAWebNewsletterGatingUtils").getMaxMsgCountFromServer()),messageDirectionsArgs:e}}));switch(a.name){case"GetNewsletterMessagesResponseSuccess":e=a.value.messagesNewsletterMessageResponsePayloadMixin;var f=e.message;e=e.t;return{messages:f,end:f.length<c,timestamp:(f=e)!=null?f:d("WATimeUtils").unixTime()};case"GetNewsletterMessagesResponseClientError":c=a.value.getNewsletterMessagesClientErrors;switch(c.name){case"ItemNotFoundIQErrorResponse":e=c.value.errorIQErrorItemNotFoundMixin;f=e.text;e=e.code;throw new(d("WAWebBackendErrors").ServerStatusCodeError)(e,f);case"RateLimitedIQErrorResponse":e=c.value.errorIQErrorRateOverlimitMixin;f=e.text;e=e.code;throw new(d("WAWebBackendErrors").ServerStatusCodeError)(e,f);case"BadRequestIQErrorResponse":e=c.value.errorIQErrorBadRequestMixin;f=e.text;e=e.code;throw new(d("WAWebBackendErrors").ServerStatusCodeError)(e,f);case"SuspendedIQErrorResponse":e=c.value.errorIQErrorLockedMixin;f=e.text;e=e.code;throw new(d("WAWebBackendErrors").ServerStatusCodeError)(e,f);case"UnavailableForLegalReasonsResponse":e=c.value.errorIQErrorUnavailableForLegalReasonsGenericMixin;f=e.text;e=e.code;throw new(d("WAWebBackendErrors").ServerStatusCodeError)(e,f);case"NotAllowedIQErrorResponse":e=c.value.errorIQErrorNotAllowedMixin;f=e.text;c=e.code;throw new(d("WAWebBackendErrors").ServerStatusCodeError)(c,f)}break;case"GetNewsletterMessagesResponseServerError":e=a.value.errorIQErrorInternalServerErrorMixin;c=e.code;f=e.text;return(h||(h=b("Promise"))).reject(new(d("WAWebBackendErrors").ServerStatusCodeError)(Number(c),f))}});return l.apply(this,arguments)}g.queryNewsletterMessagesByJid=a;g.queryNewsletterMessagesByInviteCode=c}),98); __d("WAWebNewsletterGetMessagesJob",["WAJobOrchestratorTypes","WATimeUtils","WAWebJidToWid","WAWebNewsletterBackendAddOnsUtils","WAWebNewsletterGetMessagesQueryJob","WAWebNewsletterValidationUtils","WAWebOrchestratorNonPersistedJob","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,c,e){d("WAWebNewsletterValidationUtils").validateNewsletterJidOrThrow(a);return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("getNewsletterMessages",b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var b=(yield d("WAWebNewsletterGetMessagesQueryJob").queryNewsletterMessagesByJid(a,c,e)),f=d("WAWebJidToWid").jidWithTypeToWid({jidType:"newsletter",newsletterJid:a});f=(yield d("WAWebNewsletterBackendAddOnsUtils").getMsgsAndAddOnsFromUpdates(b.messages,f,b.timestamp));return babelHelpers["extends"]({},f,{timestamp:d("WATimeUtils").castToUnixTime(b.timestamp)})}),{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()}g.getNewsletterMessages=a}),98); __d("WAWebNewsletterMetadataJob",["Promise","WAJobOrchestratorTypes","WAWebNewsletterCreateJob","WAWebNewsletterMetadataQueryJob","WAWebOrchestratorNonPersistedJob","WAWebSchemaNewsletterMetadata","WAWebSchemaProfilePicThumb","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function a(){return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("getAllNewslettersMetadata",function(){return d("WAWebNewsletterMetadataQueryJob").queryAllNewslettersMetadata()},{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()}function c(a,b,c){return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("getNewsletterMetadata",function(){return d("WAWebNewsletterMetadataQueryJob").queryNewsletterMetadataByJid(a,b,c)},{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()}function e(a){return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("updateNewsletterMetadata",function(){return Array.isArray(a)?d("WAWebSchemaNewsletterMetadata").getNewsletterMetadataTable().bulkCreateOrMerge(a):d("WAWebSchemaNewsletterMetadata").getNewsletterMetadataTable().createOrMerge(a.id,a)},{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()}function f(a){return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("deleteNewsletterMetadata",function(){return d("WAWebSchemaNewsletterMetadata").getNewsletterMetadataTable().remove(a)},{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()}function i(a){return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("deleteNewsletterPicture",function(){return d("WAWebSchemaProfilePicThumb").getProfilePicThumbTable().remove(a)},{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()}function j(a,b,c){return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("editNewsletterMetadata",function(){var e=c.picture;e=d("WAWebNewsletterCreateJob").encodePicture(e);return d("WAWebNewsletterMetadataQueryJob").editNewsletterMetadataQuery(a,b,babelHelpers["extends"]({},c,{picture:e}))},{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()}function k(a,c,e,f){f===void 0&&(f=d("WAJobOrchestratorTypes").JOB_PRIORITY.LOW);return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("updateNewsletterMessageDeliveryUpdates",b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var f=(yield d("WAWebSchemaNewsletterMetadata").getNewsletterMetadataTable().get(a));if(f==null)return(h||(h=b("Promise"))).resolve();var g=f.messageDeliveryUpdates,i=g===void 0?new Map():g;e.forEach(function(a){i==null?void 0:i["delete"](a)});c.forEach(function(a){var b=a.id;a=babelHelpers.objectWithoutPropertiesLoose(a,["id"]);i==null?void 0:i.set(b,a)});f.messageDeliveryUpdates=i;return d("WAWebSchemaNewsletterMetadata").getNewsletterMetadataTable().merge(a,f)}),{priority:f}).waitUntilCompleted()}function l(a){return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("suspendNewsletter",function(){return d("WAWebSchemaNewsletterMetadata").getNewsletterMetadataTable().merge(a,{id:a,suspended:!0})},{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()}function m(a){return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("geosuspendNewsletter",function(){return d("WAWebSchemaNewsletterMetadata").getNewsletterMetadataTable().merge(a,{id:a,suspended:!0,geosuspended:!0})},{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()}g.getAllNewslettersMetadata=a;g.getNewsletterMetadata=c;g.updateNewsletterMetadata=e;g.deleteNewsletterMetadata=f;g.deleteNewsletterPicture=i;g.editNewsletterMetadata=j;g.updateNewsletterMessageDeliveryUpdates=k;g.suspendNewsletter=l;g.geosuspendNewsletter=m}),98); __d("WAWebNewsletterSendMessageQueryJob",["WASmaxMessagePublishNewsletterRPC","WAStanzaUtils","WAWebNewsletterValidationUtils","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){d("WAWebNewsletterValidationUtils").validateNewsletterJidOrThrow(a.newsletterJid);a={messageTo:a.newsletterJid,clientNewsletterOrNewsletterAndServerIDMixinGroupArgs:i(a)};a=(yield d("WASmaxMessagePublishNewsletterRPC").sendNewsletterRPC(a));switch(a.name){case"NewsletterResponseSuccess":return{success:!0,ack:{t:a.value.t},serverId:a.value.serverId};case"NewsletterResponseNegative":return{success:!1,ack:{t:a.value.t,error:a.value.error}}}});return h.apply(this,arguments)}function i(a){switch(a.type){case"reaction":return j(a);case"pollVote":return k(a);default:return{newsletterClientID:l(a)}}}function j(a){var b=a.reactionCode;b=b!=null&&b!==""?{newsletterReaction:{reactionCode:b}}:{isNewsletterReactionRevoke:!0};return{newsletterClientAndServerID:{messageId:d("WAStanzaUtils").toStanzaId(a.messageId),messageServerId:a.parentMsgServerId,newsletterReactionOrReactionRevokeOrPollVoteMixinGroupArgs:b}}}function k(a){var b={voteArgs:a.votes.map(function(a){return{voteElementValue:a}})};return{newsletterClientAndServerID:{messageId:d("WAStanzaUtils").toStanzaId(a.messageId),messageServerId:a.parentMsgServerId,newsletterReactionOrReactionRevokeOrPollVoteMixinGroupArgs:{newsletterPollVote:b}}}}function l(a){switch(a.type){case"edit":return{messageId:d("WAStanzaUtils").toStanzaId(a.messageId),newsletterClientIdContentArgs:{newsletterEdit:{newsletterTextOrMediaMixinGroupArgs:{newsletterText:{payloadMixinArgs:{plaintextElementValue:a.payload},hasWAMOSub:a.isWamoSub}}}}};case"revoke":return{messageId:d("WAStanzaUtils").toStanzaId(a.messageId),newsletterClientIdContentArgs:{newsletterRevoke:{hasWAMOSub:a.isWamoSub}}};case"pollCreation":return{messageId:d("WAStanzaUtils").toStanzaId(a.messageId),newsletterClientIdContentArgs:{newsletterPollCreation:{payloadMixinArgs:{plaintextElementValue:a.payload},hasWAMOSub:a.isWamoSub,metaContenttype:a.contentType}}};case"pollResultSnapshot":return{messageId:d("WAStanzaUtils").toStanzaId(a.messageId),newsletterClientIdContentArgs:{newsletterPollResultSnapshot:{payloadMixinArgs:{plaintextElementValue:a.payload},hasWAMOSub:a.isWamoSub}}};case"text":return{messageId:d("WAStanzaUtils").toStanzaId(a.messageId),newsletterClientIdContentArgs:{newsletterText:{payloadMixinArgs:{plaintextElementValue:a.payload},hasWAMOSub:a.isWamoSub}}};case"audio":case"avatar_sticker":case"document":case"gif":case"image":case"ptt":case"sticker":case"url":case"vcard":case"video":return{messageId:d("WAStanzaUtils").toStanzaId(a.messageId),newsletterClientIdContentArgs:{newsletterMediaPublish:{plaintextMediatype:a.type,payloadMixinArgs:{plaintextElementValue:a.payload},messageMediaId:a.mediaHandle,hasWAMOSub:a.isWamoSub,messageAssociationTypeMixinArgs:a.messageAssociationTypeMixinArgs}}};default:a.type;throw c("err")("Wrong code path for "+a.type)}}g.querySendNewsletterMessage=a}),98); __d("WAWebNewsletterSendMessageJob",["Promise","WAJobOrchestratorTypes","WALogger","WANullthrows","WAWebBackendJobs.flow","WAWebBackendJobsCommon","WAWebMessageAssociation.flow","WAWebNewsletterSendMessageQueryJob","WAWebNewsletterValidationUtils","WAWebOrchestratorNonPersistedJob","WAWebOutgoingMessage","WAWebPollCreationUtils","WAWebProtobufsE2E.pb","encodeProtobuf","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletter] Unsupported media type"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletter] Failed to get media type from protobuf"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletter] Unexpected newsletter message association type: ",""]);k=function(){return a};return a}function a(a){return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("sendNewsletterMessage",function(){return m(a)},{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()}function l(a,b){var e=a.type,f=a.msg,g={messageId:f.id.id,newsletterJid:a.newsletterJid,payload:d("encodeProtobuf").encodeProtobuf(d("WAWebProtobufsE2E.pb").MessageSpec,b).readByteArray(),isWamoSub:f.isWamoSub===!0||void 0};if(e==="media")return babelHelpers["extends"]({},g,{mediaHandle:c("WANullthrows")(a.mediaHandle),type:o(b),messageAssociationTypeMixinArgs:n(f)});return e==="pollCreation"?babelHelpers["extends"]({},g,{type:"pollCreation",contentType:(f==null?void 0:f.pollContentType)===d("WAWebPollCreationUtils").PollContentType.IMAGE?"image":"text"}):babelHelpers["extends"]({},g,{type:e})}function m(a){d("WAWebNewsletterValidationUtils").validateNewsletterJidOrThrow(a.newsletterJid);switch(a.type){case"edit":var e=d("WAWebOutgoingMessage").createOutgoingMsgModelProtobuf(d("WAWebOutgoingMessage").OutgoingMessageOriginType.Newsletter,a.msg);e=d("encodeProtobuf").encodeProtobuf(d("WAWebProtobufsE2E.pb").MessageSpec,e);return d("WAWebNewsletterSendMessageQueryJob").querySendNewsletterMessage({type:"edit",messageId:a.msg.id.id,newsletterJid:a.newsletterJid,payload:e.readByteArray(),isWamoSub:a.msg.isWamoSub===!0||void 0});case"pollCreation":case"pollResultSnapshot":case"text":case"media":e=d("WAWebOutgoingMessage").createOutgoingMsgModelProtobuf(d("WAWebOutgoingMessage").OutgoingMessageOriginType.Newsletter,a.msg);e=l(a,e);return d("WAWebNewsletterSendMessageQueryJob").querySendNewsletterMessage(e);case"revoke":return d("WAWebNewsletterSendMessageQueryJob").querySendNewsletterMessage({messageId:a.messageId,newsletterJid:a.newsletterJid,type:"revoke",isContentMedia:a.isContentMedia,isWamoSub:a.isWamoSub===!0||void 0});case"reaction":return d("WAWebNewsletterSendMessageQueryJob").querySendNewsletterMessage({type:"reaction",newsletterJid:a.newsletterJid,reactionCode:a.reactionCode,messageId:a.msg.id.id,parentMsgServerId:a.parentMsgServerId});case"pollVote":return d("WAWebNewsletterSendMessageQueryJob").querySendNewsletterMessage({type:"pollVote",newsletterJid:a.newsletterJid,votes:a.votes,messageId:a.msg.id.id,parentMsgServerId:a.parentMsgServerId});default:a.type;return(h||(h=b("Promise"))).reject(c("err")("Unexpected message type: "+a.type))}}function n(a){var b=a.associationType;if(b==null)return null;switch(b){case d("WAWebMessageAssociation.flow").MessageAssociationType.MEDIA_POLL:return{metaMessageAssociationType:"media_poll"};case d("WAWebMessageAssociation.flow").MessageAssociationType.BOT_PLUGIN:case d("WAWebMessageAssociation.flow").MessageAssociationType.MEDIA_ALBUM:case d("WAWebMessageAssociation.flow").MessageAssociationType.UNKNOWN:d("WALogger").ERROR(k(),b).tags("newsletter").devConsole(a).sendLogs("newsletter-message-association-type-"+b);return null}}function o(a){var b=d("WAWebBackendJobsCommon").mediaTypeFromProtobuf(a);if(b==null){d("WALogger").ERROR(j()).tags("newsletter").devConsole(a).sendLogs("newsletter-failed-media-type-from-protobuf");throw c("err")("Failed to get media type from protobuf")}switch(b){case d("WAWebBackendJobs.flow").EncMediaType.Audio:return"audio";case d("WAWebBackendJobs.flow").EncMediaType.Document:return"document";case d("WAWebBackendJobs.flow").EncMediaType.Gif:return"gif";case d("WAWebBackendJobs.flow").EncMediaType.Image:return"image";case d("WAWebBackendJobs.flow").EncMediaType.Ptt:return"ptt";case d("WAWebBackendJobs.flow").EncMediaType.Sticker:return"sticker";case d("WAWebBackendJobs.flow").EncMediaType.Url:return"url";case d("WAWebBackendJobs.flow").EncMediaType.VCard:return"vcard";case d("WAWebBackendJobs.flow").EncMediaType.Video:return"video";default:d("WALogger").ERROR(i()).tags("newsletter").devConsole(a).sendLogs("newsletter-unsupported-media-type-"+b);throw c("err")("Unsupported media type "+b)}}g.sendNewsletterMessageJob=a;g.sendNewsletterMessage=m}),98); __d("WAWebMexMuteNewsletterJobMutation.graphql",[],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"newsletter_id"}],b=[{alias:null,args:[{kind:"Variable",name:"newsletter_id",variableName:"newsletter_id"}],concreteType:"XWA2NewsletterMutationResponse",kind:"LinkedField",name:"xwa2_newsletter_mute_v2",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,concreteType:"XWA2NewsletterState",kind:"LinkedField",name:"state",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"type",storageKey:null}],storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"WAWebMexMuteNewsletterJobMutation",selections:b,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"WAWebMexMuteNewsletterJobMutation",selections:b},params:{id:"25151904754424642",metadata:{},name:"WAWebMexMuteNewsletterJobMutation",operationKind:"mutation",text:null}}}();e.exports=a}),null); __d("WAWebMexMuteNewsletterJob",["WALogger","WAWebMexClient","WAWebMexMuteNewsletterJobMutation.graphql","WAWebMexNewsletterUtils","WAWebNewsletterRpcUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[MEX][NEWSLETTER] mute newsletter via mex"]);i=function(){return a};return a}var j=h!==void 0?h:h=b("WAWebMexMuteNewsletterJobMutation.graphql");function a(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a[0];a=(yield d("WAWebNewsletterRpcUtils").runWithBackoff(function(){return l(b)}));a=d("WAWebMexNewsletterUtils").convertMutationResponse(a.xwa2_newsletter_mute_v2);return[a]});return k.apply(this,arguments)}function l(a){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a={newsletter_id:a};a=(yield d("WAWebMexClient").fetchQuery(j,a));d("WALogger").DEV(i()).tags("GQL","MEX").devConsole({response:a});return a});return m.apply(this,arguments)}g.mexMuteNewsletter=a}),98); __d("WAWebMexUnmuteNewsletterJobMutation.graphql",[],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"newsletter_id"}],b=[{alias:null,args:[{kind:"Variable",name:"newsletter_id",variableName:"newsletter_id"}],concreteType:"XWA2NewsletterMutationResponse",kind:"LinkedField",name:"xwa2_newsletter_unmute_v2",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,concreteType:"XWA2NewsletterState",kind:"LinkedField",name:"state",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"type",storageKey:null}],storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"WAWebMexUnmuteNewsletterJobMutation",selections:b,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"WAWebMexUnmuteNewsletterJobMutation",selections:b},params:{id:"7337137176362961",metadata:{},name:"WAWebMexUnmuteNewsletterJobMutation",operationKind:"mutation",text:null}}}();e.exports=a}),null); __d("WAWebMexUnmuteNewsletterJob",["WALogger","WAWebMexClient","WAWebMexNewsletterUtils","WAWebMexUnmuteNewsletterJobMutation.graphql","WAWebNewsletterRpcUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[MEX][NEWSLETTER] unmute newsletter via mex"]);i=function(){return a};return a}var j=h!==void 0?h:h=b("WAWebMexUnmuteNewsletterJobMutation.graphql");function a(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a[0];a=(yield d("WAWebNewsletterRpcUtils").runWithBackoff(function(){return l(b)}));a=d("WAWebMexNewsletterUtils").convertMutationResponse(a.xwa2_newsletter_unmute_v2);return[a]});return k.apply(this,arguments)}function l(a){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a={newsletter_id:a};a=(yield d("WAWebMexClient").fetchQuery(j,a));d("WALogger").DEV(i()).tags("GQL","MEX").devConsole({response:a});return a});return m.apply(this,arguments)}g.mexUnmuteNewsletter=a}),98); __d("WAWebNewsletterToggleMuteStateJob",["WAJobOrchestratorTypes","WALogger","WAWebMexMuteNewsletterJob","WAWebMexUnmuteNewsletterJob","WAWebMiscErrors","WAWebNewsletterModelUtils","WAWebOrchestratorNonPersistedJob","WAWebSchemaChat","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletter][","Newsletter] Failed to persist the mutation on db"]);h=function(){return a};return a}function a(a){return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("muteNewsletter",b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield i({newsletterJids:a,muteStateMexFunction:d("WAWebMexMuteNewsletterJob").mexMuteNewsletter,muteExpirationValue:d("WAWebNewsletterModelUtils").MUTED_STATE})}),{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()}function c(a){return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("unmuteNewsletter",b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield i({newsletterJids:a,muteStateMexFunction:d("WAWebMexUnmuteNewsletterJob").mexUnmuteNewsletter,muteExpirationValue:d("WAWebNewsletterModelUtils").UNMUTED_STATE})}),{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()}function i(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.newsletterJids,c=a.muteStateMexFunction,e=a.muteExpirationValue;a=e===d("WAWebNewsletterModelUtils").MUTED_STATE?"mute":"unmute";c=(yield c(b));b=c.filter(function(a){return a.subscriberNotFoundMixin==null}).map(function(a){return a.jid});try{return yield d("WAWebSchemaChat").getChatTable().bulkCreateOrMerge(b.map(function(a){return{id:a,muteExpiration:e}}))}catch(b){b instanceof d("WAWebMiscErrors").DbOnLogoutAbort||d("WALogger").ERROR(h(),a).tags("newsletter").devConsole(b).sendLogs("newsletter-"+a+"-db-fail");throw b}});return j.apply(this,arguments)}g.muteNewsletter=a;g.unmuteNewsletter=c}),98); __d("WAWebNewsletterUpdateMsgsRecordsJob",["Promise","WAJobOrchestratorTypes","WALogger","WAWebDBMessageSerialization","WAWebDBMessageUtils","WAWebFrontendMsgGetters","WAWebMessageProcessorCache","WAWebMsgDataFromModel","WAWebMsgGetters","WAWebOrchestratorNonPersistedJob","WAWebSchemaMessage","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[updateNewsletterMsgRecord] Msg not found, skipping"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[updateNewsletterMsgRecord] Called on a non-newsletter msg"]);j=function(){return a};return a}function a(a){return k(a).waitUntilCompleted()}function k(a){return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("addNewsletterMsgsRecords",function(){return a.length===0?(h||(h=b("Promise"))).resolve():d("WAWebMessageProcessorCache").messageProcessorCache.addMessages(a.map(function(a){return{msg:a}}),!0)},{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION})}function c(a){return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("updateNewsletterMsgRecord",b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(!d("WAWebMsgGetters").getIsNewsletterMsg(a)){d("WALogger").ERROR(j()).devConsole(a.id);return}if((yield d("WAWebSchemaMessage").getMessageTable().get(a.id.toString()))==null){d("WALogger").WARN(i()).devConsole(a.id);return}var b=a.serverId,c=d("WAWebFrontendMsgGetters").getChat(a),e=l(d("WAWebMsgDataFromModel").msgDataFromMsgModel(a));e=d("WAWebDBMessageSerialization").dbRowFromMessage(e);b!=null&&(e.internalId=d("WAWebDBMessageUtils").craftInternalId(c.id.toJid(),b));yield d("WAWebSchemaMessage").getMessageTable().merge(a.id.toString(),e)}),{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()}function l(a){delete a.serverId;delete a.rowId;delete a.messageRangeIndex;return a}g.addNewsletterMsgsRecords=a;g.addNewsletterMsgsRecordsJob=k;g.updateNewsletterMsgRecord=c}),98); __d("WAWebNewsletterMetadataInitFromStorage",["WAJids","WALinkify","WALogger","WAWebBackendApi","WAWebCommonNewsletterEnums","WAWebNewsletterMessageDeliveryUpdateToModelUtils","WAWebNewsletterMetadataCollection","WAWebSchemaNewsletterMetadata","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[init-from-storage]: restoreNewsletterMetadata: complete restoring newsletter metadata"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[init-from-storage]: restoreNewsletterMetadata: start restoring newsletter metadata"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Encountered unexpected newsletter capability in DB: ",""]);j=function(){return a};return a}function k(a){switch(a){case 0:return d("WAWebCommonNewsletterEnums").NewsletterMembershipType.Subscriber;case 1:return d("WAWebCommonNewsletterEnums").NewsletterMembershipType.Admin;case 3:return d("WAWebCommonNewsletterEnums").NewsletterMembershipType.Owner;case 2:default:return d("WAWebCommonNewsletterEnums").NewsletterMembershipType.Guest}}function l(a){switch(a){case 0:return d("WAWebCommonNewsletterEnums").NewsletterReactionCodesSetting.All;case 3:return d("WAWebCommonNewsletterEnums").NewsletterReactionCodesSetting.None;case 2:return d("WAWebCommonNewsletterEnums").NewsletterReactionCodesSetting.Blocklist;case 1:default:return d("WAWebCommonNewsletterEnums").NewsletterReactionCodesSetting.Basic}}function m(a){switch(a){case 0:return d("WAWebCommonNewsletterEnums").NewsletterCapability.Insights;case 1:return d("WAWebCommonNewsletterEnums").NewsletterCapability.PhotoPolls;default:d("WALogger").WARN(j(),a).tags("newsletter-capabilities").sendLogs("Unexpected newsletter capability in DB");return null}}function n(a){switch(a){case 1:return d("WAWebCommonNewsletterEnums").NewsletterPrivacy.Private;case 0:default:return d("WAWebCommonNewsletterEnums").NewsletterPrivacy.Public}}function o(a){switch(a){case 0:return d("WAWebCommonNewsletterEnums").WamoSubStatus.ACTIVE;case 1:default:return d("WAWebCommonNewsletterEnums").WamoSubStatus.INACTIVE}}function a(){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){d("WALogger").DEV(i());try{var a=(yield d("WAWebSchemaNewsletterMetadata").getNewsletterMetadataTable().all());a.forEach(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=d("WAWebWidFactory").createWid(a.id),e={id:b,creationTime:a.creationTime,name:a.name,nameUpdateTime:a.nameUpdateTime,description:a.description,descriptionUpdateTime:a.descriptionUpdateTime,handle:a.handle,inviteCode:a.inviteCode,size:a.size,verified:a.verified,membershipType:k(a.membershipType),reactionCodesSetting:l(a.reactionCodesSetting),privacy:n(a.privacy),website:a.website!=null?d("WALinkify").findLink(a.website):null,adminCount:a.adminCount,capabilities:a.capabilities!=null?new Set(Array.from(a.capabilities).map(m).filter(Boolean)):new Set(),suspended:a.suspended,geosuspended:a.geosuspended,terminated:a.terminated,wamoSubPlanId:a.wamoSubPlanId,wamoSubStatus:o(a.wamoSubStatus)};c("WAWebNewsletterMetadataCollection")==null?void 0:c("WAWebNewsletterMetadataCollection").add(e,{merge:!0});if(a.messageDeliveryUpdates!=null){var f=[];a.messageDeliveryUpdates.forEach(function(a,b){return f.push({id:b,code:a.code})});e=(yield d("WAWebNewsletterMessageDeliveryUpdateToModelUtils").getMessageDeliveryUpdatesModelToUpdate(d("WAJids").toNewsletterJid(a.id),f,[]));a=e.modelUpdatesToAdd;yield d("WAWebBackendApi").frontendFireAndForget("updateNewsletterMessageDeliveryUpdate",{id:b,modelUpdatesToAdd:a,modelUpdatesToRemove:[]})}});return function(b){return a.apply(this,arguments)}}())}finally{d("WALogger").DEV(h())}});return p.apply(this,arguments)}g.restoreNewsletterMetadata=a}),98); __d("WAWebCRUDOperationsNewsletterPollsVotes",["WAWebModelStorageUtils","WAWebSchemaNewsletterPollsVotes","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return d("WAWebModelStorageUtils").getStorage().lock(["newsletter-polls-votes"],function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){b=b[0];b;var c=new Map(a.map(function(a){return[a.parentMsgKey,a]})),d=(yield b.bulkGet(a.map(function(a){return a.parentMsgKey}))).filter(Boolean);d.forEach(function(a){var b=c.get(a.parentMsgKey);b!=null&&b.serverTimestamp<a.serverTimestamp&&c["delete"](a.parentMsgKey)});yield b.bulkCreateOrReplace(Array.from(c.values()))});return function(a){return c.apply(this,arguments)}}())}function c(a){return d("WAWebSchemaNewsletterPollsVotes").getTable().bulkRemove(a)}function e(a){return d("WAWebSchemaNewsletterPollsVotes").getTable().get(a)}g.bulkCreateOrUpdateVotes=a;g.bulkDeleteVotes=c;g.getVote=e}),98); __d("WAWebNewsletterMapMsgAndAddOns",["Promise","WAWebBackendApi","WAWebNewsletterBackendMsgUtils","WAWebNewsletterDBUtils","WAWebPollOptionHashUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(a,b){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){var e=(yield d("WAWebBackendApi").frontendSendAndReceive("findMsgKeyFromServerId",{from:a,serverId:c}));if(e!=null)return(h||(h=b("Promise"))).resolve(e);e=(yield d("WAWebNewsletterDBUtils").getMessageByServerId(c,a.toJid()));return e==null?void 0:e.id});return j.apply(this,arguments)}function a(a,b,c){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){var e,f,g,h;e=(e=a.newsletterReactionsMixin)==null?void 0:e.reactionsReaction;f=(f=a.newsletterPollVotesMixin)==null?void 0:f.votesVote;g=d("WAWebNewsletterBackendMsgUtils").mapNewsletterMsgToMsgData(a,b,((g=e==null?void 0:e.length)!=null?g:0)>0,c);h=(h=g==null?void 0:g.id)!=null?h:yield i(b,a.serverId);a=(b=a.newsletterViewsCountMixin)==null?void 0:b.viewsCountCount;return{msgData:g,reactionData:l(e,h,c),pollVoteData:m(f,h,c),id:h,viewCount:a}});return k.apply(this,arguments)}function l(a,b,c){return b!=null&&a!=null&&a.length>0?{parentMsgKey:b,serverTimestamp:c,emojiCountMap:a.reduce(function(a,b){return a.set(b.code,b.count)},new Map())}:null}function m(a,b,c){return b==null||a==null||a.length===0?null:{parentMsgKey:b,serverTimestamp:c,voteCountMap:a.reduce(function(a,b){return a.set(d("WAWebPollOptionHashUtils").bufferToHex(b.elementValue),b.count)},new Map())}}g.mapMsgAndAddOns=a}),98); __d("WAWebNewsletterPollsUtils",["WATimeUtils","WAWebNewsletterGatingUtils"],(function(a,b,c,d,e,f,g){function a(a,b,c){var e,f=new Map();e=Array.from((e=a==null?void 0:(e=a.pollVotesCountMap)==null?void 0:e.values())!=null?e:[]);var g=e.reduce(function(a,b){return a+b},0);e=Math.max.apply(Math,e);var i=a==null?void 0:a.pollVotersMap;for(b of b){var j,k;j=Boolean(a==null?void 0:(j=a.myVote)==null?void 0:j.has(b.localId));k=Math.max((k=a==null?void 0:(k=a.pollVotesCountMap)==null?void 0:k.get(b.localId))!=null?k:0,j?1:0);var l=i==null?void 0:i.get(b.localId),m=j?h(c,a==null?void 0:a.myVoteTs):null;m=(m!=null?[m]:[]).concat((m=l==null?void 0:l.contacts)!=null?m:[]);f.set(b,{isVotedForByMe:j,isCurrentLeader:e>0&&k===e,percentageOfAll:g===0?0:k/g,percentageOfMostVotedForOption:e===0?0:k/e,votes:d("WAWebNewsletterGatingUtils").isNewsletterPollsVotersEnabled()?m.concat((j=l==null?void 0:l.others)!=null?j:[]):[],count:k,mode:"newsletter",contactVoters:m,otherVoters:(j=l==null?void 0:l.others)!=null?j:[]})}return f}function b(a){return{parentMsgKey:a.parentMsgKey.toString(),serverTimestamp:a.serverTimestamp,votesMap:a.voteCountMap}}function h(a,b){return a==null?null:{contact:a,id:a.id,time:(a=d("WATimeUtils").castMillisTimeToUnixTime(b))!=null?a:d("WATimeUtils").unixTime()}}g.aggregateNewsletterVotes=a;g.mapNewsletterVoteToDbRecord=b}),98); __d("WAWebNewsletterBackendAddOnsUtils",["Promise","WAWebCRUDOperationsNewsletterPollsVotes","WAWebDBProcessEditProtocolMsgs","WAWebModelStorageUtils","WAWebMsgType","WAWebNewsletterMapMsgAndAddOns","WAWebNewsletterMsgEditUtils","WAWebNewsletterPollsUtils","WAWebNewsletterReactionUtils","WAWebSchemaMessage","WAWebStoreMsgs","WAWebdbCRUDOperationsNewsletterReaction","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function a(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=a.msgs,e=a.reactions,f=a.reactionIdsToRemove,g=a.timestamp,h=a.ids,i=a.viewCounts;a=a.pollVotes;e.length>0&&(yield d("WAWebdbCRUDOperationsNewsletterReaction").createOrUpdateNewsletterReactions(e.map(d("WAWebNewsletterReactionUtils").mapReactionDataToDbRecord).filter(Boolean)));f.length>0&&(yield d("WAWebdbCRUDOperationsNewsletterReaction").bulkRemoveNewsletterReactionsForParentMsg(f));a.length>0&&(yield d("WAWebCRUDOperationsNewsletterPollsVotes").bulkCreateOrUpdateVotes(a.map(d("WAWebNewsletterPollsUtils").mapNewsletterVoteToDbRecord)));if(c.length>0){var j=new Map(c.map(function(a){return[a.id.toString(),a]})),k=[],l=[],m=[];e=(yield d("WAWebSchemaMessage").getMessageTable().bulkGet(c.map(function(a){return a.id.toString()})));e.forEach(function(a){if(a==null)return;var b=j.get(a.id);b!=null&&(b==null?void 0:b.kind)===d("WAWebMsgType").MsgKind.RevokedMessage&&a.type!==d("WAWebMsgType").MSG_TYPE.REVOKED?(l.push(b),m.push(a)):(b==null?void 0:b.t)!=null&&b.t>a.t&&k.push(b)});yield d("WAWebDBProcessEditProtocolMsgs").processEditProtocolMsgs(k.map(d("WAWebNewsletterMsgEditUtils").mapMsgToEditProtocolMsgLegacy));yield d("WAWebSchemaMessage").getMessageTable().bulkRemove(m.map(function(a){a=a.id;return a.toString()}));yield d("WAWebStoreMsgs").storeMsgs(l)}h.length>0&&(yield d("WAWebModelStorageUtils").getStorage().lock(["message"],function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a[0];var b=(yield a.bulkGet(h.map(function(a){return a.toString()})).then(function(a){return a.filter(Boolean)}));b=b.map(function(a){var b=a.id;a=a.viewCount;return{id:b,lastUpdateFromServerTs:g,viewCount:(b=i==null?void 0:i.get(b))!=null?b:a}});return a.bulkCreateOrMerge(b)});return function(b){return a.apply(this,arguments)}}()))});return i.apply(this,arguments)}function c(a,c,e){return a.reduce(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=(yield a);b=(yield d("WAWebNewsletterMapMsgAndAddOns").mapMsgAndAddOns(b,c,e));if(b==null)return a;var f=b.msgData,g=b.reactionData,h=b.id,i=b.viewCount;b=b.pollVoteData;h!=null&&(f==null?void 0:f.kind)!==d("WAWebMsgType").MsgKind.RevokedMessage&&a.ids.push(h);f!=null&&a.msgs.push(f);i!=null&&h!=null&&a.viewCounts.set(h.toString(),i);g==null?h!=null&&a.reactionIdsToRemove.push(h.toString()):a.reactions.push(g);b!=null&&a.pollVotes.push(b);return a});return function(b,c){return a.apply(this,arguments)}}(),(h||(h=b("Promise"))).resolve({ids:[],reactions:[],reactionIdsToRemove:[],msgs:[],viewCounts:new Map(),pollVotes:[]}))}g.updateAddOnDbRecords=a;g.getMsgsAndAddOnsFromUpdates=c}),98); __d("WAWebNewsletterMessageDeliveryUpdateToModelUtils",["Promise","WALogger","WAWebNewsletterDBUtils","WAWebNewsletterGetMessagesJob","WAWebNewsletterUpdateMsgsRecordsJob","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletter][getMessageDeliveryUpdatesModelToUpdate] couldn't retrieve message"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletter][getMessageDeliveryUpdatesModelToUpdate] Local DB doesn't contain message, we fetch from server."]);j=function(){return a};return a}function a(a,b,c){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e){var f=(yield d("WAWebNewsletterDBUtils").bulkGetMessagesByServerIds(c.map(function(a){return a.id}),a)),g=[];c=c.map(function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){var c=b.id,e=f.get(b.id);if(e==null){d("WALogger").DEV(j());c=(yield d("WAWebNewsletterGetMessagesJob").getNewsletterMessages(a,1,{after:c-1}));c=c.msgs[0];if(c==null){d("WALogger").DEV(i());return null}e=c;g.push(e)}return babelHelpers["extends"]({},b,{msgData:e,serverId:b.id,id:e.id})});return function(a){return c.apply(this,arguments)}}());g.length>0&&(yield d("WAWebNewsletterUpdateMsgsRecordsJob").addNewsletterMsgsRecords(g));var k=(yield d("WAWebNewsletterDBUtils").bulkGetMessagesByServerIds(e,a));e=e.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=k.get(a);return a==null?null:a.id});return function(b){return a.apply(this,arguments)}}());return{modelUpdatesToAdd:(yield (h||(h=b("Promise"))).all(c)).filter(Boolean),modelUpdatesToRemove:(yield h.all(e)).filter(Boolean)}});return k.apply(this,arguments)}g.getMessageDeliveryUpdatesModelToUpdate=a}),98); __d("WAWebNewsletterMetadataUpdateUtils",["WAWebBackendApi","WAWebContactProfilePicThumbBridge","WAWebDBBulkPersistProfilePic","WAWebNewsletterMetadataJob","WAWebNewsletterStorageUtils","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b,c){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){yield d("WAWebNewsletterMetadataJob").updateNewsletterMetadata(d("WAWebNewsletterStorageUtils").createNewsletterMetadataObjectForStorage(b));if(Object.prototype.hasOwnProperty.call(c,"eurl")){var e=d("WAWebWidFactory").createWid(c.id.toString());yield d("WAWebDBBulkPersistProfilePic").bulkPersistProfilePicChanges([d("WAWebContactProfilePicThumbBridge").mapProfilePictureToProfilePicThumbRowType(e,{id:e,tag:(e=c.tag)!=null?e:void 0,eurl:(e=c.eurl)!=null?e:void 0,previewEurl:(e=c.previewEurl)!=null?e:void 0,stale:c.stale,eurlStale:!1,timestamp:(e=c.timestamp)!=null?e:Date.now()})])}yield d("WAWebBackendApi").frontendSendAndReceive("updateNewsletterMetadata",{metadata:b,newsletter:a,pic:c})});return h.apply(this,arguments)}g.updateNewsletterMetadataAndPic=a}),98); __d("WAWebNewsletterMsgHistoryUtils",["Promise","WALogger","WAWebBackendApi","WAWebNewsletterBackendAddOnsUtils","WAWebNewsletterDBUtils","WAWebNewsletterGatingUtils","WAWebNewsletterGetMessagesJob","WAWebNewsletterSystemMessages","WAWebNewsletterUpdateMsgsRecordsJob","WAWebNewsletterValidationUtils","asyncToGeneratorRuntime","lodash"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[fillMsgHistoryGaps] Gaps filled for ",", "," messages retrieved from server"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[fillMsgHistoryGaps] "," identified for ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[fillMsgHistoryGaps] No gaps identified for ",", "," - ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[fillMsgHistoryGaps] Looking for gaps for ",", "," - ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[fillMsgHistoryGaps] No gaps to fill for ",", "," - ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["[fillMsgHistoryGaps] Only 1 message for ",""]);n=function(){return a};return a}function o(a,b){b===void 0&&(b=new Set());var c=[],e=function(e){var f=a[e-1].serverId;e=a[e].serverId;if(e==null||f==null)return"continue";e=e-f;if(e<=1)return"continue";e=Array.from({length:e-1},function(a,b){return b+f+1}).filter(function(a){return a>=d("WAWebNewsletterSystemMessages").EARLIEST_AVAILABLE_MESSAGE_ID&&!b.has(a)});if(e.length<=0)return"continue";while(e.length>0)c.push(e.splice(0,d("WAWebNewsletterGatingUtils").getMaxMsgCountFromServer()))};for(var f=1;f<a.length;f++){var g=e(f);if(g==="continue")continue}return c}function a(a){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=a.jid,f=a.msgs,g=a.range;a=a.serverIdsToSkip;a=a===void 0?new Set():a;if(f.length<2&&g==null){d("WALogger").DEV(n(),e);return f}var p=f[0].serverId,q=f[f.length-1].serverId;if(p==null||q==null)return[];if(p>=d("WAWebNewsletterDBUtils").TEMPORARY_SERVER_ID_LOWER_BOUND||q>=d("WAWebNewsletterDBUtils").TEMPORARY_SERVER_ID_LOWER_BOUND)return f;if(q-p+1===f.length&&g==null){d("WALogger").DEV(m(),e,q,p);return f}d("WALogger").DEV(l(),e,q,p);if(g!=null){var r=g.start;g=g.end;var s={serverId:Math.min(r,g)-1};r={serverId:Math.max(r,g)+1};g=o([s].concat(f).concat(r),a)}else g=o(f,a);if(g.length===0){d("WALogger").DEV(k(),e,q,p);return f}d("WALogger").DEV(j(),g.length,e).devConsole(g);s=g.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebNewsletterGetMessagesJob").getNewsletterMessages(d("WAWebNewsletterValidationUtils").toNewsletterJidOrThrow(String(e)),a.length,{after:a[0]-1})["catch"](function(){return null}));if(a!=null){d("WAWebBackendApi").frontendFireAndForget("updateNewsletterMessages",a);yield d("WAWebNewsletterBackendAddOnsUtils").updateAddOnDbRecords(a);return a.msgs}});return function(b){return a.apply(this,arguments)}}());r=c("lodash").flatten(yield (h||(h=b("Promise"))).all(s)).filter(Boolean);d("WAWebNewsletterUpdateMsgsRecordsJob").addNewsletterMsgsRecordsJob(r).fireAndForget();d("WALogger").DEV(i(),e,r.length);return c("lodash").sortBy(f.concat(r),"serverId")});return p.apply(this,arguments)}g.identifyMsgGaps=o;g.fillMsgHistoryGaps=a}),98); __d("WAWebSuspendInformDataModelUtils",["WALogger","WAWebNewsletterDBUtils","WAWebNewsletterGetMessagesJob","WAWebNewsletterUpdateMsgsRecordsJob","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletter][populateMsgModels] couldn't retrieve message"]);h=function(){return a};return a}function a(a,b){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=(yield d("WAWebNewsletterDBUtils").bulkGetMessagesByServerIds(a,b)),e=[],f=[],g=new Map();a.forEach(function(a){var b=c.get(a);b!=null?g.set(a,b):f.push(a)});a=f[0];var i,j=f[f.length-1];j-a+1===f.length&&(i=(yield d("WAWebNewsletterGetMessagesJob").getNewsletterMessages(b,f.length,{after:a-1})));(j=i)==null?void 0:j.msgs.forEach(function(a){if(a==null){d("WALogger").DEV(h());return}e.push(a);a.serverId!=null&&g.set(a.serverId,a)});e.length>0&&(yield d("WAWebNewsletterUpdateMsgsRecordsJob").addNewsletterMsgsRecords(e));return g});return i.apply(this,arguments)}g.populateMsgModels=a}),98); __d("WAWebGetNewsletterContextForForwardedMsg",["WAWebMsgGetters","WAWebMsgType","WAWebNewsletterMetadataCollection","WAWebWidFactory"],(function(a,b,c,d,e,f,g){function a(a){if(a.forwardedNewsletterMessageInfo!=null)return a.forwardedNewsletterMessageInfo;if(!d("WAWebMsgGetters").getIsNewsletterMsg(a))return void 0;var b=a.id.remote,e=c("WAWebNewsletterMetadataCollection").get(b);return{newsletterId:d("WAWebWidFactory").toNewsletterWid(b),newsletterName:e==null?void 0:e.name,serverMessageId:(b=a.serverId)!=null?b:void 0}}function b(a){var b=a.forwardable,c=a.source,e=a.destination;a=a.isOriginalMsgForwarded;if(!e.isNewsletter())return b;return e.equals(c)&&!a&&b.type!==d("WAWebMsgType").MSG_TYPE.POLL_RESULT_SNAPSHOT?babelHelpers["extends"]({},b,{isForwarded:!1,forwardedNewsletterMessageInfo:void 0,forwardingScore:void 0}):b}g.getNewsletterContextForForwardedMsg=a;g.maybeStripNewsletterForwardMetadata=b}),98); __d("WAWebNewsletterModelUtils",["WALogger","WATimeUtils","WAWebCommonNewsletterEnums","WAWebNewsletterGatingUtils","WAWebNewsletterMetadataCollection","WAWebWid","WAWebWidFactory","err","lodash"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Encountered unexpected newsletter capability: ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletter][throwIfNewsletterNotPreview] ",""]);i=function(){return a};return a}var j=1,k=-1,l=0;function m(a){return a==="verified"}function a(a){a=s(a);n(a);return o(a)}function n(a){var b;b=(b=a.newsletterMembershipMetadataMixin)==null?void 0:b.membershipType;b=b==null||b==="guest";if(!b){b="Trying to map an already subscribed newsletter";d("WALogger").ERROR(i(),b).tags("newsletter").devConsole(a).sendLogs("newsletter-converting-already-subscribed-newsletter")}}function o(a){a=q(a);a.muteExpiration=k;a.isReadOnly=!0;return a}function p(a){return a==="admin"||a==="owner"}function q(a){var b,e,f,g;b=(b=a.newsletterNameMetadataMixin)==null?void 0:b.nameElementValue;e=(e=a.newsletterMembershipMetadataMixin)==null?void 0:e.membershipType;f=(f=a.newsletterMutedMetadataMixin)==null?void 0:f.mutedState;var h=f==="on"?k:l;g=(g=a.newsletterCreationTimeMetadataMixin)==null?void 0:g.creationTimeValue;a={id:d("WAWebWidFactory").createWid(a.idJid),name:b!=null?b:void 0,isReadOnly:e!=null?!p(e):void 0,muteExpiration:f!=null&&f!=="undefined"?h:void 0,t:g!=null?d("WATimeUtils").castToUnixTime(g):void 0};return c("lodash").pickBy(a,function(a){return a!=null})}function r(a){a=t(a);a.membershipType=d("WAWebCommonNewsletterEnums").NewsletterMembershipType.Guest;return a}function s(a){return{idJid:a.idJid,newsletterCreationTimeMetadataMixin:a.newsletterCreationTimeMetadataMixin,newsletterNameMetadataMixin:a.newsletterNameMetadataMixin,newsletterPictureMetadataMixin:a.newsletterPictureMetadataMixin,newsletterDescriptionMetadataMixin:a.newsletterDescriptionMetadataMixin,newsletterInviteLinkMetadataMixin:a.newsletterInviteLinkMetadataMixin,newsletterSubscribersMetadataMixin:a.newsletterSubscribersMetadataMixin,newsletterPrivacyMetadataMixin:a.newsletterPrivacyMetadataMixin,newsletterVerificationMetadataMixin:a.newsletterVerificationMetadataMixin,hasNewsletterLinkedAccountsMetadataMixin:!1,newsletterMembershipMetadataMixin:null,newsletterMutedMetadataMixin:{mutedState:"undefined"},newsletterStateMetadataMixin:null}}function b(a){a=s(a);n(a);return r(a)}function t(a){var b,e,f,g,h;b=(b=a.newsletterVerificationMetadataMixin)==null?void 0:b.verificationState;e=(e=a.newsletterStateMetadataMixin)==null?void 0:e.stateType;f=(f=a.newsletterMembershipMetadataMixin)==null?void 0:f.membershipType;g=(g=a.newsletterPrivacyMetadataMixin)==null?void 0:g.privacyType;b=babelHelpers["extends"]({id:d("WAWebWidFactory").createWid(a.idJid),creationTime:(h=a.newsletterCreationTimeMetadataMixin)==null?void 0:h.creationTimeValue,name:(h=a.newsletterNameMetadataMixin)==null?void 0:h.nameElementValue,nameUpdateTime:(h=a.newsletterNameMetadataMixin)==null?void 0:h.nameUpdateTime,description:(h=a.newsletterDescriptionMetadataMixin)==null?void 0:(h=h.descriptionQueryDescriptionResponseMixin)==null?void 0:h.elementValue,descriptionUpdateTime:(h=a.newsletterDescriptionMetadataMixin)==null?void 0:(h=h.descriptionQueryDescriptionResponseMixin)==null?void 0:h.updateTime,inviteCode:(h=a.newsletterInviteLinkMetadataMixin)==null?void 0:h.inviteCode,size:(h=a.newsletterSubscribersMetadataMixin)==null?void 0:h.subscribersCount,verified:b!=null?m(b):void 0,membershipType:f!=null?d("WAWebCommonNewsletterEnums").NewsletterMembershipType.cast(f):void 0,reactionCodesSetting:Object.prototype.hasOwnProperty.call(a,"newsletterReactionCodesSettingMetadataMixin")?(h=a==null?void 0:a.newsletterReactionCodesSettingMetadataMixin)!=null?h:d("WAWebCommonNewsletterEnums").NewsletterReactionCodesSetting.All:void 0,privacy:g!=null?d("WAWebCommonNewsletterEnums").NewsletterPrivacy.cast(g):void 0,website:void 0,suspended:e!=null?d("WAWebCommonNewsletterEnums").NewsletterState.cast(e)===d("WAWebCommonNewsletterEnums").NewsletterState.Suspended||d("WAWebCommonNewsletterEnums").NewsletterState.cast(e)===d("WAWebCommonNewsletterEnums").NewsletterState.GeoSuspended:void 0,geosuspended:e!=null?d("WAWebCommonNewsletterEnums").NewsletterState.cast(e)===d("WAWebCommonNewsletterEnums").NewsletterState.GeoSuspended:void 0},d("WAWebNewsletterGatingUtils").isWamoSubExperienceEnabled()&&{wamoSubPlanId:a.newsletterWamoSubPlanIdMetadataMixin,wamoSubStatus:a.newsletterWamoSubStatusMetadataMixin});return c("lodash").pickBy(b,function(a){return a!=null})}var u="https://pps.whatsapp.net";function v(a){if(a==null||a==="")return null;a=new URL(a,u);return a.href}function w(a,b){a=d("WAWebWidFactory").createWid(a);if(b.length===0)return{id:a};var e,f;for(b of b){var g=b.queryPictureDirectPathOrEmptyResponseMixinGroup;if(g.name==="QueryPictureDirectPathResponse")g.value.type==="preview"?f=g.value:g.value.type==="image"&&(e=g.value);else if(g.name==="QueryPictureEmptyResponse")return{id:a,timestamp:Date.now(),eurl:null,previewEurl:null,eurlStale:!1,stale:!1}}b={id:a,timestamp:Date.now(),tag:(b=(g=e)==null?void 0:g.id)!=null?b:(a=f)==null?void 0:a.id,eurl:v((b=(g=e)==null?void 0:g.directPath)!=null?b:(a=f)==null?void 0:a.directPath),previewEurl:v((g=f)==null?void 0:g.directPath),eurlStale:!1,stale:!1};return c("lodash").pickBy(b,function(a){return a!=null})}function e(a){return{chat:q(a),metadata:t(a),pic:w(a.idJid,(a=(a=a.newsletterPictureMetadataMixin)==null?void 0:a.picture)!=null?a:[])}}function f(a){if(c("WAWebWid").isNewsletter(a)){var b;return(b=c("WAWebNewsletterMetadataCollection").get(a))==null?void 0:b.membershipType}return(b=c("WAWebNewsletterMetadataCollection").filter(function(b){return b.inviteCode===a})[0])==null?void 0:b.membershipType}function x(a){return a===k}function y(a){switch(a){case"INSIGHTS":return d("WAWebCommonNewsletterEnums").NewsletterCapability.Insights;case"PHOTO_POLLS":return d("WAWebCommonNewsletterEnums").NewsletterCapability.PhotoPolls;case"QUESTIONS":return d("WAWebCommonNewsletterEnums").NewsletterCapability.QUESTIONS;default:a;d("WALogger").WARN(h(),a).tags("newsletter-capabilities").sendLogs("Unexpected newsletter capability");return d("WAWebCommonNewsletterEnums").NewsletterCapability.Insights}}g.DEFAULT_NEWSLETTER_ADMIN_COUNT=j;g.MUTED_STATE=k;g.UNMUTED_STATE=l;g.mapDirectoryNewsletterToChat=a;g.mapPreviewNewsletterToChat=o;g.isMembershipAdminOrOwner=p;g.mapNewsletterToChat=q;g.mapPreviewNewsletterToMetadata=r;g.convertDirectoryNewsletterMetadataToNewsletterMetadata=s;g.mapDirectoryNewsletterToMetadata=b;g.mapNewsletterToMetadata=t;g.mapPicturesToProfilePicThumb=w;g.mapNewsletterToModels=e;g.getRoleByIdentifier=f;g.isMuted=x;g.getNewsletterCapabilityFromValue=y}),98); __d("WAWebNewsletterReactionUtils",["WATimeUtils","WAWebContactCollection","WAWebEmoji","WAWebFrontendContactGetters","WAWebProfilePicThumbCollection","WAWebReactionsModels","WAWebUserPrefsMeUser"],(function(a,b,c,d,e,f,g){function a(a){var b;return{serverTimestamp:(b=a.reactionCountMapTs)!=null?b:d("WATimeUtils").unixTime(),emojiCountMap:(b=a.reactionCountMap)!=null?b:new Map(),parentMsgKey:a.id.toString()}}function b(a){if(a.length===0)return{reactions:[],count:0};a=a.map(i);return h(a)}function h(a){var b=0,c=new Map();for(a of a){var d=a.reactions,e=a.count;b+=e;for(e of d.entries()){d=e[0];var f=e[1],g=f[0];f=f[1];var h=c.get(d);h!=null?(h.count+=f,h.reaction=babelHelpers["extends"]({},h.reaction,{reactionSenders:h.reaction.reactionSenders.concat(g.reactionSenders)}),c.set(d,h)):c.set(d,{reaction:g,count:f})}}h=Array.from(c.values()).sort(function(a,b){var c=a.count;a=a.reaction;var d=b.reaction;b=b.count;if(a.reactionByMe!=null)return-1;return d.reactionByMe!=null?1:b-c}).map(function(b){var a=b.reaction;b=b.count;return[a,b]});return{count:b,reactions:h}}function i(a){var b=new Map(),c=a.myReaction,e=a.myReactionMsgKey,f=new Map(a.reactionCountMap);c!=null&&c!==""&&!f.has(c)&&f.set(c,1);var g=0;f=j(f);for(f of f.entries()){var h=f[0],i=f[1];g+=i.count;b.set(h,[{reactionAggregate:h,reactionSenders:l(h,a),reactionByMe:c!=null&&e!=null&&h===d("WAWebEmoji").EmojiUtil.getEmojiAggregate(c)?{msgKey:e.toString(),orphan:0,parentMsgKey:a.id.toString(),reactionText:d("WAWebEmoji").EmojiUtil.getNormalizedOrTofu(c),senderUserJid:d("WAWebUserPrefsMeUser").getMeUser().toJid(),timestamp:(h=a.myReactionTs)!=null?h:0}:null},i.count])}return{reactions:b,count:g}}function j(a){var b=new Map();for(a of a.entries()){var c,e=a[0],f=a[1],g=d("WAWebEmoji").EmojiUtil.getEmojiAggregate(e);e=d("WAWebEmoji").EmojiUtil.getNormalizedOrTofu(e);c=(c=b.get(g))!=null?c:{count:0,reactions:new Map()};c.reactions.set(e,f);c.count+=f;b.set(g,c)}return b}function k(a){var b=new Map();a.reactions.map(function(a){var c,e=a.reactionCode;a=a.senderList;e=d("WAWebEmoji").EmojiUtil.getEmojiAggregate(e);c=(c=b.get(e))!=null?c:[];b.set(e,c.concat(a))});return b}function c(a){a=k(a);var b=new Map();for(a of a.entries()){var c=a[0],e=a[1];e=e.sort(function(a,b){a=(a==null?void 0:a.id)!=null?d("WAWebContactCollection").ContactCollection.get(a.id):null;b=(b==null?void 0:b.id)!=null?d("WAWebContactCollection").ContactCollection.get(b.id):null;var c=(a==null?void 0:a.type)==="in",e=(b==null?void 0:b.type)==="in";if(c&&a&&b&&e){a=d("WAWebProfilePicThumbCollection").ProfilePicThumbCollection.get(a.id)!=null;b=d("WAWebProfilePicThumbCollection").ProfilePicThumbCollection.get(b.id)!=null;return a===b?0:a?-1:1}else if(!c&&!e)return 0;return c?-1:1}).slice(0,5);e=e.map(function(a){return(a==null?void 0:a.id)!=null?a.id:a==null?void 0:a.profileUrl}).filter(Boolean);b.set(c,e)}return b}function e(a){var b=[];a.reactions.map(function(a){var c=a.reactionCode;a=a.senderList;a.map(function(a){if((a==null?void 0:a.id)==null)return;a=d("WAWebContactCollection").ContactCollection.get(a.id);(a==null?void 0:a.type)==="in"&&b.push({reaction:c,contact:a})})});return b.sort(function(a,b){a=d("WAWebFrontendContactGetters").getFormattedUser(a.contact);b=d("WAWebFrontendContactGetters").getFormattedUser(b.contact);return a.localeCompare(b)})}function l(a,b){var c=b.myReaction,e=c!=null&&a===d("WAWebEmoji").EmojiUtil.getEmojiAggregate(c);return[new(d("WAWebReactionsModels").ReactionsSenders)({id:b.id,reactionText:e?c:a,senderUserJid:e?d("WAWebUserPrefsMeUser").getMeUser().toJid():b.id.remote.toJid(),timestamp:b.reactionCountMapTs})]}function f(a){var b=a.serverTimestamp,c=a.emojiCountMap;a=a.parentMsgKey;if(b==null||c==null)return;return{serverTimestamp:b,emojiCountMap:c,parentMsgKey:a.toString()}}g.mapFrontendReactionToBackend=a;g.aggregateAndSortReactions=b;g.getReactionSendersForFacePile=c;g.getContactReactionSenders=e;g.mapReactionDataToDbRecord=f}),98); __d("WAWebNewsletterSystemMessages",["Promise","WATimeUtils","WAWebCommonNewsletterEnums","WAWebContactSystemMsg","WAWebMsgKey","WAWebMsgModelFromData","WAWebMsgType","WAWebNewsletterGatingUtils","WAWebNewsletterUpdateMsgsRecordsJob","WAWebUserPrefsMeUser","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h,i=new Map([["newsletter_privacy",10],["newsletter_created",20],["newsletter_admin_context_card",30],["newsletter_deleted",Number.MAX_SAFE_INTEGER]]),j=100,k=2147476647;function a(a){a=a.serverId;return a==null?!1:a<j}function e(a){a=a.serverId;if(a==null)return!1;var b=Array.from(i.values());b=Math.min.apply(Math,b);return a===b}function l(a,b){var e=i.get(b.subtype);b=babelHelpers["extends"]({},d("WAWebContactSystemMsg").genNotificationMsg(a,babelHelpers["extends"]({type:d("WAWebMsgType").MSG_TYPE.NEWSLETTER_NOTIFICATION,kind:d("WAWebMsgType").MsgKind.NewsletterNotification},b,{serverId:e,templateParams:(b=b.templateParams)!=null?b:[]})),{id:new(c("WAWebMsgKey"))({fromMe:d("WAWebUserPrefsMeUser").isMeAccount(a),remote:a,id:e!=null?e.toString(10):c("WAWebMsgKey").newId_DEPRECATED()})});return b}function m(a){var b=a.id,c=a.name,e=a.t;a=a.role;a=(a=a)!=null?a:d("WAWebCommonNewsletterEnums").NewsletterMembershipType.Subscriber;e=e!=null?d("WATimeUtils").castToUnixTime(e):d("WATimeUtils").unixTime();var f=l(d("WAWebWidFactory").createWid(b.toString()),{subtype:"newsletter_privacy",templateParams:[a],t:e});c=l(d("WAWebWidFactory").createWid(b.toString()),{subtype:"newsletter_created",templateParams:c!=null?[c,a]:[],t:e});if(d("WAWebNewsletterGatingUtils").isNewsletterAdminContextCardEnabled(a)){a=l(d("WAWebWidFactory").createWid(b.toString()),{subtype:"newsletter_admin_context_card",templateParams:[b.toString()],t:e});return[f,c,a]}return[f,c]}function f(a){return a.addQueue.enqueue((h||(h=b("Promise"))).resolve().then(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var b;b=m({id:a.id,name:a.name,t:(b=a.newsletterMetadata)==null?void 0:b.creationTime,role:(b=a.newsletterMetadata)==null?void 0:b.membershipType});var c=b.map(d("WAWebMsgModelFromData").msgModelFromMsgData);yield d("WAWebNewsletterUpdateMsgsRecordsJob").addNewsletterMsgsRecords(b);a.msgs.add(c,{at:0});return c})))}function n(a){var b=a.id;a=a.name;b=l(d("WAWebWidFactory").createWid(b.toString()),{subtype:"newsletter_deleted",templateParams:[a],t:d("WATimeUtils").unixTime()});return[b]}g.EARLIEST_AVAILABLE_MESSAGE_ID=j;g.LATEST_AVAILABLE_MESSAGE_ID=k;g.isNewsletterSystemMsg=a;g.isEarliestNewsletterSystemMsg=e;g.genNewsletterCreationSystemMessages=m;g.addSystemMessagesToChat=f;g.genNewsletterDeletionSystemMessages=n}),98); __d("WAWebGetNewsletterCursor",["WAWebNewsletterSystemMessages"],(function(a,b,c,d,e,f,g){function a(a,b,c){c=c.length>0?c:a.toArray();c=b==="before"?(a=c[0])==null?void 0:a.serverId:(a=c[c.length-1])==null?void 0:a.serverId;return c==null?null:(a={},a[b]=h(c),a)}function h(a){return Math.min(Math.max(a,d("WAWebNewsletterSystemMessages").EARLIEST_AVAILABLE_MESSAGE_ID-1),d("WAWebNewsletterSystemMessages").LATEST_AVAILABLE_MESSAGE_ID)}g.getNewsletterCursor=a}),98); __d("WAWebFetchNewsletterProfilePicAction",["WAJids","WAWebNewsletterMetadataJob","WAWebNewsletterModelUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b={id:a},c=d("WAJids").toNewsletterJid(a.toString());a=d("WAWebNewsletterModelUtils").getRoleByIdentifier(a);a=(yield d("WAWebNewsletterMetadataJob").getNewsletterMetadata(c,a,{picture:!0}));a=a==null?void 0:(a=a.newsletterPictureMetadataMixin)==null?void 0:a.picture;if(a==null)return b;c=d("WAWebNewsletterModelUtils").mapPicturesToProfilePicThumb(c,a);return babelHelpers["extends"]({},b,{tag:(a=c.tag)!=null?a:void 0,eurl:(b=c.eurl)!=null?b:void 0,previewEurl:(a=c.previewEurl)!=null?a:void 0,stale:c.stale,eurlStale:!1,timestamp:(b=c.timestamp)!=null?b:Date.now()})});return h.apply(this,arguments)}g.fetchNewsletterProfilePic=a}),98); __d("WAWebNewsletterGetMessageUpdatesAction",["Promise","WAJids","WALogger","WATimeUtils","WAWebNewsletterBridgeApi","WAWebNewsletterGatingUtils","WAWebNewsletterGetMessageUpdatesJob","WAWebNewsletterMetadataJob","WAWebNewsletterSystemMessages","WAWebNewsletterValidationUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[maybeUpdateMsgsAddOns] Failed to update messages"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletter][maybeUpdateMsgsAddOns] Failed to geosuspend channel "," on receiving 451 error - ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletter][maybeUpdateMsgsAddOns] Failed to suspend channel "," on receiving 423 error - ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose([""," updated UI, exiting"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose([""," updated db records"]);m=function(){return a};return a}function a(){var b=babelHelpers.taggedTemplateLiteralLoose([""," Couldn't find a message with server id"]);a=function(){return b};return b}function n(){var a=babelHelpers.taggedTemplateLiteralLoose([""," updating, earliest server id in batch ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["[maybeUpdateMsgsAddOns] should not update, exiting"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose([""," init, earliestMsgUpdateTs=",""]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose([""," no messages, exit"]);q=function(){return a};return a}function c(a,b){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){var e="[maybeUpdateMsgsAddOns]["+c.id.toJid()+"]";if(a.length===0){d("WALogger").DEV(q(),e);return}a=a.filter(function(a){return a.serverId==null?!1:a.serverId>=d("WAWebNewsletterSystemMessages").EARLIEST_AVAILABLE_MESSAGE_ID&&a.serverId<=d("WAWebNewsletterSystemMessages").LATEST_AVAILABLE_MESSAGE_ID});var f=Math.min.apply(Math,a.map(function(a){return(a=a.lastUpdateFromServerTs)!=null?a:0}));d("WALogger").DEV(p(),e,f);if(!s(f)){d("WALogger").DEV(o());return}var g=Math.min.apply(Math,a.map(function(a){return a.serverId}).filter(Boolean));d("WALogger").DEV(n(),e,g);if(!Number.isSafeInteger(g))return;try{g=g-1;var r=0,t=[];while(r<a.length){var u=Math.min(a.length-r,d("WAWebNewsletterGatingUtils").getMaxMsgCountFromServer());t.push(d("WAWebNewsletterGetMessageUpdatesJob").getNewsletterMessageUpdates(d("WAWebNewsletterValidationUtils").toNewsletterJidOrThrow(c.id.toJid()),{cursor:{after:g},count:u,since:f>0?f:void 0,ids:a.map(function(a){return a.id})}));g+=u;r+=u}u=(yield (h||(h=b("Promise"))).all(t));u.forEach(function(a){d("WALogger").DEV(m(),e).devConsole(a),void d("WAWebNewsletterBridgeApi").NewsletterBridgeApi.updateNewsletterMessages(a),d("WALogger").DEV(l(),e)})}catch(a){if((a==null?void 0:a.status)===423)try{yield d("WAWebNewsletterMetadataJob").suspendNewsletter(d("WAJids").toNewsletterJid(c.id.toJid())),void d("WAWebNewsletterBridgeApi").NewsletterBridgeApi.suspendNewsletter({id:c.id})}catch(a){d("WALogger").ERROR(k(),c.id.toString(),a.name).devConsole(a).tags("newsletter").sendLogs("newsletter-maybe-update-msg-addons-suspend-error");return}else if((a==null?void 0:a.status)===451)try{yield d("WAWebNewsletterMetadataJob").geosuspendNewsletter(d("WAJids").toNewsletterJid(c.id.toJid())),void d("WAWebNewsletterBridgeApi").NewsletterBridgeApi.geosuspendNewsletter({id:c.id})}catch(a){d("WALogger").ERROR(j(),c.id.toString(),a.name).devConsole(a).tags("newsletter").sendLogs("newsletter-maybe-update-msg-addons-geosuspend-error");return}d("WALogger").ERROR(i()).devConsole(a).tags("newsletter")}});return r.apply(this,arguments)}function s(a){return!Number.isSafeInteger(a)?!1:d("WATimeUtils").unixTime()-a>d("WAWebNewsletterGatingUtils").getPullMessageUpdatesThresholdSeconds()}g.maybeUpdateMsgsAddOns=c}),98); __d("WAWebNewsletterGetNewsletterEnforcementsUpdatesAction",["WAJobOrchestratorTypes","WALogger","WAWebGetNewsletterEnforcementsJob","WAWebNewsletterValidationUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletters][getNewsletterEnforcementsUpdatesAction] Failed to get NewsletterEnforcements updates"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletters][getNewsletterEnforcementsUpdatesAction] Start"]);i=function(){return a};return a}function a(a,b){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b===void 0&&(b=d("WAJobOrchestratorTypes").JOB_PRIORITY.HIGH);d("WALogger").DEV(i());try{a=d("WAWebNewsletterValidationUtils").toNewsletterJidOrThrow(a.toJid());a=(yield d("WAWebGetNewsletterEnforcementsJob").getNewsletterEnforcements(a,b));if(a==null)return;b=a.enforcementData;a=a.msgModelMap;return{enforcementData:b,msgModelMap:a}}catch(a){d("WALogger").ERROR(h()).tags("newsletter").devConsole(a).sendLogs("newsletter-failed-to-get-NewsletterEnforcements-updates")}});return j.apply(this,arguments)}g.getNewsletterEnforcementsUpdatesAction=a}),98); __d("WAWebNewsletterMessageDeliveryUpdateAction",["WAJids","WAWebNewsletterMetadataJob","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){yield d("WAWebNewsletterMetadataJob").updateNewsletterMessageDeliveryUpdates(d("WAJids").toNewsletterJid(a.id.toString()),[],b.map(function(a){return a.serverId}).filter(Boolean));(a=a.newsletterMetadata)==null?void 0:a.messageDeliveryUpdates.remove(b.map(function(a){return a.id}))});return h.apply(this,arguments)}g.removeMessageDeliveryUpdates=a}),98); __d("WAWebNewsletterPullMessagesFromServerAction",["Promise","WAAbortError","WALogger","WARaceSignal","WAWebApiChat","WAWebChatGetters","WAWebChatSeenBridge","WAWebMsgModelFromData","WAWebNewsletterBackendAddOnsUtils","WAWebNewsletterBridgeApi","WAWebNewsletterErrors","WAWebNewsletterGetMessagesJob","WAWebNewsletterUpdateMsgsRecordsJob","WAWebNewsletterValidationUtils","WAWebStateUtils","WAWebUpdateUnreadChatAction","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[updateNewsletterAddons], updating"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[pullNewsletterMessagesFromServer] failed to pull newsletter messages from server"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose([""," no messages retrieved from server, skip models update"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose([""," local collections and db updated"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose([""," loaded "," messages from server"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose([""," early returning loadRecentPromise"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose([""," early returning loadEarlierPromise"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose([""," start pulling messages"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["[pullNewsletterMessagesFromServer] not a newsletter"]);q=function(){return a};return a}function a(a,e){var f=d("WAWebStateUtils").unproxy(a);if(!d("WAWebChatGetters").getIsNewsletter(f)){d("WALogger").ERROR(q());return(h||(h=b("Promise"))).reject(new(d("WAWebNewsletterErrors").UnexpectedNonNewsletterChatError)())}return e.messageCount<0?(h||(h=b("Promise"))).resolve([]):c("WARaceSignal")([e.signal,f.getDeleteSignal()].filter(Boolean),function(a){return v(f,babelHelpers["extends"]({},e,{signal:a}))})}function r(a,b,c){switch(b){case"before":a.msgs.msgLoadState.isLoadingEarlierMsgs=c;break;case"after":a.msgs.msgLoadState.isLoadingRecentMsgs=c;break}}function s(a,c,d){return c.length===0?(h||(h=b("Promise"))).resolve():a.addQueue.enqueue((h||(h=b("Promise"))).resolve().then(function(){a.msgs.add(c,d==="before"?{at:0}:void 0);if(d==="after"){var b,e=Math.max.apply(null,c.map(function(a){return a.t}));a.t=Math.max((b=a.t)!=null?b:0,e)}}))}function t(a,b){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=(yield d("WAWebApiChat").getChatMeta(a.id));c=c.unreadCount;c=Math.max(c-b,0);yield d("WAWebChatSeenBridge").markConversationSeen(a.id,c);yield d("WAWebUpdateUnreadChatAction").updateUnreadCountMD(a,0,!1)});return u.apply(this,arguments)}function v(a,b){return w.apply(this,arguments)}function w(){w=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){if(c.signal.aborted)throw new(d("WAAbortError").AbortError)();var e=c.messageCount,f=c.cursor,g=c.shouldUpdateMsg,i=f==null||f.after!=null?"after":"before",q="[pullNewsletterMessagesFromServer]["+a.id.toJid()+"]["+i+"]";d("WALogger").DEV(p(),q);var u=a.msgs.msgLoadState,v=u.isLoadingEarlierMsgs;u=u.isLoadingRecentMsgs;if(i==="before"&&v){d("WALogger").DEV(o(),q);return a.msgs.loadEarlierPromise}if(i==="after"&&u){d("WALogger").DEV(n(),q);return a.msgs.loadRecentPromise}r(a,i,!0);try{if(c.signal.aborted)throw new(d("WAAbortError").AbortError)();var w=d("WAWebNewsletterValidationUtils").toNewsletterJidOrThrow(a.id.toJid());v=(h||(h=b("Promise"))).resolve().then(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var j=(yield d("WAWebNewsletterGetMessagesJob").getNewsletterMessages(w,e,f)),n=g!=null?j.msgs.filter(g):j.msgs,o=n.map(d("WAWebMsgModelFromData").msgModelFromMsgData);d("WALogger").DEV(m(),q,o.length);if(c.signal.aborted)throw new(d("WAAbortError").AbortError)();o.length>0?(yield (h||(h=b("Promise"))).all([d("WAWebNewsletterUpdateMsgsRecordsJob").addNewsletterMsgsRecords(n),x(j),s(a,o,i)]),c.resetUnreadCount===!0&&(yield t(a,o.length)),d("WALogger").DEV(l(),q)):d("WALogger").DEV(k(),q);r(a,i,!1);return j.msgs.map(d("WAWebMsgModelFromData").msgModelFromMsgData)}));i==="before"?a.msgs.loadEarlierPromise=v:i==="after"&&(a.msgs.loadRecentPromise=v);return yield v}catch(a){d("WALogger").ERROR(j()).tags("newsletter").devConsole(a);throw a}});return w.apply(this,arguments)}function x(a){return y.apply(this,arguments)}function y(){y=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.reactions,c=a.pollVotes,e=a.timestamp;d("WALogger").DEV(i()).devConsole(b);yield d("WAWebNewsletterBackendAddOnsUtils").updateAddOnDbRecords(a);a=b.map(function(a){return a.parentMsgKey});return d("WAWebNewsletterBridgeApi").NewsletterBridgeApi.updateNewsletterMessages({reactions:b,ids:a,timestamp:e,pollVotes:c})});return y.apply(this,arguments)}g.pullNewsletterMessagesFromServer=a}),98); __d("WAWebNewsletterReparseMsgAction",["WAWebBackendApi","WAWebHandleMsgTypes.flow","WAWebNewsletterFutureProofUtils","WAWebNewsletterUpdateMsgsRecordsJob","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.futureproofBuffer,c=a.futureproofType,e=a.futureproofSubtype;if(b!=null||c==null)return a;if(!d("WAWebNewsletterFutureProofUtils").isMsgSupported(a))return a;b=babelHelpers["extends"]({},a,{type:c,kind:c,subtype:e,futureproofType:void 0,futureproofSubtype:void 0});yield d("WAWebNewsletterUpdateMsgsRecordsJob").addNewsletterMsgsRecords([b]);yield d("WAWebBackendApi").frontendSendAndReceive("updateMessageUI",{msg:b,chatId:a.id.remote,messageOverwriteOption:d("WAWebHandleMsgTypes.flow").MessageOverwriteOption.RETRY});return b});return h.apply(this,arguments)}g.reparseNewsletterMsg=a}),98); __d("WAWebWamEnumChannelEventType",[],(function(a,b,c,d,e,f){a=Object.freeze({FOLLOW:1,UNFOLLOW:2,MUTE:3,UNMUTE:4,PREMIUM_SUBSCRIBE:5,PREMIUM_UNSUBSCRIBE:6,CHANNEL_PREMIUM_SETUP:7,CHANNEL_PREMIUM_CANCEL:8});f.CHANNEL_EVENT_TYPE=a}),66); __d("WAWebNewsletterToggleMuteStateAction",["WAJids","WALogger","WAWebNewsletterAttributionLogging","WAWebNewsletterBridgeApi","WAWebNewsletterCollection","WAWebNewsletterToggleMuteStateJob","WAWebWamEnumChannelEventType","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletter][unmuteNewsletterAction] failed to unmute the newsletter"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletter][unmuteNewsletterAction] called with a non-newsletter chat"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletter][muteNewsletterAction] failed to mute the newsletter"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletter][muteNewsletterAction] called with a non-newsletter chat"]);k=function(){return a};return a}function a(a,b){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=b.eventSurface;if(!a.isNewsletter()){d("WALogger").ERROR(k()).tags("newsletter").devConsole(a).sendLogs("mute-not-a-newsletter");return}try{d("WAWebNewsletterAttributionLogging").NewsletterCoreEventLogger.log({eventSurface:b,cid:a,channelCoreEventType:d("WAWebWamEnumChannelEventType").CHANNEL_EVENT_TYPE.MUTE});b=c("WAWebNewsletterCollection").get(a);if(b==null)throw c("err")("Failed to retrieve newsletter");b.mute.promises.mute=d("WAWebNewsletterToggleMuteStateJob").muteNewsletter([d("WAJids").toNewsletterJid(a.toJid())]).then(function(){return{status:200}})["catch"](function(){return{status:400}});yield b.mute.promises.mute;yield d("WAWebNewsletterBridgeApi").NewsletterBridgeApi.muteNewsletter({id:a})}catch(a){d("WALogger").ERROR(j()).tags("newsletter").devConsole(a).sendLogs("newsletter-mute-action-failed")}});return l.apply(this,arguments)}function e(a,b){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=b.eventSurface;if(!a.isNewsletter()){d("WALogger").ERROR(i()).tags("newsletter").devConsole(a).sendLogs("mute-not-a-newsletter");return}try{d("WAWebNewsletterAttributionLogging").NewsletterCoreEventLogger.log({eventSurface:b,cid:a,channelCoreEventType:d("WAWebWamEnumChannelEventType").CHANNEL_EVENT_TYPE.UNMUTE});b=c("WAWebNewsletterCollection").get(a);if(b==null)throw c("err")("Failed to retrieve newsletter");b.mute.promises.unmute=d("WAWebNewsletterToggleMuteStateJob").unmuteNewsletter([d("WAJids").toNewsletterJid(a.toJid())]).then(function(){return{status:200}})["catch"](function(){return{status:400}});yield b.mute.promises.unmute;yield d("WAWebNewsletterBridgeApi").NewsletterBridgeApi.unmuteNewsletter({id:a})}catch(a){d("WALogger").ERROR(h()).tags("newsletter").devConsole(a).sendLogs("newsletter-unmute-action-failed")}});return m.apply(this,arguments)}g.muteNewsletterAction=a;g.unmuteNewsletterAction=e}),98); __d("WAWebQueryAndUpdateNewslettersMetadataAction",["$InternalEnum","Promise","WAJids","WAJobOrchestratorTypes","WALogger","WAWebBackendErrors","WAWebCommonNewsletterEnums","WAWebContactCollection","WAWebContactProfilePicThumbBridge","WAWebCreateChat","WAWebDBBulkPersistProfilePic","WAWebNewsletterBridgeApi","WAWebNewsletterCollection","WAWebNewsletterDeleteChatJob","WAWebNewsletterGetAdminCapabilitiesJob","WAWebNewsletterGetAdminCountJob","WAWebNewsletterGetNewsletterEnforcementsUpdatesAction","WAWebNewsletterMembershipUtil","WAWebNewsletterMetadataCollection","WAWebNewsletterMetadataJob","WAWebNewsletterModelUtils","WAWebNewsletterPullMessagesFromServerAction","WAWebNewsletterStorageUtils","WAWebNewsletterSystemMessages","WAWebNewsletterUpdateNewslettersRecordsJob","WAWebNoop","WAWebProfilePicThumbCollection","WAWebSchemaChat","WAWebViewMode.flow","WAWebViewModeUtils","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletters][queryAndUpdateAllNewsletterMetadataAction][messages] End"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletters][queryAndUpdateAllNewsletterMetadataAction][messages] Start"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletters][queryAndUpdateAllNewsletterMetadataAction] Update local model"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletters][updateCollections][picture] Persist changes to DB"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletters][updateCollections][metadata] Persist changes to DB"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletters][updateCollections][chat] Persist changes to DB"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletters][updateCollections] Start"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletter][queryAndUpdateNewsletterMetadataAction] Failed to retrieve newsletter metadata"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletters][queryAndUpdateNewsletterMetadataAction] End"]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletters][queryAndUpdateNewsletterMetadataAction] Start"]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletter][queryAndUpdateAllNewsletterMetadataAction] Failed to retrieve the list of newsletters"]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletters][queryAndUpdateAllNewsletterMetadataAction] End"]);t=function(){return a};return a}function u(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletters][getNewsletterEnforcementsUpdatesAction] Update local model"]);u=function(){return a};return a}function v(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletters][queryAndUpdateAllNewsletterMetadataAction] Update local model"]);v=function(){return a};return a}function w(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletters][queryAndUpdateAllNewsletterMetadataAction] Start"]);w=function(){return a};return a}function x(a){return a!=null&&Number.isInteger(a)&&a>0}var y=b("$InternalEnum").Mirrored(["Bootstrap","DirtyBit","Debug"]);function a(a,b){return z.apply(this,arguments)}function z(){z=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){c===void 0&&(c={});d("WALogger").LOG(w());c=(c=c)!=null?c:{};var e=c.messageCount,f=c.addSystemMsgs;c=c.qplEvent;try{c==null?void 0:c.annotate({string:{entryPoint:a}});c==null?void 0:c.addPoint("getAllNewslettersMetadata_start");var g=(yield d("WAWebNewsletterMetadataJob").getAllNewslettersMetadata()),i=g.newsletters;g=g.deletedNewsletters;var j=i.reduce(function(a,b){var c;a.chats.push(d("WAWebNewsletterModelUtils").mapNewsletterToChat(b));a.metadata.push(d("WAWebNewsletterModelUtils").mapNewsletterToMetadata(b));c=(c=b.newsletterPictureMetadataMixin)==null?void 0:c.picture;c!=null&&a.pics.push(d("WAWebNewsletterModelUtils").mapPicturesToProfilePicThumb(b.idJid,c));return a},{chats:[],metadata:[],pics:[]}),k=j.chats,l=j.metadata;j=j.pics;c==null?void 0:c.addPoint("getAllNewslettersMetadata_end");c==null?void 0:c.addPoint("processDeletedNewsletters_start");yield D(g);c==null?void 0:c.addPoint("processDeletedNewsletters_end");i=(i=i.map(function(a){return a.idJid})).concat.apply(i,((g==null?void 0:g.id)||[]).map(function(a){return a.jid}));a===y.DirtyBit&&(c==null?void 0:c.addPoint("processUnsubscribedNewsletters_start"),yield F(i),c==null?void 0:c.addPoint("processUnsubscribedNewsletters_end"));c==null?void 0:c.addPoint("fetchAdminCountsForOwnerNewsletter_start");yield (h||(h=b("Promise"))).all(l.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(d("WAWebNewsletterMembershipUtil").iAmOwner(a)){var b=(yield d("WAWebNewsletterGetAdminCountJob").getNewsletterAdminCount(d("WAJids").toNewsletterJid(a.id.toString())));a.adminCount=b}});return function(b){return a.apply(this,arguments)}}()));c==null?void 0:c.addPoint("fetchAdminCountsForOwnerNewsletter_start");d("WALogger").LOG(v());yield B({chats:k,metadata:l,pics:j,messageCount:e,addSystemMsgs:f,qplEvent:c});d("WALogger").LOG(u());c==null?void 0:c.addPoint("processChannelEnforcementsUpdates_start");yield h.all(l.map(function(a){d("WAWebNewsletterMembershipUtil").iAmAdminOrOwner(a)&&void d("WAWebNewsletterGetNewsletterEnforcementsUpdatesAction").getNewsletterEnforcementsUpdatesAction(d("WAWebWidFactory").createWid(a.id.toString()),d("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION)}));c==null?void 0:c.addPoint("processChannelEnforcementsUpdates_end");d("WALogger").LOG(t());return{chats:k,success:!0}}catch(a){d("WALogger").ERROR(s()).tags("newsletter").devConsole(a).sendLogs("newsletter-failed-to-retrieve-newsletters");return{success:!1}}});return z.apply(this,arguments)}function e(a,b){return A.apply(this,arguments)}function A(){A=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){d("WALogger").LOG(r());try{var e,f,g,h=d("WAWebNewsletterModelUtils").getRoleByIdentifier(a);h=(yield d("WAWebNewsletterMetadataJob").getNewsletterMetadata(a,h,b==null?void 0:b.fields));if(h==null)return;var i=d("WAWebNewsletterModelUtils").mapNewsletterToChat(h),j=d("WAWebNewsletterModelUtils").mapNewsletterToMetadata(h);e=(e=h.newsletterPictureMetadataMixin)==null?void 0:e.picture;e=e?[d("WAWebNewsletterModelUtils").mapPicturesToProfilePicThumb(a,e)]:[];var k=void 0;f=(f=b==null?void 0:b.adminFields)!=null?f:{};f=f.adminCount;f===!0&&(k=(yield d("WAWebNewsletterGetAdminCountJob").getNewsletterAdminCount(a)));f=void 0;g=(g=b==null?void 0:b.adminFields)!=null?g:{};g=g.capabilities;g===!0&&(f=(yield d("WAWebNewsletterGetAdminCapabilitiesJob").getNewsletterAdminCapabilities(a)));yield B({chats:[i],metadata:[babelHelpers["extends"]({},j,{adminCount:k,capabilities:f})],pics:e,messageCount:b==null?void 0:b.messageCount});d("WALogger").LOG(q());return c("WAWebNewsletterCollection").get(h.idJid)}catch(a){if(a instanceof d("WAWebBackendErrors").ServerStatusCodeError&&a.statusCode===405)return;d("WALogger").ERROR(p()).tags("newsletter").devConsole(a).sendLogs("newsletter-failed-to-retrieve-newsletter")}});return A.apply(this,arguments)}function B(a){return C.apply(this,arguments)}function C(){C=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=a.chats,f=a.metadata,g=a.pics,p=a.messageCount,q=a.addSystemMsgs;a=a.qplEvent;d("WALogger").LOG(o());var r=H(e,f,g),s=r.filteredChats,t=r.filteredMetadata;r=r.filteredPics;a==null?void 0:a.addPoint("updateNewsletterChatRecords_start");yield d("WAWebNewsletterUpdateNewslettersRecordsJob").updateNewsletterChatRecords(s.map(d("WAWebCreateChat").createNewsletterObjectForStorage));a==null?void 0:a.addPoint("updateNewsletterChatRecords_end");d("WALogger").LOG(n());a==null?void 0:a.addPoint("updateNewsletterMetadata_start");yield d("WAWebNewsletterMetadataJob").updateNewsletterMetadata(t.map(d("WAWebNewsletterStorageUtils").createNewsletterMetadataObjectForStorage));a==null?void 0:a.addPoint("updateNewsletterMetadata_end");d("WALogger").LOG(m());a==null?void 0:a.addPoint("bulkPersistProfilePicChanges_start");yield d("WAWebDBBulkPersistProfilePic").bulkPersistProfilePicChanges(r.map(function(a){if(!Object.prototype.hasOwnProperty.call(a,"eurl"))return;var b=d("WAWebWidFactory").createWid(a.id.toString());return d("WAWebContactProfilePicThumbBridge").mapProfilePictureToProfilePicThumbRowType(b,{id:b,tag:(b=a.tag)!=null?b:void 0,eurl:(b=a.eurl)!=null?b:void 0,previewEurl:(b=a.previewEurl)!=null?b:void 0,stale:a.stale,eurlStale:!1,timestamp:(b=a.timestamp)!=null?b:Date.now()})}).filter(Boolean));a==null?void 0:a.addPoint("bulkPersistProfilePicChanges_end");d("WALogger").LOG(l());d("WALogger").LOG(k());c("WAWebNewsletterMetadataCollection").add(f,{merge:!0});d("WAWebProfilePicThumbCollection").ProfilePicThumbCollection.add(g,{merge:!0});c("WAWebNewsletterCollection").add(e,{merge:!0});a==null?void 0:a.addPoint("pullNewsletterMessagesFromServer_start");d("WALogger").LOG(j());x(p)&&(yield (h||(h=b("Promise"))).all(c("WAWebNewsletterCollection").filter(function(a){return!((a=a.newsletterMetadata)==null?void 0:a.isSuspendedOrTerminated)}).map(function(a){return d("WAWebNewsletterPullMessagesFromServerAction").pullNewsletterMessagesFromServer(a,{messageCount:p,resetUnreadCount:!0}).then(function(b){if(b.filter(function(a){return a.isWamoSub!==!0||d("WAWebViewModeUtils").isViewModeVisibleInSurface(d("WAWebViewMode.flow").ViewModeSurface.CHAT,a.viewMode)}).length===0&&q===!0)return d("WAWebNewsletterSystemMessages").addSystemMessagesToChat(a)})["catch"](c("WAWebNoop"))})));a==null?void 0:a.addPoint("pullNewsletterMessagesFromServer_end");d("WALogger").LOG(i());a==null?void 0:a.addPoint("contactUpdates_start");s=f.filter(function(a){return a.name}).map(function(a){return{id:a.id,name:a.name}});d("WAWebContactCollection").ContactCollection.add(s,{merge:!0});a==null?void 0:a.addPoint("contactUpdates_end")});return C.apply(this,arguments)}function D(a){return E.apply(this,arguments)}function E(){E=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a==null)return;var b=a.id.map(function(a){return{id:a.jid.toString(),terminated:!0}});a=a.id.map(function(a){return{id:d("WAWebWidFactory").createWid(a.jid),terminated:!0}});yield d("WAWebNewsletterMetadataJob").updateNewsletterMetadata(b);c("WAWebNewsletterMetadataCollection").add(a,{merge:!0})});return E.apply(this,arguments)}function F(a){return G.apply(this,arguments)}function G(){G=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=(yield d("WAWebSchemaChat").getChatTable().all());c=c.map(function(a){return d("WAWebWidFactory").createWid(a.id)}).filter(function(b){return b.isNewsletter()&&!a.includes(b.toJid())});var e=[];c.map(function(a){e.push(d("WAWebNewsletterBridgeApi").NewsletterBridgeApi.deleteNewsletter({id:a,keep:!1})),e.push(d("WAWebNewsletterMetadataJob").deleteNewsletterMetadata(a.toString())),e.push(d("WAWebNewsletterDeleteChatJob").deleteNewsletterChat(a)),e.push(d("WAWebNewsletterMetadataJob").deleteNewsletterPicture(a.toString()))});yield (h||(h=b("Promise"))).all(e)});return G.apply(this,arguments)}function H(a,b,e){var f=b.filter(function(a){if(a.membershipType!=null)return a.membershipType===d("WAWebCommonNewsletterEnums").NewsletterMembershipType.Guest;a=c("WAWebNewsletterMetadataCollection").get(a.id);return a==null?!1:a.membershipType===d("WAWebCommonNewsletterEnums").NewsletterMembershipType.Guest}).map(function(a){return a.id});a=a.filter(function(a){return!f.includes(a.id)});b=b.filter(function(a){return!f.includes(a.id)});e=e.filter(function(a){return!f.includes(a.id)});return{filteredChats:a,filteredMetadata:b,filteredPics:e}}g.NewsletterMetadataUpdateEntryPoint=y;g.queryAndUpdateAllNewsletterMetadataAction=a;g.queryAndUpdateNewsletterMetadataAction=e;g.updateCollections=B}),98); __d("WAWebUpdateNewsletterMsgUIAction",["Promise","WAAckLevel","WAJids","WATimeUtils","WAWebFrontendMsgGetters","WAWebMsgCollection","WAWebMsgDataFromModel","WAWebMsgGetters","WAWebMsgType","WAWebNewsletterCollection","WAWebNewsletterDBUtils","WAWebNewsletterDeleteChatJob","WAWebNewsletterMessageDeliveryUpdateAction","WAWebNewsletterPollVotesModelCollection","WAWebNewsletterReactionCollection","WAWebQueryAndUpdateNewslettersMetadataAction","WAWebReactionsMsgAction","WAWebRevokeMsgAction","WAWebUpdateLastAddOnPreviewChatAction","WAWebUserPrefsMeUser","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function a(a,b){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e=d("WAJids").toNewsletterJid(b.toJid()),f=c("WAWebNewsletterCollection").get(b);f==null&&(f=(yield d("WAWebQueryAndUpdateNewslettersMetadataAction").queryAndUpdateNewsletterMetadataAction(e)),f!=null&&c("WAWebNewsletterCollection").add(f));if(f==null){yield d("WAWebNewsletterDeleteChatJob").deleteNewsletterChat(b);return}if(a.type==="reaction")return j(a);if(a.type==="poll_update"){if(a.subtype==="poll_vote")return l(a);return}if(a.subtype==="admin_revoke")return m(a,b);if(a.type===d("WAWebMsgType").MSG_TYPE.PROTOCOL)return;yield d("WAWebMsgCollection").MsgCollection.processMultipleMessages(f.id,[babelHelpers["extends"]({},d("WAWebMsgDataFromModel").msgDataFromMsgModel(a),{recvFresh:!0,isNewMsg:!0})],{},"updateNewsletterMessageUI",f.msgs,!0)});return i.apply(this,arguments)}function j(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=d("WAWebMsgCollection").MsgCollection.get(a.reactionParentKey),c=a.reactionText;if(b==null)return;var e=b.serverId;if(e==null)return;d("WAWebNewsletterReactionCollection").updateOrCreateMessageReaction({parentMsg:b,reactionMsg:a,reactionCode:c});b={msgKey:a.id.toString(),parentMsgKey:d("WAWebNewsletterDBUtils").craftNewsletterMsgKeyFromServerId(e,a.from).toString(),senderUserJid:d("WAWebUserPrefsMeUser").getMeUser().toString(),reactionText:c,timestamp:a.t*1e3,orphan:0,read:!0,ack:d("WAAckLevel").ACK.SENT};yield d("WAWebReactionsMsgAction").addOrUpdateReactionsModelCollection(b,{allowNotify:!1})});return k.apply(this,arguments)}function l(a){if(a.pollUpdateParentKey==null)return;var b=d("WAWebMsgCollection").MsgCollection.get(a.pollUpdateParentKey);if(b==null||a.type!==d("WAWebMsgType").MSG_TYPE.POLL_UPDATE)return;var c=a.senderTimestampMs;d("WAWebNewsletterPollVotesModelCollection").updateOrCreatePollVote({msgKey:a.id,parentMsgKey:b.id,selectedOptionLocalIds:new Set(a.selectedOptionLocalIds),timestamp:c!=null?d("WATimeUtils").castToMillisTime(c):d("WATimeUtils").castUnixTimeToMillisTime(d("WATimeUtils").castToUnixTime(a.t))})}function m(a,b){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){e=(e=c("WAWebNewsletterCollection").get(e))==null?void 0:e.msgs.get(a.protocolMessageKey);if(e==null)return(h||(h=b("Promise"))).resolve();d("WAWebUpdateLastAddOnPreviewChatAction").deleteModelsForLastAddOnPreview([e.id.toString()]);yield d("WAWebNewsletterMessageDeliveryUpdateAction").removeMessageDeliveryUpdates(d("WAWebFrontendMsgGetters").getChat(e),[e]);return(h||(h=b("Promise"))).resolve(d("WAWebRevokeMsgAction").revoke(e,{subtype:a.subtype,msgKey:a.id,sender:d("WAWebMsgGetters").getIsSentByMe(a)?d("WAWebUserPrefsMeUser").getMeUser():a.from,revokeTimestamp:a.t,viewMode:a.viewMode}))});return n.apply(this,arguments)}g.updateNewsletterMessageUI=a}),98); __d("WAWebNewsletterInsightUtils",["$InternalEnum","WALogger"],(function(a,b,c,d,e,f,g){"use strict";function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Encountered unexpected status"]);h=function(){return a};return a}var i=b("$InternalEnum").Mirrored(["Available","Missing"]);function a(a){switch(a){case"OK":return i.Available;case"MISSING":return i.Missing;default:a;d("WALogger").WARN(h()).tags("newsletter-admin-insights").devConsole(a);return i.Missing}}g.NewsletterInsightDataStatus=i;g.getNewsletterInsightsDataStatus=a}),98); __d("WAWebNewsletterAdminInsightsModel",["fbt","WAWebBaseModel","WAWebClock","WAWebModelUtils","WAWebNewsletterInsightUtils","WAWebWid"],(function(a,b,c,d,e,f,g,h){"use strict";a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.rangeStart=d("WAWebModelUtils").prop(),c.rangeEnd=d("WAWebModelUtils").prop(),c.dataStatus=d("WAWebModelUtils").prop(function(){return d("WAWebNewsletterInsightUtils").NewsletterInsightDataStatus.Available}),c.accountsReached=d("WAWebModelUtils").prop(),c.reachDelta=d("WAWebModelUtils").prop(),c.followersReached=d("WAWebModelUtils").prop(),c.nonFollowersReached=d("WAWebModelUtils").prop(),c.reachByCountry=d("WAWebModelUtils").prop(function(){return[]}),c.followers=d("WAWebModelUtils").prop(),c.followersDelta=d("WAWebModelUtils").prop(),c.followersByCountry=d("WAWebModelUtils").prop(function(){return[]}),c.netFollows=d("WAWebModelUtils").prop(),c.growthChartData=d("WAWebModelUtils").prop(function(){return[]}),c.growthChart=d("WAWebModelUtils").derived(function(){var a=this.growthChartData;return a.length===0?[]:[{data:a,dataLabels:[{label:h._(/*BTDS*/"__JHASH__A9fKm3RpAsV__JHASH__"),key:"net-follows"},{label:h._(/*BTDS*/"__JHASH__tz2qeOxyNRB__JHASH__"),key:"follows"},{label:h._(/*BTDS*/"__JHASH__Ify7SnreaIr__JHASH__"),key:"unfollows"}],dataSetLabel:{label:h._(/*BTDS*/"__JHASH__zCudIClvABC__JHASH__"),key:"growth"}}]},["growthChartData"]),c.rangeInDays=d("WAWebModelUtils").derived(function(){var a=this.rangeStart,b=this.rangeEnd;return a==null||b==null?0:d("WAWebClock").Clock.daysDeltaAbs(a,b)+1},["rangeStart","rangeEnd"]),b)||babelHelpers.assertThisInitialized(c)}return b}(d("WAWebBaseModel").BaseModel);a.Proxy="newsletterInsights";a.idClass=c("WAWebWid");b=d("WAWebBaseModel").defineModel(a);g.NewsletterAdminInsights=b}),226); __d("WAWebNewsletterSubscriberModel",["WAWebBaseModel","WAWebModelUtils","WAWebWid"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebModelUtils").prop(),c.membership=d("WAWebModelUtils").prop(),c.isPendingAdmin=d("WAWebModelUtils").prop(),c.contact=d("WAWebModelUtils").session(),b)||babelHelpers.assertThisInitialized(c)}return b}(d("WAWebBaseModel").BaseModel);a.Proxy="newsletterSubscriber";a.idClass=c("WAWebWid");b=d("WAWebBaseModel").defineModel(a);g.NewsletterSubscriber=b}),98); __d("WAWebNewsletterBridgeApi",["WALogger","WAWebCommonNewsletterEnums","WAWebContactCollection","WAWebDBUpdateLastAddOnPreviewChat","WAWebLastAddOnDBSerialization","WAWebMexNewsletterUtils","WAWebMsgCollection","WAWebMsgModelFromData","WAWebMsgType","WAWebNewsletterAdminInsightsModel","WAWebNewsletterBridgeMsgAddOnsUtils","WAWebNewsletterCollection","WAWebNewsletterGatingUtils","WAWebNewsletterMetadataCollection","WAWebNewsletterModelUtils","WAWebNewsletterPullMessagesFromServerAction","WAWebNewsletterReportCollection","WAWebNewsletterSubscriberModel","WAWebNewsletterValidationUtils","WAWebProfilePicThumbCollection","WAWebQueryAndUpdateNewslettersMetadataAction","WAWebShouldUpdateLastAddOnPreview","WAWebShowNewsletterMetadataUpdateNotification","WAWebShowNewsletterRoleChangeNotification","WAWebUpdateLastAddOnPreviewChatAction","WAWebUpdateNewsletterMsgUIAction","WAWebUpdateUnreadChatAction","WAWebUserPrefsNewsletter","WAWebWidFactory","asyncToGeneratorRuntime","lodash"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[updateNewsletterInsights] called with newsletterMetadata = null"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[updateNewsletterMembershipRole] called with newsletterMetadata = null"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[updateNewsletterMembershipRole] called with newsletterMetadata = null"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[subscribeToNewsletter] called with newsletterMetadata = null"]);k=function(){return a};return a}function l(a,b){a=c("WAWebNewsletterCollection").get(a);void (a==null?void 0:a.mute.setMute(b,!1,!0))}a={updateNewsletterMessageUI:function(a){var b=a.msg,c=a.chatID;a=a.isOrphan;if(a)return;a=d("WAWebMsgModelFromData").msgModelFromMsgData(b);return d("WAWebUpdateNewsletterMsgUIAction").updateNewsletterMessageUI(a,c)},deleteNewsletter:function(a){var b=a.id;a=a.keep;var e=c("WAWebNewsletterCollection")==null?void 0:c("WAWebNewsletterCollection").get(b),f=e==null?void 0:e.newsletterMetadata;if(a){f!=null&&(f.membershipType=d("WAWebCommonNewsletterEnums").NewsletterMembershipType.Guest);return}a=e==null?void 0:e.msgs;a!=null&&d("WAWebMsgCollection").MsgCollection.remove(a);e==null?void 0:e["delete"]();e==null?void 0:(f=e.newsletterMetadata)==null?void 0:f["delete"]();d("WAWebProfilePicThumbCollection").ProfilePicThumbCollection.remove(b)},joinNewsletter:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.newsletter,e=a.metadata,f=a.pic,g=a.msgs;a=a.noEarlierMsgs;b=c("WAWebNewsletterCollection").gadd(b,{merge:!0});g!=null&&(yield d("WAWebMsgCollection").MsgCollection.processMultipleMessages(b.id,g,{isHistory:!0,add:"search"},"joinNewsletter",b.msgs));a===!0&&(b.msgs.msgLoadState.noEarlierMsgs=!0);d("WAWebProfilePicThumbCollection").ProfilePicThumbCollection.add(f,{merge:!0});c("WAWebNewsletterMetadataCollection").add(e,{merge:!0})});function e(b){return a.apply(this,arguments)}return e}(),updateNewsletterMetadata:function(a){var b=a.metadata,e=a.newsletter;a=a.pic;var f=b.id;b=babelHelpers.objectWithoutPropertiesLoose(b,["id"]);e.id;e=babelHelpers.objectWithoutPropertiesLoose(e,["id"]);a.id;a=babelHelpers.objectWithoutPropertiesLoose(a,["id"]);c("WAWebNewsletterCollection").gadd(f).set(c("lodash").pickBy(e,function(a){return a!=null}),{merge:!0});c("WAWebNewsletterMetadataCollection").gadd(f).set(c("lodash").pickBy(b,function(a){return a!=null}),{merge:!0});d("WAWebProfilePicThumbCollection").ProfilePicThumbCollection.gadd(f).set(a,{merge:!0});b.name!=null&&d("WAWebContactCollection").ContactCollection.gadd(f).set({name:b.name},{merge:!0})},muteNewsletter:function(a){a=a.id;l(a,d("WAWebNewsletterModelUtils").MUTED_STATE)},unmuteNewsletter:function(a){a=a.id;l(a,d("WAWebNewsletterModelUtils").UNMUTED_STATE)},updateNewsletterSubscriberCount:function(a){var b,d=a.id;a=a.update;d=c("WAWebNewsletterCollection")==null?void 0:(d=c("WAWebNewsletterCollection").get(d))==null?void 0:d.newsletterMetadata;if(d==null)return;var e=d.size;b=(b=a.newSubscriberCount)!=null?b:Number(a.increment)+e;d.set("size",b)},updateNewsletterUnreadMsgCount:function(a){a=a.id;a=c("WAWebNewsletterCollection").get(a);a!=null&&d("WAWebUpdateUnreadChatAction").updateUnreadCountMD(a,0,!1)},subscribeToNewsletter:function(a){a=a.newsletter;var b=a.newsletterMetadata;if(b==null){d("WALogger").ERROR(k());return}b.membershipType=d("WAWebCommonNewsletterEnums").NewsletterMembershipType.Subscriber;c("WAWebNewsletterCollection").add(a,{merge:!0})},loadNewsletterPreviewChat:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.metadata,e=a.pic,f=a.newsletter;a=a.messages;var g=b.id,h=babelHelpers.objectWithoutPropertiesLoose(b,["id"]);c("WAWebNewsletterMetadataCollection").gadd(g).set(h,{merge:!0});if(e!=null){e.id;h=babelHelpers.objectWithoutPropertiesLoose(e,["id"]);d("WAWebProfilePicThumbCollection").ProfilePicThumbCollection.gadd(g).set(h,{merge:!0})}d("WAWebContactCollection").ContactCollection.add({id:g,name:b.name},{merge:!0});c("WAWebNewsletterCollection").add(f,{merge:!0});e=c("WAWebNewsletterCollection").get(g);e!=null&&a!=null&&(yield d("WAWebMsgCollection").MsgCollection.processMultipleMessages(e.id,a,{isHistory:!0,add:"search"},"loadPreviewNewsletter",e.msgs));return e});function e(b){return a.apply(this,arguments)}return e}(),terminateNewsletter:function(a){var b=a.id;a=a.msgs;c("WAWebNewsletterMetadataCollection")==null?void 0:c("WAWebNewsletterMetadataCollection").gadd(b).set({terminated:!0},{merge:!0});if(a!=null){(b=c("WAWebNewsletterCollection").get(b))==null?void 0:b.msgs.add(a)}},updateNewsletterPicture:function(a){a=a.pic;var b=a.id;a=babelHelpers.objectWithoutPropertiesLoose(a,["id"]);d("WAWebProfilePicThumbCollection").ProfilePicThumbCollection.gadd(b).set(a,{merge:!0})},updateNewsletterMessages:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b,c=a.reactions,e=a.reactionIdsToRemove,f=a.timestamp,g=a.ids,h=a.viewCounts,i=a.pollVotes;a=a.msgs;yield (b=d("WAWebNewsletterBridgeMsgAddOnsUtils")).updateReactions({ids:g,reactions:c,reactionIdsToRemove:e});yield b.updatePollVotes({ids:g,pollVotes:i});b.updateViewCounts(h);b.updateLastUpdateTs(g,f);c=a==null?void 0:a.filter(function(a){return a.kind===d("WAWebMsgType").MsgKind.RevokedMessage});c!=null&&c.length>0&&(yield d("WAWebMsgCollection").MsgCollection.processMultipleMessages(c[0].id.remote,c,{},"updateNewsletterMessages"))});function c(b){return a.apply(this,arguments)}return c}(),updateNewsletterMessageDeliveryUpdate:function(a){var b,e=a.id,f=a.modelUpdatesToAdd;a=a.modelUpdatesToRemove;e=c("WAWebNewsletterCollection").get(e);if(e==null)return;(b=e.newsletterMetadata)==null?void 0:b.messageDeliveryUpdates.remove(a);(b=e.newsletterMetadata)==null?void 0:b.messageDeliveryUpdates.add(f.map(function(a){var b=d("WAWebMsgModelFromData").msgModelFromMsgData(a.msgData);d("WAWebMsgCollection").MsgCollection.add(b,{merge:!0});return babelHelpers["extends"]({},a,{msgModel:b})}),{merge:!0})},findMsgKeyFromServerId:function(a){var b=a.from,d=a.serverId;a=c("WAWebNewsletterCollection").get(b);return a==null?void 0:(b=a.msgs)==null?void 0:(a=b.findFirst(function(a){return a.serverId===d}))==null?void 0:a.id},updateMsgsViewed:function(a){a=a.ids;a.forEach(function(a){(a=d("WAWebMsgCollection").MsgCollection.get(a))==null?void 0:a.set("viewed",!0)})},updateGeosuspendedCountry:function(a){var b=a.id,d=a.countryCodes;a=a.toAdd;b=c("WAWebNewsletterCollection").get(b);if(b==null)return;if(a){(a=b.newsletterMetadata)==null?void 0:a.geosuspendedCountries.add(d.map(function(a){return{id:a,geosuspended:!0}}))}else{(a=b.newsletterMetadata)==null?void 0:a.geosuspendedCountries.remove(d.map(function(a){return a}))}},suspendNewsletter:function(a){a=a.id;c("WAWebNewsletterMetadataCollection").gadd(a).set({suspended:!0},{merge:!0})},geosuspendNewsletter:function(a){a=a.id;c("WAWebNewsletterMetadataCollection").gadd(a).set({suspended:!0,geosuspended:!0},{merge:!0})},updateProfilePictureDeletionAlertState:function(a){a=a.newsletterWid;c("WAWebNewsletterMetadataCollection").gadd(a).set({hasProfilePictureDeletionAlerts:!0},{merge:!0})},getActiveNewsletter:function(){var a;return(a=c("WAWebNewsletterCollection").getActive())==null?void 0:a.id},getNewsletterMetadata:function(a){a=a.id;return(a=c("WAWebNewsletterCollection").get(a))==null?void 0:a.newsletterMetadata},handleMyRoleChangeNotification:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b;a=a.jid;var e=d("WAWebWidFactory").createWid(a);e=c("WAWebNewsletterCollection").get(e);e==null?void 0:(b=e.newsletterMetadata)==null?void 0:(b=b.subscribers)==null?void 0:b.reset();b=e!=null;yield d("WAWebQueryAndUpdateNewslettersMetadataAction").queryAndUpdateNewsletterMetadataAction(a,{messageCount:b?void 0:1,fields:{membership:!0,state:!0,creationTime:b?void 0:!0,description:b?void 0:!0,handle:b?void 0:!0,inviteLink:b?void 0:!0,linkedAccounts:b?void 0:!0,muted:b?void 0:!0,name:b?void 0:!0,picture:b?void 0:!0,privacy:b?void 0:!0,subscribers:b?void 0:!0,verification:b?void 0:!0}})});function e(b){return a.apply(this,arguments)}return e}(),displayRoleChangeDesktopNotification:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b,e;a=a.notification;var f=a.xwa2_notify_newsletter_admin_promote!=null?"promote":"demote";b=(b=a.xwa2_notify_newsletter_admin_promote)!=null?b:a.xwa2_notify_newsletter_admin_demote;if(b==null)return;a=b!=null?c("WAWebNewsletterCollection").get(b==null?void 0:b.id):null;var g=b.user.pn;e=(e=b.actor)==null?void 0:e.pn;b=d("WAWebMexNewsletterUtils").mapRoleToMembership(b.user_new_role);if(g==null||a==null||b==null)return;g=d("WAWebWidFactory").createWid(g);e=e==null?null:d("WAWebWidFactory").createWid(e);a=a;yield d("WAWebShowNewsletterRoleChangeNotification").showNewsletterRoleChangeNotification({mode:f,user:g,admin:e,chat:a,newRole:b})});function e(b){return a.apply(this,arguments)}return e}(),handleOtherUserRoleChangeNotification:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b,e=a.jid,f=a.userId;a=a.newRole;e=d("WAWebWidFactory").createWid(e);e=c("WAWebNewsletterCollection").get(e);b=e==null?void 0:(b=e.newsletterMetadata)==null?void 0:(b=b.subscribers)==null?void 0:b.get(f);if(b!=null)b.membership=a;else{b=d("WAWebContactCollection").ContactCollection.get(f);if(a===d("WAWebCommonNewsletterEnums").NewsletterMembershipType.Admin&&b!=null){var g;e==null?void 0:(g=e.newsletterMetadata)==null?void 0:(g=g.subscribers)==null?void 0:g.add(new(d("WAWebNewsletterSubscriberModel").NewsletterSubscriber)({id:f,membership:a,isPendingAdmin:!1,contact:b}))}}e==null?void 0:(g=e.newsletterMetadata)==null?void 0:(b=g.subscribers)==null?void 0:b.sort();if(a===d("WAWebCommonNewsletterEnums").NewsletterMembershipType.Admin){e==null?void 0:(g=e.newsletterMetadata)==null?void 0:(b=g.pendingAdmins)==null?void 0:b.remove(f)}});function e(b){return a.apply(this,arguments)}return e}(),updateChatPreviewFromReaction:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.reactionMsgObj;a=a.parentMsgKey;b=(yield d("WAWebShouldUpdateLastAddOnPreview").filterChatsWithAddOnPreviewUpdates([d("WAWebLastAddOnDBSerialization").lastAddOnPreviewCandidateFromReactionRowType(babelHelpers["extends"]({},b,{parentMsgKey:a.toString()}))]));b.size>0&&(yield d("WAWebDBUpdateLastAddOnPreviewChat").updateDatabaseForLastAddOnPreview(b),d("WAWebUpdateLastAddOnPreviewChatAction").updateModelsForLastAddOnPreview(b))});function c(b){return a.apply(this,arguments)}return c}(),updateChatPreviewFromVote:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.voteMsgObj;a=a.parentMsgKey;b=(yield d("WAWebShouldUpdateLastAddOnPreview").filterChatsWithAddOnPreviewUpdates([d("WAWebLastAddOnDBSerialization").lastAddOnPreviewCandidateFromVoteData(babelHelpers["extends"]({},b,{parentMsgKey:a}),!1)]));b.size>0&&(yield d("WAWebDBUpdateLastAddOnPreviewChat").updateDatabaseForLastAddOnPreview(b),d("WAWebUpdateLastAddOnPreviewChatAction").updateModelsForLastAddOnPreview(b))});function c(b){return a.apply(this,arguments)}return c}(),updateNewsletterReports:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a.reports;d("WAWebNewsletterReportCollection").NewsletterReportCollection.reset();d("WAWebNewsletterReportCollection").NewsletterReportCollection.add(a)});function c(b){return a.apply(this,arguments)}return c}(),updateNewsletterReport:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a.report;d("WAWebNewsletterReportCollection").NewsletterReportCollection.add(a,{merge:!0})});function c(b){return a.apply(this,arguments)}return c}(),updateMyNewsletterMembershipRole:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.newsletter;a=a.newRole;var e=b.newsletterMetadata;if(e==null){d("WALogger").ERROR(j());return}e.membershipType=a;c("WAWebNewsletterCollection").add(b,{merge:!0})});function e(b){return a.apply(this,arguments)}return e}(),updateNewsletterMemberRole:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.newsletter,c=a.member;a=a.newRole;var e=b.newsletterMetadata;if(e==null){d("WALogger").ERROR(i());return}e=(e=e.subscribers)==null?void 0:e.get(c.id);if(e!=null){e.membership=a;(c=b.newsletterMetadata)==null?void 0:(e=c.subscribers)==null?void 0:e.sort();a=d("WAWebNewsletterValidationUtils").toNewsletterJidOrThrow(b.id.toJid());yield d("WAWebUserPrefsNewsletter").flushCachedNewsletterSubscribers(a)}});function c(b){return a.apply(this,arguments)}return c}(),displayNewsletterMetadataUpdateNotification:function(a){a=a.notification;var b=a.newsletterId,e=a.actorId;a=a.updates;b=c("WAWebNewsletterCollection").get(b);if(b==null)return;void d("WAWebShowNewsletterMetadataUpdateNotification").showNewsletterMetadataUpdateNotification({chat:b,user:e,updates:a})},expireNewsletterAdminInvites:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a.expiredMsgData;a.forEach(function(a){var b=a.id;a=a.newsletterAdminInviteInfo;(b=d("WAWebMsgCollection").MsgCollection.get(b))==null?void 0:b.set({newsletterAdminInviteInfo:a})})});function c(b){return a.apply(this,arguments)}return c}(),updateNewsletterInsights:function(a){var b=a.newsletter;a=a.insights;b=b.newsletterMetadata;if(b==null){d("WALogger").ERROR(h());return}var c=b.adminInsights;c==null?b.adminInsights=new(d("WAWebNewsletterAdminInsightsModel").NewsletterAdminInsights)(a):c.set(babelHelpers["extends"]({},a))},handleNewsletterWamoSubStatusChangeNotification:function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.jid;a=a.wamoSubStatus;var e=d("WAWebWidFactory").createWid(b);e=c("WAWebNewsletterCollection").get(e);if(e==null)return;var f=e.newsletterMetadata;f!=null&&(f.wamoSubStatus=a);yield d("WAWebQueryAndUpdateNewslettersMetadataAction").queryAndUpdateNewsletterMetadataAction(b);a===d("WAWebCommonNewsletterEnums").WamoSubStatus.ACTIVE&&(yield d("WAWebNewsletterPullMessagesFromServerAction").pullNewsletterMessagesFromServer(e,{messageCount:d("WAWebNewsletterGatingUtils").getMaxMsgCountFromServer()}))});function e(b){return a.apply(this,arguments)}return e}()};g.NewsletterBridgeApi=a}),98); __d("WAWebNewsletterBridgeMsgAddOnsUtils",["Promise","WAWebMsgCollection","WAWebNewsletterPollVotesModelCollection","WAWebNewsletterReactionCollection","WAWebNoop","WAWebPollsCreateOptionLocalIdMap","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function a(a){if(a!=null&&a.size>0)for(a of a.entries()){var b=a[0],c=a[1];b=d("WAWebMsgCollection").MsgCollection.get(b);b==null?void 0:b.set("viewCount",c)}}function e(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=a.reactions,f=a.ids;a=a.reactionIdsToRemove;a!=null&&d("WAWebNewsletterReactionCollection").NewsletterMessageReactionsCollection.remove(a);yield (h||(h=b("Promise"))).all((a=f.map(function(a){return d("WAWebNewsletterReactionCollection").NewsletterMessageReactionsCollection.find(a.toString())["catch"](c("WAWebNoop"))}))!=null?a:[]);d("WAWebNewsletterReactionCollection").NewsletterMessageReactionsCollection.add(e.map(function(a){return{id:a.parentMsgKey,reactionCountMap:a.emojiCountMap,reactionCountMapTs:a.serverTimestamp}}),{merge:!0})});return i.apply(this,arguments)}function f(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=a.pollVotes;a=a.ids;yield (h||(h=b("Promise"))).all((a=a.map(function(a){return d("WAWebNewsletterPollVotesModelCollection").NewsletterPollVotesModelCollection.find(a)["catch"](c("WAWebNoop"))}))!=null?a:[]);a=(yield h.all(e.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=d("WAWebMsgCollection").MsgCollection.get(a.parentMsgKey);b=b==null?void 0:b.pollOptions;if(b==null)return;b=(yield d("WAWebPollsCreateOptionLocalIdMap").createOptionLocalIdMap(b));return{id:a.parentMsgKey,pollVotesCountMap:k(a.voteCountMap,b),pollVotesCountMapTs:a.serverTimestamp}});return function(b){return a.apply(this,arguments)}}())));d("WAWebNewsletterPollVotesModelCollection").NewsletterPollVotesModelCollection.add(a.filter(Boolean),{merge:!0})});return j.apply(this,arguments)}function k(a,b){var c=new Map();for(a of a.entries()){var d=a[0],e=a[1];c.set(b.getLocalIdForHexHash(d),e)}return c}function l(a,b){b!=null&&a.forEach(function(a){a=d("WAWebMsgCollection").MsgCollection.get(a);a==null?void 0:a.set("lastUpdateFromServerTs",b)})}g.updateViewCounts=a;g.updateReactions=e;g.updatePollVotes=f;g.updateLastUpdateTs=l}),98); __d("WAWebGetEphemeralFieldsMsgActionsUtils",["WAWebABProps","WAWebChatEphemerality","WAWebChatGetters"],(function(a,b,c,d,e,f,g){function a(a){var b={};d("WAWebChatEphemerality").isEphemeralSettingOn(a)&&(b.ephemeralDuration=d("WAWebChatEphemerality").getEphemeralSetting(a));var c=d("WAWebChatEphemerality").getEphemeralSettingTimestamp(a);c!=null&&(b.ephemeralSettingTimestamp=c);c=d("WAWebChatEphemerality").getDisappearingModeInitiator(a);c!=null&&(b.disappearingModeInitiator=c);if(d("WAWebABProps").getABPropConfigValue("dm_initiator_trigger")){c=d("WAWebChatEphemerality").getDisappearingModeTrigger(a);c!=null&&(b.disappearingModeTrigger=c);c=d("WAWebChatEphemerality").getDisappearingModeInitiatedByMe(a);c!=null&&(b.disappearingModeInitiatedByMe=c)}if(d("WAWebChatGetters").getIsGroup(a)&&d("WAWebABProps").getABPropConfigValue("dm_initiator_trigger_groups")){c=d("WAWebChatEphemerality").getDisappearingModeTriggerGroups(a);c!=null&&(b.disappearingModeTrigger=c);c=d("WAWebChatEphemerality").getDisappearingModeInitiatedByMeGroups(a);c!=null&&(b.disappearingModeInitiatedByMe=c)}return babelHelpers["extends"]({},b)}g.getEphemeralFields=a}),98); __d("WAWebMexCreateNewsletterAdminInviteJobMutation.graphql",[],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"newsletter_id"},{defaultValue:null,kind:"LocalArgument",name:"user_id"}],b=[{kind:"Variable",name:"newsletter_id",variableName:"newsletter_id"},{kind:"Variable",name:"user_id",variableName:"user_id"}],c={alias:null,args:null,kind:"ScalarField",name:"invite_expiration_time",storageKey:null};return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"WAWebMexCreateNewsletterAdminInviteJobMutation",selections:[{alias:null,args:b,concreteType:"XWA2NewsletterAdminInviteCreateResponse",kind:"LinkedField",name:"xwa2_newsletter_admin_invite_create",plural:!1,selections:[c],storageKey:null}],type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"WAWebMexCreateNewsletterAdminInviteJobMutation",selections:[{alias:null,args:b,concreteType:"XWA2NewsletterAdminInviteCreateResponse",kind:"LinkedField",name:"xwa2_newsletter_admin_invite_create",plural:!1,selections:[c,{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null}],storageKey:null}]},params:{id:"6826078034173770",metadata:{},name:"WAWebMexCreateNewsletterAdminInviteJobMutation",operationKind:"mutation",text:null}}}();e.exports=a}),null); __d("WAWebMexCreateNewsletterAdminInviteJob",["WANullthrows","WATimeUtils","WAWebLidMigrationUtils","WAWebMexClient","WAWebMexCreateNewsletterAdminInviteJobMutation.graphql","WAWebNewsletterRpcUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h,i=h!==void 0?h:h=b("WAWebMexCreateNewsletterAdminInviteJobMutation.graphql");function a(a,b){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){return d("WAWebNewsletterRpcUtils").runWithBackoff(function(){return k(a,b)})});return j.apply(this,arguments)}function k(a,b){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=d("WAWebLidMigrationUtils").getEnforceCurrentLid(b);a=(yield d("WAWebMexClient").fetchQuery(i,{newsletter_id:a,user_id:b.toString()}));b=a.xwa2_newsletter_admin_invite_create;a=c("WANullthrows")(b==null?void 0:b.invite_expiration_time);return{inviteExpiration:d("WATimeUtils").castToUnixTime(Number.parseInt(a,10))}});return l.apply(this,arguments)}g.createNewsletterAdminInvite=a}),98); __d("WAWebNewsletterSendMsgAction",["Promise","WAAckLevel","WALogger","WANullthrows","WATimeUtils","WAWebChatGetters","WAWebDBProcessEditProtocolMsgs","WAWebFrontendMsgGetters","WAWebGetEphemeralFieldsMsgActionsUtils","WAWebMessageSendPerfReporter","WAWebMessageSendReporter","WAWebMexCreateNewsletterAdminInviteJob","WAWebMsgDataFromModel","WAWebMsgGetters","WAWebMsgKey","WAWebMsgModel","WAWebMsgModelFromData","WAWebMsgType","WAWebNewsletterCollection","WAWebNewsletterErrors","WAWebNewsletterGatingUtils","WAWebNewsletterSendMessageJob","WAWebNewsletterSendMsgActionUtils","WAWebNewsletterUpdateMsgsRecordsJob","WAWebNewsletterValidationUtils","WAWebPollsGatingUtils","WAWebSendMsgChatAction","WAWebSendMsgResultAction","WAWebSendTextMsgChatAction","WAWebStateUtils","WAWebUserPrefsMeUser","WAWebViewMode.flow","WAWebWamEnumMessageSendResultType","WAWebWidFactory","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[sendNewsletterAdminInviteMessage] Failed to send message ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletter] Failed to send message"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletter] Empty serverId returned from server"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletter] Failed to send message, "," from server"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletter] Failed to persist sent message on db"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletter] Sent message "," -> ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletter] Sending message "," -> ",""]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletter] Forwarding MMS messages is not supported"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletter] Poll forwarding is not enabled"]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletter] Poll creation is not enabled"]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletter] Failed to edit message"]);s=function(){return a};return a}function a(a,b,c){return t.apply(this,arguments)}function t(){t=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e){a=d("WAWebStateUtils").unproxy(a);if(!d("WAWebChatGetters").getIsNewsletter(a))throw new(d("WAWebNewsletterErrors").UnexpectedNonNewsletterChatError)();b=(yield d("WAWebSendTextMsgChatAction").createTextMsgData(a,b,e));if(b==null)throw c("err")("Failed to generate MsgData");d("WAWebNewsletterSendMsgActionUtils").validateMsgDataForMsgSend(b,a);e=new(d("WAWebMsgModel").Msg)(b);return D({chat:a,msg:e,type:"text"})});return t.apply(this,arguments)}function e(a){var c=d("WAWebFrontendMsgGetters").getChat(a);return d("WAWebFrontendMsgGetters").getAsMms(a)?(h||(h=b("Promise"))).resolve():D({chat:c,msg:a,type:"text"})}function f(a,c,e){if(!d("WAWebChatGetters").getIsNewsletter(a))return(h||(h=b("Promise"))).reject(new(d("WAWebNewsletterErrors").UnexpectedNonNewsletterChatError)());c=c instanceof d("WAWebMsgModel").Msg?c:new(d("WAWebMsgModel").Msg)(c);c.local=!0;return D({chat:a,msg:c,type:"media",uploadMediaMsg:e})}function u(a){a.wamMessageSendReporter=new(d("WAWebMessageSendReporter").MessageSendReporter)(a),a.wamMessageSendPerfReporter=new(d("WAWebMessageSendPerfReporter").MessageSendPerfReporter)({chatWid:a.to,mediaType:a.getWamMediaType(),messageType:a.getWamMessageType()})}function v(a,b){return w.apply(this,arguments)}function w(){w=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){try{var c=d("WAWebDBProcessEditProtocolMsgs").generateMessageEdit(d("WAWebMsgDataFromModel").msgDataFromMsgModel(a),d("WAWebMsgDataFromModel").msgDataFromMsgModel(b));c=c.editedMsgData;a.set(c);c=(yield d("WAWebNewsletterSendMessageJob").sendNewsletterMessageJob({type:"edit",editType:d("WAWebMsgGetters").getIsMedia(a)?"media":"text",msg:a,newsletterJid:d("WAWebNewsletterValidationUtils").toNewsletterJidOrThrow(a.id.remote.toJid())}));b.updateAck(d("WAAckLevel").ACK.SENT);return{t:c.ack.t,messageSendResult:c.success===!0?d("WAWebSendMsgResultAction").SendMsgResult.OK:d("WAWebSendMsgResultAction").SendMsgResult.ERROR_NETWORK}}catch(a){d("WALogger").ERROR(s()).devConsole(a).tags("newsletter").sendLogs("newsletter-edit-fail");return{messageSendResult:d("WAWebSendMsgResultAction").SendMsgResult.ERROR_UNKNOWN}}});return w.apply(this,arguments)}function x(a){return y.apply(this,arguments)}function y(){y=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.msgData;a=a.chat;if(!d("WAWebNewsletterGatingUtils").isNewsletterPollsCreationEnabled()){d("WALogger").ERROR(r()).tags("newsletter").sendLogs("poll-creation-not-enabled");throw c("err")("Poll creation is not enabled")}b=new(d("WAWebMsgModel").Msg)(b);a=(yield D({chat:a,msg:b,type:"pollCreation"}));return[b,a]});return y.apply(this,arguments)}function z(a){return A.apply(this,arguments)}function A(){A=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.msgData;a=a.chat;if(!d("WAWebNewsletterGatingUtils").isNewsletterPollForwardingEnabled()){d("WALogger").ERROR(q()).tags("newsletter").sendLogs("poll-forwarding-not-enabled");throw c("err")("Poll forwarding is not enabled")}b=new(d("WAWebMsgModel").Msg)(b);a=(yield D({chat:a,msg:b,type:"pollResultSnapshot"}));return[b,a]});return A.apply(this,arguments)}function B(a,b){return C.apply(this,arguments)}function C(){C=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if(d("WAWebFrontendMsgGetters").getIsMms(b)){d("WALogger").ERROR(p()).devConsole("Forwarding MMS messages must be done via MediaPrep");return{messageSendResult:d("WAWebSendMsgResultAction").SendMsgResult.ERROR_UNKNOWN}}var c=(yield d("WAWebNewsletterSendMsgActionUtils").prepMsgDataForForward(b));return D({chat:a,msg:d("WAWebMsgModelFromData").msgModelFromMsgData(c),type:b.type===d("WAWebMsgType").MSG_TYPE.POLL_RESULT_SNAPSHOT&&d("WAWebPollsGatingUtils").isPollResultSnapshotPollTypeEnvelopeEnabled()?"pollResultSnapshot":"text"})});return C.apply(this,arguments)}function D(a){return E.apply(this,arguments)}function E(){E=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=a.chat,f=a.type,g=a.uploadMediaMsg,i=a.msg;u(i);d("WALogger").DEV(o(),(a=i)==null?void 0:a.id,e.id.toJid());(a=i.wamMessageSendPerfReporter)==null?void 0:a.startRenderedStage();yield e.addQueue.enqueue((h||(h=b("Promise"))).resolve(i)).then(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield d("WAWebNewsletterUpdateMsgsRecordsJob").addNewsletterMsgsRecords([d("WAWebMsgDataFromModel").msgDataFromMsgModel(i)]),e.msgs.add(a),e.t=i.t});return function(b){return a.apply(this,arguments)}}());(a=i.wamMessageSendPerfReporter)==null?void 0:a.postRenderedStage();try{try{g!=null&&(i=(yield g(i)))}catch(a){throw new(d("WAWebNewsletterErrors").NewsletterMediaUploadError)()}(a=i.wamMessageSendPerfReporter)==null?void 0:a.startReadyToSendStage();g=d("WAWebNewsletterValidationUtils").toNewsletterJidOrThrow(e.id.toJid());a=f==="media"?{msg:i,type:f,newsletterJid:g,mediaHandle:c("WANullthrows")(i.mediaHandle,"Unexpected null mediaHandle")}:{msg:i,type:f,newsletterJid:g};(f=i.wamMessageSendPerfReporter)==null?void 0:f.postReadyToSendStage();(g=i.wamMessageSendPerfReporter)==null?void 0:g.startWrittenWireStage();f=(yield e.sendQueue.enqueue(d("WAWebNewsletterSendMessageJob").sendNewsletterMessageJob(a)));(g=i.wamMessageSendPerfReporter)==null?void 0:g.postWrittenWireStage();switch(f.success){case!0:d("WALogger").DEV(n(),(a=i)==null?void 0:a.id,e.id.toJid());g=f.serverId;if(g==null)throw new(d("WAWebNewsletterErrors").MissingNewsletterServerIdError)();i.serverId=f.serverId;i.t=f.ack.t;i.updateAck(d("WAAckLevel").ACK.SENT,!0);try{(a=i.wamMessageSendPerfReporter)==null?void 0:a.startSavedStage();yield d("WAWebNewsletterUpdateMsgsRecordsJob").updateNewsletterMsgRecord(i);(g=i.wamMessageSendPerfReporter)==null?void 0:g.postSavedStage()}catch(a){d("WALogger").ERROR(m()).tags("newsletter").devConsole(a).sendLogs("newsletter-send-message-db-fail")}(a=i.wamMessageSendReporter)==null?void 0:a.postSuccess();return{messageSendResult:d("WAWebSendMsgResultAction").SendMsgResult.OK};case!1:d("WALogger").ERROR(l(),f.ack.error).tags("newsletter").devConsole(f.ack.error).sendLogs("newsletter-send-message-fail-server");i.updateAck(d("WAAckLevel").ACK.FAILED,!0);(g=i.wamMessageSendReporter)==null?void 0:g.postFailure({result:d("WAWebWamEnumMessageSendResultType").MESSAGE_SEND_RESULT_TYPE.ERROR_NETWORK,isTerminal:!1});return{messageSendResult:d("WAWebSendMsgResultAction").SendMsgResult.ERROR_NETWORK}}}catch(b){b instanceof d("WAWebNewsletterErrors").MissingNewsletterServerIdError?d("WALogger").ERROR(k()).tags("newsletter").sendLogs("newsletter-empty-server-id"):d("WALogger").WARN(j()).tags("newsletter").devConsole(b);i.updateAck(d("WAAckLevel").ACK.FAILED,!0);(a=i.wamMessageSendReporter)==null?void 0:a.postFailure({result:b instanceof d("WAWebNewsletterErrors").NewsletterMediaUploadError?d("WAWebWamEnumMessageSendResultType").MESSAGE_SEND_RESULT_TYPE.ERROR_UPLOAD:d("WAWebWamEnumMessageSendResultType").MESSAGE_SEND_RESULT_TYPE.ERROR_UNKNOWN,isTerminal:!1});return b instanceof d("WAWebNewsletterErrors").NewsletterMediaUploadError?{messageSendResult:d("WAWebSendMsgResultAction").SendMsgResult.ERROR_UPLOAD}:{messageSendResult:d("WAWebSendMsgResultAction").SendMsgResult.ERROR_UNKNOWN}}finally{i.wamMessageSendReporter=null,i.wamMessageSendPerfReporter=null}});return E.apply(this,arguments)}function F(a,b){return G.apply(this,arguments)}function G(){G=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e=b.newsletterWid,f=b.invitee,g=b.inviteMessage;b=b.base64Thumb;try{a=d("WAWebStateUtils").unproxy(a);f=(yield d("WAWebMexCreateNewsletterAdminInviteJob").createNewsletterAdminInvite(d("WAWebNewsletterValidationUtils").toNewsletterJidOrThrow(e.toJid()),f));f=f.inviteExpiration;var h=c("WANullthrows")(c("WAWebNewsletterCollection").get(e)),j=d("WAWebUserPrefsMeUser").getMeUser();j=babelHelpers["extends"]({ack:d("WAAckLevel").ACK.CLOCK,from:j,id:new(c("WAWebMsgKey"))({from:j,to:a.id,id:yield c("WAWebMsgKey").newId(),participant:void 0,selfDir:"out"}),local:!0,t:d("WATimeUtils").unixTime(),to:a.id,type:"newsletter_admin_invite",kind:"newsletterAdminInvite",viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE,isNewMsg:!0,newsletterAdminInviteInfo:{newsletterId:d("WAWebWidFactory").toNewsletterWid(e),newsletterName:h==null?void 0:h.name,inviteExpiration:c("WANullthrows")(f),inviteMessage:g,pictureThumbnail:b}},d("WAWebGetEphemeralFieldsMsgActionsUtils").getEphemeralFields(a));return d("WAWebSendMsgChatAction").addAndSendMsgToChat(a,j)[1]}catch(a){d("WALogger").ERROR(i(),a).tags("newsletter").devConsole(a).sendLogs("newsletter-failed-to-send-admin-invite");return{messageSendResult:d("WAWebSendMsgResultAction").SendMsgResult.ERROR_UNKNOWN}}});return G.apply(this,arguments)}g.sendNewsletterTextMsg=a;g.resendNewsletterMsg=e;g.sendNewsletterMediaMsg=f;g.sendNewsletterEditMsg=v;g.sendNewsletterPollCreationMsg=x;g.sendNewsletterPollResultSnapshotMsg=z;g.forwardNewsletterMessage=B;g.sendNewsletterAdminInviteMessage=F}),98); __d("WAWebNewsletterSendMsgActionUtils",["WAWebConstantsDeprecated","WAWebFrontendMsgGetters","WAWebMediaGetUploadOriginForChat","WAWebMediaOpaqueData","WAWebMediaUploadMmsThumbnail","WAWebMmsMediaTypes","WAWebMsgModelFromData","WAWebMsgModelUtils","WAWebNewsletterErrors","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){return d("WAWebMsgModelUtils").notRefiningTypeIsUrl(a)?i(a):a});return h.apply(this,arguments)}function i(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=d("WAWebFrontendMsgGetters").getAsUrl(d("WAWebMsgModelFromData").msgModelFromMsgData(a));if(b==null)return a;var e=b.thumbnailHQ;if(e==null)return a;e=(yield c("WAWebMediaUploadMmsThumbnail")({thumbnail:yield c("WAWebMediaOpaqueData").createFromBase64Jpeg(e),mediaType:d("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_THUMBNAIL_LINK,uploadOrigin:c("WAWebMediaGetUploadOriginForChat")(d("WAWebFrontendMsgGetters").getChat(b.unsafe())),forwardedFromWeb:!0,timeout:c("WAWebConstantsDeprecated").MMS_THUMBNAIL_UPLOAD_TIMEOUT,isViewOnce:!1}));b=e.filehash;e=e.mediaEntry;return babelHelpers["extends"]({},a,{thumbnailDirectPath:e==null?void 0:e.directPath,thumbnailSha256:b,thumbnailEncSha256:void 0,mediaKey:void 0,mediaKeyTimestamp:void 0})});return j.apply(this,arguments)}function e(a,b){if(a.quotedParticipant!=null&&a.quotedParticipant!==b.id)throw new(d("WAWebNewsletterErrors").UnexpectedNewsletterQuotedParticipantMismatchError)()}g.prepMsgDataForForward=a;g.validateMsgDataForMsgSend=e}),98); __d("WAWebNewsletterViewModeUIUtils",["WAWebMessageAssociationUIUtils","WAWebViewMode.flow"],(function(a,b,c,d,e,f,g){"use strict";function a(a,b){b===void 0&&(b=d("WAWebViewMode.flow").ViewModeSurface.CHAT);a=d("WAWebMessageAssociationUIUtils").getHiddenViewModeMessagesForChat(a,b);b=a.map(function(a){return a.serverId}).filter(Boolean);return new Set(b)}g.getHiddenMessageServerIdsForChat=a}),98); __d("WAWebChatFlowTypes",["$InternalEnum"],(function(a,b,c,d,e,f){a=b("$InternalEnum")({Group:"group",Broadcast:"broadcast",Chat:"chat",Community:"community",Newsletter:"newsletter"});f.ChatKindType=a}),66); __d("WAWebInfoFlowStep",["$InternalEnum"],(function(a,b,c,d,e,f){a=b("$InternalEnum").Mirrored(["GroupInfo","BroadcastInfo","ContactInfo","NewsletterInfo","DeleteNewsletter","NewsletterAdminCenter","NewsletterInsights","NewsletterLink","NewsletterSettings","NewsletterTransferOwnershipSelection","NewsletterTransferOwnership","ProductDetail","ProductCollection","ProductLink","ProductInfo","CatalogLink","Cart","Catalog","ProductList","Starred","Wallpaper","Kept","GroupSettings","MediaGallery","GroupInviteLink","PendingParticipants","Verification","DefaultEphemerality","Ephemeral","SentForAdminReview","SaveContactFlow","EventInfo","AllEvents","LimitSharing"]);f.InfoFlowStep=a}),66); __d("WAWebHostedGroupUtils",["fbt","WAWebABProps","WAWebFrontendContactGetters","gkx"],(function(a,b,c,d,e,f,g,h){a=function(){return!c("gkx")("26258")&&d("WAWebABProps").getABPropConfigValue("is_capi_groups_alpha_enabled")};b=function(a,b){b===void 0&&(b=!1);return b?h._(/*BTDS*/"__JHASH__m7a5D-ZHh9N__JHASH__",[h._param("ownerName",d("WAWebFrontendContactGetters").getFormattedName(a))]):h._(/*BTDS*/"__JHASH__ekWAcytrFXK__JHASH__",[h._param("ownerName",d("WAWebFrontendContactGetters").getFormattedName(a))])};g.isWAHostedGroupEnabled=a;g.getSecureServicesBannerText=b}),226); __d("WAWebParticipantListUtils",["fbt","WAWebABProps","WAWebAlphaRegex","WAWebContactGetters","WAWebFbtIntlList","WAWebFrontendContactGetters","WAWebHostedGroupUtils","WAWebMiscGatingUtils"],(function(a,b,c,d,e,f,g,h){function a(a){if(a.participants.length===0)return h._(/*BTDS*/"__JHASH__f2bYp_rOxbz__JHASH__").toString();if(a.participants.length===1){var b;b=(b=a.participants.head())==null?void 0:b.contact;if(b!=null&&d("WAWebContactGetters").getIsMe(b))return h._(/*BTDS*/"__JHASH__Luh7m2vnFeR__JHASH__").toString()}b=i(a,!0);if(b.length===1)return b[0];else if(b.length<=3)return c("WAWebFbtIntlList")(b,c("WAWebFbtIntlList").CONJUNCTIONS.AND,c("WAWebFbtIntlList").DELIMITERS.COMMA).toString();if(b.length>=4){a=b[0];var e=h._(/*BTDS*/"__JHASH__pcQ3aTbuxc8__JHASH__",[h._plural(b.length-1,"other_participants")]).toString();return c("WAWebFbtIntlList")([a,e],c("WAWebFbtIntlList").CONJUNCTIONS.AND).toString()}return b.join()}function b(a,b){b===void 0&&(b=!1);if(a.participants.length===0)return h._(/*BTDS*/"__JHASH__f2bYp_rOxbz__JHASH__").toString();if(a.participants.length===1){var e;e=(e=a.participants.head())==null?void 0:e.contact;if(e!=null&&d("WAWebContactGetters").getIsMe(e))return h._(/*BTDS*/"__JHASH__Luh7m2vnFeR__JHASH__").toString()}e=i(a,b);if(e.length===1)return e.pop();a=c("WAWebFbtIntlList")(e,c("WAWebFbtIntlList").CONJUNCTIONS.AND,c("WAWebFbtIntlList").DELIMITERS.COMMA);return a.toString()}function i(a,b){b===void 0&&(b=!1);var e=a.participants.length;b?b=a.participants.filter(function(a){return!d("WAWebContactGetters").getIsMe(a.contact)}):b=a.participants;var f=b.filter(function(a){return d("WAWebContactGetters").getIsMyContact(a.contact)});b=b.filter(function(a){return!d("WAWebContactGetters").getIsMyContact(a.contact)});var g=[];d("WAWebABProps").getABPropConfigValue("elevated_push_names_v2_m2_enabled")&&e>=3&&(g=b.filter(function(a){return d("WAWebContactGetters").getNotifyName(a.contact)!=null}));e=b.filter(function(a){return!g.includes(a)});b=e;e=[];d("WAWebMiscGatingUtils").isDropLastNameEnabled()?e=f.map(function(b){b=b.contact;return a.hasUniqueShortNameMention(b)?d("WAWebFrontendContactGetters").getFormattedShortNameWithNonBreakingSpaces(b):d("WAWebFrontendContactGetters").getFormattedName(b).replace(/\s/g," ")}):e=f.map(function(a){a=d("WAWebFrontendContactGetters").getFormattedShortNameWithNonBreakingSpaces(a.contact);return a});f=[];d("WAWebMiscGatingUtils").isDropLastNameEnabled()?f=g.map(function(a){a=a.contact;var b=d("WAWebContactGetters").getNotifyName(a);b=b!=null?b:d("WAWebFrontendContactGetters").getFormattedName(a);return"~"+b.replace(/\s/g," ")}):f=g.map(function(a){var b=d("WAWebContactGetters").getNotifyName(a.contact);b=b!=null?b:d("WAWebFrontendContactGetters").getFormattedShortNameWithNonBreakingSpaces(a.contact);a=b.split(/\s/);a=a[0];return"~"+(c("WAWebAlphaRegex").exec(a)?a:b)});b=b.map(function(a){return d("WAWebFrontendContactGetters").getFormattedName(a.contact)});return e.sort().concat(f.sort().concat(b.sort()))}function j(a){a=d("WAWebFrontendContactGetters").getFormattedShortNameWithNonBreakingSpaces(a);var b=a.split(/\s/);b=b[0];return c("WAWebAlphaRegex").exec(b)?b:a}function k(a,b){var c;a=a.filter(function(a){if(d("WAWebContactGetters").getIsMe(a.contact)){c=a;return!1}return!0});c&&a.push(c);if(d("WAWebMiscGatingUtils").isDropLastNameEnabled())return a.map(function(a){a=a.contact;return b.hasUniqueShortNameMention(a)?d("WAWebFrontendContactGetters").getFormattedShortNameWithNonBreakingSpaces(a):d("WAWebFrontendContactGetters").getFormattedName(a).replace(/\s/g," ")}).filter(Boolean);if(d("WAWebHostedGroupUtils").isWAHostedGroupEnabled()&&b.hasCapi===!0){var e=a.findIndex(function(a){return a.id.toString()===((a=b.owner)==null?void 0:a.toString())}),f=a[e];a.splice(e,1);a.splice(0,0,f)}return a.map(function(a){return j(a.contact)}).filter(Boolean)}function e(a){return k(a.participants.toArray(),a)}function f(a){return k(a.participants.getAdmins(),a)}g.calculateUnnamedGroupParticipantsList=a;g.calculateUnnamedGroupFullParticipantsList=b;g.getFirstNameForContact=j;g.calculateParticipantsList=e;g.calculateAdminsList=f}),226); __d("WAWebNotificationsNewsletterMetadataUpdateNotification",["fbt","WATimeUtils","WAWebBaseNotification","WAWebChatFlowTypes","WAWebCmd","WAWebContactCollection","WAWebFbtIntlList","WAWebInfoFlowStep","WAWebNotificationIconUtils","WAWebParticipantListUtils","WAWebWidFormat","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g,h){a=function(a){babelHelpers.inheritsLoose(c,a);function c(b){var c;c=a.call(this)||this;c.updates=b.updates;c.user=b.user;c.chat=b.chat;return c}var e=c.prototype;e.buildKey=function(){return"newslowner:"+this.chat.id.toString()+":"+this.user.toString()+":"+d("WATimeUtils").unixTime().toString()};e.getBannerOptions=function(){var a=this,b=this.updates.some(function(a){a=a.item;return a==="reaction_setting"})?d("WAWebInfoFlowStep").InfoFlowStep.NewsletterSettings:d("WAWebInfoFlowStep").InfoFlowStep.NewsletterInfo;return{wid:this.chat.id,title:this.chat.name,body:this.getNotificationBody(),onClick:function(){d("WAWebCmd").Cmd.openNewsletterProfile(a.chat,b)}}};e.getNotificationBody=function(){var a=this.getActor();return j(a,this.updates).toString()};e.getActor=function(){var a=d("WAWebContactCollection").ContactCollection.get(this.user);return a!=null?d("WAWebParticipantListUtils").getFirstNameForContact(a):d("WAWebWidFormat").widToFormattedUser(this.user)};e.getIcon=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){return d("WAWebNotificationIconUtils").getChatNotificationIcon(this.chat,this.abortController.signal)});function c(){return a.apply(this,arguments)}return c}();e.matchesChat=function(a){return a.equals(this.chat)};e.getChatKind=function(){return d("WAWebChatFlowTypes").ChatKindType.Newsletter};return c}(d("WAWebBaseNotification").WABaseNotification);function i(a){switch(a){case"name":return h._(/*BTDS*/"__JHASH__chuXZ2MBd5e__JHASH__");case"description":return h._(/*BTDS*/"__JHASH__EENgGuwy_Yj__JHASH__");case"profile_picture":return h._(/*BTDS*/"__JHASH__SKz8ZoqdmyT__JHASH__");case"reaction_setting":return h._(/*BTDS*/"__JHASH__0yDyy80Z5Ng__JHASH__")}}function j(a,b){if(b.length===1&&b[0].item==="name"){var d=b[0].value;return h._(/*BTDS*/"__JHASH__ZkCBwqi0GZN__JHASH__",[h._param("actor",a),h._param("updateValue",d)])}d=b.map(function(a){a=a.item;return i(a)});b=c("WAWebFbtIntlList")(d,c("WAWebFbtIntlList").CONJUNCTIONS.AND,c("WAWebFbtIntlList").DELIMITERS.COMMA);return h._(/*BTDS*/"__JHASH__96GebINn0Vh__JHASH__",[h._param("actor",a),h._param("update",b.toString())])}g.WANewsletterMetadataUpdateNotification=a}),226); __d("WAWebNotificationsNewsletterRoleChangeNotification",["fbt","WAWebBaseNotification","WAWebChatFlowTypes","WAWebContactCollection","WAWebNotificationIconUtils","WAWebParticipantListUtils","WAWebUserPrefsMeUser","WAWebWidFormat","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g,h){a=function(a){babelHelpers.inheritsLoose(c,a);function c(b){var c;c=a.call(this)||this;c.mode=b.mode;c.admin=b.admin;c.user=b.user;c.chat=b.chat;return c}var e=c.prototype;e.buildKey=function(){return"newsladmin:"+this.chat.id.toString()+":"+this.mode+":"+this.user.toString()};e.getBannerOptions=function(){var a=this.getNotificationUser(),b=d("WAWebUserPrefsMeUser").isMeAccount(this.user);return{wid:this.chat.id,title:this.chat.name,body:i[this.mode](a,b).toString()}};e.getNotificationUser=function(){var a=this.mode==="ownership"?this.admin:this.user;if(a==null)return null;a=d("WAWebContactCollection").ContactCollection.get(a);return a!=null?d("WAWebParticipantListUtils").getFirstNameForContact(a):d("WAWebWidFormat").widToFormattedUser(this.user)};e.getIcon=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){return d("WAWebNotificationIconUtils").getChatNotificationIcon(this.chat,this.abortController.signal)});function c(){return a.apply(this,arguments)}return c}();e.matchesChat=function(a){return this.chat.equals(a)};e.getChatKind=function(){return d("WAWebChatFlowTypes").ChatKindType.Newsletter};return c}(d("WAWebBaseNotification").WABaseNotification);var i={promote:function(a,b){return b?h._(/*BTDS*/"__JHASH__bL7J4CLU6em__JHASH__"):h._(/*BTDS*/"__JHASH__XENtrn6pxP6__JHASH__",[h._param("who",a)])},demote:function(a,b){return b?h._(/*BTDS*/"__JHASH__byyywj9BtKc__JHASH__"):h._(/*BTDS*/"__JHASH__4ctKkNCDLaB__JHASH__",[h._param("who",a)])},ownership:function(a){return a==null?h._(/*BTDS*/"__JHASH__7n5JI-F32Et__JHASH__"):h._(/*BTDS*/"__JHASH__uhWTxssj4Ey__JHASH__",[h._param("who",a)])}};g.WANewsletterRoleChangeNotification=a}),226); __d("WAWebShowNewsletterMetadataUpdateNotification",["WAWebNewsletterMembershipUtil","WAWebNotificationController","WAWebNotificationsNewsletterMetadataUpdateNotification","WAWebUserPrefsMeUser","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.chat,c=a.user;a=a.updates;var e=b.newsletterMetadata;if(e==null)return;if(!d("WAWebNewsletterMembershipUtil").iAmOwner(e))return;if(d("WAWebUserPrefsMeUser").isMeAccount(c))return;if(a.length===0)return;return d("WAWebNotificationController").WANotificationController.triggerNotification(new(d("WAWebNotificationsNewsletterMetadataUpdateNotification").WANewsletterMetadataUpdateNotification)({chat:b,user:c,updates:a}))});return h.apply(this,arguments)}g.showNewsletterMetadataUpdateNotification=a}),98); __d("WAWebShowNewsletterRoleChangeNotification",["Promise","WAWebCommonNewsletterEnums","WAWebNewsletterMembershipUtil","WAWebNotificationController","WAWebNotificationsNewsletterRoleChangeNotification","WAWebUserPrefsMeUser"],(function(a,b,c,d,e,f,g){var h;function a(a){var c=a.newRole,e=a.mode,f=a.chat,g=a.admin;a=a.user;var i=f.newsletterMetadata;if(i==null)return(h||(h=b("Promise"))).resolve();var j=e==="promote"&&d("WAWebUserPrefsMeUser").isMeAccount(a)&&c===d("WAWebCommonNewsletterEnums").NewsletterMembershipType.Owner;if(j)return d("WAWebNotificationController").WANotificationController.triggerNotification(new(d("WAWebNotificationsNewsletterRoleChangeNotification").WANewsletterRoleChangeNotification)({mode:"ownership",chat:f,admin:g,user:a}));j=d("WAWebNewsletterMembershipUtil").iAmOwner(i)&&e==="promote"&&c===d("WAWebCommonNewsletterEnums").NewsletterMembershipType.Admin&&!d("WAWebUserPrefsMeUser").isMeAccount(a);i=e==="demote"&&c===d("WAWebCommonNewsletterEnums").NewsletterMembershipType.Subscriber&&!d("WAWebUserPrefsMeUser").isMeAccount(a)&&a.toJid()===(g==null?void 0:g.toJid());c=e==="demote"&&d("WAWebUserPrefsMeUser").isMeAccount(a)&&a.toJid()!==(g==null?void 0:g.toJid());return j||i||c?d("WAWebNotificationController").WANotificationController.triggerNotification(new(d("WAWebNotificationsNewsletterRoleChangeNotification").WANewsletterRoleChangeNotification)({mode:e,chat:f,admin:g,user:a})):(h||(h=b("Promise"))).resolve()}g.showNewsletterRoleChangeNotification=a}),98); __d("WAWebWamEnumChannelEntryPoint",[],(function(a,b,c,d,e,f){a=Object.freeze({UNKNOWN:0,UPDATES_TAB:1,DIRECTORY:2,LINK:3,DEEPLINK:4,FORWARDED_MESSAGE:5,DIRECTORY_SEARCH:6,RECOMMENDED_LIST:7,NOTIFICATION:8,UPDATES_TAB_SEARCH:9,STATUS:10,ADMIN_INVITE_MESSAGE:11,MEDIA_BROWSER:12,SIMILAR_CHANNEL:13,DIRECTORY_CATEGORIES:14,DIRECTORY_CATEGORIES_SEARCH:15,NEWSLETTER_MEDIA_GALLERY_MEDIA:16,NEWSLETTER_MEDIA_GALLERY_LINKS:17,THREAD_CHAIN_PILL:18,THREAD_CHAIN_SWIPE_UP:19,RECENT_SEARCHES:20});f.CHANNEL_ENTRY_POINT=a}),66); __d("WAWebWamEnumChannelEntryPointApp",[],(function(a,b,c,d,e,f){a=Object.freeze({EXTERNAL_UNKNOWN:1,WHATSAPP:2});f.CHANNEL_ENTRY_POINT_APP=a}),66); __d("WAWebWamEnumChannelEntryPointMetadata",[],(function(a,b,c,d,e,f){a=Object.freeze({STATUS_HEADER:1,LINK_TOOLTIP:2,LINK_BUTTON:3,POST_TOOLTIP:4});f.CHANNEL_ENTRY_POINT_METADATA=a}),66); __d("WAWebWamEnumChannelEventSurface",[],(function(a,b,c,d,e,f){a=Object.freeze({CHANNEL_UPDATES_HOME:1,CHANNEL_THREAD:2,CHANNEL_DIRECTORY:3,CHANNEL_DIRECTORY_SEARCH:4,CHANNEL_PROFILE:5,CHANNEL_UPDATES_HOME_SEARCH:6,CHANNEL_DIRECTORY_CATEGORIES:7,CHANNEL_DIRECTORY_CATEGORIES_SEARCH:8});f.CHANNEL_EVENT_SURFACE=a}),66); __d("WAWebWamEnumChannelEventUnit",[],(function(a,b,c,d,e,f){a=Object.freeze({RECOMMENDED_CHANNELS:1,SIMILAR_CHANNELS:2,RECENT_SEARCHES:3});f.CHANNEL_EVENT_UNIT=a}),66); __d("WAWebChannelCoreEventWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumChannelEntryPoint","WAWebWamEnumChannelEntryPointApp","WAWebWamEnumChannelEntryPointMetadata","WAWebWamEnumChannelEventSurface","WAWebWamEnumChannelEventType","WAWebWamEnumChannelEventUnit","WAWebWamEnumTsSurface"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({ChannelCoreEvent:[4692,{channelCoreEventSequenceNumber:[8,a.TYPES.INTEGER],channelCoreEventType:[1,d("WAWebWamEnumChannelEventType").CHANNEL_EVENT_TYPE],channelDirectorySessionId:[7,a.TYPES.INTEGER],channelEntryPoint:[2,d("WAWebWamEnumChannelEntryPoint").CHANNEL_ENTRY_POINT],channelEntryPointApp:[3,d("WAWebWamEnumChannelEntryPointApp").CHANNEL_ENTRY_POINT_APP],channelEntryPointMetadata:[10,d("WAWebWamEnumChannelEntryPointMetadata").CHANNEL_ENTRY_POINT_METADATA],channelEventUnit:[12,d("WAWebWamEnumChannelEventUnit").CHANNEL_EVENT_UNIT],cid:[4,a.TYPES.STRING],directoryChannelIndex:[9,a.TYPES.INTEGER],discoverySurface:[14,d("WAWebWamEnumTsSurface").TS_SURFACE],entryPointMetadata:[5,a.TYPES.STRING],eventSurface:[6,d("WAWebWamEnumChannelEventSurface").CHANNEL_EVENT_SURFACE],similarChannelsSessionId:[13,a.TYPES.INTEGER]},[1,1,1],"regular"]},{ChannelCoreEvent:[]});g.ChannelCoreEventWamEvent=b}),98); __d("WAWebSimilarNewsletterSessionId",["react"],(function(a,b,c,d,e,f,g){"use strict";var h,i=(h||d("react")).useMemo;function j(){return 1+Math.floor(Number.MAX_SAFE_INTEGER*Math.random())}function a(){var a=i(function(){return j()},[]);return a}function b(a){return a}g.generateSessionId=j;g.useSimilarNewslettersSessionId=a;g.newsletterSessionIdToInt=b}),98); __d("WAWebNewsletterAttributionLogging",["WALogger","WAWebChannelCoreEventWamEvent","WAWebCommonNewsletterEnums","WAWebNewsletterCollection","WAWebNewsletterDirectoryFilterUtils","WAWebNewsletterGatingUtils","WAWebSimilarNewsletterSessionId","WAWebWamEnumChannelEntryPoint","WAWebWamEnumChannelEntryPointApp","WAWebWamEnumTsSurface"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Encountered unexpected entry point: ",""]);h=function(){return a};return a}function i(a){switch(a){case d("WAWebWamEnumChannelEntryPoint").CHANNEL_ENTRY_POINT.LINK:return d("WAWebWamEnumTsSurface").TS_SURFACE.CHAT_THREAD;case d("WAWebWamEnumChannelEntryPoint").CHANNEL_ENTRY_POINT.RECOMMENDED_LIST:case d("WAWebWamEnumChannelEntryPoint").CHANNEL_ENTRY_POINT.UPDATES_TAB:return d("WAWebWamEnumTsSurface").TS_SURFACE.CHANNEL_UPDATES_HOME;case d("WAWebWamEnumChannelEntryPoint").CHANNEL_ENTRY_POINT.DIRECTORY_CATEGORIES:return d("WAWebWamEnumTsSurface").TS_SURFACE.CHANNEL_DIRECTORY_CATEGORIES;case d("WAWebWamEnumChannelEntryPoint").CHANNEL_ENTRY_POINT.FORWARDED_MESSAGE:return d("WAWebWamEnumTsSurface").TS_SURFACE.CHAT_THREAD;case d("WAWebWamEnumChannelEntryPoint").CHANNEL_ENTRY_POINT.DIRECTORY_CATEGORIES_SEARCH:case d("WAWebWamEnumChannelEntryPoint").CHANNEL_ENTRY_POINT.DIRECTORY_SEARCH:return d("WAWebWamEnumTsSurface").TS_SURFACE.CHANNEL_DIRECTORY_CATEGORIES_SEARCH;case d("WAWebWamEnumChannelEntryPoint").CHANNEL_ENTRY_POINT.STATUS:return d("WAWebWamEnumTsSurface").TS_SURFACE.STATUS_VIEWER_SHEET;case d("WAWebWamEnumChannelEntryPoint").CHANNEL_ENTRY_POINT.ADMIN_INVITE_MESSAGE:return d("WAWebWamEnumTsSurface").TS_SURFACE.CHAT_THREAD;case d("WAWebWamEnumChannelEntryPoint").CHANNEL_ENTRY_POINT.SIMILAR_CHANNEL:return d("WAWebWamEnumTsSurface").TS_SURFACE.CHANNEL_PROFILE;default:d("WALogger").WARN(h(),a).tags("newsletter-logging").sendLogs("Unexpected entry point in newsletter open logging");return d("WAWebWamEnumTsSurface").TS_SURFACE.UNKNOWN}}function j(){return c("WAWebNewsletterCollection").some(function(a){return((a=a.newsletterMetadata)==null?void 0:a.membershipType)===d("WAWebCommonNewsletterEnums").NewsletterMembershipType.Subscriber})?1:0}a=function(){function a(){this.$6={}}var b=a.prototype;b.setChannelEntryPoint=function(a){this.$1=a};b.setChannelEntryPointMetadata=function(a){this.$4=a};b.setSimilarChannelsSessionId=function(a){this.$5=a};b.setNewsletterDirectoryLoggingData=function(a){this.$6=a};b.getSimilarChannelsSessionId=function(){return this.$5};b.getIsSimilarUnitMountedForChat=function(a){return a.equals(this.$7)};b.setIsSimilarUnitMountedForChat=function(a){this.$7=a};b.getSimilarChannelsSessionIdForLogging=function(){var a=this.$5;if(a==null)return;return d("WAWebSimilarNewsletterSessionId").newsletterSessionIdToInt(a)};b.setDirectorySessionId=function(a){this.$2=a};b.getDirectorySessionIdForLogging=function(){return this.$2};b.getNewsletterDirectoryLoggingData=function(){return this.$6};b.setDirectoryFilter=function(a){if(a==null){this.$3=null;return}switch(a){case d("WAWebNewsletterDirectoryFilterUtils").NewsletterDirectoryFilterType.Recommended:return this.$3="all";case d("WAWebNewsletterDirectoryFilterUtils").NewsletterDirectoryFilterType.New:return this.$3="new";case d("WAWebNewsletterDirectoryFilterUtils").NewsletterDirectoryFilterType.Popular:return this.$3="popular";case d("WAWebNewsletterDirectoryFilterUtils").NewsletterDirectoryFilterType.Featured:return this.$3="featured";case d("WAWebNewsletterDirectoryFilterUtils").NewsletterDirectoryFilterType.Trending:return this.$3="most_active";default:return this.$3=null}};b.log=function(a){var b,c=a.cid,e=a.eventSurface,f=a.channelCoreEventType,g=a.similarChannelSessionId,h=a.eventUnit,k=a.entryPoint;a=babelHelpers.objectWithoutPropertiesLoose(a,["cid","eventSurface","channelCoreEventType","similarChannelSessionId","eventUnit","entryPoint"]);b=JSON.stringify(babelHelpers["extends"]({has_followed_channels:j(),pill_type:(b=this.$3)!=null?b:void 0},d("WAWebNewsletterGatingUtils").isDirectoryCategoriesLoggingEnabled()?a:{}));new(d("WAWebChannelCoreEventWamEvent").ChannelCoreEventWamEvent)({cid:c.user,eventSurface:e,channelCoreEventType:f,channelEntryPointApp:d("WAWebWamEnumChannelEntryPointApp").CHANNEL_ENTRY_POINT_APP.WHATSAPP,channelEntryPoint:(c=(a=k)!=null?a:this.$1)!=null?c:void 0,channelDirectorySessionId:(e=this.$2)!=null?e:void 0,entryPointMetadata:b,similarChannelsSessionId:g!=null?d("WAWebSimilarNewsletterSessionId").newsletterSessionIdToInt(g):void 0,channelEntryPointMetadata:this.$4,channelEventUnit:(f=h)!=null?f:void 0,discoverySurface:k!=null?i(k):void 0}).commit()};return a}();b=new a();g.getDiscoverySurfaceFromChannelEntryPoint=i;g.NewsletterCoreEventLogger=b}),98); __d("WAWebNewsletterCollection",["WAWebChatCollection"],(function(a,b,c,d,e,f,g){a=new(d("WAWebChatCollection").ChatCollectionImpl)();g["default"]=a}),98); __d("WAWebNewsletterGeosuspendedCountryModel",["WAWebBaseModel"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.geosuspended=d("WAWebBaseModel").prop(),b)||babelHelpers.assertThisInitialized(c)}var c=b.prototype;c.initialize=function(){a.prototype.initialize.call(this)};return b}(d("WAWebBaseModel").BaseModel);a.Proxy="newsletter_geosuspended_country";b=d("WAWebBaseModel").defineModel(a);g.GeosuspendedCountry=b}),98); __d("WAWebNewsletterGeosuspendedCountryCollection",["WAWebBaseCollection","WAWebNewsletterGeosuspendedCountryModel"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}return b}(d("WAWebBaseCollection").BaseCollection);a.model=d("WAWebNewsletterGeosuspendedCountryModel").GeosuspendedCountry;g["default"]=a}),98); __d("WAWebNewsletterMessageDeliveryUpdateModel",["WAWebBaseModel","WAWebMsgKey"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.serverId=d("WAWebBaseModel").prop(),c.msgModel=d("WAWebBaseModel").prop(),c.code=d("WAWebBaseModel").prop(),c.t=d("WAWebBaseModel").prop(),b)||babelHelpers.assertThisInitialized(c)}var c=b.prototype;c.initialize=function(){a.prototype.initialize.call(this)};return b}(d("WAWebBaseModel").BaseModel);a.Proxy="newsletter_message_update";a.idClass=c("WAWebMsgKey");b=d("WAWebBaseModel").defineModel(a);g.NewsletterMessageDeliveryUpdate=b}),98); __d("WAWebNewsletterMessageDeliveryUpdateCollection",["WAWebBaseCollection","WAWebNewsletterMessageDeliveryUpdateModel"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}return b}(d("WAWebBaseCollection").BaseCollection);a.model=d("WAWebNewsletterMessageDeliveryUpdateModel").NewsletterMessageDeliveryUpdate;g["default"]=a}),98); __d("WAWebNewsletterMetadataCollection",["Promise","WALogger","WAWebBaseCollection","WAWebCollectionUtils","WAWebNewsletterMetadataModel","WAWebWid","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["newsletterMetadata:find trying to fetch non-newsletter wid ",""]);i=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var e,f;for(var g=arguments.length,j=new Array(g),k=0;k<g;k++)j[k]=arguments[k];return(e=f=a.call.apply(a,[this].concat(j))||this,f.byInviteCode=d("WAWebCollectionUtils").aggregated(function(a){return a.inviteCode}),f.findImpl=function(a){if(c("WAWebWid").isNewsletter(a))return(h||(h=b("Promise"))).resolve({id:a});d("WALogger").LOG(i(),a.toString());return(h||(h=b("Promise"))).reject(c("err")("newsletterMetadata:find trying to fetch non-newsletter wid "+a.toString()))},e)||babelHelpers.assertThisInitialized(f)}return e}(d("WAWebBaseCollection").BaseCollection);a.model=d("WAWebNewsletterMetadataModel").NewsletterMetadata;a.staleCollection=!0;e=new a();g["default"]=e}),98); __d("WAWebNewsletterMetricUtils",["$InternalEnum","WATimeUtils"],(function(a,b,c,d,e,f,g){"use strict";var h=60*60*24,i=30,j="infinite";function a(a){a=d("WATimeUtils").pastUnixTime(h*(i-1),a);return a}var k=b("$InternalEnum")({UniqueVisitorsOverPeriod:1,NewUniqueVisitorsOverPeriod:2,NetFollowsOverPeriod:3,UniqueVisitorOverPeriodByRole:4,UniqueVisitorOverPeriodByCountry:5,FollowersOverPeriod:6,FollowersOverPeriodByCountry:7,FollowsPerDay:8,UnfollowsPerDay:9});function c(a){a=a.flatMap(function(a){return a.getMetrics()});a=a.reduce(function(a,b){var c=a.enumSet,d=a.metricRequests,e=k.cast(b.id);if(e==null)return a;if(c.has(e))return a;c.add(e);d.push(b);return a},{enumSet:new Set(),metricRequests:[]});a=a.metricRequests;return a}function e(a){return a!==j&&Math.abs(a)<Number.EPSILON}function f(a){return new Date(a).setHours(0,0,0,0)}g.INSIGHT_DAYS_COVERED=i;g.DELTA_INFINITE=j;g.getInsightPeriodStart=a;g.NewsletterInsightMetricQuery=k;g.getUniqueMetricRequests=c;g.isDeltaValueZero=e;g.roundToNearestDay=f}),98); __d("WAWebNewsletterMetadataModel",["WAWebBaseModel","WAWebClock","WAWebCommonNewsletterEnums","WAWebModelUtils","WAWebNewsletterGeosuspendedCountryCollection","WAWebNewsletterMembershipUtil","WAWebNewsletterMessageDeliveryUpdateCollection","WAWebNewsletterMetadataCollection","WAWebNewsletterMetricUtils","WAWebNewsletterPendingAdminsCollection","WAWebNewsletterSubscribersCollection","WAWebWid"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,e;for(var f=arguments.length,g=new Array(f),h=0;h<f;h++)g[h]=arguments[h];return(b=e=a.call.apply(a,[this].concat(g))||this,e.id=d("WAWebModelUtils").prop(),e.creationTime=d("WAWebModelUtils").prop(),e.name=d("WAWebModelUtils").prop(),e.nameUpdateTime=d("WAWebModelUtils").prop(),e.description=d("WAWebModelUtils").prop(),e.descriptionUpdateTime=d("WAWebModelUtils").prop(),e.handle=d("WAWebModelUtils").prop(),e.inviteCode=d("WAWebModelUtils").prop(),e.size=d("WAWebModelUtils").prop(),e.verified=d("WAWebModelUtils").prop(),e.membershipType=d("WAWebModelUtils").prop(),e.privacy=d("WAWebModelUtils").prop(),e.website=d("WAWebModelUtils").prop(),e.messageDeliveryUpdates=d("WAWebModelUtils").collection(c("WAWebNewsletterMessageDeliveryUpdateCollection")),e.reactionCodesSetting=d("WAWebModelUtils").prop(),e.wamoSubPlanId=d("WAWebModelUtils").prop(),e.wamoSubStatus=d("WAWebModelUtils").prop(),e.suspended=d("WAWebModelUtils").prop(!1),e.geosuspended=d("WAWebModelUtils").prop(!1),e.hasProfilePictureDeletionAlerts=d("WAWebModelUtils").prop(!1),e.geosuspendedCountries=d("WAWebModelUtils").collection(c("WAWebNewsletterGeosuspendedCountryCollection")),e.capabilities=d("WAWebModelUtils").prop(function(){return new Set()}),e.adminInsights=d("WAWebModelUtils").session(),e.adminCount=d("WAWebModelUtils").prop(1),e.pendingAdmins=d("WAWebModelUtils").collection(c("WAWebNewsletterPendingAdminsCollection")),e.subscribers=d("WAWebModelUtils").collection(c("WAWebNewsletterSubscribersCollection")),e.terminated=d("WAWebModelUtils").prop(!1),e.similarNewsletters=d("WAWebModelUtils").session(function(){return[]}),e.recentlyFollowedFrom=d("WAWebModelUtils").session(),e.isSuspendedOrTerminated=d("WAWebModelUtils").derived(function(){return this.suspended||this.terminated},["suspended","terminated"]),e.canBeMuted=d("WAWebModelUtils").derived(function(){return d("WAWebNewsletterMembershipUtil").iAmOwner(this)&&this.adminCount>1||d("WAWebNewsletterMembershipUtil").iAmAdmin(this)||d("WAWebNewsletterMembershipUtil").iAmSubscriber(this)},["adminCount","membershipType"]),e.isSubscribedOrOwned=d("WAWebModelUtils").derived(function(){return d("WAWebNewsletterMembershipUtil").iAmAdminOrOwner(this)||d("WAWebNewsletterMembershipUtil").iAmSubscriber(this)},["membershipType"]),e.isPreview=d("WAWebModelUtils").derived(function(){return this.membershipType===d("WAWebCommonNewsletterEnums").NewsletterMembershipType.Guest},["membershipType"]),e.showInsightDelta=d("WAWebModelUtils").derived(function(){return d("WAWebClock").Clock.daysDeltaAbs(this.creationTime)>=d("WAWebNewsletterMetricUtils").INSIGHT_DAYS_COVERED},["creationTime"]),b)||babelHelpers.assertThisInitialized(e)}var e=b.prototype;e.initialize=function(){var b=this;a.prototype.initialize.call(this);this.listenTo(this.subscribers,"change add reset set remove",function(){b.updateAdminCount()})};e.getCollection=function(){return c("WAWebNewsletterMetadataCollection")};e.resetRecentlyFollowedFrom=function(){this.recentlyFollowedFrom=null};e.updateAdminCount=function(){var a;a=(a=(a=this.subscribers)==null?void 0:a.filter(function(a){a=a.membership;return a===d("WAWebCommonNewsletterEnums").NewsletterMembershipType.Admin||a===d("WAWebCommonNewsletterEnums").NewsletterMembershipType.Owner}).length)!=null?a:0;this.adminCount=this.membershipType===d("WAWebCommonNewsletterEnums").NewsletterMembershipType.Owner?a+1:a};return b}(d("WAWebBaseModel").BaseModel);a.Proxy="newsletterMetadata";a.idClass=c("WAWebWid");b=d("WAWebBaseModel").defineModel(a);g.NewsletterMetadata=b}),98); __d("WAWebNewsletterPendingAdminsCollection",["WAWebBaseCollection","WAWebNewsletterSubscriberModel"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}return b}(d("WAWebBaseCollection").BaseCollection);a.model=d("WAWebNewsletterSubscriberModel").NewsletterSubscriber;g["default"]=a}),98); __d("WAWebNewsletterPollVotesGetters",["WAWebGetters","WAWebGettersCaches"],(function(a,b,c,d,e,f,g){a=d("WAWebGetters").createGetterFactories({createCache:d("WAWebGettersCaches").createNewsletterPollVotesCache});b=a.field;c=a.unsafeIdentityGetter;e=a.clearCacheFor;f=e;d=c;a=b("ack");g.clearNewsletterPollVotesGetterCacheFor=f;g.getNewsletterPollVotesUnsafe=d;g.getAck=a}),98); __d("WAWebFrontendNewsletterPollVotesGetters",["WAWebAck","WAWebGetters","WAWebGettersCaches","WAWebNewsletterPollVotesGetters"],(function(a,b,c,d,e,f,g){a=d("WAWebGetters").createGetterFactories({root:d("WAWebNewsletterPollVotesGetters").getNewsletterPollVotesUnsafe,createCache:d("WAWebGettersCaches").createFrontendNewsletterPollVotesCache});b=a.field;c=a.computed;e=a.clearCacheFor;f=e;a=b("isSendFailure",{"default":!1});e=c(function(a){var b=a[0];a=a[1];b=b!=null&&b<d("WAWebAck").ACK.CLOCK;return b||Boolean(a)},[d("WAWebNewsletterPollVotesGetters").getAck,a]);g.clearFrontendNewsletterPollVotesGetterCacheFor=f;g.getIsFailed=e}),98); __d("WAWebNewsletterPollVotesModel",["WATimeUtils","WAWebAddOnModel","WAWebBaseModel","WAWebFrontendNewsletterPollVotesGetters","WAWebModelUtils","WAWebMsgKey","WAWebNewsletterPollVotesGetters"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebModelUtils").prop(),c.pollVotesCountMap=d("WAWebModelUtils").prop(function(){return new Map()}),c.pollVotesCountMapTs=d("WAWebModelUtils").prop(),c.myVote=d("WAWebModelUtils").prop(function(){return new Set()}),c.myVoteTs=d("WAWebModelUtils").prop(),c.isUnvote=d("WAWebModelUtils").prop(!1),c.msgKey=d("WAWebModelUtils").prop(),c.pollVotersMap=d("WAWebModelUtils").prop(function(){return new Map()}),b)||babelHelpers.assertThisInitialized(c)}var c=b.prototype;c["delete"]=function(){a.prototype["delete"].call(this),d("WAWebNewsletterPollVotesGetters").clearNewsletterPollVotesGetterCacheFor(this),d("WAWebFrontendNewsletterPollVotesGetters").clearFrontendNewsletterPollVotesGetterCacheFor(this)};c.updateMyVote=function(a,b,c){var e,f;if(b<((e=this.myVoteTs)!=null?e:0))return;e=(e=this.myVote)!=null?e:new Set();var g=(f=this.pollVotesCountMap)!=null?f:new Map();Array.from(e).forEach(function(a){var b;b=(b=g.get(a))!=null?b:0;g.set(a,Math.max(b-1,0))});Array.from(a).forEach(function(a){var b;b=(b=g.get(a))!=null?b:0;g.set(a,b+1)});this.msgKey=c;this.pollVotesCountMap=g;this.myVote=a;this.myVoteTs=d("WATimeUtils").castToMillisTime(b)};c.updatePollVotersMap=function(a,b){if(b==null){this.pollVotersMap=a;return}a=a.get(b);if(a!=null){var c=new Map(this.pollVotersMap);c.set(b,a);this.pollVotersMap=c}};return b}(d("WAWebAddOnModel").AddOnBaseModel);a.Proxy="newsletterPollVote";a.idClass=c("WAWebMsgKey");b=d("WAWebBaseModel").defineModel(a);g.NewsletterPollVotes=b}),98); __d("WAWebNewsletterPollVotesModelCollection",["WATimeUtils","WAWebBaseCollection","WAWebCRUDOperationsNewsletterMyVotes","WAWebCRUDOperationsNewsletterPollsVotes","WAWebMiscErrors","WAWebMsgCollection","WAWebMsgKey","WAWebNewsletterPollVotesModel","WAWebPollsCreateOptionLocalIdMap","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){e=function(a){babelHelpers.inheritsLoose(e,a);function e(){var e,f;for(var g=arguments.length,h=new Array(g),i=0;i<g;i++)h[i]=arguments[i];return(e=f=a.call.apply(a,[this].concat(h))||this,f.findImpl=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=a.toString();var b=(yield d("WAWebCRUDOperationsNewsletterPollsVotes").getVote(a)),e=(yield d("WAWebMsgCollection").MsgCollection.hydrateOrGetMessages([a]));e=e[0];if(e==null)throw new(d("WAWebMiscErrors").NotFoundError)("No votes found");var f=e.id.remote.toJid(),g=e.serverId;e=e.pollOptions;f=g!=null?yield d("WAWebCRUDOperationsNewsletterMyVotes").getMyVote(f,g):null;if(e==null)throw new(d("WAWebMiscErrors").NotFoundError)("No pollOptions found");if(b==null&&f==null)throw new(d("WAWebMiscErrors").NotFoundError)("No polls to display");g={id:c("WAWebMsgKey").fromString(a),pollVotesCountMap:new Map()};var h=(yield d("WAWebPollsCreateOptionLocalIdMap").createOptionLocalIdMap(e));b!=null&&(g.pollVotesCountMap=new Map(Array.from(b.votesMap.entries()).map(function(a){var b=a[0];a=a[1];return[h.getLocalIdForHexHash(b),a]})),g.pollVotesCountMapTs=d("WATimeUtils").castToUnixTime(b.serverTimestamp));if(f!=null){g.myVote=new Set(f.votes.map(function(a){return h.getLocalIdForHexHash(a)}));var i=g.pollVotesCountMap;g.myVote.forEach(function(a){i!=null&&!i.has(a)&&i.set(a,1)});g.myVoteTs=d("WATimeUtils").castToMillisTime(f.serverTimestampMs);g.ack=f.ack}return g});return function(b){return a.apply(this,arguments)}}(),e)||babelHelpers.assertThisInitialized(f)}return e}(d("WAWebBaseCollection").BaseCollection);e.model=d("WAWebNewsletterPollVotesModel").NewsletterPollVotes;function a(a){var b=a.msgKey,c=a.parentMsgKey,d=a.selectedOptionLocalIds;a=a.timestamp;c=h.gadd({id:c});c.updateMyVote(d,a,b);return c}var h=new e();g.updateOrCreatePollVote=a;g.NewsletterPollVotesModelCollection=h}),98); __d("WAWebNewsletterReactionModel",["WATimeUtils","WAWebBaseModel","WAWebModelUtils","WAWebMsgKey","WAWebReactionsBEUtils"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebModelUtils").prop(),c.parentMsgServerId=d("WAWebModelUtils").prop(),c.myReactionMsgKey=d("WAWebModelUtils").prop(),c.reactionCountMap=d("WAWebModelUtils").prop(),c.reactionCountMapTs=d("WAWebModelUtils").prop(),c.myReaction=d("WAWebModelUtils").prop(),c.myReactionTs=d("WAWebModelUtils").prop(),b)||babelHelpers.assertThisInitialized(c)}var c=b.prototype;c.initialize=function(){var b;a.prototype.initialize.call(this);this.reactionCountMap=(b=this.reactionCountMap)!=null?b:new Map()};c.updateMyReaction=function(a){return a===d("WAWebReactionsBEUtils").REVOKED_REACTION_TEXT?this.$NewsletterMessageReactionsImpl$p_1():this.$NewsletterMessageReactionsImpl$p_2(a)};c.$NewsletterMessageReactionsImpl$p_2=function(a){var b,c=this.myReaction;this.reactionCountMap=(b=this.reactionCountMap)!=null?b:new Map();b=this.reactionCountMap;var d=b.get(a);b.set(a,((d=d)!=null?d:0)+1);d=c!=null?b.get(c):null;if(d!=null&&c!=null){d=d-1;d>0?b.set(c,d):b["delete"](c)}this.$NewsletterMessageReactionsImpl$p_3(a)};c.$NewsletterMessageReactionsImpl$p_1=function(){var a,b=this.myReaction;if(b==null)return;this.reactionCountMap=(a=this.reactionCountMap)!=null?a:new Map();a=this.reactionCountMap;var c=a.get(b);if(c==null)return;c>1?a.set(b,c-1):a["delete"](b);this.$NewsletterMessageReactionsImpl$p_3(null)};c.$NewsletterMessageReactionsImpl$p_3=function(a){this.myReactionTs=d("WATimeUtils").unixTime(),this.myReaction=a};return b}(d("WAWebBaseModel").BaseModel);a.Proxy="newsletterReaction";a.idClass=c("WAWebMsgKey");b=d("WAWebBaseModel").defineModel(a);g.NewsletterMessageReactions=b}),98); __d("WAWebNewsletterReactionCollection",["WATimeUtils","WAWebBaseCollection","WAWebDBGetReactions","WAWebMiscErrors","WAWebMsgCollection","WAWebMsgKey","WAWebNewsletterDBUtils","WAWebNewsletterReactionModel","WAWebReactionsBEUtils","WAWebUserPrefsMeUser","WAWebdbCRUDOperationsNewsletterReaction","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){e=function(a){babelHelpers.inheritsLoose(e,a);function e(){var e,f;for(var g=arguments.length,h=new Array(g),i=0;i<g;i++)h[i]=arguments[i];return(e=f=a.call.apply(a,[this].concat(h))||this,f.findImpl=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield d("WAWebdbCRUDOperationsNewsletterReaction").getNewsletterReaction(a)),e=(yield d("WAWebMsgCollection").MsgCollection.hydrateOrGetMessages([a]));e=e[0];if(e==null)throw new(d("WAWebMiscErrors").NotFoundError)("No reactions found");var f=e.id.remote.toJid();e=e.serverId;f=e!=null?yield d("WAWebNewsletterDBUtils").craftNewsletterMsgKeyFromServerId(e,f):null;f=f!=null?yield d("WAWebDBGetReactions").existsReactionAddressingModeInsensitive({parentMsgKey:f.toString(),senderUserJid:d("WAWebUserPrefsMeUser").getMeUser().toString()}):null;if(b==null&&f==null)throw new(d("WAWebMiscErrors").NotFoundError)("No reactions to display");a={id:c("WAWebMsgKey").fromString(a)};e!=null&&(a.parentMsgServerId=e);b!=null&&(a.reactionCountMap=b.emojiCountMap,a.reactionCountMapTs=d("WATimeUtils").castToUnixTime(b.serverTimestamp));f!=null&&f.reactionText!==d("WAWebReactionsBEUtils").REVOKED_REACTION_TEXT&&(a.myReactionMsgKey=c("WAWebMsgKey").from(f.msgKey),a.myReaction=f.reactionText,a.myReactionTs=d("WATimeUtils").castToUnixTime(f.timestamp));return a});return function(b){return a.apply(this,arguments)}}(),e)||babelHelpers.assertThisInitialized(f)}return e}(d("WAWebBaseCollection").BaseCollection);e.model=d("WAWebNewsletterReactionModel").NewsletterMessageReactions;var h=new e();function a(a){var b=a.parentMsg,c=a.reactionCode;a=a.reactionMsg;b=h.gadd({id:b.id,myReactionMsgKey:a.id});b.updateMyReaction(c);return b}g.NewsletterMessageReactionsCollection=h;g.updateOrCreateMessageReaction=a}),98); __d("WAWebNewsletterReportModel",["WAWebBaseModel"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.reportStatus=d("WAWebBaseModel").prop(),c.creationTime=d("WAWebBaseModel").prop(),c.newsletterName=d("WAWebBaseModel").prop(),c.newsletterId=d("WAWebBaseModel").prop(),c.serverMsgId=d("WAWebBaseModel").prop(),c.appeal=d("WAWebBaseModel").prop(),b)||babelHelpers.assertThisInitialized(c)}return b}(d("WAWebBaseModel").BaseModel);a.Proxy="newsletter_report";b=d("WAWebBaseModel").defineModel(a);g.NewsletterReport=b}),98); __d("WAWebNewsletterReportCollection",["WAWebBaseCollection","WAWebNewsletterReportModel"],(function(a,b,c,d,e,f,g){a=function(a,b){var c;c=((c=b.appeal.creationTime)!=null?c:0)-((c=a.appeal.creationTime)!=null?c:0);return c!==0?c:b.creationTime-a.creationTime};b=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}return b}(d("WAWebBaseCollection").BaseCollection);b.model=d("WAWebNewsletterReportModel").NewsletterReport;b.comparator=a;c=new b();g.NewsletterReportCollection=c}),98); __d("WAWebNewsletterSubscribersCollection",["WAWebBaseCollection","WAWebCommonNewsletterEnums","WAWebContactGetters","WAWebFrontendContactGetters","WAWebNewsletterSubscriberModel"],(function(a,b,c,d,e,f,g){a=function(a,b){if(a.membership===b.membership){if(!d("WAWebContactGetters").getIsMyContact(a.contact))return 1;if(!d("WAWebContactGetters").getIsMyContact(b.contact))return-1;var c=d("WAWebFrontendContactGetters").getFormattedUser(a.contact),e=d("WAWebFrontendContactGetters").getFormattedUser(b.contact);return c.localeCompare(e)}if(a.membership===d("WAWebCommonNewsletterEnums").NewsletterMembershipType.Owner)return-1;return b.membership===d("WAWebCommonNewsletterEnums").NewsletterMembershipType.Owner?1:a.membership===d("WAWebCommonNewsletterEnums").NewsletterMembershipType.Admin?-1:1};b=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}return b}(d("WAWebBaseCollection").BaseCollection);b.model=d("WAWebNewsletterSubscriberModel").NewsletterSubscriber;b.comparator=a;g["default"]=b}),98); __d("WAWebPsaVerifiedBlueIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k="psa-verified-blue";function a(a){var b=a.iconXstyle,e=a.height,f=a.width,g=a.viewBox;a=babelHelpers.objectWithoutPropertiesLoose(a,["iconXstyle","height","width","viewBox"]);var h;if(g){var l=g.x;l=l===void 0?0:l;var m=g.y;m=m===void 0?0:m;var n=g.width;n=n===void 0?0:n;g=g.height;g=g===void 0?0:g;h=[l,m,n,g].join(" ")}l=20;m=20;(e!=null||f!=null)&&(l=e,m=f);return j.jsx(d("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers["extends"]({name:k},a,{children:j.jsxs("svg",{viewBox:(n=h)!=null?n:"0 0 20 20",height:l,width:m,preserveAspectRatio:"xMidYMid meet",className:(i||(i=c("stylex")))(b),fill:"none",children:[j.jsx("title",{children:k}),j.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.595 8.23978L17.7696 9.43025L17.7615 9.42221C18.0795 9.74022 18.0795 10.2538 17.7614 10.5718L16.5868 11.7623L17.011 13.3849C17.117 13.817 16.8641 14.2655 16.4318 14.3797L14.8167 14.82L14.3762 16.4345C14.2539 16.8666 13.8134 17.1275 13.3811 17.0134L11.7578 16.5894L10.5669 17.7635C10.4119 17.9185 10.1998 18 9.99592 18C9.792 18 9.57991 17.9185 9.42493 17.7635L8.234 16.5894L6.61076 17.0134C6.17844 17.1275 5.7298 16.8666 5.6156 16.4345L5.17512 14.82L3.56003 14.3797C3.13587 14.2574 2.87484 13.817 2.98904 13.3849L3.4132 11.7623L2.23859 10.5718C1.92047 10.2538 1.92047 9.74009 2.23859 9.42209L3.4132 8.23162L2.98904 6.60899C2.87484 6.17684 3.12771 5.72837 3.56003 5.61422L5.17512 5.17391L5.6156 3.55943C5.73796 3.13543 6.17844 2.87451 6.61076 2.98866L8.234 3.41266L9.42493 2.2385C9.74305 1.9205 10.2569 1.9205 10.5751 2.2385L11.766 3.41266L13.3892 2.98866C13.8216 2.88266 14.2702 3.13543 14.3844 3.56759L14.8249 5.18206L16.44 5.62237C16.8723 5.74468 17.1333 6.18499 17.0191 6.61715L16.595 8.23978ZM9.37506 12.7678C9.21482 12.9279 9.01452 13 8.80621 13C8.5979 13 8.3976 12.9199 8.23736 12.7678L6.23435 10.7658C5.92188 10.4535 5.92188 9.94895 6.23435 9.63664C6.54682 9.32432 7.05158 9.32432 7.36405 9.63664L8.7982 11.0701L12.636 7.23423C12.9484 6.92192 13.4532 6.92192 13.7656 7.23423C14.0781 7.54655 14.0781 8.05105 13.7656 8.36336L11.5784 10.5656L9.37506 12.7678Z",fill:"#007BFC",style:{fill:"#007BFC",fillOpacity:1}})]})}))}a.displayName=a.name+" [from "+f.id+"]";g.PsaVerifiedBlueIcon=a}),98); __d("WAWebPsaVerifiedIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k="psa-verified";function a(a){var b=a.iconXstyle,e=a.height,f=a.width,g=a.viewBox;a=babelHelpers.objectWithoutPropertiesLoose(a,["iconXstyle","height","width","viewBox"]);var h;if(g){var l=g.x;l=l===void 0?0:l;var m=g.y;m=m===void 0?0:m;var n=g.width;n=n===void 0?0:n;g=g.height;g=g===void 0?0:g;h=[l,m,n,g].join(" ")}l=18;m=18;(e!=null||f!=null)&&(l=e,m=f);return j.jsx(d("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers["extends"]({name:k},a,{children:j.jsxs("svg",{viewBox:(n=h)!=null?n:"0 0 18 18",height:l,width:m,preserveAspectRatio:"xMidYMid meet",className:(i||(i=c("stylex")))(b),version:"1.1",x:"0px",y:"0px",enableBackground:"new 0 0 18 18",children:[j.jsx("title",{children:k}),j.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 "}),j.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 "})]})}))}a.displayName=a.name+" [from "+f.id+"]";g.PsaVerifiedIcon=a}),98); __d("WAWebNewsletterName.react",["fbt","WALogger","WAWebEmojiText.react","WAWebFbtCommon","WAWebFormatConfiguration","WAWebMiscGatingUtils","WAWebPsaVerifiedBlueIcon.react","WAWebPsaVerifiedIcon.react","react","useWAWebModelValues"],(function(a,b,c,d,e,f,g,h){"use strict";var i;function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[newsletter][NewsletterName] undefined name"]);j=function(){return a};return a}var k=i||d("react");b={verified:{flexGrow:"x1c4vz4f",display:"x3nfvp2",overflowX:"xuce83p",overflowY:"x1bft6iq",textOverflow:"x1i7k8ik",whiteSpace:"xq9mrsl",alignItems:"x6s0dn4",$$css:!0},newsletterIcon:{display:"x78zum5",alignItems:"x6s0dn4",justifyContent:"xl56j7k",marginStart:"x12mruv9",$$css:!0}};function a(a){var b=a.chat,c=a.element,e=a.highlightText,f=a.titlify,g=a.ellipsify,h=a.breakWord,i=a.onClick,j=a.className,n=a.xstyle,o=a.testid;o=a.checkmarkLarge;o=o===void 0?!1:o;a=a.skipCheckMark;a=a===void 0?!1:a;var p=d("useWAWebModelValues").useModelValues(b,["id","newsletterMetadata"]);p=d("useWAWebModelValues").useOptionalModelValues(p.newsletterMetadata,["verified"]);b=m(b);e=e!=null&&e!==""?d("WAWebFormatConfiguration").SearchName({terms:[e]}):void 0;b=k.jsx(d("WAWebEmojiText.react").EmojiText,{text:b,element:c,className:j,xstyle:n,formatters:e,titlify:f,ellipsify:g,breakWord:h,direction:"auto",inlineblock:!0,onClick:i,testid:void 0});c=(p==null?void 0:p.verified)===!0;return k.jsx(l,{verified:c,checkmarkLarge:o,skipCheckMark:a,children:b})}a.displayName=a.name+" [from "+f.id+"]";function l(a){var b=a.checkmarkLarge,c=a.children,e=a.skipCheckMark;a=a.verified;var f;if(a&&!e){a=h._(/*BTDS*/"__JHASH__3IUSQ66sfH4__JHASH__");e=b?24:16;f=k.jsx("div",babelHelpers["extends"]({className:"x78zum5 x6s0dn4 xl56j7k x12mruv9"},{children:d("WAWebMiscGatingUtils").isBlueEnabled()?k.jsx(d("WAWebPsaVerifiedBlueIcon.react").PsaVerifiedBlueIcon,{"aria-label":a,width:e,height:e}):k.jsx(d("WAWebPsaVerifiedIcon.react").PsaVerifiedIcon,{"aria-label":a})}))}return k.jsxs("span",babelHelpers["extends"]({className:"x1c4vz4f x3nfvp2 xuce83p x1bft6iq x1i7k8ik xq9mrsl x6s0dn4"},{children:[c,f]}))}l.displayName=l.name+" [from "+f.id+"]";function m(a){a=d("useWAWebModelValues").useModelValues(a,["id","newsletterMetadata","formattedTitle"]);var b=d("useWAWebModelValues").useOptionalModelValues(a.newsletterMetadata,["name","verified"]);if((b==null?void 0:b.name)!=null)return b.name;if(a.formattedTitle!=null)return a.formattedTitle;d("WALogger").ERROR(j()).tags("newsletter").devConsole("Undefined newsletter metadata name or chat.formattedTitle for "+a.id.toString()+" ").sendLogs("newsletter-undefined-name");return c("WAWebFbtCommon")("Untitled Channel")}g.styles=b;g.NewsletterName=a}),226); __d("WAWebPaymentNotificationHandler",["WALogger","WANullthrows","WAWap","WAWebCommonMsgSubtypeTypes","WAWebDBMsgUtils","WAWebDBProcessMessage","WAWebHandleSingleMsg","WAWebLidMigrationUtils","WAWebMsgCollection","WAWebMsgKey","WAWebMsgModel","WAWebMsgType","WAWebPaymentNotificationParser","WAWebPaymentStatusUtils","WAWebSchemaOrphanPaymentNotification","WAWebStateUtils","WAWebUserPrefsMeUser","WAWebViewMode.flow","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["getOrphanPaymentNotificationTable.bulkRemove: failed for: ",", error: ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["handlePaymentTransactionNotification: no msg found for id: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["handlePaymentNotification: failed: ",""]);j=function(){return a};return a}function a(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=d("WAWebPaymentNotificationParser").paymentNotificationParser.parse(a);if(a.error!=null){d("WALogger").WARN(j(),a.error);throw a.error}var b=a.success,c=b.transaction;b=b.invite;b!=null?yield n(b):c!=null&&(yield l(c));return w(a.success)});return k.apply(this,arguments)}function l(a){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=c("WANullthrows")(a.msgKey),e=d("WAWebLidMigrationUtils").getAlternateMsgKey(b),f=x(b,e);f=f?d("WAWebStateUtils").unproxy(f):yield y(b,e);if(!f){d("WALogger").WARN(i(),b);e=babelHelpers["extends"]({},a,{msgKey:b.toString()});yield d("WAWebSchemaOrphanPaymentNotification").getTable().createOrReplace(e);return}yield p(f,a)});return m.apply(this,arguments)}function n(a){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a.type!=="account-set-up")return;a=(yield u(a.from,a.timestamp));yield d("WAWebHandleSingleMsg").handleSingleMsg(a.from,a,"handlePaymentInviteNotification")});return o.apply(this,arguments)}function p(a,b){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=[];r(a,b);c.push(a.id.toString());b=[a instanceof d("WAWebMsgModel").Msg?a.toJSON():a];if(a.paymentRequestMessageKey!=null){var e=a.paymentRequestMessageKey,f=d("WAWebLidMigrationUtils").getAlternateMsgKey(e),g=x(e,f);g=g?d("WAWebStateUtils").unproxy(g):yield y(e,f);g&&(g.paymentStatus=a.paymentStatus,g.paymentTxnStatus=d("WAWebPaymentStatusUtils").determinePaymentRequestFulfilledStatus(a.paymentTxnStatus),b.push(g instanceof d("WAWebMsgModel").Msg?g.toJSON():g))}d("WAWebSchemaOrphanPaymentNotification").getTable().bulkRemove(c)["catch"](function(a){d("WALogger").ERROR(h(),c,a)});yield d("WAWebDBProcessMessage").updateExistingMessages(b)});return q.apply(this,arguments)}function r(a,b){b&&(b.status!=null&&(a.paymentStatus=d("WAWebPaymentStatusUtils").getPaymentWebStatus(b.status,b.type),a.paymentTxnStatus=d("WAWebPaymentStatusUtils").getPaymentTxnWebStatus(b.status)),a.paymentCurrency=b.currency||"",a.paymentAmount1000=c("WANullthrows")(b.amount1000),a.paymentMessageReceiverJid=b.receiver,a.paymentTransactionTimestamp=c("WANullthrows")(b.ts))}function e(a){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.map(function(a){return a.id.toString()});b=(yield d("WAWebSchemaOrphanPaymentNotification").getTable().bulkGet(b));var e=new Map();a.forEach(function(a){e.set(a.id.toString(),a)});b.forEach(function(a){if(a){var b=e.get(a.msgKey);if(!b)return;void p(b,{receiver:a.receiver,currency:a.currency,amount1000:a.amount1000,type:a.type,status:a.status,ts:a.ts,msgKey:c("WAWebMsgKey").fromString(a.msgKey)})}})});return s.apply(this,arguments)}function f(){return t.apply(this,arguments)}function t(){t=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield d("WAWebSchemaOrphanPaymentNotification").getTable().all()),b=new Map(),e=[];a.forEach(function(a){var f=a.msgKey,g=d("WAWebMsgCollection").MsgCollection.get(f);if(g==null){var h=d("WAWebLidMigrationUtils").getAlternateMsgKey(c("WAWebMsgKey").fromString(f));h!=null&&(f=h.toString(),g=d("WAWebMsgCollection").MsgCollection.get(h))}g?void p(g,{receiver:a.receiver,currency:a.currency,amount1000:a.amount1000,type:a.type,status:a.status,ts:a.ts,msgKey:c("WAWebMsgKey").fromString(f)}):(b.set(f,a),e.push(f))});if(e.length>0){a=(yield d("WAWebDBMsgUtils").getMsgsByMsgKey(e,function(a){var e=b.get(a.id.toString());e&&(a.paymentTxnStatus=d("WAWebPaymentStatusUtils").getPaymentTxnWebStatus(e.status),a.paymentCurrency=e.currency||"",a.paymentAmount1000=c("WANullthrows")(e.amount1000),a.paymentMessageReceiverJid=e.receiver,a.paymentTransactionTimestamp=c("WANullthrows")(e.ts))}));return d("WAWebDBProcessMessage").updateExistingMessages(a)}});return t.apply(this,arguments)}function u(a,b){return v.apply(this,arguments)}function v(){v=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){return{id:new(c("WAWebMsgKey"))({remote:a,fromMe:!1,id:yield c("WAWebMsgKey").newId()}),type:d("WAWebMsgType").MSG_TYPE.NOTIFICATION_TEMPLATE,kind:d("WAWebMsgType").MsgKind.NotificationTemplate,viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE,subtype:d("WAWebCommonMsgSubtypeTypes").MsgSubtype.PaymentInviteAccountSetUp,from:a,to:d("WAWebUserPrefsMeUser").getMeUser(),recipients:[],t:b,templateParams:[a]}});return v.apply(this,arguments)}function w(a){var b=a.stanzaId;a=a.from;return d("WAWap").wap("ack",{"class":"notification",type:"pay",id:d("WAWap").CUSTOM_STRING(b),to:a})}function x(a,b){return(a=d("WAWebMsgCollection").MsgCollection.get(a))!=null?a:b!=null?d("WAWebMsgCollection").MsgCollection.get(b):null}function y(a,b){return z.apply(this,arguments)}function z(){z=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=(yield d("WAWebDBMsgUtils").getMsgByMsgKey(a));a==null&&b!=null&&(a=(yield d("WAWebDBMsgUtils").getMsgByMsgKey(b)));return a});return z.apply(this,arguments)}g.handlePaymentNotification=a;g.processOrphanPaymentNotifications=e;g.processAllOrphanPaymentNotifications=f;g.getMessageFromCollection=x;g.getMessageFromDb=y}),98); __d("WAWebGenerateRequestPaymentMessageProto",["WAWebPaymentsProtoUtils"],(function(a,b,c,d,e,f,g){function a(a){a=a.json;var b=d("WAWebPaymentsProtoUtils").generatePaymentsNoteMessage(a);return{requestPaymentMessage:{amount1000:a.amount1000,expiryTimestamp:a._paymentExpiryTimestamp,requestFrom:a._paymentRequestFrom,currencyCodeIso4217:a._currencyCodeIso4217,noteMessage:b}}}g["default"]=a}),98); __d("WAWebGenerateSendPaymentMessageProto",["WAWebE2EProtoUtils","WAWebPaymentsProtoUtils"],(function(a,b,c,d,e,f,g){function a(a){a=a.json;var b=a.paymentRequestMessageKey?{fromMe:a.paymentRequestMessageKey.fromMe,remoteJid:d("WAWebE2EProtoUtils").encodeJid(a.paymentRequestMessageKey.remote),id:a.paymentRequestMessageKey.id,participant:d("WAWebE2EProtoUtils").encodeJid(a.paymentRequestMessageKey.participant)}:void 0;return{sendPaymentMessage:{requestMessageKey:b,noteMessage:d("WAWebPaymentsProtoUtils").generatePaymentsNoteMessage(a)}}}g["default"]=a}),98); __d("WAWebPaymentsProtoUtils",["WAWebE2EProtoGenerator","WAWebE2EProtoUtils"],(function(a,b,c,d,e,f,g){function a(a){if(a.paymentNoteMsg==null)return;var b={stanzaId:a.quotedStanzaID,mentionedJid:a.mentionedJidList&&a.mentionedJidList.map(d("WAWebE2EProtoUtils").encodeJid),isForwarded:a.isForwarded,forwardingScore:a.forwardingScore,groupMentions:[]},c=d("WAWebE2EProtoUtils").encodeJid(a.quotedParticipant);c!=null&&(b.participant=c);if(a.quotedMsg){c=d("WAWebE2EProtoGenerator").getProtobufMessage(a.quotedMsg,void 0,void 0,void 0,"quoted");b.quotedMessage=d("WAWebE2EProtoUtils").getMutableMessageProtobuf(c)}return d("WAWebE2EProtoGenerator").getProtobufMessage(Object.assign(a.paymentNoteMsg,{_isPaymentNoteMsg:!0}),void 0,b)}g.generatePaymentsNoteMessage=a}),98); __d("WAWebPaymentRequestMsgAction",["WAWebDBProcessPaymentMessages","WAWebMsgCollection","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=new(d("WAWebMsgCollection").MsgCollection.constructor.model)(a);b=(yield d("WAWebDBProcessPaymentMessages").processPaymentMessages([b]));b&&b.forEach(function(b){var c=d("WAWebMsgCollection").MsgCollection.get(b.id);c?c.set(b,{merge:!0}):b.id===a.id.toString()&&(a.type=b.type,a.templateParams=b.templateParams)})});return h.apply(this,arguments)}function c(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=new(d("WAWebMsgCollection").MsgCollection.constructor.model)(a);a=(yield d("WAWebDBProcessPaymentMessages").processPaymentMessages([a]));a&&a.forEach(function(a){var b=d("WAWebMsgCollection").MsgCollection.get(a.id);b&&b.set(a,{merge:!0})})});return i.apply(this,arguments)}g.cancelOrDeclinePaymentRequest=a;g.fulfillPaymentRequest=c}),98); __d("WAWebFormatPaymentMsg",["fbt","WAWebWidToFormattedNameOrNumber"],(function(a,b,c,d,e,f,g,h){function a(a){var b=c("WAWebWidToFormattedNameOrNumber")(a.remote);return a.fromMe?h._(/*BTDS*/"__JHASH__Q3aJQv8wfXg__JHASH__",[h._param("otherUser",b)]):h._(/*BTDS*/"__JHASH__rxqsRnpSp0V__JHASH__",[h._param("otherUser",b)])}g.formatPaymentInviteMessageText=a}),226); __d("WAWebPinInChatGetters",["WAWebGetters","WAWebGettersCaches"],(function(a,b,c,d,e,f,g){a=d("WAWebGetters").createGetterFactories({createCache:d("WAWebGettersCaches").createPinInChatsCache});b=a.field;c=a.unsafeIdentityGetter;e=a.clearCacheFor;f=e;d=c;a=b("sender");e=b("ack");g.clearPinInChatGetterCacheFor=f;g.getPinInChatUnsafe=d;g.getSender=a;g.getAck=e}),98); __d("WAWebFrontendPinInChatGetters",["WAWebAck","WAWebGetters","WAWebGettersCaches","WAWebPinInChatGetters","WAWebUserPrefsMeUser"],(function(a,b,c,d,e,f,g){a=d("WAWebGetters").createGetterFactories({root:d("WAWebPinInChatGetters").getPinInChatUnsafe,createCache:d("WAWebGettersCaches").createFrontendPinInChatsCache});b=a.field;c=a.computed;e=a.clearCacheFor;f=e;a=b("isSendFailure",{"default":!1});e=c(function(a){var b=a[0],c=a[1];a=a[2];b=d("WAWebUserPrefsMeUser").isMeAccount(b)&&c!=null&&c<d("WAWebAck").ACK.CLOCK;return b||Boolean(a)},[d("WAWebPinInChatGetters").getSender,d("WAWebPinInChatGetters").getAck,a]);g.clearFrontendPinInChatGetterCacheFor=f;g.getIsFailed=e}),98); __d("WAWebPinInChatModel",["WATimeUtils","WAWebAddOnModel","WAWebBaseModel","WAWebFrontendPinInChatGetters","WAWebPinInChatGetters"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.msgKey=d("WAWebBaseModel").prop(),c.parentMsgKey=d("WAWebBaseModel").prop(),c.senderTimestampMs=d("WAWebBaseModel").prop(),c.t=d("WAWebBaseModel").prop(),c.sender=d("WAWebBaseModel").prop(),c.chatId=d("WAWebBaseModel").prop(),c.pinType=d("WAWebBaseModel").prop(),c.pinExpiryDuration=d("WAWebBaseModel").prop(),c.id=d("WAWebBaseModel").prop(),c.read=d("WAWebBaseModel").prop(),b)||babelHelpers.assertThisInitialized(c)}var c=b.prototype;c["delete"]=function(){a.prototype["delete"].call(this),d("WAWebPinInChatGetters").clearPinInChatGetterCacheFor(this),d("WAWebFrontendPinInChatGetters").clearFrontendPinInChatGetterCacheFor(this)};c.leftExpirationTime=function(){var a;a=((a=this.t)!=null?a:Math.floor(this.senderTimestampMs/1e3))+((a=this.pinExpiryDuration)!=null?a:0);return a-d("WATimeUtils").unixTime()};return b}(d("WAWebAddOnModel").AddOnBaseModel);b=d("WAWebBaseModel").defineModel(a);g.PinInChat=b}),98); __d("WAWebPinInChatCollection",["WATimeUtils","WAWebBaseCollection","WAWebCollectionUtils","WAWebFrontendPinInChatGetters","WAWebPinInChatModel","WAWebPinMsgConstants","WAWebUserPrefsMeUser"],(function(a,b,c,d,e,f,g){b=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.byChatId=d("WAWebCollectionUtils").aggregated(function(a){return a.chatId}),c.byIsFailedByMe=d("WAWebCollectionUtils").aggregated(function(a){return d("WAWebFrontendPinInChatGetters").getIsFailed(a)&&d("WAWebUserPrefsMeUser").isMeAccount(a.sender)}),b)||babelHelpers.assertThisInitialized(c)}var c=b.prototype;c.deleteByParentMessageKey=function(a){this.remove(h(a))};c.getByMsgKey=function(a){return this.findFirst(function(b){return b.msgKey.equals(a)})};c.getByParentMsgKey=function(a){return this.get(h(a))};return b}(d("WAWebBaseCollection").BaseCollection);b.model=d("WAWebPinInChatModel").PinInChat;b.comparator=function(a,b){return Number(b.t)-Number(a.t)};function h(a){return"!!"+a.toString()}function i(a){var b;if(a.senderTimestampMs==null)return!1;var c=a.pinExpiryDuration!=null;a=((b=a.t)!=null?b:Math.floor(a.senderTimestampMs/1e3))+((b=a.pinExpiryDuration)!=null?b:0);return c&&a<d("WATimeUtils").unixTime()}function a(a){return a.pinType===d("WAWebPinMsgConstants").PIN_STATE.PIN&&a.parentMsgKey!=null&&!i(a)}c=new b();g.getPinInChatId=h;g.isPinExpired=i;g.isPinValid=a;g.PinInChatCollection=c}),98); __d("WAWebDBPollsInvalidateChatPolls",["WAWebDBMessageUtils","WAWebModelStorageUtils","WAWebMsgType","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return d("WAWebModelStorageUtils").getStorage().lock(["message"],function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){b=b[0];var c=(yield b.between(["internalId"],d("WAWebDBMessageUtils").beginningOfChat(a),d("WAWebDBMessageUtils").endOfChat(a)));yield b.bulkCreateOrMerge(c.filter(function(a){return a.type===d("WAWebMsgType").MSG_TYPE.POLL_CREATION&&!a.pollInvalidated}).map(function(a){return{id:a.id,pollInvalidated:!0}}))});return function(a){return c.apply(this,arguments)}}())}g.invalidateChatPolls=a}),98); __d("WAWebPollsInvalidateChatPollMsgsAction",["WALogger","WAWebDBPollsInvalidateChatPolls","WAWebFrontendMsgGetters","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[POLLS] Failed to invalidate polls with error: ",""]);h=function(){return a};return a}function a(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){try{yield d("WAWebDBPollsInvalidateChatPolls").invalidateChatPolls(a.id),a.msgs.filter(function(a){return d("WAWebFrontendMsgGetters").getAsPollCreation(a)&&!a.pollInvalidated}).forEach(function(a){a.pollInvalidated=!0})}catch(a){d("WALogger").ERROR(h(),a).devConsole(a)}});return i.apply(this,arguments)}g.invalidateChatPollMsgs=a}),98); __d("WAWebPollsPollVoteCollection",["WANullthrows","WAWebApiContact","WAWebBaseCollection","WAWebLidMigrationUtils","WAWebMaybe","WAWebPollsPollVoteModel","WAWebUserPrefsMeUser","WAWebWidFactory"],(function(a,b,c,d,e,f,g){var h=function(b){babelHelpers.inheritsLoose(a,b);function a(){return b.apply(this,arguments)||this}var c=a.prototype;c.getVoteFromSenderAddressingModeInsensitive=function(a){var b=d("WAWebApiContact").getAlternateUserWid(d("WAWebWidFactory").toUserWid(a));return this.findFirst(function(c){return c.sender.equals(a)||c.sender.equals(b)})};c.getUnreadCount=function(){return this.filter(function(a){return a.selectedOptionLocalIds.length>0&&!a.read&&!d("WAWebUserPrefsMeUser").isMeAccount(a.sender)}).length};c.getVoteCount=function(){return this.filter(function(a){return a.selectedOptionLocalIds.length>0}).length};return a}(d("WAWebBaseCollection").BaseCollection);h.model=d("WAWebPollsPollVoteModel").PollVote;b=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.$PollVoteCollectionImpl$p_1=new Map(),b)||babelHelpers.assertThisInitialized(c)}var c=b.prototype;c.add=function(b,c){b=a.prototype.add.call(this,b,c);c=j(b.filter(Boolean));for(c of c){var d=c[0],e=c[1];d=this.getForParentAddressingModeInsensitive([d]);d=d[0];d.add(e)}return b};c.remove=function(b,c){b=a.prototype.remove.call(this,b,c);c=j(b.filter(Boolean));for(c of c){var d=c[0],e=c[1];this.getForParentAddressingModeInsensitive([d])[0].remove(e)}return b};c.reset=function(){a.prototype.reset.call(this);for(var b of this.$PollVoteCollectionImpl$p_1.values())b.reset();this.$PollVoteCollectionImpl$p_1.clear()};c.getForParentAddressingModeInsensitive=function(a){var b=this;return a.map(function(a){return b.$PollVoteCollectionImpl$p_2(a)})};c.$PollVoteCollectionImpl$p_2=function(a){var b,c=this;b=(b=this.$PollVoteCollectionImpl$p_1.get(a.toString()))!=null?b:d("WAWebMaybe").ifSome(d("WAWebLidMigrationUtils").getAlternateMsgKey(a),function(a){return c.$PollVoteCollectionImpl$p_1.get(a.toString())});b==null&&(b=new h(),b.add(this.filter(function(b){return b.parentMsgKey.equals(a)})),this.$PollVoteCollectionImpl$p_1.set(a.toString(),b));return b};c.getByMsgKey=function(a){return this.get(i(a))};return b}(d("WAWebBaseCollection").BaseCollection);b.model=d("WAWebPollsPollVoteModel").PollVote;function i(a){return"!!"+a.toString()}function a(a){return new(d("WAWebPollsPollVoteModel").PollVote)(babelHelpers["extends"]({id:i(a.msgKey)},a))}e=new b();function j(a){var b=new Map();if(!a)return b;a.forEach(function(a){var d=a.parentMsgKey;b.has(d)||b.set(d,[]);c("WANullthrows")(b.get(d)).push(a)});return b}g.GroupedPollVoteCollection=h;g.createPollVoteModel=a;g.PollVoteCollection=e}),98); __d("WAWebPollVoteGetters",["WAWebGetters","WAWebGettersCaches"],(function(a,b,c,d,e,f,g){a=d("WAWebGetters").createGetterFactories({createCache:d("WAWebGettersCaches").createPollVotesCache});b=a.field;c=a.computed;e=a.unsafeIdentityGetter;f=a.clearCacheFor;d=f;a=e;f=b("parentMsgKey");e=b("sender");var h=b("ack"),i=b("t"),j=b("senderTimestampMs");b=b("selectedOptionLocalIds");b=c(function(a){a=a[0];return a.length===0},[b]);c=c(function(a){var b=a[0];a=a[1];return b==null||b===0?a:b*1e3},[i,j]);g.clearPollVoteGetterCacheFor=d;g.getPollVoteUnsafe=a;g.getParentMsgKey=f;g.getSender=e;g.getAck=h;g.getIsUnvote=b;g.getTimestamp=c}),98); __d("WAWebPollsPollVoteModel",["WAWebAddOnModel","WAWebBaseModel","WAWebFrontendPollVoteGetters","WAWebPollVoteGetters"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.msgKey=d("WAWebBaseModel").prop(),c.parentMsgKey=d("WAWebBaseModel").prop(),c.selectedOptionLocalIds=d("WAWebBaseModel").prop(),c.senderTimestampMs=d("WAWebBaseModel").prop(),c.t=d("WAWebBaseModel").prop(),c.sender=d("WAWebBaseModel").prop(),c.read=d("WAWebBaseModel").prop(),b)||babelHelpers.assertThisInitialized(c)}var c=b.prototype;c["delete"]=function(){a.prototype["delete"].call(this),d("WAWebPollVoteGetters").clearPollVoteGetterCacheFor(this),d("WAWebFrontendPollVoteGetters").clearFrontendPollVoteGetterCacheFor(this)};c.getData=function(){return{msgKey:this.msgKey,parentMsgKey:this.parentMsgKey,selectedOptionLocalIds:this.selectedOptionLocalIds,senderTimestampMs:this.senderTimestampMs,t:this.t,sender:this.sender,ack:this.ack,read:this.read}};return b}(d("WAWebAddOnModel").AddOnBaseModel);a.Proxy="poll_vote";b=d("WAWebBaseModel").defineModel(a);g.PollVote=b}),98); __d("WAWebPollsVoteNotification",["fbt","WAWebBaseNotification","WAWebEnvironment","WAWebFrontendChatGetters","WAWebFrontendMsgGetters","WAWebGetNotificationStrings","WAWebMuteCollection","WAWebMuteGetters","WAWebNotificationController","WAWebNotificationHelpers","WAWebNotificationIconUtils","WAWebNotificationMuteReason","WAWebPollsPollVoteCollection","asyncToGeneratorRuntime","gkx"],(function(a,b,c,d,e,f,g,h){a=function(a){babelHelpers.inheritsLoose(e,a);function e(b){var c;b=b.creationMsg;c=a.call(this)||this;c.$PollVoteNotification$p_3=function(){c.$PollVoteNotification$p_2.getUnreadCount()===0&&c.closeBanner()};c.$PollVoteNotification$p_1=b;c.$PollVoteNotification$p_2=d("WAWebPollsPollVoteCollection").PollVoteCollection.getForParentAddressingModeInsensitive([b.id])[0];c.bodyText=i({unreadCount:c.$PollVoteNotification$p_2.getUnreadCount(),pollName:c.$PollVoteNotification$p_1.pollName});return c}var f=e.prototype;f.shouldPlaySound=function(){var b=d("WAWebFrontendMsgGetters").getChat(this.$PollVoteNotification$p_1.unsafe());return a.prototype.shouldPlaySound.call(this)&&!d("WAWebNotificationHelpers").shouldSquelch(b,!1)};f.shouldMute=function(a){if(d("WAWebMuteGetters").getIsMuted(d("WAWebMuteCollection").MuteCollection.globalMute()))return c("WAWebNotificationMuteReason").GlobalMute;if(d("WAWebNotificationHelpers").shouldMuteDueToAppState(a))return c("WAWebNotificationMuteReason").AppState;if(d("WAWebNotificationHelpers").isMutedAndNotMentioned(this.$PollVoteNotification$p_1.unsafe()))return c("WAWebNotificationMuteReason").MutedChat;if(d("WAWebNotificationHelpers").isArchivedAndNotMentioned(this.$PollVoteNotification$p_1.unsafe()))return c("WAWebNotificationMuteReason").ArchivedChat;if(!c("gkx")("26258")&&d("WAWebNotificationHelpers").shouldIgnoreGroupMsg(this.$PollVoteNotification$p_1.unsafe()))return c("WAWebNotificationMuteReason").IgnoreGroupMsg;return d("WAWebNotificationHelpers").isOfflineResumeInProgress()&&!c("WAWebEnvironment").isWindows?c("WAWebNotificationMuteReason").OfflineResumeInProgress:null};f.shouldSquelch=function(){if(d("WAWebNotificationController").WANotificationController.notificationExists(this.buildKey()))return null;var a=d("WAWebFrontendMsgGetters").getChat(this.$PollVoteNotification$p_1.unsafe());return d("WAWebNotificationHelpers").shouldSquelch(a,!1)?c("WAWebNotificationMuteReason").GroupFlood:null};f.afterBannerShown=function(a){var b=this;this.$PollVoteNotification$p_2.on("change add remove reset",this.$PollVoteNotification$p_3);a.waitForClose().then(function(){b.$PollVoteNotification$p_2.off("change add remove reset",b.$PollVoteNotification$p_3)})};f.buildKey=function(){return"vote:"+this.$PollVoteNotification$p_1.id.toString()};f.matchesChat=function(a){return d("WAWebFrontendMsgGetters").getChat(this.$PollVoteNotification$p_1.unsafe()).equals(a)};f.getChatKind=function(){return d("WAWebFrontendChatGetters").getKind(d("WAWebFrontendMsgGetters").getChat(this.$PollVoteNotification$p_1.unsafe()))};f.getIcon=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=d("WAWebFrontendMsgGetters").getChat(this.$PollVoteNotification$p_1.unsafe());return d("WAWebNotificationIconUtils").getChatNotificationIcon(a,this.abortController.signal)});function c(){return a.apply(this,arguments)}return c}();f.getBannerOptions=function(){var a=this.$PollVoteNotification$p_1,b=d("WAWebFrontendMsgGetters").getChat(a.unsafe());return{wid:b.id,msgId:a.id.toString(),tag:this.buildKey(),title:d("WAWebNotificationHelpers").getNotificationTitle(b),body:d("WAWebGetNotificationStrings").getNotificationBody(babelHelpers["extends"]({},this.$PollVoteNotification$p_4(),{msgDir:d("WAWebFrontendMsgGetters").getDir(a)}))}};f.$PollVoteNotification$p_4=function(){return{body:this.bodyText}};return e}(d("WAWebBaseNotification").WABaseNotification);function i(a){var b=a.unreadCount;a=a.pollName;return h._(/*BTDS*/"__JHASH__1i4EGFAFtrA__JHASH__",[h._plural(b,"number_of_votes"),h._param("pollName",a)]).toString()}g.PollVoteNotification=a}),226); __d("WAWebBootstrapPremiumMessages",["Promise","WAWebMiscGatingUtils","WAWebMsgCollection","WAWebPremiumMessageCollection","WAWebPremiumMessageSchema","asyncToGeneratorRuntime","lodash"],(function(a,b,c,d,e,f,g){var h,i=250;function a(){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(!d("WAWebMiscGatingUtils").isRambutanEnabled())return(h||(h=b("Promise"))).resolve();var a=(yield d("WAWebPremiumMessageSchema").getPremiumMessageTable().all());d("WAWebPremiumMessageCollection").PremiumMessageCollection.initializeFromCache(a)});return j.apply(this,arguments)}function e(){if(!d("WAWebMiscGatingUtils").isRambutanEnabled())return;d("WAWebMsgCollection").MsgCollection.listenTo(d("WAWebMsgCollection").MsgCollection,"add",c("lodash").debounce(k,i,{leading:!0,trailing:!0}));d("WAWebPremiumMessageCollection").PremiumMessageCollection.listenTo(d("WAWebPremiumMessageCollection").PremiumMessageCollection,"add",function(a){return a.hydrateMessages()})}function k(){d("WAWebPremiumMessageCollection").PremiumMessageCollection.getModelsArray().forEach(function(a){a.hydrateMessages()})}g.restorePremiumMessages=a;g.bindPremiumMessageListeners=e}),98); __d("WAWebPremiumMessageBroadcastSync",["WALogger","WASyncdAction","WASyncdConst","WAWebPremiumMessageAddSendAction","WAWebPremiumMessageCollection","WAWebSyncdIndexUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["premium_message_broadcast:syncd: operation not supported"]);h=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=null,b)||babelHelpers.assertThisInitialized(c)}var f=e.prototype;f.getVersion=function(){return 7};f.getAction=function(){return d("WASyncdConst").Actions.MarketingMessageBroadcast};f.applyMutations=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=[];a=a.map(function(a){try{var c=a.indexParts,e=c[1];c=c[2];(!e||!c)&&d("WAWebSyncdIndexUtils").throwInvalidActionIndex();if(a.operation==="set"){if(d("WAWebPremiumMessageCollection").PremiumMessageCollection.find(e)==null)return{actionState:d("WASyncdConst").SyncActionState.Orphan};b.push({messageId:c,premiumMessageId:e});return{actionState:d("WASyncdConst").SyncActionState.Success}}d("WALogger").DEV(h());return{actionState:d("WASyncdConst").SyncActionState.Unsupported}}catch(a){return{actionState:d("WASyncdConst").SyncActionState.Failed}}});yield c("WAWebPremiumMessageAddSendAction")(b);return a});function e(b){return a.apply(this,arguments)}return e}();return e}(d("WASyncdAction").SyncActionBase);e=new a();g["default"]=e}),98); __d("WAWebPremiumMessageSync",["WALogger","WASyncdAction","WASyncdConst","WAWebPremiumMessageCollection","WAWebPremiumMessageSchema","WAWebSyncdIndexUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["premium_message:syncd: operation not supported"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["premium_message:syncd: malformed mutation - missing type"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["premium_message:syncd: malformed mutation"]);j=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(c,a);function c(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=null,b)||babelHelpers.assertThisInitialized(c)}var e=c.prototype;e.getVersion=function(){return 7};e.getAction=function(){return d("WASyncdConst").Actions.MarketingMessage};e.applyMutations=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=[];a=a.map(function(a){try{var c=a.indexParts;c=c[1];c||d("WAWebSyncdIndexUtils").throwInvalidActionIndex();if(a.operation==="set"){a=a.value.marketingMessageAction;if(!a){d("WALogger").DEV(j());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}var e=a.name,f=a.type,g=a.message,k=a.isDeleted;a=a.mediaId;if(f==null){d("WALogger").DEV(i());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}b.push({id:c,name:e,type:f,isDeleted:k,message:g,mediaId:a,sentMessageIds:new Set()});return{actionState:d("WASyncdConst").SyncActionState.Success}}d("WALogger").DEV(h());return{actionState:d("WASyncdConst").SyncActionState.Unsupported}}catch(a){return{actionState:d("WASyncdConst").SyncActionState.Failed}}});yield d("WAWebPremiumMessageSchema").getPremiumMessageTable().bulkCreateOrMerge(b);d("WAWebPremiumMessageCollection").PremiumMessageCollection.add(b);return a});function c(b){return a.apply(this,arguments)}return c}();return c}(d("WASyncdAction").SyncActionBase);c=new a();g["default"]=c}),98); __d("WAWebPremiumMessageAddSendAction",["WAWebPremiumMessageCollection","WAWebPremiumMessageSchema","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=[];for(a of a){var c=d("WAWebPremiumMessageCollection").PremiumMessageCollection.get(a.premiumMessageId);if(c){var e=new Set(c.sentMessageIds);e.add(a.messageId);b.push(c);c.set("sentMessageIds",e)}}yield d("WAWebPremiumMessageSchema").getPremiumMessageTable().bulkCreateOrMerge(b.map(function(a){return{id:a.id,name:a.name,type:a.type,isDeleted:a.isDeleted,mediaId:a.mediaId,sentMessageIds:a.sentMessageIds}}))});return h.apply(this,arguments)}g["default"]=a}),98); __d("WAWebPremiumMessageHydrateMessageAction",["WASyncAction.pb","WAWebContactCollection","WAWebContactGetters","WAWebMsgType"],(function(a,b,c,d,e,f,g){function a(a,b){var c=d("WAWebContactCollection").ContactCollection.get(a.id.remote);if(c==null)return;switch(b.type){case d("WASyncAction.pb").SyncActionValue$MarketingMessageAction$MarketingMessagePrototypeType.PERSONALIZED:b=h(b,c);a.mediaData==null?a.set("body",b):a.set("caption",b);break;default:a.type=d("WAWebMsgType").MSG_TYPE.UNKNOWN;break}}function h(a,b){a=i(a,b);return a}function i(a,b){b=d("WAWebContactGetters").getPremiumMessageName(b);return b===""?a.message.replaceAll(/ ?<<customer_name>>/g,""):a.message.replace(/<<customer_name>>/g,b)}g.hydratePremiumMessage=a}),98); __d("WAWebPremiumMessageCollection",["WAWebBaseCollection","WAWebPremiumMessageModel"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}return b}(d("WAWebBaseCollection").BaseCollection);a.model=d("WAWebPremiumMessageModel").PremiumMessage;b=new a();g.PremiumMessageCollection=b}),98); __d("WAWebPremiumMessageModel",["WAWebBaseModel","WAWebMsgCollection","WAWebPremiumMessageHydrateMessageAction"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.name=d("WAWebBaseModel").prop(),c.type=d("WAWebBaseModel").prop(),c.message=d("WAWebBaseModel").prop(),c.isDeleted=d("WAWebBaseModel").prop(),c.sentMessageIds=d("WAWebBaseModel").prop(),c.mediaId=d("WAWebBaseModel").prop(),b)||babelHelpers.assertThisInitialized(c)}var c=b.prototype;c.initialize=function(){a.prototype.initialize.call(this),this.listenTo(this,"change:message change:sentMessageIds change:type",this.hydrateMessages)};c.hydrateMessages=function(){var a=this;d("WAWebMsgCollection").MsgCollection.getModelsArray().filter(function(b){return b.smbClientCampaignId===a.id}).forEach(function(b){d("WAWebPremiumMessageHydrateMessageAction").hydratePremiumMessage(b,a)})};return b}(d("WAWebBaseModel").BaseModel);a.Proxy="premium_message";b=d("WAWebBaseModel").defineModel(a);g.PremiumMessage=b}),98); __d("WAWebGetUserDisclosuresContentsJob",["WAJobOrchestratorTypes","WAWebGetUserDisclosuresContentsQueryJob","WAWebOrchestratorNonPersistedJob"],(function(a,b,c,d,e,f,g){function a(a){return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("getDisclosuresContentsJob",function(){return d("WAWebGetUserDisclosuresContentsQueryJob").getUserDisclosureContentsQueryJob(a)},{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()}g.getDisclosuresContentsJob=a}),98); __d("WAWebWamEnumUserNoticeErrorEvent",[],(function(a,b,c,d,e,f){a=Object.freeze({INVALID_STANZA:1,JSON_FETCH:2,JSON_PARSE:3,IMAGE_FETCH:4,NO_ELIGIBLE_DISCLOSURE:5,DISCLOSURE_STAGE_FETCH:6,UI_TEMPLATE_MISMATCHED:7,ERROR_UNKNOWN:8,SYNC_STAGE_MISMATCH:9,IMAGE_FETCH_400:10,JSON_FETCH_400:11,JSON_FETCH_REDIRECT:12,IMAGE_FETCH_REDIRECT:13,IMAGE_FETCH_FORBIDDEN:14,JSON_FETCH_FORBIDDEN:15});f.USER_NOTICE_ERROR_EVENT=a}),66); __d("WAWebUserNoticeErrorWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumNoticeType","WAWebWamEnumUserNoticeErrorEvent"],(function(a,b,c,d,e,f,g){a=d("WAWebWamCodegenUtils").defineEvents({UserNoticeError:[2474,{noticeType:[4,d("WAWebWamEnumNoticeType").NOTICE_TYPE],userNoticeContentVersion:[2,d("WAWebWamCodegenUtils").TYPES.INTEGER],userNoticeErrorEvent:[3,d("WAWebWamEnumUserNoticeErrorEvent").USER_NOTICE_ERROR_EVENT],userNoticeId:[1,d("WAWebWamCodegenUtils").TYPES.INTEGER]},[1,1,1],"regular"]},{UserNoticeError:[]});g.UserNoticeErrorWamEvent=a}),98); __d("isNonZeroNumber",[],(function(a,b,c,d,e,f){"use strict";function a(a){return a!=null&&a!==0&&!isNaN(a)}f.isNonZeroNumber=a}),66); __d("WAWebGetUserDisclosuresContentsQueryJob",["Promise","WAAbortError","WACcToIso","WALogger","WANullthrows","WAPhoneFindCC","WAWebConnModel","WAWebHttpErrors","WAWebPonyfillsFetch","WAWebURLUtils","WAWebUserNoticeErrorWamEvent","WAWebUserPrefsInfoStore","WAWebUserPrefsMeUser","WAWebWamEnumUserNoticeErrorEvent","asyncToGeneratorRuntime","err","isNonZeroNumber"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Notice: Icon fetch error : ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Notice:fetchNoticeData successful for policyVersion ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["Notice: Error Message : ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["Notice: Unknown action type ",""]);l=function(){return a};return a}var m="https://www.whatsapp.com/user-notice/v1/",n=new Set(["ACCEPT","OK"]),o="zz",p="ZZ";function a(a){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(d("isNonZeroNumber").isNonZeroNumber(a)){var e,f=d("WAWebUserPrefsMeUser").getMeUser();f=d("WAPhoneFindCC").findCC(f.user);f=r(f);var g=(yield d("WAWebUserPrefsInfoStore").deviceInfo.get());g=c("WAWebURLUtils").build(m,{id:a,lg:(e=g.lg)!=null?e:o,lc:(e=g.lc)!=null?e:p,cc:f,platform:d("WAWebConnModel").Conn.isSMB?"smbweb":"web"});return s(g,a)}return(h||(h=b("Promise"))).resolve({disclosureId:a})});return q.apply(this,arguments)}function r(a){a=parseInt(a,10);a=c("WACcToIso")[a];return c("WANullthrows")(a)}function s(a,b){return t.apply(this,arguments)}function t(){t=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){try{a=(yield w(a));try{if(a!=null){a=JSON.parse(a);if(a!=null)return y(a,b)}}catch(c){a=new(d("WAWebUserNoticeErrorWamEvent").UserNoticeErrorWamEvent)({userNoticeId:b,userNoticeContentVersion:1,userNoticeErrorEvent:d("WAWebWamEnumUserNoticeErrorEvent").USER_NOTICE_ERROR_EVENT.JSON_PARSE});a.commit()}}catch(a){if(a.name===d("WAAbortError").ABORT_ERROR)return;d("WALogger").ERROR(k(),a.message).sendLogs("pdfn-notice-content-error");throw new(d("WAWebHttpErrors").HttpNetworkError)()}});return t.apply(this,arguments)}function u(a){return v.apply(this,arguments)}function v(){v=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){return new(h||(h=b("Promise")))(function(b,c){var d=new FileReader();d.onload=function(){var a=String(d.result);b(a)};d.onerror=c;d.readAsDataURL(a)})});return v.apply(this,arguments)}function w(a){return x.apply(this,arguments)}function x(){x=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=new AbortController();b=b.signal;a=(yield c("WAWebPonyfillsFetch")(a,{signal:b}));b=a.headers.get("Content-Type");if(b==null)return a.text();if(b.includes("image/svg+xml"))return a.text();return b.includes("image/png")?u(yield a.blob()):a.text()});return x.apply(this,arguments)}function y(a,b){return z.apply(this,arguments)}function z(){z=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){var f=a.policyVersion;if(f==null)throw c("err")("Missing field policyVersion in notice content.");d("WALogger").LOG(j(),f);var g=B(a);a=A(a);f=parseInt(f,10);var k;try{k=(yield G(g))}catch(a){var l=new(d("WAWebUserNoticeErrorWamEvent").UserNoticeErrorWamEvent)({userNoticeId:e,userNoticeContentVersion:f,userNoticeErrorEvent:d("WAWebWamEnumUserNoticeErrorEvent").USER_NOTICE_ERROR_EVENT.IMAGE_FETCH});l.commit();d("WALogger").ERROR(i(),a.message).sendLogs("notice-icon-fetch-error")}return(h||(h=b("Promise"))).resolve({disclosureId:e,policyVersion:f,privacyDisclosureModal:(l=k)!=null?l:g,endDate:a})});return z.apply(this,arguments)}function A(a){a=a["privacy-disclosure"]&&((a=a["privacy-disclosure"])==null?void 0:(a=a.timing)==null?void 0:(a=a.end)==null?void 0:a.time);return a==null?null:new Date(a)}function B(a){a=a["privacy-disclosure"]&&C(a["privacy-disclosure"].prompts[0]);return a==null?null:F(a)}function C(a){if(!a)return;D(["icon","iconDescription","title","bullets","primaryButton","nav"],a);D(["light","dark","type"],a.icon);D(["dismissButton","backButton"],a.nav);for(var b=0;b<a.bullets.length;b++)D(["icon","text"],a.bullets[b]);b=a.footer!=null?{footer:a.footer}:{};return babelHelpers["extends"]({icon:{light:a.icon.light,dark:a.icon.dark,type:a.icon.type},iconSvg:{light:"",dark:""},iconDescription:a.iconDescription,title:a.title,bullets:a.bullets,primaryButton:a.primaryButton,nav:{dismissButton:a.nav.dismissButton,backButton:a.nav.backButton}},b)}function D(a,b){a.forEach(function(a){if(!(a in b))throw c("err")("Missing field "+a+" in notice content.")})}var E=function(a){if(!a)return null;var b=a.action;if(b){if(n.has(b))return a;d("WALogger").WARN(l(),b)}return null};function F(a){if(!a)return null;a.primaryButton=E(a.primaryButton);return a}function G(a){return H.apply(this,arguments)}function H(){H=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=[a==null?void 0:a.icon.light,a==null?void 0:a.icon.dark];for(var d=0;d<((e=a==null?void 0:a.bullets.length)!=null?e:0);d++){var e;e=a==null?void 0:a.bullets[d];e!=null&&(c.push(e.icon.light),c.push(e.icon.dark))}e=c.map(function(a){return a!=null?w(a):(h||(h=b("Promise"))).resolve(null)});d=a;c=(yield (h||(h=b("Promise"))).all(e));e=c[0];var f=c[1];c=c.slice(2);var g=[];for(var i=0;i<((j=a==null?void 0:a.bullets.length)!=null?j:0);i++){var j;j=a==null?void 0:a.bullets[i];if(j!=null){var k=c[i*2],l=c[i*2+1];k!=null&&l!=null?g.push(babelHelpers["extends"]({},j,{iconSvg:{light:k,dark:l}})):g.push(j)}}a&&e!=null&&f!=null&&(d=babelHelpers["extends"]({},a,{bullets:g,iconSvg:{light:e,dark:f}}));return d});return H.apply(this,arguments)}g.getUserDisclosureContentsQueryJob=a;g.attemptFetch=w}),98); __d("WAWebGetUserDisclosuresContentsAction",["WAWebGetUserDisclosuresContentsJob","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebGetUserDisclosuresContentsJob").getDisclosuresContentsJob(a));return a});return h.apply(this,arguments)}g.getDisclosuresContentAction=a}),98); __d("WAWebFrontendConstants",[],(function(a,b,c,d,e,f){a=100;b=1024;c=264;f.SCROLL_FUDGE=a;f.LAYOUT_2COLUMNS_MAX_WIDTH=b;f.QR_EDGE=c}),66); __d("WAWebBizCatalogUtils",["Promise","WATypeUtils","WAWebCatalogCollection","WAWebFrontendConstants","WAWebNonEmptyString","WAWebQplQuickPerformanceLoggerMarkerIds","WAWebQplQuickPerformanceLoggerModule","WAWebUserPrefsMeUser","asyncToGeneratorRuntime","isStringNullOrEmpty"],(function(a,b,c,d,e,f,g){var h,i=3;function j(a,b){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=a.getData().length||0;c=!a.getCanLoadMore()||!n(c,a.listItemHeight);var e=d("WAWebUserPrefsMeUser").getMeUser();b&&d("WAWebQplQuickPerformanceLoggerModule").QPL.markerAnnotate(b,{bool:{IsCached:c,IsConsumer:!e.equals(a.catalog.id)}});if(c)return!0;yield a.loadMore(!0);b=a.getData().length||0;return n(b,a.listItemHeight)?a.loadInitialItems():!0});return k.apply(this,arguments)}e=function(){function a(a,b,d,e){this.loading=null;this.catalog=a;this.collectionId=b;this.forCatalogManager=d;this.listItemHeight=e;if(!c("isStringNullOrEmpty")(b)){this.canLoadMoreCollectionItems=a.collections.length>0?((d=this.catalog.collections.get(b))==null?void 0:d.afterCursor)!=="":!0}else this.canLoadMoreAllItems=a.productCollection.length>0?!!this.catalog.afterCursor:!0}var e=a.prototype;e.loadMore=function(a){var e=this;if(this.loading)return this.loading;if(!this.getCanLoadMore())return(h||(h=b("Promise"))).resolve();var f=this.collectionId;if(!c("isStringNullOrEmpty")(f)){a=a===!0?d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.WHATSAPP_COLLECTION_VIEW_ALL:void 0;this.loading=this.catalog.collections.findCollectionProducts(this.catalog.id,f,!1,a).then(function(){var a;e.canLoadMoreCollectionItems=!!((a=e.catalog.collections.get(f))==null?void 0:a.afterCursor);e.loading=null})}else this.loading=d("WAWebCatalogCollection").CatalogCollection.update(this.catalog.id).then(function(){e.canLoadMoreAllItems=!!e.catalog.afterCursor,e.loading=null});return this.loading};e.loadInitialItems=function(){var a=d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.WHATSAPP_COLLECTION_VIEW_ALL;return j(this,a)};e.getCanLoadMore=function(){return this.canLoadMoreCollectionItems||this.canLoadMoreAllItems};e.getData=function(){var a=this.collectionId;if(!c("isStringNullOrEmpty")(a)){a=((a=this.catalog.collections.get(a))==null?void 0:a.productCollection.getProductModels(this.forCatalogManager))||[]}else a=this.catalog.productCollection.getProductModels(this.forCatalogManager)||[];return a.map(function(a){return{product:a,collection:void 0}})};return a}();f=function(){function a(a,b,c,d){this.loading=null,this.catalog=a,this.forCatalogManager=b,this.listItemHeight=c,this.canLoadMoreCollections=a.collections.length>0?!!this.catalog.collections.afterCursor:!0,this.canLoadMoreCatalog=a.productCollection.length>0?!!this.catalog.afterCursor:!0,this.canLogQpl=d}var c=a.prototype;c.loadMore=function(a){var c=this;if(this.loading)return this.loading;if(!this.getCanLoadMore())return(h||(h=b("Promise"))).resolve();if(this.canLoadMoreCollections){a=this.canLogQpl&&a===!0?d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.WHATSAPP_CATALOG_COLLECTIONS_VIEW:void 0;this.loading=this.catalog.collections.findCollectionsList(this.catalog.id,i,this.forCatalogManager,a).then(function(){c.canLoadMoreCollections=!!c.catalog.collections.afterCursor,c.loading=null})}else this.loading=d("WAWebCatalogCollection").CatalogCollection.update(this.catalog.id).then(function(){c.canLoadMoreCatalog=!!c.catalog.afterCursor,c.loading=null});return this.loading};c.loadInitialItems=function(){var a=this.canLogQpl?d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.WHATSAPP_CATALOG_COLLECTIONS_VIEW:void 0;return j(this,a)};c.getCanLoadMore=function(){return this.canLoadMoreCollections||this.canLoadMoreCatalog};c.getData=function(){var a=this,b=this.catalog.collections.getCollectionModels(this.forCatalogManager);b=b.reduce(function(b,c){b===void 0&&(b=[]);var d=c.productCollection.getProductModels(a.forCatalogManager)||[];if(d.length!==0){var e;b.push({collection:c,product:void 0});d.length>i&&(d.length=i);(e=b).push.apply(e,d.map(function(a){return{product:a,collection:c}}))}return b},[]);var c=b.length>0;if(this.canLoadMoreCollections)return b;c&&b.push({allItems:{totalItemsCount:b.length}});c=this.catalog.productCollection.getProductModels(this.forCatalogManager).map(function(a){return{product:a,collection:void 0}});b.push.apply(b,c);return b};return a}();var l=function(){function a(a,b,c,d){this.loading=null,this.canLoadMoreCollections=!0,this.catalog=a,this.forCatalogManager=b,this.listItemHeight=c,this.canLogQpl=d}var c=a.prototype;c.loadMore=function(a){var c=this;if(this.loading)return this.loading;if(!this.getCanLoadMore())return(h||(h=b("Promise"))).resolve();if(this.canLoadMoreCollections){a=this.canLogQpl&&a===!0?d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.WHATSAPP_COLLECTIONS_MANAGEMENT_VIEW:void 0;this.loading=this.catalog.collections.findCollectionsList(this.catalog.id,i,this.forCatalogManager,a).then(function(){c.canLoadMoreCollections=!!c.catalog.collections.afterCursor,c.loading=null})}return this.loading||(h||(h=b("Promise"))).resolve()};c.loadInitialItems=function(){var a=this.canLogQpl?d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.WHATSAPP_COLLECTIONS_MANAGEMENT_VIEW:void 0;return j(this,a)};c.getCanLoadMore=function(){return this.canLoadMoreCollections};c.resetData=function(){var a;((a=this.catalog)==null?void 0:a.collections)&&(this.catalog.collections.reset(),this.catalog.collections.afterCursor="");this.canLoadMoreCollections=!0};c.getData=function(){return this.catalog.collections.getCollectionModels(this.forCatalogManager).map(function(a){return{collection:a,product:void 0}})};return a}(),m=function(){function a(a,b,c){this.loading=null,this.canLoadMore=!0,this.catalog=a,this.catalog.stale=!0,this.catalog.markProductCollectionOld(),this.catalog.productCollection.reset(),this.listItemHeight=b,this.collectionId=d("WAWebNonEmptyString").asMaybeNonEmptyString(c)}var e=a.prototype;e.loadMore=function(){var a=this;if(this.loading)return this.loading;if(!this.getCanLoadMore())return(h||(h=b("Promise"))).resolve();this.canLoadMore&&(c("isStringNullOrEmpty")(this.collectionId)?this.loading=d("WAWebCatalogCollection").CatalogCollection.update(this.catalog.id).then(function(){a.canLoadMore=!!a.catalog.afterCursor,a.loading=null}):this.loading=d("WAWebCatalogCollection").CatalogCollection.findCollectionMembership(this.catalog.id,this.collectionId).then(function(){a.canLoadMore=!!a.catalog.afterCursor,a.loading=null}));return this.loading||(h||(h=b("Promise"))).resolve()};e.loadInitialItems=function(){return j(this)};e.getCanLoadMore=function(){return this.canLoadMore};e.getData=function(){return this.catalog.productCollection.getProductModels(!0).map(function(a){return{product:a,collection:void 0}})};return a}();function n(a,b){return a*b<window.innerHeight}var o=function(){function a(a){this.dataSource=a}var c=a.prototype;c.isScrollAtBottom=function(a){return a.scrollTop+d("WAWebFrontendConstants").SCROLL_FUDGE>=a.scrollHeight-a.clientHeight};c.willLoadMore=function(a){return Boolean(this.dataSource.loading||this.isScrollAtBottom(a))};c.onScroll=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if(this.dataSource.loading){yield this.dataSource.loading;return!0}if(this.isScrollAtBottom(b)){yield this.dataSource.loadMore();return!0}return!1});function c(b,c){return a.apply(this,arguments)}return c}();return a}();function a(a,b,e){a=d("WAWebCatalogCollection").CatalogCollection.get(a);var f,g;if(!a)return void 0;if(!c("isStringNullOrEmpty")(b)&&e){var h=a.productCollection.get(e.id);f=h&&a.productCollection.indexOf(h);return{productId:e.id.toString(),productIndex:d("WATypeUtils").isNumber(f)&&f>-1?f.toString():void 0}}if(!c("isStringNullOrEmpty")(b)){h=a.collections.get(b);g=h&&a.collections.indexOf(h);a=e&&(h==null?void 0:h.productCollection.get(e.id));f=a&&(h==null?void 0:h.productCollection.indexOf(a))}return{collectionId:b||"",productId:e==null?void 0:e.id.toString(),collectionIndex:d("WATypeUtils").isNumber(g)&&g>-1?g.toString():void 0,productIndex:d("WATypeUtils").isNumber(f)&&f>-1?f.toString():void 0}}g.SingleCollectionDataSource=e;g.CatalogWithCollectionsDataSource=f;g.CollectionsDataSource=l;g.CollectionsContentDataSource=m;g.CatalogListItemScrollHelper=o;g.getProductStatsInFetched=a}),98); __d("WAWebChangeProfilePicThumb",["Promise","WAWebApiContact","WAWebBackendApi","WAWebContactProfilePicThumbBridge","WAWebProfilePicConstants","WAWebWidFactory","WAWebWorkerSafeBackendApi","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function a(a,b){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){var e=[j(a,c)];if(a.isLid()){var f=d("WAWebApiContact").getPhoneNumber(d("WAWebWidFactory").toUserWid(a));f!=null&&e.push(j(f,c))}if(!a.isLid()&&a.isUser()){f=d("WAWebApiContact").getCurrentLid(d("WAWebWidFactory").toUserWid(a));f!=null&&e.push(j(f,c))}yield (h||(h=b("Promise"))).all(e)});return i.apply(this,arguments)}function j(a,b){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if(b===d("WAWebProfilePicConstants").ProfilePicCommand.Remove)yield d("WAWebContactProfilePicThumbBridge").persistProfilePicToDB(a),d("WAWebBackendApi").frontendFireAndForget("removeProfilePicThumb",{wid:a});else return d("WAWebWorkerSafeBackendApi").workerSafeSendAndReceive("setProfilePicThumb",{wid:a})});return k.apply(this,arguments)}g.changeProfilePicThumb=a}),98); __d("WAWebHandleProfilePicNotification",["Promise","WADeprecatedWapParser","WALogger","WAWap","WAWebBackendJobsCommon","WAWebChangeProfilePicThumb","WAWebCommsWapMd","WAWebGroupSystemMsg","WAWebHandleSingleMsg","WAWebJidToWid","WAWebLidAwareContactsDB","WAWebOrchestratorNonPersistedJob","WAWebProfilePicConstants","WAWebUserPrefsMeUser","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Invalid type received"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["set_avatar picture notification is not implemented"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["could not find side contact hash for profile pic update operation"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["Parsing Error: ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["error while parsing: ",""]);m=function(){return a};return a}var n=new(c("WADeprecatedWapParser"))("incomingProfilePicNotificationParser",function(a){a.assertTag("notification");var b,c;if(a.hasChild("delete"))b="delete",c=a.child("delete");else if(a.hasChild("set"))b="set",c=a.child("set");else if(a.hasChild("request"))b="request",c=a.child("request"),c.assertAttr("jid",d("WAWebUserPrefsMeUser").assertGetMe().toJid());else if(a.hasChild("set_avatar"))b="set_avatar",c=a.child("set_avatar");else return a["throw"]("Unexpected profile picture notification type");var e=a.attrString("id");return c.hasAttr("jid")?{type:b,from:d("WAWebJidToWid").chatJidToChatWid(a.attrChatJid("from")),jid:d("WAWebJidToWid").chatJidToChatWid(c.attrChatJid("jid")),author:c.hasAttr("author")?d("WAWebJidToWid").userJidToUserWid(c.attrUserJid("author")):null,ts:a.attrTime("t"),rawTs:a.attrString("t"),stanzaId:e,picId:b==="set"?c.attrInt("id",1):0}:{from:d("WAWebJidToWid").userJidToUserWid(a.attrUserJid("from")),jid:null,type:b,hash:c.attrString("hash"),ts:a.attrTime("t"),stanzaId:e}});function o(a){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=n.parse(a);if(e.error){d("WALogger").DEV(m(),a.toString());d("WALogger").ERROR(l(),e.error.toString());return(h||(h=b("Promise"))).reject(e.error)}var f=e.success;a=(h||(h=b("Promise"))).resolve();if(f.jid||f.hash){var g;if(f.jid)g=f.jid;else{e=(yield c("WAWebLidAwareContactsDB").equals(["contactHash"],f.hash));e.length===0?d("WALogger").WARN(k()):g=d("WAWebWidFactory").createWid(e[0].id)}switch(f.type){case"delete":case"set":var o=f.type==="delete"?d("WAWebProfilePicConstants").ProfilePicCommand.Remove:d("WAWebProfilePicConstants").ProfilePicCommand.Set;g&&(a=d("WAWebChangeProfilePicThumb").changeProfilePicThumb(g,o).then(function(){if(!g.isGroup())return;if(f.ts!=null){var a=d("WAWebGroupSystemMsg").genGroupPicChangeNotificationMsg(g,o,f.ts,f.author||d("WAWebUserPrefsMeUser").getMeUser());return d("WAWebHandleSingleMsg").handleSingleMsg(g,a,"profilePicNotification")}}));break;case"request":break;case"set_avatar":d("WALogger").WARN(j());break;default:d("WALogger").WARN(i()).devConsole(f.type)}}return a.then(function(){return d("WAWap").wap("ack",{id:d("WAWap").CUSTOM_STRING(f.stanzaId),to:d("WAWebCommsWapMd").JID(f.from),"class":"notification",type:"picture"})})});return p.apply(this,arguments)}function a(a){var b=d("WAWebBackendJobsCommon").getNonCriticalNotificationPriority(Boolean(a.attrs.offline));return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("handleProfilePicNotification",function(a){return o(a.node)},{priority:b}).waitUntilCompleted({node:a})}g.handleProfilePicNotificationJob=a}),98); __d("WAWebProfilePicThumbCollection",["Promise","WAFilteredCatch","WALogger","WATimeUtils","WAWebBackendErrors","WAWebBaseCachePolicy","WAWebBaseCollection","WAWebChatCollection","WAWebChatGetters","WAWebContactCollection","WAWebContactProfilePicThumbBridge","WAWebGroupType","WAWebNewsletterCollection","WAWebProfilePicPrivacyTokenGating","WAWebProfilePicThumbModel","WAWebSocketConstants","WAWebSocketModel","WAWebUnjoinedSubgroupMetadataCollection","WAWebUserPrefsKeys","WAWebVcardParsingUtils","WAWebWid","asyncToGeneratorRuntime","cr:17219"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["ProfilePicThumbStore:resyncPictures dropped: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["ProfilePicThumbStore:resyncPictures dropped: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["ProfilePicThumbStore:resyncPictures blocked ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["ProfilePicThumbStore:resyncPictures success"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["ProfilePicThumbStore:resyncMyProfilePicture failed: ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["ProfilePicThumbStore:resyncPictures success"]);n=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var e,f;f=a.call(this)||this;f.findImpl=function(a){var e,f,g=a.isNewsletter()?c("WAWebNewsletterCollection"):d("WAWebChatCollection").ChatCollection;g=g.get(a);e=(g==null?void 0:(e=g.groupMetadata)==null?void 0:e.groupType)===d("WAWebGroupType").GroupType.COMMUNITY;var i=c("WAWebUnjoinedSubgroupMetadataCollection").get(a.toString());if((g==null?void 0:g.isReadOnly)&&!e&&!(g!=null&&d("WAWebChatGetters").getIsNewsletter(g))&&i==null||(g==null?void 0:(f=g.groupMetadata)==null?void 0:f.terminated)||(g==null?void 0:(f=g.newsletterMetadata)==null?void 0:f.terminated)||(g==null?void 0:(f=g.newsletterMetadata)==null?void 0:f.isPreview))return(h||(h=b("Promise"))).resolve({id:a,stale:!0});else if((c("WAWebWid").isUser(a)||c("WAWebWid").isGroup(a)||c("WAWebWid").isNewsletter(a))&&!c("WAWebWid").isPSA(a)){e=e?a:g==null?void 0:(f=g.groupMetadata)==null?void 0:f.parentGroup;i!=null&&(e=i.parentGroupId);if(d("WAWebSocketModel").Socket.stream!==d("WAWebSocketConstants").SOCKET_STREAM.DISCONNECTED){if(d("WAWebProfilePicPrivacyTokenGating").isProfilePicIQPrivacyTokenEnabled()&&c("WAWebWid").isUser(a)){g=d("WAWebContactCollection").ContactCollection.get(a);f=d("WAWebChatCollection").ChatCollection.get(a);return d("WAWebContactProfilePicThumbBridge").requestProfilePicFromServer(a,e,f==null?void 0:f.tcToken,(f==null?void 0:f.tcToken)==null?g==null?void 0:(i=g.maybeCommonGroupChatModel)==null?void 0:i.id:null)}return d("WAWebContactProfilePicThumbBridge").requestProfilePicFromServer(a,e)}return(h||(h=b("Promise"))).resolve({id:a,stale:!0})}return(h||(h=b("Promise"))).resolve({id:a,tag:null})};f._getUpdatedProfilePicModel=function(a){return{tag:a.tag,raw:void 0,stale:!1,eurl:a.eurl,eurlStale:!1,previewEurl:a.previewEurl,previewDirectPath:a.previewDirectPath,fullDirectPath:a.fullDirectPath,filehash:a.filehash,timestamp:Date.now()}};var g=(e=b("cr:17219"))==null?void 0:e.getWindowsBridge();g&&f.listenTo(babelHelpers.assertThisInitialized(f),"add remove change:timestamp",function(a,b,c){(b=g.pictures)==null?void 0:b.notifyUpdate(a)});return f}var f=e.prototype;f.get=function(b){var c=a.prototype.get.call(this,b);this.isProfilePicRefreshNeeded(c==null?void 0:c.timestamp,c==null?void 0:c.eurlStale)&&(c==null?void 0:c.markStale({eurl:!0}));return!this.modelClass.prototype.isIdType(b)?c:c};f.resyncPicturesByWid=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=this;try{a=(yield d("WAWebContactProfilePicThumbBridge").profilePicResync(a.map(function(a){return{id:a}})));d("WALogger").LOG(n());a.forEach(function(a){var c=b._getUpdatedProfilePicModel(a),d=b.get(a.id);d?d.set(c):b.add(babelHelpers["extends"]({id:a.id},c))})}catch(a){d("WALogger").WARN(m(),a)}});function c(b){return a.apply(this,arguments)}return c}();f.resyncPictures=function(a){var c=this;return a.length===0?(h||(h=b("Promise"))).resolve():d("WAWebContactProfilePicThumbBridge").profilePicResync(a.map(function(a){return{id:a.id,tag:a.tag}})).then(function(b){d("WALogger").LOG(l()),b.forEach(function(a){var b=c.get(a.id);b&&b.set(c._getUpdatedProfilePicModel(a))}),a.forEach(function(a){a.eurlStale&&c.update(a.id),a.stale=!1})})["catch"](d("WAFilteredCatch").filteredCatch(d("WAWebBackendErrors").ServerStatusCodeError,function(a){a.status===423||a.status===429?d("WALogger").WARN(k(),a.status):a.status>=400&&d("WALogger").WARN(j(),String(a))}))["catch"](function(a){d("WALogger").WARN(i(),String(a))})};f.findThumbnailWid=function(a){var b=this;return a.find(function(a){return(a=b.get(a))==null?void 0:a.img})};f.getThumbnailWidFromVcard=function(a){if(!a)return null;a=d("WAWebVcardParsingUtils").vcardWids(a);if(!a)return;var b=this.findThumbnailWid(a);return b?b:a.length?a[0]:null};f.isProfilePicRefreshNeeded=function(a,b){b===void 0&&(b=!1);if(a==null||b)return!0;b=Date.now()-a;return b>d("WATimeUtils").WEEK_MILLISECONDS};return e}(d("WAWebBaseCollection").BaseCollection);a.model=d("WAWebProfilePicThumbModel").ProfilePicThumb;a.staleCollection=!0;a.cachePolicy={id:d("WAWebUserPrefsKeys").COLLECTIONS_KEYS.PROFILE_PIC_THUMB_COLLECTION,trigger:"change:tag",policy:d("WAWebBaseCachePolicy").CACHE_POLICY.NONE,delay:5e3};e=new a();g.ProfilePicThumbCollection=e}),98); __d("WAWebProfilePicThumbModel",["WALogger","WAWebBaseModel","WAWebChatCollection","WAWebMediaHosts","WAWebMediaHostsRouteSelection","WAWebMmsClientSelectHost","WAWebMmsMediaTypes","WAWebProfilePicConstants","WAWebProfilePicThumbCollection","WAWebUserPrefsMeUser","WAWebWid","isStringNullOrEmpty"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Using mms4 download url for profile-pic with host name ","."]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Failed to resolve mms4 hostname for profile-pic, falling back to static host. Error : ","."]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["increased mms4 retry count: ",""]);j=function(){return a};return a}var k={SINGLE:"SINGLE",GROUP:"GROUP"};a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,e;for(var f=arguments.length,g=new Array(f),h=0;h<f;h++)g[h]=arguments[h];return(b=e=a.call.apply(a,[this].concat(g))||this,e.id=d("WAWebBaseModel").prop(),e.tag=d("WAWebBaseModel").prop(),e.raw=d("WAWebBaseModel").prop(),e.eurl=d("WAWebBaseModel").prop(),e.previewEurl=d("WAWebBaseModel").prop(),e.fullDirectPath=d("WAWebBaseModel").prop(),e.previewDirectPath=d("WAWebBaseModel").prop(),e.filehash=d("WAWebBaseModel").prop(),e.stale=d("WAWebBaseModel").session(!0),e.eurlStale=d("WAWebBaseModel").session(!1),e.pendingPic=d("WAWebBaseModel").session(),e.timestamp=d("WAWebBaseModel").session(),e.hostRetryCount=d("WAWebBaseModel").session(0),e.lastHostUsed=d("WAWebBaseModel").session(),e.img=d("WAWebBaseModel").derived(function(){if(this.raw)return"data:image/jpeg;base64,"+this.raw;if(!this.tag&&this.stale)return null;return!this.tag?void 0:this.previewDirectPath!=null?this.$ProfilePicThumbImpl$p_1(this.previewDirectPath,this.filehash):this.previewEurl},["tag","raw","stale","eurl","eurlStale","previewEurl","previewDirectPath","hostRetryCount"]),e.imgFull=d("WAWebBaseModel").derived(function(){if((this.raw||!this.tag)&&this.stale)return null;if(this.raw)return void 0;return!this.tag?void 0:this.fullDirectPath!=null?this.$ProfilePicThumbImpl$p_1(this.fullDirectPath,this.filehash):this.eurl},["tag","raw","stale","eurl","eurlStale","fullDirectPath","hostRetryCount"]),e.fallbackType=d("WAWebBaseModel").derived(function(){if(c("WAWebWid").isUser(this.id))return k.SINGLE;else if(c("WAWebWid").isGroup(this.id))return k.GROUP;return k.GROUP},["id"]),b)||babelHelpers.assertThisInitialized(e)}var e=b.prototype;e.markStale=function(a){this.stale=!0,(a==null?void 0:a.eurl)===!0&&(this.eurlStale=!0)};e.markMms4HostSuccess=function(){this.hostRetryCount=0};e.markMms4HostFailure=function(){this.hostRetryCount++,d("WALogger").DEV(j(),this.hostRetryCount).tags("mms4")};e.validate=function(){if(!this.stale&&!this.eurlStale)return;return this.getCollection().update(this.id)};e.canSet=function(){if(c("WAWebWid").isGroup(this.id)){var a=d("WAWebChatCollection").ChatCollection.get(this.id);a=a==null?void 0:(a=a.groupMetadata)==null?void 0:a.participants.iAmRestrictedMember();return!a}return d("WAWebUserPrefsMeUser").isMeAccount(this.id)?!0:!1};e.canDelete=function(){var a=!c("isStringNullOrEmpty")(this.tag);if(c("WAWebWid").isGroup(this.id)&&a){var b=d("WAWebChatCollection").ChatCollection.get(this.id);b=b==null?void 0:(b=b.groupMetadata)==null?void 0:b.participants.iAmRestrictedMember();return!b}return d("WAWebUserPrefsMeUser").isMeAccount(this.id)&&a?!0:!1};e.getCollection=function(){return d("WAWebProfilePicThumbCollection").ProfilePicThumbCollection};e.$ProfilePicThumbImpl$p_1=function(a,b){var c=d("WAWebProfilePicConstants").DEFAULT_HOSTNAME;try{c=this.$ProfilePicThumbImpl$p_2(a,b).hostname}catch(a){d("WALogger").WARN(i(),a).tags("mms4")}d("WALogger").DEV(h(),c).tags("mms4");return"https://"+c+a};e.$ProfilePicThumbImpl$p_2=function(a,b){a=d("WAWebMediaHosts").mediaHosts.getCachedHostsInfo({directPath:a,encFilehash:b,operation:d("WAWebMediaHostsRouteSelection").OPERATIONS.DOWNLOAD,type:d("WAWebMmsMediaTypes").MEDIA_TYPES.PPIC});b=a.selectedHost;a=a.fallbackHost;b=c("WAWebMmsClientSelectHost")({selectedHost:b,fallbackHost:a,attemptCount:this.hostRetryCount,lastHostUsed:this.lastHostUsed,lastFetchMadeProgress:this.hostRetryCount===0});this.lastHostUsed=b;return b};return b}(d("WAWebBaseModel").BaseModel);a.Proxy="profilePicThumb";a.idClass=c("WAWebWid");b=d("WAWebBaseModel").defineModel(a);g.ProfilePicThumbImpl=a;g.ProfilePicThumb=b}),98); __d("WAWebCommonCTWAQplHelpers",["WAWebGraphQLServerError","WAWebQplQuickPerformanceLoggerModule"],(function(a,b,c,d,e,f,g){function a(a){var b=a.error,c=a.markerId,e=a.errorAnnotationName;a=a.errorMessageAnnotationName;if(b instanceof d("WAWebGraphQLServerError").GraphQLServerError){var f,g;d("WAWebQplQuickPerformanceLoggerModule").QPL.markerAnnotate(c,{string:(g={},g[e]=(f=b.name)!=null?f:"UNKNOWN",g[a]=b.source.errors.map(function(a){return"["+a.code+"] "+((a=a.message)!=null?a:"")}).join("|"),g)})}else if(b instanceof Error){d("WAWebQplQuickPerformanceLoggerModule").QPL.markerAnnotate(c,{string:(f={},f[e]=(g=b.name)!=null?g:"UNKNOWN",f[a]=(g=b.message)!=null?g:"",f)})}else{d("WAWebQplQuickPerformanceLoggerModule").QPL.markerAnnotate(c,{string:(g={},g[e]=String(b),g[a]="",g)})}}g.qplAnnotateGraphQLError=a}),98); __d("WAWebFetchQuickPromotionsQuery_facebookRelayOperation",[],(function(a,b,c,d,e,f){e.exports="23863939843202957"}),null); __d("WAWebFetchQuickPromotionsQuery.graphql",["WAWebFetchQuickPromotionsQuery_facebookRelayOperation"],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"nux_ids"},{defaultValue:null,kind:"LocalArgument",name:"trigger_context"}],c=[{kind:"Literal",name:"include_holdouts",value:!0},{kind:"Literal",name:"supports_client_side_filters",value:!0},{kind:"Variable",name:"surface_nux_ids",variableName:"nux_ids"},{kind:"Variable",name:"trigger_context",variableName:"trigger_context"}],d={alias:null,args:null,kind:"ScalarField",name:"surface_nux_id",storageKey:null},e={alias:null,args:null,kind:"ScalarField",name:"client_ttl_seconds",storageKey:null},f={alias:null,args:null,kind:"ScalarField",name:"priority",storageKey:null},g={alias:null,args:null,kind:"ScalarField",name:"is_holdout",storageKey:null},h={alias:null,args:null,kind:"ScalarField",name:"log_eligibility_waterfall",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"start",storageKey:null},j={alias:null,args:null,kind:"ScalarField",name:"end",storageKey:null},k={alias:null,args:null,kind:"ScalarField",name:"promotion_id",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"is_server_force_pass",storageKey:null},m={alias:null,args:null,kind:"ScalarField",name:"ab_prop_name",storageKey:null},n={alias:null,args:null,kind:"ScalarField",name:"surface_delay_in_seconds",storageKey:null},o={alias:null,args:null,kind:"ScalarField",name:"encrypted_logging_data",storageKey:null},p={alias:null,args:null,kind:"ScalarField",name:"client_side_dry_run",storageKey:null},q=[{alias:null,args:null,kind:"ScalarField",name:"text",storageKey:null}],r=[{kind:"InlineDataFragmentSpread",name:"WAWebFetchQuickPromotionsQuery_QPText",selections:q,args:null,argumentDefinitions:[]}],s={alias:null,args:null,concreteType:"TextWithEntities",kind:"LinkedField",name:"title",plural:!1,selections:r,storageKey:null},t={alias:null,args:null,kind:"ScalarField",name:"url",storageKey:null},u=[{alias:null,args:null,kind:"ScalarField",name:"jpeg_thumbnail",storageKey:null}],v={alias:null,args:null,concreteType:"WAQPMediaDetails",kind:"LinkedField",name:"wa_light_mode_media_details",plural:!1,selections:u,storageKey:null};u={alias:null,args:null,concreteType:"WAQPMediaDetails",kind:"LinkedField",name:"wa_dark_mode_media_details",plural:!1,selections:u,storageKey:null};var w={alias:null,args:null,kind:"ScalarField",name:"accessibility_text_for_image",storageKey:null},x={alias:null,args:null,kind:"ScalarField",name:"is_dismissible",storageKey:null},y={alias:null,args:null,concreteType:"QPContentAttributeDescriptor",kind:"LinkedField",name:"content_attributes",plural:!1,selections:[{alias:null,args:null,concreteType:"WhatsappQPColors",kind:"LinkedField",name:"wa_banner_background_color",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"light_mode_highlight_color",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"dark_mode_highlight_color",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"light_mode_background_color",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"dark_mode_background_color",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"wa_primary_cta_alternative_url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"wa_eligible_duration_after_impression_in_seconds",storageKey:null}],storageKey:null},z={alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null},A={alias:null,args:null,concreteType:"WAQPContentAttribute",kind:"LinkedField",name:"wa_qp_content_attributes_do_not_use",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},z],storageKey:null},B={alias:null,args:null,kind:"ScalarField",name:"clause_type",storageKey:null};z=[{alias:null,args:null,kind:"ScalarField",name:"filter_name",storageKey:null},{alias:null,args:null,concreteType:"QPFilterParameter",kind:"LinkedField",name:"parameters",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"key",storageKey:null},z],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"passes_if_client_not_supported",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"filter_result",storageKey:null}];var C={kind:"InlineDataFragmentSpread",name:"WAWebFetchQuickPromotionsQuery_QPWAFilterClause",selections:[B,{alias:null,args:null,concreteType:"QuickPromotionFlattenedFilter",kind:"LinkedField",name:"filters",plural:!0,selections:[{kind:"InlineDataFragmentSpread",name:"WAWebFetchQuickPromotionsQuery_QPWAFilter",selections:z,args:null,argumentDefinitions:[]}],storageKey:null}],args:null,argumentDefinitions:[]},D={alias:null,args:null,concreteType:"QPUserInteractionInfo",kind:"LinkedField",name:"user_interaction_info",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"impression_max_instances",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"impression_count_for_user",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"dismiss_max_instances",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"dismiss_click_count_for_user",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"primary_click_max_instances",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"primary_click_count_for_user",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"secondary_click_count_for_user",storageKey:null}],storageKey:null},E={alias:null,args:null,concreteType:"TextWithEntities",kind:"LinkedField",name:"title",plural:!1,selections:q,storageKey:null},F={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null};z={alias:null,args:null,concreteType:"QuickPromotionFlattenedFilter",kind:"LinkedField",name:"filters",plural:!0,selections:z,storageKey:null};return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"WAWebFetchQuickPromotionsQuery",selections:[{alias:null,args:c,concreteType:"QuickPromotionBatchFetchSurface",kind:"LinkedField",name:"quick_promotion_batch_fetch_root",plural:!0,selections:[d,{alias:null,args:null,concreteType:"QuickPromotionSurfaceEligiblePromotionsConnection",kind:"LinkedField",name:"eligible_promotions",plural:!1,selections:[{alias:null,args:null,concreteType:"QuickPromotionSurfaceEligiblePromotionsEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{kind:"RequiredField",field:e,action:"LOG",path:"quick_promotion_batch_fetch_root.eligible_promotions.edges.client_ttl_seconds"},{kind:"RequiredField",field:f,action:"LOG",path:"quick_promotion_batch_fetch_root.eligible_promotions.edges.priority"},{kind:"RequiredField",field:g,action:"LOG",path:"quick_promotion_batch_fetch_root.eligible_promotions.edges.is_holdout"},{kind:"RequiredField",field:h,action:"LOG",path:"quick_promotion_batch_fetch_root.eligible_promotions.edges.log_eligibility_waterfall"},{kind:"RequiredField",field:{alias:null,args:null,concreteType:"TimeRange",kind:"LinkedField",name:"time_range",plural:!1,selections:[{kind:"RequiredField",field:i,action:"LOG",path:"quick_promotion_batch_fetch_root.eligible_promotions.edges.time_range.start"},{kind:"RequiredField",field:j,action:"LOG",path:"quick_promotion_batch_fetch_root.eligible_promotions.edges.time_range.end"}],storageKey:null},action:"LOG",path:"quick_promotion_batch_fetch_root.eligible_promotions.edges.time_range"},{alias:null,args:null,concreteType:"QuickPromotion",kind:"LinkedField",name:"node",plural:!1,selections:[{kind:"InlineDataFragmentSpread",name:"WAWebFetchQuickPromotionsQuery_QuickPromotion",selections:[k,l,m,n,o,p,{alias:null,args:null,concreteType:"QuickPromotionCreative",kind:"LinkedField",name:"creatives",plural:!0,selections:[{kind:"InlineDataFragmentSpread",name:"WAWebFetchQuickPromotionsQuery_QPCreative",selections:[s,{alias:null,args:null,concreteType:"TextWithEntities",kind:"LinkedField",name:"content",plural:!1,selections:r,storageKey:null},{alias:null,args:null,concreteType:"QuickPromotionAction",kind:"LinkedField",name:"primary_action",plural:!1,selections:[{kind:"InlineDataFragmentSpread",name:"WAWebFetchQuickPromotionsQuery_QPAction",selections:[s,t],args:null,argumentDefinitions:[]}],storageKey:null},v,u,w,x],args:null,argumentDefinitions:[]}],storageKey:null},y,A,{alias:null,args:null,concreteType:"QuickPromotionFlattenedFilterClause",kind:"LinkedField",name:"contextual_filters_for_wa_do_not_use",plural:!1,selections:[C,{alias:null,args:null,concreteType:"QuickPromotionFlattenedFilterClause",kind:"LinkedField",name:"clauses",plural:!0,selections:[C,{alias:null,args:null,concreteType:"QuickPromotionFlattenedFilterClause",kind:"LinkedField",name:"clauses",plural:!0,selections:[C,{alias:null,args:null,concreteType:"QuickPromotionFlattenedFilterClause",kind:"LinkedField",name:"clauses",plural:!0,selections:[C],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null},D],args:null,argumentDefinitions:[]}],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"WAWebFetchQuickPromotionsQuery",selections:[{alias:null,args:c,concreteType:"QuickPromotionBatchFetchSurface",kind:"LinkedField",name:"quick_promotion_batch_fetch_root",plural:!0,selections:[d,{alias:null,args:null,concreteType:"QuickPromotionSurfaceEligiblePromotionsConnection",kind:"LinkedField",name:"eligible_promotions",plural:!1,selections:[{alias:null,args:null,concreteType:"QuickPromotionSurfaceEligiblePromotionsEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[e,f,g,h,{alias:null,args:null,concreteType:"TimeRange",kind:"LinkedField",name:"time_range",plural:!1,selections:[i,j],storageKey:null},{alias:null,args:null,concreteType:"QuickPromotion",kind:"LinkedField",name:"node",plural:!1,selections:[k,l,m,n,o,p,{alias:null,args:null,concreteType:"QuickPromotionCreative",kind:"LinkedField",name:"creatives",plural:!0,selections:[E,{alias:null,args:null,concreteType:"TextWithEntities",kind:"LinkedField",name:"content",plural:!1,selections:q,storageKey:null},{alias:null,args:null,concreteType:"QuickPromotionAction",kind:"LinkedField",name:"primary_action",plural:!1,selections:[E,t],storageKey:null},v,u,w,x,F],storageKey:null},y,A,{alias:null,args:null,concreteType:"QuickPromotionFlattenedFilterClause",kind:"LinkedField",name:"contextual_filters_for_wa_do_not_use",plural:!1,selections:[B,z,{alias:null,args:null,concreteType:"QuickPromotionFlattenedFilterClause",kind:"LinkedField",name:"clauses",plural:!0,selections:[B,z,{alias:null,args:null,concreteType:"QuickPromotionFlattenedFilterClause",kind:"LinkedField",name:"clauses",plural:!0,selections:[B,z,{alias:null,args:null,concreteType:"QuickPromotionFlattenedFilterClause",kind:"LinkedField",name:"clauses",plural:!0,selections:[B,z],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null},D,F],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}]},params:{id:b("WAWebFetchQuickPromotionsQuery_facebookRelayOperation"),metadata:{},name:"WAWebFetchQuickPromotionsQuery",operationKind:"query",text:null}}}();e.exports=a}),null); __d("WAWebFetchQuickPromotionsQuery_QPAction.graphql",[],(function(a,b,c,d,e,f){"use strict";a={kind:"InlineDataFragment",name:"WAWebFetchQuickPromotionsQuery_QPAction"};e.exports=a}),null); __d("WAWebFetchQuickPromotionsQuery_QPCreative.graphql",[],(function(a,b,c,d,e,f){"use strict";a={kind:"InlineDataFragment",name:"WAWebFetchQuickPromotionsQuery_QPCreative"};e.exports=a}),null); __d("WAWebFetchQuickPromotionsQuery_QPText.graphql",[],(function(a,b,c,d,e,f){"use strict";a={kind:"InlineDataFragment",name:"WAWebFetchQuickPromotionsQuery_QPText"};e.exports=a}),null); __d("WAWebFetchQuickPromotionsQuery_QPWAFilter.graphql",[],(function(a,b,c,d,e,f){"use strict";a={kind:"InlineDataFragment",name:"WAWebFetchQuickPromotionsQuery_QPWAFilter"};e.exports=a}),null); __d("WAWebFetchQuickPromotionsQuery_QPWAFilterClause.graphql",[],(function(a,b,c,d,e,f){"use strict";a={kind:"InlineDataFragment",name:"WAWebFetchQuickPromotionsQuery_QPWAFilterClause"};e.exports=a}),null); __d("WAWebFetchQuickPromotionsQuery_QuickPromotion.graphql",[],(function(a,b,c,d,e,f){"use strict";a={kind:"InlineDataFragment",name:"WAWebFetchQuickPromotionsQuery_QuickPromotion"};e.exports=a}),null); __d("WAWebFetchQuickPromotions",["Promise","WABase64","WACustomError","WALogger","WAPromiseRetryLoop","WAPromiseTimeout","WAQplTypes","WAWebBackendApi","WAWebBizGatingUtils","WAWebBuildConstants","WAWebCTWAConstants","WAWebCommonCTWAQplHelpers","WAWebFetchAdAccountToken","WAWebFetchQuickPromotionsQuery.graphql","WAWebFetchQuickPromotionsQuery_QPAction.graphql","WAWebFetchQuickPromotionsQuery_QPCreative.graphql","WAWebFetchQuickPromotionsQuery_QPText.graphql","WAWebFetchQuickPromotionsQuery_QPWAFilter.graphql","WAWebFetchQuickPromotionsQuery_QPWAFilterClause.graphql","WAWebFetchQuickPromotionsQuery_QuickPromotion.graphql","WAWebJobUpdateQPSurfaces","WAWebL10NCountryCodes","WAWebNetworkStatus","WAWebOrchestratorNonPersistedJob","WAWebProtobufsQuickPromotionSurfaces.pb","WAWebQplQuickPerformanceLoggerMarkerIds","WAWebQplQuickPerformanceLoggerModule","WAWebRelayClient","WAWebUserPrefsMeUser","WAWebWebp","err"],(function(a,b,c,d,e,f,g){var h,i,j,k,l,m,n,o;function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["fetchQuickPromotions: failed to decode base64 for dark mode media details"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["fetchQuickPromotions: failed to decode base64 for light mode media details"]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["fetchQuickPromotions: received unexpected nux ID ",""]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["fetchQuickPromotions: could not find "," in reverse mapping"]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(['fetchQuickPromotions: failed as "timeout"']);t=function(){return a};return a}function u(){var a=babelHelpers.taggedTemplateLiteralLoose(['fetchQuickPromotions: failed as "','"']);u=function(){return a};return a}function v(){var a=babelHelpers.taggedTemplateLiteralLoose(["fetchQuickPromotions: failed while saving to the DB: ",""]);v=function(){return a};return a}function w(){var a=babelHelpers.taggedTemplateLiteralLoose(["fetchQuickPromotions: success"]);w=function(){return a};return a}var x={type:"error"},y=1,z=1e3,A=3e3,B=h!==void 0?h:h=b("WAWebFetchQuickPromotionsQuery.graphql"),C=i!==void 0?i:i=b("WAWebFetchQuickPromotionsQuery_QuickPromotion.graphql"),D=j!==void 0?j:j=b("WAWebFetchQuickPromotionsQuery_QPCreative.graphql"),E=k!==void 0?k:k=b("WAWebFetchQuickPromotionsQuery_QPAction.graphql"),F=l!==void 0?l:l=b("WAWebFetchQuickPromotionsQuery_QPText.graphql"),G=m!==void 0?m:m=b("WAWebFetchQuickPromotionsQuery_QPWAFilterClause.graphql"),H=n!==void 0?n:n=b("WAWebFetchQuickPromotionsQuery_QPWAFilter.graphql");function I(a){d("WAWebCommonCTWAQplHelpers").qplAnnotateGraphQLError({error:a,markerId:d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.FETCH_QUICK_PROMOTIONS,errorAnnotationName:"fetch_promotions_error",errorMessageAnnotationName:"fetch_promotions_error_message"})}function a(){return!d("WAWebBizGatingUtils").qpGraphQLEnabled()?(o||(o=b("Promise"))).resolve({type:"not-enabled"}):d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("fetchQuickPromotions",function(){return d("WAWebBackendApi").frontendSendAndReceive("getUserLocale").then(function(a){return J(a)})}).waitUntilCompleted()}function J(a){return c("WAWebNetworkStatus").waitIfOffline().then(function(){return d("WAPromiseTimeout").promiseTimeout(K(a),S()).then(function(b){if(b.type==="success"){d("WALogger").LOG(w());return d("WAWebJobUpdateQPSurfaces").updateQPSurfacesFromGraphQLFetch(b.quickPromotions,a).then(function(){d("WAWebQplQuickPerformanceLoggerModule").QPL.markerEnd(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.FETCH_QUICK_PROMOTIONS,d("WAQplTypes").QuickLogActionType.SUCCESS);return b})["catch"](function(a){d("WALogger").ERROR(v(),String(a)).devConsole(a);I(a);d("WAWebQplQuickPerformanceLoggerModule").QPL.markerEnd(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.FETCH_QUICK_PROMOTIONS,d("WAQplTypes").QuickLogActionType.FAIL);return{type:"error"}})}b.type;d("WALogger").WARN(u(),b.type);return b})["catch"](function(a){if(a instanceof d("WACustomError").TimeoutError){d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.FETCH_QUICK_PROMOTIONS,"fetch_promotions_end");d("WAWebQplQuickPerformanceLoggerModule").QPL.markerEnd(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.FETCH_QUICK_PROMOTIONS,d("WAQplTypes").QuickLogActionType.ABORTED);d("WALogger").WARN(t());return{type:"timeout"}}throw a})})}function K(a){d("WAWebQplQuickPerformanceLoggerModule").QPL.markerStart(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.FETCH_QUICK_PROMOTIONS);d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.FETCH_QUICK_PROMOTIONS,"fetch_promotions_start");return d("WAWebFetchAdAccountToken").fetchToken().then(function(b){if(b.type==="success")return L(b.token,a).then(function(a){if(a.type==="success"){d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.FETCH_QUICK_PROMOTIONS,"fetch_promotions_end");return a}d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.FETCH_QUICK_PROMOTIONS,"fetch_promotions_end");d("WAWebQplQuickPerformanceLoggerModule").QPL.markerEnd(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.FETCH_QUICK_PROMOTIONS,d("WAQplTypes").QuickLogActionType.FAIL);a.type==="auth-failure"?d("WAWebFetchAdAccountToken").markTokenAsInvalid():a.type;return a});b.type;return b})}function L(a,b){var c=y,e=function(d){return M(a,b).then(function(a){if(a.type==="success")d(a);else{var b=c>0;c--;b||d(a)}})["catch"](function(a){var b=c>0;c--;if(!b)throw a})};e=new(d("WAPromiseRetryLoop").PromiseRetryLoop)({name:"fetchQuickPromotions",timer:{algo:{type:"exponential",first:z},max:A},code:e});e.start();return e.promise()}function M(a,c){var e,f=Array.from(d("WAWebBizGatingUtils").qpSurfaceIdsUsingGraphQL());if(f.length===0)return(o||(o=b("Promise"))).resolve({type:"not-enabled"});e=(e=d("WAWebUserPrefsMeUser").getMaybeMeUser())==null?void 0:e.user;if(e==null)return(o||(o=b("Promise"))).resolve({type:"error"});e=d("WAWebL10NCountryCodes").getCountryShortcodeByPhone(e);var g;return d("WAWebRelayClient").fetchQuery(B,{nux_ids:f,trigger_context:{wa_smb_trigger_context:{is_from_wa_smb:!0,app_version:d("WAWebBuildConstants").VERSION_BASE,country:e,locale:c}}},{environmentType:"facebook",accessToken:a,getInlineDataReader:function(a){g=a}}).then(function(a){if(a==null)return x;a=a.quick_promotion_batch_fetch_root;var b=new Map();f.forEach(function(a){var c=R(a);if(c==null){d("WALogger").ERROR(s(),a).sendLogs("quick-promotions-graphql-missing-surface");return}b.set(a,{id:c,promotions:[]})});a.forEach(function(a){var c=a.surface_nux_id;a=a.eligible_promotions;if(c==null||a==null)return;var e=b.get(c);if(e==null){d("WALogger").ERROR(r(),c);return}c=a.edges;c.forEach(function(a){if(a==null)return;var b=a.node,c=a.priority,f=a.time_range,h=a.is_holdout,i=a.log_eligibility_waterfall;a=a.client_ttl_seconds;if(b==null)return;b=g(C,b);var j=b.promotion_id,k=b.creatives,l=b.is_server_force_pass,m=b.content_attributes,n=b.ab_prop_name,o=b.wa_qp_content_attributes_do_not_use,r=b.contextual_filters_for_wa_do_not_use,s=b.surface_delay_in_seconds,t=b.user_interaction_info,u=b.encrypted_logging_data;b=b.client_side_dry_run;if(j==null||l==null||m==null||s==null)return;var v=m.wa_eligible_duration_after_impression_in_seconds,w=m.wa_banner_background_color;m=m.wa_primary_cta_alternative_url;if(v==null)return;k=k.map(function(a){return g(D,a)});k=k[0];var x,y,z,A,B;if(k!=null){var G=k.primary_action,H=k.title,I=k.content,J=k.wa_dark_mode_media_details,K=k.wa_light_mode_media_details,L=k.accessibility_text_for_image;if(H==null||I==null)return;y=g(F,H).text;z=g(F,I).text;if(G!=null){H=g(E,G);I=H.title;G=H.url;if(I!=null){H=g(F,I);H.text!=null&&(x={text:H==null?void 0:H.text,deepLink:G,universalLink:m})}}A=k.is_dismissible;if(L!=null){var M;try{(K==null?void 0:K.jpeg_thumbnail)!=null&&(M={elementValue:new Uint8Array(d("WABase64").decodeB64(K.jpeg_thumbnail))})}catch(a){d("WALogger").ERROR(q())}var N;try{(J==null?void 0:J.jpeg_thumbnail)!=null&&(N={elementValue:new Uint8Array(d("WABase64").decodeB64(J.jpeg_thumbnail))})}catch(a){d("WALogger").ERROR(p())}B={description:L,light:M,dark:N}}}if(y==null||z==null||A==null)return;I=w!=null?{lightHighlight:w.light_mode_highlight_color,lightBackground:w.light_mode_background_color,darkHighlight:w.dark_mode_highlight_color,darkBackground:w.dark_mode_background_color}:void 0;H=o.reduce(function(a,b){var c=b.name;b=b.value;if(c==null||b==null)return a;a.push({key:c,value:b});return a},[]);var O;if(t!=null){G=t.dismiss_click_count_for_user;m=t.impression_count_for_user;k=t.primary_click_count_for_user;K=t.secondary_click_count_for_user;J=t.dismiss_max_instances;L=t.impression_max_instances;w=t.primary_click_max_instances;if(m==null||k==null||K==null||G==null||L==null||w==null||J==null)return;O={promotionConfig:{maxImpressions:L,maxDismisses:J,maxPrimaryClicks:w,maxSecondaryClicks:0},userInfo:{impressionCount:m,primaryClickCount:k,secondaryClickCount:K,dismissClickCount:G}}}o=r!=null?P(r,g):void 0;t=u!=null?{elementValue:d("WAWebWebp").stringToUint8(u)}:void 0;L={id:j,qpConfigPriority:c,qpConfigDismissable:A?"true":"false",qpConfigEligibilityDurationMs:v*1e3,qpConfigEndTimeSeconds:f.end,qpConfigExperimentKey:n,qpConfigExposureHoldout:h?"true":"false",qpConfigForcePass:l?"true":"false",qpConfigLogEligibilityWaterfall:i?"true":"false",qpConfigStartTimeSeconds:f.start,qpConfigSurfaceDelayTimeSeconds:s,qpConfigTtlSeconds:a,qpConfigClientSideDryRun:b===!0?"true":"false",titleElementValue:y,textElementValue:z,colors:I,contentAttributes:{attribute:H},image:B,primaryAction:x,qpConfigPacing:O,qpConfigFilterRules:o,header:void 0,instanceId:void 0,qpConfigDeterministic:"true",qpConfigImpressionCooldown:-1,qpConfigInstanceLogData:t,qpConfigMaxImpressions:-1,qpConfigTemplateName:"whatsapp_banner",qpConfigTriggersTrigger:[],secondaryAction:void 0};e.promotions.push(L)})});return{type:"success",quickPromotions:Array.from(b.values(),function(a){var b=a.id;a=a.promotions;return{id:b,promotions:[].concat(a)}})}})["catch"](function(a){I(a);return d("WAWebFetchAdAccountToken").hasGraphQLAuthError(a)?{type:"auth-failure"}:x})}function N(a){switch(a){case"AND_TYPE":return d("WAWebProtobufsQuickPromotionSurfaces.pb").QP$ClauseType.AND;case"OR_TYPE":return d("WAWebProtobufsQuickPromotionSurfaces.pb").QP$ClauseType.OR;case"NOR_TYPE":return d("WAWebProtobufsQuickPromotionSurfaces.pb").QP$ClauseType.NOR;default:a;throw c("err")("Unexpected future filter clause type")}}function O(a){switch(a){case"PASS":return d("WAWebProtobufsQuickPromotionSurfaces.pb").QP$FilterResult.TRUE;case"FAIL":return d("WAWebProtobufsQuickPromotionSurfaces.pb").QP$FilterResult.FALSE;case"UNKNOWN":return d("WAWebProtobufsQuickPromotionSurfaces.pb").QP$FilterResult.UNKNOWN;default:a;throw c("err")("Unexpected future filter result")}}function P(a,b){var c=b(G,a),d=c.clause_type;c=c.filters;a=a.clauses;if(d==null)return;a=a!=null?a.map(function(a){return P(a,b)}).filter(Boolean):[];c=c.map(function(a){return Q(a,b)}).filter(Boolean);d={clauseType:N(d),clauses:a,filters:c};return d}function Q(a,b){b=b(H,a);a=b.filter_name;var c=b.parameters,e=b.passes_if_client_not_supported;b=b.filter_result;if(a==null)return;c=c.reduce(function(a,b){var c=b.key;b=b.value;if(c==null||b==null)return a;a.push({key:c,value:b});return a},[]);a={filterName:a,parameters:c,clientNotSupportedConfig:e===!0?d("WAWebProtobufsQuickPromotionSurfaces.pb").QP$FilterClientNotSupportedConfig.PASS_BY_DEFAULT:d("WAWebProtobufsQuickPromotionSurfaces.pb").QP$FilterClientNotSupportedConfig.FAIL_BY_DEFAULT,filterResult:b!=null?O(b):void 0};return a}function R(a){for(var b of d("WAWebCTWAConstants").KNOWN_QP_SURFACES.entries()){var c=b[0],e=b[1];if(e===a)return c}}function S(){return d("WAWebFetchAdAccountToken").getMaximumAdAccountFetchTimeoutSeconds()*1e3+d("WAWebCTWAConstants").QP_FETCH_TIMEOUT_MS*(y+1)}g.fetchQuickPromotions=a}),98); __d("WAWebQuickReplyEnum",["$InternalEnum"],(function(a,b,c,d,e,f){a=b("$InternalEnum")({TEXT:"text",ADDRESS_SMART_DEFAULT:"address_smart_default",HOURS_SMART_DEFAULT:"hours_smart_default",PROFILE_SMART_DEFAULT:"profile_smart_default",PIX_KEY_SMART_DEFAULT:"pix_key_smart_default"});f.QuickReplyTypes=a}),66); __d("WAWebQuickReplyGetters",["WAWebGetters","WAWebGettersCaches","WAWebQuickReplyEnum"],(function(a,b,c,d,e,f,g){a=d("WAWebGetters").createGetterFactories({createCache:d("WAWebGettersCaches").createQuickReplyCache});b=a.field;c=a.computed;e=a.unsafeIdentityGetter;f=a.clearCacheFor;a=f;f=e;e=b("id");b=b("count");c=c(function(a){a=a[0];a=(a=d("WAWebQuickReplyEnum").QuickReplyTypes.cast(a))!=null?a:d("WAWebQuickReplyEnum").QuickReplyTypes.TEXT;switch(a){case d("WAWebQuickReplyEnum").QuickReplyTypes.ADDRESS_SMART_DEFAULT:return d("WAWebQuickReplyEnum").QuickReplyTypes.ADDRESS_SMART_DEFAULT;case d("WAWebQuickReplyEnum").QuickReplyTypes.HOURS_SMART_DEFAULT:return d("WAWebQuickReplyEnum").QuickReplyTypes.HOURS_SMART_DEFAULT;case d("WAWebQuickReplyEnum").QuickReplyTypes.PROFILE_SMART_DEFAULT:return d("WAWebQuickReplyEnum").QuickReplyTypes.PROFILE_SMART_DEFAULT;case d("WAWebQuickReplyEnum").QuickReplyTypes.PIX_KEY_SMART_DEFAULT:return d("WAWebQuickReplyEnum").QuickReplyTypes.PIX_KEY_SMART_DEFAULT;default:return d("WAWebQuickReplyEnum").QuickReplyTypes.TEXT}},[e]);g.clearQuickReplyGetterCacheFor=a;g.getQuickReplyUnsafe=f;g.getCount=b;g.getType=c}),98); __d("WAWebFrontendQuickReplyGetters",["WAWebGetters","WAWebGettersCaches","WAWebQuickReplyGetters"],(function(a,b,c,d,e,f,g){a=d("WAWebGetters").createGetterFactories({root:d("WAWebQuickReplyGetters").getQuickReplyUnsafe,createCache:d("WAWebGettersCaches").createFrontendQuickReplyCache});b=a.field;c=a.computed;e=a.clearCacheFor;f=e;a=b("pendingCount");e=c(function(a){var b=a[0];a=a[1];return b+a},[d("WAWebQuickReplyGetters").getCount,a]);g.clearFrontendQuickReplyGetterCacheFor=f;g.getTotalCount=e}),98); __d("WAWebBizQuickReplyBridge",["Promise","WAWebSchemaQuickReply"],(function(a,b,c,d,e,f,g){var h;function a(a){(h||(h=b("Promise"))).resolve();var c=a.id,e=a.shortcut,f=a.count,g=a.message;a=a.keywords;c={id:c,shortcut:e,count:f,message:g,keywords:a};e=d("WAWebSchemaQuickReply").getQuickReplyTable().createOrReplace(c);return e}g.updateQuickReply=a}),98); __d("WAWebQuickReplyModel",["WAWebBaseModel","WAWebBizQuickReplyBridge","WAWebFrontendQuickReplyGetters","WAWebQuickReplyEnum","WAWebQuickReplyGetters"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.shortcut=d("WAWebBaseModel").prop(),c.message=d("WAWebBaseModel").prop(),c.count=d("WAWebBaseModel").prop(),c.keywords=d("WAWebBaseModel").prop(),c.pendingCount=d("WAWebBaseModel").session(0),b)||babelHelpers.assertThisInitialized(c)}var c=b.prototype;c.useOnce=function(){this.isSmartDefault()?(this.count+=1,void d("WAWebBizQuickReplyBridge").updateQuickReply(this)):this.pendingCount+=1};c.isSmartDefault=function(){switch(d("WAWebQuickReplyGetters").getType(this)){case d("WAWebQuickReplyEnum").QuickReplyTypes.PROFILE_SMART_DEFAULT:case d("WAWebQuickReplyEnum").QuickReplyTypes.HOURS_SMART_DEFAULT:case d("WAWebQuickReplyEnum").QuickReplyTypes.ADDRESS_SMART_DEFAULT:case d("WAWebQuickReplyEnum").QuickReplyTypes.PIX_KEY_SMART_DEFAULT:return!0;default:return!1}};c.hideFromGroupChat=function(){switch(d("WAWebQuickReplyGetters").getType(this)){case d("WAWebQuickReplyEnum").QuickReplyTypes.PIX_KEY_SMART_DEFAULT:return!0;default:return!1}};c.hideForRecipientCountryCode=function(a){switch(d("WAWebQuickReplyGetters").getType(this)){case d("WAWebQuickReplyEnum").QuickReplyTypes.PIX_KEY_SMART_DEFAULT:return a!=="BR";default:return!1}};c["delete"]=function(){a.prototype["delete"].call(this),d("WAWebQuickReplyGetters").clearQuickReplyGetterCacheFor(this),d("WAWebFrontendQuickReplyGetters").clearFrontendQuickReplyGetterCacheFor(this)};return b}(d("WAWebBaseModel").BaseModel);a.Proxy="quickReply";b=d("WAWebBaseModel").defineModel(a);g["default"]=b}),98); __d("WAWebQuickReplyCollection",["WAWebBaseCollection","WAWebFrontendQuickReplyGetters","WAWebQuickReplyModel","WAWebQuickReplySmartDefaults"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.smartDefaultsAdded=!1,c.sortQuickReply=function(a,b){var c=d("WAWebFrontendQuickReplyGetters").getTotalCount(a),e=d("WAWebFrontendQuickReplyGetters").getTotalCount(b);return c===e?a.id<b.id?-1:1:c>e?-1:1},b)||babelHelpers.assertThisInitialized(c)}var c=b.prototype;c.addSmartDefaultsIfNeeded=function(){this.smartDefaultsAdded===!1&&(d("WAWebQuickReplySmartDefaults").addSmartDefaults(),this.smartDefaultsAdded=!0)};c.filterShortcuts=function(a){var b=this.filter(function(b){b=b.shortcut;return b.toLowerCase().startsWith(a.toLowerCase())});return b.sort(this.sortQuickReply)};return b}(d("WAWebBaseCollection").BaseCollection);a.model=c("WAWebQuickReplyModel");b=new a();g.QuickReplyCollection=b}),98); __d("WAWebBizFrontendGatingUtils",["WAWebABProps","WAWebMobilePlatforms","WAWebPrimaryFeaturesModel"],(function(a,b,c,d,e,f,g){function a(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebPrimaryFeaturesModel").PrimaryFeatures.paymentInfoSyncSupport&&d("WAWebABProps").getABPropConfigValue("order_details_payment_instructions_sync_enabled")}function b(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebPrimaryFeaturesModel").PrimaryFeatures.customPaymentMethodsSyncSupport&&d("WAWebABProps").getABPropConfigValue("payments_br_pix_phase_1_seller_sync_enabled")}function c(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebPrimaryFeaturesModel").PrimaryFeatures.customPaymentMethodsSyncSupport&&d("WAWebABProps").getABPropConfigValue("payments_br_pix_quick_reply_enabled")}function e(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("payments_br_force_copy_pix_cta_enabled")}function f(){return d("WAWebABProps").getABPropConfigValue("payments_br_copy_pix_code_api_merchant_enabled")}function h(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebPrimaryFeaturesModel").PrimaryFeatures.merchantPaymentPartnerSyncSupport&&d("WAWebABProps").getABPropConfigValue("payments_br_merchant_psp_account_status_sync")}function i(){return d("WAWebMobilePlatforms").isSMB()&&d("WAWebABProps").getABPropConfigValue("payments_br_pix_on_web")}g.isOrderDetailsPaymentInstructionsSyncEnabled=a;g.isCustomPaymentMethodsSyncEnabled=b;g.isPixInQuickReplyEnabled=c;g.isForceCopyPixCTAEnabled=e;g.isAPICopyPixCTAEnabled=f;g.isMerchantPaymentPartnerSyncEnabled=h;g.isPixOnWebEnabled=i}),98); __d("WAWebBrazilPixKeyFormattingUtils",["fbt","WAWebUserPrefsTypes"],(function(a,b,c,d,e,f,g,h){"use strict";var i=/^(\d{3})(\d{3})(\d{3})(\d{2})$/g,j="$1.$2.$3-$4",k=/^(\d{2})(\d{3})(\d{3})(\d{4})(\d{2})$/g,l="$1.$2.$3/$4-$5",m=/^(\+\d{2})(\d{2})(\d{4,5})(\d{4})$/g,n="$2 $3-$4";function a(a,b){if(b==null)return a;switch(b){case d("WAWebUserPrefsTypes").PixKeyType.CPF:return o(a);case d("WAWebUserPrefsTypes").PixKeyType.CNPJ:return p(a);case d("WAWebUserPrefsTypes").PixKeyType.PHONE:return q(a);case d("WAWebUserPrefsTypes").PixKeyType.EMAIL:case d("WAWebUserPrefsTypes").PixKeyType.EVP:return a}}function b(a,b){if(b==null)return a;switch(b){case d("WAWebUserPrefsTypes").PixKeyType.PHONE:return a.substr(3);default:return a}}function c(a){a=(a=d("WAWebUserPrefsTypes").PixKeyType.cast(a))!=null?a:d("WAWebUserPrefsTypes").PixKeyType.PHONE;switch(a){case d("WAWebUserPrefsTypes").PixKeyType.CPF:return h._(/*BTDS*/"__JHASH__TYk1WxUTcuy__JHASH__");case d("WAWebUserPrefsTypes").PixKeyType.CNPJ:return h._(/*BTDS*/"__JHASH__ZbpmuxjqEdU__JHASH__");case d("WAWebUserPrefsTypes").PixKeyType.PHONE:return h._(/*BTDS*/"__JHASH__RSjiVJPqKgl__JHASH__");case d("WAWebUserPrefsTypes").PixKeyType.EMAIL:return h._(/*BTDS*/"__JHASH__1nq2QGKYRXj__JHASH__");case d("WAWebUserPrefsTypes").PixKeyType.EVP:return h._(/*BTDS*/"__JHASH__fqu557Pg0Mp__JHASH__")}}function o(a){return a.replace(i,j)}function p(a){return a.replace(k,l)}function q(a){return a.replace(m,n)}g.getFormattedPixKey=a;g.getCopiedPixKey=b;g.getPixKeyTypeLabel=c}),226); __d("WAWebQuickReplySmartDefaults",["fbt","WAWebBizFrontendGatingUtils","WAWebBrazilPixKeyFormattingUtils","WAWebBusinessProfileCollection","WAWebBusinessProfileUtils","WAWebContactCollection","WAWebFrontendContactGetters","WAWebQuickReplyCollection","WAWebQuickReplyEnum","WAWebQuickReplyModel","WAWebUserPrefsCustomPaymentMethods","WAWebUserPrefsMeUser"],(function(a,b,c,d,e,f,g,h){function a(){o(),i(),j(),k()}function i(){var a=d("WAWebQuickReplyEnum").QuickReplyTypes.PROFILE_SMART_DEFAULT,b=m();!d("WAWebQuickReplyCollection").QuickReplyCollection.get(a)?b&&d("WAWebQuickReplyCollection").QuickReplyCollection.add(b,{merge:!0}):b&&d("WAWebQuickReplyCollection").QuickReplyCollection.add({id:a,message:b.message},{merge:!0})}function j(){var a=d("WAWebQuickReplyEnum").QuickReplyTypes.ADDRESS_SMART_DEFAULT,b=n();!d("WAWebQuickReplyCollection").QuickReplyCollection.get(a)?b&&d("WAWebQuickReplyCollection").QuickReplyCollection.add(b,{merge:!0}):b&&d("WAWebQuickReplyCollection").QuickReplyCollection.add({id:a,message:b.message},{merge:!0})}function k(){var a=d("WAWebQuickReplyEnum").QuickReplyTypes.HOURS_SMART_DEFAULT,b=l();!d("WAWebQuickReplyCollection").QuickReplyCollection.get(a)?b&&d("WAWebQuickReplyCollection").QuickReplyCollection.add(b,{merge:!0}):b&&d("WAWebQuickReplyCollection").QuickReplyCollection.add({id:a,message:b.message},{merge:!0})}function l(){var a,b=d("WAWebUserPrefsMeUser").getMaybeMeUser();if(b==null)return;b=d("WAWebBusinessProfileCollection").BusinessProfileCollection.get(b);if(b==null?void 0:(a=b.businessHours)==null?void 0:a.config){a=d("WAWebQuickReplyEnum").QuickReplyTypes.HOURS_SMART_DEFAULT;b=d("WAWebBusinessProfileUtils").quickReplyHoursStr(b.businessHours);return new(c("WAWebQuickReplyModel"))({id:a,shortcut:h._(/*BTDS*/"__JHASH__bJUomZQhnPj__JHASH__").toString(),message:b,count:-1,keywords:[]})}}function m(){var a=d("WAWebContactCollection").ContactCollection.getMeContact();if(a){var b=d("WAWebQuickReplyEnum").QuickReplyTypes.PROFILE_SMART_DEFAULT;return new(c("WAWebQuickReplyModel"))({id:b,shortcut:h._(/*BTDS*/"__JHASH__k9t4CrKiWk___JHASH__").toString(),message:d("WAWebFrontendContactGetters").getDisplayName(a),count:-1,keywords:[]})}}function n(){var a=d("WAWebUserPrefsMeUser").getMaybeMeUser();if(a==null)return;a=d("WAWebBusinessProfileCollection").BusinessProfileCollection.get(a);if((a==null?void 0:a.latitude)!=null||(a==null?void 0:a.longitude)!=null||(a==null?void 0:a.address)!=null){var b=d("WAWebQuickReplyEnum").QuickReplyTypes.ADDRESS_SMART_DEFAULT;a=a.address||h._(/*BTDS*/"__JHASH__opR7fK9qdoa__JHASH__");var e="\ud83d\udccd";return new(c("WAWebQuickReplyModel"))({id:b,shortcut:h._(/*BTDS*/"__JHASH__KWQcryoUjlr__JHASH__").toString(),message:h._(/*BTDS*/"__JHASH__uZ8pOhpkEw5__JHASH__",[h._param("pinEmoji",e),h._param("address",a)]).toString(),count:-1,keywords:[]})}}function o(){var a=d("WAWebQuickReplyEnum").QuickReplyTypes.PIX_KEY_SMART_DEFAULT,b=p();d("WAWebQuickReplyCollection").QuickReplyCollection.get(a)?b?d("WAWebQuickReplyCollection").QuickReplyCollection.add({id:a,message:b.message},{merge:!0}):d("WAWebQuickReplyCollection").QuickReplyCollection.remove(a):b&&d("WAWebQuickReplyCollection").QuickReplyCollection.add(b,{merge:!0})}function p(){if(d("WAWebBizFrontendGatingUtils").isPixInQuickReplyEnabled()){var a=d("WAWebUserPrefsCustomPaymentMethods").getPIX();if(a){var b=d("WAWebQuickReplyEnum").QuickReplyTypes.PIX_KEY_SMART_DEFAULT;return new(c("WAWebQuickReplyModel"))({id:b,shortcut:h._(/*BTDS*/"__JHASH__er43OPhwNX4__JHASH__").toString(),message:d("WAWebBrazilPixKeyFormattingUtils").getFormattedPixKey(a.key,a.key_type),count:-1,keywords:[]})}}}g.addSmartDefaults=a;g.getOrUpdatePixKeySmartDefault=o}),226); __d("WAWebReactionsMsgAction",["WAAbortError","WAJobOrchestratorTypes","WALogger","WAWebAck","WAWebAddOnsUpdateSendStatesAction","WAWebAddonGatingUtils","WAWebAddonHydrationUtils","WAWebDBCreateOrUpdateReactions","WAWebFlattenedReactionCollection","WAWebLidMigrationUtils","WAWebMaybe","WAWebMessageAddOnType","WAWebMsgCollection","WAWebMsgKey","WAWebMsgModel","WAWebMsgReactionsBridge","WAWebMsgType","WAWebNotificationBackend","WAWebOrchestratorNonPersistedJob","WAWebReactionDataUtils","WAWebReactionGatingUtils","WAWebReactionNotificationUtils","WAWebReactionTypeConversion","WAWebReactionsBEUtils","WAWebReactionsCollection","WAWebReactionsModels","WAWebReactionsMsgActionUtils","WAWebSendAddonMsgChatAction","WAWebSendMsgRecordAction","WAWebSendMsgResultAction","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["WAWebReactionsUtils:resendUpdateFailedPropsForSentReactionsDBAndModel Reactions model not found for this message id"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["actions:addOrUpdateReactions reaction was not added or updated in the DB"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["actions:addOrUpdateReactions Notify for this reaction"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["actions:addOrUpdateReactions Reaction Model does not exist for this parentMsg"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["actions:handleReactionNotification - notification aborted ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["actions:handleReactionNotification Notify for this reaction"]);m=function(){return a};return a}function n(a,b){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=b.allowNotify;var e=a.parentMsgKey,f=a.ack,g=d("WAWebReactionDataUtils").reactionRowToReactionMsgData(a);b=Boolean(b)&&!d("WAWebReactionNotificationUtils").nonHydratedShouldMuteReactionNotification(g);if(d("WAWebReactionGatingUtils").isFlattenedReactionsEnabled()){var h=c("WAWebMsgKey").fromString(e);b&&!d("WAWebAddonHydrationUtils").haveAddonsBeenHydratedForParent(h,d("WAWebMsgType").MSG_TYPE.REACTION)&&(yield d("WAWebAddonHydrationUtils").hydrateAddons({ids:[h],hydrationType:d("WAWebMsgType").MSG_TYPE.REACTION}));var i=d("WAWebAddonHydrationUtils").haveAddonsBeenHydratedForParent(h,d("WAWebMsgType").MSG_TYPE.REACTION);f=d("WAWebReactionTypeConversion").convertReactionRowToFlattenedReaction(a,f!=null&&f<d("WAWebAck").ACK.CLOCK);if(i){d("WAWebFlattenedReactionCollection").FlattenedReactionsCollection.addOrUpdateReaction([f]);i=d("WAWebFlattenedReactionCollection").FlattenedReactionsCollection.byParent(h.toString()).length>0;yield d("WAWebMsgReactionsBridge").updateHasReactionInParent(e,i)}else a.reactionText!==d("WAWebReactionsBEUtils").REVOKED_REACTION_TEXT&&(yield d("WAWebMsgReactionsBridge").updateHasReactionInParent(e,!0))}else{b?f=(yield d("WAWebReactionsCollection").ReactionsCollection.find(e)):f=d("WAWebReactionsCollection").ReactionsCollection.getAddressingModeInsensitive(e);if(f){d("WAWebReactionsCollection").ReactionsCollection.addOrUpdateReaction(a);h=f.reactions.length>0;yield d("WAWebMsgReactionsBridge").updateHasReactionInParent(e,h)}else a.reactionText!==d("WAWebReactionsBEUtils").REVOKED_REACTION_TEXT&&(yield d("WAWebMsgReactionsBridge").updateHasReactionInParent(e,!0)),d("WALogger").DEV(k())}b&&!d("WAWebReactionGatingUtils").isReactionNotificationAddOnApiEnabled()&&(d("WALogger").DEV(j()),d("WAWebNotificationBackend").showReactionNotification(g))});return o.apply(this,arguments)}function a(a,b){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=(yield d("WAWebDBCreateOrUpdateReactions").createOrUpdateReactions([a]));a=a[0];if(!a){d("WALogger").DEV(i());return}n(a,{allowNotify:b});return a});return p.apply(this,arguments)}function e(a){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b;a.senderUserJid;var c=babelHelpers.objectWithoutPropertiesLoose(a,["senderUserJid"]);b=(b=d("WAWebReactionsCollection").ReactionsCollection.getExistingSenderModelFromReactionDetails(c))!=null?b:d("WAWebMaybe").ifSome(d("WAWebLidMigrationUtils").getAlternateMsgKey(c.msgKey),function(a){return d("WAWebReactionsCollection").ReactionsCollection.getExistingSenderModelFromReactionDetails(babelHelpers["extends"]({},c,{msgKey:a}))});if(b==null){d("WALogger").ERROR(h());return}yield r(a,b.timestamp)});return q.apply(this,arguments)}function r(a,b){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){var f=d("WAWebMsgCollection").MsgCollection.get(a.parentMsgKey),g=a instanceof d("WAWebReactionsModels").FlattenedReaction?c("WAWebMsgKey").from(a.parentMsgKey):a.parentMsgKey,h=a instanceof d("WAWebReactionsModels").FlattenedReaction?c("WAWebMsgKey").from(a.msgKey):a.msgKey;if(f){g=g.remote;var i=d("WAWebReactionsMsgActionUtils").getFromForReactionMessage(f);f=(yield d("WAWebReactionsMsgActionUtils").getReactionMsgData(f,a.reactionText,i,h,Math.floor(e/1e3),g,e));if(d("WAWebAddonGatingUtils").isUnifiedInfraEnabled(f)){i=(yield d("WAWebSendAddonMsgChatAction").addAndSendAddonToChat(f));if(i.messageSendResult!==d("WAWebSendMsgResultAction").SendMsgResult.OK)throw c("err")("Reaction send error");return}var j=new(d("WAWebMsgModel").Msg)(f);yield d("WAWebAddOnsUpdateSendStatesAction").updateAddOnSendStatesAction(new Map([[d("WAWebMessageAddOnType").MessageAddOnType.Reaction,[{msgKey:a.msgKey.toString(),ack:d("WAWebAck").ACK.CLOCK,isSendFailure:!1}]]]));return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("sendMessage",b("asyncToGeneratorRuntime").asyncToGenerator(function*(){return d("WAWebSendMsgRecordAction").sendMsgRecord(j)}),{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()}});return s.apply(this,arguments)}function f(a){for(a of a){var b=!d("WAWebReactionNotificationUtils").nonHydratedShouldMuteReactionNotification(a);b&&(d("WALogger").DEV(m()).devConsole(a),d("WAWebNotificationBackend").showReactionNotification(a)["catch"](d("WAAbortError").catchAbort(function(a){d("WALogger").DEV(l(),a)})))}}g.addOrUpdateReactionsModelCollection=n;g.addOrUpdateReactions=a;g.resendUpdateFailedPropsForSentReactionsDBAndModel=e;g.handleReactionNotification=f}),98); __d("WAWebReactionsMsgActionUtils",["WALogger","WANullthrows","WAWebAck","WAWebAddonEncryption","WAWebFrontendMsgGetters","WAWebMsgGetters","WAWebMsgKeyUtils","WAWebMsgType","WAWebReferentialMsgKey","WAWebUserPrefsMeUser","WAWebViewMode.flow","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["create reaction: "," and "," do not match"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["create reaction: "," and "," do not match"]);i=function(){return a};return a}function a(a){a=Boolean((a=d("WAWebFrontendMsgGetters").getChat(a).groupMetadata)==null?void 0:a.isCag);var b=d("WAWebUserPrefsMeUser").getMaybeMeLidUser();return a&&b!=null?b:d("WAWebUserPrefsMeUser").getMeUser()}function e(a,b,c,d,e,f,g){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e,f,g,j,k){var l,m=d("WAWebMsgKeyUtils").msgKeyToTargetInfo(f,d("WAWebMsgKeyUtils").TranslateMsgKeyType.Addon);e.equals(m.from)||d("WALogger").WARN(i(),e.toLogString(),m.from.toLogString()).tags("messaging").sendLogs("reactionMsgData: from is not matching",{sampling:.01});j.equals(m.to)||d("WALogger").WARN(h(),j.toLogString(),m.to.toLogString()).tags("messaging").sendLogs("reactionMsgData: to is not matching",{sampling:.01});if((l=d("WAWebFrontendMsgGetters").getChat(a).groupMetadata)==null?void 0:l.isCag){l=self.crypto.getRandomValues(new Uint8Array(12));var n={type:d("WAWebMsgType").MsgKind.ReactionDecrypted,encode:{text:b,senderTimestampMs:k}};n=(yield d("WAWebAddonEncryption").encryptAddOn(n,{messageSecret:c("WANullthrows")(a.messageSecret,"Parent message missing message secret"),iv:l,stanzaId:a.id.id,originalMessageSender:d("WAWebMsgGetters").getOriginalSender(a.unsafe()),addOnSender:d("WAWebWidFactory").toUserWid(e)}));n=n.encPayload;return{id:f,type:d("WAWebMsgType").MSG_TYPE.REACTION_ENC,kind:d("WAWebMsgType").MsgKind.ReactionEncrypted,viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE,t:g,from:e,to:j,author:m.author,ack:d("WAWebAck").ACK.CLOCK,targetMessageKey:d("WAWebReferentialMsgKey").getReferentialMsgKey(a),encPayload:n,encIv:l.buffer}}return{id:f,reactionParentKey:d("WAWebReferentialMsgKey").getReferentialMsgKey(a),type:d("WAWebMsgType").MSG_TYPE.REACTION,viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE,kind:d("WAWebMsgType").MsgKind.ReactionDecrypted,t:g,from:e,to:j,author:m.author,ack:d("WAWebAck").ACK.CLOCK,reactionText:b,reactionTimestamp:k,read:!0}});return j.apply(this,arguments)}g.getFromForReactionMessage=a;g.getReactionMsgData=e}),98); __d("WAWebNotificationsBaseReactionNotification",["WALogger","WANullthrows","WAWebBaseNotification","WAWebConstantsDeprecated","WAWebEnvironment","WAWebFrontendMsgGetters","WAWebMsgCollection","WAWebNotificationController","WAWebNotificationHelpers","WAWebNotificationMuteReason","WAWebReactionNotificationUtils","WAWebReactionsCollection","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["WAReactionNotification: cleaning up reaction notification"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["WAReactionNotification: Reaction model not found"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["WAReactionNotification: parentMsg is not present in the MsgCollection. It may need to be hydrated."]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["WAReactionNotification: constructor"]);k=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(e,a);function e(b){var e;b=b.reactionMsg;e=a.call(this)||this;e.$WABaseReactionNotification$p_1=function(){d("WAWebFrontendMsgGetters").getChat(e.parentMsg)!=null&&e.parentMsg!=null&&d("WAWebFrontendMsgGetters").getChat(e.parentMsg).reactionSquelch===c("WAWebConstantsDeprecated").SQUELCH_RESET_VALUE&&(e.parentMsg.squelch=c("WAWebConstantsDeprecated").SQUELCH_RESET_VALUE)};d("WALogger").LOG(k()).devConsole({reactionMsg:b});e.reactionMsg=b;b=d("WAWebMsgCollection").MsgCollection.get(c("WANullthrows")(e.reactionMsg.reactionParentKey).toString());if(b==null){d("WALogger").ERROR(j()).devConsole(babelHelpers.assertThisInitialized(e));return babelHelpers.assertThisInitialized(e)}e.parentMsg=b;return e}var f=e.prototype;f.beforeBannerShown=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(this.parentMsg==null)return;var a=(yield d("WAWebReactionsCollection").ReactionsCollection.findAddressingModeInsensitive(this.parentMsg.id.toString()));if(a){a=d("WAWebReactionsCollection").ReactionsCollection.getAggregateEmojiAndSender(a,d("WAWebReactionNotificationUtils").getReactionSenderJid(this.reactionMsg).toString());a=a.reactionSenderModel;this.reactionSender=a}else d("WALogger").WARN(i())});function c(){return a.apply(this,arguments)}return c}();f.afterBannerShown=function(a){var b=this;if(this.reactionSender!=null){var c=this.reactionSender,e=d("WAWebFrontendMsgGetters").getMaybeChat(this.parentMsg);c.on("revoked change:read",this.closeBanner);e==null?void 0:e.on("change:reactionSquelch",this.$WABaseReactionNotification$p_1);a.waitForClose().then(function(){d("WALogger").LOG(h()),c.off("revoked change:read",b.closeBanner),e==null?void 0:e.off("change:reactionSquelch",b.$WABaseReactionNotification$p_1)})}};f.shouldMute=function(a){if(c("WAWebEnvironment").isWindows&&this.reactionMsg.viewed===!0)return c("WAWebNotificationMuteReason").IgnoreViewedMsgs;if(d("WAWebReactionNotificationUtils").nonHydratedShouldMuteReactionNotification(this.reactionMsg))return c("WAWebNotificationMuteReason").NonHydratedReaction;if(this.parentMsg==null)return c("WAWebNotificationMuteReason").ParentMsgMissing;if(this.shouldMuteDueToAppState(a))return c("WAWebNotificationMuteReason").AppState};f.shouldSquelch=function(){var a=d("WAWebNotificationController").WANotificationController.notificationExists(this.buildKey());if(a)return null};f.buildKey=function(){return"reaction:"+this.parentMsg.id.toString()+"-"+d("WAWebReactionNotificationUtils").getReactionSenderJid(this.reactionMsg).toString()};f.shouldMuteDueToAppState=function(a){return d("WAWebNotificationHelpers").shouldMuteDueToAppState(a)};return e}(d("WAWebBaseNotification").WABaseNotification);g.WABaseReactionNotification=a}),98); __d("WAWebNotificationsReactionNotification",["WAWebFrontendChatGetters","WAWebFrontendMsgGetters","WAWebGetNotificationStrings","WAWebMuteGetters","WAWebNoop","WAWebNotificationHelpers","WAWebNotificationIconUtils","WAWebNotificationMuteReason","WAWebNotificationsBaseReactionNotification","WAWebReactionNotificationUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(e,a);function e(){return a.apply(this,arguments)||this}var f=e.prototype;f.shouldMute=function(b){b=a.prototype.shouldMute.call(this,b);if(b!=null)return b;b=d("WAWebFrontendMsgGetters").getChat(this.parentMsg);if(d("WAWebMuteGetters").getIsMuted(b.mute))return c("WAWebNotificationMuteReason").MutedChat;return d("WAWebReactionNotificationUtils").isArchivedChat(b)?c("WAWebNotificationMuteReason").ArchivedChat:null};f.shouldSquelch=function(){if(a.prototype.shouldSquelch.call(this)==null)return null;var b=d("WAWebFrontendMsgGetters").getChat(this.parentMsg);if(d("WAWebNotificationHelpers").shouldSquelch(b,!1))return c("WAWebNotificationMuteReason").GroupFlood;return d("WAWebReactionNotificationUtils").shouldSquelchReactionMessage(b,this.parentMsg)?c("WAWebNotificationMuteReason").ReactionFlood:null};f.matchesChat=function(a){return d("WAWebFrontendMsgGetters").getChat(this.parentMsg).equals(a)};f.getChatKind=function(){return d("WAWebFrontendChatGetters").getKind(d("WAWebFrontendMsgGetters").getChat(this.parentMsg))};f.getIcon=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=d("WAWebFrontendMsgGetters").getChat(this.parentMsg);return d("WAWebNotificationIconUtils").getChatNotificationIcon(a,this.abortController.signal)});function c(){return a.apply(this,arguments)}return c}();f.getBannerOptions=function(){var a=this.parentMsg,b=d("WAWebFrontendMsgGetters").getChat(a),e=d("WAWebReactionNotificationUtils").getNotificationPartsForChatReaction(a,this.reactionMsg),f=e.action,g=e.author;e=e.body;f=d("WAWebGetNotificationStrings").getNotificationBody({action:f,author:g,body:e,msgDir:d("WAWebFrontendMsgGetters").getDir(a)});return{wid:b.id,msgId:a.id.toString(),onClick:c("WAWebNoop"),tag:a.id.toString(),doNotOpenChat:!1,title:d("WAWebNotificationHelpers").getNotificationTitle(b),body:f}};return e}(d("WAWebNotificationsBaseReactionNotification").WABaseReactionNotification);g.WAReactionNotification=a}),98); __d("WAWebNotificationsStatusReactionNotification",["WANullthrows","WAWebEnvironment","WAWebFrontendMsgGetters","WAWebGetNotificationStrings","WAWebNotificationIconUtils","WAWebNotificationMuteReason","WAWebNotificationsBaseReactionNotification","WAWebReactionNotificationUtils","WAWebStatusNotificationUtils","asyncToGeneratorRuntime","cr:7293"],(function(a,b,c,d,e,f,g){e=(a=b("cr:7293"))!=null?a:{};var h=e.getStatusReactionsSetting;f=function(a){babelHelpers.inheritsLoose(e,a);function e(){return a.apply(this,arguments)||this}var f=e.prototype;f.shouldMute=function(b){b=a.prototype.shouldMute.call(this,b);return b!=null?b:(h==null?void 0:h())===!1?c("WAWebNotificationMuteReason").MutedStatusReaction:null};f.matchesChat=function(a){return a.id.isStatus()};f.getChatKind=function(){return null};f.getIcon=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){return d("WAWebNotificationIconUtils").getNotificationIconByWid(d("WAWebReactionNotificationUtils").getReactionSenderJid(this.reactionMsg),this.abortController.signal,d("WAWebNotificationIconUtils").USER_DEFAULT_ICON)});function c(){return a.apply(this,arguments)}return c}();f.getBannerOptions=function(){var a=this.parentMsg,b=d("WAWebReactionNotificationUtils").getNotificationPartsForStatusReaction(a,this.reactionMsg),e=b.action,f=b.author;b=b.body;e=d("WAWebGetNotificationStrings").getNotificationBody({action:e,body:b,msgDir:d("WAWebFrontendMsgGetters").getDir(a)});b=function(){d("WAWebStatusNotificationUtils").openStatusViewer(a)};return{wid:a.id.remote,msgId:a.id.toString(),onClick:b,tag:a.id.toString(),doNotOpenChat:!0,title:c("WANullthrows")(f),body:e}};f.shouldMuteDueToAppState=function(b){return c("WAWebEnvironment").isWindows?!1:a.prototype.shouldMuteDueToAppState.call(this,b)};return e}(d("WAWebNotificationsBaseReactionNotification").WABaseReactionNotification);g.WAStatusReactionNotification=f}),98); __d("WAWebChatContactUtils",["fbt"],(function(a,b,c,d,e,f,g,h){function a(a,b){b===void 0&&(b=!0);return a==null||a===""?"":"~"+(b?"\u202f":"")+a}function b(a){return a==null||a===""?"":h._(/*BTDS*/"__JHASH__i57tYcHhpTl__JHASH__",[h._param("notifyName",a)])}g.getFormattedNotifyName=a;g.getAccessibleNotifyName=b}),226); __d("WAWebReactionNotificationUtils",["fbt","WANullthrows","WAWebChatContactUtils","WAWebChatGetters","WAWebConstantsDeprecated","WAWebContactCollection","WAWebContactGetters","WAWebElevatedPushNamesFlag","WAWebEmoji","WAWebFrontendMsgGetters","WAWebGetNotificationStrings","WAWebGroupMetadataCollection","WAWebMsgGetters","WAWebMsgType","WAWebMuteCollection","WAWebMuteGetters","WAWebNotificationHelpers","WAWebReactionsBEUtils","WAWebSettingsGetters","WAWebSettingsModel","WAWebUserPrefsMeUser","WAWebWidFactory","WAWebWidFormat"],(function(a,b,c,d,e,f,g,h){function i(a){return d("WAWebWidFactory").toUserWid(c("WANullthrows")(d("WAWebMsgGetters").getSender(a)))}function a(a){var b=a.read,c=a.reactionText,e=i(a).toString();if(b===!0)return!0;if(d("WAWebUserPrefsMeUser").isSerializedWidMe(e))return!0;if(!a.reactionParentKey.fromMe)return!0;if(c===d("WAWebReactionsBEUtils").REVOKED_REACTION_TEXT)return!0;if(d("WAWebNotificationHelpers").isOfflineResumeInProgress())return!0;if(d("WAWebMuteGetters").getIsMuted(d("WAWebMuteCollection").MuteCollection.globalMute()))return!0;return d("WAWebMuteGetters").getIsMuted(d("WAWebMuteCollection").MuteCollection.globalReactionsMute())?!0:!1}function b(a,b){if(!d("WAWebChatGetters").getIsGroup(a))return!1;var e=Date.now(),f=b.squelch||0;if(e>f){c("WAWebGroupMetadataCollection").find(a.id).then(function(e){if(e!=null){e=d("WAWebNotificationHelpers")._calculateTimeoutFromGroupMetadata(a.id,e);e=Date.now()+e;b.squelch=e;a.reactionSquelch===c("WAWebConstantsDeprecated").SQUELCH_RESET_VALUE&&(a.reactionSquelch=e)}});return!1}return!0}function j(a,b){b=i(b);var c=d("WAWebContactCollection").ContactCollection.gadd(b);a=d("WAWebFrontendMsgGetters").getChat(a);a=d("WAWebElevatedPushNamesFlag").elevatedPushNamesM2Enabled(a);if(b.isLid()&&c.phoneNumber){b=d("WAWebContactCollection").ContactCollection.get(c.phoneNumber);var e=d("WAWebElevatedPushNamesFlag").pushNameCanBeUsed(b)&&a,f=b!=null?d("WAWebContactGetters").getNotifyName(b):null;b=(b=b==null?void 0:b.name)!=null?b:e&&f!=null?d("WAWebChatContactUtils").getFormattedNotifyName(f).toString():d("WAWebWidFormat").widToFormattedUser(c.phoneNumber)}else{e=d("WAWebElevatedPushNamesFlag").pushNameCanBeUsed(c)&&a;b=(f=c.name)!=null?f:e&&d("WAWebContactGetters").getNotifyName(c)!=null?d("WAWebChatContactUtils").getFormattedNotifyName(d("WAWebContactGetters").getNotifyName(c)).toString():d("WAWebWidFormat").widToFormattedUser(c.id)}return b}function e(a,b){var c,e;d("WAWebMsgGetters").getIsGroupMsg(a)&&(e=j(a,b));b=(b=d("WAWebEmoji").EmojiUtil.normalizeEmojiFromString(b.reactionText))!=null?b:d("WAWebEmoji").OPEN_BOX_CHAR;b=h._(/*BTDS*/"__JHASH__7BEwPDyKwtY__JHASH__",[h._param("emoji",b)]);a.type===d("WAWebMsgType").MSG_TYPE.CHAT&&!a.shouldShowNotificationPreview()?c=h._(/*BTDS*/"__JHASH__e4C3EbDka6R__JHASH__"):(c=d("WAWebGetNotificationStrings").getNotificationMessageBody(a),c=h._(/*BTDS*/"__JHASH__jdTh_Py1bBb__JHASH__",[h._param("originalMessageBody",c)]));return{body:c.toString(),author:e,action:b.toString()}}function f(a,b){return{body:h._(/*BTDS*/"__JHASH__XWLxpQDGZD9__JHASH__").toString(),author:j(a,b)}}function k(a){if(!d("WAWebSettingsGetters").getShowArchiveV2(c("WAWebSettingsModel")))return!1;return!a.archive?!1:!0}g.getReactionSenderJid=i;g.nonHydratedShouldMuteReactionNotification=a;g.shouldSquelchReactionMessage=b;g._getAuthorNameForReactionNofitication=j;g.getNotificationPartsForChatReaction=e;g.getNotificationPartsForStatusReaction=f;g.isArchivedChat=k}),226); __d("WAWebReactionTypeConversion",["WAWebAck","WAWebFlattenedReactionCollection","WAWebMsgKey"],(function(a,b,c,d,e,f,g){function a(a,b){var e;b=c("WAWebMsgKey").from(a.msgKey).fromMe&&b;e=d("WAWebFlattenedReactionCollection").createFlattenedReactionModel({msgKey:a.msgKey,orphan:a.orphan,parentMsgKey:a.parentMsgKey,reactionText:a.reactionText,read:(e=a.read)!=null?e:!1,senderUserJid:a.senderUserJid,timestamp:a.timestamp,ack:a.ack,isSendFailure:b});return e}function b(a){var b;return{msgKey:a.msgKey,orphan:a.orphan,parentMsgKey:a.parentMsgKey,reactionText:a.reactionText,read:(b=a.read)!=null?b:!1,senderUserJid:a.senderUserJid,timestamp:a.timestamp,ack:a.isSendFailure===!0?d("WAWebAck").ACK.FAILED:(b=a.ack)!=null?b:d("WAWebAck").ACK.CLOCK}}g.convertReactionRowToFlattenedReaction=a;g.convertFlattenedReactionToReactionRow=b}),98); __d("WAWebFlattenedReactionCollection",["WAWebBaseCollection","WAWebCollectionUtils","WAWebEmoji","WAWebLidMigrationUtils","WAWebMsgKey","WAWebReactionsBEUtils","WAWebReactionsModels"],(function(a,b,c,d,e,f,g){b=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.byParentAndSender=d("WAWebCollectionUtils").aggregated(function(a){return[a.parentMsgKey,a.senderUserJid]}),c.byParent=d("WAWebCollectionUtils").aggregated(function(a){return a.parentMsgKey}),c.byParents=d("WAWebCollectionUtils").aggregated(function(a){return[a.parentMsgKey]}),b)||babelHelpers.assertThisInitialized(c)}var c=b.prototype;c.existingReactionAddressingModeInsensitive=function(a,b){var c=this.byParentAndSender([a,b]).head();if(c!=null)return c;c=d("WAWebLidMigrationUtils").getAlternateJid(b);if(c!=null)return this.byParentAndSender([a,c]).head()};c.addOrUpdateReaction=function(a){for(a of a){var b=this.existingReactionAddressingModeInsensitive(a.parentMsgKey,a.senderUserJid);if(b!=null)if(a.timestamp>=b.timestamp)this.remove(b);else continue;a.reactionText!==d("WAWebReactionsBEUtils").REVOKED_REACTION_TEXT&&this.add(a)}};c.getReactionsByMsgKeys=function(a){if(a.length===0)return[];var b=[];for(a of a){var c=this.get(a);c!=null&&b.push(c)}return b};c.deleteReactionsByParentMessageKey=function(a){a=this.byParent(a.toString()).toArray();for(a of a)this.remove(a)};c.getReactionsByParentMsgKeys=function(a){var b=[];for(a of a)b=b.concat(this.byParent(a.toString()).toArray());return b};return b}(d("WAWebBaseCollection").BaseCollection);b.model=d("WAWebReactionsModels").FlattenedReaction;function a(a){return new(d("WAWebReactionsModels").FlattenedReaction)(babelHelpers["extends"]({id:c("WAWebMsgKey").fromString(a.msgKey),aggregatedEmoji:d("WAWebEmoji").EmojiUtil.getEmojiAggregate(a.reactionText)},a))}e=new b();g.createFlattenedReactionModel=a;g.FlattenedReactionsCollection=e}),98); __d("WAWebReactionsCollection",["WALogger","WATypeUtils","WAWebAck","WAWebApiContact","WAWebBaseCollection","WAWebEmoji","WAWebLidMigrationUtils","WAWebMsgCollection","WAWebMsgKey","WAWebMsgReactionsBridge","WAWebReactionsBEUtils","WAWebReactionsModels","WAWebUserPrefsMeUser","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["reactions_collection:shouldUpdateAck Reaction sender model not found"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["reactions_collection:getExistingSenderModelFromReactionDetails Reactions sender model not found for this message id"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["reactions_collection:markReactionsAsRead Reaction sender model not found"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["reactions_collection:removeReaction no reactions model found"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["reactions_collection:removeReaction"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["reactions_collection:addOrUpdateReaction Reactions model not found for this message id"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["reactions_collection:addOrUpdateReaction Did not update because timestamp was smaller than previous reaction"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["reactions_collection:addOrUpdateReaction Removing previous reaction"]);o=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var c,e;for(var f=arguments.length,g=new Array(f),h=0;h<f;h++)g[h]=arguments[h];return(c=e=a.call.apply(a,[this].concat(g))||this,e.findImpl=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebMsgCollection").MsgCollection.hydrateOrGetMessages([a]));a=a[0];return d("WAWebMsgReactionsBridge").sendQueryReactions(a)});return function(b){return a.apply(this,arguments)}}(),c)||babelHelpers.assertThisInitialized(e)}var f=e.prototype;f.findAddressingModeInsensitive=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e=(yield this.find(a,b));if(e!=null)return e;e=d("WAWebLidMigrationUtils").getAlternateMsgKey(c("WAWebMsgKey").fromString(String(a)));if(e!=null)return this.find(e,b)});function e(b,c){return a.apply(this,arguments)}return e}();f.getAddressingModeInsensitive=function(a){var b;return(b=this.get(a))!=null?b:this._getByAltId(a)};f._getByAltId=function(b){b=b instanceof c("WAWebMsgKey")?b:c("WAWebMsgKey").from(String(b));b=d("WAWebLidMigrationUtils").getAlternateMsgKey(b);if(b!=null)return a.prototype.get.call(this,b)};f.addOrUpdateReaction=function(a){if(a.reactionText===d("WAWebReactionsBEUtils").REVOKED_REACTION_TEXT)return this.removeReaction(a);var b=this.getAddressingModeInsensitive(a.parentMsgKey);if(b){var c=this.getAggregateEmojiAndSender(b,a.senderUserJid),e=c.reactionSenderModel;c=c.reactionAggregateWithSender;if(c&&e){if(e.id.toString()===a.msgKey&&e.ack!==a.ack){e.ack=a.ack;e.isSendFailure===!0&&a.ack!=null&&a.ack>=d("WAWebAck").ACK.SENT&&(e.isSendFailure=!1,e.trigger("change:isSendFailure"));e.trigger("change:ack");return}else if(a.timestamp>e.timestamp){d("WALogger").DEV(o());d("WAWebUserPrefsMeUser").isSerializedWidMe(a.senderUserJid)&&(e.trigger("revoked"),c.set({hasReactionByMe:!1}));this._addNewReactionToAggregate(a,b);c.aggregateEmoji===d("WAWebEmoji").EmojiUtil.getEmojiAggregate(a.reactionText)?(c.senders.remove(e.id),b.reactions.trigger("change:senders")):this._removeAggregateEmojiAndSender(b,e,c);return}d("WALogger").DEV(n());return}this._addNewReactionToAggregate(a,b)}else d("WALogger").DEV(m())};f.removeReaction=function(a){if(d("WAWebUserPrefsMeUser").isSerializedWidMe(a.senderUserJid))return this._removeSelfReaction(a);var b=this.get(a.parentMsgKey);if(b){a=this.getAggregateEmojiAndSender(b,a.senderUserJid);var c=a.reactionAggregateWithSender;a=a.reactionSenderModel;c&&a&&(this._removeAggregateEmojiAndSender(b,a,c),a.trigger("revoked"),d("WALogger").DEV(l()))}else d("WALogger").WARN(k())};f._addNewReactionToAggregate=function(a,b){var e=d("WAWebEmoji").EmojiUtil.getEmojiAggregate(a.reactionText),f=b.reactions.get(e),g=c("WAWebMsgKey").fromString(a.msgKey);g=babelHelpers["extends"]({},a,{id:g});var h=d("WAWebUserPrefsMeUser").isSerializedWidMe(a.senderUserJid);f?(h&&(f.set({hasReactionByMe:!0}),b.set({reactionByMe:a})),f.senders.add(g),b.reactions.sort(),f.trigger("change:senders")):(h&&b.set({reactionByMe:a}),b.reactions.add({aggregateEmoji:e,hasReactionByMe:h,id:e,senders:[g]}))};f._removeAggregateEmojiAndSender=function(a,b,c){c.senders.remove(b.id),c.senders.length===0?a.reactions.remove(c.id):a.reactions.sort(),c.trigger("change:senders")};f.getAggregateEmojiAndSender=function(a,b){var c=null,e=null,f=d("WAWebApiContact").getAlternateUserWid(d("WAWebWidFactory").createUserWid(b));for(var g=0;g<a.reactions.length;g++){var h=a.reactions.at(g),i=h==null?void 0:h.senders.findFirst(function(a){return a.senderUserJid===b||f!=null&&a.senderUserJid===f.toString()});if(i){c=i;e=h;break}}return{reactionSenderModel:c,reactionAggregateWithSender:e}};f._removeSelfReaction=function(a){var b=this.get(a.parentMsgKey);b==null?void 0:b.set({reactionByMe:null});if(b){a=this.getAggregateEmojiAndSender(b,a.senderUserJid);var c=a.reactionAggregateWithSender;a=a.reactionSenderModel;c==null?void 0:c.set({hasReactionByMe:!1});c&&a&&(this._removeAggregateEmojiAndSender(b,a,c),a.trigger("revoked"))}};f.markReactionsAsRead=function(a){for(a of this._getSendersByMsgKeys(a))a.read=!0};f._getSendersByMsgKeys=function(a){if(a.length===0)return[];a=new Set(a);var b=[];for(var c of this.toArray())for(var e of c.reactions.toArray())for(var f of a){var g=e.senders.get(f);if(g!=null){b.push(g);a["delete"](f);if(a.size===0)return b}}d("WALogger").WARN(j());return b};f.getSenderByMsgKey=function(a){for(var b of this.toArray())for(var c of b.reactions.toArray()){var d=c.senders.get(a);if(d!=null)return d}};f.getExistingSenderModelFromReactionDetails=function(a){var b=a.parentMsgKey,c=a.msgKey;a=a.reactionText;a=d("WAWebEmoji").EmojiUtil.getEmojiAggregate(a);b=this.get(b);if(b){b=b.reactions.get(a);a=b==null?void 0:b.senders.get(c);return a}d("WALogger").WARN(i());return};f.shouldUpdateAck=function(a,b){a=this.getExistingSenderModelFromReactionDetails(a);if(a){a=a.ack;return d("WATypeUtils").isNumber(b)&&(a===void 0||a==null||b>a||b===d("WAWebAck").ACK.FAILED)?!0:!1}d("WALogger").WARN(h());return!1};f.deleteReactionsByParentMessageKey=function(a){this.remove(a)};return e}(d("WAWebBaseCollection").BaseCollection);a.model=d("WAWebReactionsModels").Reactions;e=new a();g.ReactionsCollection=e}),98); __d("WAWebReactionsModels",["WAWebAck","WAWebAddOnModel","WAWebBaseModel","WAWebCollection","WAWebContactCollection","WAWebMsgCollection","WAWebMsgKey","WAWebReactionsCollection","WAWebUserPrefsMeUser","WAWebWid","WAWebWidFactory","lodash"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.msgKey=d("WAWebBaseModel").prop(),c.parentMsgKey=d("WAWebBaseModel").prop(),c.reactionText=d("WAWebBaseModel").prop(),c.timestamp=d("WAWebBaseModel").prop(),c.senderUserJid=d("WAWebBaseModel").prop(),c.read=d("WAWebBaseModel").prop(),c.orphan=d("WAWebBaseModel").prop(),c.isFailed=d("WAWebBaseModel").derived(function(){if(this.id.remote.isNewsletter())return!1;var a=d("WAWebUserPrefsMeUser").isSerializedWidMe(this.senderUserJid)&&this.ack!=null&&this.ack<d("WAWebAck").ACK.CLOCK;return a||Boolean(this.isSendFailure)},["ack","isSendFailure"]),c.senderObj=d("WAWebBaseModel").session(),c.parentMsg=d("WAWebBaseModel").derived(function(){return this.$ReactionsSendersSkeleton$p_1().assertGet(this.parentMsgKey)}),b)||babelHelpers.assertThisInitialized(c)}var e=b.prototype;e.initialize=function(){a.prototype.initialize.call(this);if(c("WAWebWid").isNewsletter(this.senderUserJid))return;var b=d("WAWebContactCollection").ContactCollection.gadd(d("WAWebWidFactory").createUserWid(this.senderUserJid));this.addChild("senderObj",b)};e.$ReactionsSendersSkeleton$p_1=function(){return d("WAWebMsgCollection").MsgCollection};e.isEqual=function(a){return this.id.equals(a.id)};return b}(d("WAWebAddOnModel").AddOnBaseModel);a.Proxy="reactionsSenders";a.idClass=c("WAWebMsgKey");e=(b=d("WAWebBaseModel")).defineModel(a);var h=function(b){babelHelpers.inheritsLoose(a,b);function a(){return b.apply(this,arguments)||this}return a}(c("WAWebCollection"));h.model=e;h.comparator=function(a,b){if(d("WAWebUserPrefsMeUser").isSerializedWidMe(a.senderUserJid))return-1;else if(d("WAWebUserPrefsMeUser").isSerializedWidMe(b.senderUserJid))return 1;return b.timestamp-a.timestamp};f=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.aggregateEmoji=d("WAWebBaseModel").prop(),c.hasReactionByMe=d("WAWebBaseModel").prop(),c.senders=d("WAWebBaseModel").collection(h),b)||babelHelpers.assertThisInitialized(c)}return b}(b.BaseModel);f.Proxy="aggReactions";a=b.defineModel(f);var i=function(b){babelHelpers.inheritsLoose(a,b);function a(){return b.apply(this,arguments)||this}return a}(c("WAWebCollection"));i.model=a;i.comparator=function(a,b){var c=b.senders.length-a.senders.length;if(a.hasReactionByMe)return-1;else if(b.hasReactionByMe)return 1;if(c===0){b=b.senders.at(0);a=a.senders.at(0);if(b&&a)return b.timestamp-a.timestamp}return c};f=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.reactionByMe=d("WAWebBaseModel").prop(),c.reactions=d("WAWebBaseModel").collection(i),b)||babelHelpers.assertThisInitialized(c)}var e=b.prototype;e.unreadSenders=function(){return c("lodash").flatMap(this.reactions.toArray(),function(a){return a.senders.toArray()}).filter(function(a){return!a.read&&!d("WAWebUserPrefsMeUser").isSerializedWidMe(a.senderUserJid)})};e.getReactionSenderModel=function(a,b){a=this.reactions.get(a);a=a==null?void 0:a.senders.findFirst(function(a){return a.senderUserJid===b});return a};e.getCollection=function(){return d("WAWebReactionsCollection").ReactionsCollection};return b}(b.BaseModel);f.Proxy="reactions";f.idClass=c("WAWebMsgKey");f=b.defineModel(f);var j=function(b){babelHelpers.inheritsLoose(a,b);function a(){var a,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(a=c=b.call.apply(b,[this].concat(f))||this,c.msgKey=d("WAWebBaseModel").prop(),c.parentMsgKey=d("WAWebBaseModel").prop(),c.reactionText=d("WAWebBaseModel").prop(),c.timestamp=d("WAWebBaseModel").prop(),c.senderUserJid=d("WAWebBaseModel").prop(),c.read=d("WAWebBaseModel").prop(),c.orphan=d("WAWebBaseModel").prop(),c.id=d("WAWebBaseModel").prop(),c.aggregatedEmoji=d("WAWebBaseModel").prop(),c.isFailed=d("WAWebBaseModel").derived(function(){var a=d("WAWebUserPrefsMeUser").isMeAccount(d("WAWebWidFactory").createUserWid(this.senderUserJid))&&this.ack!=null&&this.ack<d("WAWebAck").ACK.CLOCK;return a||Boolean(this.isSendFailure)},["sender","ack","isSendFailure"]),c.senderObj=d("WAWebBaseModel").session(),a)||babelHelpers.assertThisInitialized(c)}var e=a.prototype;e.isEqual=function(a){return this.id.equals(a.id)};e.initialize=function(){b.prototype.initialize.call(this);if(c("WAWebWid").isNewsletter(this.senderUserJid))return;d("WAWebContactCollection").ContactCollection.gadd(d("WAWebWidFactory").createUserWid(this.senderUserJid))};return a}(d("WAWebAddOnModel").AddOnBaseModel);b=b.defineModel(j);g.ReactionsSenders=e;g.ReactionsSendersCollection=h;g.AggReactions=a;g.AggReactionsCollection=i;g.Reactions=f;g.FlattenedReaction=b}),98); __d("WAWebRecentReactionModel",["WAWebBaseModel"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.reactionText=d("WAWebBaseModel").prop(),c.timestamp=d("WAWebBaseModel").prop(),b)||babelHelpers.assertThisInitialized(c)}return b}(d("WAWebBaseModel").BaseModel);a.Proxy="recentReaction";b=d("WAWebBaseModel").defineModel(a);g["default"]=b}),98); __d("WAWebRecentReactionsCollection",["Promise","WAWebBaseCachePolicy","WAWebBaseCollection","WAWebRecentReactionModel","WAWebUserPrefsKeys","lodash"],(function(a,b,c,d,e,f,g){var h,i=16,j=100;a=function(a){babelHelpers.inheritsLoose(d,a);function d(){var d;d=a.call(this)||this;d.findImpl=function(a){return(h||(h=b("Promise"))).resolve({id:a})};d.listenTo(babelHelpers.assertThisInitialized(d),"add",c("lodash").debounce(d._sortTrim,j));return d}var e=d.prototype;e._sortTrim=function(){var a=this.length;if(!a)return;this.sort();a>i&&this.remove(this.slice(i))};return d}(d("WAWebBaseCollection").BaseCollection);a.model=c("WAWebRecentReactionModel");a.cachePolicy={id:d("WAWebUserPrefsKeys").COLLECTIONS_KEYS.RECENT_REACTIONS_COLLECTION,policy:d("WAWebBaseCachePolicy").CACHE_POLICY.LOAD,delay:2e3};a.comparator=function(a,b){return b.timestamp-a.timestamp};e=new a();g.RECENT_REACTIONS_LIMIT=i;g.LISTENER_DEBOUNCE_WAIT=j;g.RecentReactionsCollection=e}),98); __d("WAWebApiStatus",["WAJids","WALogger","WATimeUtils","WAWebAck","WAWebDBMessageSerialization","WAWebDBMessageStoreUtils","WAWebDBMessageUtils","WAWebDbEncryptionKey","WAWebMsgType","WAWebSchemaMessage","WAWebWidFactory","lodash"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Message id: ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Author is null for status v3 message"]);i=function(){return a};return a}function a(){var a=d("WAWebWidFactory").createWid(d("WAJids").STATUS_JID);return d("WAWebDbEncryptionKey").DbEncKeyStore.waitForFinalDbMsgEncKey().then(function(){return d("WAWebDBMessageStoreUtils").queryChatMessageHelper(d("WAWebDBMessageUtils").beginningOfChat(a),d("WAWebDBMessageUtils").endOfChat(a),{lowerInclusive:!1,upperInclusive:!1}).then(function(a){var b=[],e=[];a.forEach(function(a){!a.author?(d("WALogger").WARN(i()),d("WALogger").DEV(h(),a.id)):d("WATimeUtils").happenedWithin(d("WATimeUtils").castToUnixTime(a.t),d("WATimeUtils").DAY_SECONDS)&&a.type!==d("WAWebMsgType").MSG_TYPE.REVOKED?a.type!==d("WAWebMsgType").MSG_TYPE.PROTOCOL&&e.push(d("WAWebDBMessageSerialization").messageFromDbRow(a)):b.push(a.id)});d("WAWebSchemaMessage").getMessageTable().bulkRemove(b);a=c("lodash").groupBy(e,function(a){return a.author.toString()});var f=[];for(var g in a){var j=a[g],k=j.filter(function(a){return a.ack<d("WAWebAck").ACK.READ}).length,l=j[j.length-1].t;f.push({id:d("WAWebWidFactory").createWid(g),unreadCount:k,totalCount:j.length,t:l,_msgs:j})}return f})})}g.getAllStatuses=a}),98); __d("WAWebDeleteStatusAction",["WALogger","WAWebContactGetters","WAWebDBMessageDelete","WAWebStatusCollection","WAWebUserPrefsMeUser"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["clearStatusForNonAddressBook: remove "," status "]);h=function(){return a};return a}function a(){var a=d("WAWebStatusCollection").StatusCollection.filter(function(a){return!d("WAWebUserPrefsMeUser").isMeAccount(a.contact.id)&&!d("WAWebContactGetters").getIsMyContact(a.contact)&&!d("WAWebContactGetters").getIsPSA(a.contact)});a=a.reduce(function(a,b){a=a.concat(b.msgs.map(function(a){return String(a.id)}));b["delete"]();return a},[]);d("WALogger").LOG(h(),a.length);return d("WAWebDBMessageDelete").removeStatusMessage(a)}g.clearStatusForRemovedContact=a}),98); __d("WAWebPostSendStatusFailure",["WAErrors","WALogger","WAWebBackendErrors","WAWebHandleMsgError","WAWebSendMsgResultAction","WAWebWamEnumMessageSendResultType"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[status] failed to send status message"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[status] failed to send status message, get error ack"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[status] failed to send status message, get error ack"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[status] failed to send status message"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[status] failed to send status message"]);l=function(){return a};return a}function a(a,b){if(a instanceof d("WAWebBackendErrors").ServerStatusCodeError){var c;d("WALogger").ERROR(l()).sendLogs("status-send-server-error");(c=b.sendReporter)==null?void 0:c.postFailure({result:d("WAWebWamEnumMessageSendResultType").MESSAGE_SEND_RESULT_TYPE.ERROR_NETWORK,isTerminal:!0});return{messageSendResult:d("WAWebSendMsgResultAction").SendMsgResult.ERROR_NETWORK}}else if(a instanceof d("WAWebHandleMsgError").MessageValidationError){d("WALogger").ERROR(k()).sendLogs("status-send-validation-error");(c=b.sendReporter)==null?void 0:c.postFailure({result:d("WAWebWamEnumMessageSendResultType").MESSAGE_SEND_RESULT_TYPE.ERROR_INVALID_PROTOBUF,isTerminal:!0});return{messageSendResult:d("WAWebSendMsgResultAction").SendMsgResult.ERROR_UNKNOWN}}else if(a instanceof d("WAWebHandleMsgError").MessageSentAckError){d("WALogger").ERROR(j()).sendLogs("status-send-ack-error");(c=b.sendReporter)==null?void 0:c.postFailure({result:d("WAWebWamEnumMessageSendResultType").MESSAGE_SEND_RESULT_TYPE.ERROR_UNKNOWN,isTerminal:!0});return{messageSendResult:d("WAWebSendMsgResultAction").SendMsgResult.ERROR_UNKNOWN}}else if(a instanceof d("WAErrors").BufferTooLargeError){d("WALogger").ERROR(i()).sendLogs("status-send-too-large-error");(c=b.sendReporter)==null?void 0:c.postFailure({result:d("WAWebWamEnumMessageSendResultType").MESSAGE_SEND_RESULT_TYPE.ERROR_PAYLOAD_TOO_BIG,isTerminal:!0});return{messageSendResult:d("WAWebSendMsgResultAction").SendMsgResult.ERROR_UNKNOWN}}d("WALogger").ERROR(h()).sendLogs("status-send-fail");(a=b.sendReporter)==null?void 0:a.postFailure({result:d("WAWebWamEnumMessageSendResultType").MESSAGE_SEND_RESULT_TYPE.ERROR_UNKNOWN,isTerminal:!0});return{messageSendResult:d("WAWebSendMsgResultAction").SendMsgResult.ERROR_UNKNOWN}}g.postStatusSendFailure=a}),98); __d("WAWebSendStatusMsgAction",["invariant","WAJids","WALogger","WATimeUtils","WAWebAck","WAWebDBProcessMessage","WAWebEncryptAndSendStatusMsg","WAWebMessageSendPerfReporter","WAWebMessagingGatingUtils","WAWebMsgKey","WAWebMsgModel","WAWebMsgType","WAWebOutgoingMessage","WAWebPostSendStatusFailure","WAWebSendMsgMetricReporter","WAWebSendMsgResultAction","WAWebSendMsgTypes","WAWebStatusCollection","WAWebStatusGatingUtils","WAWebUserPrefsMeUser","WAWebViewMode.flow","WAWebWamEnumMessageSendResultType","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g,h){function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["_sendStatusMessage: failed with ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["_sendStatusMessage: done"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["_sendStatusMessage: generate protobuf"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["_sendStatusMessage: send status messege ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["sendStatusMediaMsgAction: media prep done for status messege"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["[status] failed to send status message with ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["sendStatusMediaMsgAction: store media messege"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["sendStatusMediaMsgAction: start to send status messege"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["sendStatusTextMsgAction: store text messege"]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["sendStatusTextMsgAction: start to send text messege"]);r=function(){return a};return a}var s=4286237861;function a(a){return t.apply(this,arguments)}function t(){t=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b;d("WALogger").LOG(r());a=(yield x(a));a!=null||h(0,73062);var c=new(d("WAWebMsgModel").Msg)(a);c.wamMessageSendPerfReporter=new(d("WAWebMessageSendPerfReporter").MessageSendPerfReporter)({chatWid:c.to,mediaType:c.getWamMediaType(),messageType:c.getWamMessageType()});var e=d("WAWebSendMsgMetricReporter").createMsgModelMetricReporter(c);e.sendReporter=(b=e.sendReporter)!=null?b:e.createSendReporter();(b=e.sendPerfReporter)==null?void 0:b.startRenderedStage();yield d("WAWebStatusCollection").StatusCollection.addStatusMessages(c.author,[c]);d("WAWebStatusCollection").StatusCollection.handleUpdate(a,null,!1);(b=e.sendPerfReporter)==null?void 0:b.postRenderedStage();(b=e.sendPerfReporter)==null?void 0:b.startSavedStage();yield d("WAWebDBProcessMessage").storeMessages([a],c.to);d("WALogger").LOG(q());(b=e.sendPerfReporter)==null?void 0:b.postSavedStage();return v(c,a,e)});return t.apply(this,arguments)}function e(a,b){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c;d("WALogger").LOG(p());a=babelHelpers["extends"]({},a,{author:d("WAWebUserPrefsMeUser").getMeUser(),cannotBeRanked:d("WAWebStatusGatingUtils").canCheckStatusRankingPosterGating()});var e=new(d("WAWebMsgModel").Msg)(a);e.wamMessageSendPerfReporter=new(d("WAWebMessageSendPerfReporter").MessageSendPerfReporter)({chatWid:e.to,mediaType:e.getWamMediaType(),messageType:e.getWamMessageType()});var f=d("WAWebSendMsgMetricReporter").createMsgModelMetricReporter(e);f.sendReporter=(c=f.sendReporter)!=null?c:f.createSendReporter();(c=f.sendPerfReporter)==null?void 0:c.startRenderedStage();yield d("WAWebStatusCollection").StatusCollection.addStatusMessages(e.author,[e]);d("WAWebStatusCollection").StatusCollection.handleUpdate(a,null,!1);(c=f.sendPerfReporter)==null?void 0:c.postRenderedStage();(c=f.sendPerfReporter)==null?void 0:c.startSavedStage();yield d("WAWebDBProcessMessage").storeMessages([a],e.to);d("WALogger").LOG(o());(c=f.sendPerfReporter)==null?void 0:c.postSavedStage();(c=f.sendPerfReporter)==null?void 0:c.startReadyToSendStage();yield e.waitForPrep();try{yield b(e)}catch(a){d("WALogger").ERROR(n(),a).sendLogs("status-send-media-error");(c=f.sendReporter)==null?void 0:c.postFailure({result:d("WAWebWamEnumMessageSendResultType").MESSAGE_SEND_RESULT_TYPE.ERROR_UPLOAD,isTerminal:!0});return{messageSendResult:d("WAWebSendMsgResultAction").SendMsgResult.ERROR_UPLOAD}}(b=f.sendPerfReporter)==null?void 0:b.postReadyToSendStage();d("WALogger").LOG(m()).devConsole(a);return v(e,a,f)});return u.apply(this,arguments)}function v(a,b,c){return w.apply(this,arguments)}function w(){w=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){d("WALogger").LOG(l(),a.id).devConsole(b);b={type:d("WAWebSendMsgTypes").SendMessageRecordType.Message,data:a};var e=d("WAWebOutgoingMessage").createOutgoingMessageProtobuf(d("WAWebOutgoingMessage").OutgoingMessageOriginType.Status,b);d("WALogger").LOG(k()).devConsole(e);try{yield d("WAWebEncryptAndSendStatusMsg").encryptAndSendStatusMsg(b,e,c);(b=c.sendReporter)==null?void 0:b.postSuccess();a.updateAck(d("WAWebAck").ACK.SENT);d("WALogger").LOG(j());return{messageSendResult:d("WAWebSendMsgResultAction").SendMsgResult.OK}}catch(b){a.updateAck(d("WAWebAck").ACK.FAILED);d("WALogger").LOG(i(),b);return d("WAWebPostSendStatusFailure").postStatusSendFailure(b,c)}});return w.apply(this,arguments)}function x(a){return y.apply(this,arguments)}function y(){y=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(a.text||"").trim();if(b==="")return null;var e=d("WAWebWidFactory").createWid(d("WAJids").STATUS_JID),f=d("WAWebUserPrefsMeUser").getMeUser(),g=f;g=new(c("WAWebMsgKey"))({from:f,to:e,id:yield c("WAWebMsgKey").newId(),participant:g,selfDir:"out"});g={id:g,body:b,author:f,backgroundColor:(g=a.color)!=null?g:s,type:"chat",kind:d("WAWebMsgType").MsgKind.Chat,viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE,subtype:void 0,t:d("WATimeUtils").unixTime(),from:f,to:e,isNewMsg:!0,local:!0,ack:d("WAWebAck").ACK.CLOCK,font:(b=a.font)!=null?b:void 0,messageSecret:d("WAWebMessagingGatingUtils").isReportingTokenSendingEnabled()?self.crypto.getRandomValues(new Uint8Array(32)):null,cannotBeRanked:d("WAWebStatusGatingUtils").canCheckStatusRankingPosterGating()};return g});return y.apply(this,arguments)}g.sendStatusTextMsgAction=a;g.sendStatusMediaMsgAction=e}),98); __d("WAWebStatusGetters",["WALogger","WAWebGetters","WAWebGettersCaches"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Bad status read count, ",", ",""]);h=function(){return a};return a}a=d("WAWebGetters").createGetterFactories({createCache:d("WAWebGettersCaches").createStatusCache});b=a.field;c=a.computed;e=a.unsafeIdentityGetter;f=a.clearCacheFor;a=f;f=e;e=b("id");var i=b("t"),j=b("unreadCount");b=b("totalCount");var k=c(function(a){a=a[0];return a>0},[j]);c=c(function(a){var b=a[0];a=a[1];var c=a-b;if(Number.isFinite(c))return c;d("WALogger").WARN(h(),a,b);return 0},[j,b]);g.clearStatusGetterCacheFor=a;g.getStatusUnsafe=f;g.getId=e;g.getT=i;g.getUnreadCount=j;g.getTotalCount=b;g.getHasUnread=k;g.getReadCount=c}),98); __d("WAWebWebcStatusSessionWamEvent",["WAWebWamCodegenUtils"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({WebcStatusSession:[1880,{webcStatusMutedItemCount:[4,a.TYPES.INTEGER],webcStatusMutedRowCount:[7,a.TYPES.INTEGER],webcStatusRecentItemCount:[2,a.TYPES.INTEGER],webcStatusRecentRowCount:[5,a.TYPES.INTEGER],webcStatusSessionId:[1,a.TYPES.INTEGER],webcStatusViewedItemCount:[3,a.TYPES.INTEGER],webcStatusViewedRowCount:[6,a.TYPES.INTEGER]},[1,1,1],"regular"]},{WebcStatusSession:[]});g.WebcStatusSessionWamEvent=b}),98); __d("WAWebWebcStatusSyncWamEvent",["WAWebWamCodegenUtils"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({WebcStatusSync:[1878,{webcStatusMutedItemCount:[4,a.TYPES.INTEGER],webcStatusMutedRowCount:[7,a.TYPES.INTEGER],webcStatusRecentItemCount:[2,a.TYPES.INTEGER],webcStatusRecentRowCount:[5,a.TYPES.INTEGER],webcStatusSyncT:[1,a.TYPES.TIMER],webcStatusViewedItemCount:[3,a.TYPES.INTEGER],webcStatusViewedRowCount:[6,a.TYPES.INTEGER]},[1,1,1],"regular"]},{WebcStatusSync:[]});g.WebcStatusSyncWamEvent=b}),98); __d("WAWebStatusCollection",["Promise","WAJids","WALogger","WATimeUtils","WAWebABProps","WAWebApiContact","WAWebBaseCollection","WAWebContactGetters","WAWebContactStatusBridge","WAWebLidMigrationUtils","WAWebMediaOpaqueData","WAWebMsgCollection","WAWebStatusGetters","WAWebStatusModel","WAWebUserPrefsMeUser","WAWebWebcStatusSessionWamEvent","WAWebWebcStatusSyncWamEvent","WAWebWidFactory","asyncToGeneratorRuntime","isStringNullOrEmpty","sumOfArray"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[StatusCollection] failed to create from base64 jpeg"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Total count: ",", msgs length: ",""]);j=function(){return a};return a}var k=3600*24;a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var c,e;for(var f=arguments.length,g=new Array(f),i=0;i<f;i++)g[i]=arguments[i];return(c=e=a.call.apply(a,[this].concat(g))||this,e.findImpl=function(a){return(h||(h=b("Promise"))).resolve({id:a})},e.findQueryImpl=function(){return d("WAWebContactStatusBridge").queryStatusAll()},c)||babelHelpers.assertThisInitialized(e)}var f=e.prototype;f.findQuery=function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(c,d){var e=this;c=(yield a.prototype.findQuery.call(this,c,d));d=c||[];yield (h||(h=b("Promise"))).all(d.map(function(a){if(!a)return;var c=0;a.msgs.forEach(function(b){c<a._msgs.length&&a._msgs[c].id.toString()===b.id.toString()?++c:b["delete"]()});return a._msgs.length>0?e.addStatusMessages(a.id,a._msgs):(h||(h=b("Promise"))).resolve()}));return d});function d(a,b){return c.apply(this,arguments)}return d}();f.sync=function(a){var b=this,c=window.performance.now();return this.findQuery({},{set:this.hasSynced()})["finally"](function(){b.trigger("sync")}).then(function(a){var e=window.performance.now();e=Math.round(e-c);b.logMetrics({type:"sync",syncTime:e});b.forEach(function(a){a.msgs.length>a.totalCount&&d("WALogger").LOG(j(),a.totalCount,a.msgs.length)});return a})};f.logMetrics=function(a){var b;a.type==="sync"?b=new(d("WAWebWebcStatusSyncWamEvent").WebcStatusSyncWamEvent)({webcStatusSyncT:a.syncTime}):b=new(d("WAWebWebcStatusSessionWamEvent").WebcStatusSessionWamEvent)({webcStatusSessionId:a.sessionId});a=this.filter(function(a){return!d("WAWebContactGetters").getIsMe(a.contact)});var e=a.filter(function(a){return!a.contact.statusMute}),f=e.filter(function(a){return d("WAWebStatusGetters").getHasUnread(a)}),g=e.filter(function(a){return!d("WAWebStatusGetters").getHasUnread(a)});a=a.filter(function(a){return a.contact.statusMute});var h=c("sumOfArray")(e.map(function(a){return a.unreadCount}));e=c("sumOfArray")(e.map(function(a){return d("WAWebStatusGetters").getReadCount(a)}));var i=c("sumOfArray")(a.map(function(a){return a.totalCount}));b.webcStatusRecentItemCount=h;b.webcStatusRecentRowCount=f.length;b.webcStatusViewedItemCount=e;b.webcStatusViewedRowCount=g.length;b.webcStatusMutedItemCount=i;b.webcStatusMutedRowCount=a.length;b.commit()};f.hasSynced=function(){return!0};f.getStatusModel=function(a,b){var c=this.get(a);if(c==null&&b){b=a!=null?d("WAWebApiContact").getAlternateUserWid(d("WAWebWidFactory").toUserWid(a)):null;c=b!=null?this.get(b):null}return c};f.handleUpdate=function(a,b,e){b=a.id.fromMe?d("WAWebUserPrefsMeUser").getMeUser():a.author;if(this.hasSynced()){if(e)return!0;e=a.subtype==="sender_revoke";var f=b?this.getStatusModel(b,e):null;if(f){var g=f.totalCount===f.msgs.length;if(e){var h=a.protocolMessageKey,j=h!=null?d("WAWebLidMigrationUtils").getAlternateMsgKey(h):null,k=!1;h!=null&&(k=f.containsMessage(h)||f.containsMessage(j));if(k!==!0)return!0;k=h==null?void 0:h.toString();h=j==null?void 0:j.toString();j={totalCount:f.totalCount-1};((f==null?void 0:f.isUnreadMessage(k))||(f==null?void 0:f.isUnreadMessage(h)))&&(j.unreadCount=f.unreadCount-1);f.set(j)}else{k={totalCount:f.totalCount+1,t:a.t};a.invis!==!0&&(k.unreadCount=f.unreadCount+1);f.set(k)}!g&&!c("isStringNullOrEmpty")(a.body)&&c("WAWebMediaOpaqueData").createFromBase64Jpeg(a.body).then(function(a){f.pic=a})["catch"](function(){d("WALogger").ERROR(i()).sendLogs("failed-to-create-from-base64-jpeg")});return g}if(e)return!0;if(b){h={id:b,t:a.t,unreadCount:a.invis===!0?0:1,totalCount:1};this.add(h)}return!0}return!1};f.addStatusMessages=function(a,b){return d("WAWebMsgCollection").MsgCollection.processMultipleMessages(d("WAWebWidFactory").createWid(d("WAJids").STATUS_JID),b,{add:"after",isHistory:!0},"addStatusMessages")};f.getUnexpired=function(a){var b=!1;b=d("WAWebABProps").getABPropConfigValue("web_status_psa");var c=this.filter(function(a){if(a.totalCount<=0)return!1;if(a.isExpired())return!1;if(d("WAWebContactGetters").getIsMe(a.contact))return!1;if(d("WAWebContactGetters").getIsMyContact(a.contact))return!0;return d("WAWebContactGetters").getIsPSA(a.contact)?b:!1});b&&c.sort(function(a,b){return d("WAWebContactGetters").getIsPSA(a.contact)===d("WAWebContactGetters").getIsPSA(b.contact)?0:d("WAWebContactGetters").getIsPSA(a.contact)?-1:1});if(a){a=c.filter(function(a){return a.unreadCount>0});return a}a=c.filter(function(a){return a.unreadCount===0});return a};f.getMyStatus=function(){var a=this.filter(function(a){return d("WAWebContactGetters").getIsMe(a.contact)});if(a.length===0)return;else if(d("WATimeUtils").unixTime()-a[0].t>k)return;return a[0]};f.getPSAStatus=function(){var a=this.filter(function(a){return d("WAWebContactGetters").getIsPSA(a.contact)});if(a.length===0)return;return a[0]};return e}(d("WAWebBaseCollection").BaseCollection);a.model=c("WAWebStatusModel");a.comparator=function(a,b){return b.t-a.t};e=new a();g.StatusCollection=e}),98); __d("WAWebFrontendStatusGetters",["WAWebGetters","WAWebGettersCaches","WAWebStatusGetters"],(function(a,b,c,d,e,f,g){a=d("WAWebGetters").createGetterFactories({root:d("WAWebStatusGetters").getStatusUnsafe,createCache:d("WAWebGettersCaches").createFrontendStatusCache});b=a.field;c=a.computed;e=a.clearCacheFor;f=e;d=b("msgs");a=b("msgsChanged");e=b("contact");b=c(function(a){a[0];a=a[1];return a.last()},[a,d]);g.clearFrontendStatusGetterCacheFor=f;g.getContact=e;g.getLastStatus=b}),98); __d("WAWebStatusPSAUtils",["WATimeUtils"],(function(a,b,c,d,e,f,g){function a(a,b){if(b.length===0)return-1;var c=0,d=b[0].campaignId;for(var e=1;e<b.length;e++){var f=b[e],g=f.id;f=f.campaignId;d!==f?(d=f,c=0):c++;if(g.toString()===a.toString())return c}return-1}function b(a){var b=h(a),c=[];Object.keys(b).forEach(function(a){var d=b[a],e=d.numberOfStatus;d=d.numberOfReadStatus;e=e-d;c.push(a+":"+e)});return c.join(",")}function h(a){var b={};a.forEach(function(a){var c=a.t,d=a.campaignId,e=a.campaignDuration;a=a.statusPSAReadTimestamp;if(!d)return;b[d]||(b[d]={id:d,t:c,duration:e,firstReadTimestamp:null,numberOfStatus:0,numberOfReadStatus:0});c=b[d];c.numberOfStatus++;a!=null&&(c.numberOfReadStatus++,(c.firstReadTimestamp==null||a<c.firstReadTimestamp)&&(c.firstReadTimestamp=a))});return b}function i(a,b){var c=a.firstReadTimestamp;if(c!=null)return d("WATimeUtils").unixTime()-c>b;c=a.duration;return c!=null?d("WATimeUtils").unixTime()-a.t>c:!1}function c(a,b){var c=h(a);return Object.keys(c).every(function(a){return i(c[a],b)})}g.getPsaCampaignIndex=a;g.getPsaCampaignsString=b;g.getPSACampaigns=h;g.isCampaignExpired=i;g.isExpiredStatusPSA=c}),98); __d("WAWebStatusModel",["Promise","WALogger","WATimeUtils","WAWebAlarm","WAWebApiContact","WAWebBaseModel","WAWebCollectionConstants","WAWebCommonMsgUtils","WAWebContactCollection","WAWebContactStatusBridge","WAWebFrontendMsgGetters","WAWebFrontendStatusGetters","WAWebMsgGetters","WAWebMsgModelUtils","WAWebNoop","WAWebNotificationBackend","WAWebStatusCollection","WAWebStatusGatingUtils","WAWebStatusGetters","WAWebStatusPSAUtils","WAWebSuperChatMsgs","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime","gkx"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Status onEmptyMRM with total count: ",", noEarlierMsgs: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Status deleted with total count: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["msgs.length:"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["Unread count:"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["Expiring campaignID:"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["msgs.length:"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["Unread count:"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["Expiring message with ID:"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["No phone number found for LID ",""]);q=function(){return a};return a}var r=3600*24,s=1e3;a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.t=d("WAWebBaseModel").prop(),c.unreadCount=d("WAWebBaseModel").prop(0),c.totalCount=d("WAWebBaseModel").prop(0),c.pic=d("WAWebBaseModel").prop(),c._msgs=d("WAWebBaseModel").prop(function(){return[]}),c.readKeys=d("WAWebBaseModel").session(function(){return{}}),c.contact=d("WAWebBaseModel").session(),c.expireTimer=d("WAWebBaseModel").session(),c.expireTs=d("WAWebBaseModel").session(),b)||babelHelpers.assertThisInitialized(c)}var f=e.prototype;f.initialize=function(){var b=this;a.prototype.initialize.call(this);if(this.id.isLid()){var c=d("WAWebApiContact").getPhoneNumber(d("WAWebWidFactory").toUserWid(this.id));c?this.addChild("contact",d("WAWebContactCollection").ContactCollection.gadd(c)):d("WALogger").WARN(q(),this.id)}else this.addChild("contact",d("WAWebContactCollection").ContactCollection.gadd(this.id));this.listenTo(this.msgs,"add bulk_add",function(){self.setTimeout(function(){b.setupStatusExpiration()})});this.listenTo(this,"change:msgsChanged",function(){var a=d("WAWebFrontendStatusGetters").getLastStatus(b);a&&(b.t=a.t)});this.listenTo(this.msgs,"add",function(a){d("WAWebStatusGatingUtils").isStatusPrivateMentionsReceiveEnabled()&&!d("WAWebMsgGetters").getIsSentByMe(a)&&Boolean(d("WAWebMsgGetters").getStatusMentioned(a))&&[d("WAWebCommonMsgUtils").EventType.DEFAULT,d("WAWebCommonMsgUtils").EventType.AMBIENT].includes(d("WAWebFrontendMsgGetters").getEventType(a))&&void d("WAWebNotificationBackend").showStatusNotification(a)})};f.isExpired=function(){return this.id.isPSA()?d("WAWebStatusPSAUtils").isExpiredStatusPSA(this.msgs.toArray(),r):d("WATimeUtils").unixTime()-this.t>r};f.setupStatusExpiration=function(){var a=this,b=this.msgs.at(0);if(!b)return;if(typeof this.expireTs==="number"&&this.expireTs<=b.t)return;var e=1;e=b.t+r+e;e<d("WATimeUtils").unixTime()?self.setTimeout(function(){a.expireMsg()}):(this.expireTimer=c("WAWebAlarm").setGlobalTimeout(this.expireMsg.bind(this),e*s,this.expireTimer),this.expireTs=b.t)};f._removeSingleMsg=function(a){var b=this.msgs;this.unreadCount>this.totalCount-1&&this.unreadCount--;this.totalCount--;b.remove(a);a["delete"]()};f.expireMsg=function(){if(this.id.isPSA()){this.expirePSAMsg();return}var a=this.msgs;while(a.length>0){var b=a.at(0);if(!b)break;var e=b.t+r>d("WATimeUtils").unixTime();if(e)break;c("gkx")("26258")||(d("WALogger").DEV(p()).devConsole(b.id,"msg timestamp:",b.t,"global unix time:",d("WATimeUtils").unixTime()),d("WALogger").DEV(o()).devConsole(this.unreadCount,"total count:",this.totalCount),d("WALogger").DEV(n()).devConsole(a.length));this._removeSingleMsg(b)}this.expireTs=void 0;this.expireTimer=void 0;this.totalCount!==0&&this.setupStatusExpiration()};f.expirePSAMsg=function(){var a=this,b=d("WAWebStatusPSAUtils").getPSACampaigns(this.msgs.toArray());this.msgs.forEach(function(e){var f=e.campaignId;if(f==null)return;f=d("WAWebStatusPSAUtils").isCampaignExpired(b[f],r);if(!f)return;c("gkx")("26258")||(d("WALogger").DEV(m()).devConsole(e.campaignId,"campaignDuration:",e.campaignDuration,"- msg with ID:",e.id,"msg timestamp:",e.t,"global unix time:",d("WATimeUtils").unixTime()),d("WALogger").DEV(l()).devConsole(a.unreadCount,"total count:",a.totalCount),d("WALogger").DEV(k()).devConsole(a.msgs.length));a._removeSingleMsg(e)});this.expireTs=void 0;this.expireTimer=void 0;this.totalCount!==0&&this.setupStatusExpiration()};f.isUnreadMessage=function(a){if(a==null)return!1;var b=d("WAWebMsgModelUtils").getReadMsgKeys(this.msgs.toArray());b=b.find(function(b){return b===a})==null;return b&&this.readKeys[a]!==!0};f.revokeMsgs=function(a){var b=this,c=new Set(a);a=this.msgs.filter(function(a){return c.has(a.id.toString())});a.forEach(function(a){return b._removeSingleMsg(a)});this.totalCount===0&&(this.expireTs=void 0,this.expireTimer=void 0)};f["delete"]=function(){d("WALogger").LOG(j(),this.totalCount),a.prototype["delete"].call(this),this.expireTimer&&c("WAWebAlarm").clearTimeout(this.expireTimer),this.expireTs!=null&&(this.expireTs=void 0),this.getCollection().remove(this.id),d("WAWebStatusGetters").clearStatusGetterCacheFor(this),d("WAWebFrontendStatusGetters").clearFrontendStatusGetterCacheFor(this)};f.onEmptyMRM=function(){var a=this;d("WALogger").LOG(i(),this.totalCount,this.msgs.msgLoadState.noEarlierMsgs?"true":"false");if(this.msgs.msgLoadState.noEarlierMsgs&&this.totalCount===0){this["delete"]();return}this.totalCount>0&&this.loadMore()["catch"](c("WAWebNoop"))["finally"](function(){a.msgs.length||a["delete"]()})};f.loadMore=function(a){a===void 0&&d("WAWebCollectionConstants").PAGE_SIZE;if(this.msgs.msgLoadState.noEarlierMsgs)return(h||(h=b("Promise"))).resolve();if(this.msgs.msgLoadState.isLoadingEarlierMsgs)return this.msgs.loadEarlierPromise;this.msgs.msgLoadState.noEarlierMsgs=!0;return(h||(h=b("Promise"))).resolve()};f.handleReadStatus=function(a){a=a.toString();this.readKeys[a]||(this.readKeys[a]=!0,this.unreadCount>0&&this.unreadCount--)};f.sendReadStatus=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=(yield d("WAWebContactStatusBridge").sendReadStatus(a,b));b&&this.handleReadStatus(a.id)});function c(b,c){return a.apply(this,arguments)}return c}();f.getCollection=function(){return d("WAWebStatusCollection").StatusCollection};f.containsMessage=function(a){return a==null?!1:this.msgs.toArray().some(function(b){return b.id.toString()===a.toString()})};return e}(c("WAWebSuperChatMsgs"));a.Proxy="status";a.idClass=c("WAWebWid");e=d("WAWebBaseModel").defineModel(a);g["default"]=e}),98); __d("WAWebStatusNotification",["fbt","WANullthrows","WAWebBaseNotification","WAWebContactCollection","WAWebEnvironment","WAWebFrontendContactGetters","WAWebFrontendMsgGetters","WAWebGetNotificationStrings","WAWebMsgGetters","WAWebMuteCollection","WAWebMuteGetters","WAWebNotificationHelpers","WAWebNotificationIconUtils","WAWebNotificationMuteReason","WAWebStatusCollection","WAWebStatusNotificationUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g,h){a=function(a){babelHelpers.inheritsLoose(e,a);function e(b){var e;b=b.msg;e=a.call(this)||this;e.msg=b;e.status=d("WAWebStatusCollection").StatusCollection.getStatusModel(c("WANullthrows")(d("WAWebMsgGetters").getSender(e.msg),"[WAStatusNotification]: status poster cannot be null"),!1);return e}var f=e.prototype;f.shouldMute=function(a){if(d("WAWebMuteGetters").getIsMuted(d("WAWebMuteCollection").MuteCollection.globalMute()))return c("WAWebNotificationMuteReason").GlobalMute;if(d("WAWebNotificationHelpers").appIsActive())return c("WAWebNotificationMuteReason").AppState;if((a=this.status)==null?void 0:a.contact.statusMute)return c("WAWebNotificationMuteReason").MutedStatus;return d("WAWebNotificationHelpers").isOfflineResumeInProgress()&&!c("WAWebEnvironment").isWindows?c("WAWebNotificationMuteReason").OfflineResumeInProgress:null};f.shouldPlaySound=function(){return a.prototype.shouldPlaySound.call(this)};f.getBannerOptions=function(){var a=this,b=h._(/*BTDS*/"__JHASH__139MKaSfb4q__JHASH__").toString(),e=this.status?d("WAWebFrontendContactGetters").getFormattedName(this.status.contact):d("WAWebFrontendContactGetters").getFormattedName(c("WANullthrows")(d("WAWebContactCollection").ContactCollection.get(this.msg.author)));b=d("WAWebGetNotificationStrings").getNotificationBody({body:b,msgDir:d("WAWebFrontendMsgGetters").getDir(this.msg)});var f=function(){d("WAWebStatusNotificationUtils").openStatusViewer(a.msg)};return{wid:this.msg.author,title:c("WANullthrows")(e),body:b,onClick:f}};f.buildKey=function(){return"status-msg:"+this.msg.id.toString()};f.getIcon=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){return d("WAWebNotificationIconUtils").getNotificationIconByWid(c("WANullthrows")(d("WAWebMsgGetters").getSender(this.msg)),this.abortController.signal,d("WAWebNotificationIconUtils").USER_DEFAULT_ICON)});function e(){return a.apply(this,arguments)}return e}();return e}(d("WAWebBaseNotification").WABaseNotification);g.WAStatusNotification=a}),226); __d("WAWebLazyLoadedRetriable",["Promise","WALogger","WANullthrows","WAPromiseDelays","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Lazyload failure for component ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Failed to load a component"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["Loadable error: ",""]);k=function(){return a};return a}function l(a){return function(b,c){d("WALogger").WARN(k(),b.stack);b=c>1?"s":"";c="loadable:"+a+" failed to load after ["+c+"] attempt"+b;d("WALogger").ERROR(j()).sendLogs(c)}}var m=10;function a(a,e){var f=l(e),g="INIT",j,k=0;return function l(){switch(g){case"INIT":case"FAILURE":g="INFLIGHT";j=a().then(function(a){a||f(c("err")("Lazyload response is empty"),k);g="SUCCESS";return a})["catch"](function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){d("WALogger").WARN(i(),e).devConsole(a);g="FAILURE";k++;if(k<=m){yield d("WAPromiseDelays").delayMs(k*1e3);return l()}f(a,k);throw a});return function(b){return a.apply(this,arguments)}}());return j;case"INFLIGHT":case"SUCCESS":return c("WANullthrows")(j);default:g;return(h||(h=b("Promise"))).reject(c("err")("retriable_promise_hoc:promiseStatus is invalid"))}}}g["default"]=a}),98); /** * License: https://www.facebook.com/legal/license/l6Md91cKJ3N/ */ __d("react-loadable-5.5.0",["Promise","prop-types","react"],(function(a,b,c,d,e,f){"use strict";var g,h,i=typeof Symbol==="function"&&typeof (typeof Symbol==="function"?Symbol.iterator:"@@iterator")==="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol==="function"&&a.constructor===Symbol&&a!==(typeof Symbol==="function"?Symbol.prototype:"@@prototype")?"symbol":typeof a};function j(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function k(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b==="object"||typeof b==="function")?b:a}function l(a,b){if(typeof b!=="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}var m=g||b("react"),n=[],o=[];function p(a){return(typeof __webpack_modules__==="undefined"?"undefined":i(__webpack_modules__))!=="object"?!1:a().every(function(a){return typeof a!=="undefined"&&typeof __webpack_modules__[a]!=="undefined"})}function q(a){a=a();var b={loading:!0,loaded:null,error:null};b.promise=a.then(function(a){b.loading=!1;b.loaded=a;return a})["catch"](function(a){b.loading=!1;b.error=a;throw a});return b}function r(a){var c={loading:!1,loaded:{},error:null},d=[];try{Object.keys(a).forEach(function(b){var e=q(a[b]);!e.loading?(c.loaded[b]=e.loaded,c.error=e.error):c.loading=!0;d.push(e.promise);e.promise.then(function(a){c.loaded[b]=a})["catch"](function(a){c.error=a})})}catch(a){c.error=a}c.promise=(h||(h=b("Promise"))).all(d).then(function(a){c.loading=!1;return a})["catch"](function(a){c.loading=!1;throw a});return c}function s(a){return a&&a.__esModule?a["default"]:a}function t(a,b){return m.createElement(s(a),b)}function u(a,c){var d;if(!c.loading)throw new Error("react-loadable requires a `loading` component");var e=Object.assign({loader:null,loading:null,delay:200,timeout:null,render:t,webpack:null,modules:null},c),f=null;function g(){f||(f=a(e.loader));return f.promise}n.push(g);typeof e.webpack==="function"&&o.push(function(){if(p(e.webpack))return g()});return d=c=function(b){l(c,b);function c(d){j(this,c);var h=k(this,b.call(this,d));h.retry=function(){h.setState({error:null,loading:!0,timedOut:!1}),f=a(e.loader),h._loadModule()};g();h.state={error:f.error,pastDelay:!1,timedOut:!1,loading:f.loading,loaded:f.loaded};return h}c.preload=function(){return g()};c.prototype.componentWillMount=function(){this._mounted=!0,this._loadModule()};c.prototype._loadModule=function(){var a=this;this.context.loadable&&Array.isArray(e.modules)&&e.modules.forEach(function(b){a.context.loadable.report(b)});if(!f.loading)return;typeof e.delay==="number"&&(e.delay===0?this.setState({pastDelay:!0}):this._delay=setTimeout(function(){a.setState({pastDelay:!0})},e.delay));typeof e.timeout==="number"&&(this._timeout=setTimeout(function(){a.setState({timedOut:!0})},e.timeout));var b=function(){if(!a._mounted)return;a.setState({error:f.error,loaded:f.loaded,loading:f.loading});a._clearTimeouts()};f.promise.then(function(){b()})["catch"](function(a){b()})};c.prototype.componentWillUnmount=function(){this._mounted=!1,this._clearTimeouts()};c.prototype._clearTimeouts=function(){clearTimeout(this._delay),clearTimeout(this._timeout)};c.prototype.render=function(){if(this.state.loading||this.state.error)return m.createElement(e.loading,{isLoading:this.state.loading,pastDelay:this.state.pastDelay,timedOut:this.state.timedOut,error:this.state.error,retry:this.retry});else if(this.state.loaded)return e.render(this.state.loaded,this.props);else return null};return c}(m.Component),c.contextTypes={loadable:b("prop-types").shape({report:b("prop-types").func.isRequired})},d}function a(a){return u(q,a)}function c(a){if(typeof a.render!=="function")throw new Error("LoadableMap requires a `render(loaded, props)` function");return u(r,a)}a.Map=c;d=function(a){l(b,a);function b(){j(this,b);return k(this,a.apply(this,arguments))}b.prototype.getChildContext=function(){return{loadable:{report:this.props.report}}};b.prototype.render=function(){return m.Children.only(this.props.children)};return b}(m.Component);d.propTypes={report:b("prop-types").func.isRequired};d.childContextTypes={loadable:b("prop-types").shape({report:b("prop-types").func.isRequired}).isRequired};a.Capture=d;function v(a){var c=[];while(a.length){var d=a.pop();c.push(d())}return(h||(h=b("Promise"))).all(c).then(function(){if(a.length)return v(a)})}a.preloadAll=function(){return new(h||(h=b("Promise")))(function(a,b){v(n).then(a,b)})};a.preloadReady=function(){return new(h||(h=b("Promise")))(function(a,b){v(o).then(a,a)})};e.exports=a}),null); __d("react-loadable",["react-loadable-5.5.0"],(function(a,b,c,d,e,f){e.exports=b("react-loadable-5.5.0")}),null); __d("WAWebLoadable",["react","react-loadable"],(function(a,b,c,d,e,f,g){var h,i=h||c("react");function a(a){var b=a.loader,d=a.loading,e=c("react-loadable")({loader:b,loading:function(a){return!a.pastDelay?null:d(a)},render:function(a,b){var c=b.forwardedRefDoNotUse;b=babelHelpers.objectWithoutPropertiesLoose(b,["forwardedRefDoNotUse"]);return i.jsx(a,babelHelpers["extends"]({ref:c},b))}});function g(a){var b=a.ref;a=babelHelpers.objectWithoutPropertiesLoose(a,["ref"]);return i.jsx(e,babelHelpers["extends"]({forwardedRefDoNotUse:b},a))}g.displayName=g.name+" [from "+f.id+"]";return g}g["default"]=a}),98); __d("WAWebBackIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k="back";function a(a){var b=a.iconXstyle,e=a.height,f=a.width,g=a.viewBox;a=babelHelpers.objectWithoutPropertiesLoose(a,["iconXstyle","height","width","viewBox"]);var h;if(g){var l=g.x;l=l===void 0?0:l;var m=g.y;m=m===void 0?0:m;var n=g.width;n=n===void 0?0:n;g=g.height;g=g===void 0?0:g;h=[l,m,n,g].join(" ")}l=24;m=24;(e!=null||f!=null)&&(l=e,m=f);return j.jsx(d("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers["extends"]({name:k},a,{children:j.jsxs("svg",{viewBox:(n=h)!=null?n:"0 0 24 24",height:l,width:m,preserveAspectRatio:"xMidYMid meet",className:(i||(i=c("stylex")))(b),version:"1.1",x:"0px",y:"0px",enableBackground:"new 0 0 24 24",children:[j.jsx("title",{children:k}),j.jsx("path",{fill:"currentColor",d:"M12,4l1.4,1.4L7.8,11H20v2H7.8l5.6,5.6L12,20l-8-8L12,4z"})]})}))}a.displayName=a.name+" [from "+f.id+"]";g.BackIcon=a}),98); __d("WAWebRefreshIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k="refresh";function a(a){var b=a.iconXstyle,e=a.height,f=a.width,g=a.viewBox;a=babelHelpers.objectWithoutPropertiesLoose(a,["iconXstyle","height","width","viewBox"]);var h;if(g){var l=g.x;l=l===void 0?0:l;var m=g.y;m=m===void 0?0:m;var n=g.width;n=n===void 0?0:n;g=g.height;g=g===void 0?0:g;h=[l,m,n,g].join(" ")}l=24;m=24;(e!=null||f!=null)&&(l=e,m=f);return j.jsx(d("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers["extends"]({name:k},a,{children:j.jsxs("svg",{viewBox:(n=h)!=null?n:"0 0 24 24",height:l,width:m,preserveAspectRatio:"xMidYMid meet",className:(i||(i=c("stylex")))(b),version:"1.1",x:"0px",y:"0px",enableBackground:"new 0 0 24 24",children:[j.jsx("title",{children:k}),j.jsx("path",{fill:"currentColor",d:"M17.6,6.4C16.2,4.9,14.2,4,12,4c-4.4,0-8,3.6-8,8s3.6,8,8,8c3.7,0,6.8-2.6,7.7-6h-2.1 c-0.8,2.3-3,4-5.6,4c-3.3,0-6-2.7-6-6s2.7-6,6-6c1.7,0,3.1,0.7,4.2,1.8L13,11h7V4L17.6,6.4z"})]})}))}a.displayName=a.name+" [from "+f.id+"]";g.RefreshIcon=a}),98); __d("WAWebLazyLoadLoading.react",["fbt","WAWebRefreshIcon.react","WAWebSpinner.react","WAWebUISpacing","react","stylex"],(function(a,b,c,d,e,f,g,h){var i,j,k=i||c("react"),l={circleSvg:{width:"x1pju0fl",height:"x10wjd1d",$$css:!0},text:{lineHeight:"xggjnk3",color:"x1n68mz9",$$css:!0}};function m(a){a=a.text;return k.jsxs("div",{children:[k.jsx("div",babelHelpers["extends"]({className:"x1pju0fl x10wjd1d x1d12jij xeksh7e x1idq3uh x1w1l3m7 xdj266r xkrivgy x98jqk3 x1gryazu xue55m6 x7o08j2 x2b8uid x14yjl9h xudhj91 x18nykt9 xww2gxu xilfgz5"},{children:k.jsx(d("WAWebRefreshIcon.react").RefreshIcon,{iconXstyle:l.circleSvg})})),k.jsx("div",babelHelpers["extends"]({},(j||(j=c("stylex"))).props(l.text,d("WAWebUISpacing").uiMargin.vert0,d("WAWebUISpacing").uiMargin.horiz20),{children:a}))]})}m.displayName=m.name+" [from "+f.id+"]";function a(a){var b=a.error,c=a.text;c=c===void 0?h._(/*BTDS*/"__JHASH__oj1QVsTyDDd__JHASH__"):c;a=a.retry;a=a===void 0?function(){return window.location.reload()}:a;return k.jsx("div",babelHelpers["extends"]({className:"x10l6tqk x42zw1d x78zum5 x6s0dn4 xl56j7k xh8yej3 x5yr21d x2b8uid x1ypdohk"},{onClick:b?a:null,children:b?k.jsx(m,{text:c}):k.jsx(d("WAWebSpinner.react").Spinner,{size:50,stroke:4})}))}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),226); __d("WAWebXViewerIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k="x-viewer";function a(a){var b=a.iconXstyle,e=a.height,f=a.width,g=a.viewBox;a=babelHelpers.objectWithoutPropertiesLoose(a,["iconXstyle","height","width","viewBox"]);var h;if(g){var l=g.x;l=l===void 0?0:l;var m=g.y;m=m===void 0?0:m;var n=g.width;n=n===void 0?0:n;g=g.height;g=g===void 0?0:g;h=[l,m,n,g].join(" ")}l=24;m=24;(e!=null||f!=null)&&(l=e,m=f);return j.jsx(d("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers["extends"]({name:k},a,{children:j.jsxs("svg",{viewBox:(n=h)!=null?n:"0 0 24 24",height:l,width:m,preserveAspectRatio:"xMidYMid meet",className:(i||(i=c("stylex")))(b),version:"1.1",x:"0px",y:"0px",enableBackground:"new 0 0 24 24",children:[j.jsx("title",{children:k}),j.jsx("path",{fill:"currentColor",d:"M19.8,5.8l-1.6-1.6L12,10.4L5.8,4.2L4.2,5.8l6.2,6.2l-6.2,6.2l1.6,1.6l6.2-6.2l6.2,6.2l1.6-1.6L13.6,12 L19.8,5.8z"})]})}))}a.displayName=a.name+" [from "+f.id+"]";g.XViewerIcon=a}),98); __d("WAWebStatusLoadingQuoted.react",["WAWebBackIcon.react","WAWebLazyLoadLoading.react","WAWebModalManager","WAWebXViewerIcon.react","react"],(function(a,b,c,d,e,f,g){var h,i=h||c("react");function a(a){var b=a.error,e=a.text;a=a.retry;var f=function(){return d("WAWebModalManager").ModalManager.closeMedia()};return i.jsxs("div",babelHelpers["extends"]({className:"x10l6tqk x13vifvy x17qophe x1bpt9pm xh8yej3 x5yr21d x66m237"},{"data-animate-status-viewer":!0,children:[i.jsx("button",babelHelpers["extends"]({className:"x10l6tqk xoyzfg9 x4p3wbt xhtitgo x1fpc5dy"},{onClick:f,children:i.jsx(d("WAWebXViewerIcon.react").XViewerIcon,{})})),i.jsx("button",babelHelpers["extends"]({className:"x10l6tqk xoyzfg9 x10ick3y xhtitgo x78zum5 x1fpc5dy"},{onClick:f,children:i.jsx(d("WAWebBackIcon.react").BackIcon,{directional:!0})})),i.jsx(c("WAWebLazyLoadLoading.react"),{error:b,text:e,retry:a})]}))}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),98); __d("WAWebStatusQuotedFlowLoadable",["JSResourceForInteraction","WAWebLazyLoadedRetriable","WAWebLoadable","WAWebStatusLoadingQuoted.react","asyncToGeneratorRuntime","react"],(function(a,b,c,d,e,f,g){var h,i=h||c("react");a=c("WAWebLazyLoadedRetriable")(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield c("JSResourceForInteraction")("WAWebStatusQuotedFlow.react").__setRef("WAWebStatusQuotedFlowLoadable").load());return a}),"StatusQuotedFlow");d=c("WAWebLoadable")({loader:a,loading:function(a){return i.jsx(c("WAWebStatusLoadingQuoted.react"),{error:Boolean(a.error)})}});g.requireBundle=a;g.StatusQuotedFlowLoadable=d}),98); __d("WAWebStatusNotificationUtils",["fbt","WAWebModalManager","WAWebMsgGetters","WAWebStatusCollection","WAWebStatusQuotedFlowLoadable","WAWebToast.react","WAWebToastManager","react"],(function(a,b,c,d,e,f,g,h){var i,j=i||c("react");function a(a){var b=d("WAWebMsgGetters").getSender(a);if(b==null){d("WAWebToastManager").ToastManager.open(j.jsx(d("WAWebToast.react").Toast,{msg:h._(/*BTDS*/"__JHASH__NLTahMCR_fl__JHASH__")}));return}void d("WAWebStatusCollection").StatusCollection.find(b).then(function(b){var c=function(){d("WAWebToastManager").ToastManager.open(j.jsx(d("WAWebToast.react").Toast,{msg:h._(/*BTDS*/"__JHASH__DeFnLHkzQLY__JHASH__")}))};d("WAWebModalManager").ModalManager.openMedia(j.jsx(d("WAWebStatusQuotedFlowLoadable").StatusQuotedFlowLoadable,{status:b,msgKey:a.id,onMsgNotFound:c,onClose:function(){return d("WAWebModalManager").ModalManager.closeMedia()}}),{transition:"quoted-status-modal"})})}g.openStatusViewer=a}),226); __d("WAWebHistorySyncStickers",["WABase64","WALogger","WALongInt","WATimeUtils","WAWebHistorySyncNotificationUtils","WAWebMediaTypes","WAWebRecentStickerCollectionMd","WAWebUserPrefsAppStateSync","WAWebUserPrefsTypes"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Recent Stickers completed, ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Recent Stickers: "," stickers need to be added after sticker construction."]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Recent Stickers: Got an empty fileEncSha256 or mediaKey from initial sticker history with filehash ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["Recent Stickers: Got an empty fileEncSha256 or mediaKey from initial sticker history"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["Recent Stickers: Got an empty filehash from initial sticker history"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["Recent Stickers: processing recent stickers from history. total of "," stickers received."]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["Recent Stickers: received empty recentStickers protobuf"]);n=function(){return a};return a}function a(a,b){if(a.recentStickers==null){d("WALogger").WARN(n());return}d("WALogger").LOG(m(),a.recentStickers.length);a=a.recentStickers.map(function(a){var b=a.fileSha256;if(b==null){d("WALogger").WARN(l());return null}var c=a.fileEncSha256,e=a.mediaKey;(c==null||e==null)&&(d("WALogger").LOG(k()),d("WALogger").DEV(j(),d("WABase64").encodeB64(b)));return[{id:d("WABase64").encodeB64(b),directPath:a.directPath,filehash:d("WABase64").encodeB64(b),encFilehash:c!=null?d("WABase64").encodeB64(c):null,mediaKey:e!=null?d("WABase64").encodeB64(e):"",mediaKeyTimestamp:d("WATimeUtils").unixTime(),width:a.width,height:a.height,mimetype:a.mimetype,type:d("WAWebMediaTypes").OUTWARD_TYPES.STICKER,index:0,weight:a.weight},(b=d("WALongInt").maybeNumberOrThrowIfTooLarge(a.lastStickerSentTs))!=null?b:0,null]}).filter(Boolean);d("WALogger").LOG(i(),a.length);d("WAWebRecentStickerCollectionMd").RecentStickerCollectionMd.replaceAndEnqueue(a,!0);d("WAWebUserPrefsAppStateSync").setNonCriticalDataSyncStatus((a={},a[d("WAWebUserPrefsTypes").NonCriticalDataSyncStatusType.RECENT_STICKER_INITIALIZED]=d("WAWebUserPrefsTypes").RecentStickerInitializedStatusType.SUCCESS,a));d("WALogger").LOG(h(),d("WAWebHistorySyncNotificationUtils").getHistorySyncLogDetailsString(b))}g.processRecentStickers=a}),98); __d("WAWebStickersFavoriteSyncAction",["WABase64","WABaseGlobals","WAJids","WALogger","WAServerSync.pb","WASyncdAction","WASyncdConst","WAWebFavoriteStickerCollection","WAWebMiscGatingUtils","WAWebStickerModel","WAWebSyncdActionUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: favorite sticker sync: successfully "," sticker ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: favorite sticker sync: try remove the sticker but it isn't in favorite sticker panel."]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: favorite sticker sync: skipping adding favorite sticker since it has been added"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: favorite sticker sync: got an empty fileEncSha256 or mediaKey with filehash ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: favorite sticker sync: malformed mutation"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: favorite sticker sync: malformed mutation"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: favorite sticker sync: operation not supported"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: favorite sticker sync operation not supported"]);o=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(c,a);function c(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=null,b)||babelHelpers.assertThisInitialized(c)}var e=c.prototype;e.getVersion=function(){return 7};e.getAction=function(){return d("WASyncdConst").Actions.FavoriteSticker};e.applyMutations=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!d("WAWebMiscGatingUtils").isFavoriteStickersEnabled()){d("WALogger").WARN(o());return a.map(function(){return{actionState:d("WASyncdConst").SyncActionState.Unsupported}})}a=a.map(function(a){try{if(a.operation!=="set"){d("WALogger").WARN(n());return{actionState:d("WASyncdConst").SyncActionState.Unsupported}}var b=a.indexParts,c=a.value;a=a.timestamp;b=b[1];if(!b)return{actionState:d("WASyncdConst").SyncActionState.Malformed};c=c.stickerAction;if(c==null){d("WALogger").WARN(m());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}var e=c.fileEncSha256,f=c.mediaKey,g=c.mimetype,o=c.height,p=c.width,q=c.directPath,r=c.isFavorite;c=c.deviceIdHint;if(r==null){d("WALogger").WARN(l());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}(e==null||f==null)&&d("WALogger").DEV(k(),b);if(r){if(d("WAWebFavoriteStickerCollection").FavoriteStickerCollection.get(b)){d("WALogger").LOG(j());return{actionState:d("WASyncdConst").SyncActionState.Success}}q=new(d("WAWebStickerModel").StickerModel)({id:b,directPath:q,filehash:b,encFilehash:e?d("WABase64").encodeB64(e):"",mediaKey:f!=null?d("WABase64").encodeB64(f):"",mediaKeyTimestamp:a,width:p,height:o,mimetype:g});d("WAWebFavoriteStickerCollection").FavoriteStickerCollection.addOrUpdateStickers([q],a,c)}else{e=d("WAWebFavoriteStickerCollection").FavoriteStickerCollection.get(b);if(!e){d("WALogger").DEV(i());return{actionState:d("WASyncdConst").SyncActionState.Success}}d("WAWebFavoriteStickerCollection").FavoriteStickerCollection.removeAndSave(b)}d("WALogger").DEV(h(),r?"favorite":"unfavorite",b);return{actionState:d("WASyncdConst").SyncActionState.Success}}catch(a){return{actionState:d("WASyncdConst").SyncActionState.Failed}}});return a});function c(b){return a.apply(this,arguments)}return c}();e.generateFavoriteSyncMutation=function(a,b,c){var e;e={stickerAction:{fileEncSha256:d("WABase64").decodeB64((e=a.encFilehash)!=null?e:""),mediaKey:d("WABase64").decodeB64((e=a.mediaKey)!=null?e:""),mimetype:a.mimetype,height:a.height,width:a.width,directPath:a.directPath!=null?a.directPath:void 0,isFavorite:b,deviceIdHint:d("WAJids").interpretAsNumber(d("WAJids").extractDeviceId(d("WABaseGlobals").getMyDeviceJid()))}};return d("WAWebSyncdActionUtils").buildPendingMutation({collection:d("WASyncdConst").CollectionName.RegularLow,indexArgs:[a.filehash],operation:d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET,version:this.getVersion(),value:e,timestamp:c,action:this.getAction()})};return c}(d("WASyncdAction").SyncActionBase);c=new a();g["default"]=c}),98); __d("WAWebStickersRemoveRecentSyncAction",["WALogger","WALongInt","WAServerSync.pb","WASyncdAction","WASyncdConst","WATimeUtils","WAWebMiscGatingUtils","WAWebRecentStickerCollectionMd","WAWebSyncdActionUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: skipping remove recent sticker since remove timestamp (",") is smaller than added timestamp (",")"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: removed a recent sticker"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: orphan remove recent sticker"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: no sticker hash provided"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: remove recent sticker sync: operation not supported"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["syncd: remove recent sticker operation not supported"]);m=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(c,a);function c(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.chatJidIndex=null,b)||babelHelpers.assertThisInitialized(c)}var e=c.prototype;e.getVersion=function(){return 7};e.getAction=function(){return d("WASyncdConst").Actions.RemoveRecentSticker};e.applyMutations=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!d("WAWebMiscGatingUtils").isRecentStickersMDEnabled()){d("WALogger").WARN(m());return a.map(function(){return{actionState:d("WASyncdConst").SyncActionState.Unsupported}})}return a.map(function(a){if(a.operation!=="set"){d("WALogger").WARN(l());return{actionState:d("WASyncdConst").SyncActionState.Unsupported}}var b=a.indexParts;b=b[1];if(b==null){d("WALogger").WARN(k());return{actionState:d("WASyncdConst").SyncActionState.Malformed}}a=(a=a.value.removeRecentStickerAction)==null?void 0:a.lastStickerSentTs;b=d("WAWebRecentStickerCollectionMd").RecentStickerCollectionMd.get(b);if(!b){d("WALogger").DEV(j());return{actionState:d("WASyncdConst").SyncActionState.Orphan}}var c=d("WALongInt").maybeNumberOrThrowIfTooLarge(a);c==null||d("WALongInt").numberOrThrowIfTooLarge(b.timestamp)<=c?(d("WAWebRecentStickerCollectionMd").RecentStickerCollectionMd.removeAndSave(b),d("WALogger").DEV(i())):d("WALogger").DEV(h(),a,b.timestamp);return{actionState:d("WASyncdConst").SyncActionState.Success}})});function c(b){return a.apply(this,arguments)}return c}();e.generateRemoveStickerMutation=function(a){var b=d("WATimeUtils").unixTimeMs(),c={removeRecentStickerAction:{lastStickerSentTs:a.timestamp}};return d("WAWebSyncdActionUtils").buildPendingMutation({collection:d("WASyncdConst").CollectionName.RegularLow,indexArgs:[a.sticker.filehash],operation:d("WAServerSync.pb").SyncdMutation$SyncdOperation.SET,version:this.getVersion(),value:c,timestamp:b,action:this.getAction()})};return c}(d("WASyncdAction").SyncActionBase);c=new a();g["default"]=c}),98); __d("WAWebStickerUtils",["$InternalEnum","Promise","WACryptoSha256","WALogger","WAPromiseProps","WAWebABProps","WAWebFeatureDetectionDetectWebpSupport","WAWebInMemoryLottieStickerCache","WAWebMediaDataUtils","WAWebMediaMmsV4Download","WAWebStickerMetadataParsing","WAWebStickerMimeUtils","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["extractMetaDataFromLottieSticker: Failed to parse metadata out of lottie sticker, returning default metadata."]);i=function(){return a};return a}var j="metadata",k="customProps",l=512,m=512,n=b("$InternalEnum").Mirrored(["WEBP","LOTTIE"]);function o(a){return d("WAWebStickerMimeUtils").WhatsAppLottieStickerMimeType===a?n.LOTTIE:n.WEBP}function p(a){if(a==null)return d("WAWebStickerMetadataParsing").DEFAULT_STICKER_METADATA;try{a=(a=(a=a[j])==null?void 0:a[k])!=null?a:{};return d("WAWebStickerMetadataParsing").toStickerMetadata(a)}catch(a){d("WALogger").LOG(i()).devConsole(a);return d("WAWebStickerMetadataParsing").DEFAULT_STICKER_METADATA}}function a(a,b){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){if(o(a.type)===n.LOTTIE){c=c.filehash;if(c!=null){var e=d("WAWebInMemoryLottieStickerCache").InMemoryLottieStickerCache.get(c);e==null&&(e=(yield d("WAWebInMemoryLottieStickerCache").extractAndSetLottieJSONInMemoryCache(c,a)));c=p(e);return(h||(h=b("Promise"))).resolve(babelHelpers["extends"]({},c,{size:a.size,fullWidth:l,fullHeight:m}))}}return d("WAWebFeatureDetectionDetectWebpSupport").detectWebpSupport().then(function(c){return c?d("WAPromiseProps").promiseProps({widthHeight:d("WAWebMediaDataUtils").getImageWidthHeightNoOpaque(a),webpData:d("WAWebMediaDataUtils").parseWebpNoOpaque(a)}).then(function(b){return{fullWidth:b.widthHeight.width,fullHeight:b.widthHeight.height,animationDuration:b.webpData.animationDuration,firstFrameLength:b.webpData.firstFrameLength,singleLoopDuration:b.webpData.singleLoopDuration,emojis:b.webpData.emojis,isAnimated:b.webpData.animationDuration>0,size:a.size,isFirstParty:b.webpData.isFirstParty,isFromStickerMaker:b.webpData.isFromStickerMaker,stickerPackId:b.webpData.stickerPackId,stickerPackName:b.webpData.stickerPackName,stickerPackPublisher:b.webpData.stickerPackPublisher,isAvatar:b.webpData.isAvatar,isAiSticker:b.webpData.isAiSticker,stickerMakerSourceType:b.webpData.stickerMakerSourceType}}):d("WAWebMediaDataUtils").parseWebpNoOpaque(a).then(function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){var c=b.animationDuration,e=b.firstFrameLength,f=b.singleLoopDuration,g=b.emojis,h=b.isFirstParty,i=b.isFromStickerMaker,j=b.stickerPackId,k=b.stickerPackName,l=b.stickerPackPublisher,m=b.isAvatar,n=b.isAiSticker;b=b.stickerMakerSourceType;if(c>0)return{animationDuration:c,firstFrameLength:e,singleLoopDuration:f,emojis:g,isAnimated:!0,size:a.size,isFirstParty:h,isFromStickerMaker:i,stickerPackId:j,stickerPackName:k,stickerPackPublisher:l,isAvatar:m,isAiSticker:n,stickerMakerSourceType:b};e=(yield d("WAWebMediaDataUtils").decodeWebpToRGBANoOpaque(a));return{animationDuration:c,rgbaBuffer:e.rgbaBuffer,rgbaWidth:e.width,rgbaHeight:e.height,emojis:g,isAnimated:!1,size:a.size,isFirstParty:h,isFromStickerMaker:i,stickerPackId:j,stickerPackName:k,stickerPackPublisher:l,isAvatar:m,isAiSticker:n,stickerMakerSourceType:b}});return function(a){return c.apply(this,arguments)}}())})});return q.apply(this,arguments)}function r(a){return a.replaceAll(/\s+/g,"")}function e(a,b){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=new Blob([a],{type:d("WAWebStickerMimeUtils").WhatsAppLottieStickerMimeType});a=(yield d("WAWebMediaMmsV4Download").extractLottieJSON(a,b));if(a==null)throw c("err")("Failed to extract lottie json from zipped sticker");return t(a)});return s.apply(this,arguments)}function t(a){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=v(a,j);var b=new TextEncoder();b=b.encode(a).buffer;a=(yield d("WACryptoSha256").sha256Base64(b));return a});return u.apply(this,arguments)}function v(a,b){a=r(a);try{a=JSON.parse(a);delete a[b];return JSON.stringify(a)}catch(a){throw c("err")("removeKeyFromString: Failed to parse lottie json "+a)}}function f(){var a={},b=d("WAWebABProps").getABPropConfigValue("gimmick_phase_two_data_suffix");b=new URLSearchParams(b);b.forEach(function(b,c){a[c]=b});return a}g.METADATA_OBJECT=j;g.LOTTIE_STICKER_FULL_WIDTH=l;g.LOTTIE_STICKER_FULL_HEIGHT=m;g.StickerFileType=n;g.getStickerFileType=o;g.extractMetaDataFromLottieSticker=p;g.parseStickerMetadata=a;g.removeSpacesAndEmptyLines=r;g.getLottieStickerFilehashFromZippedStickerBuffer=e;g.calculateLottieStickerFilehash=t;g.removeKeyFromString=v;g.getStickerFetchParamsFromABConfig=f}),98); __d("WAWebWamEnumQueryType",[],(function(a,b,c,d,e,f){a=Object.freeze({STICKER_STORE_DATA:0,PREVIEW_IMAGE_DOWNLOAD:1,STICKER_PACK_DATA:2,STICKER_SEARCH:3,DISCOVERY_PACK:4});f.QUERY_TYPE=a}),66); __d("WAWebStickerCommonQueryToStaticServerWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumQueryType"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({StickerCommonQueryToStaticServer:[2740,{httpResponseCode:[2,a.TYPES.INTEGER],params:[3,a.TYPES.STRING],queryLatencyMs:[4,a.TYPES.TIMER],queryType:[1,d("WAWebWamEnumQueryType").QUERY_TYPE]},[1,1,1],"regular"]},{StickerCommonQueryToStaticServer:[]});g.StickerCommonQueryToStaticServerWamEvent=b}),98); __d("WAWebFetchFirstPartyStickerPacksAction",["WAWebL10N","WAWebL10NCountryCodes","WAWebMiscErrors","WAWebPonyfillsFetch","WAWebPonyfillsUrlSearchParams","WAWebStickerCommonQueryToStaticServerWamEvent","WAWebStickerUtils","WAWebURLUtils","WAWebUserPrefsMeUser","WAWebWamEnumQueryType","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h="https://static.whatsapp.net/sticker";function i(a,b){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e=d("WAWebStickerUtils").getStickerFetchParamsFromABConfig();e=babelHelpers["extends"]({},e,a);a=c("WAWebURLUtils").build(h,e);var f=new(d("WAWebStickerCommonQueryToStaticServerWamEvent").StickerCommonQueryToStaticServerWamEvent)();f.startQueryLatencyMs();b=(yield c("WAWebPonyfillsFetch")(a,{signal:b.signal}));f.markQueryLatencyMs();f.set({httpResponseCode:b.status,params:new(c("WAWebPonyfillsUrlSearchParams"))(e).toString(),queryType:d("WAWebWamEnumQueryType").QUERY_TYPE.STICKER_PACK_DATA});f.commit();if(!b.ok)throw new(d("WAWebMiscErrors").InvalidServerResponseError)(a,b.status.toString(),"Invalid response from WhatsApp stickers endpoint");e=(yield b.json());if(e==null||e.length===0)throw new(d("WAWebMiscErrors").InvalidServerResponseError)(a,b.status.toString(),"Invalid response from WhatsApp stickers endpoint: "+JSON.stringify(e));return e});return j.apply(this,arguments)}function k(a,b){b={id:a["sticker-pack-id"],name:a.name,publisher:a.publisher,description:a.description,fileSize:Number(a["file-size"]),imageDataHash:a["image-data-hash"],animated:a.animated===1,previewImageIds:a["preview-image-ids"],trayImageId:a["tray-image-id"],trayImagePreview:a["tray-image-preview"],index:(a=b)!=null?a:0};return b}function a(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b,e=c("WAWebL10N").getNormalizedLocale();b=d("WAWebL10NCountryCodes").getCountryShortcodeByPhone((b=d("WAWebUserPrefsMeUser").getMaybeMeUser())==null?void 0:b.user)||"default";e={cat:"sticker_store_data",id:"all",lg:e,country:b};b=(yield i(e,{signal:a.signal}));return b.map(function(a,b){return k(a,b)})});return l.apply(this,arguments)}function e(a){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=c("WAWebL10N").getNormalizedLocale();b={cat:"sticker_pack_data",id:a.id,lg:b};b=(yield i(b,{signal:a.signal}));a=b[0];return k(a)});return m.apply(this,arguments)}g.fetchFirstPartyStickerPacks=a;g.fetchFirstPartyStickerPack=e}),98); __d("WAWebFetchFirstPartyStickersAction",["WAWebL10N","WAWebMiscErrors","WAWebPonyfillsFetch","WAWebPonyfillsUrlSearchParams","WAWebStickerCommonQueryToStaticServerWamEvent","WAWebStickerUtils","WAWebURLUtils","WAWebWamEnumQueryType","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h="https://static.whatsapp.net/sticker";function a(a,b){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e=d("WAWebStickerUtils").getStickerFetchParamsFromABConfig();e=babelHelpers["extends"]({},e,{cat:"sticker_pack_data",id:a,lg:c("WAWebL10N").getNormalizedLocale()});a=c("WAWebURLUtils").build(h,e);var f=new(d("WAWebStickerCommonQueryToStaticServerWamEvent").StickerCommonQueryToStaticServerWamEvent)();f.startQueryLatencyMs();b=(yield c("WAWebPonyfillsFetch")(a,{signal:b==null?void 0:b.signal}));f.markQueryLatencyMs();f.set({httpResponseCode:b.status,params:new(c("WAWebPonyfillsUrlSearchParams"))(e).toString(),queryType:d("WAWebWamEnumQueryType").QUERY_TYPE.STICKER_PACK_DATA});f.commit();if(!b.ok)throw new(d("WAWebMiscErrors").InvalidServerResponseError)(a,b.status.toString(),"Invalid response from WhatsApp stickers endpoint");e=(yield b.json());if(e==null||e.length===0)throw new(d("WAWebMiscErrors").InvalidServerResponseError)(a,b.status.toString(),"Invalid response from WhatsApp stickers endpoint: "+JSON.stringify(e));return e[0].stickers.map(function(a,b){return{mimetype:a.mimetype,width:a.width,height:a.height,index:b,filehash:a["file-hash"],directPath:a["direct-path"],mediaKey:a["media-key"],id:a["file-hash"],deprecatedMms3Url:a.url,encFilehash:a["enc-file-hash"],mediaKeyTimestamp:0}})});return i.apply(this,arguments)}g.fetchFirstPartyStickers=a}),98); __d("WAWebMediaHostsUtil",["WAWebMediaHosts","asyncToGeneratorRuntime","lodash"],(function(a,b,c,d,e,f,g){var h="https://static.whatsapp.net";a=c("lodash").memoize(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield d("WAWebMediaHosts").mediaHosts.getHostsInfoByBucket({preferredBuckets:[1]}));a=a.selectedHost;return a!=null?"https://"+a.hostname:h}));g.getStaticMediaHostName=a}),98); __d("WAWebSearchFirstPartyStickersAction",["WAWebL10NCountryCodes","WAWebMediaHostsUtil","WAWebMiscErrors","WAWebPonyfillsFetch","WAWebPonyfillsUrlSearchParams","WAWebStickerCommonQueryToStaticServerWamEvent","WAWebStickerModel","WAWebStickerUtils","WAWebURLUtils","WAWebUserPrefsMeUser","WAWebWamEnumQueryType","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h=250,i="https://static.whatsapp.net",j="/sticker",k="/wa/static/sticker";function a(a,b){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e;e=d("WAWebL10NCountryCodes").getCountryShortcodeByPhone((e=d("WAWebUserPrefsMeUser").getMaybeMeUser())==null?void 0:e.user)||"default";var f=0,g=0;while(f<=h)f+=3+encodeURIComponent(a[g++]).length;f=a.slice(0,g-1).join(",");a={country:e};g=(yield d("WAWebMediaHostsUtil").getStaticMediaHostName());e=g===i?""+g+j:""+g+k;g=d("WAWebStickerUtils").getStickerFetchParamsFromABConfig();e=c("WAWebURLUtils").build(e,babelHelpers["extends"]({},g,{cat:"sticker_search",terms:f,_nc_cat:1},a));g=new(d("WAWebStickerCommonQueryToStaticServerWamEvent").StickerCommonQueryToStaticServerWamEvent)();g.startQueryLatencyMs();f=(yield c("WAWebPonyfillsFetch")(e,{signal:b==null?void 0:b.signal}));g.markQueryLatencyMs();g.set({httpResponseCode:f.status,params:new(c("WAWebPonyfillsUrlSearchParams"))(a).toString(),queryType:d("WAWebWamEnumQueryType").QUERY_TYPE.STICKER_SEARCH});g.commit();if(!f.ok)throw new(d("WAWebMiscErrors").InvalidServerResponseError)(e,f.status.toString(),"Invalid response from WhatsApp stickers endpoint");b=(yield f.json());if(b==null)throw new(d("WAWebMiscErrors").InvalidServerResponseError)(e,f.status.toString(),"Invalid response from WhatsApp stickers endpoint: "+JSON.stringify(b));return b.map(function(a,b){return new(d("WAWebStickerModel").StickerModel)({mimetype:a.mimetype,width:a.width,height:a.height,filehash:a["file-hash"],directPath:a["direct-path"],mediaKey:a["media-key"],id:a["file-hash"],encFilehash:a["enc-file-hash"],mediaKeyTimestamp:0,index:b})})});return l.apply(this,arguments)}g.searchFirstPartyStickers=a}),98); __d("WAWebFavoriteStickerModel",["WAWebBaseModel"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.sticker=d("WAWebBaseModel").prop(),c.timestamp=d("WAWebBaseModel").prop(),c.stickerHashWithoutMeta=d("WAWebBaseModel").prop(),c.isFavorite=d("WAWebBaseModel").prop(),c.deviceId=d("WAWebBaseModel").prop(),b)||babelHelpers.assertThisInitialized(c)}return b}(d("WAWebBaseModel").BaseModel);a.Proxy="favoriteSticker";b=d("WAWebBaseModel").defineModel(a);g["default"]=b}),98); __d("WAWebWebpCalculateWebpFilehashWithoutMetadata",["WACryptoSha256","WAWebWebp"],(function(a,b,c,d,e,f,g){function a(a){var b,c=new Uint8Array(a);b=(b=d("WAWebWebp").findWebpChunk(c,d("WAWebWebp").Chunk.EXIF))!=null?b:d("WAWebWebp").findWebpChunk(c,d("WAWebWebp").Chunk.XMP);if(b==null)return d("WACryptoSha256").sha256Base64(a);a=c.slice(0,b.position);c=a.byteLength-d("WAWebWebp").CHUNK_HEADER_SIZE;a.set(d("WAWebWebp").numberToLittleEndian(c),d("WAWebWebp").FOUR);return d("WACryptoSha256").sha256Base64(a)}g["default"]=a}),98); __d("WAWebFavoriteStickerCollection",["Promise","WABaseGlobals","WAJids","WALogger","WAWebABProps","WAWebBaseCollection","WAWebFavoriteStickerModel","WAWebIdleTaskRunner","WAWebMediaAutoDownloadQueue","WAWebMediaStore","WAWebSchemaFavoriteStickers","WAWebStickerModel","WAWebStickerUtils","WAWebWebpCalculateWebpFilehashWithoutMetadata","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Favorite Stickers: need to initialize stickers from DB with length: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Favorite Stickers: length of stickers will be removed: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["Favorite Stickers: need to save collection to DB."]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["Favorite Stickers: length of stickers will be enqueued: ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["FavoriteStickerCollection attempt to save to database failed"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["Favorite Stickers: after save, stickers in DB with length: ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["Favorite Stickers: before save, stickers in DB with length: ",""]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["Favorite Stickers: need to save stickers in DB with length: ",""]);p=function(){return a};return a}function q(a,b){return a.timestamp<b.timestamp?1:-1}a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c._comparator=function(a,b){return q(a,b)},b)||babelHelpers.assertThisInitialized(c)}return b}(d("WAWebBaseCollection").BaseCollection);a.model=c("WAWebFavoriteStickerModel");e=function(a){babelHelpers.inheritsLoose(e,a);function e(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c._comparator=function(a,b){return q(a,b)},c._emojiToCollection=new Map(),c._hasInitializedFromCache=!1,b)||babelHelpers.assertThisInitialized(c)}var f=e.prototype;f.add=function(b,c){b=a.prototype.add.call(this,b,c);c=d("WAWebABProps").getABPropConfigValue("web_autodownload_stickers");if(c)for(c of b){if(!c)break;this._enqueueStickerAutoDownload(c)}return b};f._enqueueStickerAutoDownload=function(a){void d("WAWebMediaAutoDownloadQueue").AutoDownloadQueue.enqueue(a.sticker,d("WAWebMediaAutoDownloadQueue").AutoDownloadTypes.MEDIA)};f.remove=function(b,c){return a.prototype.remove.call(this,b,c)};f.reset=function(){a.prototype.reset.call(this)};f._addSaveTask=function(){var a=this;(!this._idleTaskId||!d("WAWebIdleTaskRunner").IdleCallbackTasks.isInQueue(this._idleTaskId))&&(this._idleTaskId=d("WAWebIdleTaskRunner").IdleCallbackTasks.enqueue(function(){a._saveToDb()}))};f._saveToDb=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=this.toArray().map(function(a){var b=a.sticker.toDbData();return{id:a.id,timestamp:a.timestamp,sticker:{index:b.index,width:b.width,height:b.height,size:b.size,mimetype:b.mimetype,filehash:b.filehash,directPath:b.directPath,mediaKey:b.mediaKey,mediaKeyTimestamp:b.mediaKeyTimestamp,encFilehash:b.encFilehash,deprecatedMms3Url:b.deprecatedMms3Url,type:"sticker"},stickerHashWithoutMeta:a.stickerHashWithoutMeta,isFavorite:a.isFavorite,deviceId:a.deviceId}});d("WALogger").LOG(p(),a.length);try{var b=d("WAWebSchemaFavoriteStickers").getFavoriteStickersTable(),c=(yield b.count());d("WALogger").LOG(o(),c);yield b.clear();yield b.bulkCreateOrReplace(a);c=(yield b.count());d("WALogger").LOG(n(),c)}catch(a){d("WALogger").ERROR(m()).devConsole(a).sendLogs(a)}});function a(){return a.apply(this,arguments)}return a}();f._dbDataToModel=function(a){return new(c("WAWebFavoriteStickerModel"))({id:a.id,timestamp:a.timestamp,stickerHashWithoutMeta:a.stickerHashWithoutMeta,sticker:new(d("WAWebStickerModel").StickerModel)(a.sticker)})};f._getStickerHashWithoutMeta=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e=(yield d("WAWebMediaStore").LruMediaStore.get(a));if(e==null)return a;b=d("WAWebStickerUtils").getStickerFileType(b);return b===d("WAWebStickerUtils").StickerFileType.LOTTIE?d("WAWebStickerUtils").getLottieStickerFilehashFromZippedStickerBuffer(e,a):c("WAWebWebpCalculateWebpFilehashWithoutMetadata")(e)});function a(b,c){return a.apply(this,arguments)}return a}();f.addOrUpdateStickers=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e,f){var g=this;f===void 0&&(f=d("WAJids").interpretAsNumber(d("WAJids").extractDeviceId(d("WABaseGlobals").getMyDeviceJid())));var i=a.filter(function(a){return!g.get(a.id)});d("WALogger").LOG(l(),a.length);if(i.length===0)return;a=(yield (h||(h=b("Promise"))).all(i.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){return new(c("WAWebFavoriteStickerModel"))({id:a.filehash,sticker:a,stickerHashWithoutMeta:yield g._getStickerHashWithoutMeta(a.filehash,a.mimetype),timestamp:e,isFavorite:!0,deviceId:f})});return function(b){return a.apply(this,arguments)}}())));this.addAndSort(a);this._hasInitializedFromCache&&(d("WALogger").LOG(k()),this._addSaveTask())});function e(b,c,d){return a.apply(this,arguments)}return e}();f.addAndSort=function(a){this.add(a),this.sort()};f.removeAndSave=function(a,b){b===void 0&&(b={});a=this.remove(a,b);a.length&&(d("WALogger").LOG(j(),a.length),this._addSaveTask());return a};f.initializeFromCache=function(a){var b=this;d("WALogger").LOG(i(),a.length);a=a.map(function(a){return b._dbDataToModel(a)});this.addAndSort(a);var c=this.toArray();if(c.length>0){var e=new Set(a.map(function(a){return a.id}));c.some(function(a){return!e.has(a.id)})&&this._addSaveTask()}this._hasInitializedFromCache=!0};f.updateFavoriteStickerWithNewSticker=function(a,b){a=this.get(a);if(a==null)return;a.sticker=new(d("WAWebStickerModel").StickerModel)(b);this.set([a],{remove:!1,add:!1,silent:!0,sort:!1});this._addSaveTask()};f.getSuggestionsFromEmoji=function(a){return(a=this._emojiToCollection.get(a))==null?void 0:a.map(function(a){return a.sticker})};return e}(d("WAWebBaseCollection").BaseCollection);e.model=c("WAWebFavoriteStickerModel");f=new e();g.FavoriteStickerCollection=f}),98); __d("WAWebRecentStickerCollection",["WALogger","WANullthrows","WAWebBaseCollection","WAWebConnModel","WAWebMobilePlatforms","WAWebStickerModel","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["collection:recent_sticker:_sync error "]);h=function(){return a};return a}var i=32;a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var b,e;for(var f=arguments.length,g=new Array(f),h=0;h<f;h++)g[h]=arguments[h];return(b=e=a.call.apply(a,[this].concat(g))||this,e._comparator=function(a,b){return d("WAWebConnModel").Conn.platform===d("WAWebMobilePlatforms").PLATFORMS.ANDROID?e._getWeight(b)-e._getWeight(a):a.index>b.index?1:-1},e._checksum="",e._syncStatus="NONE",e._weightMap=new Map(),e._sortTrimScale=function(){var a=e.length;if(!a)return;e.sort();if(a>i){for(var b=i;b<a;b++)e._weightMap["delete"](c("WANullthrows")(e.at(b)).id);e.remove(e.slice(i))}b=e.head();var d=e.last();if(b&&d&&e._getWeight(b)<10&&e._getWeight(d)>.01)return;e.forEach(function(b,c){e._weightMap.set(b.id,1+3*((a-c)/a))})},b)||babelHelpers.assertThisInitialized(e)}var f=e.prototype;f._getWeight=function(a){return c("WANullthrows")(this._weightMap.get(a.id))};f.enqueue=function(a){if(a.length===0)return;d("WAWebConnModel").Conn.platform===d("WAWebMobilePlatforms").PLATFORMS.ANDROID?this._enqueueAndroid(a):this._enqueueiOS(a)};f.addStickerWithMediaData=function(a){a=new(d("WAWebStickerModel").StickerModel)(a);a.id||(a.id=a.filehash);this.enqueue([a])};f._enqueueAndroid=function(a){var b=this;a.forEach(function(a){b.get(a.id)||(b._weightMap.set(a.id,0),b.add(a)),b.forEach(function(c){var d=b._getWeight(c);c.id===a.id?d+=1:d*=.9;b._weightMap.set(c.id,Math.round(1e3*d)/1e3)})});this._sortTrimScale()};f._enqueueiOS=function(a){var b=this;this.forEach(function(a,b){a.index=i+b});var c=new Set(a.map(function(a){return a.id}));a=a.reduce(function(a,b){if(c.has(b.id)){c["delete"](b.id);return[b].concat(a)}return a},[]).slice(0,i);a.forEach(function(a,c){var d=b.get(a.id);d?d.index=c:b.add({id:a.id,deprecatedMms3Url:a.deprecatedMms3Url,directPath:a.directPath,filehash:a.filehash,encFilehash:a.encFilehash,mediaKey:a.mediaKey,mediaKeyTimestamp:a.mediaKeyTimestamp,width:a.width,height:a.height,size:a.size,mimetype:a.mimetype,type:a.type,index:c})});this.sort();this.remove(this.slice(i))};f.setChecksum=function(a){this._checksum=a};f.sync=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){(a==null||a!==this._checksum)&&(yield this._sync())});function c(b){return a.apply(this,arguments)}return c}();f._sync=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(this._syncStatus==="INPROGRESS")return;this._syncStatus="INPROGRESS";try{yield this.findQuery({},{set:!0}),this.sort(),this._syncStatus="SUCCESS"}catch(a){d("WALogger").WARN(h()).devConsole(a),this._syncStatus="FAILURE"}});function c(){return a.apply(this,arguments)}return c}();f.isSynced=function(){return this._syncStatus==="SUCCESS"||this._syncStatus==="FAILURE"};f.reset=function(){this._syncStatus="NONE";this._weightMap.clear();return a.prototype.reset.call(this)};return e}(d("WAWebBaseCollection").BaseCollection);a.model=d("WAWebStickerModel").StickerModel;e=new a();g.RecentStickerCollection=e}),98); __d("WAWebRecentStickerModel",["WAWebBaseModel"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.sticker=d("WAWebBaseModel").prop(),c.timestamp=d("WAWebBaseModel").prop(),c.msgId=d("WAWebBaseModel").prop(),c.weight=d("WAWebBaseModel").prop(),c.isNewSticker=d("WAWebBaseModel").prop(),b)||babelHelpers.assertThisInitialized(c)}return b}(d("WAWebBaseModel").BaseModel);a.Proxy="recentSticker";b=d("WAWebBaseModel").defineModel(a);g["default"]=b}),98); __d("WAWebRecentStickerCollectionMd",["WALogger","WATimeUtils","WAWebABProps","WAWebBaseCollection","WAWebIdleTaskRunner","WAWebMediaAutoDownloadQueue","WAWebMediaStorage","WAWebMsgCollection","WAWebRecentStickerModel","WAWebSchemaRecentStickers","WAWebStickerModel","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Recent Stickers: stickers length "," after remove."]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Recent Stickers: stickers length "," is over the limit."]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["updateDirectPaths called with a stickerId that doesn't match any in the collection"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["Recent Stickers: need to save collection to DB."]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["Recent Stickers: adjust weight and resort stickers."]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["Recent Stickers: length of stickers will be enqueued: ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["RecentStickerCollection attempt to save to database failed"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["Recent Stickers: after save, stickers in DB with length: ",""]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["Recent Stickers: before save, stickers in DB with length: ",""]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["Recent Stickers: need to save stickers in DB with length: ",""]);q=function(){return a};return a}var r=32;a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c._hasInitializedFromCache=!1,b)||babelHelpers.assertThisInitialized(c)}var f=e.prototype;f.remove=function(b,c){return a.prototype.remove.call(this,b,c)};f.add=function(b,c){b=a.prototype.add.call(this,b,c);c=d("WAWebABProps").getABPropConfigValue("web_autodownload_stickers");if(c)for(c of b){if(!c)break;this._enqueueStickerAutoDownload(c)}return b};f._enqueueStickerAutoDownload=function(a){void d("WAWebMediaAutoDownloadQueue").AutoDownloadQueue.enqueue(a.sticker,d("WAWebMediaAutoDownloadQueue").AutoDownloadTypes.MEDIA)};f.reset=function(){a.prototype.reset.call(this)};f._comparator=function(a,b){return a.weight!==b.weight?a.weight<b.weight?1:-1:a.timestamp<b.timestamp?1:-1};f._dbDataToModel=function(a){var b;return new(c("WAWebRecentStickerModel"))({id:a.id,timestamp:a.timestamp,msgId:a.msgId,sticker:new(d("WAWebStickerModel").StickerModel)(a.sticker),weight:(b=a.weight)!=null?b:1,isNewSticker:a.isNewSticker})};f._addSaveTask=function(){var a=this;(!this._idleTaskId||!d("WAWebIdleTaskRunner").IdleCallbackTasks.isInQueue(this._idleTaskId))&&(this._idleTaskId=d("WAWebIdleTaskRunner").IdleCallbackTasks.enqueue(function(){a._saveToDb()}))};f._saveToDb=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=this.toArray().map(function(a){var b=a.sticker.toDbData();return{id:a.id,timestamp:a.timestamp,msgId:a.msgId,weight:a.weight,sticker:{id:b.id,index:b.index,width:b.width,height:b.height,size:b.size,mimetype:b.mimetype,filehash:b.filehash,directPath:b.directPath,mediaKey:b.mediaKey,mediaKeyTimestamp:b.mediaKeyTimestamp,encFilehash:b.encFilehash,deprecatedMms3Url:b.deprecatedMms3Url,type:"sticker"}}});d("WALogger").LOG(q(),a.length);try{var b=d("WAWebSchemaRecentStickers").getRecentStickersTable(),c=(yield b.count());d("WALogger").LOG(p(),c);yield b.clear();yield b.bulkCreateOrReplace(a);c=(yield b.count());d("WALogger").LOG(o(),c)}catch(a){d("WALogger").ERROR(n()).sendLogs(a)}});function a(){return a.apply(this,arguments)}return a}();f.addStickerWithMediaData=function(a){var b=a.mediaKey,c=a.mediaData,e=a.encFilehash,f=a.id;a=a.stickerSentTs;this.addNewSticker(new(d("WAWebStickerModel").StickerModel)(babelHelpers["extends"]({},c,{mediaKey:b,encFilehash:e})),f.toString(),a)};f.addNewSticker=function(a,b,c){a.id||(a.id=a.filehash);var e=this.get(a.id)==null;this.addStickersAndPersistToDB([[a,(a=c)!=null?a:d("WATimeUtils").unixTimeMs(),b]],e)};f.addStickersAndPersistToDB=function(a,b){var c=this;b===void 0&&(b=!1);d("WALogger").LOG(m(),a.length);if(a.length===0)return;var e=new Set(a.map(function(a){return a[0].id}));a=a.reduce(function(a,b){var c=b[0],d=b[1];b=b[2];if(e.has(c.id)){e["delete"](c.id);c=[[c,d,b]];return c.concat(a)}return a},[]);var f=[],g=[];a.forEach(function(a){var d=a[0],e=a[1];a=a[2];var h=c.get(d.id);if(h)h.timestamp<=e&&(h.timestamp=e),g.push(h);else{h=c._dbDataToModel({id:d.id,timestamp:e,sticker:{id:d.id,index:d.index,width:d.width,height:d.height,size:d.size,mimetype:d.mimetype,filehash:d.filehash,directPath:d.directPath,mediaKey:d.mediaKey,mediaKeyTimestamp:d.mediaKeyTimestamp,encFilehash:d.encFilehash,deprecatedMms3Url:d.deprecatedMms3Url,type:"sticker"},msgId:a,weight:d.weight!=null?Number(d.weight.toFixed(2)):1,isNewSticker:b});f.push(h);g.push(h)}});g.length>0&&(d("WALogger").LOG(l()),this.adjustWeight(g),this.addAndSort(f),this._hasInitializedFromCache&&(d("WALogger").LOG(k()),this._addSaveTask()))};f.replaceAndEnqueue=function(a,b){b===void 0&&(b=!1);if(this.length>0){var c=this.map(function(a){return a.id});this.remove(c)}if(a.length===0){this._addSaveTask();return}this.addStickersAndPersistToDB(a,b)};f.updateDirectPath=function(a,b){a=this.get(a);(a==null?void 0:a.sticker)?(a.sticker.directPath=b,this.set([a],{remove:!1,add:!1,silent:!0,sort:!1}),this._addSaveTask()):d("WALogger").ERROR(j())};f.updateStickerMediaData=function(a,b){a=this.get(a);if(b==null||a==null)return;b.directPath!=null&&(a.sticker.directPath=b.directPath);b.encFilehash!=null&&(a.sticker.encFilehash=b.encFilehash);b.mediaKey&&(a.sticker.mediaKey=b.mediaKey);b.mediaKeyTimestamp&&(a.sticker.mediaKeyTimestamp=b.mediaKeyTimestamp);this.set([a],{remove:!1,add:!1,silent:!0,sort:!1});this._addSaveTask()};f.updateRecentStickerWithNewSticker=function(a,b){a=this.get(a);if(a==null)return;a.sticker=new(d("WAWebStickerModel").StickerModel)(b);this.set([a],{remove:!1,add:!1,silent:!0,sort:!1});this._addSaveTask()};f.associateStickerWithMsg=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c;b=(yield d("WAWebMsgCollection").MsgCollection.getMessagesById([b]));b=b.messages;var e=((c=a.mediaObject)==null?void 0:c.associatedMsgs())||[];a.mediaObject&&(e.length===0||!b.some(function(a){return e.includes(a)}))&&d("WAWebMediaStorage").associateMediaWithMsg(a.mediaObject,b[b.length-1])});function c(b,c){return a.apply(this,arguments)}return c}();f.initializeFromCache=function(a){var b=this;this._hasInitializedFromCache=!0;a=a.map(function(a){a=b._dbDataToModel(a);a.msgId!=null&&b.associateStickerWithMsg(a.sticker,a.msgId);return a});var c=this.toArray();c.length>0&&a.forEach(function(a){return a.weight=Number((a.weight*Math.pow(.9,c.length)).toFixed(2))});this.addAndSort(a);if(c.length){var d=new Set(a.map(function(a){return a.id}));c.some(function(a){return!d.has(a)})&&this._addSaveTask()}};f.addAndSort=function(a){this.add(a),this.sort(),this.length>r&&this._hasInitializedFromCache&&(d("WALogger").LOG(i(),this.length),this.set(this.toArray().slice(0,r)))};f.removeAndSave=function(a,b){b===void 0&&(b={});a=this.remove(a,b);a.length&&this._addSaveTask();d("WALogger").LOG(h(),this.length);return a};f.adjustWeight=function(a){var b=new Set(a.map(function(a){return a.id}));this.filter(function(a){return!b.has(a.id)}).forEach(function(a){return a.weight=Number((a.weight*.9).toFixed(2))});a.forEach(function(a){a.isNewSticker===!0?a.isNewSticker=void 0:a.weight=Number((a.weight+1).toFixed(2))})};return e}(d("WAWebBaseCollection").BaseCollection);a.model=c("WAWebRecentStickerModel");e=new a();g.RecentStickerCollectionMd=e}),98); __d("WAWebStickerCollection",["WAWebBaseCollection","WAWebStickerModel","err"],(function(a,b,c,d,e,f,g){a={PENDING:"PENDING",SUCCESS:"SUCCESS",ERROR:"ERROR"};b=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}var d=b.prototype;d.fetch=function(a){throw c("err")(this.constructor.name+".fetch is not implemented")};return b}(d("WAWebBaseCollection").BaseCollection);b.model=d("WAWebStickerModel").StickerModel;e=new b();g.FETCH_STATE=a;g.StickerCollectionImpl=b;g.StickerCollection=e}),98); __d("WAWebStickerDownloadCollection",["WALogger","WATimeUtils","WAWebIdleTaskRunner","WAWebSchemaStickerDownload","WAWebStickerPackCollectionMd","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["StickerDownloadCollection attempt to save to database failed"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Sticker Downloads: after save, sticker downloads in DB with length: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Sticker Downloads: before save, sticker downloads in DB with length: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["Sticker Downloads: need to save sticker downloads in DB with length: ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["Sticker Download: length of stickers will be removed: ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["Sticker Download: sticker pack already exists in collection"]);m=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(c,a);function c(){return a.apply(this,arguments)||this}var e=c.prototype;e.addAndPersist=function(a){if(this.get(a.id)!=null){d("WALogger").LOG(m());return}this.add(a);this.$StickerDownloadCollectionImpl$p_2()};e.removeAndPersist=function(a){a=this.remove(a);a.length&&(d("WALogger").LOG(l(),a.length),this.$StickerDownloadCollectionImpl$p_2());return a};e.$StickerDownloadCollectionImpl$p_2=function(){var a=this;(!this.$StickerDownloadCollectionImpl$p_1||!d("WAWebIdleTaskRunner").IdleCallbackTasks.isInQueue(this.$StickerDownloadCollectionImpl$p_1))&&(this.$StickerDownloadCollectionImpl$p_1=d("WAWebIdleTaskRunner").IdleCallbackTasks.enqueue(function(){a.$StickerDownloadCollectionImpl$p_3()}))};e.$StickerDownloadCollectionImpl$p_3=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=this.toArray().map(function(a){return{id:a.id,timestamp:d("WATimeUtils").unixTime()}});d("WALogger").LOG(k(),a.length);try{var b=d("WAWebSchemaStickerDownload").getStickerDownloadTable(),c=(yield b.count());d("WALogger").LOG(j(),c);yield b.clear();yield b.bulkCreateOrReplace(a);c=(yield b.count());d("WALogger").LOG(i(),c)}catch(a){d("WALogger").ERROR(h()).sendLogs(a)}});function c(){return a.apply(this,arguments)}return c}();return c}(d("WAWebStickerPackCollectionMd").StickerPackCollection);c=new a();g.StickerDownloadCollection=c}),98); __d("WAWebStickerModel",["WALogger","WATimeUtils","WAWebABProps","WAWebBaseModel","WAWebMedia","WAWebMediaData","WAWebMediaTypes","once"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["id: ",", error: ",""]);h=function(){return a};return a}a=c("once")(function(){return new i({id:"placeholder",isPlaceholder:!0})});b=c("once")(function(){return new i({id:"createButton",isCreateButton:!0})});e=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.mediaData=d("WAWebBaseModel").session(),c.mediaObject=d("WAWebBaseModel").prop(),c.deprecatedMms3Url=d("WAWebBaseModel").prop(),c.directPath=d("WAWebBaseModel").prop(),c.filehash=d("WAWebBaseModel").prop(),c.height=d("WAWebBaseModel").prop(),c.index=d("WAWebBaseModel").prop(),c.mediaKey=d("WAWebBaseModel").prop(),c.mediaKeyTimestamp=d("WAWebBaseModel").prop(),c.mimetype=d("WAWebBaseModel").prop(),c.size=d("WAWebBaseModel").prop(),c.type=d("WAWebBaseModel").prop(d("WAWebMediaTypes").OUTWARD_TYPES.STICKER),c.encFilehash=d("WAWebBaseModel").prop(),c.width=d("WAWebBaseModel").prop(),c.weight=d("WAWebBaseModel").prop(),c.stickerPackId=d("WAWebBaseModel").prop(),c.stickerPackName=d("WAWebBaseModel").prop(),c.stickerPackPublisher=d("WAWebBaseModel").prop(),c.isPlaceholder=d("WAWebBaseModel").prop(),c.isCreateButton=d("WAWebBaseModel").prop(),b)||babelHelpers.assertThisInitialized(c)}var e=b.prototype;e.initialize=function(){var b=this;a.prototype.initialize.call(this);var e=new(c("WAWebMediaData"))();this.addChild("mediaData",e);d("WAWebABProps").getABPropConfigValue("web_sticker_suggestions_enable")&&this.listenTo(e,"change:emojis",function(a){a.emojis!=null&&(a.emojis.length&&b.trigger("sticker_mediaData_emojis_updated"),b.stopListening(e,"change:emojis"))});!this.isPlaceholder&&!this.isCreateButton&&d("WAWebMedia").registerSticker(this)};e.downloadMedia=function(a){var b=this;return d("WAWebMedia").downloadStickerOrStickerPackIcon(this,"STICKER",a)["catch"](function(a){d("WALogger").ERROR(h(),b.id,String(a.stack||a)).tags("non-sad").sendLogs("sticker-panel:sticker download failed")})};e.toDbData=function(){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:this.mediaKeyTimestamp!=null?this.mediaKeyTimestamp:d("WATimeUtils").unixTime(),encFilehash:this.encFilehash,deprecatedMms3Url:this.deprecatedMms3Url,type:d("WAWebMediaTypes").OUTWARD_TYPES.STICKER,weight:this.weight}};e["delete"]=function(){a.prototype["delete"].call(this),d("WAWebMedia").deregisterSticker(this)};return b}(d("WAWebBaseModel").BaseModel);e.Proxy="sticker";e.getPlaceholder=a;e.getCreateButton=b;var i=d("WAWebBaseModel").defineModel(e);i.getPlaceholder=a;g.Sticker=e;g.StickerModel=i}),98); __d("WAWebStickerPackCollectionMd",["$InternalEnum","WAAbortError","WALogger","WATimeUtils","WAWebBaseCollection","WAWebFetchFirstPartyStickerPacksAction","WAWebL10N","WAWebStickerConstants","WAWebStickerPackModelMd","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["First party sticker pack request failed: error: ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["First party sticker pack request cancelled"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["First party sticker packs request failed: error: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["First party sticker packs request cancelled"]);k=function(){return a};return a}var l=b("$InternalEnum").Mirrored(["INITIAL","PENDING","SUCCESS","ERROR"]);a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var b;b=a.call(this)||this;b.fetchState=l.INITIAL;b.packFetchState=new Map();b.$StickerPackCollection$p_1=null;b.$StickerPackCollection$p_2=new Map();b.$StickerPackCollection$p_3=null;b.$StickerPackCollection$p_4=new Map();b.listenTo(c("WAWebL10N"),"locale_change",function(){return b.$StickerPackCollection$p_5()});return b}var f=e.prototype;f.$StickerPackCollection$p_5=function(){this.$StickerPackCollection$p_6(),this.reset()};f.$StickerPackCollection$p_6=function(){var a;(a=this.$StickerPackCollection$p_3)==null?void 0:a.abort();this.$StickerPackCollection$p_3=null;this.$StickerPackCollection$p_4.forEach(function(a){return a.abort()});this.$StickerPackCollection$p_4.clear();this.$StickerPackCollection$p_7();this.$StickerPackCollection$p_8();this.$StickerPackCollection$p_1=null;this.$StickerPackCollection$p_2.clear()};f.$StickerPackCollection$p_9=function(a){if(a===this.fetchState)return;this.fetchState=a;this.trigger("change:fetchState",a)};f.$StickerPackCollection$p_7=function(){this.$StickerPackCollection$p_9(l.INITIAL)};f.$StickerPackCollection$p_10=function(a,b){if(b===this.packFetchState.get(a))return;this.packFetchState.set(a,b);this.trigger("change:packFetchState",a,b)};f.$StickerPackCollection$p_8=function(){this.packFetchState.clear(),this.trigger("change:packFetchState")};f.$StickerPackCollection$p_11=function(a,b,c){var d=this;this.$StickerPackCollection$p_12(a,b,function(b,e){var f=c[e-a];if(!b)f&&d.add(f);else if(!f){var g=b;while(g)d.remove(g),g=d.at(e)}else b.id===f.id&&(b.imageDataHash!==f.imageDataHash||b.index!==f.index)?(d.remove(b,{silent:!0}),d.add(f)):(d.remove(b),d.add(f))});this.$StickerPackCollection$p_8();this.$StickerPackCollection$p_2.clear()};f.$StickerPackCollection$p_12=function(a,b,c){for(a=a;a<b;a++){var d=this.at(a);c(d,a)}};f.fetch=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a;if(this.fetchState===l.PENDING||this.fetchState===l.SUCCESS&&d("WATimeUtils").unixTime()-((a=this.$StickerPackCollection$p_1)!=null?a:0)<d("WAWebStickerConstants").STICKER_PACK_FETCH_TIMEOUT)return;this.$StickerPackCollection$p_9(l.PENDING);this.$StickerPackCollection$p_1=d("WATimeUtils").unixTime();this.$StickerPackCollection$p_3=new AbortController();try{a=(yield d("WAWebFetchFirstPartyStickerPacksAction").fetchFirstPartyStickerPacks({signal:this.$StickerPackCollection$p_3.signal}));var b=Math.max(this.length,a.length);this.$StickerPackCollection$p_11(0,b,a);this.$StickerPackCollection$p_9(l.SUCCESS)}catch(a){this.$StickerPackCollection$p_9(l.ERROR);if(a.name===d("WAAbortError").ABORT_ERROR){d("WALogger").LOG(k());return}d("WALogger").WARN(j(),a).sendLogs("sticker-packs-fetch-request-failed")}});function c(){return a.apply(this,arguments)}return c}();f.fetchStickerPack=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b;if(!a)return;if(this.get(a))return;var c=this.packFetchState.get(a);b=(b=this.$StickerPackCollection$p_2.get(a))!=null?b:0;if(c===l.PENDING||c===l.SUCCESS&&d("WATimeUtils").unixTime()-b<d("WAWebStickerConstants").STICKER_PACK_FETCH_TIMEOUT)return;this.$StickerPackCollection$p_10(a,l.PENDING);this.$StickerPackCollection$p_2.set(a,d("WATimeUtils").unixTime());c=new AbortController();this.$StickerPackCollection$p_4.set(a,c);try{b=(yield d("WAWebFetchFirstPartyStickerPacksAction").fetchFirstPartyStickerPack({id:a,signal:c.signal}));this.$StickerPackCollection$p_10(a,l.SUCCESS);this.add(b)}catch(b){this.$StickerPackCollection$p_10(a,l.ERROR);if(b.name===d("WAAbortError").ABORT_ERROR){d("WALogger").LOG(i());return}d("WALogger").WARN(h(),b).sendLogs("sticker-packs-fetch-request-failed")}});function c(b){return a.apply(this,arguments)}return c}();f["delete"]=function(){a.prototype["delete"].call(this),this.stopListening(),this.$StickerPackCollection$p_6()};return e}(d("WAWebBaseCollection").BaseCollection);a.model=d("WAWebStickerPackModelMd").StickerPackModel;a.comparator=function(a,b){if(a.index<b.index)return-1;return a.index>b.index?1:0};e=new a();g.FetchState=l;g.StickerPackCollection=a;g.StickerPackCollectionMd=e}),98); __d("WAWebStickerPackModel",["Promise","WALogger","WAWebBaseModel","WAWebMedia","WAWebMediaData","WAWebMediaTypes","WAWebStickerPackStickerCollection","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["id: ",", error: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["StickerPackModel ",""]);j=function(){return a};return a}var k="placeholder:",l="image/png";a=function(a){var b=a.index;a=a.page;return new m({id:""+k+b,index:b,page:a})};e=function(a){babelHelpers.inheritsLoose(e,a);function e(){var b,f;for(var g=arguments.length,h=new Array(g),i=0;i<g;i++)h[i]=arguments[i];return(b=f=a.call.apply(a,[this].concat(h))||this,f.id=d("WAWebBaseModel").prop(),f.index=d("WAWebBaseModel").prop(),f.name=d("WAWebBaseModel").prop(),f.page=d("WAWebBaseModel").prop(),f.url=d("WAWebBaseModel").prop(),f.mimetype=d("WAWebBaseModel").prop(l),f.mediaData=d("WAWebBaseModel").session(),f.mediaObject=d("WAWebBaseModel").prop(),f.directPath=d("WAWebBaseModel").prop(),f.filehash=d("WAWebBaseModel").prop(),f.mediaKey=d("WAWebBaseModel").prop(),f.mediaKeyTimestamp=d("WAWebBaseModel").prop(),f.size=d("WAWebBaseModel").prop(),f.type=d("WAWebBaseModel").prop(d("WAWebMediaTypes").OUTWARD_TYPES.IMAGE),f.encFilehash=d("WAWebBaseModel").prop(),f.deprecatedMms3Url=d("WAWebBaseModel").derived(function(){return this.isFirstParty?"":this.url},["url","isFirstParty"]),f.stickers=d("WAWebBaseModel").derived(function(){this.$StickerPack$p_1=this.$StickerPack$p_1||new(c("WAWebStickerPackStickerCollection"))(this.id.split("#")[0],this.isFirstParty);return this.$StickerPack$p_1},["id"]),f.isPlaceholder=d("WAWebBaseModel").derived(function(){return e.isPlaceholderId(this.id)},["id"]),f.isFirstParty=d("WAWebBaseModel").derived(function(){return Boolean(this.url)&&!this.mediaKey},["url","mediaKey"]),b)||babelHelpers.assertThisInitialized(f)}var f=e.prototype;f.initialize=function(){a.prototype.initialize.call(this);!this.isPlaceholder&&!this.isFirstParty&&(this.addChild("mediaData",new(c("WAWebMediaData"))({renderableUrl:""})),d("WAWebMedia").registerStickerPackIcon(this));var b=c("err")("StickerPackModel is not initialized");d("WALogger").LOG(j(),b).sendLogs("used-legacy-sticker-pack")};f.downloadMedia=function(){var a=this;return this.isPlaceholder||this.isFirstParty?(h||(h=b("Promise"))).resolve():d("WAWebMedia").downloadStickerOrStickerPackIcon(this,"STICKER_PACK")["catch"](function(b){d("WALogger").ERROR(i(),a.id,String(b.stack||b)).sendLogs("sticker-panel:sticker-pack download failed")})};f["delete"]=function(){a.prototype["delete"].call(this),d("WAWebMedia").deregisterStickerPackIcon(this)};return e}(d("WAWebBaseModel").BaseModel);e.Proxy="stickerPack";e.createPlaceholder=a;e.isPlaceholderId=function(a){return new RegExp("^"+k).test(a)};var m=d("WAWebBaseModel").defineModel(e);m.createPlaceholder=a;m.isPlaceholderId=e.isPlaceholderId;g.PRE_PLACEHOLDER_ID=k;g.StickerPackModel=m}),98); __d("WAWebStickerPackModelMd",["WAWebBaseModel","WAWebStickerPackStickerCollection"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.index=d("WAWebBaseModel").prop(),c.id=d("WAWebBaseModel").prop(),c.name=d("WAWebBaseModel").prop(),c.publisher=d("WAWebBaseModel").prop(),c.description=d("WAWebBaseModel").prop(),c.fileSize=d("WAWebBaseModel").prop(),c.imageDataHash=d("WAWebBaseModel").prop(),c.animated=d("WAWebBaseModel").prop(),c.previewImageIds=d("WAWebBaseModel").prop(),c.trayImageId=d("WAWebBaseModel").prop(),c.trayImagePreview=d("WAWebBaseModel").prop(),c.stickers=d("WAWebBaseModel").session(),b)||babelHelpers.assertThisInitialized(c)}var e=b.prototype;e.initialize=function(){a.prototype.initialize.call(this);var b=!0;this.stickers=new(c("WAWebStickerPackStickerCollection"))(this.id,b)};e.toDBData=function(){return{id:this.id}};return b}(d("WAWebBaseModel").BaseModel);a.Proxy="stickerPackMd";b=d("WAWebBaseModel").defineModel(a);g.StickerPack=a;g.StickerPackModel=b}),98); __d("WAWebStickerPackStickerCollection",["Promise","WATimeUtils","WAWebFetchFirstPartyStickersAction","WAWebNoop","WAWebStickerCollection","WAWebStickerConstants","WAWebStickerPackModel"],(function(a,b,c,d,e,f,g){var h;a=function(a){babelHelpers.inheritsLoose(e,a);function e(b,c){var d;d=a.call(this)||this;d.stickerPackId=b;d.isFirstParty=c;d._firstPartyFetchTimestamp=null;b=e._cache[d.stickerPackId];if(b)return b||babelHelpers.assertThisInitialized(d);var f,g=babelHelpers.assertThisInitialized(d);Object.defineProperty(babelHelpers.assertThisInitialized(d),"fetchState",{get:function(){return f},set:function(a){f!==a&&(f=a,g.trigger("change:fetchState",a))}});return d}var f=e.prototype;f.fetch=function(a){var e,f=this;e=this.isFirstParty&&d("WATimeUtils").unixTime()-((e=this._firstPartyFetchTimestamp)!=null?e:0)>=d("WAWebStickerConstants").STICKER_PACK_FETCH_TIMEOUT;(a||e)&&this.fetchState!==d("WAWebStickerCollection").FETCH_STATE.PENDING&&delete this._fetchPromise;if(this._fetchPromise)return this._fetchPromise;this.fetchState=d("WAWebStickerCollection").FETCH_STATE.PENDING;if(d("WAWebStickerPackModel").StickerPackModel.isPlaceholderId(this.stickerPackId)){this._fetchPromise=new(h||(h=b("Promise")))(c("WAWebNoop"));return this._fetchPromise}if(this.isFirstParty)this._firstPartyFetchTimestamp=d("WATimeUtils").unixTime(),a=d("WAWebFetchFirstPartyStickersAction").fetchFirstPartyStickers(this.stickerPackId);else return(h||(h=b("Promise"))).resolve();this._fetchPromise=a.then(function(a){var b=Math.max(f.length||a.length);f._resetRange(0,b,a);f.fetchState=d("WAWebStickerCollection").FETCH_STATE.SUCCESS})["catch"](function(){f.fetchState=d("WAWebStickerCollection").FETCH_STATE.ERROR});return this._fetchPromise};f._resetRange=function(a,b,c){var d=this;this._forEachInRange(a,b,function(b,e){e=c[e-a];!b?e&&d.add(e):!e?d.remove(b):b.id===e.id?b.set(e):(d.remove(b),d.add(e))})};f._forEachInRange=function(a,b,c){for(a=a;a<b;a++){var d=this.at(a);c(d,a)}};return e}(d("WAWebStickerCollection").StickerCollectionImpl);a._cache={};a.comparator=function(a,b){if(a.index<b.index)return-1;return a.index>b.index?1:0};g["default"]=a}),98); __d("WAWebStickerSearchCollection",["WALogger","WAWebBaseCollection","WAWebEmoji","WAWebEmojiKeywordToUnicode","WAWebSearchFirstPartyStickersAction","WAWebStickerModel","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Sticker search request failed: error: ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["StickerMoodCollection cache was invalid, re-searching."]);i=function(){return a};return a}var j={HAPPY:["\ud83d\ude02","\ud83e\udd23","\ud83d\ude00","\ud83d\ude01","\ud83d\ude06","\ud83d\ude42","\ud83d\ude07","\u263a\ufe0f","\ud83d\ude04","\ud83d\ude03"],LOVE:["\ud83d\ude0d","\ud83d\ude18","\u2764\ufe0f","\ud83d\udc95","\ud83e\udd70","\ud83d\ude17","\ud83d\ude19","\ud83d\ude3b","\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d\udc69","\ud83d\udc90","\ud83d\udc8c","\ud83d\udc9b","\ud83d\udc9a","\ud83d\udc99","\ud83d\udc9c","\ud83d\udc93","\ud83d\udc98","\ud83d\udc8f","\ud83d\udc91","\ud83c\udf39","\ud83e\udd1f","\ud83c\udfe9"],GREETINGS:["\ud83d\udc4b","\ud83d\ude02","\ud83e\udd23","\ud83d\ude4f","\u270b","\ud83e\uddd5","\ud83d\udeb6\u200d\u2640\ufe0f","\ud83d\udeb6","\ud83d\udc60","\ud83e\udd7e","\ud83d\ude48","\ud83e\udd9b","\ud83c\udf3a","\u26a1","\ud83c\udfaf","\ud83d\ude84","\ud83d\ude85","\ud83d\udc92","\ud83d\uded5","\ud83d\udee3\ufe0f","\ud83d\udd49\ufe0f","\ud83d\udd0a"],SAD:["\ud83d\ude2d","\ud83d\ude14","\ud83d\ude22","\ud83d\ude1e","\ud83d\ude1f","\ud83d\ude15","\ud83d\ude41","\u2639\ufe0f","\ud83d\ude16","\ud83d\ude2b","\ud83d\ude29","\ud83e\udd7a","\ud83d\ude25","\ud83d\ude13","\ud83d\ude2a","\ud83d\ude3f","\ud83d\udca7","\ud83d\udc94"],ANGRY:["\ud83d\ude20","\ud83d\ude21","\ud83d\ude24","\ud83d\udc7a","\ud83d\udca2","\ud83d\uddef\ufe0f","\ud83d\udc7f"],CELEBRATE:["\ud83e\udd73","\ud83e\udd42","\ud83c\udf88","\ud83c\udf8a","\ud83c\udf89"]};a=function(a){babelHelpers.inheritsLoose(c,a);function c(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.$StickerSearchCollectionImpl$p_1=new Map(),c.$StickerSearchCollectionImpl$p_2=!1,c.$StickerSearchCollectionImpl$p_4=!0,b)||babelHelpers.assertThisInitialized(c)}var e=c.prototype;e.isFetchingData=function(){return this.$StickerSearchCollectionImpl$p_4};e.hasFetchedData=function(){return this.$StickerSearchCollectionImpl$p_2};e.setStartFetching=function(){this.$StickerSearchCollectionImpl$p_4=!0,this.trigger("start_fetching")};e.setStopFetching=function(){this.$StickerSearchCollectionImpl$p_4=!1,this.trigger("stop_fetching")};e.search=function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){this.$StickerSearchCollectionImpl$p_3!==b&&this.$StickerSearchCollectionImpl$p_2&&a.prototype["delete"].call(this);var c=b.trim().toUpperCase();if(this.$StickerSearchCollectionImpl$p_1.has(b)){var e=this.$StickerSearchCollectionImpl$p_1.get(b);if(e!=null){this.add(e);this.$StickerSearchCollectionImpl$p_3=b;return}d("WALogger").LOG(i())}e=[];if(Object.prototype.hasOwnProperty.call(j,c))e.push.apply(e,j[c]);else{c=d("WAWebEmoji").EmojiUtil.containsOnlyEmoji(c)?d("WAWebEmoji").EmojiUtil.splitEmojis(c):d("WAWebEmojiKeywordToUnicode").emojiKeywordToUnicodeSearch(c);if(c==null||c.length===0){this.$StickerSearchCollectionImpl$p_3=b;this.setStopFetching();a.prototype["delete"].call(this);return}e.push.apply(e,c)}this.setStartFetching();c=[];try{c=(yield d("WAWebSearchFirstPartyStickersAction").searchFirstPartyStickers(e))}catch(a){d("WALogger").WARN(h(),a).sendLogs("sticker-search-request-failed");this.setStopFetching();return}this.$StickerSearchCollectionImpl$p_1.set(b,c);this.$StickerSearchCollectionImpl$p_2=!0;this.$StickerSearchCollectionImpl$p_3=b;this.add(c);this.setStopFetching()});function e(a){return c.apply(this,arguments)}return e}();e.searchMood=function(a){return this.search(a)};e["delete"]=function(){a.prototype["delete"].call(this),this.$StickerSearchCollectionImpl$p_1=new Map(),this.$StickerSearchCollectionImpl$p_2=!1,this.$StickerSearchCollectionImpl$p_4=!1};return c}(d("WAWebBaseCollection").BaseCollection);a.model=d("WAWebStickerModel").StickerModel;c=new a();g.StickerSearchCollection=c}),98); __d("WAWebTextStatusCollection",["fbt","WAWebBaseCollection","WAWebStatusContactAction","WAWebTextStatusModel","WAWebWid","WAWebWidFactory"],(function(a,b,c,d,e,f,g,h){b=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,e;for(var f=arguments.length,g=new Array(f),h=0;h<f;h++)g[h]=arguments[h];return(b=e=a.call.apply(a,[this].concat(g))||this,e.findImpl=function(a){a=a instanceof c("WAWebWid")?d("WAWebWidFactory").toUserWid(a):d("WAWebWidFactory").createUserWid(a);return d("WAWebStatusContactAction").getStatus(a)},b)||babelHelpers.assertThisInitialized(e)}return b}(d("WAWebBaseCollection").BaseCollection);b.model=c("WAWebTextStatusModel");b.idClass=c("WAWebWid");b.staleCollection=!0;function a(){return h._(/*BTDS*/"__JHASH___HFqOsV3qQe__JHASH__").toString()}e=new b();g.getDefaultTextStatus=a;g.TextStatusCollection=e}),226); __d("WAWebTextStatusModel",["WAWebBaseModel","WAWebTextStatusCollection","WAWebWid"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.status=d("WAWebBaseModel").prop(),c.stale=d("WAWebBaseModel").session(!0),b)||babelHelpers.assertThisInitialized(c)}var c=b.prototype;c.getCollection=function(){return d("WAWebTextStatusCollection").TextStatusCollection};return b}(d("WAWebBaseModel").BaseModel);a.Proxy="textStatus";a.idClass=c("WAWebWid");b=d("WAWebBaseModel").defineModel(a);g["default"]=b}),98); __d("WAWebWamEnumTsExternalEventSource",[],(function(a,b,c,d,e,f){a=Object.freeze({CALL:1,VIDEO:2,PTT_RECORD:3,PTT_PLAY:4});f.TS_EXTERNAL_EVENT_SOURCE=a}),66); __d("WAWebTsExternalWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumTsExternalEventSource"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({TsExternal:[4574,{relativeTimestampMs:[1,a.TYPES.INTEGER],tsDuration:[2,a.TYPES.INTEGER],tsExternalEventSource:[3,d("WAWebWamEnumTsExternalEventSource").TS_EXTERNAL_EVENT_SOURCE],tsSessionId:[4,a.TYPES.INTEGER],tsTimestampMs:[5,a.TYPES.INTEGER],unifiedSessionId:[6,a.TYPES.STRING]},[1,1,1],"regular"]},{TsExternal:[]});g.TsExternalWamEvent=b}),98); __d("WAWebTimeSpentLoggingExternal",["WALogger","WAWebABProps","WAWebClock","WAWebTimeSpentLoggingSession","WAWebTsExternalWamEvent","WAWebUnifiedSession"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[time-spent][external] next interval for ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[time-spent][external] preparing to log ",": ","ms"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[time-spent][external] "," duration (","ms) too short to log"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[time-spent][external] begin ",""]);k=function(){return a};return a}var l=1e3,m=new Set();function a(){return m.size>0}function b(a){var b=d("WAWebTimeSpentLoggingSession").getOrInitTimeSpentSession();d("WALogger").DEV(k(),a);var c={source:a,tsSessionId:b.id,startTimeMs:b.relativeTimestampMs};if(d("WAWebABProps").getABPropConfigValue("unified_session_log_ts_event")){c.tsTimestampMs=d("WAWebClock").Clock.getServerTimeMs();a=d("WAWebUnifiedSession").UnifiedSessionManager.getSessionId();a!=null&&(c.unifiedSessionId=a)}o(c);m.add(c);var e=!1;return function(){if(e)return;q(c);e=!0}}function n(a,b){b=b-a.startTimeMs;if(b<l){d("WALogger").DEV(j(),a.source,b);return}d("WALogger").DEV(i(),a.source,b);b={tsSessionId:a.tsSessionId,tsDuration:Math.floor(b/1e3),tsExternalEventSource:a.source,relativeTimestampMs:a.startTimeMs};d("WAWebABProps").getABPropConfigValue("unified_session_log_ts_event")&&(a.tsTimestampMs!=null&&(b.tsTimestampMs=a.tsTimestampMs),a.unifiedSessionId!=null&&(b.unifiedSessionId=a.unifiedSessionId));return b}function o(a){a.intervalTimeoutId=self.setTimeout(function(){return p(a)},d("WAWebABProps").getABPropConfigValue("ts_session_duration_ms")/2)}function p(a){d("WAWebTimeSpentLoggingSession").markTimeSpentActivity();d("WALogger").DEV(h(),a.source);var b=d("WAWebTimeSpentLoggingSession").getOrInitTimeSpentSession();b=b.relativeTimestampMs;var c=n(a,b);if(c==null)return;new(d("WAWebTsExternalWamEvent").TsExternalWamEvent)(c).commit();a.startTimeMs=b;o(a)}function q(a){a.intervalTimeoutId!=null&&self.clearTimeout(a.intervalTimeoutId);m["delete"](a);var b=d("WAWebTimeSpentLoggingSession").getOrInitTimeSpentSession();b=b.relativeTimestampMs;a=n(a,b);if(a==null)return;new(d("WAWebTsExternalWamEvent").TsExternalWamEvent)(a).commit()}g.tsExternalEventsInProgress=a;g.beginTsExternalEvent=b}),98); __d("WAWebWamEnumReferrerAction",[],(function(a,b,c,d,e,f){a=Object.freeze({NULLSTATE_ASK_META_AI:1,TYPEAHEAD_ASK_META_AI:2,NULLSTATE_PAPER_PLANE:3,TYPEAHEAD_PAPER_PLANE:4,TYPEAHEAD_SEND:5,FAVICON:6,THREAD_OPEN:7,MY_STATUS_OVERLFOW_MENU_OPTION:8,AI_WIDGET:9,FAB_MM_TAP:10});f.REFERRER_ACTION=a}),66); __d("WAWebWamEnumThreadType",[],(function(a,b,c,d,e,f){a=Object.freeze({GROUP:1,BROADCAST:2,INDIVIDUAL:3,STATUS:4,CHANNEL:5,SUB_GROUP:6,DEFAULT_SUB_GROUP:7,PARENT_GROUP:8,BOT:9});f.THREAD_TYPE=a}),66); __d("WAWebTsNavigationWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumEntryPointConversationInitiated","WAWebWamEnumProductArea","WAWebWamEnumReferrerAction","WAWebWamEnumThreadType","WAWebWamEnumTsSurface","WAWebWamEnumTypeOfGroupEnum"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({TsNavigation:[4334,{cid:[19,a.TYPES.STRING],entryPointConversationInitiated:[23,d("WAWebWamEnumEntryPointConversationInitiated").ENTRY_POINT_CONVERSATION_INITIATED],entryPointConversionApp:[24,a.TYPES.STRING],entryPointConversionSource:[25,a.TYPES.STRING],groupSize:[1,a.TYPES.INTEGER],isCatalogVisible:[29,a.TYPES.BOOLEAN],isCloudapi:[26,a.TYPES.BOOLEAN],isMetaAiThread:[30,a.TYPES.BOOLEAN],isOnpremises:[27,a.TYPES.BOOLEAN],isSmb:[28,a.TYPES.BOOLEAN],navigationDestination:[2,d("WAWebWamEnumTsSurface").TS_SURFACE],navigationDestinationProductArea:[34,d("WAWebWamEnumProductArea").PRODUCT_AREA],navigationDestinationViewName:[35,a.TYPES.STRING],navigationSource:[3,d("WAWebWamEnumTsSurface").TS_SURFACE],referrerAction:[31,d("WAWebWamEnumReferrerAction").REFERRER_ACTION],relativeTimestampMs:[4,a.TYPES.INTEGER],smbCatalogBusinessVertical:[20,a.TYPES.STRING],smbCatalogIsCatalogVisible:[21,a.TYPES.BOOLEAN],smbCatalogIsToggleCart:[22,a.TYPES.BOOLEAN],threadType:[7,d("WAWebWamEnumThreadType").THREAD_TYPE],tsSessionId:[5,a.TYPES.INTEGER],tsTimestampMs:[32,a.TYPES.INTEGER],typeOfGroup:[6,d("WAWebWamEnumTypeOfGroupEnum").TYPE_OF_GROUP_ENUM],unifiedSessionId:[33,a.TYPES.STRING]},[1,1,1],"regular"]},{TsNavigation:[]});g.TsNavigationWamEvent=b}),98); __d("WAWebTimeSpentLoggingNavigation",["WALogger","WAShiftTimer","WAWebABProps","WAWebTimeSpentLoggingSession","WAWebTsNavigationWamEvent","WAWebUserPrefsKeys","WAWebUserPrefsStore","WAWebWamEnumTsSurface","gkx","react"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[time-spent][nav] debug logging set to "," [","]"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[time-spent][nav] found pending background navigation from ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[time-spent][nav] set pending background navigation from ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[time-spent][nav] setPendingBackgroundNavigation: already in background"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[time-spent][nav] skipping unknown -> unknown navigation."]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["[time-spent][nav] already logged navigation to ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["[time-spent][nav] missing destination for navigation from ",""]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["[time-spent][nav] flushing empty queue!"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["[time-spent][nav] exit "," [","]"]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["[time-spent][nav] cleaning up surface id "," but it's no longer visible"]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["[time-spent][nav] enter "," [","]"]);s=function(){return a};return a}var t=(h||d("react")).useEffect,u={unknown:d("WAWebWamEnumTsSurface").TS_SURFACE.UNKNOWN,"chat-list":d("WAWebWamEnumTsSurface").TS_SURFACE.CHAT_LIST,chat:d("WAWebWamEnumTsSurface").TS_SURFACE.CHAT_THREAD,"community-tab":d("WAWebWamEnumTsSurface").TS_SURFACE.COMMUNITY_TAB,"community-info":d("WAWebWamEnumTsSurface").TS_SURFACE.COMMUNITY_HOME,"community-navigation":d("WAWebWamEnumTsSurface").TS_SURFACE.COMMUNITY_NAVIGATION,"community-subgroup-switcher":d("WAWebWamEnumTsSurface").TS_SURFACE.SUBGROUP_SWITCHER,"group-info-drawer":d("WAWebWamEnumTsSurface").TS_SURFACE.CHAT_INFO_PAGE,"contact-info-drawer":d("WAWebWamEnumTsSurface").TS_SURFACE.CHAT_INFO_PAGE,"new-community-info-drawer":d("WAWebWamEnumTsSurface").TS_SURFACE.COMMUNITY_COMPOSER,"media-viewer":d("WAWebWamEnumTsSurface").TS_SURFACE.MEDIA_VIEWER,"media-drawer":d("WAWebWamEnumTsSurface").TS_SURFACE.ALL_MEDIA,camera:d("WAWebWamEnumTsSurface").TS_SURFACE.CAMERA,"youtube-player":d("WAWebWamEnumTsSurface").TS_SURFACE.STREAMING_MEDIA_VIEWER,"settings-drawer":d("WAWebWamEnumTsSurface").TS_SURFACE.SETTINGS_HOME_TAB,background:d("WAWebWamEnumTsSurface").TS_SURFACE.BACKGROUND,"tools-tab":d("WAWebWamEnumTsSurface").TS_SURFACE.TOOLS_TAB,"archived-chats-drawer":d("WAWebWamEnumTsSurface").TS_SURFACE.ARCHIVED_MESSAGES_TAB,"starred-messages-drawer":d("WAWebWamEnumTsSurface").TS_SURFACE.STARRED_MESSAGES_TAB,"forward-selection-modal":d("WAWebWamEnumTsSurface").TS_SURFACE.FORWARD_SELECTION_SCREEN,status:d("WAWebWamEnumTsSurface").TS_SURFACE.STATUS_HOME_TAB,"status-view":d("WAWebWamEnumTsSurface").TS_SURFACE.STATUS_VIEW,"status-composer-text":d("WAWebWamEnumTsSurface").TS_SURFACE.STATUS_COMPOSER_TEXT,"status-composer-media":d("WAWebWamEnumTsSurface").TS_SURFACE.STATUS_COMPOSER,"channel-updates-home":d("WAWebWamEnumTsSurface").TS_SURFACE.CHANNEL_UPDATES_HOME,"channel-updates-home-search":d("WAWebWamEnumTsSurface").TS_SURFACE.CHANNEL_UPDATES_HOME_SEARCH,"channel-thread":d("WAWebWamEnumTsSurface").TS_SURFACE.CHANNEL_THREAD,"channel-directory-home":d("WAWebWamEnumTsSurface").TS_SURFACE.CHANNEL_DIRECTORY,"channel-directory-search":d("WAWebWamEnumTsSurface").TS_SURFACE.CHANNEL_DIRECTORY_SEARCH,"channel-directory-categories-home":d("WAWebWamEnumTsSurface").TS_SURFACE.CHANNEL_DIRECTORY_CATEGORIES,"channel-directory-categories-search":d("WAWebWamEnumTsSurface").TS_SURFACE.CHANNEL_DIRECTORY_CATEGORIES_SEARCH,"channel-profile":d("WAWebWamEnumTsSurface").TS_SURFACE.CHANNEL_PROFILE,"channel-forward":d("WAWebWamEnumTsSurface").TS_SURFACE.CHANNEL_FORWARD,"channel-producer-media-editor":d("WAWebWamEnumTsSurface").TS_SURFACE.CHANNEL_PRODUCER_MEDIA_EDITOR,"channel-edit-page":d("WAWebWamEnumTsSurface").TS_SURFACE.CHANNEL_EDIT,"channel-create-page":d("WAWebWamEnumTsSurface").TS_SURFACE.CHANNEL_CREATE,"channel-delete-page":d("WAWebWamEnumTsSurface").TS_SURFACE.CHANNEL_DELETE,"channel-insights-reach":d("WAWebWamEnumTsSurface").TS_SURFACE.CHANNEL_PRODUCER_INSIGHTS_REACH,"channel-insights-growth":d("WAWebWamEnumTsSurface").TS_SURFACE.CHANNEL_PRODUCER_INSIGHTS_GROWTH,"channel-insights-followers":d("WAWebWamEnumTsSurface").TS_SURFACE.CHANNEL_PRODUCER_INSIGHTS_FOLLOWERS,"create-event":d("WAWebWamEnumTsSurface").TS_SURFACE.CREATE_EVENT,"event-info":d("WAWebWamEnumTsSurface").TS_SURFACE.EVENT_PAGE,"events-in-group":d("WAWebWamEnumTsSurface").TS_SURFACE.EVENTS_IN_GROUP,"list-management":d("WAWebWamEnumTsSurface").TS_SURFACE.LIST_MANAGEMENT},v,w=[];function a(a){t(function(){var b,c=x((b=a)!=null?b:{surface:"unknown"});return function(){return z(c)}},[])}function x(a){var b,c=Math.floor(Math.random()*Number.MAX_SAFE_INTEGER),e=y(a)?{id:c,surface:"unknown"}:babelHelpers["extends"]({},a,{id:c});b=(b=w[w.length-1])!=null?b:{surface:"background",id:-1};w.push(e);I()&&d("WALogger").DEV(s(),a.surface,w.map(function(a){return a.surface}));C(b);return c}function y(a){return(1<<u[a.surface]&d("WAWebABProps").getABPropConfigValue("ts_surface_killswitch"))!==0}function z(a){var b=w.findIndex(function(b){return b.id===a});if(b===-1){d("WALogger").LOG(r(),a);return}var c=w[b];w.splice(b,1);I()&&d("WALogger").DEV(q(),c.surface,w.map(function(a){return a.surface}));C(c)}var A=[],B=new(d("WAShiftTimer").ShiftTimer)(function(){if(A.length===0){d("WALogger").LOG(p());return}var a;for(var b of A){if(a==null){a=b;continue}a.destId===b.sourceId?(b.event.navigationSource=a.event.navigationSource,b.event.relativeTimestampMs=a.event.relativeTimestampMs):a.event.commit();a=b}(b=a)==null?void 0:b.event.commit();A=[]});function C(a){var b,c,e=w[w.length-1];e==null&&(d("WALogger").LOG(o(),a.surface),e={surface:"unknown",id:-1});if(e.id===((b=v)==null?void 0:b.id)){d("WALogger").DEV(n(),e.surface);return}b=d("WAWebTimeSpentLoggingSession").getOrInitTimeSpentSession();F();if(a.surface==="unknown"&&e.surface==="unknown"){I()&&d("WALogger").DEV(m());return}c=new(d("WAWebTsNavigationWamEvent").TsNavigationWamEvent)({tsSessionId:b.id,relativeTimestampMs:b.relativeTimestampMs,navigationSource:u[a.surface],navigationDestination:u[e.surface],groupSize:(c=e.extras)==null?void 0:c.groupSize,typeOfGroup:(c=e.extras)==null?void 0:c.typeOfGroup,threadType:(c=e.extras)==null?void 0:c.threadType,cid:(c=e.extras)==null?void 0:(c=c.channelWid)==null?void 0:c.user});d("WAWebABProps").getABPropConfigValue("unified_session_log_ts_event")&&(b.tsTimestampMs!=null&&(c.tsTimestampMs=b.tsTimestampMs),b.unifiedSessionId!=null&&(c.unifiedSessionId=b.unifiedSessionId));A.push({sourceId:a.id,destId:e.id,event:c});B.onOrBefore(100);v=e}var D=null;function b(){D=x({surface:"background"})}function E(){var a="unknown";w.length>0&&(a=w[w.length-1].surface);return a}function e(){var a=d("WAWebTimeSpentLoggingSession").getOrInitTimeSpentSession(),b=E();b==="background"&&d("WALogger").DEV(l());c("WAWebUserPrefsStore").set(d("WAWebUserPrefsKeys").KEYS.TIME_SPENT_PENDING_BACKGROUND_NAVIGATION,{id:a.id,relativeTimestampMs:a.relativeTimestampMs,source:b});d("WALogger").DEV(k(),b)}function F(){var a=c("WAWebUserPrefsStore").get(d("WAWebUserPrefsKeys").KEYS.TIME_SPENT_PENDING_BACKGROUND_NAVIGATION);if(a==null||typeof a!=="object")return;var b=a.id,e=a.relativeTimestampMs,f=a.source;if(typeof b!=="number"||typeof e!=="number"||typeof f!=="string")return;if(u[f]==null)return;d("WALogger").DEV(j(),f);b=new(d("WAWebTsNavigationWamEvent").TsNavigationWamEvent)({tsSessionId:b,relativeTimestampMs:e,navigationSource:u[f],navigationDestination:u.background});d("WAWebABProps").getABPropConfigValue("unified_session_log_ts_event")&&(typeof a.tsTimestampMs==="number"&&(b.tsTimestampMs=a.tsTimestampMs),typeof a.unifiedSessionId==="string"&&(b.unifiedSessionId=a.unifiedSessionId));b.commit();c("WAWebUserPrefsStore").set(d("WAWebUserPrefsKeys").KEYS.TIME_SPENT_PENDING_BACKGROUND_NAVIGATION,null)}function f(){if(D==null)return;z(D)}var G=!1;function H(){c("gkx")("26258")||(G=!G,d("WALogger").DEV(i(),G,w.map(function(a){return a.surface})))}function I(){return!c("gkx")("26258")?G:!1}g.useTsNavigation=a;g.tsNavigationEnter=x;g.tsNavigationExit=z;g.logTsBackgroundNavigation=b;g.setPendingBackgroundNavigation=e;g.logTsForegroundNavigation=f;g.toggleTsNavigationDebug=H}),98); __d("WAWebTsBitArrayWamEvent",["WAWebWamCodegenUtils"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({TsBitArray:[4332,{bitarrayHigh:[1,a.TYPES.INTEGER],bitarrayLength:[2,a.TYPES.INTEGER],bitarrayLow:[3,a.TYPES.INTEGER],cumulativeBits:[4,a.TYPES.INTEGER],relativeTimestampMs:[5,a.TYPES.INTEGER],sessionSeq:[6,a.TYPES.INTEGER],tsSessionId:[7,a.TYPES.INTEGER],tsTimestampMs:[8,a.TYPES.INTEGER],unifiedSessionId:[9,a.TYPES.STRING]},[1,1,1],"regular"]},{TsBitArray:[]});g.TsBitArrayWamEvent=b}),98); __d("WAWebTimeSpentLoggingBitArray",["Promise","WALogger","WAWebABProps","WAWebPermanentStorage","WAWebTsBitArrayWamEvent"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Invalid stashed time spent event"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Invalid stashed time spent event"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[time-spent] logging bitarray ",":",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[time-spent] error flushing events for ","."]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[time-spent] error parsing stashed bitarray data (",")"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["[time-spent] error flushing events for ","."]);n=function(){return a};return a}function o(a,b){var d=""+a.bitmap[0];for(var e=1;e<a.bitmap.length;++e)d+=":"+a.bitmap[e];e=a.sessionId+":"+a.sessionSeq+":"+a.sessionCum+(":"+a.startTime+":"+a.bitmapLen+(a.relativeStartTimeMs==null?"":":"+a.relativeStartTimeMs)+"$"+d);d=c("WAWebPermanentStorage").getItem(b);if(d==null){c("WAWebPermanentStorage").setItem(b,e);return[a]}var f=q(d);f.push(a);c("WAWebPermanentStorage").setItem(b,d+"_"+e);return f}function a(a,e){a=o(a,e);(h||(h=b("Promise"))).all(a.map(p)).then(function(){return c("WAWebPermanentStorage").removeItem(e)})["catch"](function(){d("WALogger").ERROR(n(),e)})}function e(a,e){var f=c("WAWebPermanentStorage").getItem(a);if(f!=null){f=q(f);if(f==null){d("WALogger").WARN(m(),a);return}(h||(h=b("Promise"))).all(f.map(e)).then(function(){return c("WAWebPermanentStorage").removeItem(a)})["catch"](function(){d("WALogger").ERROR(l(),a)})}}function p(a){var b,c=Number(a.sessionId);b=new(d("WAWebTsBitArrayWamEvent").TsBitArrayWamEvent)({tsSessionId:Number.isSafeInteger(c)?c:-1,bitarrayLength:a.bitmapLen,bitarrayLow:a.bitmap[0],bitarrayHigh:(b=a.bitmap[1])!=null?b:void 0,cumulativeBits:a.sessionCum,relativeTimestampMs:(b=a.relativeStartTimeMs)!=null?b:void 0,sessionSeq:a.sessionSeq});d("WAWebABProps").getABPropConfigValue("unified_session_log_ts_event")&&(a.tsTimestampMs!=null&&(b.tsTimestampMs=a.tsTimestampMs),a.unifiedSessionId!=null&&(b.unifiedSessionId=a.unifiedSessionId));d("WALogger").DEV(k(),c,a.sessionSeq);return b.commitAndWaitForFlush()}function q(a){return a.length===0?[]:a.split("_").map(r).filter(Boolean)}function r(a){var b=a.split("$"),c=b[0],e=b[1];b=b.slice(2);if(b.length||!e){d("WALogger").WARN(j()).devConsole(a);return}b=c.split(":");if(!(b.length===5||b.length===6)){d("WALogger").WARN(i()).devConsole(a);return}c=new Int32Array(e.split(":").map(function(a){return Number(a)}));a={sessionId:b[0],sessionSeq:Number(b[1]),sessionCum:Number(b[2]),startTime:Number(b[3]),bitmapLen:Number(b[4]),bitmap:c};b[5]!=null&&(a.relativeStartTimeMs=Number(b[5]));return a}g.stashBitarrayData=o;g.stashAndFlushBitarray=a;g.flushBitarrays=e;g.postTsBitArrayEvent=p}),98); __d("WAWebTimeSpentLoggingSession",["WALogger","WAShiftTimer","WATimeUtils","WAWebABProps","WAWebClock","WAWebTimeSpentLoggingBitArray","WAWebTimeSpentLoggingExternal","WAWebUnifiedSession","WAWebUserPrefsKeys","WAWebUserPrefsStore","WAWebWamTimeSpentArray"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[time-spent] processing array data for an expired session, but no session found"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[time-spent] creating time spent array"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[time-spent] initializing session"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[time-spent] restored ts session: ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[time-spent] malformed ts session: ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[time-spent] no session to restore"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["[time-spent] persisted session"]);n=function(){return a};return a}var o=Math.pow(2,31)-1,p=null,q=null,r=new(d("WAShiftTimer").ShiftTimer)(function(){p!=null&&(c("WAWebUserPrefsStore").set(d("WAWebUserPrefsKeys").KEYS.TIME_SPENT_SESSION,p),d("WALogger").LOG(n()))});function s(a){a===void 0&&(a=!1);if(a){r.forceRunNow();return}a=10;r.onOrBefore(a*1e3)}function a(){var a=c("WAWebUserPrefsStore").get(d("WAWebUserPrefsKeys").KEYS.TIME_SPENT_SESSION);if(a==null||typeof a!=="object"){d("WALogger").LOG(m());p=null;return}var b=a.id,e=a.startTimestampMs,f=a.lastActivityTimestampMs,g=a.cumulativeBitsSet,h=a.sequenceId,i=a.relativeTimestampMs,j=a.tsTimestampMs,n=a.unifiedSessionId;if(typeof b!=="number"||typeof e!=="number"||typeof f!=="number"||typeof g!=="number"||typeof h!=="number"||typeof i!=="number"||typeof j!=="number"&&j!=null||typeof n!=="string"&&n!=null){d("WALogger").LOG(l(),JSON.stringify(a));p=null;return}p={id:b,startTimestampMs:e,lastActivityTimestampMs:f,cumulativeBitsSet:g,sequenceId:h,relativeTimestampMs:i,tsTimestampMs:(a=j)!=null?a:null,unifiedSessionId:(b=n)!=null?b:null};d("WALogger").LOG(k(),JSON.stringify(p))}function t(){var a=d("WATimeUtils").unixTimeMs(),b=null,c=null;if(d("WAWebABProps").getABPropConfigValue("unified_session_log_ts_event")){var e;b=d("WAWebClock").Clock.getServerTimeMs();c=(e=d("WAWebUnifiedSession").UnifiedSessionManager.getSessionId())!=null?e:null}if(p==null||a-p.lastActivityTimestampMs>=v()&&!d("WAWebTimeSpentLoggingExternal").tsExternalEventsInProgress()){q=p;d("WALogger").LOG(j());e={id:Math.floor(Math.random()*o),startTimestampMs:a,lastActivityTimestampMs:a,cumulativeBitsSet:0,sequenceId:-1,relativeTimestampMs:0,tsTimestampMs:b,unifiedSessionId:c};p=e;s(!0);return e}p.relativeTimestampMs=a-p.startTimestampMs;p.tsTimestampMs=b;p.unifiedSessionId=c;return p}function u(){t().lastActivityTimestampMs=d("WATimeUtils").unixTimeMs(),s()}function v(){return d("WAWebABProps").getABPropConfigValue("ts_session_duration_ms")}function b(){d("WALogger").LOG(i());return new(c("WAWebWamTimeSpentArray"))({getSessionData:function(){var a=t();return{relativeTimeMs:a.relativeTimestampMs,id:a.id.toString()}},postUpdate:u,loggingCallback:function(a){d("WAWebTimeSpentLoggingBitArray").stashAndFlushBitarray(w(a),d("WAWebUserPrefsKeys").KEYS.TIME_SPENT_BITARRAY_EVENT)}})}function w(a){var b=t(),c=Number(a.sessionId);if(b.id!==c){var e;if(q!=null&&((e=q)==null?void 0:e.id)===c)b=q;else{d("WALogger").WARN(h());return a}}b.cumulativeBitsSet+=a.sessionCum;b.sequenceId++;a.sessionSeq=b.sequenceId;a.sessionCum=b.cumulativeBitsSet;s(!0);return a}g.restoreTimeSpentSession=a;g.getOrInitTimeSpentSession=t;g.markTimeSpentActivity=u;g.createTimeSpentArray=b;g.preprocessTsArrayData=w}),98); __d("WAWebMexUsernameUpdateNotificationHandler",["Promise","WALogger","WAWebApiContact","WAWebChatCollection","WAWebContactSystemMsg","WAWebHandleSingleMsg","WAWebLidAwareContactsDB","WAWebQueryExistsJob","WAWebSetUsernameJob","WAWebUsernameGatingUtils","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["could not find side contact hash for username change notification."]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[mex][username][notification][username-change-side-subscriber] Received username change notification for side subscriber"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[mex][username][notification][username-delete] Received username delete notification"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[mex][username][notification][username-set] Received username change notification"]);l=function(){return a};return a}function a(a,b){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){if(!d("WAWebUsernameGatingUtils").usernameDisplayedEnabled())return;d("WALogger").LOG(l());a=c.xwa2_notify_username_on_change;c=a.username;a=a.lid;a=d("WAWebWidFactory").createUserWid(a);var e=d("WAWebApiContact").getPhoneNumber(a);yield (h||(h=b("Promise"))).all([d("WAWebSetUsernameJob").setUsernamesJob([{userId:a,username:c}].concat(e!=null?[{userId:e,username:c}]:[])),p(a,c)])});return m.apply(this,arguments)}function e(a,b){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){if(!d("WAWebUsernameGatingUtils").usernameDisplayedEnabled())return;d("WALogger").LOG(k());a=c.xwa2_notify_username_delete;c=a.lid;a=(a=a.display_name)!=null?a:"";c=d("WAWebWidFactory").createUserWid(c);var e=d("WAWebApiContact").getPhoneNumber(c);yield (h||(h=b("Promise"))).all([d("WAWebSetUsernameJob").deleteUsernamesJob([{userId:c,displayNameLID:a}].concat(e!=null?[{userId:e,displayNameLID:a}]:[])),p(c,"")])});return n.apply(this,arguments)}function f(a,b){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){if(!d("WAWebUsernameGatingUtils").usernameDisplayedEnabled())return;d("WALogger").LOG(j());a=e.xwa2_notify_username_on_update_side_sub.hash;e=(yield c("WAWebLidAwareContactsDB").equals(["contactHash"],a));if(e.length===0){d("WALogger").WARN(i());return}e=d("WAWebWidFactory").createUserWid((a=e[0])==null?void 0:a.id);a=(yield d("WAWebQueryExistsJob").queryWidUsernameExists(e));if(a!=null){yield (h||(h=b("Promise"))).all([p(e,(e=a)!=null?e:"")])}});return o.apply(this,arguments)}function p(a,b){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=d("WAWebChatCollection").ChatCollection.getChatByAccountLid(a);if(a!=null){b=d("WAWebContactSystemMsg").genUsernameChangeSystemMsg(a.id,b);yield d("WAWebHandleSingleMsg").handleSingleMsg(a.id,b,"username_change_notification")}});return q.apply(this,arguments)}g.mexHandleUsernameChange=a;g.mexHandleUsernameDelete=e;g.mexHandleUsernameChangeForSideSub=f}),98); __d("WAWebVoipHandleIncomingSignalingMessage",["Promise","WAWebBackendApi","WAWebEnvironment","asyncToGeneratorRuntime","cr:17219","cr:9457","err"],(function(a,b,c,d,e,f,g){"use strict";var h;f=(f=b("cr:9457"))!=null?f:{};var i=f.handleWindowsVoipEncRekey;f=(f=b("cr:17219"))!=null?f:{};var j=f.getWindowsBridge;function a(a,b){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if(c("WAWebEnvironment").isWindows){var e,f=(yield d("WAWebBackendApi").frontendSendAndReceive("getTcToken",{wid:a.peer_jid}));f=f.tcToken;j==null?void 0:(e=j())==null?void 0:(e=e.voip)==null?void 0:e.handleIncomingSignalingMessage(b,a.peer_platform,a.peer_app_version,a.e,a.t,(e=a.isContact)!=null?e:!1,a.peer_jid.toString(),f);return}d("WAWebBackendApi").frontendFireAndForget("handleVoipWebIncomingSignalingMessageAction",{msg:a,voipNode:b})});return k.apply(this,arguments)}function e(a,d){return i?i(a,d):(h||(h=b("Promise"))).reject(c("err")("incoming enc rekey is not expected in web"))}g.handleVoipIncomingSignalingMessage=a;g.handleVoipIncomingEncRekey=e}),98); __d("WAWebVoipSignalingEnums",["$InternalEnum"],(function(a,b,c,d,e,f){a={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};c=["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"];d={SINGLE_PARTICIPANT:"enc",GROUP_CALL:"enc_rekey_retry"};e=b("$InternalEnum")({Unknown:0,Timeout:1,Self:2,RejectDoNotDisturb:3,RejectBlocked:4,MicPermissionDenied:5,CameraPermissionDenied:6});f.TYPE=a;f.TYPE_NAME=c;f.ENC_RETRY_RECEIPT_ATTRS=d;f.EndCallReason=e}),66); __d("WAWebVoipSendGroupCallRekeyRetryReceiptJob",["WADeprecatedSendIq","WAWap","WAWebCommsWapMd","WAWebSignalStoreApi","WAWebVoipSignalingEnums","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){function a(a,b,c){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e){e===void 0&&(e=0);var f=(yield d("WAWebSignalStoreApi").waSignalStore.getRegistrationInfo());if(!f)throw c("err")("No registration info found");a=d("WAWap").wap("receipt",{to:d("WAWebCommsWapMd").DEVICE_JID(b.peer_jid),id:d("WAWap").CUSTOM_STRING(a),type:d("WAWap").CUSTOM_STRING(d("WAWebVoipSignalingEnums").ENC_RETRY_RECEIPT_ATTRS.GROUP_CALL)},d("WAWap").wap("enc_rekey",{"call-creator":d("WAWebCommsWapMd").DEVICE_JID(b.call_creator),"call-id":d("WAWap").CUSTOM_STRING(b.call_id),count:d("WAWap").INT(e+1)}),d("WAWap").wap("registration",null,d("WAWap").BIG_ENDIAN_CONTENT(f.registrationId)));d("WADeprecatedSendIq").deprecatedCastStanza(a)});return h.apply(this,arguments)}g["default"]=a}),98); __d("WAWebHandleVoipCall",["Promise","WADeprecatedSendIq","WADeprecatedWapParser","WALogger","WATimeUtils","WAWap","WAWebCommsWapMd","WAWebDBCreateLidPnMappings","WAWebEnvironment","WAWebHandleVoipOfferNotice","WAWebJidToWid","WAWebSetUsernameJob","WAWebUserPrefsMeUser","WAWebUsernameGatingUtils","WAWebVoipHandleIncomingSignalingMessage","WAWebVoipSendGroupCallRekeyRetryReceiptJob","WAWebVoipSignalingEnums","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime","cr:13666","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleVoipIncomingSignalingMessage: offer notice not supported on windows"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleVoipIncomingEncRekey: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["Parsing Error: ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["error while parsing: ",""]);l=function(){return a};return a}f=(e=b("cr:13666"))!=null?e:{};var m=f.handleWindowsVoipCallOffer;function n(a){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.jid,e=a.phoneNumber,f=a.username;a=a.flushImmediately;b=d("WAWebWidFactory").toUserWid(b);if(!c("WAWebWid").isUserLid(b))return;e!=null&&(yield d("WAWebDBCreateLidPnMappings").createLidPnMappings({mappings:[{lid:b,pn:d("WAWebWidFactory").toUserWid(e)}],flushImmediately:a,learningSource:"other"}));f!=null&&d("WAWebUsernameGatingUtils").usernameDisplayedEnabled()&&(yield d("WAWebSetUsernameJob").setUsernamesJob([{userId:b,username:f}]))});return o.apply(this,arguments)}function p(a){return d("WAWebVoipSignalingEnums").TYPE[a.tag().toUpperCase()]||d("WAWebVoipSignalingEnums").TYPE.NONE}var q=new(c("WADeprecatedWapParser"))("callParser",function(a){a.assertTag("call");var b=d("WAWebJidToWid").jidWithTypeToWid(a.attrJidWithType("from")),e=a.mapFirstChild(function(a){return a});if(e){var f,g=e.attrString("call-id"),h=d("WAWebJidToWid").jidWithTypeToWid(e.attrJidWithType("call-creator")),i=e.hasAttr("group-jid")?d("WAWebJidToWid").jidWithTypeToWid(e.attrJidWithType("group-jid")):null,j=e.hasAttr("caller_pn")?d("WAWebJidToWid").jidWithTypeToWid(e.attrJidWithType("caller_pn")):null,k=e.maybeAttrString("username");f=(f=e.maybeChild("group_info"))==null?void 0:f.mapChildren(function(a){return{jid:d("WAWebJidToWid").jidWithTypeToWid(a.attrJidWithType("jid")),user_pn:a.hasAttr("user_pn")?d("WAWebJidToWid").jidWithTypeToWid(a.attrJidWithType("user_pn")):null,username:a.maybeAttrString("username")}});b={call_id:g,call_creator:h,caller_pn:j,peer_jid:b,peer_platform:a.hasAttr("platform")?a.attrString("platform"):"",peer_app_version:a.hasAttr("version")?a.attrString("version"):"0",is_offline:a.hasAttr("offline"),type:p(e),common:{call_id:g,peer_jid:b.toString(),type:String(p(e))},group_jid:i,caller_username:k,isVideoCall:e.hasChild("video"),silence_reason:(g=(j=e.maybeChild("silence"))==null?void 0:j.maybeAttrString("reason"))!=null?g:void 0,t:a.hasAttr("t")?a.attrTime("t"):d("WATimeUtils").castToUnixTime(0),e:a.hasAttr("e")?d("WATimeUtils").castUnixTimeToMillisTime(a.attrTime("e")):d("WATimeUtils").castToMillisTime(0),group_info_updates:f};return{from:d("WAWebJidToWid").jidWithTypeToWid(a.attrJidWithType("from")),stanzaId:a.attrString("id"),payloadTag:e.tag(),message:b,callCreator:h,voipNode:e}}throw c("err")("Unrecognized call stanza")});function a(a){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=q.parse(a);if(e.error){d("WALogger").DEV(l(),a.toString());d("WALogger").ERROR(k(),e.error.toString());return(h||(h=b("Promise"))).resolve("NO_ACK")}e=e.success;var f=e.callCreator,g=e.from,o=e.message,p=e.payloadTag,r=e.stanzaId;e=e.voipNode;var u=!Boolean(o.is_offline);yield n({jid:f,phoneNumber:o.caller_pn,username:o.caller_username,flushImmediately:u});var v=o.group_info_updates;if(v!=null){var w=0;yield v.reduce(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){yield a;a=w===v.length-1;w++;return n({jid:b.jid,phoneNumber:b.user_pn,username:b.username,flushImmediately:u&&a})});return function(b,c){return a.apply(this,arguments)}}(),(h||(h=b("Promise"))).resolve())}var x=o.call_id;switch(o.type){case d("WAWebVoipSignalingEnums").TYPE.OFFER:s(g,r,x,f,o.type);m!=null?yield m(o,e):yield d("WAWebVoipHandleIncomingSignalingMessage").handleVoipIncomingSignalingMessage(o,e);return"NO_ACK";case d("WAWebVoipSignalingEnums").TYPE.ENC_REKEY:try{var y=(yield d("WAWebVoipHandleIncomingSignalingMessage").handleVoipIncomingEncRekey(o,e)),z=y.shouldRetry;y=y.retryCount;z?yield c("WAWebVoipSendGroupCallRekeyRetryReceiptJob")(r,o,y):s(g,r,x,f,d("WAWebVoipSignalingEnums").TYPE.ENC_REKEY)}catch(a){d("WALogger").ERROR(j(),a).devConsole(a)}return"NO_ACK";case d("WAWebVoipSignalingEnums").TYPE.ACCEPT:case d("WAWebVoipSignalingEnums").TYPE.REJECT:s(g,r,x,f,o.type);yield d("WAWebVoipHandleIncomingSignalingMessage").handleVoipIncomingSignalingMessage(o,e);return"NO_ACK";case d("WAWebVoipSignalingEnums").TYPE.OFFER_NOTICE:if(c("WAWebEnvironment").isWindows){d("WALogger").ERROR(i());return(h||(h=b("Promise"))).resolve("NO_ACK")}return c("WAWebHandleVoipOfferNotice")(a);default:yield d("WAWebVoipHandleIncomingSignalingMessage").handleVoipIncomingSignalingMessage(o,e);return t(g,r,p)}});return r.apply(this,arguments)}function s(a,b,c,e,f){var g;switch(f){case d("WAWebVoipSignalingEnums").TYPE.OFFER:g=d("WAWap").wap("offer",{"call-id":d("WAWap").CUSTOM_STRING(c),"call-creator":d("WAWebCommsWapMd").JID(e)});break;case d("WAWebVoipSignalingEnums").TYPE.ENC_REKEY:g=d("WAWap").wap("enc_rekey",{"call-id":d("WAWap").CUSTOM_STRING(c),"call-creator":d("WAWebCommsWapMd").JID(e)});break;case d("WAWebVoipSignalingEnums").TYPE.ACCEPT:g=d("WAWap").wap("accept",{"call-id":d("WAWap").CUSTOM_STRING(c),"call-creator":d("WAWebCommsWapMd").JID(e)});break;case d("WAWebVoipSignalingEnums").TYPE.REJECT:g=d("WAWap").wap("reject",{"call-id":d("WAWap").CUSTOM_STRING(c),"call-creator":d("WAWebCommsWapMd").JID(e)});break}d("WADeprecatedSendIq").deprecatedCastStanza(d("WAWap").wap("receipt",{to:d("WAWebCommsWapMd").JID(a),id:d("WAWap").CUSTOM_STRING(b),from:a.isLid()?d("WAWebCommsWapMd").JID(d("WAWebUserPrefsMeUser").assertGetMeLid()):d("WAWebCommsWapMd").JID(d("WAWebUserPrefsMeUser").getMeUser())},g))}function t(a,b,c){return d("WAWap").wap("ack",{to:d("WAWebCommsWapMd").JID(a),id:d("WAWap").CUSTOM_STRING(b),"class":"call",type:d("WAWap").MAYBE_CUSTOM_STRING(c)})}g.handleCall=a}),98); __d("WAWebHandleVoipOfferNotice",["Promise","WADeprecatedWapParser","WALogger","WAWap","WAWebCommsWapMd","WAWebIncomingOfferNoticeVoipHandlerAction","WAWebJidToWid"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Parsing Error: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["error while parsing: ",""]);j=function(){return a};return a}var k=new(c("WADeprecatedWapParser"))("callOfferNoticeParser",function(a){a.assertTag("call");var b=a.attrString("id"),c=d("WAWebJidToWid").jidWithTypeToWid(a.attrJidWithType("from")),e=a.child("offer_notice"),f=d("WAWebJidToWid").deviceJidToDeviceWid(e.attrDeviceJid("call-creator")),g=e.attrString("call-id"),h=e.attrString("type");e=e.attrString("media");a=a.attrTime("t");return{stanzaId:b,fromWid:c,callCreator:f,callId:g,isGroup:h==="group",isVideo:e==="video",t:a}});function a(a){var e=k.parse(a);if(e.error){d("WALogger").DEV(j(),a.toString());d("WALogger").ERROR(i(),e.error.toString());return(h||(h=b("Promise"))).resolve("NO_ACK")}a=e.success;e=a.stanzaId;var f=a.fromWid,g=a.callCreator,l=a.callId,m=a.isGroup,n=a.isVideo;a=a.t;c("WAWebIncomingOfferNoticeVoipHandlerAction")(g,l,a,n,m);return(h||(h=b("Promise"))).resolve(d("WAWap").wap("ack",{to:d("WAWebCommsWapMd").JID(f),id:d("WAWap").CUSTOM_STRING(e),"class":"call",type:d("WAWap").CUSTOM_STRING("offer_notice")}))}g["default"]=a}),98); __d("WAWebIncomingOfferNoticeVoipHandlerAction",["WALogger","WATimeUtils","WAWebCallCollection","WAWebCmd","WAWebWidFactory"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["voip:handleIncomingCallOfferNotice: Ignoring stale offer_notice"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["voip:handleIncomingCallOfferNotice: callId ",""]);i=function(){return a};return a}var j=45;function a(a,b,e,f,g){d("WALogger").LOG(i(),b);if(d("WATimeUtils").unixTime()-e>j){d("WALogger").LOG(h());return}c("WAWebCallCollection").add({id:b,isVideo:f,isGroup:g,offerTime:e,peerJid:a,isSilenced:!1},{merge:!0});d("WAWebCmd").Cmd.alertCall(d("WAWebWidFactory").toUserWid(a),b,f,g,!1);self.setTimeout(function(){d("WAWebCmd").Cmd.cancelCall(a);var e=c("WAWebCallCollection").get(b);e&&c("WAWebCallCollection").remove(e)},j*1e3)}g["default"]=a}),98); __d("WAWebVoipCallsTabPanelManager",["WAWebTypedEventEmitter"],(function(a,b,c,d,e,f,g){"use strict";a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}return b}(c("WAWebTypedEventEmitter"));b=new a();g["default"]=b}),98); __d("WAWebVoipActionWriteCallLogMessage",["Promise","WALogger","WALongInt","WANullthrows","WAPromiseEach","WAResolvable","WATimeUtils","WAWebCallLogUtils","WAWebCmd","WAWebGetMessageCache","WAWebHandleSingleMsg","WAWebMessageQueue","WAWebMsgKey","WAWebMsgType","WAWebUpdateMessageUIAction","WAWebUserPrefsHistorySync","WAWebUserPrefsMeUser","WAWebViewMode.flow","WAWebVoipCallsTabPanelManager","WAWebVoipWaCallEnums","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["generateCallLogFromCallSyncRecord: failed to generate call log message from syncd: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["",": ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["",": ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["generateCallLogFromCallSyncRecord: generating call log message, before initial history sync complete, from history sync: ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["generateCallLogFromCallSyncRecord: generating call log message, after initial history sync complete, from history sync: ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["generateCallLogFromCallSyncRecord: generated call log message, after initial history sync complete, from history sync: ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["generateCallLogFromCallSyncRecord: listener called, "," pending call log records"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["generateCallLogFromCallSyncRecord: setting up listener"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["generateCallLogFromCallSyncRecord: listener already registered"]);q=function(){return a};return a}function a(a){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.callCreatorWid,e=a.callOutcome,f=a.offerTime,g=a.isVideo,h=a.silenceReason,i=a.isGroup,j=a.groupJid,k=a.callId;a=a.isOffline;b=(yield d("WAWebCallLogUtils").getCallLogTargetDetails({callCreatorWid:b,callId:k,groupJid:j}));var l=b.msgKeyId,m=b.fromMe,n=b.callCreatorUserWid;b=b.chatId;var o;n={type:d("WAWebMsgType").MSG_TYPE.CALL_LOG,viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE,kind:d("WAWebMsgType").MsgKind.CallLog,from:n,callOutcome:e,callSilenceReason:h,isVideoCall:g,t:f!=null?f:d("WATimeUtils").unixTime()};e=i&&j?j:b;i&&k!=null?j&&(o=babelHelpers["extends"]({id:new(c("WAWebMsgKey"))({remote:b,fromMe:m,id:l}),to:j},n)):o=babelHelpers["extends"]({id:new(c("WAWebMsgKey"))({remote:b,fromMe:m,id:l}),to:d("WAWebUserPrefsMeUser").assertGetMe()},n);o!=null&&(yield z(e,o,a===!0))});return r.apply(this,arguments)}var s=[],t=null;function u(){if(t!=null){d("WALogger").LOG(q());return t.promise}d("WALogger").LOG(p());t=new(d("WAResolvable").Resolvable)();var a=t;d("WAWebCmd").Cmd.on("on_initial_chat_synced",b("asyncToGeneratorRuntime").asyncToGenerator(function*(){d("WALogger").LOG(o(),s.length),yield d("WAPromiseEach").promiseEach(s,function(b){return w(b).then(function(){d("WALogger").LOG(n(),b.fromHistorySync),a.resolve(),s=[],t=null})})}));return a.promise}function e(a){return v.apply(this,arguments)}function v(){v=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(d("WAWebUserPrefsHistorySync").getInitialHistorySyncComplete())d("WALogger").LOG(m(),a.fromHistorySync),yield w(a);else{d("WALogger").LOG(l(),a.fromHistorySync);s.push(a);return u()}});return v.apply(this,arguments)}function w(a){return x.apply(this,arguments)}function x(){x=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.callLogRecord,e=a.fromHistorySync;e=e===void 0?!1:e;a=a.shouldHideInConversation;a=a===void 0?!1:a;var f={message:"generateCallLogFromCallSyncdRecord: failed to find chat target details for call log syncd record",log:"generate-call-log-message-syncd-failed"};e&&(f={message:"generateCallLogFromCallHistorySyncRecord: failed to find chat target details for call log history sync record",log:"generate-call-log-message-history-sync-failed"});var g=b.callCreatorJid,h=b.callResult,i=b.callId,l=b.groupJid,m=b.startTime,n=b.silenceReason,o=b.isVideo,p;try{p=(yield d("WAWebCallLogUtils").getCallLogTargetDetails({callCreatorWid:g!=null&&g!==""?d("WAWebWidFactory").createWid(g):d("WAWebUserPrefsMeUser").assertGetMe(),callId:i,groupJid:l!=null&&l!==""?d("WAWebWidFactory").createWid(l):null,participants:b.participants.map(function(a){return a.userJid!=null&&a.userJid!==""?d("WAWebWidFactory").createWid(a.userJid):null}).filter(Boolean)}))}catch(a){d("WALogger").LOG(k(),f.message,a).devConsole(a);return}g=p;i=g.msgKeyId;l=g.fromMe;var q=g.callCreatorUserWid,r=g.chatId;g=g.participant;try{a={id:new(c("WAWebMsgKey"))({remote:r,participant:g,fromMe:l,id:i}),type:d("WAWebMsgType").MSG_TYPE.CALL_LOG,kind:d("WAWebMsgType").MsgKind.CallLog,viewMode:a||e?d("WAWebViewMode.flow").ViewModeType.HISTORY_SYNCED_CALL_LOG:d("WAWebViewMode.flow").ViewModeType.VISIBLE,callOutcome:d("WAWebCallLogUtils").getCallOutcomeFromCallResultSyncProto(c("WANullthrows")(h,"generateCallLogFromCallSyncRecord: callResult is null from call log record sync")),callSilenceReason:n!=null?d("WAWebCallLogUtils").getCallSilenceReason(n):void 0,isVideoCall:(g=o)!=null?g:!1,callDuration:b.duration==null?void 0:(l=d("WALongInt").maybeNumber(b.duration))!=null?l:void 0,callParticipants:b.participants.filter(function(a){return a.userJid!=null}).map(function(a){return{participant:d("WAWebWidFactory").createWid(c("WANullthrows")(a.userJid)),outcome:a.callResult!=null?d("WAWebCallLogUtils").getCallParticipantStateFromCallResultSyncProto(a.callResult):d("WAWebVoipWaCallEnums").CallParticipantState.Invalid}}),from:q,t:(i=d("WALongInt").maybeNumber(m))!=null?i:d("WATimeUtils").unixTime(),to:r};yield z(r,a,!1)}catch(a){e?f.message="generateCallLogFromCallHistorySyncRecord: failed to generate call log message from history sync":f.message="generateCallLogFromCallSyncRecord: failed to generate call log message from syncd",d("WALogger").ERROR(j(),f.message,a).tags("nexus-voip").devConsole(a).sendLogs(f.log)}});return x.apply(this,arguments)}function f(a){return y.apply(this,arguments)}function y(){y=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){try{var b=a.peerJid,e=a.fromMe,f=a.groupJid,g=a.callId,h=a.startTime,j=a.connectTime,k=a.result,l=a.videoCall,m=a.participantEntries;a=a.callCreatorJid;a=(yield d("WAWebCallLogUtils").getCallLogTargetDetails({callCreatorWid:(a=a)!=null?a:e?d("WAWebUserPrefsMeUser").assertGetMe():b,peerWid:b,callId:g,groupJid:f,participants:m.map(function(a){return a.jid}).filter(Boolean)}));b=a.msgKeyId;g=a.callCreatorUserWid;f=a.chatId;a=a.participant;e={id:new(c("WAWebMsgKey"))({remote:f,participant:a,fromMe:e,id:b}),type:d("WAWebMsgType").MSG_TYPE.CALL_LOG,kind:d("WAWebMsgType").MsgKind.CallLog,viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE,callOutcome:d("WAWebCallLogUtils").getCallOutcomeFromCallResultNative(k),isVideoCall:(a=l)!=null?a:!1,callDuration:j==null?void 0:j,from:g,t:h,callParticipants:m.map(function(a){return{participant:a.jid,outcome:a.result}}),to:f};yield z(f,e,!1)}catch(a){d("WALogger").ERROR(i(),a).tags("nexus-voip").devConsole(a).sendLogs("generate-call-log-message-syncd-failed")}});return y.apply(this,arguments)}function z(a,e,f){var g=new(d("WAResolvable").Resolvable)();void d("WAWebMessageQueue").onMessageQueue(a,f,b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=i(e).then(function(){g.resolve()});return f?(h||(h=b("Promise"))).resolve():a}));return g.promise;function i(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){f?(d("WAWebCmd").Cmd.isMainStreamReadyMd&&void d("WAWebUpdateMessageUIAction").updateUI(a,b),yield d("WAWebGetMessageCache").getMessageCache().addMessages([{msg:b}],!1)):yield d("WAWebHandleSingleMsg").handleSingleMsg(a,b,"voipNotification"),c("WAWebVoipCallsTabPanelManager").trigger("onWriteCallLogMessage")});return j.apply(this,arguments)}}g.generateCallLog=a;g.generateCallLogFromCallSyncRecord=e;g.generateCallLogFromNativeCallEndingEvent=f}),98); __d("WAWebPttAudioChannels",["WAWebEventEmitter"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}var c=b.prototype;c.registerMedia=function(a){var b=this,c=null,d=function(){c=b.claim(a,function(){a.pause()})},e=function(){c==null?void 0:c()};a.addEventListener("play",d);a.addEventListener("pause",e);return function(){c==null?void 0:c(),a.removeEventListener("play",d),a.removeEventListener("pause",e)}};c.claim=function(a,b){var c=this,d=this.$AudioChannel$p_1;d!=null&&a!==d.key&&(d.pause(),this.trigger("paused_DEPRECATED_DO_NOT_USE",d.key));this.$AudioChannel$p_1={key:a,pause:b};return function(){var b;a===((b=c.$AudioChannel$p_1)==null?void 0:b.key)&&(c.$AudioChannel$p_1=null)}};return b}(c("WAWebEventEmitter"));b=new a();g.MainAudioChannel=b}),98); __d("WAWebCallCollection",["WALogger","WAWebBaseCollection","WAWebCallModel","WAWebNoop","WAWebPttAudioChannels","lodash"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["voip:processIncomingCall: Attempting to add existing call with call ID"]);h=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.pendingOffers={},c.pendingVoipCapChecks={},b)||babelHelpers.assertThisInitialized(c)}var e=b.prototype;e.processIncomingCall=function(a,b,e){var f;if(this.get(a)!=null){d("WALogger").LOG(h()).devConsole(a);return this.get(a)}e=e;f={id:a,isGroup:(f=(f=e)==null?void 0:f.isGroupCall)!=null?f:Boolean((f=e)==null?void 0:f.groupWid),groupJid:(f=e)==null?void 0:f.groupWid};b!=null&&(f.peerJid=b);e&&(e=c("lodash").omitBy(e,function(a){return a==null}),c("lodash").merge(f,e));this.add(f,{merge:!0});return this.get(a)};e.cleanupPendingOffer=function(a){delete this.pendingOffers[a]};e.setActiveCall=function(a){this.activeCall=a,this.trigger("change:activeCall",a),this.$CallCollectionImpl$p_1==null?void 0:this.$CallCollectionImpl$p_1(),a!=null&&(this.$CallCollectionImpl$p_1=d("WAWebPttAudioChannels").MainAudioChannel.claim(this,c("WAWebNoop")))};return b}(d("WAWebBaseCollection").BaseCollection);a.model=c("WAWebCallModel");b=new a();e=b;g["default"]=e}),98); __d("WAWebCallModel",["WAWebBaseModel","WAWebCallCollection","WAWebCmd","WAWebConnModel","WAWebEnvironment","WAWebNoop","WAWebPttAudioChannels","WAWebVoipWaCallEnums"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.peerJid=d("WAWebBaseModel").prop(),c.offerTime=d("WAWebBaseModel").prop(),c.isVideo=d("WAWebBaseModel").prop(!1),c.isGroup=d("WAWebBaseModel").prop(!1),c.groupJid=d("WAWebBaseModel").prop(),c.groupCallParticipants=d("WAWebBaseModel").prop(),c.outgoing=d("WAWebBaseModel").prop(!1),c.isSilenced=d("WAWebBaseModel").prop(!1),c.offerReceivedWhileOffline=d("WAWebBaseModel").prop(!1),c.$Call$p_1=d("WAWebBaseModel").prop(),b)||babelHelpers.assertThisInitialized(c)}var e=b.prototype;e.getState=function(){return this.$Call$p_1};e.setState=function(a){this.$Call$p_1=a,this.$Call$p_2()};e.$Call$p_2=function(){if(c("WAWebEnvironment").isWindows)return;var a=this.getState();if(!d("WAWebConnModel").Conn.tosShowCallNotification||!this.peerJid)return;if(!this.offerReceivedWhileOffline&&a===d("WAWebVoipWaCallEnums").CallState.ReceivedCall){d("WAWebCmd").Cmd.alertCall(this.peerJid,this.id,this.isVideo,this.isGroup,this.isSilenced);a=d("WAWebPttAudioChannels").MainAudioChannel.claim(this,c("WAWebNoop"));a()}else d("WAWebCmd").Cmd.cancelCall(this.peerJid)};e.getCollection=function(){return c("WAWebCallCollection")};return b}(d("WAWebBaseModel").BaseModel);a.Proxy="call";b=d("WAWebBaseModel").defineModel(a);g["default"]=b}),98); __d("WAWebCallLogUtils",["WANullthrows","WATimeUtils","WAWebCallLogMsgData.flow","WAWebFindChatAction","WAWebFrontendMsgGetters","WAWebLid1X1MigrationGating","WAWebMsgGetters","WAWebMsgKey","WAWebUserPrefsMeUser","WAWebVoipWaCallEnums","WAWebWidFactory","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){"use strict";function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.callCreatorWid,e=a.callId,f=a.groupJid,g=a.peerWid;a=a.participants;a=a===void 0?[]:a;var h;b=(yield i({callDestinationWid:b}));var j=d("WAWebUserPrefsMeUser").isMeAccount(b);if(f!=null)f=f,h=b;else if(!j)f=b;else if(a.length>0){a=a.find(function(a){return a!=null&&!d("WAWebUserPrefsMeUser").isMeAccount(a)});if(a==null)throw c("err")("getCallLogTargetDetails: could not find a remote participant");f=(yield i({callDestinationWid:a}))}else if(g!=null)f=g;else throw c("err")("getCallLogTargetDetails: could not find a chatId");return{msgKeyId:(a=e)!=null?a:yield c("WAWebMsgKey").newId(),fromMe:j,callCreatorUserWid:b,chatId:f,participant:h}});return h.apply(this,arguments)}function i(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.callDestinationWid;a=a.groupJid;var c=d("WAWebWidFactory").toUserWid(b),e=!c.isLid()&&d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated();a=!a&&(c.isLid()||e);if(a){e=(yield d("WAWebFindChatAction").findOrCreateLatestChat(b,"voipCallLog"));a=e.chat;c=d("WAWebWidFactory").toUserWid(a.id)}return c});return j.apply(this,arguments)}function e(a){switch(a){case 0:return d("WAWebCallLogMsgData.flow").CallOutcome.Completed;case 1:return d("WAWebCallLogMsgData.flow").CallOutcome.Rejected;case 2:return d("WAWebCallLogMsgData.flow").CallOutcome.Canceled;case 3:return d("WAWebCallLogMsgData.flow").CallOutcome.AcceptedElsewhere;case 4:case 6:case 9:return d("WAWebCallLogMsgData.flow").CallOutcome.Missed;case 5:case 7:case 8:return d("WAWebCallLogMsgData.flow").CallOutcome.Failed;case 10:return d("WAWebCallLogMsgData.flow").CallOutcome.Ongoing;default:return d("WAWebCallLogMsgData.flow").CallOutcome.Unknown}}function f(a){switch(a){case 0:return d("WAWebVoipWaCallEnums").CallParticipantState.Connected;case 1:return d("WAWebVoipWaCallEnums").CallParticipantState.Rejected;case 2:return d("WAWebVoipWaCallEnums").CallParticipantState.Terminated;case 4:case 6:case 9:return d("WAWebVoipWaCallEnums").CallParticipantState.Terminated;case 10:return d("WAWebVoipWaCallEnums").CallParticipantState.Connected;case 3:case 5:case 7:case 8:return d("WAWebVoipWaCallEnums").CallParticipantState.Invalid;default:return d("WAWebVoipWaCallEnums").CallParticipantState.Invalid}}function k(a){switch(a){case d("WAWebVoipWaCallEnums").CallResult.Connected:return d("WAWebCallLogMsgData.flow").CallOutcome.Completed;case d("WAWebVoipWaCallEnums").CallResult.Missed:case d("WAWebVoipWaCallEnums").CallResult.MissedNotificationsMuted:return d("WAWebCallLogMsgData.flow").CallOutcome.Missed;case d("WAWebVoipWaCallEnums").CallResult.Declined:return d("WAWebCallLogMsgData.flow").CallOutcome.Rejected;case d("WAWebVoipWaCallEnums").CallResult.Canceled:return d("WAWebCallLogMsgData.flow").CallOutcome.Canceled;case d("WAWebVoipWaCallEnums").CallResult.AcceptedElsewhere:return d("WAWebCallLogMsgData.flow").CallOutcome.AcceptedElsewhere;case d("WAWebVoipWaCallEnums").CallResult.Unavailable:case d("WAWebVoipWaCallEnums").CallResult.Undefined:return d("WAWebCallLogMsgData.flow").CallOutcome.Unknown}}function l(a){switch(a){case 1:return"scheduled";case 2:return"privacy";case 3:return"lightweight";default:return void 0}}function m(a,b){return a!=null&&b!=null&&a.isSameAccountAndAddressingMode(b)}function n(a,b){return a.length!==b.length?!1:a.every(function(a){return b.some(function(b){return m(a,b)})})}function o(a,b){var c=d("WAWebMsgGetters").getSender(a),e=d("WAWebMsgGetters").getSender(b);if(!m(c,e))return!1;c=d("WAWebMsgGetters").getTo(a);e=d("WAWebMsgGetters").getTo(b);if(!m(c,e))return!1;c=d("WAWebMsgGetters").getIsVideoCall(a)===d("WAWebMsgGetters").getIsVideoCall(b)&&d("WAWebMsgGetters").getIsSentByMe(a)===d("WAWebMsgGetters").getIsSentByMe(b)&&d("WAWebMsgGetters").getIsGroupCall(a)===d("WAWebMsgGetters").getIsGroupCall(b);if(!c)return!1;e=d("WAWebMsgGetters").getIsMissedCall(a)===d("WAWebMsgGetters").getIsMissedCall(b);if(!e)return!1;c=(d("WAWebMsgGetters").getIsCallSilenced(a)&&!d("WAWebMsgGetters").getIsSentByMe(a))===(d("WAWebMsgGetters").getIsCallSilenced(b)&&!d("WAWebMsgGetters").getIsSentByMe(b));if(!c)return!1;if(!d("WATimeUtils").sameDay(d("WATimeUtils").castToUnixTime(d("WAWebMsgGetters").getT(a)),d("WATimeUtils").castToUnixTime(d("WAWebMsgGetters").getT(b))))return!1;c=(e=a.callParticipants)==null?void 0:e.map(function(a){return a.participant});e=(a=b.callParticipants)==null?void 0:a.map(function(a){return a.participant});b=c!=null&&e!=null&&n(c,e);return b}function p(a){if(a.length===0)return[];var b=[],e=c("WANullthrows")(d("WAWebFrontendMsgGetters").getAsCallLog(a[0]),"[mergeCallRecords] record is not a call log record"),f=[e.unsafe()];for(var g=1;g<a.length;g++){var h=c("WANullthrows")(d("WAWebFrontendMsgGetters").getAsCallLog(a[g]),"[mergeCallRecords] record is not a call log record");o(e,h)?f.push(h.unsafe()):(b.push({mergedMsgs:f}),e=h,f=[h.unsafe()])}b.push({mergedMsgs:f});return b}g.getCallLogTargetDetails=a;g.get1x1CallLidOrPnDestination=i;g.getCallOutcomeFromCallResultSyncProto=e;g.getCallParticipantStateFromCallResultSyncProto=f;g.getCallOutcomeFromCallResultNative=k;g.getCallSilenceReason=l;g.shouldMergeCallLogRecords=o;g.mergeCallRecords=p}),98); __d("WAWebWamEnumMultideviceActionType",[],(function(a,b,c,d,e,f){a=Object.freeze({LOGIN:0,LOGOUT:1,CUSTOM_AGENT_NAME:2,MESSAGE_INFO:3,ACTIVE:4,DELETE:5});f.MULTIDEVICE_ACTION_TYPE=a}),66); __d("WAWebMdExpansionAgentBrowserMdIdWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumMultideviceActionType"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({MdExpansionAgentBrowserMdId:[3390,{agentId:[1,a.TYPES.STRING],browserId:[2,a.TYPES.STRING],companionMdId:[5,a.TYPES.INTEGER],isCustomAgentName:[6,a.TYPES.BOOLEAN],isNewAgent:[9,a.TYPES.BOOLEAN],loginTimestamp:[3,a.TYPES.INTEGER],logoutTimestamp:[4,a.TYPES.INTEGER],mdLinkedCount:[8,a.TYPES.INTEGER],multideviceAction:[7,d("WAWebWamEnumMultideviceActionType").MULTIDEVICE_ACTION_TYPE]},[1,1,1],"regular"]},{MdExpansionAgentBrowserMdId:[]});g.MdExpansionAgentBrowserMdIdWamEvent=b}),98); __d("WAWebBizAgentAction",["WALogger","WATimeUtils","WAWebAgentCollection","WAWebAgentModelUtils","WAWebBizGatingUtils","WAWebCmd","WAWebMdExpansionAgentBrowserMdIdWamEvent","WAWebMiscBrowserUtils","WAWebMsgCollection","WAWebSchemaMessage","WAWebUnattributedMessageCollection","WAWebUserPrefsMeUser","WAWebWamEnumMultideviceActionType","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["agent: unknown agent with device id::",", delaying attribution of message id::",""]);h=function(){return a};return a}function i(a){return a.author.user!==((a=d("WAWebUserPrefsMeUser").getMaybeMeUser())==null?void 0:a.user)?!0:!1}function a(a,b){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b,c){if(i(b)||!d("WAWebAgentModelUtils").canUserSeeMessageAttribution())return;var e=b.author.getDeviceId();b=d("WAWebAgentCollection").AgentCollection.getByDeviceId(e);if(b==null){var f=c.map(function(a){return{id:a.id.toString(),deviceId:e}});d("WAWebUnattributedMessageCollection").UnattributedMessageCollection.add(f);f.forEach(function(a){d("WALogger").DEV(h(),e,a.id)});return}f=c.map(function(a){return d("WAWebMsgCollection").MsgCollection.get(a.id)}).filter(Boolean).filter(function(a){return a.agentId==null});var a=String(b.id);f.forEach(function(b){b.agentId=a});c=f.map(function(b){b=b.id.toString();return{id:b,agentId:a}});yield d("WAWebSchemaMessage").getMessageTable().bulkCreateOrMerge(c)});return j.apply(this,arguments)}function e(a){if(a.agentId!=null||!d("WAWebAgentModelUtils").canUserSeeMessageAttribution())return a.agentId;a=d("WAWebUserPrefsMeUser").getMe();if(a!=null){a=d("WAWebAgentCollection").AgentCollection.getByDeviceId(a.getDeviceId());if(a!=null)return a.id}}var k,l;function f(a){l=a}function m(a,b){b===void 0&&(b=!1);if(!d("WAWebBizGatingUtils").isMultiDeviceAgentsLoggingEnabled())return;new(d("WAWebMdExpansionAgentBrowserMdIdWamEvent").MdExpansionAgentBrowserMdIdWamEvent)(babelHelpers["extends"]({agentId:k},a)).commitAndWaitForFlush(b)}function n(a){l!=null&&m(babelHelpers["extends"]({},a,l,{multideviceAction:d("WAWebWamEnumMultideviceActionType").MULTIDEVICE_ACTION_TYPE.LOGIN}))}function o(){if(!d("WAWebBizGatingUtils").isMultiDeviceAgentsLoggingEnabled())return;var a=d("WAWebUserPrefsMeUser").assertGetMe().getDeviceId(),b=c("WAWebMiscBrowserUtils").persistentExpiringId();d("WAWebCmd").Cmd.on("logout",function(){m({browserId:b,companionMdId:a,logoutTimestamp:d("WATimeUtils").unixTimeWithoutClockSkewCorrection(),multideviceAction:d("WAWebWamEnumMultideviceActionType").MULTIDEVICE_ACTION_TYPE.LOGOUT},!0)});document.addEventListener("visibilitychange",function(){document.hidden||m({browserId:b,companionMdId:a,multideviceAction:d("WAWebWamEnumMultideviceActionType").MULTIDEVICE_ACTION_TYPE.ACTIVE})});var e=d("WAWebAgentCollection").AgentCollection.getByDeviceId(a);e!=null?(k=e.id,n({browserId:b,companionMdId:a})):d("WAWebCmd").Cmd.on(d("WAWebCmd").APP_STATE_SYNC_COMPLETED,function(){var c=d("WAWebAgentCollection").AgentCollection.getByDeviceId(a);(c==null?void 0:c.id)!=null&&k==null&&(k=c.id,n({browserId:b,companionMdId:a}))})}function p(a){a=a!=null?d("WAWebAgentCollection").AgentCollection.get(a):void 0;var b=c("WAWebMiscBrowserUtils").persistentExpiringId();m({browserId:b,agentId:a==null?void 0:a.id,companionMdId:a==null?void 0:a.deviceId,multideviceAction:d("WAWebWamEnumMultideviceActionType").MULTIDEVICE_ACTION_TYPE.MESSAGE_INFO})}g.updateUnattributedMessages=a;g.getAgentId=e;g.setShouldLogAgentLogin=f;g.initializeAgentLog=o;g.logMessageInfo=p}),98); __d("WAWebBizBusinessChangeAction",["WAWebBusinessProfileCollection","WAWebConnModel","WAWebContactGetters","WAWebStateUtils"],(function(a,b,c,d,e,f,g){a=function(a){a=d("WAWebStateUtils").unproxy(a);var b=a.businessProfile,c=a.id,e=a.isBusiness||d("WAWebContactGetters").getIsMe(a)&&d("WAWebConnModel").Conn.isSMB;e&&!b?a.addChild("businessProfile",d("WAWebBusinessProfileCollection").BusinessProfileCollection.gadd(c)):!e&&b&&(a.stopListening(b),a.businessProfile=void 0,b["delete"]())};g.handleBusinessChange=a}),98); __d("WAWebQueryBusinessCategoriesJob",["WADeprecatedSendIq","WADeprecatedWapParser","WAWap","WAWebBackendErrors","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h=new(c("WADeprecatedWapParser"))("businessCategoriesResponse",function(a){a.assertTag("iq");a.assertFromServer();a=a.child("response");var b=[],c="";try{var d=a.maybeChild("not_a_biz");d==null?void 0:d.forEachChildWithTag("category",function(a){c=a.attrString("id")});d=a.child("categories");d.forEachChildWithTag("category",function(a){var d=a.attrString("id");a=a.contentString();b.push({id:d,localized_display_name:a,not_a_biz:c.length?d===c:!1})})}catch(a){}return{categories:b,notABizId:c}});function a(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b,c="profile_typeahead";c=(b=d("WAWap")).wap("iq",{to:b.S_WHATSAPP_NET,xmlns:"fb:thrift_iq",id:b.generateId(),type:"get"},b.wap("request",{op:b.CUSTOM_STRING(c),type:"catkit",v:"1"},b.wap("query",null,a)));b=(yield d("WADeprecatedSendIq").deprecatedSendIq(c,h));if(!b.success)throw new(d("WAWebBackendErrors").ServerStatusCodeError)(b.errorCode);else return b.result});return i.apply(this,arguments)}g.queryBusinessCategories=a}),98); __d("WAWebBusinessProfileCategoriesBridge",["WAWebBizLogQplEvents","WAWebQueryBusinessCategoriesJob"],(function(a,b,c,d,e,f,g){function a(a){d("WAWebBizLogQplEvents").qplPointProfileCatsView("datasource_start");return d("WAWebQueryBusinessCategoriesJob").queryBusinessCategories(a).then(function(a){d("WAWebBizLogQplEvents").qplPointProfileCatsView("datasource_end");return a})}g.queryBusinessCategories=a}),98); __d("WAWebBizCatalogManagementUpdateCommerceSettingsMutation_facebookRelayOperation",[],(function(a,b,c,d,e,f){e.exports="9797519763673469"}),null); __d("WAWebBizCatalogManagementUpdateCommerceSettingsMutation.graphql",["WAWebBizCatalogManagementUpdateCommerceSettingsMutation_facebookRelayOperation"],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"input"}],c=[{alias:null,args:[{kind:"Variable",name:"request",variableName:"input"}],concreteType:"XFBWhatsAppCatalogCommerceSettingsResponse",kind:"LinkedField",name:"xfb_whatsapp_smb_commerce_settings",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"cart_enabled",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"WAWebBizCatalogManagementUpdateCommerceSettingsMutation",selections:c,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"WAWebBizCatalogManagementUpdateCommerceSettingsMutation",selections:c},params:{id:b("WAWebBizCatalogManagementUpdateCommerceSettingsMutation_facebookRelayOperation"),metadata:{},name:"WAWebBizCatalogManagementUpdateCommerceSettingsMutation",operationKind:"mutation",text:null}}}();e.exports=a}),null); __d("WAWebBizCatalogManagementUpdateCommerceSettings",["Promise","WALogger","WAWebBizCatalogManagementUpdateCommerceSettingsMutation.graphql","WAWebBizGatingUtils","WAWebFetchAdAccountToken","WAWebGraphQLServerError","WAWebNetworkStatus","WAWebRelayClient"],(function(a,b,c,d,e,f,g){var h,i;function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["updateCommerceSettingsWithToken: failed with error"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(['updateCommerceSettings: failed as "','"']);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["updateCommerceSettings: success"]);l=function(){return a};return a}var m={type:"error"},n=h!==void 0?h:h=b("WAWebBizCatalogManagementUpdateCommerceSettingsMutation.graphql");function a(a){return!d("WAWebBizGatingUtils").graphQLForCommerceSettingsEnabled()?(i||(i=b("Promise"))).resolve({type:"not-enabled"}):o(a).then(function(a){if(a.type==="success"){d("WALogger").LOG(l());return a}a.type;d("WALogger").LOG(k(),a.type);return a})}function o(a){return d("WAWebFetchAdAccountToken").fetchToken().then(function(b){if(b.type==="success")return p(b.token,a).then(function(a){a.type!=="success"?a.type==="auth-failure"?d("WAWebFetchAdAccountToken").markTokenAsInvalid():a.type:a.type;return a});b.type;return b})}function p(a,b){return c("WAWebNetworkStatus").waitIfOffline().then(function(){return d("WAWebRelayClient").commitMutation(n,{input:b},{environmentType:"facebook",accessToken:a})}).then(function(a){if(a==null)return m;a=a.xfb_whatsapp_smb_commerce_settings;if(a==null)return m;return(a==null?void 0:a.cart_enabled)==null?m:{type:"success",result:a.cart_enabled}})["catch"](function(a){d("WALogger").LOG(j()).devConsole(a);if(d("WAWebFetchAdAccountToken").hasGraphQLAuthError(a))return{type:"auth-failure"};return a instanceof d("WAWebGraphQLServerError").GraphQLServerError?{type:"graphql-error",error:a}:m})}g.updateCommerceSettings=a}),98); __d("WAWebBusinessProfileJob",["WADeprecatedSendIq","WADeprecatedWapParser","WAWap","WAWapDeprecatedSmaxID","WAWebBackendErrors","WAWebBizCatalogManagementUpdateCommerceSettings","WAWebBizGatingUtils","WAWebMaybeThrowCatalogErrors","WAWebUserPrefsMeUser","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h=new(c("WADeprecatedWapParser"))("businessProfileResponse",function(a){a.assertTag("iq"),a.assertFromServer()}),i=new(c("WADeprecatedWapParser"))("commerceSettingsResponse",function(a){a.assertTag("iq");a.assertFromServer();a=a.child("commerce_settings");a=a.child("cart").attrString("enabled");return a==="true"});function j(a){var b=a.note,c=a.timezone,e=a.config,f=[];Object.keys(e).forEach(function(a){var b=e[a];if(b==null)return;var c=b.mode;b=b.hours;if(b)for(b of b){var d=b[0],g=b[1];f.push({day_of_week:a,mode:c,open_time:d,close_time:g})}else f.push({day_of_week:a,mode:c})});a=[];b!=null&&b!==""&&a.push(d("WAWap").wap("business_hours_note",null,b));a.push.apply(a,f.map(function(a){a=d("WAWap").wap("business_hours_config",{day_of_week:d("WAWap").CUSTOM_STRING(a.day_of_week),mode:d("WAWap").CUSTOM_STRING(a.mode),open_time:a.open_time!=null?d("WAWap").CUSTOM_STRING(a.open_time.toString()):d("WAWap").DROP_ATTR,close_time:a.close_time!=null?d("WAWap").CUSTOM_STRING(a.close_time.toString()):d("WAWap").DROP_ATTR});return a}));return d("WAWap").wap("business_hours",{timezone:c?d("WAWap").CUSTOM_STRING(c):d("WAWap").DROP_ATTR},a)}function k(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b;b=(b=d("WAWap")).wap("iq",{to:b.S_WHATSAPP_NET,smax_id:b.SMAX_ID(c("WAWapDeprecatedSmaxID").CommerceSettingsSet),xmlns:"fb:thrift_iq",id:b.generateId(),type:"set"},b.wap("commerce_settings",null,b.wap("cart",{enabled:b.CUSTOM_STRING(a.toString())})));a=(yield d("WADeprecatedSendIq").deprecatedSendIq(b,i));if(!a.success)throw new(d("WAWebBackendErrors").ServerStatusCodeError)(a.errorCode);else return a.result});return l.apply(this,arguments)}function m(a){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=d("WAWebUserPrefsMeUser").getMaybeMeUser();if(b==null)throw c("err")("updateCartEnabledGraphQL: meUser is null");b=(yield d("WAWebBizCatalogManagementUpdateCommerceSettings").updateCommerceSettings({biz_jid:b.toJid(),cart_enabled:a}));if(b.type==="success")return b.result;else if(b.type==="graphql-error")d("WAWebMaybeThrowCatalogErrors").maybeThrowLocalErrorForCatalogQuery(b.error);else if(b.type==="recovery-required")return k(a);else b.type;throw c("err")("updateCartEnabledGraphQL: error handling flow not implemented for "+JSON.stringify(b))});return n.apply(this,arguments)}function a(a){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){return d("WAWebBizGatingUtils").graphQLForCommerceSettingsEnabled()?m(a):k(a)});return o.apply(this,arguments)}function e(a){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b,c=a.address,e=a.description,f=a.categories,g=a.email,i=a.website;a=a.businessHours;b=(b=d("WAWap")).wap("iq",{to:b.S_WHATSAPP_NET,xmlns:"w:biz",id:b.generateId(),type:"set"},b.wap("business_profile",{v:"3",mutation_type:"delta"},c!==void 0?d("WAWap").wap("address",null,c):null,e!==void 0?d("WAWap").wap("description",null,e):null,g!==void 0?d("WAWap").wap("email",null,g):null,i&&i.length===0?d("WAWap").wap("website",null):null,i&&i.length>0?d("WAWap").wap("website",null,i[0].url):null,i&&i.length>1?d("WAWap").wap("website",null,i[1].url):null,f?d("WAWap").wap("categories",null,f.map(function(a){return d("WAWap").wap("category",{id:d("WAWap").CUSTOM_STRING(a.id)})})):null,a?j(a):null));c=(yield d("WADeprecatedSendIq").deprecatedSendIq(b,h));if(!c.success)throw new(d("WAWebBackendErrors").ServerStatusCodeError)(c.errorCode)});return p.apply(this,arguments)}function f(a,b,c){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){var e;a=(e=d("WAWap")).wap("iq",{to:e.S_WHATSAPP_NET,xmlns:"w:biz",id:e.generateId(),type:"set"},e.wap("business_profile",{v:"3",mutation_type:"delta"},e.wap("cover_photo",{op:"update",id:e.CUSTOM_STRING(a.toString()),ts:e.CUSTOM_STRING(b.toString()),token:e.CUSTOM_STRING(c)})));b=(yield d("WADeprecatedSendIq").deprecatedSendIq(a,h));if(!b.success)throw new(d("WAWebBackendErrors").ServerStatusCodeError)(b.errorCode)});return q.apply(this,arguments)}function r(a){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b;b=(b=d("WAWap")).wap("iq",{to:b.S_WHATSAPP_NET,xmlns:"w:biz",id:b.generateId(),type:"set"},b.wap("business_profile",{v:"3",mutation_type:"delta"},b.wap("cover_photo",{op:"delete",id:b.CUSTOM_STRING(a)})));a=(yield d("WADeprecatedSendIq").deprecatedSendIq(b,h));if(!a.success)throw new(d("WAWebBackendErrors").ServerStatusCodeError)(a.errorCode)});return s.apply(this,arguments)}g.updateCartEnabled=a;g.editBusinessProfile=e;g.sendCoverPhoto=f;g.deleteCoverPhoto=r}),98); __d("WAWebBizBusinessProfileAction",["WALogger","WAPromiseDelays","WAWebBusinessCategoriesResultModel","WAWebBusinessProfileCategoriesBridge","WAWebBusinessProfileCollection","WAWebBusinessProfileJob","WAWebPersistedJobDefinitions","WAWebPersistedJobManager","WAWebQueryBusinessProfile","WAWebUserPrefsMeUser","asyncToGeneratorRuntime","cr:3128","err","gkx"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[direct-connection] fetching signed user info from server"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[queryBusinessProfile] merging mock payload to the busines profile"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[queryBusinessProfile] delaying "," seconds before querying business profile"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[direct-connection] fetching business public key certificate from server"]);k=function(){return a};return a}function a(a,b){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){if(!c("gkx")("26258")){var f;f=(f=b("cr:3128")==null?void 0:b("cr:3128").debugSmbConfigs.delayBusinessProfileQuery)!=null?f:0;f&&(d("WALogger").DEV(j(),f),yield d("WAPromiseDelays").delayMs(f*1e3))}f=(yield d("WAWebQueryBusinessProfile").queryBusinessProfile(a,e));if(!c("gkx")("26258")){a=b("cr:3128")==null?void 0:b("cr:3128").debugSmbConfigs.mockBusinessProfileId;e=b("cr:3128")==null?void 0:(e=b("cr:3128").debugSmbConfigs)==null?void 0:e.mockBusinessProfileQueryPayload;e&&f[0].wid.equals(a)&&(d("WALogger").DEV(i()).devConsole({response:f,mockPayload:e}),f[0].profile=babelHelpers["extends"]({},f[0].profile,e))}return f});return l.apply(this,arguments)}function e(a){return a===d("WAWebBusinessCategoriesResultModel").BUSINESS_CATEGORY_EMPTY_STR_ID?d("WAWebBusinessProfileCategoriesBridge").queryBusinessCategories(""):d("WAWebBusinessProfileCategoriesBridge").queryBusinessCategories(a)}function f(a){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebBusinessProfileJob").updateCartEnabled(a));var b=d("WAWebBusinessProfileCollection").BusinessProfileCollection.getValid(d("WAWebUserPrefsMeUser").getMeUser()),c=b==null?void 0:b.profileOptions;b&&c&&(c.cartEnabled=a,d("WAWebBusinessProfileCollection").BusinessProfileCollection.add(b,{merge:!0}))});return m.apply(this,arguments)}function n(a){d("WALogger").DEV(k());return d("WAWebPersistedJobManager").getJobManager().waitUntilCompleted(d("WAWebPersistedJobDefinitions").jobSerializers.getPublicKey(a))}function o(a){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){d("WALogger").DEV(h());a=(yield d("WAWebPersistedJobManager").getJobManager().waitUntilCompleted(d("WAWebPersistedJobDefinitions").jobSerializers.getSignedUserInfo(a)));var b=a.phoneNumber,e=a.phoneNumberSignature,f=a.phoneNumberSignatureExpiration;a=a.businessDomain;if(b==null||f==null||e==null||a==null)throw c("err")("Unexpected null or undefined");return{phoneNumber:b,phoneNumberSignature:e,phoneNumberSignatureExpiration:f,businessDomain:a}});return p.apply(this,arguments)}g.queryBusinessProfile=a;g.queryBusinessCategories=e;g.updateCartEnabled=f;g.queryBusinessPublicKey=n;g.querySignedUserInfo=o}),98); __d("WAWebChatAssignmentLogEvents.flow",["$InternalEnum"],(function(a,b,c,d,e,f){a=b("$InternalEnum").Mirrored(["CONTACT_INFO_SCREEN","CONVERSATION_MENU","MULTI_SELECT","SYSTEM_MESSAGE"]);f.ChatAssignmentEntryPointType=a}),66); __d("WAWebChatAssignmentSystemMsg",["WAWebMsgKey","WAWebMsgType","WAWebUserPrefsMeUser","WAWebViewMode.flow"],(function(a,b,c,d,e,f,g){function a(a,b,e){var f=d("WAWebUserPrefsMeUser").getMeUser(),g=c("WAWebMsgKey").newId_DEPRECATED();g=new(c("WAWebMsgKey"))({fromMe:d("WAWebUserPrefsMeUser").isMeAccount(a),remote:a,id:g});return{id:g,t:e,type:"notification_template",kind:d("WAWebMsgType").MsgKind.NotificationTemplate,viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE,subtype:b==null?"chat_assignment_unassign":"chat_assignment",from:a,to:f,templateParams:b==null?[]:[b.name]}}g.genChatAssignmentNotificationTemplateMsg=a}),98); __d("WAWebBizChatAssignmentAction",["Promise","WATimeUtils","WAWebAgentCollection","WAWebBizChatAssignmentOpenedAction","WAWebBizGatingUtils","WAWebChatAssignmentCollection","WAWebChatAssignmentLogEvents","WAWebChatAssignmentLogEvents.flow","WAWebChatAssignmentModel","WAWebChatAssignmentSync","WAWebChatAssignmentSystemMsg","WAWebChatAssignmentUtils","WAWebChatCollection","WAWebCmd","WAWebHandleSingleMsg","WAWebMobilePlatforms","WAWebNotificationController","WAWebNotificationsChatAssignmentNotification","WAWebSchemaChatAssignment","WAWebSyncdCoreApi","WAWebSyncdOrphan","WAWebUserPrefsMeUser","WAWebUserPrefsStore","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function a(a,b){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if(!d("WAWebChatAssignmentUtils").canAssignChats())return;var e=d("WAWebUserPrefsMeUser").assertGetMe().getDeviceId(),f=a.map(function(a){var c=a.chat.id.toString({legacy:!0});a=a.agentId;var f=d("WAWebAgentCollection").AgentCollection.getByDeviceId(e);f=(f==null?void 0:f.deviceId)===e&&b!==d("WAWebChatAssignmentLogEvents.flow").ChatAssignmentEntryPointType.MULTI_SELECT&&b!==d("WAWebChatAssignmentLogEvents.flow").ChatAssignmentEntryPointType.CONTACT_INFO_SCREEN;return{id:c+"_"+(a||""),chatId:c,agentId:(c=a)!=null?c:"",chatOpenedByAgent:f}}),g=a.map(function(a){return a.chat.assignedAgent!=null});yield d("WAWebSyncdCoreApi").lockForSync(["chat-assignment"],yield c("WAWebChatAssignmentSync").createChatAssignmentMutations(f),function(){return k(f)});a.forEach(function(c,e){d("WAWebChatAssignmentLogEvents").logChatAssignment(c.chat,(c=c.agentId)!=null?c:"",g[e],b,a.length)});m(a.map(function(a){var b=a.chat;a=a.agentId;a=d("WAWebAgentCollection").AgentCollection.get((a=a)!=null?a:"");return{chatId:b.id,agent:a,timestamp:d("WATimeUtils").unixTime()}}));c("WAWebUserPrefsStore").setUser("chat_assignment_agent_has_assigned_chats",!0);f.filter(function(a){a=a.chatOpenedByAgent;return a===!0}).forEach(function(a){a=d("WAWebChatCollection").ChatCollection.get(a.chatId);a!=null&&d("WAWebBizChatAssignmentOpenedAction").markChatAsOpened(a,!0)})});return i.apply(this,arguments)}function j(a){return d("WAWebChatAssignmentCollection").ChatAssignmentCollection.getModelsArray().filter(function(b){b=b.chatId;return a.includes(b)}).map(function(a){return a.id})}function k(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=j(a.map(function(a){a=a.chatId;return a})),e=a.map(function(a){var b=a.id,c=a.chatId,e=a.agentId;a=a.chatOpenedByAgent;return new(d("WAWebChatAssignmentModel").ChatAssignment)({id:b,chatId:c,agentId:e,chatOpenedByAgent:a,agent:d("WAWebAgentCollection").AgentCollection.get(e)})});d("WAWebChatAssignmentCollection").ChatAssignmentCollection.remove(c);d("WAWebChatAssignmentCollection").ChatAssignmentCollection.add(e);e=d("WAWebSchemaChatAssignment").getChatAssignmentTable();yield (h||(h=b("Promise"))).all([e.bulkRemove(c),e.bulkCreateOrMerge(a)])});return l.apply(this,arguments)}function m(a){if(!d("WAWebBizGatingUtils").chatAssignmentSystemMessagesEnabled())return;a.forEach(function(a){var b=a.chatId,c=a.agent;a=a.timestamp;var e=d("WAWebChatCollection").ChatCollection.get(b);d("WAWebHandleSingleMsg").handleSingleMsg(b,d("WAWebChatAssignmentSystemMsg").genChatAssignmentNotificationTemplateMsg(b,c,a),"chatAssignmentSystemMsg").then(function(){e!=null&&d("WAWebChatAssignmentLogEvents").logSystemMessageGeneratedFromCompanion(e)})["catch"](function(){e!=null&&d("WAWebChatAssignmentLogEvents").logSystemMessageFailedToGenerate(e)})})}function e(a){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!d("WAWebMobilePlatforms").isSMB())return;a=j([a.toString({legacy:!0})]);yield d("WAWebSchemaChatAssignment").getChatAssignmentTable().bulkRemove(a);d("WAWebChatAssignmentCollection").ChatAssignmentCollection.remove(a)});return n.apply(this,arguments)}function f(){d("WAWebCmd").Cmd.once(d("WAWebCmd").APP_STATE_SYNC_COMPLETED,function(){d("WAWebSyncdOrphan").checkOrphanAgents(d("WAWebAgentCollection").AgentCollection.getModelsArray().map(function(a){a=a.id;return a})),d("WAWebSyncdOrphan").checkOrphanChatAssignments(d("WAWebChatAssignmentCollection").ChatAssignmentCollection.getModelsArray().map(function(a){a=a.id;return a}))})}function o(a,b){if(!d("WAWebBizGatingUtils").chatAssignmentNotificationsEnabled()||!d("WAWebChatAssignmentUtils").canAssignChats())return;var c=d("WAWebUserPrefsMeUser").assertGetMe().getDeviceId();a=a.filter(function(a){a=d("WAWebAgentCollection").AgentCollection.get(a.agentId);return(a==null?void 0:a.deviceId)===c});if(a.length===0)return;d("WAWebNotificationController").WANotificationController.triggerNotification(new(d("WAWebNotificationsChatAssignmentNotification").WAWebNotificationsChatAssignmentNotification)({chats:a.map(function(a){return d("WAWebWidFactory").createWid(a.chatId)}),assignmentTimestamps:b}))}g.changeChatAssignment=a;g.createChatAssignmentSystemMsgs=m;g.removeChatAssignmentsForChat=e;g.checkOrphanAssignments=f;g.triggerChatAssignmentNotification=o}),98); __d("WAWebBizChatAssignmentOpenedAction",["WAWebAgentCollection","WAWebChatAssignmentCollection","WAWebChatAssignmentOpenedStatusSync","WAWebChatAssignmentUtils","WAWebSchemaChatAssignment","WAWebSyncdCoreApi","WAWebUserPrefsMeUser","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a.forEach(function(a){var b=a.id;a=a.chatOpenedByAgent;b=d("WAWebChatAssignmentCollection").ChatAssignmentCollection.get(b);b&&b.set("chatOpenedByAgent",a)});var b=d("WAWebSchemaChatAssignment").getChatAssignmentTable();yield b.bulkCreateOrMerge(a)});return i.apply(this,arguments)}function a(a,b){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if(!d("WAWebChatAssignmentUtils").canAssignChats())return;var e=d("WAWebUserPrefsMeUser").assertGetMe().getDeviceId();a=a.id;var f=(e=d("WAWebAgentCollection").AgentCollection.getByDeviceId(e))==null?void 0:e.id;if(f==null)return;e=[{chatId:a,agentId:f,chatOpened:b}];var g=e.map(function(a){a=a.chatId.toString({legacy:!0});return{id:a+"_"+f,chatId:a,agentId:f,chatOpenedByAgent:b}});yield d("WAWebSyncdCoreApi").lockForSync(["chat-assignment"],yield c("WAWebChatAssignmentOpenedStatusSync").createChatOpenedMutations(g),function(){return h(g)})});return j.apply(this,arguments)}g.updateLocalOpenedState=h;g.markChatAsOpened=a}),98); __d("WAWebBizInteractiveMessageQuickReplyAction",["WANullthrows","WAWebCarouselMsgUtils","WAWebSchemaMessage","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if(a.isCarouselCard)return i(a,b);b=k(a,b);var c=d("WAWebSchemaMessage").getMessageTable();c=(yield c.get(a.id.toString()));yield d("WAWebSchemaMessage").getMessageTable().bulkCreateOrMerge([{id:c==null?void 0:c.id,interactivePayload:b}]);a.set("interactivePayload",b)});return h.apply(this,arguments)}function i(a,b){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=k(a.interactivePayload,b);var e=c("WANullthrows")(d("WAWebCarouselMsgUtils").getParentMsgFromCarouselCard(a)),f=c("WANullthrows")(e.carouselCardsParsed).slice(),g=f.findIndex(function(b){return b.id.toString()===a.id.toString()});f[g]=babelHelpers["extends"]({},f[g],{interactivePayload:b});g=d("WAWebSchemaMessage").getMessageTable();var h=(yield g.get(e.id.toString()));yield g.bulkCreateOrMerge([{id:h==null?void 0:h.id,carouselCardsParsed:f}]);e.set("carouselCardsParsed",f);a.set("interactivePayload",b)});return j.apply(this,arguments)}function k(a,b){return babelHelpers["extends"]({},a,{buttons:a==null?void 0:(a=a.buttons)==null?void 0:a.map(function(a,c){if(a.buttonParamsJson===void 0)return a;var d=JSON.parse(a.buttonParamsJson);b===c&&(d.disabled=!0);return{name:a.name,buttonParamsJson:JSON.stringify(d)}})})}g.markInteractiveButtonClicked=a;g.rebuildInteractivePayloadWithDisabledButton=k}),98); __d("WAWebCatalogVariantHelper",["fbt","$InternalEnum","WACustomError","WAWebBizGatingUtils"],(function(a,b,c,d,e,f,g,h){"use strict";e=100;f="listing_details,types,availability,variant_properties";var i="variant_properties";function a(a,b){var c;c=b!=null&&b.variantInfo!=null&&((c=b.variantInfo.listing_details)==null?void 0:c.description)==null&&b.variantInfo.variant_properties==null;return Boolean(!c&&(a==null?void 0:a.isBusinessLinkedMetaCatalog())&&d("WAWebBizGatingUtils").isCatalogVariantsViewingEnabled())}var j=b("$InternalEnum")({COLOR:"color",SIZE:"size",MATERIAL:"material",PATTERN:"pattern",GENDER:"gender",AGE_GROUP:"age group"});function c(a,b){a=j.cast(a);if(a==null)throw new k();switch(a){case j.COLOR:return h._(/*BTDS*/"__JHASH__KUswQkmKRCo__JHASH__",[h._plural(b,"number")]);case j.SIZE:return h._(/*BTDS*/"__JHASH__8KDeCfm7r2w__JHASH__");case j.MATERIAL:return h._(/*BTDS*/"__JHASH__Py-NJMsIdw3__JHASH__");case j.PATTERN:return h._(/*BTDS*/"__JHASH__FKRDb2KC_UZ__JHASH__");case j.GENDER:return h._(/*BTDS*/"__JHASH__ckZu3qIwnhR__JHASH__");case j.AGE_GROUP:return h._(/*BTDS*/"__JHASH__irK7eHY4UFh__JHASH__")}}var k=function(b){babelHelpers.inheritsLoose(a,b);function a(){return b.apply(this,arguments)||this}return a}(d("WACustomError").customError("UnsupportedCatalogVariantOptionType"));g.VARIANT_THUMBNAIL_IMAGE_SIZE=e;g.FULL_VARIANT_INFO_FIELDS=f;g.VARIANT_PROPERTIES_INFO_FIELD=i;g.shouldRequestVariantInfo=a;g.VariantOptionName=j;g.getVariantTypeOptions=c;g.UnsupportedCatalogVariantOptionType=k}),226); __d("WAWebBizProductCatalogAction",["WAWebBizCreateProductInquiry","WAWebBizProductCatalogBridge","WAWebBusinessProfileCollection","WAWebCatalogCollection","WAWebCatalogVariantHelper","WAWebCmd","WAWebComposeBoxActions","WAWebDrawerManager","WAWebFindChatAction","WAWebFrontendConstants","WAWebMsgCollection","WAWebStateUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b,c,d,e,f){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e,f,g){var h;c===void 0&&(c=100);e===void 0&&(e=100);var i,j,k,l=(yield d("WAWebBusinessProfileCollection").BusinessProfileCollection.find(a));h=(h=d("WAWebCatalogCollection").CatalogCollection.get(a))==null?void 0:h.productCollection.get(b);d("WAWebCatalogVariantHelper").shouldRequestVariantInfo(l,h)&&(i=d("WAWebCatalogVariantHelper").FULL_VARIANT_INFO_FIELDS,j=d("WAWebCatalogVariantHelper").VARIANT_THUMBNAIL_IMAGE_SIZE,k=d("WAWebCatalogVariantHelper").VARIANT_THUMBNAIL_IMAGE_SIZE);return d("WAWebBizProductCatalogBridge").queryProduct(a,b,c,e,f,g,i,j,k)});return h.apply(this,arguments)}function c(a,b,c,e,f,g,h,i,j,k){c===void 0&&(c=5);e===void 0&&(e=100);f===void 0&&(f=100);h===void 0&&(h=!1);return d("WAWebBizProductCatalogBridge").queryCatalog(a,b,c,e,f,g,h,i,j,k)}function e(a,b,c,e,f){c===void 0&&(c=100);e===void 0&&(e=100);return d("WAWebBizProductCatalogBridge").queryProductList(a,b,c,e,f)}function f(a,b){return d("WAWebBizProductCatalogBridge").appealProduct(a,b)}function i(a,b,c){return d("WAWebBizProductCatalogBridge").reportProduct(a,b,c)}function j(a,b,c){b===void 0&&(b=100);c===void 0&&(c=100);return d("WAWebBizProductCatalogBridge").addProduct(a,b,c)}function k(a,b,c){b===void 0&&(b=100);c===void 0&&(c=100);return d("WAWebBizProductCatalogBridge").editProduct(a,b,c)}function l(a){return d("WAWebBizProductCatalogBridge").deleteProducts(a)}function m(a,b,c){var e=a.catalogWid;if(!b)return;b=b.productCollection.get(a.id);var f=b?d("WAWebStateUtils").unproxy(b):d("WAWebStateUtils").unproxy(a);if(!f)return;b=f.getProductImageCollectionHead();var g=b==null?void 0:b.mediaData;if(!g)return;d("WAWebFindChatAction").findOrCreateLatestChat(e,"bizProductCatalogAction").then(function(a){var b=a.chat;d("WAWebCmd").Cmd.openChatFromUnread(b).then(function(a){if(a){a=d("WAWebStateUtils").unproxy(d("WAWebBizCreateProductInquiry").createProductInquiry(f,e,g,c==null?void 0:c.session.toString()));d("WAWebMsgCollection").MsgCollection.add(a);b.composeQuotedMsg=a;d("WAWebComposeBoxActions").ComposeBoxActions.focus(b);window.innerWidth<=d("WAWebFrontendConstants").LAYOUT_2COLUMNS_MAX_WIDTH&&d("WAWebDrawerManager").DrawerManager.closeDrawerRight()}})})}g.queryProduct=a;g.queryCatalog=c;g.queryProductList=e;g.appealProduct=f;g.reportProduct=i;g.addProduct=j;g.editProduct=k;g.deleteProducts=l;g.sendProductToChat=m}),98); __d("WAWebBizProductMessageListAction",["WAWebMsgCollection"],(function(a,b,c,d,e,f,g){function a(a,b){var c;b=d("WAWebMsgCollection").MsgCollection.get(b);c=b==null?void 0:(c=b.list)==null?void 0:(c=c.productListInfo)==null?void 0:(c=c.headerImage)==null?void 0:c.productId;a.id===c&&b!=null&&(b.productHeaderImageRejected=!0)}g.updateProductListHeaderImageRejected=a}),98); __d("WAWebBizUpdateContactsWithVerifiedNamesAction",["WANullthrows","WAWebApiVerifiedBusinessName","WAWebBusinessProfileTypes","WAWebContactCollection","WAWebHandleMsgTypes.flow","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(a,b){var c={};for(a of a){var e=a.id;c[e.user]=a}for(a of b){var e=a.id;if(e.isBot())continue;b=c[e.user];var f=Boolean(b);b=b||{};var g=b.level,h=b.name,i=b.isApi,j=b.isSmb;b=b.privacyMode;i=Boolean(i);f={isBusiness:f,isEnterprise:i,isSmb:Boolean(j),verifiedLevel:d("WAWebBusinessProfileTypes").convertLevel(g),verifiedName:h,privacyMode:b};a.set(f)}}a=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield d("WAWebApiVerifiedBusinessName").getAllVerifiedNames()).map(function(a){var b=a.id,e=a.name,f=a.level,g=a.isApi,h=a.isSmb;a=a.privacyMode;return{id:d("WAWebWidFactory").createUserWid(b),name:e,level:f,isApi:g,isSmb:h,privacyMode:a?{actualActors:c("WANullthrows")(d("WAWebHandleMsgTypes.flow").ActualActorsEnumType.cast(a.actualActors)),hostStorage:c("WANullthrows")(d("WAWebHandleMsgTypes.flow").HostStorageEnumType.cast(a.hostStorage)),privacyModeTs:a.privacyModeTs}:null}});h(a,d("WAWebContactCollection").ContactCollection.toArray())});return function(){return a.apply(this,arguments)}}();g.updateContactsWithVerifiedNames=h;g.applyContactBusinessProps=a}),98); __d("WAWebBizVerifiedNameAction",["Promise","WAWebBizUpdateContactsWithVerifiedNamesAction","WAWebChatCollection","WAWebFrontendChatGetters","WAWebHandleBusinessNameChangeLidHelpers","WAWebHandlePrivacyModeUpdateMsgAction","WAWebLid1X1MigrationGating","WAWebLidMigrationUtils","WAWebSchemaVerifiedBusinessName","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function a(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a.length===0)return;yield (h||(h=b("Promise"))).all(a.map(function(a){var b=a.id;a=a.verifiedName.privacyMode;if(a==null)return;var c=d("WAWebLidMigrationUtils").toLid(b);c=d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()&&c!=null?d("WAWebChatCollection").ChatCollection.getChatByAccountLid(d("WAWebWidFactory").toChatWid(c)):d("WAWebChatCollection").ChatCollection.get(b);if(c==null)return;if(d("WAWebFrontendChatGetters").getShouldAppearInList(c)===!0)return;return d("WAWebHandlePrivacyModeUpdateMsgAction").handlePrivacyModeTransition(c.id,a,{chat:c,bypassVerifiedNameUpdate:!0,shouldRunMATonWid:!1})}));a=d("WAWebHandleBusinessNameChangeLidHelpers").getVerifiedNamesToUpdateLidAware(a).map(function(a){var b=a.id;a=a.verifiedName;var c=a.level,d=a.serial,e=a.name,f=a.isApi,g=a.isSmb;a=a.privacyMode;return{id:b.isLid()?b.toString():b.user,level:c,serial:d,name:e,isApi:f,isSmb:g,privacyMode:a?{actualActors:a.actualActors,hostStorage:a.hostStorage,privacyModeTs:a.privacyModeTs}:null}});yield d("WAWebSchemaVerifiedBusinessName").getVerifiedBusinessNameTable().bulkCreateOrReplace(a);yield d("WAWebBizUpdateContactsWithVerifiedNamesAction").applyContactBusinessProps()});return i.apply(this,arguments)}g.handleVerifiedNameSync=a}),98); __d("WAWebDBNoteDatabaseApi",["WALogger","WAWebSchemaNote","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[getOnlyNoteByChatJid] Found more than one note for chatJid ","."]);h=function(){return a};return a}function a(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){return d("WAWebSchemaNote").getNoteTable().createOrReplace(a)});return i.apply(this,arguments)}function j(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=d("WAWebSchemaNote").getNoteTable().equals(["chatJid"],a);return a});return k.apply(this,arguments)}function c(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield j(a));b.length>1&&d("WALogger").ERROR(h(),a).devConsole(b);return b.length>0?b[0]:null});return l.apply(this,arguments)}function e(a){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){return d("WAWebSchemaNote").getNoteTable().bulkCreateOrMerge(a)});return m.apply(this,arguments)}g.addOrEditNote=a;g.getNotesByChatJid=j;g.getOnlyNoteByChatJid=c;g.bulkUpdateNotes=e}),98); __d("WAWebGetOnlyNoteByChatJidJob",["WAJobOrchestratorTypes","WAWebDBNoteDatabaseApi","WAWebOrchestratorNonPersistedJob","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=a.chatJid;return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("getOnlyNoteByChatJid",b("asyncToGeneratorRuntime").asyncToGenerator(function*(){return d("WAWebDBNoteDatabaseApi").getOnlyNoteByChatJid(c)}),{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()});return h.apply(this,arguments)}g.getOnlyNoteByChatJidJob=a}),98); __d("WAWebNoteModel",["WAWebBaseModel"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.type=d("WAWebBaseModel").prop(),c.chatJid=d("WAWebBaseModel").prop(),c.content=d("WAWebBaseModel").prop(),c.createdAt=d("WAWebBaseModel").prop(),c.modifiedAt=d("WAWebBaseModel").prop(),b)||babelHelpers.assertThisInitialized(c)}var c=b.prototype;c.initialize=function(){a.prototype.initialize.call(this)};return b}(d("WAWebBaseModel").BaseModel);a.Proxy="note";b=d("WAWebBaseModel").defineModel(a);g.Note=b}),98); __d("WAWebNoteAction",["invariant","WALogger","WATimeUtils","WAWebBaseModel","WAWebBizGatingUtils","WAWebDBNoteDatabaseApi","WAWebGetOnlyNoteByChatJidJob","WAWebNoteCollection","WAWebNoteModel","WAWebNoteSync","WAWebNotesUtils","WAWebSchemaNote","WAWebSyncdCoreApi","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g,h){function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[Notes] addOrEditNoteAction: id "," mutation generated"]);i=function(){return a};return a}function a(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!d("WAWebNoteCollection").NoteCollection.hasCachedQueryForChatJid(a)){var b=(yield d("WAWebGetOnlyNoteByChatJidJob").getOnlyNoteByChatJidJob({chatJid:a}));d("WAWebNoteCollection").NoteCollection.updateCollectionFromDB(a,b)}return d("WAWebNoteCollection").NoteCollection.maybeGetNoteByChatJid(a)});return j.apply(this,arguments)}function e(a,b,c,d){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,d){yield o({actionType:"add",noteType:a,chatJid:b,content:c},(a=d)!=null?a:!0)});return k.apply(this,arguments)}function f(a,b,c,d,e){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,d,e){yield o({actionType:"edit",id:a,noteType:b,chatJid:c,content:d,createdAt:e},!0)});return l.apply(this,arguments)}function m(a){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield o({actionType:"syncdUpsert",id:d("WAWebBaseModel").idTypeToString(a.id),noteType:a.type,chatJid:a.chatJid,content:a.content,createdAt:a.createdAt,modifiedAt:a.modifiedAt},!1)});return n.apply(this,arguments)}function o(a,b){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){var f;d("WAWebBizGatingUtils").smbNotesV1Enabled()||h(0,79042);var g=d("WATimeUtils").unixTime(),j=a.id;j==null&&(j=(yield d("WAWebNotesUtils").generateNoteId(a.chatJid)));var k={id:j,type:a.noteType,chatJid:a.chatJid,content:a.content,createdAt:(f=a.createdAt)!=null?f:g,modifiedAt:(f=a.modifiedAt)!=null?f:g};if(e){a=(yield c("WAWebNoteSync").getNoteMutation(k));d("WALogger").LOG(i(),j).devConsole(a);yield d("WAWebSyncdCoreApi").lockForSync(["note"],[a],b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield d("WAWebDBNoteDatabaseApi").addOrEditNote(k)}))}else yield d("WAWebDBNoteDatabaseApi").addOrEditNote(k);d("WAWebNoteCollection").NoteCollection.add(k,{merge:!0})});return p.apply(this,arguments)}function q(a,b){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=(yield d("WAWebDBNoteDatabaseApi").getNotesByChatJid(b));c.length>0&&(yield d("WAWebSchemaNote").getNoteTable().bulkRemove(c.map(function(a){return a.id})),d("WAWebNoteCollection").NoteCollection.purgeNotesByChatJid(b));c=(yield d("WAWebDBNoteDatabaseApi").getNotesByChatJid(a));if(c.length===0)return;c=c.map(function(a){return babelHelpers["extends"]({},a,{chatJid:b})});var e=c.map(function(a){return new(d("WAWebNoteModel").Note)(a)});d("WAWebNoteCollection").NoteCollection.purgeNotesByChatJid(a);d("WAWebNoteCollection").NoteCollection.add(e,{merge:!0});return d("WAWebDBNoteDatabaseApi").bulkUpdateNotes(c)});return r.apply(this,arguments)}g.retrieveOnlyNoteForChatJid=a;g.noteAddAction=e;g.noteEditAction=f;g.upsertFromSyncd=m;g.addOrEditNoteAction=o;g.updateNoteJidAction=q}),98); __d("WAWebBizOrderAction",["WAWebBizOrderBridge"],(function(a,b,c,d,e,f,g){function a(a,b,c,e,f){return d("WAWebBizOrderBridge").queryOrder(a,b,c,e,f)}function b(a,b){return d("WAWebBizOrderBridge").createOrder(a,b)}g.queryOrder=a;g.createOrder=b}),98); __d("WAWebFindChatAction",["WAAbortError","WALogger","WAWebApiContact","WAWebChatGetExistingBridge","WAWebCheckChatExistedOrCreate","WAWebLid1X1MigrationGating","WAWebLidMigrationUtils","WAWebMessageProcessUtils","WAWebUsernameTypes","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["findOrCreateLatestChat: will create chat with ",", origin ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["findOrCreateLatestChat will create Lid chat for origin ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["findOrCreateLatestChat: creating lid chat with ",", origin ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["findOrCreateLatestChat: creating username chat with ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["findOrCreateLatestChat: creating pn chat with ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["findOrCreateLatestChat: could not find phone number for lid while enforcing pre-migration rules. source: ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["findOrCreateLatestChat: applying pre-migration rules (chat: ",", origin: ",")"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["findOrCreateLatestChat: using migration rules (chat: ",", origin: ",")"]);o=function(){return a};return a}function a(a,b,c){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e){if(!c("WAWebWid").isUser(a))return q(a,b).then(function(a){a=a.chat;return a});var f=(yield d("WAWebChatGetExistingBridge").getExisting(a));return f?f:q(a,b,e).then(function(a){a=a.chat;return a})});return p.apply(this,arguments)}function q(a,b,c){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e){var f={chatId:a};if(c("WAWebWid").isRegularUser(a))if(d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()){d("WALogger").LOG(o(),f.chatId.toLogString(),b);var g=d("WAWebLidMigrationUtils").getEnforceCurrentLid(a);f=(yield d("WAWebMessageProcessUtils").selectChatForOneOnOneMessage({lid:g}))}else if(a.isLid()&&b!=="username_contactless_search"){g=(yield d("WAWebChatGetExistingBridge").getExisting(f.chatId));if(g==null){d("WALogger").LOG(n(),f.chatId.toLogString(),b);g=d("WAWebApiContact").getPhoneNumber(d("WAWebWidFactory").toUserWid(a));if(g==null){d("WALogger").ERROR(m(),b).sendLogs("findOrCreateLatestChat: could not find phone number for lid while enforcing pre-migration rules");throw c("err")("findOrCreateLatestChat: could not find phone number for lid while enforcing pre-migration rules")}f={chatId:g}}}g=(a=e)!=null?a:{};e=g.forceUsync;a=g.isGroupJoin;var p=g.signal;g=g.nextPrivacyMode;if(p==null?void 0:p.aborted)throw new(d("WAAbortError").AbortError)();p=(yield d("WAWebChatGetExistingBridge").getExisting(f.chatId));if(p)return{chat:p,created:!1};p={createdLocally:!0};a===!0&&(p.notSpam=!0);if(f.chatId.isLid()){a=d("WAWebApiContact").getPhoneNumber(d("WAWebWidFactory").toUserWid(f.chatId));b==="username_contactless_search"?a!=null?(f.chatId=a,d("WALogger").LOG(l(),f.chatId.toLogString())):(p.lidOriginType=d("WAWebUsernameTypes").LidOriginType.USERNAME,d("WALogger").LOG(k(),f.chatId.toLogString())):(p.lidOriginType=d("WAWebUsernameTypes").LidOriginType.GENERAL,d("WALogger").LOG(j(),f.chatId.toLogString(),b));d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()||d("WALogger").ERROR(i(),b).sendLogs("findOrCreateLatestChat will create Lid chat")}d("WALogger").LOG(h(),f.chatId.toLogString(),b);a=(yield d("WAWebCheckChatExistedOrCreate").checkChatExistedOrCreate({destinationChat:f,msgMeta:null,chatOriginType:b,initialProps:p,options:{forceUsync:e,nextPrivacyMode:g}}));b=(yield d("WAWebChatGetExistingBridge").getExisting(f.chatId));if(b==null)throw c("err")("findChat: new chat not found");return{chat:b,created:!a}});return r.apply(this,arguments)}g.findExistingChat=a;g.findOrCreateLatestChat=q}),98); __d("WAWebSetArchiveChatActionUtils",["WALogger","WAWebSettingsGetters","WAWebSettingsModel"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["archive:shouldUnarchiveChat unarchive chat"]);h=function(){return a};return a}function a(a){if(d("WAWebSettingsGetters").getShowArchiveV2(c("WAWebSettingsModel")))return!1;d("WALogger").DEV(h());return!0}g.shouldUnarchiveChat=a}),98); __d("WAWebWamEnumWebcQueryTriggerType",[],(function(a,b,c,d,e,f){a=Object.freeze({UNKNOWN:0,USER_SCROLL:1,NEW_MESSAGE_PREFETCH:2,SEARCH_RESULT_CLICK:3});f.WEBC_QUERY_TRIGGER_TYPE=a}),66); __d("WAWebHandleNewMsgAction",["Promise","WAFilteredCatch","WALogger","WATimeUtils","WAWebApiChat","WAWebBackendErrors","WAWebBotGenTypingIndicatorMsg","WAWebChangePresenceHandlerAction","WAWebChatGetters","WAWebChatLoadMessages","WAWebCmd","WAWebCollectionConstants","WAWebCommonCTWAConsumerTransparency","WAWebCommonCTWALogging","WAWebCommonMsgUtils","WAWebConversionTupleCollection","WAWebDBUpdateChatTable","WAWebEnvironment","WAWebFrontendMsgGetters","WAWebGroupUnreadMessageType","WAWebHandleMsgReceiptCommon","WAWebInvisiblePlaceholderViewModeProcessor","WAWebMsgGetters","WAWebMsgType","WAWebNewsletterGatingUtils","WAWebNoop","WAWebSendSpamChatAction","WAWebSetArchiveChatActionUtils","WAWebUnreadMentionModel","WAWebUserPrefsMeUser","WAWebViewMode.flow","WAWebViewModeUtils","WAWebWamEnumWebcQueryTriggerType","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["chat:onNewMsg failed\n",""],["chat:onNewMsg failed\\n",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["onNewMsg: unable to find metadata from chat table for id:",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["chat model: unarchiving chat"]);k=function(){return a};return a}function l(){return!d("WAWebCmd").Cmd.isOfflineDeliveryEnd}function a(a,e){if(d("WAWebChatGetters").getIsNewsletter(a)&&!d("WAWebNewsletterGatingUtils").isNewsletterEnabled())return(h||(h=b("Promise"))).resolve();if(!e)return(h||(h=b("Promise"))).resolve();var f=(h||(h=b("Promise"))).resolve();d("WAWebMsgGetters").getIsSentByMe(e)&&!a.notSpam&&!d("WAWebChatGetters").getIsNewsletter(a)&&(f=d("WAWebSendSpamChatAction").sendNotSpam(a,!1));return d("WAWebFrontendMsgGetters").getEventType(e)===d("WAWebCommonMsgUtils").EventType.IGNORE?(h||(h=b("Promise"))).resolve():f.then(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var b={};a.promises.updateSortTime&&a.promises.updateSortTime.abortController.abort();d("WAWebMsgGetters").getIsSentByMeFromWeb(e)&&(a.archive&&(d("WAWebSetArchiveChatActionUtils").shouldUnarchiveChat(d("WAWebMsgGetters").getIsSentByMe(e))&&(d("WALogger").DEV(k()),b.archive=!1)));a.promises.setArchive&&a.promises.setArchive.abortController.abort();!d("WAWebChatGetters").getIsNewsletter(a)&&e.subtype!==d("WAWebBotGenTypingIndicatorMsg").BOT_TYPING_PLACEHOLDER_MSG_SUBTYPE&&(!d("WAWebMsgGetters").getIsSentByMe(e)?c("WAWebChangePresenceHandlerAction")({id:a.id,participant:e.author,type:"idle"},!1):a.markedUnread=!1);yield d("WAWebDBUpdateChatTable").updateChatTable(a.id,b);b=babelHelpers["extends"]({},b);try{var f;if(l()&&(d("WAWebViewModeUtils").isViewModeVisibleInSurface(d("WAWebViewMode.flow").ViewModeSurface.CHAT,e.viewMode)||((f=d("WAWebInvisiblePlaceholderViewModeProcessor").InvisiblePlaceholderViewModeProcessor.compatibleMessageTypes)==null?void 0:f.includes(e.type))))b.t=e.t,(d("WAWebFrontendMsgGetters").getEventType(e)===d("WAWebCommonMsgUtils").EventType.AMBIENT||d("WAWebFrontendMsgGetters").getEventType(e)===d("WAWebCommonMsgUtils").EventType.DEFAULT)&&!e.id.fromMe&&(b.unreadCount=a.unreadCount+1||1,a.activeUnreadCount>0&&(b.activeUnreadCount=a.activeUnreadCount+1));else{f=(yield d("WAWebApiChat").getChatMeta(a.id));var g=f.unreadCount;f=f.timestamp;b.unreadCount=g;b.t=f;a.activeUnreadCount>0&&(b.activeUnreadCount=a.activeUnreadCount+Number(d("WAWebViewModeUtils").isViewModeVisibleInSurface(d("WAWebViewMode.flow").ViewModeSurface.CHAT,e.viewMode)))}b.unreadDividerOffset=0}catch(b){d("WALogger").ERROR(j(),a.id.toLogString())}return b})).then(function(b){a.set(b);e.ctwaContext!=null&&(d("WAWebCommonCTWAConsumerTransparency").handleConsumerTransparencyForNewMsg(a,e.ctwaContext.conversionData,e.ctwaContext.conversionSource),d("WAWebCommonCTWALogging").maybeSetCtwaMessageReceivedInUserPreferenceStore(e));var f=c("WAWebConversionTupleCollection").get(a.id);if(f)f.timestamp=d("WATimeUtils").unixTime();else if(e.ctwaContext!=null){f=e.ctwaContext;var g=f.conversionSource;f=f.conversionData;c("WAWebConversionTupleCollection").add({conversionSource:g,conversionData:f,id:a.id,timestamp:d("WATimeUtils").unixTime()},{merge:!0})}g=d("WAWebUserPrefsMeUser").getMeUser();e.type==="gp2"&&(e.subtype==="add"||e.subtype==="create")&&a.getGroupMetadataCollection().trigger("group_participant_change_"+g.toString(),a.id);if(!d("WAWebMsgGetters").getIsSentByMe(e)){switch(d("WAWebFrontendMsgGetters").getEventType(e)){case d("WAWebCommonMsgUtils").EventType.DEFAULT:case d("WAWebCommonMsgUtils").EventType.AMBIENT:d("WAWebFrontendMsgGetters").getEventType(e)===d("WAWebCommonMsgUtils").EventType.DEFAULT&&d("WAWebCmd").Cmd.alertNewMsg(e);a.msgs.length<d("WAWebCollectionConstants").MSG_PRELOAD_THRESHOLD&&!d("WAWebChatGetters").getIsNewsletter(a)&&d("WAWebChatLoadMessages").loadEarlierMsgs(a,void 0,d("WAWebWamEnumWebcQueryTriggerType").WEBC_QUERY_TRIGGER_TYPE.NEW_MESSAGE_PREFETCH)["catch"](d("WAFilteredCatch").filteredCatch(d("WAWebBackendErrors").E404,c("WAWebNoop")))["catch"](function(a){d("WALogger").LOG(i(),a)});break;case d("WAWebCommonMsgUtils").EventType.NOTEWORTHY:(e.type===d("WAWebMsgType").MSG_TYPE.CALL_LOG&&!c("WAWebEnvironment").isWindows||e.subtype==="sender_invite")&&d("WAWebCmd").Cmd.alertNewMsg(e);break;case d("WAWebCommonMsgUtils").EventType.SIGNIFICANT:if(e.type==="gp2"&&e.subtype==="add"&&d("WAWebUserPrefsMeUser").isMeAccount(e.recipients[0])&&!a.contact.name)return;d("WAWebCmd").Cmd.alertNewMsg(e);f=a.getGroupMetadataCollection();f.trigger("group_participant_change_"+g.toString(),a.id);break;default:break}f=e.mediaData;f&&(f.type==="image"||f.type==="video")&&d("WAWebCmd").Cmd.newMediaMsg(e);b.unreadCount!=null&&b.unreadCount>0&&!l()&&d("WAWebHandleMsgReceiptCommon").processOrphanPeerReceipt(e.id);if(d("WAWebMsgGetters").getIsImportantMessage(e)){g=new(c("WAWebUnreadMentionModel"))({id:e.id.toString(),timestamp:e.t});(f=a.groupMetadata)==null?void 0:f.unreadMentionMetadata.addUnreadMentions(g,d("WAWebGroupUnreadMessageType").UnreadMessageType.NEW_MESSAGE);if(a.archiveAtMentionViewedInDrawer){b=new Map();b.set(a.id.toString(),!1);d("WAWebApiChat").updateChatArchiveDrawer(b);a.archiveAtMentionViewedInDrawer=!1}}}})}g.handleNewMsgForChat=a}),98); __d("WAWebSendAddonMsgChatAction",["WAJobOrchestratorTypes","WAWebOrchestratorNonPersistedJob","WAWebSendMsgRecordAction","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("sendMessage",b("asyncToGeneratorRuntime").asyncToGenerator(function*(){return d("WAWebSendMsgRecordAction").sendAddonRecord(a)}),{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()}g.addAndSendAddonToChat=a}),98); __d("WAWebSendClearChatAction",["fbt","WAFilteredCatch","WALogger","WAWebActionToast.react","WAWebBackendErrors","WAWebChatClearBridge","WAWebChatConstants","WAWebNoop","WAWebStateUtils","WAWebToastManager","asyncToGeneratorRuntime","react"],(function(a,b,c,d,e,f,g,h){var i;function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["models:chat:sendClear dropped"]);j=function(){return a};return a}var k=i||c("react");function a(a,b){return l(d("WAWebStateUtils").unproxy(a),b)}function l(a,e){var f=a.promises;if(f.sendClear)return f.sendClear;var g=a.getLastMsgKeyForAction();g=f.sendClear=d("WAWebChatClearBridge").sendClear(a,g,e);var i=new(d("WAWebActionToast.react").ActionType)(h._(/*BTDS*/"__JHASH___FX9j9by1V2__JHASH__")),n=g.then(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){a.endOfHistoryTransferType=d("WAWebChatConstants").ConversationEndOfHistoryTransferModelPropType.COMPLETE_AND_NO_MORE_MESSAGE_REMAIN_ON_PRIMARY;return new(d("WAWebActionToast.react").ActionType)(h._(/*BTDS*/"__JHASH__CpLIkkKTdUu__JHASH__"))}))["catch"](d("WAFilteredCatch").filteredCatch(d("WAWebBackendErrors").ServerStatusCodeError,function(a){if(a.status>=400)return new(d("WAWebActionToast.react").ActionType)(h._(/*BTDS*/"__JHASH__6uDz5kqblli__JHASH__"))}))["catch"](function(b){d("WALogger").WARN(j()).devConsole(b);return new(d("WAWebActionToast.react").ActionType)(h._(/*BTDS*/"__JHASH__6uDz5kqblli__JHASH__"),{actionText:h._(/*BTDS*/"__JHASH__TyKOR8KAtP1__JHASH__"),actionHandler:function(){return l(a,e)}})});d("WAWebToastManager").ToastManager.open(k.jsx(d("WAWebActionToast.react").ActionToast,{initialAction:i,pendingAction:n}));return g.then(function(b){b.result&&m(a,b.result)})["catch"](d("WAFilteredCatch").filteredCatch(d("WAWebBackendErrors").ServerStatusCodeError,c("WAWebNoop")))["finally"](function(){f.sendClear=null})}function m(a,b){a&&b&&a.deleteMessages(b)}g.sendClear=a}),226); __d("WAWebBizShowOrderEphemeralSystemAction",["WAWebBizGatingUtils","WAWebDBChatEphemeralExemptionData","WAWebDBEphemeralDisplayedExemptions","WAWebOrderEphemeralExemptionUtil","WAWebOrderSystemMsg"],(function(a,b,c,d,e,f,g){function a(a,b){if(!d("WAWebBizGatingUtils").inOrderMessagesEphemeralExceptionEnabled())return null;var c=a.safe(),e=a.interactiveType;a=a.nativeFlowName;if(!d("WAWebOrderEphemeralExemptionUtil").isMessageTypeExemptedFromDisappearing(c.type,e,a))return null;c={id:b.id.toString(),ephemeralDuration:b.ephemeralDuration,ephemeralDisplayedExemptions:b.ephemeralDisplayedExemptions};if(d("WAWebOrderEphemeralExemptionUtil").shouldShowOrderExemptionSystemMessage(c)){b.ephemeralDisplayedExemptions=d("WAWebDBEphemeralDisplayedExemptions").EphemeralExemptionType.ORDERS_AND_PAYMENTS;d("WAWebDBChatEphemeralExemptionData").persistsEphemeralDisplayedExemptions(b.id,b.ephemeralDuration,d("WAWebDBEphemeralDisplayedExemptions").EphemeralExemptionType.ORDERS_AND_PAYMENTS);return d("WAWebOrderSystemMsg").getOrderEphemeralExemptionSystemMsg(b.id)}else d("WAWebOrderEphemeralExemptionUtil").shouldUnsetChatEphemeralDisplayedExemption(c)&&(b.ephemeralDisplayedExemptions=d("WAWebDBEphemeralDisplayedExemptions").EphemeralExemptionType.UNSET,d("WAWebDBChatEphemeralExemptionData").persistsEphemeralDisplayedExemptions(b.id,b.ephemeralDuration,d("WAWebDBEphemeralDisplayedExemptions").EphemeralExemptionType.UNSET));return null}g.getMaybeSystemMsgForOrderEphemeralExemption=a}),98); __d("WAWebEmptyChatSystemMsg",["WAWebInitialSystemMsg","WAWebMsgGetters","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if(!d("WAWebMsgGetters").getIsGroupMsg(a)&&b.msgs.length===0){return c("WAWebInitialSystemMsg")(b.id,b.contact.privacyMode,(a=b.contact.businessProfile)==null?void 0:a.automatedType)}return null});return h.apply(this,arguments)}g["default"]=a}),98); __d("WAWebSendMsgChatAction",["Promise","WAJobOrchestratorTypes","WALogger","WATimeUtils","WAWebApiGroupInviteV4Store","WAWebBizAgentAction","WAWebBizShowOrderEphemeralSystemAction","WAWebDBProcessMessage","WAWebDBRevokeInviteV4","WAWebEmptyChatSystemMsg","WAWebLid1X1MigrationGating","WAWebLidMigrationUtils","WAWebMessageSendPerfReporter","WAWebMessageSendReporter","WAWebMiscErrors","WAWebMsgCollection","WAWebMsgType","WAWebOrchestratorNonPersistedJob","WAWebPrivacyMode_WORKER_INCOMPATIBLE","WAWebSendMsgRecordAction","WAWebStateUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[group-invites] isLidMigrated: ",""]);j=function(){return a};return a}function a(a,b,c){return k(d("WAWebStateUtils").unproxy(a),b,c)}function e(a,b){return l(d("WAWebStateUtils").unproxy(a),b)}function k(a,e,f){f===void 0&&(f=void 0);var g;e=(h||(h=b("Promise"))).resolve(e).then(function(){var e=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){b=babelHelpers["extends"]({},b);var e=d("WAWebPrivacyMode_WORKER_INCOMPATIBLE").getPrivacyModeFromModel(a.id);e!=null&&(b.privacyModeWhenSent=e);b.agentId=d("WAWebBizAgentAction").getAgentId(b);var f=d("WAWebMsgCollection").MsgCollection.add(b)[0];if(f){var h;f.wamMessageSendReporter=new(d("WAWebMessageSendReporter").MessageSendReporter)(f);f.wamMessageSendPerfReporter=new(d("WAWebMessageSendPerfReporter").MessageSendPerfReporter)({chatWid:f.to,mediaType:f.getWamMediaType(),messageType:f.getWamMessageType()});g=(yield c("WAWebEmptyChatSystemMsg")(f,a));if(!g){e=d("WAWebBizShowOrderEphemeralSystemAction").getMaybeSystemMsgForOrderEphemeralExemption(f,a);e&&(g=[e])}e=g?[].concat(g,[b]):[b];(h=f.wamMessageSendPerfReporter)==null?void 0:h.startSavedStage();return d("WAWebDBProcessMessage").storeMessages(e,a.id).then(function(a){(a=f.wamMessageSendPerfReporter)==null?void 0:a.postSavedStage();if(f.type===d("WAWebMsgType").MSG_TYPE.GROUPS_V4_INVITE){var b=parseInt(f.inviteCodeExp,10),c=f.from.isLid()?d("WAWebLidMigrationUtils").toLid(f.to):f.to;if(!c){a=d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated();d("WALogger").LOG(j(),a);a="[group-invites] failed to get lid mapping when revoking existing duplicate group invite";d("WALogger").ERROR(i(),a).sendLogs(a);return}return d("WAWebDBRevokeInviteV4").revokeGroupInviteV4(f.from.toString(),c.toString(),f.inviteGrp,b).then(function(){return d("WAWebApiGroupInviteV4Store").persistGroupInviteV4Msg(f.id.toString(),{id:f.id.toString(),from:f.from.toString(),to:c.toString(),groupId:f.inviteGrp,expiration:b,expired:d("WATimeUtils").unixTime()>=b})})}}).then(function(){return f.waitForPrep().then(function(){return f})})}throw new(d("WAWebMiscErrors").ModelCreateError)("Msg",b)});return function(a){return e.apply(this,arguments)}}());var k=a.addQueue.enqueue(e).then(function(b){var c;(c=b.wamMessageSendPerfReporter)==null?void 0:c.startRenderedStage();g&&a.msgs.add(g);return a.msgs.add(b)[0]}).then(function(b){var c;a.createdLocally=!1;(c=b.wamMessageSendPerfReporter)==null?void 0:c.postRenderedStage();return b});e=f?k.then(f).then(function(){return k}):k;f=l(a,e);return[k,f]}function l(a,c){return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("sendMessage",b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var b=(yield a.sendQueue.enqueue(c));return d("WAWebSendMsgRecordAction").sendMsgRecord(b)}),{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()}g.addAndSendMsgToChat=a;g.resendMsgToChat=e}),98); __d("WAWebBlockContants",[],(function(a,b,c,d,e,f){a=Object.freeze({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",StatusPostReport:"status_post_report",ChatFmxCardBlock:"chat_fmx_card_block",ChatFmxCardBlockSuspicious:"chat_fmx_card_block_suspicious",ChatFmxCardSafetyToolsBlock:"chat_fmx_card_safety_tools_block",ChatFmxCardSafetyToolsBlockSuspicious:"chat_fmx_card_safety_tools_block_suspicious",ChatFmxCardSafetyToolsReport:"chat_fmx_card_safety_tools_report",ChatFmxCardSafetyToolsReportSuspicious:"chat_fmx_card_safety_tools_report_suspicious",OneToOneBlockedChatComposer:"one_to_one_blocked_chat_composer"});b=Object.freeze({NoLongerNeeded:"no_longer_needed",NoSignUp:"no_sign_up",OffensiveMessages:"offensive_messages",Spam:"spam",Other:"other"});c=Object.freeze({False:"false",True:"true",None:"none"});Object.freeze({CatalogLink:"catalog_link",ClickToChatLink:"click_to_chat_link",Ctwa:"ctwa",MessageShortLink:"message_short_link",ProductLink:"product_link",QrCode:"qr_code"});f.BlockEntryPoint=a;f.BizOptOutReason=b;f.BizOptOutFirstMessage=c}),66); __d("WAWebBlocklistUtils",["WAWebABProps","WAWebBlockContants","WAWebSpamConstants","WAWebWamEnumBlockEntryPoint"],(function(a,b,c,d,e,f,g){function a(){return d("WAWebABProps").getABPropConfigValue("rbi_show_consistent_block_dialog_all_entry_points")}function b(){return d("WAWebABProps").getABPropConfigValue("rbi_revamped_block_report_dialog_design")}function c(){return d("WAWebABProps").getABPropConfigValue("rbi_change_delete_behavior_block_report_flows")}function h(){return d("WAWebABProps").getABPropConfigValue("rbi_pre_tick_report")}function e(a){if(h())return!0;switch(a){case d("WAWebBlockContants").BlockEntryPoint.ChatFmxCardBlock:case d("WAWebBlockContants").BlockEntryPoint.ChatFmxCardBlockSuspicious:case d("WAWebBlockContants").BlockEntryPoint.ChatFmxCardSafetyToolsBlock:case d("WAWebBlockContants").BlockEntryPoint.ChatFmxCardSafetyToolsBlockSuspicious:case d("WAWebBlockContants").BlockEntryPoint.ChatFmxCardSafetyToolsReport:case d("WAWebBlockContants").BlockEntryPoint.ChatFmxCardSafetyToolsReportSuspicious:case d("WAWebBlockContants").BlockEntryPoint.OneToOneOldSpamBannerBlock:return!0;default:return!1}}function f(){return d("WAWebABProps").getABPropConfigValue("report_block_improvements_for_groups_enabled")}function i(a){switch(a){case d("WAWebBlockContants").BlockEntryPoint.OneToOneOldSpamBannerBlock:case d("WAWebBlockContants").BlockEntryPoint.BizOldSpamBannerBlock:return d("WAWebSpamConstants").SpamFlow.OneToOneOldSpamBannerBlock;case d("WAWebBlockContants").BlockEntryPoint.BizSpamBannerBlock:return d("WAWebSpamConstants").SpamFlow.BizSpamBannerBlock;case d("WAWebBlockContants").BlockEntryPoint.ChatListBlock:return d("WAWebSpamConstants").SpamFlow.ChatListBlock;case d("WAWebBlockContants").BlockEntryPoint.ChatListNoInsubBlock:return d("WAWebSpamConstants").SpamFlow.ChatListNoInsubBlock;case d("WAWebBlockContants").BlockEntryPoint.NotificationBlock:return d("WAWebSpamConstants").SpamFlow.NotificationBlock;case d("WAWebBlockContants").BlockEntryPoint.OverflowMenuBlock:return d("WAWebSpamConstants").SpamFlow.OverflowMenuBlock;default:return d("WAWebSpamConstants").SpamFlow.Block}}function j(a){switch(a){case d("WAWebSpamConstants").SpamFlow.OverflowMenuReport:return d("WAWebBlockContants").BlockEntryPoint.OverflowMenuReport;case d("WAWebSpamConstants").SpamFlow.MediaViewer:return d("WAWebBlockContants").BlockEntryPoint.MediaViewer;case d("WAWebSpamConstants").SpamFlow.MessageMenu:return d("WAWebBlockContants").BlockEntryPoint.MessageMenu;case d("WAWebSpamConstants").SpamFlow.AccountInfoReport:return d("WAWebBlockContants").BlockEntryPoint.AccountInfoReport;case d("WAWebSpamConstants").SpamFlow.OneToOneChatSpamBannerReport:return d("WAWebBlockContants").BlockEntryPoint.OneToOneChatSpamBannerReport;case d("WAWebSpamConstants").SpamFlow.ChatFmxCardSafetyToolsReport:return d("WAWebBlockContants").BlockEntryPoint.ChatFmxCardSafetyToolsReport;case d("WAWebSpamConstants").SpamFlow.ChatFmxCardSafetyToolsReportSuspicious:return d("WAWebBlockContants").BlockEntryPoint.ChatFmxCardSafetyToolsReportSuspicious;default:return null}}function k(a){if(a==null)return d("WAWebWamEnumBlockEntryPoint").BLOCK_ENTRY_POINT.OTHER;switch(a){case d("WAWebBlockContants").BlockEntryPoint.OneToOneOldSpamBannerBlock:return d("WAWebWamEnumBlockEntryPoint").BLOCK_ENTRY_POINT.ONE_TO_ONE_OLD_SPAM_BANNER_BLOCK;case d("WAWebBlockContants").BlockEntryPoint.OneToOneSpamBannerBlock:return d("WAWebWamEnumBlockEntryPoint").BLOCK_ENTRY_POINT.ONE_TO_ONE_SPAM_BANNER_BLOCK;case d("WAWebBlockContants").BlockEntryPoint.AccountInfo:return d("WAWebWamEnumBlockEntryPoint").BLOCK_ENTRY_POINT.ACCOUNT_INFO;case d("WAWebBlockContants").BlockEntryPoint.AccountInfoReport:return d("WAWebWamEnumBlockEntryPoint").BLOCK_ENTRY_POINT.ACCOUNT_INFO_REPORT;case d("WAWebBlockContants").BlockEntryPoint.BizOldSpamBannerBlock:return d("WAWebWamEnumBlockEntryPoint").BLOCK_ENTRY_POINT.BIZ_OLD_SPAM_BANNER_BLOCK;case d("WAWebBlockContants").BlockEntryPoint.BizSpamBannerBlock:return d("WAWebWamEnumBlockEntryPoint").BLOCK_ENTRY_POINT.BIZ_SPAM_BANNER_BLOCK;case d("WAWebBlockContants").BlockEntryPoint.BlockHeaderChat:return d("WAWebWamEnumBlockEntryPoint").BLOCK_ENTRY_POINT.BLOCK_HEADER_CHAT;case d("WAWebBlockContants").BlockEntryPoint.CallLog:return d("WAWebWamEnumBlockEntryPoint").BLOCK_ENTRY_POINT.CALL_LOG;case d("WAWebBlockContants").BlockEntryPoint.Chat:return d("WAWebWamEnumBlockEntryPoint").BLOCK_ENTRY_POINT.CHAT;case d("WAWebBlockContants").BlockEntryPoint.ChatListBlock:return d("WAWebWamEnumBlockEntryPoint").BLOCK_ENTRY_POINT.CHAT_LIST_BLOCK;case d("WAWebBlockContants").BlockEntryPoint.ChatListContextMenuBlock:return d("WAWebWamEnumBlockEntryPoint").BLOCK_ENTRY_POINT.CHAT_LIST_CONTEXT_MENU_BLOCK;case d("WAWebBlockContants").BlockEntryPoint.ChatListNoInsubBlock:return d("WAWebWamEnumBlockEntryPoint").BLOCK_ENTRY_POINT.CHAT_LIST_NOINSUB_BLOCK;case d("WAWebBlockContants").BlockEntryPoint.NotificationBlock:return d("WAWebWamEnumBlockEntryPoint").BLOCK_ENTRY_POINT.NOTIFICATION_BLOCK;case d("WAWebBlockContants").BlockEntryPoint.OverflowMenuBlock:return d("WAWebWamEnumBlockEntryPoint").BLOCK_ENTRY_POINT.OVERFLOW_MENU_BLOCK;case d("WAWebBlockContants").BlockEntryPoint.OverflowMenuReport:return d("WAWebWamEnumBlockEntryPoint").BLOCK_ENTRY_POINT.OVERFLOW_MENU_REPORT;case d("WAWebBlockContants").BlockEntryPoint.Profile:return d("WAWebWamEnumBlockEntryPoint").BLOCK_ENTRY_POINT.PROFILE;case d("WAWebBlockContants").BlockEntryPoint.TriggeredBlock:return d("WAWebWamEnumBlockEntryPoint").BLOCK_ENTRY_POINT.TRIGGERED_BLOCK;case d("WAWebBlockContants").BlockEntryPoint.BlockList:return d("WAWebWamEnumBlockEntryPoint").BLOCK_ENTRY_POINT.BLOCK_LIST;case d("WAWebBlockContants").BlockEntryPoint.MediaViewer:return d("WAWebWamEnumBlockEntryPoint").BLOCK_ENTRY_POINT.MEDIA_VIEWER;case d("WAWebBlockContants").BlockEntryPoint.MessageMenu:return d("WAWebWamEnumBlockEntryPoint").BLOCK_ENTRY_POINT.MESSAGE_MENU;case d("WAWebBlockContants").BlockEntryPoint.OneToOneChatSpamBannerReport:return d("WAWebWamEnumBlockEntryPoint").BLOCK_ENTRY_POINT.ONE_TO_ONE_SPAM_BANNER_REPORT;case d("WAWebBlockContants").BlockEntryPoint.StatusPostReport:return d("WAWebWamEnumBlockEntryPoint").BLOCK_ENTRY_POINT.STATUS_POST_REPORT;case d("WAWebBlockContants").BlockEntryPoint.ChatFmxCardBlock:return d("WAWebWamEnumBlockEntryPoint").BLOCK_ENTRY_POINT.CHAT_FMX_CARD_BLOCK;case d("WAWebBlockContants").BlockEntryPoint.ChatFmxCardBlockSuspicious:return d("WAWebWamEnumBlockEntryPoint").BLOCK_ENTRY_POINT.CHAT_FMX_CARD_BLOCK_SUSPICIOUS;case d("WAWebBlockContants").BlockEntryPoint.ChatFmxCardSafetyToolsBlock:return d("WAWebWamEnumBlockEntryPoint").BLOCK_ENTRY_POINT.CHAT_FMX_CARD_SAFETY_TOOLS_BLOCK;case d("WAWebBlockContants").BlockEntryPoint.ChatFmxCardSafetyToolsBlockSuspicious:return d("WAWebWamEnumBlockEntryPoint").BLOCK_ENTRY_POINT.CHAT_FMX_CARD_SAFETY_TOOLS_BLOCK_SUSPICIOUS;case d("WAWebBlockContants").BlockEntryPoint.ChatFmxCardSafetyToolsReport:return d("WAWebWamEnumBlockEntryPoint").BLOCK_ENTRY_POINT.CHAT_FMX_CARD_SAFETY_TOOLS_REPORT;case d("WAWebBlockContants").BlockEntryPoint.ChatFmxCardSafetyToolsReportSuspicious:return d("WAWebWamEnumBlockEntryPoint").BLOCK_ENTRY_POINT.CHAT_FMX_CARD_SAFETY_TOOLS_REPORT_SUSPICIOUS;case d("WAWebBlockContants").BlockEntryPoint.OneToOneBlockedChatComposer:return d("WAWebWamEnumBlockEntryPoint").BLOCK_ENTRY_POINT.ONE_TO_ONE_BLOCKED_CHAT_COMPOSER;default:return d("WAWebWamEnumBlockEntryPoint").BLOCK_ENTRY_POINT.OTHER}}function l(a){switch(a){case d("WAWebBlockContants").BlockEntryPoint.Profile:return 1;case d("WAWebBlockContants").BlockEntryPoint.ChatListBlock:return 2;case d("WAWebBlockContants").BlockEntryPoint.BlockList:return 1;default:return null}}function m(a){switch(a){case d("WAWebBlockContants").BlockEntryPoint.Profile:return 3;case d("WAWebBlockContants").BlockEntryPoint.ChatListBlock:return 4;case d("WAWebBlockContants").BlockEntryPoint.BlockList:return 5;default:return null}}g.isRBIShowConsistentBlockDialogEnabled=a;g.isRBIRevampedBlockReportDesignEnabled=b;g.isRBIChangeDeleteBehaviorBlockReportFlowsEnabled=c;g.isRBIPreTickReportForOneToOneChatsEnabled=h;g.isReportPreCheckedForOneToOneChats=e;g.isRBIForGroupsEnabled=f;g.getSpamFlowFromBlockEntryPoint=i;g.getBlockEntryPointFromSpamFlow=j;g.getBlockEventMetricFromBlockEntryPoint=k;g.getBlockPsaRemoveEntryPointFromBlockEntryPoint=l;g.getUnblockPsaRemoveEntryPointFromBlockEntryPoint=m}),98); __d("WAWebReportGatingUtils",["WAWebABProps","WAWebChatGetters","WAWebMsgGetters","WAWebNewsletterGatingUtils"],(function(a,b,c,d,e,f,g){"use strict";function h(){return d("WAWebABProps").getABPropConfigValue("private_osa_reporting_enabled")}function a(){return d("WAWebABProps").getABPropConfigValue("private_messaging_uk_osa_enabled")}function b(a,b){var c=!1;a!=null?c=d("WAWebChatGetters").getIsNewsletter(a):b!=null&&(c=d("WAWebMsgGetters").getIsNewsletterMsg(b));return c===!0?d("WAWebNewsletterGatingUtils").isNewsletterAusOSAReportingEnabled():h()}g.isAusOSAReportingEnabled=h;g.isUKOSAReportingEnabled=a;g.isPostReportingAusOSAModalEnabled=b}),98); __d("WAWebSendSpamChatAction",["fbt","Promise","WAFilteredCatch","WALogger","WAWebActionToast.react","WAWebBackendErrors","WAWebBlockContactAction","WAWebBlocklistUtils","WAWebChatGetters","WAWebExitGroupAction","WAWebFrontendMsgGetters","WAWebMiscErrors","WAWebModalManager","WAWebMsgModel","WAWebMsgType","WAWebNoop","WAWebProcessBaseMsgInfo","WAWebReportGatingUtils","WAWebReportSpamJob","WAWebSendClearChatAction","WAWebSpamConstants","WAWebStateUtils","WAWebToastManager","gkx","react","requireDeferred"],(function(a,b,c,d,e,f,g,h){var i,j;function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["Error while reporting and blocking a message : ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["Error in blocking while reporting a message: ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["Error opening Aus OSA modal while reporting a message: ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["models:chat:sendNotSpam dropped"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["reportSpam dropped"]);o=function(){return a};return a}var p=j||c("react"),q=c("requireDeferred")("WAWebAusOSAReportModalTrigger").__setRef("WAWebSendSpamChatAction");function a(a){var b=a.spamFlow,c=a.chat,d=a.msg;a=a.msgType;return x({chat:c,spamFlow:b,msg:d,msgType:a})}function e(a,b){return y(d("WAWebStateUtils").unproxy(a),b)}function r(a,b){b===void 0&&(b=d("WAWebSpamConstants").SpamFlow.MessageMenu);a=d("WAWebStateUtils").unproxy(a);return x({chat:d("WAWebFrontendMsgGetters").getChat(a),spamFlow:b,msg:a})}function f(a,b){b===void 0&&(b=d("WAWebSpamConstants").SpamFlow.MessageMenu);a=new(d("WAWebMsgModel").Msg)(babelHelpers["extends"]({},d("WAWebProcessBaseMsgInfo").msgDataToBaseMsgInfo(a),{type:d("WAWebMsgType").MSG_TYPE.CHAT,body:a.body}));return r(a,b)}function s(a,b){b===void 0&&(b=d("WAWebSpamConstants").SpamFlow.MessageMenu);return B(d("WAWebStateUtils").unproxy(a),b)}function t(a){var b=a.chat;a=a.spamFlow;return z(d("WAWebStateUtils").unproxy(b),a,!1)}function u(a,b){return z(d("WAWebStateUtils").unproxy(a),b)}function v(a,b){return A(d("WAWebStateUtils").unproxy(a),b)}function w(){return{couldntSendReportMsg:h._(/*BTDS*/"__JHASH__FKNp-z_fTUk__JHASH__"),sendingReportMsg:h._(/*BTDS*/"__JHASH__XvWts3hWJAU__JHASH__"),reportSentMsg:h._(/*BTDS*/"__JHASH__oqeTG7jzPn7__JHASH__"),reportSentMsgV2:h._(/*BTDS*/"__JHASH__oK0zzcV2WAZ__JHASH__"),reportNotSentMsg:h._(/*BTDS*/"__JHASH__tCXjPjMAYH3__JHASH__"),tryAgainMsg:h._(/*BTDS*/"__JHASH__QmNO2-eE5iu__JHASH__")}}function x(a){var e=a.spamFlow,f=a.chat,g=a.msg,h=a.toastId,j=h===void 0?d("WAWebActionToast.react").genId():h,k=a.msgType;h=w();a=h.sendingReportMsg;var l=h.couldntSendReportMsg,m=h.tryAgainMsg,n=h.reportSentMsg,q=h.reportSentMsgV2,r=f!=null?d("WAWebStateUtils").unproxy(f):f,s=(h=r==null?void 0:r.promises)!=null?h:null;if(s==null?void 0:s.sendSpamReport)return s.sendSpamReport;var t;if(k===d("WAWebMsgType").MSG_TYPE.STATUS&&g!=null)t=d("WAWebReportSpamJob").reportStatus(e,g).then(function(a){var b;if((a==null?void 0:a.errorCode)!=null)throw new(d("WAWebBackendErrors").ServerStatusCodeError)(a.errorCode,a.errorText);if((a==null?void 0:(b=a.reportIdMixin)==null?void 0:b.reportId)!=null)return a.reportIdMixin.reportId});else{if(!s)return new(i||(i=b("Promise")))(c("WAWebNoop"));g!=null?t=s.sendSpamReport=d("WAWebReportSpamJob").reportSpam(d("WAWebFrontendMsgGetters").getChat(g),e,g).then(function(a){var b;if((a==null?void 0:a.errorCode)!=null)throw new(d("WAWebBackendErrors").ServerStatusCodeError)(a.errorCode,a.errorText);if((a==null?void 0:(b=a.reportIdMixin)==null?void 0:b.reportId)!=null)return a.reportIdMixin.reportId}):r!=null&&(t=s.sendSpamReport=d("WAWebReportSpamJob").reportSpam(r,e).then(function(a){if((a==null?void 0:a.errorCode)!=null)throw new(d("WAWebBackendErrors").ServerStatusCodeError)(a.errorCode,a.errorText)}))}if(!t)return new(i||(i=b("Promise")))(c("WAWebNoop"));f=new(d("WAWebActionToast.react").ActionType)(a);h=t.then(function(a){return a!=null&&d("WAWebReportGatingUtils").isPostReportingAusOSAModalEnabled(r,g)?null:new(d("WAWebActionToast.react").ActionType)(d("WAWebBlocklistUtils").isRBIRevampedBlockReportDesignEnabled()?q:n)})["catch"](d("WAFilteredCatch").filteredCatch(d("WAWebBackendErrors").ServerStatusCodeError,function(a){return!c("gkx")("26258")&&a.statusCode===548?new(d("WAWebActionToast.react").ActionType)(a.message):new(d("WAWebActionToast.react").ActionType)(l)}))["catch"](function(a){d("WALogger").WARN(o()).devConsole(a);return new(d("WAWebActionToast.react").ActionType)(l,{actionText:m,actionHandler:function(){return x({chat:r,spamFlow:e,msg:g,toastId:j,msgType:k})}})});d("WAWebToastManager").ToastManager.open(p.jsx(d("WAWebActionToast.react").ActionToast,{id:j,initialAction:f,pendingAction:h}));return t["finally"](function(){(s==null?void 0:s.sendSpamReport)&&(s.sendSpamReport=null)})}function y(a,c,e){c===void 0&&(c=!1);e===void 0&&(e=d("WAWebActionToast.react").genId());var f=a.promises,g=a.notSpam;if(g)return(i||(i=b("Promise"))).resolve();if(f.sendNotSpam)return f.sendNotSpam;g=f.sendNotSpam=d("WAWebReportSpamJob").sendNotSpamJob(a);if(c){var j=new(d("WAWebActionToast.react").ActionType)(h._(/*BTDS*/"__JHASH__awzjT8tsfpR__JHASH__")),k=g.then(function(){return new(d("WAWebActionToast.react").ActionType)(h._(/*BTDS*/"__JHASH__2fekmmcZrTF__JHASH__"))})["catch"](d("WAFilteredCatch").filteredCatch(d("WAWebBackendErrors").ServerStatusCodeError,function(){return new(d("WAWebActionToast.react").ActionType)(h._(/*BTDS*/"__JHASH__bGQ0h7k3uA8__JHASH__"))}))["catch"](function(b){d("WALogger").WARN(n()).devConsole(b);return new(d("WAWebActionToast.react").ActionType)(h._(/*BTDS*/"__JHASH__bGQ0h7k3uA8__JHASH__"),{actionText:h._(/*BTDS*/"__JHASH__TyKOR8KAtP1__JHASH__"),actionHandler:function(){return y(a,c,e)}})});d("WAWebToastManager").ToastManager.open(p.jsx(d("WAWebActionToast.react").ActionToast,{id:e,initialAction:j,pendingAction:k}))}return g.then(function(){a.set({notSpam:!0});if(d("WAWebChatGetters").getIsGroup(a)){var b;(b=a.groupMetadata)==null?void 0:b.set({trusted:!0})}})["finally"](function(){a.isTrusted(),f.sendNotSpam=null})}function z(a,e,f){f===void 0&&(f=!0);var g=a.promises,h=a.contact;if(g.reportSpamBlockClear)return g.reportSpamBlockClear;if(d("WAWebChatGetters").getIsGroup(a))return(i||(i=b("Promise"))).reject(new(d("WAWebMiscErrors").ActionError)());var j=d("WAWebBlocklistUtils").getBlockEntryPointFromSpamFlow(e);e=x({chat:a,spamFlow:e});g.reportSpamBlockClear=e.then(function(){return d("WAWebBlockContactAction").blockContact({contact:h,blockEntryPoint:j})}).then(function(){if(!f||d("WAWebBlocklistUtils").isRBIChangeDeleteBehaviorBlockReportFlowsEnabled())return;return d("WAWebSendClearChatAction").sendClear(a,!1)})["catch"](c("WAWebNoop"))["finally"](function(){g.reportSpamBlockClear=null});return g.reportSpamBlockClear}function A(a,e){var f=a.promises,g=a.isReadOnly;if(f.reportSpamExitClear)return f.reportSpamExitClear;if(!d("WAWebChatGetters").getIsGroup(a))return(i||(i=b("Promise"))).reject(new(d("WAWebMiscErrors").ActionError)());e=x({chat:a,spamFlow:e});if(g)g=e;else{var h=d("WAWebExitGroupAction").sendExitGroup(a);g=(i||(i=b("Promise"))).all([e,h])}f.reportSpamExitClear=g.then(function(){return d("WAWebSendClearChatAction").sendClear(a,!1)})["catch"](c("WAWebNoop"))["finally"](function(){f.reportSpamExitClear=null});return f.reportSpamExitClear}function B(a,b){var c=a.senderObj,e=d("WAWebFrontendMsgGetters").getChat(a),g=e.promises;if(g.reportMessageBlock)return g.reportMessageBlock;var h=d("WAWebBlocklistUtils").getBlockEntryPointFromSpamFlow(b);e=x({chat:e,spamFlow:b,msg:a});g.reportMessageBlock=e.then(function(a){d("WAWebModalManager").ModalManager.close();a!=null&&d("WAWebReportGatingUtils").isAusOSAReportingEnabled()&&q.load().then(function(b){return b.WAWebAusOSAReportModalTrigger(a)})["catch"](function(a){d("WALogger").ERROR(m(),a).sendLogs("report-message-aus-osa-error")});return d("WAWebBlockContactAction").blockContact({contact:c,blockEntryPoint:h})["catch"](function(a){d("WALogger").ERROR(l(),a).sendLogs("report-block-message-error")})})["catch"](function(a){d("WALogger").ERROR(k(),a).sendLogs("report-block-message-error")})["finally"](function(){g.reportMessageBlock=null});return g.reportMessageBlock}g.sendReport=a;g.sendNotSpam=e;g.sendMessageReport=r;g.sendCommentReport=f;g.sendMessageReportBlock=s;g.sendReportBlock=t;g.sendSpamBlockClear=u;g.sendSpamExitClear=v}),226); __d("WAWebSendTcTokenChatAction",["WALogger","WATimeUtils","WAWebApiContact","WAWebChatCollection","WAWebSchemaChat","WAWebSetPrivacyTokensJob","WAWebTrustedContactsUtils","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["sendTcToken failed - ",""]);h=function(){return a};return a}function a(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!a.isUserNotPSA()||a.isBot())return;var b=d("WAWebChatCollection").ChatCollection.get(a);if(b==null)return;if(!d("WAWebTrustedContactsUtils").shouldSendNewToken(b.tcTokenSenderTimestamp))return;try{var c=d("WATimeUtils").unixTime(),e=a.isLid()?d("WAWebApiContact").getPhoneNumber(d("WAWebWidFactory").toUserWid(a)):a;if(e==null)return;yield d("WAWebSetPrivacyTokensJob").issuePrivacyToken(e,[d("WAWebSetPrivacyTokensJob").TokenType.TrustedContact],c);e={tcTokenSenderTimestamp:c};b.set(e);yield d("WAWebSchemaChat").getChatTable().merge(a.toString(),e)}catch(a){d("WALogger").WARN(h(),a).verbose().devConsole(a).sendLogs("send-tc-token-failed")}});return i.apply(this,arguments)}g.sendTcToken=a}),98); __d("WAWebSendTextMsgChatAction",["WAJobOrchestratorTypes","WAWebABProps","WAWebBizAgentAction","WAWebBizBotTosUtils","WAWebBotGating","WAWebBotMessageSecret","WAWebBotProfileCollection","WAWebBotSystemMsg","WAWebChatGetters","WAWebDBProcessMessage","WAWebEmptyChatSystemMsg","WAWebGetEphemeralFieldsMsgActionsUtils","WAWebLimitSharingPropMappingUtils","WAWebMessagePluginGenerateReportingTokenContent","WAWebMessageSendPerfReporter","WAWebMessageSendReporter","WAWebMessagingGatingUtils","WAWebMsgDataUtils","WAWebMsgModel","WAWebMsgType","WAWebNewsletterGatingUtils","WAWebOrchestratorNonPersistedJob","WAWebPresenceChatAction","WAWebPrivacyMode_WORKER_INCOMPATIBLE","WAWebProductCatalogLogEvents","WAWebSendMsgRecordAction","WAWebStateUtils","WAWebUserPrefsMeUser","WAWebWid","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b,c){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){c===void 0&&(c={});a=d("WAWebStateUtils").unproxy(a);b=(yield i(a,b,c));if(!b)return;yield d("WAWebBizBotTosUtils").maybeShowBizBot1pTos(a);return k(a,b)});return h.apply(this,arguments)}function i(a,b,c){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e){e===void 0&&(e={});b=(b||"").trim();if(b==="")return null;var f=e,g=f.linkPreview,h=f.quotedMsg,i=f.mentionedJidList,j=f.groupMentions,k=f.quotedMsgAdminGroupJid,l=f.quotedMsgAdminGroupSubject,m=f.quotedMsgAdminParentGroupJid,n=f.selectedId,o=f.selectedIndex,p=f.selectedCarouselCardIndex,q=f.ctwaContext,r=f.encryptedCommentFields,s=f.isWamoSub;f=f.paymentLinkMetadata;d("WAWebPresenceChatAction").clearPresence(a);var t;h?t=h.msgContextInfo(a.id):k!=null&&l!=null&&m!=null?t={quotedRemoteJid:k,quotedGroupSubject:l,quotedParentGroupJid:m}:k!=null&&(t={quotedRemoteJid:k});var u;a.limitSharing!=null&&(u=a.limitSharing,u.initiatedByMe=d("WAWebUserPrefsMeUser").isMeAccount(u.initiatedBy),c("WAWebWid").isGroup(a.id)&&typeof u.trigger==="string"&&(u.trigger=d("WAWebLimitSharingPropMappingUtils").getLimitSharingTriggerFromGroupSettingsChange(u.trigger)),delete u.initiatedBy);l=babelHelpers["extends"]({},g);m=babelHelpers["extends"]({},l,t,{mentionedJidList:i,groupMentions:j,ctwaContext:q,body:b,subtype:Object.keys(l).length>0?"url":null,urlText:a.urlText,urlNumber:a.urlNumber,botMsgBodyType:e.botMsgBodyType},yield d("WAWebMsgDataUtils").genOutgoingMsgData(a,"chat"),{paymentLinkMetadata:f,limitSharing:u});a.urlText&&(a.urlText=void 0);a.urlNumber&&(a.urlNumber=void 0);o!=null&&(m.type="template_button_reply",m.selectedId=n,m.selectedIndex=o,m.selectedCarouselCardIndex=p);m.type!==d("WAWebMsgType").MSG_TYPE.PROTOCOL&&Object.assign(m,d("WAWebGetEphemeralFieldsMsgActionsUtils").getEphemeralFields(a));k=d("WAWebPrivacyMode_WORKER_INCOMPATIBLE").getPrivacyModeFromModel(a.id);k!=null&&(m.privacyModeWhenSent=k);m.agentId=d("WAWebBizAgentAction").getAgentId(m);if(d("WAWebBotGating").isBotEnabled()){g=i==null?void 0:i.find(function(a){return a.isBot()});if(g==null?void 0:g.isBot()){m.invokedBotWid=g;j=h==null?void 0:h.botTargetSenderJid;j!=null&&!d("WAWebUserPrefsMeUser").isMeAccount(j)&&(m.botTargetSenderJid=h==null?void 0:h.botTargetSenderJid)}}q=a.isCAGAdmin();b=m.subtype==="url"&&d("WAWebABProps").getABPropConfigValue("web_youtube_rcat_chat_generation_enabled");e=Boolean(d("WAWebBotGating").isBotEnabled()&&((l=m.invokedBotWid)==null?void 0:l.isBot()));f=Boolean(d("WAWebBotGating").isBotEnabled()&&m.to.isBot());n=d("WAWebMessagingGatingUtils").isReportingTokenSendingEnabled()&&d("WAWebMessagePluginGenerateReportingTokenContent").isMsgTypeReportingTokenCompatible(m.type,m.subtype);(q||b||e||f||n)&&(m.messageSecret=self.crypto.getRandomValues(new Uint8Array(32)));e&&(m.botMessageSecret=(yield d("WAWebBotMessageSecret").genBotMsgSecretFromMsgSecret(m.messageSecret)));if(e||f){var v;e?v=m.invokedBotWid:f&&(v=m.to);if(v!=null){p=(o=d("WAWebBotProfileCollection").BotProfileCollection.get(v))==null?void 0:o.personaId;p!=null&&(m.botPersonaId=p)}}h&&h.type===d("WAWebMsgType").MSG_TYPE.PRODUCT&&d("WAWebProductCatalogLogEvents").logProductMessageBusinessSend(h,h.sessionId);r&&(m.type=d("WAWebMsgType").MSG_TYPE.COMMENT,m.encIv=r==null?void 0:r.encIv,m.encPayload=r==null?void 0:r.encPayload,m.targetMessageKey=r==null?void 0:r.targetMessageKey);s===!0&&d("WAWebChatGetters").getIsNewsletter(a)&&d("WAWebNewsletterGatingUtils").isWamoSubCreatorExperienceSupported()&&(m.isWamoSub=!0);return m});return j.apply(this,arguments)}function k(a,b){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){var f,g,h=new(d("WAWebMsgModel").Msg)(e),i=d("WAWebBotSystemMsg").getMaybeSysMsgForBotInvoke(h,a);f=[].concat((f=(yield c("WAWebEmptyChatSystemMsg")(h,a)))!=null?f:[],[i]).filter(Boolean);h.wamMessageSendReporter=new(d("WAWebMessageSendReporter").MessageSendReporter)(h);h.wamMessageSendPerfReporter=new(d("WAWebMessageSendPerfReporter").MessageSendPerfReporter)({chatWid:h.to,mediaType:h.getWamMediaType(),messageType:h.getWamMessageType()});(g=h.wamMessageSendPerfReporter)==null?void 0:g.startRenderedStage();f.length>0&&a.msgs.add(f);a.msgs.add(h);(g=h.wamMessageSendPerfReporter)==null?void 0:g.postRenderedStage();a.createdLocally=!1;var j=f.length>0?[].concat(f,[e]):[e];return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("sendMessage",b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var b;(b=h.wamMessageSendPerfReporter)==null?void 0:b.startSavedStage();yield d("WAWebDBProcessMessage").storeMessages(j,a.id);i&&(yield a.updateBotInvokeSystemMsgCreated());(b=h.wamMessageSendPerfReporter)==null?void 0:b.postSavedStage();b=(yield d("WAWebSendMsgRecordAction").sendMsgRecord(h));return b}),{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()});return l.apply(this,arguments)}g.sendTextMsgToChat=a;g.createTextMsgData=i;g.addAndSendTextMsg=k}),98); __d("WAWebSendUnstarAllChatAction",["fbt","WAFilteredCatch","WALogger","WAWebActionToast.react","WAWebBackendErrors","WAWebChatCollection","WAWebChatSendStarMsgsBridge","WAWebStarredMsgCollection","WAWebStateUtils","WAWebToastManager","react"],(function(a,b,c,d,e,f,g,h){var i;function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["models:chat:sendUnstarAll dropped"]);j=function(){return a};return a}var k=i||c("react");function a(a,b){return l(a,b?d("WAWebStateUtils").unproxy(b):b)}function l(a,b){var c=b?b.promises:d("WAWebChatCollection").ChatCollection.promises,e=b?b.id:void 0;if(c.sendUnstarAll)return c.sendUnstarAll;e=c.sendUnstarAll=d("WAWebChatSendStarMsgsBridge").sendUnstarAll(a,e);var f=new(d("WAWebActionToast.react").ActionType)(h._(/*BTDS*/"__JHASH__V6xylXkMOyw__JHASH__")),g=e.then(function(){return new(d("WAWebActionToast.react").ActionType)(h._(/*BTDS*/"__JHASH__kz5Q7OxqYRl__JHASH__"))})["catch"](d("WAFilteredCatch").filteredCatch(d("WAWebBackendErrors").ServerStatusCodeError,function(a){if(a.statusCode>=400)return new(d("WAWebActionToast.react").ActionType)(h._(/*BTDS*/"__JHASH__a9OzUiPQ54A__JHASH__"))}))["catch"](function(c){d("WALogger").WARN(j()).devConsole(c);return new(d("WAWebActionToast.react").ActionType)(h._(/*BTDS*/"__JHASH__a9OzUiPQ54A__JHASH__"),{actionText:h._(/*BTDS*/"__JHASH__TyKOR8KAtP1__JHASH__"),actionHandler:function(){return l(a,b)}})});d("WAWebToastManager").ToastManager.open(k.jsx(d("WAWebActionToast.react").ActionToast,{initialAction:f,pendingAction:g}));return e.then(function(){a.forEach(function(a){a.set("star",!1)}),b?d("WAWebStarredMsgCollection").removeStarredMsgs(a):(d("WAWebStarredMsgCollection").AllStarredMsgsCollection.reset(),d("WAWebChatCollection").ChatCollection.forEach(function(a){a.starredMsgs&&a.starredMsgs.reset()}))})["finally"](function(){c.sendUnstarAll=null})}g.unstarAllMessages=a}),226); __d("WAWebSetTcTokenChatAction",["WAArrayBufferUtils","WAWebApiContact","WAWebApiOrphanTcToken","WAWebChatGetExistingBridge","WAWebSchemaChat","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b,c){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){if(c==null)return;if(!a.isUserNotPSA())return;if(a.isLid())return;var e=d("WAWebApiContact").getCurrentLid(d("WAWebWidFactory").toUserWid(a)),f=(yield d("WAWebChatGetExistingBridge").getExisting(a)),g=e?yield d("WAWebChatGetExistingBridge").getExisting(e):null;g=(g=g)!=null?g:f;if(g==null){yield d("WAWebApiOrphanTcToken").createOrUpdateOrphanTcToken(a.toString(),{tcToken:c,tcTokenTimestamp:b});e!=null&&(yield d("WAWebApiOrphanTcToken").createOrUpdateOrphanTcToken(e.toString(),{tcToken:c,tcTokenTimestamp:b}));return}if(g.tcToken!=null&&d("WAArrayBufferUtils").arrayBuffersEqualUNSAFE(g.tcToken,c)||g.tcTokenTimestamp!=null&&g.tcTokenTimestamp>b)return;f={tcToken:c,tcTokenTimestamp:b};g.set(f);yield d("WAWebSchemaChat").getChatTable().merge(a.toString(),f)});return h.apply(this,arguments)}g.handleIncomingTcToken=a}),98); __d("WAWebUpdateDraftMessageChatJob",["WAAbortError","WAJobOrchestratorTypes","WAWebDBChatSerialization","WAWebDBUpdateChatTable","WAWebOrchestratorNonPersistedJob","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.chatId,c=a.draftMessage;a=a.abortSignal;b=d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("updateDraftMessageChat",function(a){if(a.abortSignal.aborted)throw new(d("WAAbortError").AbortError)();return d("WAWebDBUpdateChatTable").updateChatTable(a.chatId,d("WAWebDBChatSerialization").serializeChat({draftMessage:a.draftMessage}))},{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted({chatId:b,draftMessage:c,abortSignal:a});yield b});return h.apply(this,arguments)}g.updateDraftMessageChat=a}),98); __d("WAWebUpdateDraftMessageChatAction",["WAWebChatCollection","WAWebNewsletterCollection","WAWebUpdateDraftMessageChatJob","WAWebWid"],(function(a,b,c,d,e,f,g){function a(a,b){var e=c("WAWebWid").isNewsletter(a)?c("WAWebNewsletterCollection").get(a):d("WAWebChatCollection").ChatCollection.get(a),f=new AbortController(),g=d("WAWebUpdateDraftMessageChatJob").updateDraftMessageChat({chatId:a,draftMessage:b,abortSignal:f.signal});g["finally"](function(){if(e){var a;(e==null?void 0:(a=e.promises.updateDraftMessage)==null?void 0:a.promise)===g&&(e.promises.updateDraftMessage=null)}});if(e){a=e.promises;a.updateDraftMessage!=null&&a.updateDraftMessage.abortController.abort();e.draftMessage=b;e.promises.updateDraftMessage={promise:g,abortController:f}}return g}g.updateDraftMessageChat=a}),98); __d("WAWebUpdateLastAddOnPreviewChatAction",["WAWebChatCollection","WAWebMsgKey","WAWebNewsletterCollection","WAWebWid"],(function(a,b,c,d,e,f,g){function a(a){a.forEach(function(a,b){b=c("WAWebWid").isNewsletter(b)?c("WAWebNewsletterCollection").get(b):d("WAWebChatCollection").ChatCollection.get(b);if(b==null)return;b.set({chatlistPreview:a,lastReactionPreview:void 0})})}function b(a){var b=new Set(a.map(function(a){return c("WAWebMsgKey").fromString(a).remote.toString()}));b.forEach(function(b){var e;e=(e=d("WAWebChatCollection").ChatCollection.get(b))!=null?e:c("WAWebNewsletterCollection").get(b);if(e==null)return;a.includes((b=e.chatlistPreview)==null?void 0:b.parentMsgKey)&&e.unset(["chatlistPreview","lastReactionPreview"])})}g.updateModelsForLastAddOnPreview=a;g.deleteModelsForLastAddOnPreview=b}),98); __d("WAWebUpdateUnreadChatAction",["fbt","Promise","WAFilteredCatch","WALogger","WAShiftTimer","WAWebABProps","WAWebActionToast.react","WAWebApiChat","WAWebBackendErrors","WAWebChatGetters","WAWebChatSeenBridge","WAWebCmd","WAWebConstantsDeprecated","WAWebDBUpdateChatTable","WAWebNoop","WAWebPromiseQueue","WAWebSendReadReceiptJob","WAWebStateUtils","WAWebStreamModel","WAWebToastManager","asyncToGeneratorRuntime","err","gkx","react"],(function(a,b,c,d,e,f,g,h){var i,j;function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["sendSeen: got status ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[message-edit/send-seen] ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["models:chat:sendSeen unread "," pending: "," delta: ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["[update-unread]: ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["markUnread: got status ",""]);o=function(){return a};return a}var p=j||c("react");function a(a,b,c){c===void 0&&(c=!0);return u(d("WAWebStateUtils").unproxy(a),b,c)}function e(){var a=null,c=new(d("WAShiftTimer").ShiftTimer)(function(b){var c=b.chat_;b=b.afterAvailable;void r(c,b);a=null});return function(){var e=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b,e){if(a!=null){var f=a,g=f[0];f=f[1];var h=g.id.toString(),i=b.id.toString();h!==i&&(c.cancel(),void r(g,f),a=null)}if(!c.isScheduled()){h=d("WAWebABProps").getABPropConfigValue("web_resume_optimized_read_receipt_send_interval");c.onOrAfter(h,{chat_:b,afterAvailable:e})}a=[b,e]});return function(a,b){return e.apply(this,arguments)}}()}var q=e();e=function(a,b){b===void 0&&(b=!0);return!d("WAWebCmd").Cmd.isOfflineDeliveryEnd?q(a,b):r(a,b)};function r(a,b){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){c===void 0&&(c=!0);a=d("WAWebStateUtils").unproxy(a);yield (i||(i=b("Promise"))).all([w(a,c),H(a,c)])["catch"](d("WAFilteredCatch").filteredCatch(d("WAWebBackendErrors").ServerStatusCodeError,function(a){d("WALogger").WARN(k(),a.status)}))});return s.apply(this,arguments)}function f(a,b,c){return z(d("WAWebStateUtils").unproxy(a),b,c)}function t(a){B(d("WAWebStateUtils").unproxy(a))}function u(a,e,f,g){g===void 0&&(g=d("WAWebActionToast.react").genId());!e?a.markedUnread=!1:a.active&&(a.markedUnread=!0);var j=a.promises;if(j.markUnread)return j.markUnread;var k=j.markUnread=e?x(a):(i||(i=b("Promise"))).all([w(a),H(a)]),l=e?new(d("WAWebActionToast.react").ActionType)(h._(/*BTDS*/"__JHASH__sLYL8wRHKTT__JHASH__")):new(d("WAWebActionToast.react").ActionType)(h._(/*BTDS*/"__JHASH__TXAeK3_flMj__JHASH__")),m=k.then(function(){var b=e?h._(/*BTDS*/"__JHASH__Rs6rZ_F_Rtu__JHASH__"):h._(/*BTDS*/"__JHASH__X-XSG5EW21V__JHASH__");return!f?new(d("WAWebActionToast.react").ActionType)(b):new(d("WAWebActionToast.react").ActionType)(b,{actionText:h._(/*BTDS*/"__JHASH__mpD8GydGn1Q__JHASH__"),actionHandler:function(){return u(a,!e,f,g)}})})["catch"](d("WAFilteredCatch").filteredCatch(d("WAWebBackendErrors").ServerStatusCodeError,function(a){if(a.status>=400)return e?new(d("WAWebActionToast.react").ActionType)(h._(/*BTDS*/"__JHASH__b6TQJf-tGrq__JHASH__")):new(d("WAWebActionToast.react").ActionType)(h._(/*BTDS*/"__JHASH__9SBZLQI4bQu__JHASH__"));throw c("err")("invalid response status")}))["catch"](function(){var b=e?h._(/*BTDS*/"__JHASH__b6TQJf-tGrq__JHASH__"):h._(/*BTDS*/"__JHASH__9SBZLQI4bQu__JHASH__");return!f?new(d("WAWebActionToast.react").ActionType)(b):new(d("WAWebActionToast.react").ActionType)(b,{actionText:h._(/*BTDS*/"__JHASH__TyKOR8KAtP1__JHASH__"),actionHandler:function(){return u(a,e,f,g)}})});d("WAWebToastManager").ToastManager.open(p.jsx(d("WAWebActionToast.react").ActionToast,{id:g,initialAction:l,pendingAction:m}));return k.then(c("WAWebNoop"))["catch"](d("WAFilteredCatch").filteredCatch(d("WAWebBackendErrors").ServerStatusCodeError,function(a){d("WALogger").WARN(o(),a.status)}))["finally"](function(){j.markUnread=null})}function v(a){c("gkx")("26258")||d("WALogger").LOG(n(),a)}function w(a,e){e===void 0&&(e=!0);v("sendSeen: start");if(a.markedUnread||a.unreadCount===0){v("markedUnread: "+String(a.markedUnread));v("unreadCount: "+a.unreadCount);v("sendSeen: end-1");return(i||(i=b("Promise"))).resolve()}if(!d("WAWebStreamModel").Stream.available&&e){v("stream unavailable");a.listenToOnce(d("WAWebStreamModel").Stream,"change:available",function(){return w(a)});v("sendSeen: end-2");return(i||(i=b("Promise"))).resolve()}v("stream available");v("unreadCount: "+a.unreadCount);v("pendingSeenCount: "+a.pendingSeenCount);var f=a.unreadCount-a.pendingSeenCount;v("unreadCountDelta: "+f);e=a.unreadCount===-1&&f===-1;if(f<=0&&!e){v("sendSeen: end-3");return(i||(i=b("Promise"))).resolve()}a.disableUnreadAnchor=!0;a.pendingSeenCount=a.unreadCount;v("pendingSeenCount set to: "+a.unreadCount);var g=function(){a.pendingSeenCount-=f,v("pendingSeenCount set to "+a.pendingSeenCount),a.pendingSeenCount<0&&(d("WALogger").WARN(m(),a.unreadCount,a.pendingSeenCount,f),a.pendingSeenCount=0)};e=c("gkx")("26258")?a.getLastMsgKeyForAction():a.lastReceivedKey;return d("WAWebChatSeenBridge").sendConversationSeen(a,e,f).then(function(){C(a,f)})["catch"](d("WAFilteredCatch").filteredCatch(d("WAWebBackendErrors").ServerStatusCodeError,function(a){g();return(i||(i=b("Promise"))).reject(a)})).then(function(){v("sendSeen: end-4")})}function x(a){return y.apply(this,arguments)}function y(){y=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=a.getLastMsgKeyForAction();try{yield d("WAWebChatSeenBridge").sendConversationUnseen(a.id,c),t(a)}catch(c){return d("WAFilteredCatch").filteredCatch(d("WAWebBackendErrors").ServerStatusCodeError,function(c){a.markedUnread=!1;return(i||(i=b("Promise"))).reject(c)})(c)}});return y.apply(this,arguments)}function z(a,b,c){return A.apply(this,arguments)}function A(){A=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e){e===void 0&&(e=!1);v("markSeen: start - "+String(c));var f=null;c!=null?c>0&&c<=a.unreadCount?f=a.unreadCount-c:c===-1&&(a.unreadCount<=0&&(f=0)):f=0;var g=f==null?(i||(i=b("Promise"))).resolve():d("WAWebChatSeenBridge").markConversationSeen(a.id,f);yield g;if(c!=null&&e){g=a.pendingSeenCount-c;a.pendingSeenCount=Math.max(0,g);v("pendingSeenCount set to "+a.pendingSeenCount)}f!=null&&(a.unreadCount=f,v("unreadCount set to "+f));a.unreadMsgAnchor=void 0;a.markedUnread=!1;a.unreadDividerOffset=0;v("markSeen: end")});return A.apply(this,arguments)}function B(a){(a.unreadCount===0||a.unreadCount===c("WAWebConstantsDeprecated").MARKED_AS_UNREAD)&&(a.active&&(a.markedUnread=!0),d("WAWebChatSeenBridge").markConversationUnseen(a.id).then(function(){a.unreadCount=c("WAWebConstantsDeprecated").MARKED_AS_UNREAD}))}function C(a,b,c){return D.apply(this,arguments)}function D(){D=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){c===void 0&&(c=!0);var e=(yield d("WAWebApiChat").getChatMeta(a.id));e=e.unreadCount;v("updateUnreadCount: old "+a.unreadCount+", new "+e);a.unreadCount=e;a.unreadDividerOffset=0;a.unreadMsgAnchor=void 0;a.markedUnread=!1;if(c){e=a.pendingSeenCount-b;a.pendingSeenCount=Math.max(0,e)}});return D.apply(this,arguments)}function E(a){if(d("WAWebChatGetters").getIsGroup(a)){(a=a.groupMetadata)==null?void 0:a.unreadMentionMetadata.reset()}}function F(a){c("gkx")("26258")||d("WALogger").LOG(l(),a)}var G=new(d("WAWebPromiseQueue").PromiseQueue)();function H(a,b){return I.apply(this,arguments)}function I(){I=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){c===void 0&&(c=!0);if(a.unreadEditTimestampMs==null)return;F("sendSeen: start - "+String(a.unreadEditTimestampMs));if(!d("WAWebStreamModel").Stream.available&&c){a.listenToOnce(d("WAWebStreamModel").Stream,"change:available",function(){return H(a)});F("sendSeen: end - stream unavailable");return}var e=a.unreadEditTimestampMs;yield G.enqueue(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(a.unreadEditTimestampMs==null){F("sendSeen: end - no unread edits");return}yield d("WAWebSendReadReceiptJob").markEditedMsgsRead(a.id,{trusted:a.trusted});F("sendSeen: marked edit as read");if(e!==a.unreadEditTimestampMs){F("sendSeen: end - has new unread edits");return}a.unreadEditTimestampMs=null;d("WAWebDBUpdateChatTable").updateChatTable(a.id,{unreadEditTimestampMs:null});F("sendSeen: end - all edits are marked as read")}))});return I.apply(this,arguments)}g.markUnread=a;g.sendSeenDebounced=e;g.sendSeen=r;g.markSeen=f;g.markUnseen=t;g.updateUnreadCountMD=C;g.clearUnreadMentions=E}),226); __d("WAWebUpdateSubgroupsCommunityAction",["WAWebApiUnjoinedSubgroupMetadataStore","WAWebChatCollection","WAWebGroupMetadataCollection","WAWebGroupQueryBridge","WAWebGroupUnjoinedSubgroupJob","WAWebUnjoinedSubgroupMetadataCollection","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(a){a.joinedSubgroups=c("WAWebGroupMetadataCollection").filter(function(b){var c;return((c=b.parentGroup)==null?void 0:c.equals(a.id))&&b.participants.iAmMember()}).map(function(a){return a.id})}function i(a){a.unjoinedSubgroups=c("WAWebUnjoinedSubgroupMetadataCollection").filter(function(b){return b.parentGroupId.equals(a.id)}).map(function(a){return a.id})}function a(a,b){d("WAWebApiUnjoinedSubgroupMetadataStore").removeUnjoinedSubgroupMetadataFromStorage(b),j(b),i(a),h(a)}function e(a,b){c("WAWebGroupMetadataCollection").add({id:b,parentGroup:null},{merge:!0}),h(a)}function f(a,b){var c=d("WAWebChatCollection").ChatCollection.get(b.toString()),e=c==null?void 0:c.groupMetadata;if(c==null||e==null)return;h(a);if(e.participants.length===0||!a.participants.iAmAdmin()&&e.hiddenSubgroup===!0||!a.hasJoined())return;b={id:b,subject:c.formattedTitle,defaultSubgroup:!!e.defaultSubgroup,generalSubgroup:!!e.generalSubgroup,parentGroupId:a.id,membershipApprovalMode:e.membershipApprovalMode,hiddenSubgroup:!!e.hiddenSubgroup};void d("WAWebGroupUnjoinedSubgroupJob").updateUnjoinedSubgroupsJob([b],a.id);k([b],a.id)}function j(a){c("WAWebUnjoinedSubgroupMetadataCollection").remove(a.toString())}function k(a,b,d){d===void 0&&(d=!0);a.forEach(function(a){if(!d){j(a.id);return}var e=a.subject,f=a.subjectTime,g=c("WAWebUnjoinedSubgroupMetadataCollection").get(a.id.toString());g&&(g.subjectTime||0)>(f||0)&&(e=g.subject,f=g.subjectTime);c("WAWebUnjoinedSubgroupMetadataCollection").add(babelHelpers["extends"]({},a,{parentGroupId:b,subject:e,subjectTime:f}),{merge:!0})});a=c("WAWebGroupMetadataCollection").get(b.toString());a&&i(a)}function l(a,b){var d=c("WAWebUnjoinedSubgroupMetadataCollection").filter(function(a){return a.parentGroupId.equals(b)}).map(function(a){return a.id});d=d.filter(function(b){return!a.includes(b)});c("WAWebUnjoinedSubgroupMetadataCollection").remove(d)}function m(a,b,e){e===void 0&&(e=!0),a.forEach(function(a){var f=a.id,g=a.subject,h=a.generalSubgroup,i=a.hiddenSubgroup;g!=null&&d("WAWebGroupQueryBridge").updateSubject(f,g);c("WAWebGroupMetadataCollection").add(babelHelpers["extends"]({},a,{parentGroup:e?b:null,generalSubgroup:e?h:null,hiddenSubgroup:e?i:null}),{merge:!0})}),h(c("WAWebGroupMetadataCollection").assertGet(b.toString()))}function n(a){a=d("WAWebChatCollection").ChatCollection.get(a.toString());return a==null||!((a=a.groupMetadata)==null?void 0:a.participants.iAmMember())}function o(a){return a.filter(function(a){return n(a)})}function p(a){var b=o(a.map(function(a){a=a.id;return a}));return a.filter(function(a){return b.includes(a.id)})}function q(a,b){a=c("WAWebUnjoinedSubgroupMetadataCollection").get(a);a!=null&&(a.membershipApprovalRequest=b)}function r(a,b){void d("WAWebApiUnjoinedSubgroupMetadataStore").updateMembershipApprovalRequestinDB(a,b),q(a,b)}function s(a){a=a.map(function(a){return{id:a.id,size:a.participantCount}});c("WAWebUnjoinedSubgroupMetadataCollection").add(a,{merge:!0})}function t(a){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield d("WAWebApiUnjoinedSubgroupMetadataStore").updateSizeInDB(a),s(a)});return u.apply(this,arguments)}g.updateJoinedSubgroups=h;g.updateUnjoinedSubgroups=i;g.subgroupUnjoinedToJoined=a;g.unlinkParentGroup=e;g.subgroupJoinedToUnjoined=f;g.updateUnjoinedSubgroupsInCollection=k;g.cleanUnjoinedSubgroupsInCollection=l;g.updateJoinedSubgroupsInCollection=m;g.determineUnjoined=n;g.getUnjoinedSubgroups=p;g.updateMembershipApprovalRequest=r;g.updateUnjoinedSubgroupSize=t}),98); __d("WAWebAddMeContactAction",["WAJids","WAWebContactCollection","WAWebLidAwareContactsDB","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=d("WAJids").toPhoneUserJid(a.user);yield c("WAWebLidAwareContactsDB").createOrMerge(b,{id:b});d("WAWebContactCollection").ContactCollection.gadd(a)});return h.apply(this,arguments)}g.addMeToContacts=a}),98); __d("WAWebBlockUserJob",["WALogger","WASmaxBlocklistsUpdateBlockListRPC","WASmaxPsaChatBlockSetRPC","WAWebUserPrefsMultiDevice","WAWebWidToJid","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["block/unblock ",": success"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["blockUnblockUser: server response with ",", ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["blockUnblockUser: server response with ",", ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["blockUnblockPSAUser: server response with ",", ",""]);k=function(){return a};return a}function l(a){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a={blockingAction:a?"block":"unblock"};a=(yield d("WASmaxPsaChatBlockSetRPC").sendChatBlockSetRPC(a));switch(a.name){case"ChatBlockSetResponseServerError":var b=a.value.errorChatBlockError.value,c=b.code;b=b.text;d("WALogger").WARN(k(),c,b);return{errorCode:Number(c),errorText:b};default:a.name}});return m.apply(this,arguments)}function n(a){return a==null?null:{bizOptOutReason:a.reason,bizOptOutReasonDescription:a.reasonDescription,bizOptOutEntryPoint:a.entryPoint,bizOptOutFirstMessage:a.firstMessage,bizOptOutBusinessDiscoveryEntryPoint:a.businessDiscoveryEntryPoint,bizOptOutBusinessDiscoveryTimestamp:a.businessDiscoveryTimestamp,bizOptOutBusinessDiscoveryId:a.businessDiscoveryId}}function o(a,b,c){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){var e=(yield d("WAWebUserPrefsMultiDevice").getBlocklistHash()),f=n(c);f={bizOptOutArgs:f!=null?f:null,itemDhash:e!=null?e:null,updateBlockListBlockOrUpdateBlockListUnblockItemMixinGroupArgs:b?{updateBlockListBlockItem:{updateBlockListOrUpdateBlockListNonMigratedBlockItemMixinGroupArgs:{updateBlockListNonMigratedBlockItem:{itemJid:d("WAWebWidToJid").widToUserJid(a)}}}}:{updateBlockListUnblockItem:{itemJid:d("WAWebWidToJid").widToUserJid(a)}}};e=(yield d("WASmaxBlocklistsUpdateBlockListRPC").sendUpdateBlockListRPC(f));switch(e.name){case"UpdateBlockListResponseInvalidRequest":b=e.value.errorUpdateBlocklistErrors.value;a=b.code;f=b.text;d("WALogger").WARN(j(),a,f);return{errorCode:Number(a),errorText:f};case"UpdateBlockListResponseServerError":b=e.value.errorServerErrors.value;a=b.code;f=b.text;d("WALogger").WARN(i(),a,f);return{errorCode:Number(a),errorText:f};default:e.name,d("WALogger").LOG(h(),c!=null?"biz":"user")}});return p.apply(this,arguments)}function a(a,b){return a.isPSA()?l(!0):o(a,!0,b)}function c(a){return a.isPSA()?l(!1):o(a,!1)}g.blockUser=a;g.unblockUser=c}),98); __d("WAWebUpdateBlocklistDbJob",["WALogger","WAWebQueryBlockListJob","WAWebSchemaBlocklist","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["updateBlocklistDbJob failed"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["failed to update blocking status of psa user"]);i=function(){return a};return a}function a(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield d("WAWebQueryBlockListJob").getBlockingStatusForPSAUser());try{if(b){yield k(a,!0);return!0}yield k(a,!1);return!1}catch(a){d("WALogger").ERROR(i()).verbose().devConsole(a).sendLogs("Failed to update blocking status of psa user");throw c("err")("failed to update blocking status of psa user")}});return j.apply(this,arguments)}function k(a,b){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=a.toString();try{b?yield d("WAWebSchemaBlocklist").getBlocklistTable().createOrReplace({id:a}):yield d("WAWebSchemaBlocklist").getBlocklistTable().remove(a)}catch(a){d("WALogger").ERROR(h()).verbose().devConsole(a).sendLogs("Failed to update blocklist db");throw c("err")("updateBlocklistDbJob failed")}});return l.apply(this,arguments)}g.updateBlockingStatusForPSAUser=a;g.updateBlocklistDbJob=k}),98); __d("WAWebBlockContactAction",["fbt","Promise","WALogger","WAWebActionToast.react","WAWebBackendErrors","WAWebBlockUserJob","WAWebBlocklistCollection","WAWebBlocklistUtils","WAWebFrontendContactGetters","WAWebStateUtils","WAWebToastManager","WAWebUpdateBlocklistDbJob","WAWebWamBlockEventReporter","asyncToGeneratorRuntime","react"],(function(a,b,c,d,e,f,g,h){var i,j;function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["action:setBlock dropped"]);k=function(){return a};return a}var l=j||c("react");function a(a){var b=a.contact,c=a.blockEntryPoint;a=a.bizOptOutArgs;c=d("WAWebBlocklistUtils").getBlockEventMetricFromBlockEntryPoint(c);d("WAWebWamBlockEventReporter").logBlockEvent({contact:b,blockEntryPoint:c,isBlock:!0});return n(d("WAWebStateUtils").unproxy(b),!0,a)}function e(a,b){b=d("WAWebBlocklistUtils").getBlockEventMetricFromBlockEntryPoint(b);d("WAWebWamBlockEventReporter").logBlockEvent({contact:a,blockEntryPoint:b,isBlock:!1});return n(d("WAWebStateUtils").unproxy(a),!1)}function f(a){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield d("WAWebUpdateBlocklistDbJob").updateBlockingStatusForPSAUser(a));a=a;b?d("WAWebBlocklistCollection").BlocklistCollection.add({id:a}):d("WAWebBlocklistCollection").BlocklistCollection.remove(a)});return m.apply(this,arguments)}function n(a,c,e,f){var g=a.id,h=a.phoneNumber,j=c&&g.isLid(),k=j&&h!=null?h:g;j=a.isContactBlocked;h=c&&j;g=!c&&!j;if(h||g)return(i||(i=b("Promise"))).resolve();j=c?d("WAWebBlockUserJob").blockUser(k,e):d("WAWebBlockUserJob").unblockUser(k);h=j.then(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a&&a.errorCode!=null)throw new(d("WAWebBackendErrors").ServerStatusCodeError)(a.errorCode,a.errorText);yield d("WAWebUpdateBlocklistDbJob").updateBlocklistDbJob(k,c);c?d("WAWebBlocklistCollection").BlocklistCollection.add({id:k}):d("WAWebBlocklistCollection").BlocklistCollection.remove(k)});return function(b){return a.apply(this,arguments)}}());o(a,h,c,e,f);return h}function o(a,b,c,e,f){f===void 0&&(f=d("WAWebActionToast.react").genId());var g=d("WAWebFrontendContactGetters").getFormattedName(a),i=c?new(d("WAWebActionToast.react").ActionType)(h._(/*BTDS*/"__JHASH__WAyLOogeTK2__JHASH__",[h._param("member",g)])):new(d("WAWebActionToast.react").ActionType)(h._(/*BTDS*/"__JHASH__XrLTyll-03G__JHASH__",[h._param("member",g)]));b=b.then(function(){var b=c?h._(/*BTDS*/"__JHASH__K_KheXg8w78__JHASH__",[h._param("member",g)]):h._(/*BTDS*/"__JHASH__Mk8ZcJs69o-__JHASH__",[h._param("member",g)]);return new(d("WAWebActionToast.react").ActionType)(b,{actionText:h._(/*BTDS*/"__JHASH__mpD8GydGn1Q__JHASH__"),actionHandler:function(){return n(a,!c,e,f)}})})["catch"](function(b){if(b instanceof d("WAWebBackendErrors").ServerStatusCodeError){if(b.statusCode>=400)throw c?new(d("WAWebActionToast.react").ActionType)(h._(/*BTDS*/"__JHASH__GJ9jrserFqo__JHASH__",[h._param("member",g)])):new(d("WAWebActionToast.react").ActionType)(h._(/*BTDS*/"__JHASH__2vgSyVBr8Fh__JHASH__",[h._param("member",g)]))}else{d("WALogger").WARN(k()).devConsole(b);b=c?h._(/*BTDS*/"__JHASH__GJ9jrserFqo__JHASH__",[h._param("member",g)]):h._(/*BTDS*/"__JHASH__2vgSyVBr8Fh__JHASH__",[h._param("member",g)]);throw new(d("WAWebActionToast.react").ActionType)(b,{actionText:h._(/*BTDS*/"__JHASH__TyKOR8KAtP1__JHASH__"),actionHandler:function(){return n(a,c,e,f)}})}});d("WAWebToastManager").ToastManager.open(l.jsx(d("WAWebActionToast.react").ActionToast,{id:f,initialAction:i,pendingAction:b}))}g.blockContact=a;g.unblockContact=e;g.updatePSAUserBlockingStatus=f}),226); __d("WAWebBizVerifiedLevelToString",["WAWebBusinessProfileTypes"],(function(a,b,c,d,e,f,g){function a(a){switch(a){case d("WAWebBusinessProfileTypes").VERIFIED_LEVEL.HIGH:return"high";case d("WAWebBusinessProfileTypes").VERIFIED_LEVEL.LOW:return"low";case d("WAWebBusinessProfileTypes").VERIFIED_LEVEL.UNKNOWN:default:return"unknown"}}g["default"]=a}),98); __d("WAWebGetOrQueryUsyncInfoContactAction",["Promise","WALogger","WAPromiseCache","WAWebBackendErrors","WAWebBizUpdateVerifiedInfoAction","WAWebBizVerifiedLevelToString","WAWebChatCollection","WAWebContactCollection","WAWebQueryExistsJob","WAWebUpdateDisappearingModeForContact","WAWebUsync","WAWebUsyncUser","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[usync] biz info response"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[usync] querying for biz info"]);j=function(){return a};return a}function a(a,b){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){e=e===void 0?{forceUsync:!1}:e;e=e.forceUsync;var f=d("WAWebContactCollection").ContactCollection.get(a);if(e!==!0&&f!=null&&(f.name!=null||d("WAWebChatCollection").ChatCollection.get(a)!=null)){return{wid:a,biz:f.isBusiness,bizInfo:f.isBusiness?{verifiedName:{level:c("WAWebBizVerifiedLevelToString")(f.verifiedLevel),serial:null,name:f.verifiedName,isApi:Boolean(f.isEnterprise),isSmb:Boolean(f.isSmb),privacyMode:f.privacyMode}}:null,disappearingMode:{duration:(e=f.disappearingModeDuration)!=null?e:0,settingTimestamp:(e=f.disappearingModeSettingTimestamp)!=null?e:0}}}e=(yield d("WAWebQueryExistsJob").queryWidExists(a));if(e){var g=e.biz,i=e.bizInfo,j=e.disappearingMode;g&&i!=null&&(yield d("WAWebBizUpdateVerifiedInfoAction").updateVerifiedInfo(a,i.verifiedName));j&&f!=null&&(yield d("WAWebUpdateDisappearingModeForContact").updateDisappearingModeForContact(a,j.duration,j.settingTimestamp));return e}return(h||(h=b("Promise"))).reject(c("err")("Invalid number"))});return k.apply(this,arguments)}function e(){var a=new(c("WAPromiseCache"))(d("WAWebQueryExistsJob").queryPhoneExists,{maxCached:100,maxAge:36e4,shouldCache:function(a){return!!a}});return a}function f(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){d("WALogger").LOG(j()).devConsole({wid:a});var b=new(d("WAWebUsyncUser").USyncUser)(),c=new(d("WAWebUsync").USyncQuery)();a.isLid()?b.withId(a):(c.withContactProtocol(),b.withPhone(a.toString()));c.withUser(b);c.withBusinessProtocol();b=(yield c.execute());c=b.error.all||b.error.contact;d("WALogger").LOG(i()).devConsole({res:b,error:c});if(c)throw new(d("WAWebBackendErrors").ServerStatusCodeError)(c.errorCode,c.errorText);c=b.list;if(c.length!==1)return null;b=c[0];c=b.id;b=b.business;b!=null&&(yield d("WAWebBizUpdateVerifiedInfoAction").updateVerifiedInfo(a,b.verifiedName));a={wid:c,biz:b!=null,bizInfo:b};return a});return l.apply(this,arguments)}g.getOrQueryUsyncInfo=a;g.usyncContactCached=e;g.queryUsyncBusiness=f}),98); __d("WAWebWamEnumPhoneNumHyperlinkActionType",[],(function(a,b,c,d,e,f){a=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,CLICK_INVITE_TO_WHATSAPP:11});f.PHONE_NUM_HYPERLINK_ACTION_TYPE=a}),66); __d("WAWebPsPhoneNumberHyperlinkWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumPhoneNumHyperlinkActionType"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({PsPhoneNumberHyperlink:[3266,{isPhoneNumHyperlinkOwner:[1,a.TYPES.BOOLEAN],phoneNumHyperlinkAction:[2,d("WAWebWamEnumPhoneNumHyperlinkActionType").PHONE_NUM_HYPERLINK_ACTION_TYPE],phoneNumberStatusOnWa:[3,a.TYPES.BOOLEAN],sequenceNumber:[4,a.TYPES.INTEGER]},[1,1,1],"private",113760892]},{PsPhoneNumberHyperlink:[]});g.PsPhoneNumberHyperlinkWamEvent=b}),98); __d("WAWebPhoneNumberContactAction",["fbt","WAWebComposeBoxActions","WAWebCopyToClipboard","WAWebModalManager","WAWebOpenChatFlow.react","WAWebPsPhoneNumberHyperlinkWamEvent","WAWebToast.react","WAWebToastManager","WAWebUserPrefsMeUser","WAWebWamEnumPhoneNumHyperlinkActionType","react"],(function(a,b,c,d,e,f,g,h){var i,j=i||c("react");function a(a,b,c){d("WAWebModalManager").ModalManager.open(j.jsx(d("WAWebOpenChatFlow.react").OpenChatFlow,{targetId:b,onSuccess:function(a){a=a.chat;k(a,c)},msgText:null}),{transition:"modal-flow"}),new(d("WAWebPsPhoneNumberHyperlinkWamEvent").PsPhoneNumberHyperlinkWamEvent)({phoneNumHyperlinkAction:d("WAWebWamEnumPhoneNumHyperlinkActionType").PHONE_NUM_HYPERLINK_ACTION_TYPE.CLICK_MESSAGE_ON_WHATSAPP,isPhoneNumHyperlinkOwner:d("WAWebUserPrefsMeUser").isMeAccount(b),phoneNumberStatusOnWa:!0}).commit()}function b(a,b,c){void d("WAWebCopyToClipboard").copyTextToClipboard(a),d("WAWebToastManager").ToastManager.open(j.jsx(d("WAWebToast.react").Toast,{msg:h._(/*BTDS*/"__JHASH__wn768q8V76a__JHASH__")})),new(d("WAWebPsPhoneNumberHyperlinkWamEvent").PsPhoneNumberHyperlinkWamEvent)({phoneNumHyperlinkAction:d("WAWebWamEnumPhoneNumHyperlinkActionType").PHONE_NUM_HYPERLINK_ACTION_TYPE.CLICK_COPY_PHONE_NUMBER,isPhoneNumHyperlinkOwner:c,phoneNumberStatusOnWa:Boolean(b)}).commit()}function e(a,b){new(d("WAWebPsPhoneNumberHyperlinkWamEvent").PsPhoneNumberHyperlinkWamEvent)({phoneNumHyperlinkAction:d("WAWebWamEnumPhoneNumHyperlinkActionType").PHONE_NUM_HYPERLINK_ACTION_TYPE.CLICK_PHONE_NUM_HYPERLINK,isPhoneNumHyperlinkOwner:b,phoneNumberStatusOnWa:Boolean(a)}).commit()}function f(a,b){new(d("WAWebPsPhoneNumberHyperlinkWamEvent").PsPhoneNumberHyperlinkWamEvent)({phoneNumHyperlinkAction:d("WAWebWamEnumPhoneNumHyperlinkActionType").PHONE_NUM_HYPERLINK_ACTION_TYPE.CLOSE_DIALOG_BOX,isPhoneNumHyperlinkOwner:b,phoneNumberStatusOnWa:Boolean(a)}).commit()}function k(a,b){if(!a)return;d("WAWebComposeBoxActions").ComposeBoxActions.addMsgSendingLogAttributes(a,{handleOnce:function(){new(d("WAWebPsPhoneNumberHyperlinkWamEvent").PsPhoneNumberHyperlinkWamEvent)({phoneNumHyperlinkAction:d("WAWebWamEnumPhoneNumHyperlinkActionType").PHONE_NUM_HYPERLINK_ACTION_TYPE.MESSAGE_SENT,isPhoneNumHyperlinkOwner:b,phoneNumberStatusOnWa:!0}).commit()}})}g.handleOpenChat=a;g.handleCopyPhoneNumber=b;g.logClickOnPhoneNumber=e;g.logCloseDialog=f}),226); __d("WAWebStatusContactAction",["fbt","Promise","WALogger","WAWebActionToast.react","WAWebContactStatusBridge","WAWebMiscErrors","WAWebTextStatusCollection","WAWebToastManager","WAWebUserPrefsMeUser","asyncToGeneratorRuntime","react"],(function(a,b,c,d,e,f,g,h){var i,j;function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["models:statusCollection:setMyStatus dropped"]);k=function(){return a};return a}var l=j||c("react");function a(a){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield d("WAWebContactStatusBridge").getStatus(a));if(b.stale===!0){var c=d("WAWebTextStatusCollection").TextStatusCollection.get(a);if(c)return{id:a,status:c.status}}b=(c=b.status)!=null?c:d("WAWebTextStatusCollection").getDefaultTextStatus();return{id:a,status:b}});return m.apply(this,arguments)}function n(a,b,c){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e){c===void 0&&(c=d("WAWebActionToast.react").genId());e===void 0&&(e=!1);var f=a.trim();if(!f)return(i||(i=b("Promise"))).reject(new(d("WAWebMiscErrors").ActionError)());f=d("WAWebContactStatusBridge").setMyStatus(f);var g=new(d("WAWebActionToast.react").ActionType)(h._(/*BTDS*/"__JHASH__c3Hd87JDAev__JHASH__")),j=d("WAWebUserPrefsMeUser").getMeUser(),m=d("WAWebTextStatusCollection").TextStatusCollection.assertGet(j).status,o=f.then(function(a){if(a.status===200){var b=e?void 0:{actionText:h._(/*BTDS*/"__JHASH__mpD8GydGn1Q__JHASH__"),actionHandler:function(){return n(m,c,!0)}};return new(d("WAWebActionToast.react").ActionType)(h._(/*BTDS*/"__JHASH__rQQ0PSR-K8V__JHASH__"),b)}else if(a.status>=400)return new(d("WAWebActionToast.react").ActionType)(h._(/*BTDS*/"__JHASH__ZzY5RtG8Bmg__JHASH__"))})["catch"](function(b){d("WALogger").WARN(k()).devConsole(b);throw new(d("WAWebActionToast.react").ActionType)(h._(/*BTDS*/"__JHASH__ZzY5RtG8Bmg__JHASH__"),{actionText:h._(/*BTDS*/"__JHASH__TyKOR8KAtP1__JHASH__"),actionHandler:function(){return n(a,c)}})});d("WAWebToastManager").ToastManager.open(l.jsx(d("WAWebActionToast.react").ActionToast,{id:c,initialAction:g,pendingAction:o}));g=(yield f);g.status===200&&(d("WAWebTextStatusCollection").TextStatusCollection.assertGet(j).status=a)});return o.apply(this,arguments)}g.getStatus=a;g.setMyStatus=n}),226); __d("WAWebGroupExitJob",["Promise","WADeprecatedSendIq","WADeprecatedWapParser","WAWap","WAWebBackendErrors","WAWebCommsWapMd","WAWebJidToWid","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h,i=new(c("WADeprecatedWapParser"))("leaveGroupsResultParser",function(a){a.assertAttr("type","result");a=a.child("leave");a=a.mapChildren(function(a){return{id:d("WAWebJidToWid").groupJidToWid(a.attrGroupJid("id")),code:a.hasAttr("error")?a.attrInt("error"):200}});return a}),j=new(c("WADeprecatedWapParser"))("leaveCommunitiesResultParser",function(a){a.assertAttr("type","result");a=a.child("leave");a=a.mapChildren(function(a){return{id:d("WAWebJidToWid").groupJidToWid(a.attrGroupJid("parent_group_jid")),code:a.hasAttr("error")?a.attrInt("error"):200}});return a});function k(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c;a=a.map(function(a){return d("WAWap").wap("group",{id:d("WAWebCommsWapMd").GROUP_JID(a)})});c=(c=d("WAWap")).wap("iq",{to:c.G_US,type:"set",xmlns:"w:g2",id:c.generateId()},c.wap("leave",null,a));a=(yield d("WADeprecatedSendIq").deprecatedSendIq(c,i));return a.success?a.result:(h||(h=b("Promise"))).reject(new(d("WAWebBackendErrors").ServerStatusCodeError)(a.errorCode,a.errorText))});return l.apply(this,arguments)}function a(a){return k([a]).then(function(a){return a[0]})}function m(a){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c;a=a.map(function(a){return d("WAWap").wap("linked_groups",{parent_group_jid:d("WAWebCommsWapMd").GROUP_JID(a)})});c=(c=d("WAWap")).wap("iq",{to:c.G_US,type:"set",xmlns:"w:g2",id:c.generateId()},c.wap("leave",null,a));a=(yield d("WADeprecatedSendIq").deprecatedSendIq(c,j));return a.success?a.result:(h||(h=b("Promise"))).reject(new(d("WAWebBackendErrors").ServerStatusCodeError)(a.errorCode,a.errorText))});return n.apply(this,arguments)}function e(a){return m([a]).then(function(a){return a[0]})}g.leaveGroup=a;g.leaveCommunities=m;g.leaveCommunity=e}),98); __d("WAWebExitGroupAction",["fbt","Promise","WAFilteredCatch","WALogger","WAWebActionToast.react","WAWebBackendErrors","WAWebChatGetters","WAWebGroupExitJob","WAWebInvalidateEventsAction","WAWebMiscErrors","WAWebPollsInvalidateChatPollMsgsAction","WAWebSchemaChat","WAWebStateUtils","WAWebToastManager","WAWebUserPrefsMeUser","err","react"],(function(a,b,c,d,e,f,g,h){var i,j;function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["failed to merge chat table"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["actions:chat:sendExit dropped"]);l=function(){return a};return a}var m=j||c("react");function a(a){return n(d("WAWebStateUtils").unproxy(a))}function n(a){var c=a.promises;if(!d("WAWebChatGetters").getIsGroup(a))return(i||(i=b("Promise"))).reject(new(d("WAWebMiscErrors").ActionError)());if(c.sendExit)return c.sendExit;var e=c.sendExit=d("WAWebGroupExitJob").leaveGroup(a.id).then(function(a){if(a.code!==200)throw new(d("WAWebBackendErrors").ServerStatusCodeError)(a.code)}),f=new(d("WAWebActionToast.react").ActionType)(h._(/*BTDS*/"__JHASH__GZuRzekWpPT__JHASH__")),g=e.then(function(){return new(d("WAWebActionToast.react").ActionType)(h._(/*BTDS*/"__JHASH__JrkJpRZ_-th__JHASH__"))})["catch"](d("WAFilteredCatch").filteredCatch(d("WAWebBackendErrors").ServerStatusCodeError,function(a){if(a.status>=400)return new(d("WAWebActionToast.react").ActionType)(h._(/*BTDS*/"__JHASH__Q9ghZy2BLs___JHASH__"))}))["catch"](function(b){d("WALogger").WARN(l()).devConsole(b);return new(d("WAWebActionToast.react").ActionType)(h._(/*BTDS*/"__JHASH__Q9ghZy2BLs___JHASH__"),{actionText:h._(/*BTDS*/"__JHASH__TyKOR8KAtP1__JHASH__"),actionHandler:function(){return n(a)}})});d("WAWebToastManager").ToastManager.open(m.jsx(d("WAWebActionToast.react").ActionToast,{initialAction:f,pendingAction:g}));return e.then(function(){return o(a)})["finally"](function(){c.sendExit=null})["catch"](d("WAFilteredCatch").filteredCatch(d("WAWebBackendErrors").ServerStatusCodeError,function(){return!1}))}function o(a){var e;if(!d("WAWebChatGetters").getIsGroup(a))return(i||(i=b("Promise"))).resolve(!0);(e=a.groupMetadata)==null?void 0:e.participants.remove(d("WAWebUserPrefsMeUser").getMeUser());return d("WAWebSchemaChat").getChatTable().merge(a.id.toString(),{isReadOnly:!0}).then(function(){a.isReadOnly=!0;void d("WAWebPollsInvalidateChatPollMsgsAction").invalidateChatPollMsgs(a);void d("WAWebInvalidateEventsAction").invalidateEventMsgsForChat(a);return!0})["catch"](function(a){d("WALogger").ERROR(k()).verbose().devConsole(a).sendLogs("failed to merge chat table when exiting group: "+a);throw c("err")("failed to merge chat table")})}g.sendExitGroup=a}),226); __d("WAWebFindGroupMetadataAction",["Promise","WALogger","WAWebDBParticipantTypes","WAWebGroupDatabaseJob","WAWebGroupMetadataCollection","WAWebGroupQueryBridge","WAWebWamNumberToSizeBucket","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["findGroupMetadata: end find group metadata for ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["findGroupMetadata: "," - query stale group participant"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["findGroupMetadata: "," - query missing group participant"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["findGroupMetadata: "," - pending participant query"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["findGroupMetadata: "," - query missing group participant"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["findGroupMetadata: start find group metadata for ",""]);n=function(){return a};return a}function a(a){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){d("WALogger").DEV(n(),a);var e=null,f=null,g=function(){return void 0},o=c("WAWebGroupMetadataCollection").get(a);if(!o){e=(yield d("WAWebGroupDatabaseJob").getGroupMetadataJob(a));if(!e){d("WALogger").LOG(m(),a);return d("WAWebGroupQueryBridge").sendQueryGroup(a)}e.subject!=null&&d("WAWebGroupQueryBridge").updateSubject(a,e.subject)}else{if(o.participantQueryPromise){d("WALogger").LOG(l(),a);return o.participantQueryPromise.then(function(){return{id:a}})}o.participantQueryPromise=new(h||(h=b("Promise")))(function(a){g=a})}try{if(!o||o.stale){f=(yield d("WAWebGroupDatabaseJob").getGroupParticipantJob(a));if(!f){d("WALogger").LOG(k(),a);return d("WAWebGroupQueryBridge").sendQueryGroup(a)}}e=babelHelpers["extends"]({id:a},e,{participants:(e=f)==null?void 0:e.participants,pastParticipants:(e=f)==null?void 0:e.pastParticipants,deviceStale:f?f.staleType===d("WAWebDBParticipantTypes").STALE_TYPES.DEVICE:void 0,cachedDeviceCount:(e=f)==null?void 0:e.deviceCount,cachedDeviceSizeBucket:((e=f)==null?void 0:e.deviceCount)?c("WAWebWamNumberToSizeBucket")(f.deviceCount):null});if(((f=f)==null?void 0:f.staleType)===d("WAWebDBParticipantTypes").STALE_TYPES.PARTICIPANT){d("WALogger").LOG(j(),a);f=(yield d("WAWebGroupQueryBridge").sendQueryGroup(a));(f==null?void 0:f.participants)!=null&&(e.participants=f.participants)}d("WALogger").DEV(i(),a);return e}finally{g(),o&&(o.participantQueryPromise=null)}});return o.apply(this,arguments)}g.findGroupMetadata=a}),98); __d("WAWebSendForNeededAddRequest",["WALogger","WAWebCmd","WAWebContactCollection"],(function(a,b,c,d,e,f,g){"use strict";function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Assertion failed!"]);h=function(){return a};return a}function a(a,b,c,e){if(!a.participants)return;e=(e=e)!=null?e:a.gid;e||d("WALogger").ERROR(h()).sendLogs("Group add request was provided with undefined gid");var f=[];a.participants.forEach(function(a){if(a.code!=="403")return;var b=d("WAWebContactCollection").ContactCollection.gadd(a.userWid,{silent:!0});f.push(babelHelpers["extends"]({},a,{contact:b}))});f.length>0&&e&&d("WAWebCmd").Cmd.openGroupsV4InviteRequestFlow(f,e,b,c)}g.sendForNeededAddRequest=a}),98); __d("WAWebGroupInviteV4Job",["WALogger","WASmaxGroupsAcceptGroupAddRPC","WASmaxGroupsGetGroupInfoRPC","WASmaxGroupsRevokeRequestCodeRPC","WAWebGroupsQueryApi","WAWebJidToWid","WAWebWidToJid","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["revokeGroupInviteV4: failed ",":",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["revokeGroupInviteV4: failed ",":",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["joinGroupViaInviteV4: failed ",":",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["joinGroupViaInviteV4: failed ",":",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["queryGroupInviteV4: failed ",":",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["queryGroupInviteV4: failed ",":",""]);m=function(){return a};return a}function a(a,b,c,d,e){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e,f){b=(yield d("WASmaxGroupsGetGroupInfoRPC").sendGetGroupInfoRPC({addRequestArgs:{addRequestExpiration:parseInt(b,10),addRequestAdmin:d("WAWebWidToJid").widToUserJid(e),addRequestCode:a},iqTo:c,queryPhash:f}));switch(b.name){case"GetGroupInfoResponseSuccess":if(b.value.group==null)return{status:200,phashMatch:!0};e=d("WAWebGroupsQueryApi").parseGroupSmax(b.value.group);return{status:200,groupMetadata:e};case"GetGroupInfoResponseClientError":a=b.value.errorGetGroupInfoClientErrors.value;c=a.code;f=a.text;d("WALogger").LOG(m(),Number(c),f);return{status:Number(c)};case"GetGroupInfoResponseServerError":e=b.value.errorServerErrors.value;a=e.code;f=e.text;d("WALogger").LOG(l(),a,f);return{status:Number(a)}}});return n.apply(this,arguments)}function c(a,b,c,d){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e){a=(yield d("WASmaxGroupsAcceptGroupAddRPC").sendAcceptGroupAddRPC({iqTo:c,acceptCode:a,acceptExpiration:parseInt(b,10),acceptAdmin:d("WAWebWidToJid").widToUserJid(e)}));switch(a.name){case"AcceptGroupAddResponseSuccess":return{status:200,gid:d("WAWebJidToWid").groupJidToWid(c)};case"AcceptGroupAddResponseGroupJoinRequestSuccess":return{status:200,gid:d("WAWebJidToWid").groupJidToWid(c)};case"AcceptGroupAddResponseClientError":b=a.value.errorAcceptGroupAddClientErrors.value;e=b.code;c=b.text;d("WALogger").LOG(k(),e,c);return{status:Number(e)};case"AcceptGroupAddResponseServerError":b=a.value.errorServerErrors.value;c=b.code;e=b.text;d("WALogger").LOG(j(),c,e);return{status:Number(c)}}});return o.apply(this,arguments)}function e(a,b){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=(yield d("WASmaxGroupsRevokeRequestCodeRPC").sendRevokeRequestCodeRPC({participantArgs:a.map(function(a){return{participantJid:d("WAWebWidToJid").widToUserJid(a)}}),iqTo:b}));switch(a.name){case"RevokeRequestCodeResponseSuccess":return{status:200};case"RevokeRequestCodeResponseClientError":b=a.value.errorClientErrors.value;var c=b.code;b=b.text;d("WALogger").LOG(i(),c,b);return{status:Number(c)};case"RevokeRequestCodeResponseServerError":b=a.value.errorServerErrors.value;c=b.code;a=b.text;d("WALogger").LOG(h(),c,a);return{status:Number(c)}}});return p.apply(this,arguments)}g.queryGroupInviteV4=a;g.joinGroupViaInviteV4=c;g.revokeGroupInviteV4=e}),98); __d("WAWebInviteV4QueryGroupAction",["WAWebApiGroupInviteV4Store","WAWebChatCollection","WAWebContactCollection","WAWebGroupInviteV4Job","WAWebGroupMetadataCollection","WAWebPhashUtils","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a,b,c,d){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e,f){var g=null,h=c("WAWebGroupMetadataCollection").get(e);h&&(g=(yield d("WAWebPhashUtils").phashV1(h.participants.map(function(a){return a.id}))));return d("WAWebGroupInviteV4Job").queryGroupInviteV4(a,b,e,f,g).then(function(a){if(a.phashMatch===!0)return{status:200,phashMatch:!0};return a.groupMetadata!=null?babelHelpers["extends"]({},a.groupMetadata):{status:a.status}}).then(function(a){if(a.status!=null&&a.status>0)return a;if(a.id!=null){d("WAWebContactCollection").ContactCollection.gadd(a.id);return a}a=c("WAWebGroupMetadataCollection").assertGet(d("WAWebWidFactory").createWidFromWidLike(e));var b=d("WAWebChatCollection").ChatCollection.assertGet(a.id).contact.name;return{id:a.id,owner:a.owner,creation:a.creation,desc:a.desc,descId:a.descId,descOwner:a.descOwner,descTime:a.descTime,restrict:a.restrict,announce:a.announce,ephemeralDuration:a.ephemeralDuration,membershipApprovalMode:a.membershipApprovalMode,reportToAdminMode:a.reportToAdminMode,growthLockExpiration:a.growthLockExpiration,growthLockType:a.growthLockType,noFrequentlyForwarded:a.noFrequentlyForwarded,subject:b,participants:a.participants.map(function(a){return{id:a.id,isAdmin:a.isAdmin,isSuperAdmin:a.isSuperAdmin}})}})});return h.apply(this,arguments)}function e(a,b,c,e){return d("WAWebGroupInviteV4Job").joinGroupViaInviteV4(a,b,c,e)}function f(a,b){return d("WAWebGroupInviteV4Job").revokeGroupInviteV4(a,b)}function i(a,b){return d("WAWebApiGroupInviteV4Store").getPendingParticipants(a,b)}g.queryGroupInviteV4Info=a;g.joinGroupViaInviteV4=e;g.revokeGroupInviteV4=f;g.getPendingParticipants=i}),98); __d("WAWebChangePresenceHandlerAction",["Promise","WAWebApiContact","WAWebChatCollection","WAWebPresenceCollection","WAWebUserPrefsMeUser","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h,i=25e3;function j(a,b){var c=a.type;(c==="typing"||c==="recording_audio")&&(a.type=b.isOnline?"available":"unavailable")}function a(a,b){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){c===void 0&&(c=!0);var e=a.id;if(!d("WAWebUserPrefsMeUser").isMeAccount(e)){e=d("WAWebPresenceCollection").PresenceCollection.get(e);e&&(l(e,a),c&&e.set({stale:!1}))}return(h||(h=b("Promise"))).resolve()});return k.apply(this,arguments)}function l(a,b){var c=!1;typeof b.type==="undefined"?b.type=a.chatstate.type||"unavailable":b.type==="idle"&&(c=!0,b.type=a.isOnline?"available":"unavailable");a.isGroup&&b.type!=="available"&&!c&&(b.updateTime=Date.now());var e;if(a.isGroup){var f=b.participant;if(f==null)return;var g=b.id;g=d("WAWebChatCollection").ChatCollection.get(g);if(g==null)return;if(f.isLid()&&d("WAWebApiContact").getPhoneNumber(d("WAWebWidFactory").toUserWid(f))==null)return;b.id=f;b.participant=void 0;e=a.chatstates.gadd(b.id)}else e=a.chatstate;(!c||e.type==="typing"||e.type==="recording_audio")&&e.set(b);e.expireTimerId&&self.clearTimeout(e.expireTimerId);e.type==="typing"||e.type==="recording_audio"?e.expireTimerId=self.setTimeout(function(){return j(e,a)},i):e.expireTimerId=void 0;g=a.forceDisplay||a.isOnline||a.isUser&&!a.chatstate.deny;a.set({hasData:!0,isSubscribed:!0,forceDisplay:g})}g["default"]=a}),98); __d("WAWebAddOnsUpdateAddOnAcksApi",["Promise","WAAckLevel","WANullthrows","WATypeUtils","WAWebBackendApi","WAWebDBAddOnProviders","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function a(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield (h||(h=b("Promise"))).allSettled(Array.from(a.entries()).map(function(a){var b=a[0];a=a[1];b=c("WANullthrows")(d("WAWebDBAddOnProviders").getProviderForAddOnType(b));return b.updateAcks==null?void 0:b.updateAcks(a,function(){return!0})})));for(a of a)if(a.status==="rejected")throw a.reason});return i.apply(this,arguments)}function e(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield (h||(h=b("Promise"))).allSettled(Array.from(a).map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a[0];a=a[1];var e=c("WANullthrows")(d("WAWebDBAddOnProviders").getProviderForAddOnType(b));e=(yield e.updateAcks==null?void 0:e.updateAcks(a,function(a,b){return k(a.ack,b.ack)}));if(e==null||e.length===0)return;return[b,e]});return function(b){return a.apply(this,arguments)}}())));var e=new Map(a.map(function(a){return a.value}).filter(Boolean));d("WAWebBackendApi").frontendFireAndForget("updateAddOnCollectionAcks",{updatesByType:e});for(e of a)if(e.status==="rejected")throw e.reason});return j.apply(this,arguments)}function k(a,b){return d("WATypeUtils").isNumber(b)&&(a==null||b>a||b===d("WAAckLevel").ACK.FAILED)}g.updateAddOnAcks=a;g.maybeUpdateAddOnAcks=e}),98); __d("WAWebAddOnsUpdateSendStatesAction",["Promise","WAWebAddOnsUpdateAddOnAcksApi","WAWebCommentCollection","WAWebFlattenedReactionCollection","WAWebMessageAddOnType","WAWebMsgKey","WAWebMsgType","WAWebPinInChatCollection","WAWebPollsPollVoteCollection","WAWebReactionGatingUtils","WAWebReactionsCollection","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function a(a,b){var c=l(a);if(c==null)return;d("WAWebAddOnsUpdateAddOnAcksApi").maybeUpdateAddOnAcks(new Map([[c,[{msgKey:a.id.toString(),ack:b}]]]))}function e(a,c){var d=l(a);return d==null?(h||(h=b("Promise"))).resolve():i(new Map([[d,[babelHelpers["extends"]({msgKey:a.id.toString()},c)]]]))}function i(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=new Map();for(var c of a){var e=c[0],f=c[1];f=f.map(function(a){return a.ack==null?null:{msgKey:a.msgKey,ack:a.ack}}).filter(Boolean);b.set(e,f)}yield d("WAWebAddOnsUpdateAddOnAcksApi").updateAddOnAcks(b);k(a)});return j.apply(this,arguments)}function k(a){for(a of a){var b=a[0],d=a[1];for(d of d){var e=m(b,c("WAWebMsgKey").from(d.msgKey));if(e==null)continue;d.ack!=null&&(e.ack=d.ack);d.isSendFailure!=null&&(e.isSendFailure=d.isSendFailure)}}}function l(a){switch(a.type){case d("WAWebMsgType").MSG_TYPE.REACTION:case d("WAWebMsgType").MSG_TYPE.REACTION_ENC:return d("WAWebMessageAddOnType").MessageAddOnType.Reaction;case d("WAWebMsgType").MSG_TYPE.POLL_UPDATE:if(a.subtype==="poll_vote")return d("WAWebMessageAddOnType").MessageAddOnType.PollVote;break;case d("WAWebMsgType").MSG_TYPE.PIN_MESSAGE:return d("WAWebMessageAddOnType").MessageAddOnType.PinMessage;case d("WAWebMsgType").MSG_TYPE.COMMENT:return d("WAWebMessageAddOnType").MessageAddOnType.Comment}return null}function m(a,b){switch(a){case d("WAWebMessageAddOnType").MessageAddOnType.Reaction:return d("WAWebReactionGatingUtils").isFlattenedReactionsEnabled()?d("WAWebFlattenedReactionCollection").FlattenedReactionsCollection.get(b):d("WAWebReactionsCollection").ReactionsCollection.getSenderByMsgKey(b);case d("WAWebMessageAddOnType").MessageAddOnType.PollVote:return d("WAWebPollsPollVoteCollection").PollVoteCollection.getByMsgKey(b);case d("WAWebMessageAddOnType").MessageAddOnType.PinMessage:return d("WAWebPinInChatCollection").PinInChatCollection.getByMsgKey(b);case d("WAWebMessageAddOnType").MessageAddOnType.Comment:return d("WAWebCommentCollection").CommentCollection.getByMsgKey(b);case d("WAWebMessageAddOnType").MessageAddOnType.KeepInChat:case d("WAWebMessageAddOnType").MessageAddOnType.MessageEdit:case d("WAWebMessageAddOnType").MessageAddOnType.ReactionEnc:case d("WAWebMessageAddOnType").MessageAddOnType.Unknown:return null}}g.maybeUpdateAddOnAckForMsgAction=a;g.updateAddOnSendStatesForMsgAction=e;g.updateAddOnSendStatesAction=i;g.updateAddOnCollectionsSendStatesAction=k}),98); __d("WAWebFutureproofReparseMsgsAction",["Promise","WALogger","WAWebAddonGatingUtils","WAWebDBAddOnProviders","WAWebDBMessageSerialization","WAWebHandleMsgProcess","WAWebMsgGetters","WAWebMsgType","WAWebNewsletterReparseMsgAction","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["reparseFutureproof: processFutureproof error"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["reparseFutureproof: reparse error: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["reparseFutureproof: No futureproof buffer"]);k=function(){return a};return a}function l(a){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){try{var b=a.futureproofBuffer,c=a.futureproofParams;if(d("WAWebMsgGetters").getIsNewsletterMsg(a))return yield d("WAWebNewsletterReparseMsgAction").reparseNewsletterMsg(a);if(b!=null){c&&(yield d("WAWebHandleMsgProcess").processDecryptedMessageProto(babelHelpers["extends"]({},c,{decrypted:b,reparsing:!0})));return a}d("WALogger").DEV(k());return null}catch(a){d("WALogger").ERROR(j(),a);return null}});return m.apply(this,arguments)}function a(a){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){try{var c=[],e=[];a.forEach(function(a){var b=d("WAWebDBMessageSerialization").messageFromDbRow(a),f=d("WAWebAddonGatingUtils").isUnifiedInfraEnabledForType(a.type)||Boolean(d("WAWebDBAddOnProviders").getAddOnProviderForFutureproofMsg(b));f?c.push(b):a.type===d("WAWebMsgType").MSG_TYPE.UNKNOWN&&e.push(b)});yield (h||(h=b("Promise"))).all(e.map(function(a){return l(a)}));yield h.all(c.map(function(a){return l(a)}))}catch(a){d("WALogger").ERROR(i())}});return n.apply(this,arguments)}g.reparseFutureproof=l;g.processFutureproof=a}),98); __d("WAWebDisplayType",[],(function(a,b,c,d,e,f){var g={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",ANNOUNCEMENT:"ANNOUNCEMENT",NEWSLETTER:"NEWSLETTER",NEWSLETTER_PREVIEW:"NEWSLETTER_PREVIEW",CHANNEL_ALERTS_MSGS:"CHANNEL_ALERTS_MSGS",REPORTED_MSG:"REPORTED_MSG",BOT_INVOKE_RESPONSE:"BOT_INVOKE_RESPONSE",ALL_REPLIES:"ALL_REPLIES",BOT_REELS_PLUGIN:"BOT_REELS_PLUGIN",COMMENT:"COMMENT"};function a(a){return a===g.ANNOUNCEMENT||a===g.NEWSLETTER}var h=[g.CONVERSATION,g.ANNOUNCEMENT,g.NEWSLETTER,g.BOT_INVOKE_RESPONSE,g.ALL_REPLIES];function b(a){return i.includes(a)}var i=[g.STARRED_MSGS,g.REPORTED_MSG,g.CONTACT_CARD,g.GALLERY,g.GALLERY_LINKS];function c(a){return h.includes(a)}f.DISPLAY_TYPE=g;f.isWideDisplay=a;f.isMsgGalleryDisplay=b;f.isConversationDisplay=c}),66); __d("WAWebMediaLinkPreviewUtils",["WATimeUtils","WAWebDisplayType"],(function(a,b,c,d,e,f,g){var h=30*24*60*60;function i(a){a=d("WATimeUtils").unixTime()-a>h;return a}var j=7/5;function a(a,b){var c=Boolean(a.thumbnailDirectPath||a.thumbnailHQ)&&a.thumbnailHeight!=null&&a.thumbnailWidth!=null;if(!c)return!1;c=i(a.t);if(c)return!1;c=b===d("WAWebDisplayType").DISPLAY_TYPE.GALLERY;if(c)return!1;return b===d("WAWebDisplayType").DISPLAY_TYPE.STATUS&&a.thumbnailHeight!=null&&a.thumbnailWidth!=null?a.thumbnailWidth/a.thumbnailHeight>=j:!0}g.HQ_PREVIEW_LIFESPAN=h;g.hqLinkPreviewExpired=i;g.displayHighQualityLinkPreview=a}),98); __d("WAWebProcessMultipleMsgsAction",["Promise","WALogger","WATimeUtils","WAWebABProps","WAWebAddAndReorderMsgsActionsUtils","WAWebBotGenTypingIndicatorMsg","WAWebBotTypes","WAWebChatCollection","WAWebFindChatAction","WAWebFrontendMsgGetters","WAWebGetMsgUpdatesActionsUtils","WAWebMedia","WAWebMediaAutoDownloadQueue","WAWebMediaDownloadMmsThumbnail","WAWebMediaLinkPreviewUtils","WAWebMediaTypes","WAWebMiscGatingUtils","WAWebMsgCollection","WAWebMsgGetters","WAWebMsgModelUtils","WAWebMsgType","WAWebNewsletterCollection","WAWebRecentStickerCollection","WAWebRecentStickerCollectionMd","WAWebStatusCollection","WAWebStickerModel","WAWebUserPrefsGeneral","WAWebUserPrefsMeUser","WAWebWid","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Assertion failed! ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Get empty message with id ","."]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[sticker] Unexpected null media key"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["processed "," recent sticker messages"]);l=function(){return a};return a}function a(a,b,c,d,e){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e,f,g,i){var j,m=(yield c("WAWebGetMsgUpdatesActionsUtils")(a,e,f,i)),o=m.filteredRecs,p=m.reorderRecs;m=m.updates;m=(yield (h||(h=b("Promise"))).all(m));m=m.filter(function(a){return(a==null?void 0:a.associationType)!=null});d("WAWebMsgCollection").MsgCollection.makeParentMessagesVisibleInChat(m);if(o.length===0&&p.length===0){if(a&&f.pendingMsgsDone===!0){m=(m=d("WAWebChatCollection").ChatCollection.get(a))!=null?m:c("WAWebNewsletterCollection").get(a);m&&(m.pendingMsgs=!1)}return e.map(function(a){return d("WAWebMsgCollection").MsgCollection.get(a.id)}).filter(Boolean)}if(!a)return n(o).then(function(){return e.reduce(function(a,b){b=d("WAWebMsgCollection").MsgCollection.get(b.id);b!=null&&d("WAWebFrontendMsgGetters").getChat(b)!=null&&a.push(b);return a},[])});m=e[0];if(c("WAWebWid").isStatus(a)){m=m.id.fromMe?d("WAWebUserPrefsMeUser").getMeUser():m.author;m=d("WAWebStatusCollection").StatusCollection.find(m)}else m=(yield d("WAWebFindChatAction").findExistingChat(a,g));var q=(yield m);g=(yield n(o));m=f.add==="after"||f.add==="last";o=!f.isHistory;var r,s=!1,t=q.id.isBot();j=((j=q.contact.businessProfile)==null?void 0:j.isBizBot3p)===!0;if((t||j)&&f.isHistory===!1){t=q.msgs.last();(t==null?void 0:t.subtype)===d("WAWebBotGenTypingIndicatorMsg").BOT_TYPING_PLACEHOLDER_MSG_SUBTYPE&&(t==null?void 0:t["delete"]({skipUpdatingSortTime:!0}))}g.forEach(function(a){a.subtype==="biz_bot_1p_disclosure"?q.set({bizBotSystemMsgType:d("WAWebBotTypes").BizBotType.BIZ_1P}):a.subtype==="biz_bot_3p_disclosure"&&q.set({bizBotSystemMsgType:d("WAWebBotTypes").BizBotType.BIZ_3P})});f.add==="unread"?(j=i,q.msgChunks.push(j),r=f.firstUnreadKey):f.add==="last"&&f.resume===!0?(j=i,s=!0):j=typeof i==="function"?i():i;c("WAWebAddAndReorderMsgsActionsUtils")(e,g,p,q,m,j||q.msgs,r,s);f.pendingMsgsDone===!0&&(q.pendingMsgs=!1);o&&c("WAWebWid").isBroadcast(a)&&!c("WAWebWid").isStatus(a)&&g.forEach(function(a){if(!a)return;a.recvFresh&&!d("WAWebMsgGetters").getIsNotification(a)&&d("WAWebMsgModelUtils").broadcastFanout(a)});if(!((t=f.isHistory)!=null?t:!1)){i=g.map(function(a){var b,c=d("WAWebMsgGetters").getIsSentByMe(a)&&a.type===d("WAWebMsgType").MSG_TYPE.STICKER;if(!c||a.isAvatar===!0)return;c=a.mediaData;var e=a.mediaObject,f=a.id.toString();e=e==null?void 0:e.entries.entries[0];return{sticker:new(d("WAWebStickerModel").StickerModel)({id:c.filehash,directPath:c.directPath,filehash:c.filehash,encFilehash:(b=e==null?void 0:e.getEncfilehash())!=null?b:c.encFilehash,mediaKey:(b=e==null?void 0:e.getMediaKey())!=null?b:c.mediaKey,mediaKeyTimestamp:c.mediaKeyTimestamp!=null?c.mediaKeyTimestamp:d("WATimeUtils").unixTime(),width:c.fullWidth,height:c.fullHeight,size:c.size,mimetype:c.mimetype,type:d("WAWebMediaTypes").OUTWARD_TYPES.STICKER,index:0}),timestamp:(e=a.stickerSentTs)!=null?e:0,msgId:f}}).filter(Boolean);d("WALogger").LOG(l(),i.length);i.forEach(function(a){return d("WAWebRecentStickerCollectionMd").RecentStickerCollectionMd.addNewSticker(a.sticker,a.msgId,a.timestamp)})}p=g.map(function(a){var b=a.isNewMsg&&d("WAWebMsgGetters").getIsSentByMe(a)&&a.type===d("WAWebMsgType").MSG_TYPE.STICKER,c=a.mediaData;if(!b)return;b=a.mediaKey;if(b==null){d("WALogger").ERROR(k()).sendLogs("sticker-unexpected-null-media-key");return}return{id:c.filehash,directPath:c.directPath,filehash:c.filehash,encFilehash:c.encFilehash,mediaKey:b,mediaKeyTimestamp:c.mediaKeyTimestamp!=null?c.mediaKeyTimestamp:d("WATimeUtils").unixTime(),width:c.fullWidth,height:c.fullHeight,size:c.size,mimetype:c.mimetype,type:d("WAWebMediaTypes").OUTWARD_TYPES.STICKER,index:0}}).filter(Boolean);d("WAWebRecentStickerCollection").RecentStickerCollection.enqueue(p);d("WAWebMiscGatingUtils").webMediaAutoDownloadEnabled()&&!c("WAWebWid").isStatus(a)&&g.map(function(a){return d("WAWebFrontendMsgGetters").getAsAutoDownloadableMedia(a)}).filter(Boolean).forEach(function(a){d("WAWebMediaAutoDownloadQueue").AutoDownloadQueue.enqueue(a,d("WAWebMediaAutoDownloadQueue").AutoDownloadTypes.MEDIA)});d("WAWebABProps").getABPropConfigValue("download_document_thumb_mms_enabled")&&g.map(function(a){return d("WAWebFrontendMsgGetters").getAsDoc(a)}).filter(Boolean).forEach(function(a){d("WAWebMiscGatingUtils").webMediaAutoDownloadEnabled()?d("WAWebMediaAutoDownloadQueue").AutoDownloadQueue.enqueue(a,d("WAWebMediaAutoDownloadQueue").AutoDownloadTypes.MMS_THUMBNAIL):void c("WAWebMediaDownloadMmsThumbnail")({chat:null,msg:a,isPreload:!0})});g.map(function(a){return d("WAWebFrontendMsgGetters").getAsUrl(a)}).filter(Boolean).forEach(function(a){if(d("WAWebMediaLinkPreviewUtils").hqLinkPreviewExpired(a.t))return;d("WAWebMiscGatingUtils").webMediaAutoDownloadEnabled()?d("WAWebMediaAutoDownloadQueue").AutoDownloadQueue.enqueue(a,d("WAWebMediaAutoDownloadQueue").AutoDownloadTypes.MMS_THUMBNAIL,null):void c("WAWebMediaDownloadMmsThumbnail")({msg:a,isPreload:!0,chat:null})});if(d("WAWebABProps").getABPropConfigValue("download_status_thumb_mms_enabled")&&c("WAWebWid").isStatus(a)){m=d("WAWebUserPrefsGeneral").getLastStatusUsage();j=1e3*60*60*24;(m==null||Date.now()-m<14*j)&&g.map(function(a){return d("WAWebFrontendMsgGetters").getAsImage(a)||d("WAWebFrontendMsgGetters").getAsVideo(a)}).filter(Boolean).forEach(function(a){d("WAWebMiscGatingUtils").webMediaAutoDownloadEnabled()?d("WAWebMediaAutoDownloadQueue").AutoDownloadQueue.enqueue(a,d("WAWebMediaAutoDownloadQueue").AutoDownloadTypes.MMS_THUMBNAIL):void d("WAWebMedia").downloadStatusThumbnail({msg:a,isPreload:!0})})}return e.map(function(a){return d("WAWebMsgCollection").MsgCollection.get(a.id)}).filter(Boolean)});return m.apply(this,arguments)}function n(a){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=d("WAWebMsgCollection").MsgCollection.add(a,{merge:!0});c=c.reduce(function(b,c,e){c==null&&d("WALogger").ERROR(j(),a[e].id).sendLogs("msgPrepWork-empty-message");c!=null&&c.subtype!=="is_hosted_group"&&b.push(c);return b},[]);yield (h||(h=b("Promise"))).all(c.map(function(a){return a.waitForPrep()["catch"](function(a){d("WALogger").ERROR(i(),String(a)).devConsole(a).sendLogs("bad-msg-prep")})}));return c});return o.apply(this,arguments)}g._processMultipleMessages=a}),98); __d("WAWebErrorType",["$InternalEnum"],(function(a,b,c,d,e,f){a=b("$InternalEnum").Mirrored(["NoError","EditWindowExpired"]);f.SendFailureErrorCode=a}),66); __d("WAWebRevokeMsgConstants",["WATimeUtils"],(function(a,b,c,d,e,f,g){a=2.5*d("WATimeUtils").DAY_SECONDS;b=12*d("WATimeUtils").HOUR_SECONDS;c=30*d("WATimeUtils").DAY_SECONDS;g.REVOKE_WINDOW=a;g.REVOKE_WINDOW_RECEIVER_MARGIN=b;g.NEWSLETTER_REVOKE_WINDOW=c}),98); __d("WAWebSendRevokeMessageWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumMediaType","WAWebWamEnumMessageType"],(function(a,b,c,d,e,f,g){a=d("WAWebWamCodegenUtils").defineEvents({SendRevokeMessage:[1348,{messageMediaType:[2,d("WAWebWamEnumMediaType").MEDIA_TYPE],messageType:[1,d("WAWebWamEnumMessageType").MESSAGE_TYPE],revokeSendDelay:[3,d("WAWebWamCodegenUtils").TYPES.INTEGER]},[1,1,1],"regular"]},{SendRevokeMessage:[]});g.SendRevokeMessageWamEvent=a}),98); __d("WAWebRevokeMsgAction",["Promise","WAJobOrchestratorTypes","WALogger","WATimeUtils","WAWebAck","WAWebAddonProcessRevoke","WAWebApiChat","WAWebAssociationProcessor","WAWebAssociationProcessorConstants","WAWebBotGating","WAWebChatGetters","WAWebCmd","WAWebDBProcessMessage","WAWebDBStoreRevokeMsgs","WAWebErrorType","WAWebFrontendMsgGetters","WAWebFtsClient","WAWebLabelCollection","WAWebMedia","WAWebMessageAssociationGatingUtils","WAWebMessageSendPerfReporter","WAWebMsgActionCapability","WAWebMsgGetters","WAWebMsgKey","WAWebMsgModel","WAWebMsgModelUtils","WAWebMsgType","WAWebNoop","WAWebOrchestratorNonPersistedJob","WAWebPersistedJobDefinitions","WAWebPersistedJobManager","WAWebRevokeMsgConstants","WAWebSendMsgRecordAction","WAWebSendMsgResultAction","WAWebSendRevokeMessageWamEvent","WAWebSimpleSignalPNToFBIDMigration","WAWebStateUtils","WAWebUpdateLastAddOnPreviewChatAction","WAWebUserPrefsMeUser","WAWebViewMode.flow","WAWebWamMsgUtils","WAWebWid","asyncToGeneratorRuntime","err","lodash"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["_sendRevoke path for associated with bot plugin msg"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["_sendRevoke: failed to storeMessages into storage"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["failed to send revoke addon"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["cannot fanout revoke: "," ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["revoke: outside of revoke window, "," has not been revoked"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["[bot revoke] sendAssociatedBotPluginRevoke: ",""]);n=function(){return a};return a}function a(a,b,c){return a.type==="message"?p({type:"message",data:d("WAWebStateUtils").unproxy(a.data)},b,c):p(a,b,c)}function o(a,b){return s(d("WAWebStateUtils").unproxy(a),b)}function p(a,b,c,d){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e,f,g){var l;g===void 0&&(g=!1);var m=a.data;if(e===d("WAWebCmd").Revoke.Sender&&!m.id.fromMe&&!d("WAWebMsgActionCapability").canBotResponseBeRevokeByInvoker(m))return(h||(h=b("Promise"))).reject(c("err")("revoking received message"));var n=m.id.remote.isGroup()&&a.type==="addon"?d("WAWebUserPrefsMeUser").getMeLidUser():d("WAWebUserPrefsMeUser").getMeUser();l=m.id.remote.isGroup()&&((l=d("WAWebFrontendMsgGetters").getChat(m).groupMetadata)==null?void 0:l.isLidAddressingMode);var p=void 0;m.id.remote.isGroup()&&(p=l===!0?d("WAWebUserPrefsMeUser").getMeLidUser():n);var q=new(c("WAWebMsgKey"))({id:yield c("WAWebMsgKey").newId(),remote:m.id.remote,fromMe:!0,participant:p}),s=r(e),t=d("WATimeUtils").unixTime(),u=t-d("WAWebMsgGetters").getT(m),v={id:q,from:l===!0?d("WAWebUserPrefsMeUser").getMeLidUser():n,to:m.id.remote,author:p,t:t,type:d("WAWebMsgType").MSG_TYPE.PROTOCOL,kind:d("WAWebMsgType").MsgKind.ProtocolRevoke,subtype:r(e),protocolMessageKey:m.id,clearMedia:!!f,local:!0,revokeDuration:u,revokeTimestamp:t,viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE};if(a.type==="addon")return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("sendMessage",b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var b=a.data;if(b.kind!==d("WAWebMsgType").MsgKind.CommentDecrypted)throw c("err")("_sendRevoke: only decrypted comment can be revoked from the UI");var e=babelHelpers["extends"]({},v,{kind:d("WAWebMsgType").MsgKind.ProtocolAddonRevoke,targetMessageKey:b.parentMsgKey,revokeAddonType:b.type}),f=(yield d("WAWebSendMsgRecordAction").sendAddonRecord(e));f=f.messageSendResult;f===d("WAWebSendMsgResultAction").SendMsgResult.OK?(new(d("WAWebSendRevokeMessageWamEvent").SendRevokeMessageWamEvent)({messageType:d("WAWebWamMsgUtils").getWamMessageType(m),messageMediaType:d("WAWebWamMsgUtils").getWamMediaType(m),revokeSendDelay:u}).commit(),yield d("WAWebAddonProcessRevoke").processSentRevokeMsg(babelHelpers["extends"]({},e,{t:d("WAWebMsgGetters").getT(m),ack:d("WAWebAck").ACK.SENT}),b)):d("WALogger").ERROR(k()).tags("addons","messaging").sendLogs("failedSendRevokeMsg: "+b.type);return{messageSendResult:f}}),{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted();var w=babelHelpers["extends"]({},v);if(d("WAWebBotGating").isBotEnabled()){l=null;e=(p=m.mentionedJidList)==null?void 0:p.find(function(a){return a.isBot()});f=d("WAWebMsgGetters").getSender(m);f&&f.isBot()?l=f:e!=null&&m.isForwarded!==!0&&(l=e);if(l!=null){l=(p=d("WAWebSimpleSignalPNToFBIDMigration").getDeprecatedPnChatForFbidInvoke(l))!=null?p:l}w.botRespOrInvocationRevokeBotWid=l;m.botTargetSenderJid instanceof c("WAWebWid")&&(w.botTargetSenderJid=m.botTargetSenderJid)}var x=new(d("WAWebMsgModel").Msg)(w);x.wamMessageSendPerfReporter=new(d("WAWebMessageSendPerfReporter").MessageSendPerfReporter)({chatWid:x.to,mediaType:x.getWamMediaType(),messageType:x.getWamMessageType()});x.wamMessageSendPerfReporter.setIsRevokeMessage(!0);return d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("sendMessage",b("asyncToGeneratorRuntime").asyncToGenerator(function*(){try{var e;(e=x.wamMessageSendPerfReporter)==null?void 0:e.startSavedStage();yield d("WAWebDBProcessMessage").storeMessages([w],d("WAWebFrontendMsgGetters").getChat(m).id);(e=x.wamMessageSendPerfReporter)==null?void 0:e.postSavedStage()}catch(a){d("WALogger").ERROR(j()).verbose().devConsole(a).sendLogs("storeMessages failed");throw a}e=(yield d("WAWebSendMsgRecordAction").sendMsgRecord(x));e=e.messageSendResult;if(g){d("WALogger").LOG(i());throw c("err")("Expected exit for associated with bot plugin msg")}if(e===d("WAWebSendMsgResultAction").SendMsgResult.OK){new(d("WAWebSendRevokeMessageWamEvent").SendRevokeMessageWamEvent)({messageType:d("WAWebWamMsgUtils").getWamMessageType(m),messageMediaType:d("WAWebWamMsgUtils").getWamMediaType(m),revokeSendDelay:u}).commit();return d("WAWebDBStoreRevokeMsgs").processRevokeMsgs([{revokeMsgKey:m.id,newMsgKey:q,timestamp:d("WAWebMsgGetters").getT(m),revokeTimestamp:t,subtype:s,sender:n,disappearingModeInitiator:m.disappearingModeInitiator,ephemeralDuration:m.ephemeralDuration,ephemeralSettingTimestamp:m.ephemeralSettingTimestamp,viewMode:x.viewMode}]).then(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){d("WAWebUpdateLastAddOnPreviewChatAction").deleteModelsForLastAddOnPreview([m.id.toString()]);yield d("WAWebPersistedJobManager").getJobManager().waitUntilPersisted(d("WAWebPersistedJobDefinitions").jobSerializers.deleteAddOns(d("WAWebFrontendMsgGetters").getChat(m).id.toString(),[m.id.toString()]));o(a.data,{msgKey:q,subtype:s,sender:n,revokeTimestamp:t,viewMode:x.viewMode});return{messageSendResult:d("WAWebSendMsgResultAction").SendMsgResult.OK}}))}return(h||(h=b("Promise"))).resolve({messageSendResult:d("WAWebSendMsgResultAction").SendMsgResult.ERROR_UNKNOWN})}),{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()});return q.apply(this,arguments)}function e(a,b){void p({type:"message",data:d("WAWebStateUtils").unproxy(a)},b,!1,!0)["catch"](function(a){d("WALogger").LOG(n(),a.message)})}function f(a,b,c){return p({type:"message",data:d("WAWebStateUtils").unproxy(a)},b,c,!1)}function r(a){switch(a){case d("WAWebCmd").Revoke.Sender:return"sender_revoke";case d("WAWebCmd").Revoke.Admin:return"admin_revoke"}}function s(a,b){var e,f,g=d("WAWebFrontendMsgGetters").getMaybeChat(a),h=g!=null&&d("WAWebChatGetters").getIsNewsletter(g)?d("WAWebRevokeMsgConstants").NEWSLETTER_REVOKE_WINDOW:d("WAWebRevokeMsgConstants").REVOKE_WINDOW;h=h+d("WAWebRevokeMsgConstants").REVOKE_WINDOW_RECEIVER_MARGIN;h=d("WATimeUtils").unixTime()-a.t<=h;if(!h){d("WALogger").LOG(m(),a.id.toString());return}d("WAWebLabelCollection").LabelCollection.removeAllLabelsMD(a);d("WAWebMsgModelUtils").typeIsMms(a)&&d("WAWebMedia").deregisterMsg(a);g==null?void 0:g.removeFromCollection(a);a.trigger("revoked");d("WAWebMsgGetters").clearMsgGetterCacheFor(a);d("WAWebFrontendMsgGetters").clearFrontendMsgGetterCacheFor(a);var i=a.getCollection();h=a.id;a.msgChunk&&a.msgChunk.replaceId(h,b.msgKey);i.replaceId(h,b.msgKey);e=(e=g==null?void 0:g.isUnreadMsg(a))!=null?e:!1;f=(f=g==null?void 0:g.isActiveUnreadMsg(a))!=null?f:!1;var j=a.associationType;if(j!=null&&d("WAWebMessageAssociationGatingUtils").isMessageAssociationInfraEnabled()){j=d("WAWebAssociationProcessor").getAssociationProcessorByAssociationType(j);j&&j.processorType===d("WAWebAssociationProcessorConstants").AssociationProcessorType.WithDetachedMessages&&a.detachAssociatedMsg()}j={isOverwrittenByRevoke:!0,id:b.msgKey,type:d("WAWebMsgType").MSG_TYPE.REVOKED,subtype:b.subtype==="admin_revoke"?"admin":"sender",revokeSender:b.sender,revokeTimestamp:b.revokeTimestamp,protocolMessageKey:h,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,matchedText:void 0,thumbnail:void 0,richPreviewType:void 0,doNotPlayInline:void 0,paymentLinkMetadata:void 0,quotedMsg:void 0,quotedStanzaID:void 0,quotedRemoteJid:void 0,quotedParticipant:void 0,mediaData:void 0,mentionedJidList:void 0,groupMentions:void 0,vcardList:void 0,star:!1,kicState:void 0,kicTimestampMs:void 0,kicKey:void 0,errorCode:d("WAWebErrorType").SendFailureErrorCode.NoError,isSendFailure:!1,viewMode:(j=b.viewMode)!=null?j:d("WAWebViewMode.flow").ViewModeType.VISIBLE,associationType:void 0,parentMsgKey:void 0};a.set(j);a.trigger("change:msgKey",{newKey:b.msgKey,oldKey:h});g&&(h.equals(g.lastReceivedKey)&&(g.lastReceivedKey=b.msgKey),g.composeQuotedMsg===a&&(g.composeQuotedMsg=null),e&&(g.unreadCount=Math.max(g.unreadCount-1,0),g.unreadDividerOffset+=1,d("WAWebApiChat").reduceChatUnreadCount(g.id.toString())),f&&(g.activeUnreadCount=Math.max(g.activeUnreadCount-1,0)));if(c("WAWebWid").isBroadcast(h.remote)){j=d("WAWebMsgModelUtils").getBroadcastFanoutKeys(h);e=d("WAWebMsgModelUtils").getBroadcastFanoutKeys(b.msgKey);if(!j||!e||j.length!==e.length){d("WALogger").LOG(l(),String(j),String(e)).devConsole(j,e);return}c("lodash").zip(j,e).forEach(function(a){var c=i.get(a[0]);c&&o(c,{msgKey:a[1],subtype:b.subtype,sender:b.sender})});d("WAWebFtsClient").ftsClient.purge([String(a.rowId)])["catch"](c("WAWebNoop"));f=g?g.id.toString():a.id.remote.toString();d("WAWebUpdateLastAddOnPreviewChatAction").deleteModelsForLastAddOnPreview([h.toString()]);d("WAWebPersistedJobManager").getJobManager().fireAndForget(d("WAWebPersistedJobDefinitions").jobSerializers.deleteAddOns(f.toString(),[h.toString()]))}}g.sendRevoke=a;g.revoke=o;g.sendAssociatedBotPluginRevoke=e;g.sendAssociatedChildMsgRevoke=f}),98); __d("WAWebRevokeStatusPsaMsgAction",["Promise","WALogger","WAWebDBMessageDelete","WAWebStatusCollection","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["revokeStatusPSA completed"]);i=function(){return a};return a}function j(a,b){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b.length>0&&(a.revokeMsgs(b),yield d("WAWebDBMessageDelete").removeMessagesFromHistory(b),d("WALogger").LOG(i()).tags("revoke-status-psa"))});return k.apply(this,arguments)}function a(){var a=d("WAWebStatusCollection").StatusCollection.getPSAStatus();if(!a)return(h||(h=b("Promise"))).resolve();var c=a.msgs.map(function(a){return a.id.toString()});return j(a,c)}function c(a){var c=d("WAWebStatusCollection").StatusCollection.getPSAStatus();if(!c)return(h||(h=b("Promise"))).resolve();var e=c.msgs.filter(function(b){return b.campaignId===a}).map(function(a){return a.id.toString()});return j(c,e)}g.revokeAllStatusPSA=a;g.revokeStatusPSA=c}),98); __d("WAWebProcessAddonsJob",["WAJobOrchestratorTypes","WAWebDBProcessEditProtocolMsgs","WAWebOrchestratorNonPersistedJob","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("processEditProtocolMsgs",function(a){return d("WAWebDBProcessEditProtocolMsgs").processEditProtocolMsgs(a.msgs)},{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted({msgs:a});yield a});return h.apply(this,arguments)}g.processEditProtocolMsgsJob=a}),98); __d("WAWebSendMessageEditAction",["PaymentLink","Promise","WAJobOrchestratorTypes","WALogger","WANullthrows","WATimeUtils","WAWebChatGetters","WAWebDBMessageDelete","WAWebDBMsgUtils","WAWebDBProcessMessage","WAWebDBUpdateMessageTable","WAWebErrorType","WAWebFrontendMsgGetters","WAWebGroupMsgSendUtils","WAWebLidMigrationUtils","WAWebMessageEditGatingUtils","WAWebMessageEditUtils","WAWebMessageSendPerfReporter","WAWebMessageSendReporter","WAWebMessagingGatingUtils","WAWebMsgActionCapability","WAWebMsgDataFromModel","WAWebMsgGetters","WAWebMsgKey","WAWebMsgKeyUtils","WAWebMsgModel","WAWebMsgModelFromData","WAWebMsgType","WAWebNewsletterGatingUtils","WAWebNewsletterSendMsgAction","WAWebOrchestratorNonPersistedJob","WAWebProcessAddonsJob","WAWebSendMsgRecordAction","WAWebSendMsgResultAction","WAWebStateUtils","WAWebViewMode.flow","WAWebWidFactory","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[message-edit][sendMsgEditRecord] parent msg status to send edit protocol message"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[message-edit][sendMsgEditRecord] failed to send edit protocol message"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[message-edit][sendMsgEditRecord] edit protocol msg sent with result"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[message-edit][sendMessageEdit] failed to store protocol msg data in message table"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[message-edit] handle send message edit"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["[message-edit] send is disabled, "," will not be edited"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["[message-edit][resendLatestEdit] re-sending edit protocol message failed, the last edited msg was not found"]);o=function(){return a};return a}function p(a,b,c){d("WAWebMessageEditUtils").isParentWithinEditProcessingWindow({parentTsInSeconds:a.t,editTsInSeconds:c,msgKey:a.id})?b.updateErrorCode(d("WAWebErrorType").SendFailureErrorCode.NoError):(a.updateErrorCode(d("WAWebErrorType").SendFailureErrorCode.EditWindowExpired),b.updateErrorCode(d("WAWebErrorType").SendFailureErrorCode.EditWindowExpired))}function q(a,b){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b!=null&&(yield d("WAWebDBUpdateMessageTable").updateMessageTable(a.id,{count:b}))});return r.apply(this,arguments)}function a(a){var c=d("WAWebMsgGetters").getLatestEditMsgKey(a);return c==null||!d("WAWebMsgActionCapability").canEditText(a)?(h||(h=b("Promise"))).resolve():d("WAWebDBMsgUtils").getMsgByMsgKey(c).then(function(b){if(b)return v(d("WAWebStateUtils").unproxy(a),d("WAWebMsgModelFromData").msgModelFromMsgData(b))})["catch"](function(a){d("WALogger").DEV(o()).devConsole({error:a})})}function e(a,e,f){if(d("WAWebMsgGetters").getIsNewsletterMsg(a)?!d("WAWebNewsletterGatingUtils").isNewsletterMessageEditingEnabled():!d("WAWebMessageEditGatingUtils").sendTextEditEnabled()){d("WALogger").DEV(n(),a.id.toString());return(h||(h=b("Promise"))).resolve()}d("WALogger").DEV(m()).devConsole({msg:a,text:e,options:f});if(!d("WAWebMsgActionCapability").canEditText(a)&&!d("WAWebMsgActionCapability").canEditCaption(a))return(h||(h=b("Promise"))).reject(c("err")("Cannot edit message"));e=s(d("WAWebStateUtils").unproxy(a),e,f);return x(d("WAWebStateUtils").unproxy(a),e)}function s(a,b,e){var f=d("WAWebFrontendMsgGetters").getChat(a),g=d("WAWebLidMigrationUtils").getMeUserLidOrJidForChat(f,d("WAWebMsgKeyUtils").TranslateMsgKeyType.EditMessage);f=d("WAWebChatGetters").getIsGroup(f)?d("WAWebWidFactory").toUserWid(g):void 0;f=new(c("WAWebMsgKey"))({id:c("WAWebMsgKey").newId_DEPRECATED(),remote:a.id.remote,fromMe:!0,participant:f});var h=e.linkPreview,i=e.mentionedJidList;e=e.groupMentions;g={id:f,from:g,to:a.id.remote,type:d("WAWebMsgType").MSG_TYPE.PROTOCOL,kind:d("WAWebMsgType").MsgKind.Protocol,subtype:"message_edit",viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE,protocolMessageKey:a.id,local:!0,t:d("WATimeUtils").unixTime(),mentionedJidList:i,groupMentions:e,latestEditMsgKey:f,latestEditSenderTimestampMs:d("WATimeUtils").unixTimeMs(),editMsgType:a.type,errorCode:d("WAWebErrorType").SendFailureErrorCode.NoError,messageSecret:d("WAWebMessagingGatingUtils").isReportingTokenSendingEnabled()?a.messageSecret:null};switch(c("WANullthrows")(d("WAWebMessageEditUtils").getMsgEditType(a.type))){case d("WAWebMessageEditUtils").MsgEditType.TextEdit:g=babelHelpers["extends"]({},g,{body:b.trim(),title:(i=h==null?void 0:h.title)!=null?i:void 0,matchedText:(e=h==null?void 0:h.matchedText)!=null?e:void 0,description:h==null?void 0:h.description,thumbnail:(f=h==null?void 0:h.thumbnail)!=null?f:void 0,richPreviewType:h==null?void 0:h.richPreviewType,doNotPlayInline:h==null?void 0:h.doNotPlayInline,inviteGrpType:h==null?void 0:h.inviteGrpType,thumbnailDirectPath:h==null?void 0:h.thumbnailDirectPath,thumbnailSha256:h==null?void 0:h.thumbnailSha256,thumbnailEncSha256:h==null?void 0:h.thumbnailEncSha256,thumbnailHeight:h==null?void 0:h.thumbnailHeight,thumbnailWidth:h==null?void 0:h.thumbnailWidth,mediaKey:(a=h==null?void 0:h.mediaKey)!=null?a:void 0,mediaKeyTimestamp:(i=h==null?void 0:h.mediaKeyTimestamp)!=null?i:void 0,paymentLinkMetadata:(h==null?void 0:h.psp)!=null?d("PaymentLink").getPaymentLinkMessageMetadata(h==null?void 0:h.psp):void 0});break;case d("WAWebMessageEditUtils").MsgEditType.CaptionEdit:g=babelHelpers["extends"]({},g,{caption:b.trim()});break;case d("WAWebMessageEditUtils").MsgEditType.EventEdit:case d("WAWebMessageEditUtils").MsgEditType.RichResponseEdit:break}return g}function t(a,b,c,d){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e){a.latestEditMsgKey&&(yield d("WAWebDBMessageDelete").removeMessagesFromHistory([a.latestEditMsgKey.toString()]));try{e.startSavedStage(),yield d("WAWebDBProcessMessage").storeMessages([b],c),e.postSavedStage()}catch(a){d("WALogger").ERROR(l()).verbose().devConsole(a).sendLogs("storeSentMessageEdit failed");throw a}e.startRenderedStage();yield d("WAWebProcessAddonsJob").processEditProtocolMsgsJob([b]);e.postRenderedStage()});return u.apply(this,arguments)}function v(a,b){return w.apply(this,arguments)}function w(){w=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=d("WAWebMsgGetters").getIsNewsletterMsg(a)?yield d("WAWebNewsletterSendMsgAction").sendNewsletterEditMsg(a,b):yield d("WAWebSendMsgRecordAction").sendMsgRecord(b),e=c.messageSendResult,f=c.t;c=c.count;d("WALogger").DEV(k()).devConsole({messageSendResult:e,t:f});if(e!==d("WAWebSendMsgResultAction").SendMsgResult.OK){d("WALogger").DEV(j()).devConsole({editProtocolMsg:b});return}p(a,b,f);yield q(a,c);a.updateAck(b.ack);a.isSendFailure=b.isSendFailure===!0||b.errorCode===d("WAWebErrorType").SendFailureErrorCode.EditWindowExpired;d("WALogger").DEV(i()).devConsole({msg:a})});return w.apply(this,arguments)}function x(a,b){return y.apply(this,arguments)}function y(){y=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){var e=new(d("WAWebMsgModel").Msg)(c),f;if(a.to.isGroup()){var g=a.to.toString(),h=(yield d("WAWebGroupMsgSendUtils").getParticipantRecord(g));f=(yield d("WAWebGroupMsgSendUtils").getGroupData(g,h,{type:"message",data:a}))}e.wamMessageSendReporter=new(d("WAWebMessageSendReporter").MessageSendReporter)(e,{originalMessage:a,groupData:f});e.wamMessageSendPerfReporter=new(d("WAWebMessageSendPerfReporter").MessageSendPerfReporter)({chatWid:e.to,mediaType:e.getWamMediaType(),messageType:e.getWamMessageType()});var i=e.wamMessageSendPerfReporter;yield d("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("sendMessageEdit",function(){var d=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){var d=b.msgData;b=b.chatId;yield t(d,c,b,i);yield v(a,e)});return function(a){return d.apply(this,arguments)}}(),{priority:d("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted({msgData:d("WAWebMsgDataFromModel").msgDataFromMsgModel(a),chatId:d("WAWebFrontendMsgGetters").getChat(a).id})});return y.apply(this,arguments)}g.resendLatestEdit=a;g.sendMessageEdit=e;g.createEditMsgData=s;g.addAndSendMessageEdit=x}),98); __d("WAWebContactBlockedErrorAction",["WACustomError"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(b,c){b=a.call(this,b)||this;b.contact=c;return b}return b}(d("WACustomError").customError("ContactBlocked"));g["default"]=a}),98); __d("WAWebOutgoingMessageTone",["WAWebNoop","WAWebUserPrefsNotifications","bx"],(function(a,b,c,d,e,f,g){var h=new window.Audio(c("bx").getURL(c("bx")("9562")));function a(){d("WAWebUserPrefsNotifications").getOutgoingMessageSound()&&h.play()["catch"](c("WAWebNoop"))}g.playOutgoingMessageTone=a}),98); __d("WAWebChatUtmCache",[],(function(a,b,c,d,e,f){a=function(){function a(){this.utmReadChatIds=new Set()}var b=a.prototype;b.deleteChatId=function(a){this.utmReadChatIds["delete"](a)};b.hasRead=function(a){return this.utmReadChatIds.has(a)};b.read=function(a){this.utmReadChatIds.add(a)};b.clearAll=function(){this.utmReadChatIds.clear()};return a}();b=new a();f["default"]=b}),66); __d("WAWebUpdateUtmAction",["WAWebBizGatingUtils","WAWebChatUtmCache","WAWebUtmBizPrefs"],(function(a,b,c,d,e,f,g){function a(a,b){if(!d("WAWebBizGatingUtils").isUtmTrackingEnabled())return;a=a.toString();d("WAWebUtmBizPrefs").persistUtmtoLocalStorage(a,b);c("WAWebChatUtmCache").deleteChatId(a)}function b(a){a=a.toString();d("WAWebUtmBizPrefs").removeUtmFromLocalStorage(a);c("WAWebChatUtmCache").read(a)}function e(a){if(!d("WAWebBizGatingUtils").isUtmTrackingEnabled())return null;a=a.toString();if(c("WAWebChatUtmCache").hasRead(a))return null;var b=d("WAWebUtmBizPrefs").getUtmFromLocalStorage(a);b==null&&c("WAWebChatUtmCache").read(a);return b}g.addUtmToChat=a;g.clearUtmAfterMessageSent=b;g.getUtmForChat=e}),98); __d("WAWebWebcMessageSendWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumMediaType","WAWebWamEnumMessageType"],(function(a,b,c,d,e,f,g){a=d("WAWebWamCodegenUtils").defineEvents({WebcMessageSend:[2072,{messageIsForward:[3,d("WAWebWamCodegenUtils").TYPES.BOOLEAN],messageMediaType:[2,d("WAWebWamEnumMediaType").MEDIA_TYPE],messageSendT:[4,d("WAWebWamCodegenUtils").TYPES.TIMER],messageType:[1,d("WAWebWamEnumMessageType").MESSAGE_TYPE]},[1,1,1],"regular"]},{WebcMessageSend:[]});g.WebcMessageSendWamEvent=a}),98); __d("WAWebSendMsgRecordAction",["Promise","WAErrors","WAFilteredCatch","WALogger","WANullthrows","WAWebABProps","WAWebAck","WAWebAddOnsUpdateSendStatesAction","WAWebAddonSendMsgData","WAWebBackendErrors","WAWebBlocklistCollection","WAWebBotGenTypingIndicatorMsg","WAWebCommonMsgSubtypeTypes","WAWebConstantsDeprecated","WAWebContactBlockedErrorAction","WAWebContactCollection","WAWebExternalCtxConfig","WAWebExternalEntryPointPrefs","WAWebFindChatAction","WAWebGroupMetadataCollection","WAWebHandleMsgError","WAWebMsgCollection","WAWebMsgGetters","WAWebMsgType","WAWebMsgUtilsBridge","WAWebNoop","WAWebOutgoingMessageTone","WAWebReactionsBEUtils","WAWebSendMsgMetricReporter","WAWebSendMsgRecordBridge","WAWebSendMsgResultAction","WAWebSendSpamChatAction","WAWebSingleEmojiDailyUtils","WAWebUpdateUnreadChatAction","WAWebUpdateUtmAction","WAWebUserPrefsMeUser","WAWebUtmBizUtils","WAWebWamEnumMessageSendResultType","WAWebWamMsgUtils","WAWebWebcMessageSendWamEvent","WAWebWid","asyncToGeneratorRuntime","gkx"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Got error ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Got error ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["model:msg:createRecord dropped msg: ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["Got error ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["model:msg:createRecord dropped msg: ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["Phone responded ",""]);n=function(){return a};return a}function a(a){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b,c=d("WAWebSendMsgMetricReporter").createMsgModelMetricReporter(a);c.sendReporter=(b=c.sendReporter)!=null?b:c.createSendReporter();b=a.id.remote;var e=(yield d("WAWebFindChatAction").findExistingChat(b,"sendMsgRecord"));if(e.contact.isEnterprise&&!d("WAWebMsgGetters").getIsGroupMsg(a)){b=d("WAWebUpdateUtmAction").getUtmForChat(b);b!=null&&d("WAWebUtmBizUtils").isUtmValid(e,b)&&(a.utm=b)}a.isNewMsg=!0;return q({type:"message",data:a},e,c)});return o.apply(this,arguments)}function e(a){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=d("WAWebSendMsgMetricReporter").createAddonMetricReporter(a),c=(yield d("WAWebFindChatAction").findExistingChat(a.id.remote,"sendMsgRecord"));return q({type:"addon",data:a},c,b)});return p.apply(this,arguments)}function q(a,b,c){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e,f){var g=a.data,o=c("WANullthrows")(g.to),p=g.id,q=p.remote;c("WAWebWid").isGroup(o)&&(yield c("WAWebGroupMetadataCollection").find(o));e.isTrusted()||d("WAWebSendSpamChatAction").sendNotSpam(e)["catch"](c("WAWebNoop"));var r=g.type===d("WAWebMsgType").MSG_TYPE.PROTOCOL&&["sender_revoke","admin_revoke"].includes(g.subtype),s=g.type===d("WAWebMsgType").MSG_TYPE.PROTOCOL&&g.subtype===d("WAWebCommonMsgSubtypeTypes").MsgSubtype.EphemeralSyncResponse,t=d("WAWebMsgGetters").getIsReaction(g)&&g.reactionText===d("WAWebReactionsBEUtils").REVOKED_REACTION_TEXT;if(!d("WAWebMsgGetters").getIsGroupMsg(g)&&!r&&!t&&d("WAWebBlocklistCollection").BlocklistCollection.get(o))return(h||(h=b("Promise"))).reject(new(c("WAWebContactBlockedErrorAction"))("Contact is blocked",d("WAWebContactCollection").ContactCollection.assertGet(o)));var u;r||(u=new(d("WAWebWebcMessageSendWamEvent").WebcMessageSendWamEvent)({messageType:d("WAWebWamMsgUtils").getWamMessageType(g),messageMediaType:d("WAWebWamMsgUtils").getWamMediaType(g),messageIsForward:Boolean(g.isForwarded)}));s||void d("WAWebUpdateUnreadChatAction").sendSeen(e);a.type!=="addon"&&g.type!==d("WAWebMsgType").MSG_TYPE.KEEP_IN_CHAT&&!s&&!r&&d("WAWebMsgCollection").MsgCollection.trigger(c("WAWebConstantsDeprecated").NEW_MSG_SENT);return(h||(h=b("Promise"))).resolve().then(function(){return a.type==="message"?d("WAWebSendMsgRecordBridge").sendMsgRecord(a.data,f):d("WAWebAddonSendMsgData").sendAddonProcess(a.data,f)}).then(function(){var f=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){var f=p.fromMe&&d("WAWebUserPrefsMeUser").isMePrimary(q)?d("WAWebAck").ACK.READ:d("WAWebAck").ACK.SENT;a.type==="message"&&(a.data.updateAck(f),d("WAWebAddOnsUpdateSendStatesAction").maybeUpdateAddOnAckForMsgAction(a.data,f));d("WAWebBotGenTypingIndicatorMsg").maybeGenBotTypingIndicatorMessage(e,g);u&&(u.markMessageSendT(),u.commit());!r&&d("WAWebABProps").getABPropConfigValue("single_emoji_logging_enabled")&&d("WAWebSingleEmojiDailyUtils").maybeIncrementSingleEmojiDailyStatsCount(g);g.utm!=null&&d("WAWebUpdateUtmAction").clearUtmAfterMessageSent(q);yield d("WAWebMsgUtilsBridge").logMessageSendForChatThreadLogging(g);[d("WAWebMsgType").MSG_TYPE.PROTOCOL,d("WAWebMsgType").MSG_TYPE.REACTION,d("WAWebMsgType").MSG_TYPE.KEEP_IN_CHAT].includes(g.type)||(e.lastReceivedKey=p);!c("gkx")("26258")&&!r&&!s&&d("WAWebOutgoingMessageTone").playOutgoingMessageTone();d("WAWebExternalCtxConfig").isCtxLoggingEnabled()&&d("WAWebExternalEntryPointPrefs").deleteExternalEntryPoint(q);return{messageSendResult:d("WAWebSendMsgResultAction").SendMsgResult.OK,t:b.t,count:b.count}});return function(a){return f.apply(this,arguments)}}())["catch"](d("WAFilteredCatch").filteredCatch(d("WAWebBackendErrors").ServerStatusCodeError,function(a){a.status!==408&&d("WALogger").ERROR(n(),a.status).sendLogs("send-not-200");(a=f.sendReporter)==null?void 0:a.postFailure({result:d("WAWebWamEnumMessageSendResultType").MESSAGE_SEND_RESULT_TYPE.ERROR_NETWORK,isTerminal:!1});f.sendReporter=null;return{messageSendResult:d("WAWebSendMsgResultAction").SendMsgResult.ERROR_NETWORK}}))["catch"](d("WAFilteredCatch").filteredCatch(d("WAErrors").BufferTooLargeError,function(){var a;(a=f.sendReporter)==null?void 0:a.postFailure({result:d("WAWebWamEnumMessageSendResultType").MESSAGE_SEND_RESULT_TYPE.ERROR_PAYLOAD_TOO_BIG,isTerminal:!0});f.sendReporter=null;return{messageSendResult:d("WAWebSendMsgResultAction").SendMsgResult.ERROR_UNKNOWN}}))["catch"](d("WAFilteredCatch").filteredCatch(d("WAWebHandleMsgError").MessageValidationError,function(){var a;(a=f.sendReporter)==null?void 0:a.postFailure({result:d("WAWebWamEnumMessageSendResultType").MESSAGE_SEND_RESULT_TYPE.ERROR_INVALID_PROTOBUF,isTerminal:!0});f.sendReporter=null;return{messageSendResult:d("WAWebSendMsgResultAction").SendMsgResult.ERROR_UNKNOWN}}))["catch"](d("WAFilteredCatch").filteredCatch(d("WAWebHandleMsgError").MessageSentAckError,function(a){d("WALogger").WARN(m(),g.id.toString()).devConsole(g.type);d("WALogger").ERROR(l(),String(a)).devConsole(a).sendLogs("send-msg-server-nack-error");(a=f.sendReporter)==null?void 0:a.postFailure({result:d("WAWebWamEnumMessageSendResultType").MESSAGE_SEND_RESULT_TYPE.ERROR_UNKNOWN,isTerminal:!0});f.sendReporter=null;return{messageSendResult:d("WAWebSendMsgResultAction").SendMsgResult.ERROR_UNKNOWN}}))["catch"](function(b){d("WALogger").WARN(k(),g.id.toString()).devConsole(g.type);a.type==="message"?d("WALogger").ERROR(j(),String(b)).devConsole(b).tags("messaging").sendLogs("send-msg-error"):d("WALogger").ERROR(i(),String(b)).tags("messaging","addons").sendLogs("send-addon-error: "+g.type);(b=f.sendReporter)==null?void 0:b.postFailure({result:d("WAWebWamEnumMessageSendResultType").MESSAGE_SEND_RESULT_TYPE.ERROR_UNKNOWN,isTerminal:!0});f.sendReporter=null;return{messageSendResult:d("WAWebSendMsgResultAction").SendMsgResult.ERROR_UNKNOWN}})});return r.apply(this,arguments)}g.sendMsgRecord=a;g.sendAddonRecord=e}),98); __d("WAWebUpdateMessageUIAction",["WALogger","WAWebBackendErrors","WAWebCommonMsgUtils","WAWebDBProcessMessage","WAWebHandleForMessageRange","WAWebHandleForMessageRangeEnums","WAWebHandleMsgTypes.flow","WAWebMsgCollection","WAWebStatusCollection","WAWebWid","asyncToGeneratorRuntime","gkx"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Msg: "," chat: "," Error: ",", message: ",", stack: ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Msg: "," chat: "," Error: ",", message: ",", stack: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Msg: "," chat: "," Error: PreviousMsgNotUpdatableError"]);j=function(){return a};return a}function a(a,b,c,d,e){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e,f,g){e===void 0&&(e=d("WAWebHandleMsgTypes.flow").MessageOverwriteOption.NO_OVERWRITE);f===void 0&&(f=!0);g===void 0&&(g=!1);e={add:"after",update:e!==d("WAWebHandleMsgTypes.flow").MessageOverwriteOption.NO_OVERWRITE,isHistory:!1};g=!g;g=(yield d("WAWebHandleForMessageRange").handleForActiveMessageRange(a,b,g));if(g.has(d("WAWebHandleForMessageRangeEnums").ActiveRangeHandlerAction.DropMessage))return;g=g.has(d("WAWebHandleForMessageRangeEnums").ActiveRangeHandlerAction.SkipUI);var k=d("WAWebMsgCollection").MsgCollection.get(b.id);k&&((d("WAWebCommonMsgUtils").isPlaceholderMsg(k.type)||d("WAWebCommonMsgUtils").isFutureproofMsg(k.type))&&!(d("WAWebCommonMsgUtils").isPlaceholderMsg(b.type)||d("WAWebCommonMsgUtils").isFutureproofMsg(b.type))||d("WAWebCommonMsgUtils").isRichResponseMsg(k.type)&&d("WAWebCommonMsgUtils").isSomewhatParsedRichResponseMsg(b)?e.update=!0:k.fromQuotedMsg?d("WAWebMsgCollection").MsgCollection.remove(k):g=!0);try{c("WAWebWid").isStatus(a)&&d("WAWebStatusCollection").StatusCollection.handleUpdate(b,null,!1),g||(yield d("WAWebMsgCollection").MsgCollection.processMultipleMessages(a,[babelHelpers["extends"]({},b,{recvFresh:!0,isNewMsg:!0})],e,"updateMessageUIAction",null,f))}catch(e){if(e instanceof d("WAWebBackendErrors").LogoutDrop)return;if(e instanceof d("WAWebDBProcessMessage").PreviousMsgNotUpdatableError){d("WALogger").WARN(j(),String(b.id),String(a));return}!c("gkx")("26258")?d("WALogger").WARN(i(),String(b.id),String(a),e.name,e.message,e.stack).tags("messaging").devConsole(e).sendLogs("msg_handler for MD: error storing/processing single message"):d("WALogger").WARN(h(),String(b.id),String(a),e.name,e.message,e.stack).tags("messaging").devConsole(e)}});return k.apply(this,arguments)}function e(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=d("WAWebMsgCollection").MsgCollection.get(a.id);a!=null&&a["delete"]()});return l.apply(this,arguments)}g.updateUI=a;g.removePlaceholder=e}),98); __d("WAWebHandleAddChats",["WALogger","WALongInt","WAWebBackendApi","WAWebChatConstants","WAWebCollectionConstants","WAWebConnModel","WAWebCurrentUser","WAWebMobilePlatforms","WAWebSchemaChat","isEmptyIterable"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleAddChats: bulkCreateOrMerge failed: ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleAddChats chat info: ",", ",""]);i=function(){return a};return a}function j(a){return{ephemeralSettingTimestamp:d("WALongInt").maybeNumberOrThrowIfTooLarge(a.ephemeralSettingTimestamp),tcTokenSenderTimestamp:d("WALongInt").maybeNumberOrThrowIfTooLarge(a.tcTokenSenderTimestamp),tcTokenTimestamp:d("WALongInt").maybeNumberOrThrowIfTooLarge(a.tcTokenTimestamp)}}function a(a){return d("WAWebSchemaChat").getChatTable().bulkCreateOrMerge(a.map(function(a){a.pendingInitialLoading;var b=a.disappearingModeInitiator,c=a.disappearingModeTrigger,e=a.accountLid,f=babelHelpers.objectWithoutPropertiesLoose(a,["pendingInitialLoading","disappearingModeInitiator","disappearingModeTrigger","accountLid"]);f=babelHelpers["extends"]({},f,{id:a.id.toString(),muteExpiration:0,isAutoMuted:!1},j(f),{endOfHistoryTransferType:a.endOfHistoryTransferType});e!=null&&(f.accountLid=e.toString());b!=null&&(f.disappearingModeInitiator=b);c!=null&&(f.disappearingModeTrigger=c);d("WAWebCurrentUser").isEmployee()&&d("WALogger").LOG(i(),f.id,f.accountLid);return f}))["catch"](function(a){d("WALogger").LOG(h(),a)}).then(function(){return d("WAWebBackendApi").frontendSendAndReceive("chatCollectionAdd",{things:a.map(function(a){var b;return babelHelpers["extends"]({},a,{accountLid:(b=a.accountLid)!=null?b:void 0},j(a),{endOfHistoryTransferType:d("WAWebChatConstants").ConversationEndOfHistoryTransferModelPropType.cast(a.endOfHistoryTransferType)})}),options:{merge:!0}})}).then(function(){(d("WAWebConnModel").Conn.platform===d("WAWebMobilePlatforms").PLATFORMS.IPHONE||d("WAWebConnModel").Conn.platform===d("WAWebMobilePlatforms").PLATFORMS.SMBI)&&(c("isEmptyIterable")(a)?d("WAWebBackendApi").frontendFireAndForget("msgCollectionTrigger",{name:d("WAWebCollectionConstants").COLLECTION_HAS_SYNCED}):self.setTimeout(function(){d("WAWebBackendApi").frontendFireAndForget("msgCollectionTrigger",{name:d("WAWebCollectionConstants").COLLECTION_HAS_SYNCED})},2500)),d("WAWebBackendApi").frontendFireAndForget("chatCollectionTrigger",{name:d("WAWebCollectionConstants").COLLECTION_HAS_SYNCED,args:{count:a.length}})})}g["default"]=a}),98); __d("WAWebHistoryMsgHandlerAction",["Promise","WAAckLevel","WAFilteredCatch","WAJids","WALogger","WALongInt","WANullthrows","WATimeUtils","WAWebABProps","WAWebAddonProcessMsgs","WAWebAddonProcessMsgsUtils","WAWebAdvHostedAccountTypeSystemMsg","WAWebApiContact","WAWebApiFilterAndReplaceMessages","WAWebApiHistorySyncNotification","WAWebBackendApi","WAWebBackendErrors","WAWebBackendJobs.flow","WAWebBizCoexGatingUtils","WAWebBizCoexUtils","WAWebBotTypes","WAWebChatConstants","WAWebCheckUpdateOrphanReactions","WAWebContactCollection","WAWebCryptoCurve25519","WAWebCurrentUser","WAWebDBCreateLidPnMappings","WAWebDBProcessInitialHistorySyncMessage","WAWebDBReportingTokenUtils","WAWebEphemeralityTypes","WAWebEphemeralityUtils","WAWebHandleAddChats","WAWebHandleMsgTypes.flow","WAWebHandleSingleMsg","WAWebHistorySyncNotificationUtils","WAWebHistorySyncStickers","WAWebLidAwareContactsDB","WAWebLidMigrationUtils","WAWebLimitSharingProtoUtils","WAWebMessageAssociationGatingUtils","WAWebMessageReceiptBatcher","WAWebMessagingGatingUtils","WAWebMobilePlatforms","WAWebMsgProcessingApiUtils","WAWebNoop","WAWebProcessMessageAssociationMessages","WAWebProtobufsAdv.pb","WAWebProtobufsE2E.pb","WAWebProtobufsHistorySync.pb","WAWebReportingTokenUtils","WAWebSignalCommonUtils","WAWebSignalProtocolStore","WAWebSyncBootstrap","WAWebSyncdOrphan","WAWebUserPrefsHistorySync","WAWebUserPrefsIndexedDBStorage","WAWebUserPrefsMeUser","WAWebUserPrefsModelStorage","WAWebUserPrefsMultiDevice","WAWebUsernameGatingUtils","WAWebUsernameTypes","WAWebVoipActionWriteCallLogMessage","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime","isStringNullOrEmpty"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] storing initial pushname complete with "," records"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] start processing initial pushname"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] storing call log records complete, ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] start processing call log records"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] processing history non blocking data"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] storing Status complete, ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] start processing status"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] found duplicated conversation id during initial sync"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] history_sync_notification_handler: saveGroupMetadataForLeftGroup failed"]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] handleInitialSyncMsgs: invalid lidOriginType received."]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["handleInitialSyncMsgs: incoming chat info: ",", ",", ",""]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Dropping memu onboarding message"]);t=function(){return a};return a}function u(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Dropping request welcome message"]);u=function(){return a};return a}function v(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] processing conversation "," with "," messages"]);v=function(){return a};return a}function w(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] set history initial sync boundary with length ",""]);w=function(){return a};return a}function x(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] storing initial sync messages complete, ",""]);x=function(){return a};return a}function y(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] handleInitialSyncMsgs: there are Identities with missing LIDs: ",""]);y=function(){return a};return a}function z(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] handleInitialSyncMsgs: can't save the identity key."],["[history sync] handleInitialSyncMsgs: can\\'t save the identity key."]);z=function(){return a};return a}function A(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] handleInitialSyncMsgs: can't save the identity key."],["[history sync] handleInitialSyncMsgs: can\\'t save the identity key."]);A=function(){return a};return a}function B(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] saving "," LIDxPN mappings obtained from conversations"]);B=function(){return a};return a}function C(){var a=babelHelpers.taggedTemplateLiteralLoose(["first lid mappings for initial sync. count: ",". ","..."]);C=function(){return a};return a}function D(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] starts hanlding initial sync msgs"]);D=function(){return a};return a}function E(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] handleInitialSyncMsgs: Migrated account not sending accountLid for a PN chat in history sync"]);E=function(){return a};return a}function F(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] handleInitialSyncMsgs: Found duplicated accountLid during initial sync"]);F=function(){return a};return a}function G(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Error: ",", message: ",", stack: ",""]);G=function(){return a};return a}function H(){var a=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Failed update for orphan reactions"]);H=function(){return a};return a}function a(a,b,c,d,e,f,g,h){return I.apply(this,arguments)}function I(){I=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e,f,g,i,j,k,l){d("WALogger").LOG(D());var m=[],n={},o={},E=new Map(),F={},G=[],H=0,I=[],J=d("WAWebHistorySyncNotificationUtils").getLidMappingAsStringSet(l);d("WAWebCurrentUser").isEmployee()&&d("WALogger").LOG(C(),J==null?void 0:J.size,d("WAWebHistorySyncNotificationUtils").getLidsForLogging(J)).verbose();var K=new Map(),L=d("WAWebBizCoexGatingUtils").smbHostedLazySystemMsgInsertInHistorySyncEnabled()&&(yield d("WAWebUserPrefsMultiDevice").getIsHostedMeAccount())===!0;l=function(a){var b;d("WAWebCurrentUser").isEmployee()&&d("WALogger").LOG(v(),a.id,a.messages.length);var g=d("WAWebWidFactory").createWid(a.id);if(g.isNewsletter())return"continue";if(c("WAWebWid").isUserWid(g))if(c("WAWebWid").isUserLid(g)){var h=a.pnJid;h!=null&&m.push({lid:g,pn:d("WAWebWidFactory").createUserWid(h)});h=a.displayName;var i=a.shareOwnPn,j=a.username;a.username!=null&&d("WAWebUsernameGatingUtils").usernameDisplayedEnabled()&&k.push({userId:d("WAWebWidFactory").toUserWid(g),username:j});if(h!=null||i!=null){j={};h!=null&&(j.displayNameLID=h);i!=null&&(j.shareOwnPn=i);f.push({lid:d("WAWebWidFactory").toUserWid(g),data:j})}}else if(a.lidJid!=null){h=d("WAWebWidFactory").createUserWid(a.lidJid);m.push({lid:d("WAWebWidFactory").toUserLidOrThrow(h),pn:d("WAWebWidFactory").toUserWid(g)})}var l=[];H+=a.messages.length;var w=[],x=new Set(),y=[];a.messages.length===0&&(n[a.id]=-1);c("isStringNullOrEmpty")(a.pHash)||(F[a.id]=a.pHash);i=void 0;a.messages.forEach(function(b,c){if(c===a.messages.length-1){var f=d("WALongInt").maybeNumberOrThrowIfTooLarge(b.msgOrderId);f!=null&&(n[a.id]=f)}f=(b==null?void 0:(f=b.message)==null?void 0:(f=f.message)==null?void 0:(f=f.protocolMessage)==null?void 0:f.type)===d("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.REQUEST_WELCOME_MESSAGE;if(f){d("WALogger").LOG(u());return}f=(b==null?void 0:(f=b.message)==null?void 0:(f=f.message)==null?void 0:(f=f.protocolMessage)==null?void 0:f.type)===d("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.BOT_MEMU_ONBOARDING_MESSAGE;if(f){d("WALogger").LOG(t());return}if(d("WAWebMobilePlatforms").isSMB()&&d("WAWebBizCoexGatingUtils").smbHostedLazySystemMsgInsertInHistorySyncEnabled()&&c===0&&g.isUser()&&a.systemMessageToInsert!=null)switch(a.systemMessageToInsert){case d("WAWebProtobufsHistorySync.pb").PrivacySystemMessage.E2EE_MSG:if(L)break;f=d("WAWebAdvHostedAccountTypeSystemMsg").genAdvAccountTypeChangeNotificationMsg(g,d("WAWebUserPrefsMeUser").getMeUser(),d("WAWebProtobufsAdv.pb").ADVEncryptionType.E2EE);w.push(f);d("WAWebBizCoexUtils").sendWamCoexPrivacySysMsgHistorySyncInsert(f);break;case d("WAWebProtobufsHistorySync.pb").PrivacySystemMessage.NE2EE_SELF:if(!L)break;c=d("WAWebAdvHostedAccountTypeSystemMsg").genAdvAccountTypeSelfTransitionToCoexNotificationMsg(g,d("WAWebUserPrefsMeUser").getMeUser());w.push(c);d("WAWebBizCoexUtils").sendWamCoexPrivacySysMsgHistorySyncInsert(c);break;case d("WAWebProtobufsHistorySync.pb").PrivacySystemMessage.NE2EE_OTHER:f=d("WAWebAdvHostedAccountTypeSystemMsg").genAdvAccountTypeChangeNotificationMsg(g,d("WAWebUserPrefsMeUser").getMeUser(),d("WAWebProtobufsAdv.pb").ADVEncryptionType.HOSTED);w.push(f);d("WAWebBizCoexUtils").sendWamCoexPrivacySysMsgHistorySyncInsert(f)}c=d("WAWebHistorySyncNotificationUtils").parseWebMsgInfoAndReturnNullOnFailure(g,b.message,e,J,K);f=((f=b.message)==null?void 0:(f=f.message)==null?void 0:(f=f.commentMessage)==null?void 0:f.targetMessageKey)==null;var h=(c==null?void 0:c.associationType)!=null;f&&(c!=null&&x.has(c.id.toString())&&d("WAWebMessageAssociationGatingUtils").isMessageAssociationInfraEnabled()&&x["delete"](c==null?void 0:c.id.toString()),w.push(c));if(c!=null&&h&&d("WAWebMessageAssociationGatingUtils").isMessageAssociationInfraEnabled()){f=c.parentMsgKey.toString();x.add(f);y.push(c)}l=l.concat(d("WAWebAddonProcessMsgsUtils").parseHistorySyncMsg({webMsgInfo:b.message,parsedWebMsgInfo:c,isFromCag:(h=a.isDefaultSubgroup)!=null?h:!1}));(c==null?void 0:c.subtype)==="biz_bot_1p_disclosure"&&(i=d("WAWebBotTypes").BizBotType.BIZ_1P);(c==null?void 0:c.subtype)==="biz_bot_3p_disclosure"&&(i=d("WAWebBotTypes").BizBotType.BIZ_3P)});j=void 0;if(x.size>0&&d("WAWebMessageAssociationGatingUtils").isMessageAssociationInfraEnabled()){h=d("WAWebProcessMessageAssociationMessages").classifyAssociatedMsgsFromHistorySyncUsingMissingParentsCache(y,x);(h==null?void 0:h.validAssociatedMsgs)&&(j=d("WAWebApiFilterAndReplaceMessages").validateMsgFn(h==null?void 0:h.validAssociatedMsgs))}w=d("WAWebApiFilterAndReplaceMessages").filterAndReplaceMessagesInitialHistorySync(w,j);w=w.reverse();h=a.contactPrimaryIdentityKey;if(h&&c("WAWebWid").isUser(g)){j=d("WAWebSignalCommonUtils").bufferToStr(d("WAWebCryptoCurve25519").toSignalCurvePubKey(h));I.push({userId:d("WAWebWidFactory").toUserWid(g),identityKey:j})}h=void 0;j=void 0;var z=void 0;if(((b=a.disappearingMode)==null?void 0:b.initiator)!=null)switch(a.disappearingMode.initiator){case d("WAWebProtobufsE2E.pb").DisappearingMode$Initiator.CHANGED_IN_CHAT:h=d("WAWebEphemeralityTypes").DisappearingModeInitiator.ChangedInChat;j=d("WAWebEphemeralityTypes").DisappearingModeTrigger.ChatSettings;break;case d("WAWebProtobufsE2E.pb").DisappearingMode$Initiator.INITIATED_BY_ME:h=d("WAWebEphemeralityTypes").DisappearingModeInitiator.InitiatedByMe;j=d("WAWebEphemeralityTypes").DisappearingModeTrigger.AccountSettings;z=!0;break;case d("WAWebProtobufsE2E.pb").DisappearingMode$Initiator.INITIATED_BY_OTHER:case d("WAWebProtobufsE2E.pb").DisappearingMode$Initiator.BIZ_UPGRADE_FB_HOSTING:h=d("WAWebEphemeralityTypes").DisappearingModeInitiator.InitiatedByOther;j=d("WAWebEphemeralityTypes").DisappearingModeTrigger.AccountSettings;z=!1;break}if(d("WAWebABProps").getABPropConfigValue("dm_initiator_trigger_daily_logs")){if(((b=a.disappearingMode)==null?void 0:b.trigger)!=null){b=d("WAWebEphemeralityUtils").getDisappearingModeTriggerFromProtobuf(a.disappearingMode.trigger);b!=null&&(j=b)}((b=a.disappearingMode)==null?void 0:b.initiatedByMe)!=null&&(z=a.disappearingMode.initiatedByMe)}b=a.tcToken!=null&&a.tcTokenTimestamp!=null;var A=Q(g,a,E);if(A.result==="skip-chat")return"continue";if(d("WAWebCurrentUser").isEmployee()){var B;d("WALogger").LOG(s(),g,(B=A.accountLid)!=null?B:"n/a",g.isRegularUser()?d("WAWebApiContact").getAlternateUserWid(d("WAWebWidFactory").toUserWid(g)):"n/a")}B=A.accountLid;B={t:d("WALongInt").maybeNumberOrThrowIfTooLarge((A=a.conversationTimestamp)!=null?A:a.lastMsgTimestamp),accountLid:B,id:g,unreadCount:a.unreadCount,ephemeralDuration:a.ephemeralExpiration,ephemeralSettingTimestamp:a.ephemeralSettingTimestamp,disappearingModeInitiator:h,disappearingModeTrigger:j,disappearingModeInitiatedByMe:z,endOfHistoryTransferType:(A=a.endOfHistoryTransferType)!=null?A:d("WAWebChatConstants").ConversationEndOfHistoryTransferModelPropType.INCOMPLETE,name:a.name,notSpam:a.notSpam,pendingInitialLoading:!1,unreadMentionCount:a.unreadMentionCount,tcToken:b?a.tcToken:null,tcTokenTimestamp:b?a.tcTokenTimestamp:null,tcTokenSenderTimestamp:a.tcTokenSenderTimestamp,isDeprecated:a.pnhDuplicateLidThread,bizBotSystemMsgType:i,isLocked:a.locked,limitSharing:d("WAWebLimitSharingProtoUtils").getLimitSharingFromProtocolHistorySyncConversation(a)};if(g.isLid()){h=a.lidOriginType;if(h!=null){j=d("WAWebUsernameTypes").LidOriginType.cast(h);j!==d("WAWebUsernameTypes").LidOriginType.PNH_CTWA&&j!==d("WAWebUsernameTypes").LidOriginType.GENERAL&&d("WALogger").ERROR(r()).sendLogs("handleInitialSyncMsgs: invalid lidOriginType received: "+h);B.lidOriginType=j}else B.lidOriginType=d("WAWebUsernameTypes").LidOriginType.GENERAL}a.archived!=null&&(B.archive=a.archived);try{d("WAWebHistorySyncNotificationUtils").saveGroupMetadataForLeftGroup(a,B.id)}catch(a){d("WALogger").WARN(q()).tags("history-sync").devConsole(a)}Object.prototype.hasOwnProperty.call(o,a.id)?d("WALogger").LOG(p()):G.push(B);o[a.id]={chatInfo:B,msgs:w,unifiedAddons:l}};for(var M of a.conversations){var N=l(M);if(N==="continue")continue}m.length>0&&(d("WALogger").LOG(B(),m.length),yield d("WAWebDBCreateLidPnMappings").createLidPnMappings({mappings:m,flushImmediately:!0,identityChangeHandlingEnabled:!1,learningSource:"other"}));g.mdBootstrapMessagesCount=H;g.mdBootstrapChatsCount=a.conversations.length;d("WAWebHistorySyncNotificationUtils").commitHistoryDownloadedMetric(g,e.historySyncStepStartedTs,!0,j);c("WAWebSyncBootstrap").markInitialHistorySyncCountDebugStats(H,G.length);N=function(){return c("WAWebHandleAddChats")(G)||(h||(h=b("Promise"))).resolve()};var O=0,R=[];I.forEach(function(a){var b=a.userId;a=a.identityKey;!c("WAWebWid").isLid(b)&&d("WAWebApiContact").getCurrentLid(b)==null&&c("WAWebWid").isRegularUser(b)&&O++;try{var e=d("WAWebSignalCommonUtils").createSignalAddressForIdentityTable(b).toString();b.equals(d("WAWebUserPrefsMeUser").getMeUser())?d("WAWebHistorySyncNotificationUtils").checkSelfHistorySyncIdentity(e,a)["catch"](function(){d("WALogger").ERROR(A()).sendLogs("failed-self-identity-check-from-history-sync")}):R.push({identifier:e,identityKey:a})}catch(a){d("WALogger").ERROR(z())}});yield d("WAWebSignalProtocolStore").getPersistSignalProtocolStore().bulkCreateIdentity(R);O>0&&d("WALogger").ERROR(y(),O).sendLogs("handleInitialSyncMsgs: there are Identities with missing LIDs",{sampling:.01});yield N();yield P(o);yield d("WAWebApiHistorySyncNotification").updateCurrentlyProcessed(e.msgKey,e.syncType,e.chunkOrder);d("WAWebHistorySyncNotificationUtils").commitHistoryDataAppliedMetric(i,e.historySyncStepStartedTs,!0,!0);d("WALogger").LOG(x(),d("WAWebHistorySyncNotificationUtils").getHistorySyncLogDetailsString(e,H,G.length));d("WALogger").LOG(w(),Object.keys(n).length);yield (h||(h=b("Promise"))).all([d("WAWebHistorySyncNotificationUtils").handleChatThreadLoggingMetadata(a),d("WAWebUserPrefsHistorySync").setHistoryInitialSyncBoundary(n),a.companionMetaNonce!=null?d("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.set("WAWebCompanionMetaNonce",a.companionMetaNonce):null]);d("WAWebUserPrefsModelStorage").setInitialGroupPhash(F);d("WAWebHistorySyncNotificationUtils").reportMissingMapping(K)});return I.apply(this,arguments)}function e(a,b,c,d,e){return J.apply(this,arguments)}function J(){J=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e,f,g,i){d("WALogger").LOG(o());f.mdBootstrapMessagesCount=a.statusV3Messages.length;d("WAWebHistorySyncNotificationUtils").commitHistoryDownloadedMetric(f,e.historySyncStepStartedTs,!0,i);a.statusV3Messages.sort(function(a,b){a=a.messageTimestamp;b=b.messageTimestamp;return d("WATimeUtils").castToUnixTime(parseInt(a,10))-d("WATimeUtils").castToUnixTime(parseInt(b,10))});var j=[];yield (h||(h=b("Promise"))).all(a.statusV3Messages.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=null,f=[];a.key.fromMe===!0?(e=d("WAWebUserPrefsMeUser").getMeUser(),f=a.userReceipt.filter(function(a){return a.readTimestamp!=null&&a.readTimestamp!==0})):e=d("WAWebWidFactory").createWid(c("WANullthrows")(a.participant));e={type:d("WAWebHandleMsgTypes.flow").MESSAGE_TYPE.OTHER_STATUS,externalId:c("WANullthrows")(a.key.id),ts:d("WATimeUtils").castToUnixTime(parseInt(a.messageTimestamp,10)),edit:-1,isHsm:!1,count:null,chat:d("WAWebWidFactory").createWid(d("WAJids").STATUS_JID),author:c("WANullthrows")(e),pushname:null,isDirect:!1};var g=d("WAWebBackendJobs.flow").CiphertextType.Skmsg;e=(yield d("WAWebMsgProcessingApiUtils").parseMessage({info:e,ciphertextType:g,msgProtobuf:c("WANullthrows")(a.message),hsmInfo:null}));g=e.renderableMsgs&&e.renderableMsgs;if(!g||g.length!==1)return(h||(h=b("Promise"))).resolve();var i=g[0];if(a.participant==="0@s.whatsapp.net"&&(!d("WAWebABProps").getABPropConfigValue("web_status_psa_history_sync")||i.staticUrl==null))return(h||(h=b("Promise"))).resolve();e=a.ignore===!0;e&&(i=babelHelpers["extends"]({},i,{invis:!0,ack:d("WAAckLevel").ACK.READ}));yield d("WAWebHandleSingleMsg").handleSingleMsg(i.id.remote,i,"historyStatusMessages",d("WAWebHandleMsgTypes.flow").MessageOverwriteOption.NO_OVERWRITE);f.forEach(function(a){var b;b=d("WALongInt").numberOrThrowIfTooLarge((b=a.readTimestamp)!=null?b:0);a=d("WAWebWidFactory").createWid(a.userJid);void d("WAWebMessageReceiptBatcher").receiptBatcher.acceptOtherReceipt({ts:b,ack:d("WAAckLevel").ACK.READ,receiverId:a,msgKeys:[i.id.toString()]})});if(d("WAWebMessagingGatingUtils").isReportingTagSyncingEnabled()&&((g=a.reportingTokenInfo)==null?void 0:g.reportingTag)!=null){i=babelHelpers["extends"]({},i,{reportingTokenInfo:{reportingTag:new Uint8Array((e=a.reportingTokenInfo)==null?void 0:e.reportingTag),version:d("WAWebReportingTokenUtils").REPORTING_TOKEN_VERSION.HISTORY_SYNC}})}j.push(i);return!0});return function(b){return a.apply(this,arguments)}}()));yield d("WAWebApiHistorySyncNotification").updateCurrentlyProcessed(e.msgKey,e.syncType,e.chunkOrder);d("WAWebHistorySyncNotificationUtils").commitHistoryDataAppliedMetric(g,e.historySyncStepStartedTs,!0);d("WALogger").LOG(n(),d("WAWebHistorySyncNotificationUtils").getHistorySyncLogDetailsString(e,a.statusV3Messages.length));void d("WAWebDBReportingTokenUtils").handleHistorySyncedReportingInfo(j)});return J.apply(this,arguments)}function f(a,b,c,d,e){return K.apply(this,arguments)}function K(){K=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e,f){d("WALogger").LOG(m()),d("WAWebHistorySyncNotificationUtils").commitHistoryDownloadedMetric(c,b.historySyncStepStartedTs,!0,f),a.pastParticipants!=null&&a.pastParticipants.length>0&&(yield d("WAWebHistorySyncNotificationUtils").processPastParticipants(a,b)),a.callLogRecords!=null&&a.callLogRecords.length>0&&(yield L(a,b)),d("WAWebHistorySyncStickers").processRecentStickers(a,b),d("WAWebHistorySyncNotificationUtils").commitHistoryDataAppliedMetric(e,b.historySyncStepStartedTs,!0)});return K.apply(this,arguments)}function L(a,b){return M.apply(this,arguments)}function M(){M=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){d("WALogger").LOG(l()),a.callLogRecords.sort(function(a,b){a=a.startTime;b=b.startTime;return d("WATimeUtils").castToUnixTime(parseInt(a,10))-d("WATimeUtils").castToUnixTime(parseInt(b,10))}),yield (h||(h=b("Promise"))).all(a.callLogRecords.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield d("WAWebVoipActionWriteCallLogMessage").generateCallLogFromCallSyncRecord({callLogRecord:a,fromHistorySync:!0})});return function(b){return a.apply(this,arguments)}}())),d("WALogger").LOG(k(),d("WAWebHistorySyncNotificationUtils").getHistorySyncLogDetailsString(c,a.callLogRecords.length))});return M.apply(this,arguments)}function N(a,b,c,d,e){return O.apply(this,arguments)}function O(){O=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e,f,g){d("WALogger").LOG(j());d("WAWebHistorySyncNotificationUtils").commitHistoryDownloadedMetric(e,b.historySyncStepStartedTs,!0,g);e=a.pushnames.map(function(a){return{id:a.id||"",pushname:a.pushname||""}});yield c("WAWebLidAwareContactsDB").bulkCreateOrMerge(e);yield d("WAWebApiHistorySyncNotification").updateCurrentlyProcessed(b.msgKey,b.syncType,b.chunkOrder);var h=[];a.pushnames.forEach(function(a){var b=d("WAWebWidFactory").createWid(a.id||""),c=d("WAWebContactCollection").ContactCollection.get(b);h.push({id:b,pushname:a.pushname||"",type:(c==null?void 0:c.type)||"out",name:c==null?void 0:c.name});if(!b.isLid()){b=d("WAWebApiContact").getCurrentLid(d("WAWebWidFactory").toUserWid(b));b!=null&&h.push({id:b,pushname:a.pushname||"",type:(c==null?void 0:c.type)||"out",name:c==null?void 0:c.name})}});d("WAWebContactCollection").ContactCollection.add(h,{merge:!0});d("WAWebHistorySyncNotificationUtils").commitHistoryDataAppliedMetric(f,b.historySyncStepStartedTs,!0);d("WALogger").LOG(i(),a.pushnames.length)});return O.apply(this,arguments)}function P(a){var e={add:"last",isHistory:!0},f=Object.keys(a).map(function(b){return d("WAWebBackendApi").frontendSendAndReceive("processMultipleMessages",{chatId:d("WAWebWidFactory").createWid(b),msgObjs:a[b].msgs,meta:e,processMessagesOrigin:"historyMsgHandlerAction",chatMsgsCollection:null})});return(h||(h=b("Promise"))).all([].concat(f,[d("WAWebDBProcessInitialHistorySyncMessage").storeInitialSyncMessages(a)])).then(function(){var b;b=(b=Array.prototype).concat.apply(b,Object.keys(a).map(function(b){return a[b].msgs.map(function(a){return a.id.toString()})}));d("WAWebCheckUpdateOrphanReactions").checkUpdateForOrphanReactions(b)["catch"](function(){d("WALogger").ERROR(H()).sendLogs("failed-update-for-orphan-reactions")});return d("WAWebSyncdOrphan").checkOrphanMutations(b,Object.keys(a))}).then(function(){var c;return(h||(h=b("Promise"))).all((c=Array.prototype).concat.apply(c,Object.keys(a).map(function(b){return a[b].unifiedAddons}))).then(function(a){var b;return d("WAWebAddonProcessMsgs").processHistoryMsgs((b=[]).concat.apply(b,a))})})["catch"](d("WAFilteredCatch").filteredCatch(d("WAWebBackendErrors").LogoutDrop,c("WAWebNoop")))["catch"](function(a){d("WALogger").ERROR(G(),a.name,a.message,a.stack).devConsole(a).sendLogs("msg_handler for MD: error storing/processing multiple messages")})}function Q(a,b,e){if(!d("WAWebLidMigrationUtils").shouldHaveAccountLid(a))return{result:"not-needed"};if(b.accountLid!=null){b=d("WAWebWidFactory").toUserLidOrThrow(d("WAWebWidFactory").createUserWid(b.accountLid));if(e.has(b)){d("WALogger").ERROR(F()).devConsole("duplicated accountLid: "+b.toString()+", existingChatId: "+c("WANullthrows")(e.get(b)).toString()+", new chatId: "+a.toString()).sendLogs("duplicated-account-lid-in-history-sync");return{result:"skip-chat"}}e.set(b,a);return{result:"extracted",accountLid:b}}if(c("WAWebWid").isUserLid(a))return{result:"extracted",accountLid:a};d("WALogger").ERROR(E()).devConsole(a.toString()).sendLogs("missing-account-lid-in-history-sync");return{result:"skip-chat"}}g.handleInitialSyncMsgs=a;g.handleStatusMessages=e;g.handleNonBlockingData=f;g.handlePushName=N}),98); __d("WAWebAddAndReorderMsgsActionsUtils",["WALogger","WAWebMsgModelUtils"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["models:Msg:reorder trying to merge CMC of orphaned message ",""]);h=function(){return a};return a}function a(a,b,c,e,f,g,h,j){a=i(a,b,c,e,g);d("WAWebMsgModelUtils").addRecordsToChat(a.msgs,e,f,a.collection,h,j)}function i(a,b,c,e,f){var g={},i={},j,k,l,m=c.length,n=f;if(m===0)return{msgs:b,collection:n};for(j=0;j<m;j++)k=c[j],i[k.id]=k;m=b.length;for(j=0;j<m;j++){k=b[j];if(!k)continue;g[k.id]=k}var o=[];m=a.length;for(j=0;j<m;j++){k=a[j];if(!k)continue;l=g[k.id];l&&o.push(l);l=i[k.id];if(l)if(l.recvFresh)o.push(l),e.removeMsg(l),l.unset("recvFresh");else{c=e.getAllCMCs();b=c.find(function(a){return a.get(l.id)});f&&b===f||(b?(b.forEach(function(a){o.push(a),delete i[a.id]}),b===e.msgs?(e.replaceMsgsCollection(f),n=e.msgs):(e.notifyMsgCollectionMerge(f,b,f),e.removeMsgsCollection(b))):(d("WALogger").WARN(h(),k.id).devConsole(k),o.push(i[k.id])))}}return{msgs:o,collection:n}}g["default"]=a}),98); __d("WAWebButtonModel",["WAWebBaseModel"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.displayText=d("WAWebBaseModel").prop(),c.selected=d("WAWebBaseModel").session(!1),b)||babelHelpers.assertThisInitialized(c)}return b}(d("WAWebBaseModel").BaseModel);a.Proxy="replyButton";b=d("WAWebBaseModel").defineModel(a);g["default"]=b}),98); __d("WAWebTemplateButtonModel",["WAWebBaseModel"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.displayText=d("WAWebBaseModel").prop(),c.subtype=d("WAWebBaseModel").prop(),c.url=d("WAWebBaseModel").prop(),c.phoneNumber=d("WAWebBaseModel").prop(),c.selectionId=d("WAWebBaseModel").prop(),c.selected=d("WAWebBaseModel").session(!1),b)||babelHelpers.assertThisInitialized(c)}return b}(d("WAWebBaseModel").BaseModel);a.Proxy="templateButton";b=d("WAWebBaseModel").defineModel(a);g["default"]=b}),98); __d("WAWebGetMsgUpdatesActionsUtils",["Promise","WALogger","WANullthrows","WATypeUtils","WAWebAck","WAWebButtonCollection","WAWebButtonModel","WAWebChatCollection","WAWebDBGroupParticipant","WAWebEphemeralSyncResponse","WAWebErrorType","WAWebFrontendMsgGetters","WAWebGroupSystemMsg","WAWebGroupType","WAWebHandleSingleMsg","WAWebInvalidateEventsAction","WAWebInvisiblePlaceholderViewModeProcessor","WAWebLidMigrationUtils","WAWebMessageAssociationUIUtils","WAWebMsgCollection","WAWebMsgGetters","WAWebMsgKey","WAWebMsgModel","WAWebMsgModelUtils","WAWebMsgType","WAWebNewsletterCollection","WAWebPaymentRequestMsgAction","WAWebPollsInvalidateChatPollMsgsAction","WAWebRevokeMsgAction","WAWebTemplateButtonCollection","WAWebTemplateButtonModel","WAWebViewMode.flow","WAWebWid","asyncToGeneratorRuntime","gkx","lodash"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["processLiveMessage should not be called with history message id: ",", type: ",", subType: ",", isNewMsg: ",", recvFresh: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["getMsgUpdates: el.id is not a MsgKey"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["getMsgUpdates: el.id is not a MsgKey: "," of "," messages"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["ephemeralOutOfSync msgId="," chatId=",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["model:Msg:handle:processMM load search as history ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["model:Msg:handle:processMM:","",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["unknown protocolMessage ",""]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["getMsgUpdates: sender revoke: sender mismatch: "," <> ",""]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["getMsgUpdates: sender revoked ",""]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["getMsgUpdates: bot invoker revoked bot's response: ",""]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["getMsgUpdates: failed to mark group participant as stale"]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["getMsgUpdates: admin revoked ",""]);t=function(){return a};return a}function u(){var a=babelHelpers.taggedTemplateLiteralLoose(["getMsgUpdates: admin revoke came for the different group than the original message was in"]);u=function(){return a};return a}function v(){var a=babelHelpers.taggedTemplateLiteralLoose(["getMsgUpdates: "," has not been revoked"]);v=function(){return a};return a}function w(){var a=babelHelpers.taggedTemplateLiteralLoose(["getMsgUpdates: admin revoke was sent to a non-group chat"]);w=function(){return a};return a}function x(){var a=babelHelpers.taggedTemplateLiteralLoose(["getMsgUpdates: "," has not been revoked"]);x=function(){return a};return a}function a(a,b,c,d){return y.apply(this,arguments)}function y(){y=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e,f,g){var i=[],y=[],C=[],D=0;yield (h||(h=b("Promise"))).all(e.map(function(){var e=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){var e;b.id instanceof c("WAWebMsgKey")||(D++,b.id=new(c("WAWebMsgKey"))({from:b.from,to:b.to,id:b.id,participant:b.participant,selfDir:b.self}));d("WATypeUtils").isString(a)&&c("WAWebWid").isBroadcast(a)&&delete b.broadcast;b.type==="ptt"&&!b.id.fromMe&&b.ack<d("WAWebAck").ACK.CLOCK&&(b.ack=d("WAWebAck").ACK.CLOCK);b.hydratedButtons!=null&&z(b);b.dynamicReplyButtons!=null&&A(b);((e=d("WAWebInvisiblePlaceholderViewModeProcessor").InvisiblePlaceholderViewModeProcessor.compatibleMessageTypes)==null?void 0:e.includes(b.type))&&d("WAWebMessageAssociationUIUtils").shouldHideParentMessage({parentMsg:b})&&(b.viewMode=d("WAWebViewMode.flow").ViewModeType.INVISIBLE_PLACEHOLDER);var h=d("WAWebMsgCollection").MsgCollection.get(b.id);if(b.type===d("WAWebMsgType").MSG_TYPE.PROTOCOL&&b.subtype!=="ephemeral_setting"&&b.subtype!=="share_phone_number"&&b.subtype!=="event_edit_decrypted")switch(b.subtype){case"admin_revoke":var j;e=d("WAWebLidMigrationUtils").getAlternateMsgKey(b.protocolMessageKey);h=(j=d("WAWebMsgCollection").MsgCollection.get(b.protocolMessageKey))!=null?j:e!=null?d("WAWebMsgCollection").MsgCollection.get(e):null;if(h)if(!d("WAWebMsgGetters").getIsGroupMsg(h))d("WALogger").LOG(x(),h.id.toString()),d("WALogger").ERROR(w());else if(!c("WAWebWid").equals(h.id.remote,b.id.remote))d("WALogger").LOG(v(),h.id.toString()),d("WALogger").ERROR(u());else{d("WALogger").LOG(t(),h.id.toString());j=new(d("WAWebMsgModel").Msg)(b);e=c("WANullthrows")(d("WAWebFrontendMsgGetters").getChat(h).groupMetadata);var k=c("WANullthrows")(d("WAWebMsgGetters").getSender(j)),E=e.isLidAddressingMode===!0?d("WAWebLidMigrationUtils").toLid(k):d("WAWebLidMigrationUtils").toPn(k),F=E!=null?e.participants.get(E):null;if((!F||!F.isAdmin)&&E!=null){e.participants.add({id:E,isAdmin:!0},{merge:!0});if(!F){e={actionType:d("WAWebGroupType").GROUP_ACTIONS.ADD,participants:[{id:E,isAdmin:!0,isSuperAdmin:!1}],reason:null};F=(yield d("WAWebGroupSystemMsg").genGroupNotificationMsg({author:void 0,chatId:d("WAWebFrontendMsgGetters").getChat(h).id,ts:j.t},e));void d("WAWebHandleSingleMsg").handleSingleMsg(F.from,F,"handleGroupAction")}d("WAWebDBGroupParticipant").markGroupParticipantStale({group:d("WAWebFrontendMsgGetters").getChat(h).id})["catch"](function(){d("WALogger").ERROR(s()).sendLogs("failed-to-mark-group-participant-as-stale")})}d("WAWebRevokeMsgAction").revoke(h,{msgKey:j.id,subtype:j.subtype,sender:k,revokeTimestamp:j.t})}break;case"sender_revoke":E=d("WAWebLidMigrationUtils").getAlternateMsgKey(b.protocolMessageKey);h=(e=d("WAWebMsgCollection").MsgCollection.get(b.protocolMessageKey))!=null?e:E!=null?d("WAWebMsgCollection").MsgCollection.get(E):null;if(h){F=new(d("WAWebMsgModel").Msg)(b);j=(k=h)==null?void 0:k.botTargetSenderJid;e=d("WAWebMsgGetters").getSender(F);j!=null&&((E=h.id.participant)==null?void 0:E.isBot())&&c("WAWebWid").equals.apply(c("WAWebWid"),d("WAWebLidMigrationUtils").toCommonAddressingMode(j,e))&&e!=null?(d("WALogger").LOG(r(),h.id.toString()),d("WAWebRevokeMsgAction").revoke(h,{msgKey:F.id,subtype:F.subtype,sender:e,revokeTimestamp:F.t})):c("WAWebWid").equals.apply(c("WAWebWid"),d("WAWebLidMigrationUtils").toCommonAddressingMode(d("WAWebMsgGetters").getSender(h),e))&&e!=null?(d("WALogger").LOG(q(),h.id.toString()),c("WAWebWid").isStatus(a)&&h.msgChunk&&h.msgChunk.remove(h),d("WAWebRevokeMsgAction").revoke(h,{msgKey:F.id,subtype:F.subtype,sender:e,revokeTimestamp:F.t})):d("WALogger").WARN(p(),F.id.toString(),h.id.toString())}break;case"bot_request_welcome":break;case"bot_memu_onboarding":break;default:d("WALogger").LOG(o(),b.id.toString()).devConsole(b);break}else if(h&&!d("WAWebFrontendMsgGetters").getAsRevoked(h)){b.ack<h.ack&&delete b.ack;for(k in b)Object.prototype.hasOwnProperty.call(b,k)&&typeof b[k]==="undefined"&&delete b[k];h.type!==b.type&&(b.subtype=b.subtype||void 0);f.isHistory===!0&&(b.isNewMsg=!1);E=["t","id","from","to"];var G=h.t?c("lodash").omit(b,E):b;j=h.applyUpdate(G).then(function(){return h});C.push(j);if(c("WAWebWid").isBroadcast(h.id.remote)){e=d("WAWebMsgModelUtils").getBroadcastFanoutKeys(h);e&&e.forEach(function(a){a=d("WAWebMsgCollection").MsgCollection.get(a);a&&C.push(a.applyUpdate(G).then(function(){return h}))})}f.isHistory===!0&&(h.recvFresh||g)&&!h.search?(d("WALogger").WARN(n(),h.recvFresh?"dup:":"overlap:",String(h.id)),y.push(h)):f.isHistory===!0&&h.search?(h.search=!1,d("WALogger").WARN(m(),String(h.id)),i.push({id:h.id})):f.add==="search"&&i.push({id:h.id})}else{b.subtype==="payment_action_request_declined"||b.subtype==="payment_transaction_request_cancelled"?C.push(d("WAWebPaymentRequestMsgAction").cancelOrDeclinePaymentRequest(b)):b.type===d("WAWebMsgType").MSG_TYPE.PAYMENT&&b.subtype==="send"&&C.push(d("WAWebPaymentRequestMsgAction").fulfillPaymentRequest(b));k=(F=d("WAWebChatCollection").ChatCollection.get(b.id.remote))!=null?F:c("WAWebNewsletterCollection").get(b.id.remote);f.add==="search"&&(b.search=!0);d("WAWebMsgGetters").getIsUnreadType(b)&&b.id.fromMe&&b.ack===d("WAWebAck").ACK.CLOCK&&(b.isSendFailure=!0);b.errorCode===d("WAWebErrorType").SendFailureErrorCode.EditWindowExpired&&(b.isSendFailure=!0);f.update!==!0&&i.push(b);f.isHistory!==!0&&f.add!=="search"&&k&&C.push(B(b,k));b.ephemeralOutOfSync&&d("WALogger").LOG(l(),b.id.toString(),k==null?void 0:k.id.toString())}});return function(a){return e.apply(this,arguments)}}()));D>0&&(d("WALogger").LOG(k(),D,e.length),c("gkx")("26258")||d("WALogger").ERROR(j()).sendLogs("forgot-to-create-msgkey"));return{filteredRecs:i,reorderRecs:y,updates:C}});return y.apply(this,arguments)}function z(a){var b=function(a,b){b=a.index!=null?a.index:b;b=""+b;if(a.quickReplyButton)return new(c("WAWebTemplateButtonModel"))({id:b,displayText:a.quickReplyButton.displayText,selectionId:a.quickReplyButton.id,subtype:"quick_reply"});else if(a.callButton)return new(c("WAWebTemplateButtonModel"))({id:b,displayText:a.callButton.displayText,phoneNumber:a.callButton.phoneNumber,subtype:"call"});return new(c("WAWebTemplateButtonModel"))({id:b,displayText:(b=a.urlButton)==null?void 0:b.displayText,url:(b=a.urlButton)==null?void 0:b.url,subtype:"url"})};a.buttons=new(d("WAWebTemplateButtonCollection").TemplateButtonCollection)();a.buttons.add(a.hydratedButtons.map(b))}function A(a){var b=function(a){var b=a.buttonId;a=a.buttonText;return new(c("WAWebButtonModel"))({id:b,displayText:a==null?void 0:a.displayText})};a.replyButtons=new(d("WAWebButtonCollection").ButtonCollection)();a.replyButtons.add(a.dynamicReplyButtons.map(b))}function B(a,b){return C.apply(this,arguments)}function C(){C=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){if(!a.isNewMsg||!a.recvFresh){d("WALogger").WARN(i(),a.id.toString(),a.type,a.subtype,a.isNewMsg,a.recvFresh).devConsole(a).sendLogs("bad-process-live-message-call",{sampling:.001});return(h||(h=b("Promise"))).resolve()}a.type===d("WAWebMsgType").MSG_TYPE.GP2&&a.subtype==="delete"&&(c.isReadOnly=!0,void d("WAWebPollsInvalidateChatPollMsgsAction").invalidateChatPollMsgs(c),void d("WAWebInvalidateEventsAction").invalidateEventMsgsForChat(c));yield d("WAWebEphemeralSyncResponse").syncEphemeralSetting(a,c)});return C.apply(this,arguments)}g["default"]=a}),98); __d("WAWebGetPushServerSettingsJob",["WADeprecatedSendIq","WADeprecatedWapParser","WALogger","WAWap","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["getPushServerSettingsRequest: server response with ",", ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["getPushServerSettings: success"]);i=function(){return a};return a}var j=new(c("WADeprecatedWapParser"))("getPushServerSettings",function(a){if(!a.hasChild("error")){d("WALogger").LOG(i()).tags("push-notification");var b=a.child("settings");b=b.attrString("webserverkey");return b}b=a.child("error");a=b.attrInt("code");b=b.attrString("text");d("WALogger").WARN(h(),a,b).tags("push-notification");return{errorCode:a,errorText:b}}),k=(e=d("WAWap")).wap("iq",{to:e.S_WHATSAPP_NET,type:"get",xmlns:"urn:xmpp:whatsapp:push",id:e.generateId()},e.wap("settings",null));function a(){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield d("WADeprecatedSendIq").deprecatedSendIq(k,j));if(!a.success){var b=a.errorCode,c=a.errorText;return{errorCode:b,errorText:c}}return a.result});return l.apply(this,arguments)}g.getPushServerSettings=a}),98); __d("WAWebSetPushConfigJob",["WABase64","WADeprecatedSendIq","WADeprecatedWapParser","WALogger","WANullthrows","WAWap","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["setPushConfig: server response with ",", ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["setPushConfig: success"]);i=function(){return a};return a}var j=new(c("WADeprecatedWapParser"))("setPushConfig",function(a){if(!a.hasChild("error")){d("WALogger").LOG(i()).tags("push-notification");return}a=a.child("error");var b=a.attrInt("code");a=a.attrString("text");d("WALogger").WARN(h(),b,a).tags("push-notification");return{errorCode:b,errorText:a}});function a(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b;b=(b=d("WAWap")).wap("iq",{to:b.S_WHATSAPP_NET,type:"set",xmlns:"urn:xmpp:whatsapp:push",id:b.generateId()},b.wap("config",{platform:"web",endpoint:b.CUSTOM_STRING(a.endpoint),auth:b.CUSTOM_STRING(d("WABase64").encodeB64(c("WANullthrows")(a.getKey("auth")))),p256dh:b.CUSTOM_STRING(d("WABase64").encodeB64(c("WANullthrows")(a.getKey("p256dh"))))}));a=(yield d("WADeprecatedSendIq").deprecatedSendIq(b,j));if(!a.success){b=a.errorCode;var e=a.errorText;return{errorCode:b,errorText:e}}return a.result});return k.apply(this,arguments)}g.setPushConfig=a}),98); __d("WAWebSubscribePushManagerAction",["fbt","WABase64","WALogger","WAWebABProps","WAWebBackgroundSyncReporter","WAWebFbtCommon","WAWebGetPushServerSettingsJob","WAWebL10N","WAWebMiscErrors","WAWebMuteCollection","WAWebNotificationConstants","WAWebPushNotificationsGatingUtils","WAWebSetPushConfigJob","WAWebSetWorkerLocalStorage","WAWebUserPrefsGeneral","WAWebUserPrefsNotifications","WAWebUserPrefsScreenLock","WAWebWamEnumOnboardSources","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g,h){function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[push-notification] failed to unsubscribe push manager due to error: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[push-notification] successfully unsubscribed push manager"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[push-notification] failed to unsubscribe push manager due to no active push subscription"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[push-notification] failed to unsubscribe push manager due to no service worker registration"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[push-notification] failed to unsubscribe push manager due to service worker does not exist"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["[push-notification] attempt to unsubscribe push manager started"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["[push-notification] failed to subscribe push manager due to error: ",""]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["[push-notification] successfully subscribed push manager"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["[push-notification] failed to subscribe push manager due to send client push subscription data to server failure with error ",""]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["[push-notification] failed to subscribe push manager due to unable to get push server settings with error code ",""]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["[push-notification] failed to subscribe push manager due to push manager is already subscribed"]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["[push-notification] failed to subscribe push manager due to service worker is not ready yet"]);t=function(){return a};return a}function u(){var a=babelHelpers.taggedTemplateLiteralLoose(["[push-notification] failed to subscribe push manager due to service worker does not exist"]);u=function(){return a};return a}function v(){var a=babelHelpers.taggedTemplateLiteralLoose(["[push-notification] attempt to subscribe push manager started"]);v=function(){return a};return a}function w(){var a=babelHelpers.taggedTemplateLiteralLoose(["[push-notification] isOfflineNotificationsEnabled: ",",\n hasPushSubscription: ",", canEnableOfflineNotifications: ",", isScreenLockEnabled : ",""]);w=function(){return a};return a}function x(){var a=babelHelpers.taggedTemplateLiteralLoose(["[push-notification] the current service worker scope is invalid, service worker scope: ",", current scope: ",""]);x=function(){return a};return a}function y(){var a=babelHelpers.taggedTemplateLiteralLoose(["[push-notification] failed to get push manager"]);y=function(){return a};return a}function z(){var a=babelHelpers.taggedTemplateLiteralLoose(["[push-notification] failed to check and update push manager due to no service worker registration"]);z=function(){return a};return a}function A(){var a=babelHelpers.taggedTemplateLiteralLoose(["[push-notification] attempt to update push manager started"]);A=function(){return a};return a}function B(){var a=babelHelpers.taggedTemplateLiteralLoose(["[push-notification] Enable background sync for users once"]);B=function(){return a};return a}function a(){return C.apply(this,arguments)}function C(){C=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(!d("WAWebPushNotificationsGatingUtils").canSupportOfflineNotifications())return;d("WALogger").DEV(A());if("serviceWorker"in navigator){var a,b,e,f=d("WAWebMuteCollection").MuteCollection.getGlobalOfflineNotifications();f=H(f);var g=d("WAWebUserPrefsScreenLock").getScreenLockEnabled();a=f&&((a=window.Notification)==null?void 0:a.permission)===d("WAWebNotificationConstants").PERMISSION_ALLOWED&&d("WAWebPushNotificationsGatingUtils").canEnableOfflineNotifications()&&!g;b=(yield (b=window.navigator.serviceWorker)==null?void 0:b.ready);if(b==null){d("WALogger").WARN(z());return}e=b==null?void 0:(e=b.pushManager)==null?void 0:e.getSubscription==null?void 0:e.getSubscription();if(e==null){d("WALogger").WARN(y());return}if(b.scope!==window.location.origin+window.location.pathname){d("WALogger").DEV(x(),b.scope,window.location.origin+window.location.pathname);return}b=(yield e)!=null;d("WALogger").DEV(w(),f,b,d("WAWebPushNotificationsGatingUtils").canEnableOfflineNotifications(),g);a?b?(I(),c("WAWebL10N").on("locale_change",function(){I()})):void D():!a&&b&&void F()}});return C.apply(this,arguments)}function e(a){a?void D():void F()}function D(){return E.apply(this,arguments)}function E(){E=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(!d("WAWebPushNotificationsGatingUtils").canEnableOfflineNotifications())return;d("WALogger").DEV(v());try{var a;if(!("serviceWorker"in navigator)){d("WALogger").DEV(u());return}a=(yield (a=window.navigator.serviceWorker)==null?void 0:a.ready);if(a==null){d("WALogger").DEV(t());return}var b=(yield a.pushManager.getSubscription());if(b!=null){d("WALogger").DEV(s());return}b=(yield d("WAWebGetPushServerSettingsJob").getPushServerSettings());if(b.errorCode!=null){d("WALogger").WARN(r(),b.errorCode);return}b=new Uint8Array(d("WABase64").decodeB64UrlSafe(String(b)));b={userVisibleOnly:!0,applicationServerKey:b};a=(yield a.pushManager.subscribe(b));b=(yield d("WAWebSetPushConfigJob").setPushConfig(a));if((b==null?void 0:b.errorCode)!=null){d("WALogger").WARN(q(),b.errorText);return}yield d("WAWebSetWorkerLocalStorage").setWorkerLocalStorage();yield I();d("WALogger").DEV(p())}catch(a){d("WALogger").WARN(o(),a)}});return E.apply(this,arguments)}function F(){return G.apply(this,arguments)}function G(){G=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(!d("WAWebPushNotificationsGatingUtils").canSupportOfflineNotifications())return!1;d("WALogger").DEV(n());try{var a;if(!("serviceWorker"in navigator)){d("WALogger").DEV(m());return!1}a=(yield (a=window.navigator.serviceWorker)==null?void 0:a.ready);if(a==null){d("WALogger").DEV(l());return!1}a=(yield a.pushManager.getSubscription());if(a==null){d("WALogger").DEV(k());return!1}a=(yield a.unsubscribe());yield d("WAWebSetWorkerLocalStorage").clearWorkerLocalStorage()["catch"](function(a){if(!(a instanceof d("WAWebMiscErrors").DbOnLogoutAbort))throw a});d("WALogger").DEV(j());return a}catch(a){d("WALogger").WARN(i(),a);return!1}});return G.apply(this,arguments)}function H(a){var b;if(!a&&((b=window.Notification)==null?void 0:b.permission)===d("WAWebNotificationConstants").PERMISSION_ALLOWED&&d("WAWebMuteCollection").MuteCollection.getGlobalNotifications()&&d("WAWebUserPrefsNotifications").getOfflineNotificationsEnabledOnce()!==!0&&d("WAWebABProps").getABPropConfigValue("web_background_sync_v2")){d("WALogger").LOG(B());d("WAWebUserPrefsNotifications").setOfflineNotificationsEnabledOnce();d("WAWebMuteCollection").MuteCollection.setGlobalOfflineNotifications(!0);d("WAWebBackgroundSyncReporter").logBackgroundSyncAdoptionEvent({offboardSource:null,onboardSource:d("WAWebWamEnumOnboardSources").ONBOARD_SOURCES.AUTO_ENABLE});return!0}return a}function I(){var a=c("WAWebFbtCommon")("WhatsApp"),b=h._(/*BTDS*/"__JHASH__IvWQxI9B_dP__JHASH__"),e=h._(/*BTDS*/"__JHASH__U1FxZ6VWSi___JHASH__"),f;d("WAWebPushNotificationsGatingUtils").canSupportNotificationActions()&&(f=h._(/*BTDS*/"__JHASH__TEB66uvY7pa__JHASH__"));void d("WAWebUserPrefsGeneral").setOfflineNotificationContent({notificationTitle:a.toString(),notificationText:b.toString(),notificationSyncCompleteText:e.toString(),notificationSettingActionText:(a=f)==null?void 0:a.toString()})}g.updatePushManager=a;g.handleOfflineNotifications=e;g.unsubscribePushManager=F}),226); __d("WAWebAppScreen",["$InternalEnum","WAWebStreamModel","err"],(function(a,b,c,d,e,f,g){var h=b("$InternalEnum").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","SCREEN_LOCK","SERVICE_UNAVAILABLE"]);function a(a){var b,e=a.anotherSession,f=a.isUnsupportedTakeover,g=a.updating,i=a.hardExpired,j=a.mainLoaded,k=a.mode,l=a.screenLocked;if((b=a.temporaryBan)==null?void 0:b.banned)return h.TEMP_BAN;if(a.serviceUnavailable===!0)return h.SERVICE_UNAVAILABLE;if(a.startLogout)return h.LOGOUT;if(g||i)return h.CLIENT_EXPIRED_DIALOG;if(f)return h.UNSUPPORTED_TAKEOVER;if(e)return h.ANOTHER_SESSION;if(l)return!j?h.STARTUP:h.SCREEN_LOCK;switch(k){case d("WAWebStreamModel").StreamMode.QR:return h.QR;case d("WAWebStreamModel").StreamMode.SYNCING:return h.SYNCING;case d("WAWebStreamModel").StreamMode.OFFLINE:return h.OFFLINE;case d("WAWebStreamModel").StreamMode.PROXYBLOCK:return h.PROXYBLOCK;case d("WAWebStreamModel").StreamMode.CONFLICT:return h.CONFLICT;case d("WAWebStreamModel").StreamMode.TOS_BLOCK:return h.TOS_BLOCK;case d("WAWebStreamModel").StreamMode.SMB_TOS_BLOCK:return h.SMB_TOS_BLOCK;case d("WAWebStreamModel").StreamMode.DEPRECATED_VERSION:return h.DEPRECATED_VERSION;case d("WAWebStreamModel").StreamMode.MAIN:if(!j)return h.STARTUP;return a.stayInSync?h.SYNCING:h.MAIN}throw c("err")("[app] render Error invalid StreamMode: "+k)}g.AppScreen=h;g.getScreen=a}),98); __d("WAWebWamEnumErrorType",[],(function(a,b,c,d,e,f){a=Object.freeze({ERROR_FETCHING_AGENT_NAME:0,ERROR_FETCHING_CHAT:1,ERROR_OTHER:2});f.ERROR_TYPE=a}),66); __d("WAWebWamEnumMdChatAssignmentAssignmentType",[],(function(a,b,c,d,e,f){a=Object.freeze({ASSIGNED:0,UNASSIGNED:1});f.MD_CHAT_ASSIGNMENT_ASSIGNMENT_TYPE=a}),66); __d("WAWebWamEnumMdChatAssignmentChatType",[],(function(a,b,c,d,e,f){a=Object.freeze({GROUP:0,BROADCAST_LIST:1,INDIVIDUAL:2,COMMUNITY:3,CHANNEL:4,INTEROP:5});f.MD_CHAT_ASSIGNMENT_CHAT_TYPE=a}),66); __d("WAWebWamEnumMdChatAssignmentSecondaryActionType",[],(function(a,b,c,d,e,f){a=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});f.MD_CHAT_ASSIGNMENT_SECONDARY_ACTION_TYPE=a}),66); __d("WAWebWamEnumMdChatAssignmentSourceType",[],(function(a,b,c,d,e,f){a=Object.freeze({NONE:0,BOOTSTRAP:1});f.MD_CHAT_ASSIGNMENT_SOURCE_TYPE=a}),66); __d("WAWebMdChatAssignmentSecondaryActionWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumErrorType","WAWebWamEnumMdChatAssignmentAssignmentType","WAWebWamEnumMdChatAssignmentChatType","WAWebWamEnumMdChatAssignmentSecondaryActionType","WAWebWamEnumMdChatAssignmentSourceType"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({MdChatAssignmentSecondaryAction:[3716,{mdChatAssignmentSecondaryActionAgentId:[1,a.TYPES.STRING],mdChatAssignmentSecondaryActionAssignmentType:[8,d("WAWebWamEnumMdChatAssignmentAssignmentType").MD_CHAT_ASSIGNMENT_ASSIGNMENT_TYPE],mdChatAssignmentSecondaryActionBrowserId:[2,a.TYPES.STRING],mdChatAssignmentSecondaryActionChatType:[3,d("WAWebWamEnumMdChatAssignmentChatType").MD_CHAT_ASSIGNMENT_CHAT_TYPE],mdChatAssignmentSecondaryActionError:[4,d("WAWebWamEnumErrorType").ERROR_TYPE],mdChatAssignmentSecondaryActionMdId:[5,a.TYPES.INTEGER],mdChatAssignmentSecondaryActionSource:[6,d("WAWebWamEnumMdChatAssignmentSourceType").MD_CHAT_ASSIGNMENT_SOURCE_TYPE],mdChatAssignmentSecondaryActionType:[7,d("WAWebWamEnumMdChatAssignmentSecondaryActionType").MD_CHAT_ASSIGNMENT_SECONDARY_ACTION_TYPE]},[1,1,1],"regular"]},{MdChatAssignmentSecondaryAction:[]});g.MdChatAssignmentSecondaryActionWamEvent=b}),98); __d("WAWebWamEnumChatAssignmentActionType",[],(function(a,b,c,d,e,f){a=Object.freeze({ACTION_ASSIGNED:0,ACTION_UNASSIGNED:1,ACTION_REASSIGNED:2});f.CHAT_ASSIGNMENT_ACTION_TYPE=a}),66); __d("WAWebWamEnumChatAssignmentChatType",[],(function(a,b,c,d,e,f){a=Object.freeze({INDIVIDUAL:0,GROUP:1,COMMUNITY:2,CHANNEL:3});f.CHAT_ASSIGNMENT_CHAT_TYPE=a}),66); __d("WAWebWamEnumChatAssignmentEntryPointType",[],(function(a,b,c,d,e,f){a=Object.freeze({CONVERSATION_OVERFLOW_MENU:0,CONTACT_INFO_SCREEN:1,MULTI_SELECT:2,SYSTEM_MESSAGE:3,CHAT_LIST_SWIPE:4,AI_REPLIES:5});f.CHAT_ASSIGNMENT_ENTRY_POINT_TYPE=a}),66); __d("WAWebMdChatAssignmentWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumChatAssignmentActionType","WAWebWamEnumChatAssignmentChatType","WAWebWamEnumChatAssignmentEntryPointType"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({MdChatAssignment:[3752,{assignerAgentId:[1,a.TYPES.STRING],assignerBrowserId:[2,a.TYPES.STRING],assignerMdId:[3,a.TYPES.INTEGER],chatAssignmentAction:[4,d("WAWebWamEnumChatAssignmentActionType").CHAT_ASSIGNMENT_ACTION_TYPE],chatAssignmentAgentId:[5,a.TYPES.STRING],chatAssignmentBrowserId:[6,a.TYPES.STRING],chatAssignmentChatType:[7,d("WAWebWamEnumChatAssignmentChatType").CHAT_ASSIGNMENT_CHAT_TYPE],chatAssignmentEntryPoint:[8,d("WAWebWamEnumChatAssignmentEntryPointType").CHAT_ASSIGNMENT_ENTRY_POINT_TYPE],chatAssignmentMdId:[9,a.TYPES.INTEGER],chatsCnt:[10,a.TYPES.INTEGER]},[1,1,1],"regular"]},{MdChatAssignment:[]});g.MdChatAssignmentWamEvent=b}),98); __d("WAWebChatAssignmentLogEvents",["WAWebABProps","WAWebAgentCollection","WAWebBizGatingUtils","WAWebChatAssignmentLogEvents.flow","WAWebChatCollection","WAWebMdChatAssignmentSecondaryActionWamEvent","WAWebMdChatAssignmentWamEvent","WAWebMiscBrowserUtils","WAWebUserPrefsMeUser","WAWebWamEnumChatAssignmentActionType","WAWebWamEnumChatAssignmentEntryPointType","WAWebWamEnumMdChatAssignmentAssignmentType","WAWebWamEnumMdChatAssignmentSecondaryActionType","WAWebWamEnumMdChatAssignmentSourceType"],(function(a,b,c,d,e,f,g){function h(){var a=d("WAWebUserPrefsMeUser").assertGetMe().getDeviceId();return d("WAWebAgentCollection").AgentCollection.getModelsArray().find(function(b){return b.deviceId===a})}function i(a,b){var e=h(),f=d("WAWebABProps").getABPropConfigValue("smb_md_agent_chat_assignment_system_messages_logging_v2_enabled");f||delete b.mdChatAssignmentSecondaryActionAssignmentType;return new(d("WAWebMdChatAssignmentSecondaryActionWamEvent").MdChatAssignmentSecondaryActionWamEvent)(babelHelpers["extends"]({mdChatAssignmentSecondaryActionChatType:a==null?void 0:a.getMdChatAssignmentChatType(),mdChatAssignmentSecondaryActionMdId:(f=e==null?void 0:e.deviceId)!=null?f:-1,mdChatAssignmentSecondaryActionAgentId:(a=e==null?void 0:e.id)!=null?a:"",mdChatAssignmentSecondaryActionBrowserId:c("WAWebMiscBrowserUtils").persistentExpiringId()},b))}function a(a){if(!d("WAWebBizGatingUtils").chatAssignmentEnabled())return;i(a,{mdChatAssignmentSecondaryActionType:d("WAWebWamEnumMdChatAssignmentSecondaryActionType").MD_CHAT_ASSIGNMENT_SECONDARY_ACTION_TYPE.ACTION_TOOLTIP_SHOWN,mdChatAssignmentSecondaryActionSource:d("WAWebWamEnumMdChatAssignmentSourceType").MD_CHAT_ASSIGNMENT_SOURCE_TYPE.NONE}).commit()}function b(a){if(!d("WAWebBizGatingUtils").chatAssignmentEnabled())return;i(a,{mdChatAssignmentSecondaryActionType:d("WAWebWamEnumMdChatAssignmentSecondaryActionType").MD_CHAT_ASSIGNMENT_SECONDARY_ACTION_TYPE.ACTION_SYSTEM_MESSAGE_ADDED_TO_CHAT_HISTORY,mdChatAssignmentSecondaryActionSource:d("WAWebWamEnumMdChatAssignmentSourceType").MD_CHAT_ASSIGNMENT_SOURCE_TYPE.BOOTSTRAP,mdChatAssignmentSecondaryActionAssignmentType:a.assignedAgent==null?d("WAWebWamEnumMdChatAssignmentAssignmentType").MD_CHAT_ASSIGNMENT_ASSIGNMENT_TYPE.ASSIGNED:d("WAWebWamEnumMdChatAssignmentAssignmentType").MD_CHAT_ASSIGNMENT_ASSIGNMENT_TYPE.UNASSIGNED}).commit()}function e(a){if(!d("WAWebBizGatingUtils").chatAssignmentEnabled())return;i(a,{mdChatAssignmentSecondaryActionType:d("WAWebWamEnumMdChatAssignmentSecondaryActionType").MD_CHAT_ASSIGNMENT_SECONDARY_ACTION_TYPE.ACTION_SYSTEM_MESSAGE_CREATION_ERROR,mdChatAssignmentSecondaryActionSource:d("WAWebWamEnumMdChatAssignmentSourceType").MD_CHAT_ASSIGNMENT_SOURCE_TYPE.NONE,mdChatAssignmentSecondaryActionAssignmentType:a.assignedAgent==null?d("WAWebWamEnumMdChatAssignmentAssignmentType").MD_CHAT_ASSIGNMENT_ASSIGNMENT_TYPE.ASSIGNED:d("WAWebWamEnumMdChatAssignmentAssignmentType").MD_CHAT_ASSIGNMENT_ASSIGNMENT_TYPE.UNASSIGNED}).commit()}function f(a){if(!d("WAWebBizGatingUtils").chatAssignmentEnabled())return;a=d("WAWebChatCollection").ChatCollection.get(a);if(a==null)return;i(a,{mdChatAssignmentSecondaryActionType:d("WAWebWamEnumMdChatAssignmentSecondaryActionType").MD_CHAT_ASSIGNMENT_SECONDARY_ACTION_TYPE.ACTION_CHAT_STATUS_TICKER_SHOWN,mdChatAssignmentSecondaryActionSource:d("WAWebWamEnumMdChatAssignmentSourceType").MD_CHAT_ASSIGNMENT_SOURCE_TYPE.NONE}).commit()}function j(a,b,e){var f=h(),g=d("WAWebAgentCollection").AgentCollection.get(b),i=d("WAWebUserPrefsMeUser").assertGetMe().getDeviceId();b=b===(f==null?void 0:f.id);return new(d("WAWebMdChatAssignmentWamEvent").MdChatAssignmentWamEvent)(babelHelpers["extends"]({assignerMdId:i,assignerAgentId:(i=f==null?void 0:f.id)!=null?i:"",assignerBrowserId:c("WAWebMiscBrowserUtils").persistentExpiringId(),chatAssignmentAgentId:(f=g==null?void 0:g.id)!=null?f:"",chatAssignmentMdId:(i=g==null?void 0:g.deviceId)!=null?i:-1,chatAssignmentBrowserId:b?c("WAWebMiscBrowserUtils").persistentExpiringId():"",chatAssignmentChatType:a.getChatAssignmentChatType()},e))}function k(a){switch(a){case d("WAWebChatAssignmentLogEvents.flow").ChatAssignmentEntryPointType.MULTI_SELECT:return d("WAWebWamEnumChatAssignmentEntryPointType").CHAT_ASSIGNMENT_ENTRY_POINT_TYPE.MULTI_SELECT;case d("WAWebChatAssignmentLogEvents.flow").ChatAssignmentEntryPointType.SYSTEM_MESSAGE:return d("WAWebWamEnumChatAssignmentEntryPointType").CHAT_ASSIGNMENT_ENTRY_POINT_TYPE.SYSTEM_MESSAGE;case d("WAWebChatAssignmentLogEvents.flow").ChatAssignmentEntryPointType.CONVERSATION_MENU:return d("WAWebWamEnumChatAssignmentEntryPointType").CHAT_ASSIGNMENT_ENTRY_POINT_TYPE.CONVERSATION_OVERFLOW_MENU;case d("WAWebChatAssignmentLogEvents.flow").ChatAssignmentEntryPointType.CONTACT_INFO_SCREEN:return d("WAWebWamEnumChatAssignmentEntryPointType").CHAT_ASSIGNMENT_ENTRY_POINT_TYPE.CONTACT_INFO_SCREEN}}function l(a,b,c,e,f){if(!d("WAWebBizGatingUtils").chatAssignmentEnabled())return;var g;b===""?g=d("WAWebWamEnumChatAssignmentActionType").CHAT_ASSIGNMENT_ACTION_TYPE.ACTION_UNASSIGNED:c?g=d("WAWebWamEnumChatAssignmentActionType").CHAT_ASSIGNMENT_ACTION_TYPE.ACTION_REASSIGNED:g=d("WAWebWamEnumChatAssignmentActionType").CHAT_ASSIGNMENT_ACTION_TYPE.ACTION_ASSIGNED;j(a,b,{chatAssignmentAction:g,chatAssignmentEntryPoint:k(e),chatsCnt:f}).commit()}g.logNuxShown=a;g.logSystemMessageGeneratedFromCompanion=b;g.logSystemMessageFailedToGenerate=e;g.logChatStatusTickerShown=f;g.logChatAssignment=l}),98); __d("WAWebNotesUtils",["WACryptoSha256","WAWebABProps","WAWebBizGatingUtils","WAWebFrontendMsgGetters","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";e=d("WAWebABProps").getABPropConfigValue("smb_notes_content_max_limit");function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){return d("WACryptoSha256").sha256Str(a)});return h.apply(this,arguments)}function i(a){return a!=null&&a.isUser()&&!a.isPSA()&&!a.isOfficialBizAccount()&&!a.isIAS()&&!a.isSupportAccount()&&!a.isCAPISupportAccount()&&!a.isBot()&&d("WAWebBizGatingUtils").smbNotesV1Enabled()}function c(a){if(a==null)return!1;var b=d("WAWebFrontendMsgGetters").getText(a);if(b==null||b.trim()==="")return!1;b=d("WAWebFrontendMsgGetters").getChat(a);return b==null?!1:i(b.id)}g.MAX_NOTE_LENGTH=e;g.generateNoteId=a;g.shouldEnableNotesForWid=i;g.shouldEnableNotesForMsg=c}),98); __d("WAWebTemplateButtonSubtype",[],(function(a,b,c,d,e,f){a={QUICK_REPLY:"quick_reply",CALL:"call",URL:"url"};f.TEMPLATE_BUTTON_SUBTYPE=a}),66); __d("WAWebOTPHelper",["fbt","WAWebABProps","WAWebCopyToClipboard","WAWebMsgDataFromModel","WAWebOTPLoggingHelper","WAWebTemplateButtonSubtype","WAWebToast.react","WAWebToastManager","react"],(function(a,b,c,d,e,f,g,h){var i,j=i||c("react");function a(a){if(d("WAWebABProps").getABPropConfigValue("web_otp_copy_code_disabled"))return!1;if(!navigator.clipboard)return!1;var b=a.url;if(a.subtype!==d("WAWebTemplateButtonSubtype").TEMPLATE_BUTTON_SUBTYPE.URL||b==null)return!1;try{a=new URL(b);return k(a)!=null}catch(a){return!1}}function k(a){var b;return(b=l(a))!=null?b:m(a)}function b(a){var b=a.url;if(a.subtype!==d("WAWebTemplateButtonSubtype").TEMPLATE_BUTTON_SUBTYPE.URL||b==null)return null;try{a=new URL(b);return k(a)}catch(a){return null}}function e(a,b){var c=a.url;if(a.subtype!==d("WAWebTemplateButtonSubtype").TEMPLATE_BUTTON_SUBTYPE.URL||c==null)return;a=new URL(c);c=k(a);if(c==null)return;a=d("WAWebCopyToClipboard").copyTextToClipboard(c);a&&d("WAWebToastManager").ToastManager.open(j.jsx(d("WAWebToast.react").Toast,{msg:h._(/*BTDS*/"__JHASH__Ck-tGbziqPm__JHASH__")}));void d("WAWebOTPLoggingHelper").logOTPButtonClick(d("WAWebMsgDataFromModel").msgDataFromMsgModel(b))}function l(a){var b=d("WAWebABProps").getABPropConfigValue("unified_otp_copy_code_url");return!a.toString().startsWith(b)?null:a.toString().slice(b.length)}function m(a){var b=d("WAWebABProps").getABPropConfigValue("unified_otp_retriever_url");if(!a.toString().startsWith(b))return null;b=a.searchParams;a=b.get("code");if(a==null)return null;b="otp";return a.startsWith(b)?a.slice(b.length):a}g.isOTPCopyCodeButton=a;g.getOTPCode=k;g.getOTPCodeFromButton=b;g.copyOTPCode=e}),226); __d("WAWebLinkDevicePhoneNumberEntryInputFormatUtils",["WACcToIso","WAIsoToCc","WAPhoneFindCC","WAPhoneUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=a.countryCodeIso;a=a.phoneNumberWithoutCountryCode;if(b==null)return h(a);var e=c("WAIsoToCc")[b];e=d("WAPhoneUtils").compileCountryRegexes(String(e));if(e==null)return null;b=l(""+c("WAIsoToCc")[b]+a);var f=b.phoneNumberWithoutCountryCode;a=i(e);b=Math.max.apply(Math,a);if(f.length>b)return h(f);b=a.filter(function(a){return a>=f.length}).map(function(a){return j(f,a)});for(a of e.formats){e=a.testAndFormat(f);if(e!=null)return{formattedInputValue:e,placeholder:""};for(e of b){var g=a.testAndFormat(e);if(g!=null)return k({phoneNumberWithoutCountryCode:f,formattedPaddedNumber:g})}}return h(f)}function h(a){return{formattedInputValue:a,placeholder:""}}function i(a){a=a.lengths;return typeof a==="number"?[a]:a.sort(function(a,b){return a-b})}function j(a,b){return a+"_".repeat(b-a.length)}function k(a){var b=a.phoneNumberWithoutCountryCode;a=a.formattedPaddedNumber;if(b==="")return{formattedInputValue:"",placeholder:a};b=Array.from(a.matchAll(/\d/g));b=b.pop().index;b=b+1;return{formattedInputValue:a.substr(0,b),placeholder:a.substr(b)}}function b(a,b){a=d("WAPhoneUtils").compileCountryRegexes(String(a));return a==null?!1:a.formats.some(function(a){return a.testAndFormat(b)!=null})}function l(a){a=a.replaceAll(/[^\d]/g,"");var b=m(a),d=a;if(b!=null){var e=c("WAIsoToCc")[b];d=d.replace(new RegExp("^"+e),"")}return{countryCodeIso:b,phoneNumberWithoutCountryCode:d,fullRawPhoneNumber:a}}function m(a){a=d("WAPhoneFindCC").findCC(a);return c("WACcToIso")[parseInt(a,10)]}function e(a,b,c){if(b==null){a=a?"+":"";return""+a+c}return"+"+b+" "+c}g.formatPhoneNumberInput=a;g.isPhoneNumberValid=b;g.cleanPhoneNumberInputValue=l;g.getCountryCodeIso=m;g.getFullFormattedInputValue=e}),98); __d("WAWebWamEnumChatsFolderType",[],(function(a,b,c,d,e,f){a=Object.freeze({INBOX:1,ARCHIVED:2});f.CHATS_FOLDER_TYPE=a}),66); __d("WAWebWamEnumCtaFallbackReason",[],(function(a,b,c,d,e,f){a=Object.freeze({NO_OTP_REQUEST_RECEIVED:0,OTP_REQUEST_EXPIRED:1,HASH_MISMATCH:2,NO_ACTIVITY_LISTENING_ON_THIRD_PARTY_APP:3,OTHER:4,NO_PACKAGE_NAME_ON_MESSAGE:5,NO_CTA_DISPLAY_NAME:6,INCOMPATIBLE_OS_VERSION:7,NO_RETRIEVER_BUTTON:8,FEATURE_DISABLED:9,AMBIGUOUS_DELIVERY_DESTINATION:10});f.CTA_FALLBACK_REASON=a}),66); __d("WAWebWamEnumCtaType",[],(function(a,b,c,d,e,f){a=Object.freeze({COPY_CODE:0,AUTOFILL:1});f.CTA_TYPE=a}),66); __d("WAWebWamEnumOtpEventSource",[],(function(a,b,c,d,e,f){a=Object.freeze({NOTIFICATION_CTA:0,NOTIFICATION_BODY:1,CHAT_CTA:2,OTHER:3,OTP_MESSAGE:4,OTP_MESSAGE_INFO:5,OTP_CONFIGURATION:6,OTP_REQUEST_SENDER:7,OTP_ZERO_TAP_SENDER:8,OTP_CONF_OPTION:9});f.OTP_EVENT_SOURCE=a}),66); __d("WAWebWamEnumOtpEventType",[],(function(a,b,c,d,e,f){a=Object.freeze({CLICK:0,IMPRESSION:1,OTP_CODE_REQUESTED:2,OTP_CODE_SENT:3,MESSAGE_RECEIVED:4,MESSAGE_READ:5,MESSAGE_DELETED:6,ZERO_TAP_ENABLED:7,ZERO_TAP_DISABLED:8,ZERO_TAP_NOTICE_VIEWED:9,CLEAR_CHAT:10,ZERO_TAP_SEND_CODE_STARTED:11,ZERO_TAP_SEND_CODE_COMPLETED:12,ZERO_TAP_SEND_CODE_FAILED:13,OTP_CONF_OPT_ZERO_TAP_FLAG_ENABLED:14,OTP_CONF_OPT_ZERO_TAP_FLAG_DISABLED:15,HANDSHAKE_CONFIRMATION_SENT:16,FEEDBACK_BUTTON_CLICK:17});f.OTP_EVENT_TYPE=a}),66); __d("WAWebWamEnumOtpProductType",[],(function(a,b,c,d,e,f){a=Object.freeze({ONE_TAP:0,ZERO_TAP:1,COPY_CODE:2});f.OTP_PRODUCT_TYPE=a}),66); __d("WAWebOtpRetrieverWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumChatsFolderType","WAWebWamEnumCtaFallbackReason","WAWebWamEnumCtaType","WAWebWamEnumOtpEventSource","WAWebWamEnumOtpEventType","WAWebWamEnumOtpProductType"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({OtpRetriever:[3468,{businessLid:[26,a.TYPES.INTEGER],businessPhoneNumber:[1,a.TYPES.INTEGER],chatId:[19,a.TYPES.STRING],chatsFolderType:[12,d("WAWebWamEnumChatsFolderType").CHATS_FOLDER_TYPE],ctaFallbackReason:[2,d("WAWebWamEnumCtaFallbackReason").CTA_FALLBACK_REASON],ctaType:[3,d("WAWebWamEnumCtaType").CTA_TYPE],isKeepChatsArchivedEnabled:[13,a.TYPES.BOOLEAN],isMessageNotificationEnabled:[14,a.TYPES.BOOLEAN],isNotificationEnabled:[15,a.TYPES.BOOLEAN],messageReceivedElapsedTimeSeconds:[11,a.TYPES.INTEGER],otpCorrelationId:[20,a.TYPES.STRING],otpEventSource:[5,d("WAWebWamEnumOtpEventSource").OTP_EVENT_SOURCE],otpEventType:[6,d("WAWebWamEnumOtpEventType").OTP_EVENT_TYPE],otpFailureReason:[16,a.TYPES.STRING],otpHandshakeElapsedTimeMs:[21,a.TYPES.INTEGER],otpHandshakeId:[23,a.TYPES.STRING],otpMaskLinkedDevices:[24,a.TYPES.BOOLEAN],otpProductType:[7,d("WAWebWamEnumOtpProductType").OTP_PRODUCT_TYPE],otpSdkVersion:[22,a.TYPES.STRING],otpSenderAttributes:[27,a.TYPES.STRING],otpSessionId:[8,a.TYPES.STRING],receiverCountryCode:[18,a.TYPES.STRING],templateId:[17,a.TYPES.STRING],thirdPartyPackageNameFromIntent:[9,a.TYPES.STRING],thirdPartyPackageSignatureHash:[10,a.TYPES.STRING],waDeviceId:[25,a.TYPES.INTEGER]},[1,1,1],"private",113760892]},{OtpRetriever:[]});g.OtpRetrieverWamEvent=b}),98); __d("WAWebOTPLoggingHelper",["WACryptoSha256","WAWebABProps","WAWebDBMessageSerialization","WAWebFrontendMsgGetters","WAWebLinkDevicePhoneNumberEntryInputFormatUtils","WAWebMsgGetters","WAWebMuteGetters","WAWebOtpRetrieverWamEvent","WAWebSettingsGetters","WAWebSettingsModel","WAWebUserPrefsMeUser","WAWebUserPrefsNotifications","WAWebWamEnumChatsFolderType","WAWebWamEnumCtaType","WAWebWamEnumOtpEventSource","WAWebWamEnumOtpEventType","WAWebWamEnumOtpProductType","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!d("WAWebMsgGetters").getIsAuthenticationMessage(a))return;var b=new(d("WAWebOtpRetrieverWamEvent").OtpRetrieverWamEvent)({otpEventType:d("WAWebWamEnumOtpEventType").OTP_EVENT_TYPE.CLICK,otpEventSource:d("WAWebWamEnumOtpEventSource").OTP_EVENT_SOURCE.CHAT_CTA,ctaType:d("WAWebWamEnumCtaType").CTA_TYPE.COPY_CODE});yield m(b,a);b.commit()});return h.apply(this,arguments)}function e(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b;if(!d("WAWebMsgGetters").getIsAuthenticationMessage(a))return;var c=new(d("WAWebOtpRetrieverWamEvent").OtpRetrieverWamEvent)({otpEventType:d("WAWebWamEnumOtpEventType").OTP_EVENT_TYPE.MESSAGE_RECEIVED,otpEventSource:d("WAWebWamEnumOtpEventSource").OTP_EVENT_SOURCE.OTP_MESSAGE,ctaType:d("WAWebWamEnumCtaType").CTA_TYPE.COPY_CODE});b=(b=d("WAWebUserPrefsMeUser").getMe())==null?void 0:b.getDeviceId();b!=null&&(c.waDeviceId=b);yield m(c,a);c.commit()});return i.apply(this,arguments)}function f(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=d("WAWebDBMessageSerialization").messageFromDbRow(a);if(!d("WAWebMsgGetters").getIsAuthenticationMessage(a))return;var b=new(d("WAWebOtpRetrieverWamEvent").OtpRetrieverWamEvent)({otpEventType:d("WAWebWamEnumOtpEventType").OTP_EVENT_TYPE.MESSAGE_READ,otpEventSource:d("WAWebWamEnumOtpEventSource").OTP_EVENT_SOURCE.OTP_MESSAGE,ctaType:d("WAWebWamEnumCtaType").CTA_TYPE.COPY_CODE});yield m(b,a);b.commit()});return j.apply(this,arguments)}function k(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!d("WAWebMsgGetters").getIsAuthenticationMessage(a))return;var b=new(d("WAWebOtpRetrieverWamEvent").OtpRetrieverWamEvent)({otpEventType:d("WAWebWamEnumOtpEventType").OTP_EVENT_TYPE.MESSAGE_DELETED,otpEventSource:d("WAWebWamEnumOtpEventSource").OTP_EVENT_SOURCE.OTP_MESSAGE,ctaType:d("WAWebWamEnumCtaType").CTA_TYPE.COPY_CODE});yield m(b,a);b.commit()});return l.apply(this,arguments)}function m(a,b){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a.otpSessionId=(yield q(b));a.receiverCountryCode=String(d("WAWebLinkDevicePhoneNumberEntryInputFormatUtils").getCountryCodeIso(d("WAWebUserPrefsMeUser").getMeUser().user));var c=b.from.user;c!=null&&(a.businessPhoneNumber=Number(c));c=b.templateId;c!=null&&(a.templateId=c);c=r(b);c!=null&&(a.otpProductType=c);o(a);p(a,b)});return n.apply(this,arguments)}function o(a){a.isKeepChatsArchivedEnabled=d("WAWebSettingsGetters").getShowArchiveV2(c("WAWebSettingsModel")),a.isNotificationEnabled=d("WAWebUserPrefsNotifications").getGlobalNotifications()}function p(a,b){b=d("WAWebFrontendMsgGetters").getChat(b);if(b==null)return;a.chatsFolderType=b.archive?d("WAWebWamEnumChatsFolderType").CHATS_FOLDER_TYPE.ARCHIVED:d("WAWebWamEnumChatsFolderType").CHATS_FOLDER_TYPE.INBOX;a.isMessageNotificationEnabled=!d("WAWebMuteGetters").getIsMuted(b.mute)}function q(a){return d("WACryptoSha256").sha256Str(a.id.id)}function r(a){a=a.hydratedButtons;if(a==null||a.length===0)return null;var b=d("WAWebABProps").getABPropConfigValue("unified_otp_copy_code_url"),c=d("WAWebABProps").getABPropConfigValue("unified_otp_retriever_url");for(a of a){var e;e=(e=a.urlButton)==null?void 0:e.url;if(e==null)continue;if(e.startsWith(b))return d("WAWebWamEnumOtpProductType").OTP_PRODUCT_TYPE.COPY_CODE;else if(e.startsWith(c)){e=(e=new URL(e))==null?void 0:e.searchParams;e=e.get("otp_type");if(e!=null)switch(e){case"COPY_CODE":return d("WAWebWamEnumOtpProductType").OTP_PRODUCT_TYPE.COPY_CODE;case"ONE_TAP":return d("WAWebWamEnumOtpProductType").OTP_PRODUCT_TYPE.ONE_TAP;case"ZERO_TAP":return d("WAWebWamEnumOtpProductType").OTP_PRODUCT_TYPE.ZERO_TAP;default:continue}else return d("WAWebWamEnumOtpProductType").OTP_PRODUCT_TYPE.ONE_TAP}}return null}g.logOTPButtonClick=a;g.logOTPMessageReceived=e;g.logOTPMessageRead=f;g.logOTPMessageDeleted=k}),98); __d("WAWebWamEnumCatalogEntryPoint",[],(function(a,b,c,d,e,f){a=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,CATALOG_ENTRY_POINT_BIZ_ACTION_BAR:20,CATALOG_ENTRY_POINT_BIZ_ONBOARDING:21,CATALOG_ENTRY_POINT_TRUST_CARD:22,CATALOG_ENTRY_POINT_FLOWS:23,CATALOG_ENTRY_POINT_BIZ_AI_HOME:24});f.CATALOG_ENTRY_POINT=a}),66); __d("WAWebWamEnumCatalogViewAction",[],(function(a,b,c,d,e,f){a=Object.freeze({ACTION_CARD_ITEM_CLICK:2,ACTION_CARD_MORE_CLICK:3,ACTION_LIST_IMPRESSION:4,ACTION_DETAIL_IMAGE_CLICK:6,ACTION_DETAIL_LINK_CLICK:7,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_CART_CHAT_ICON_CLICK:42,ACTION_CREATE_CART:43,ACTION_PLP_PRODUCT_VARIANT_BOTTOM_SHEET_OPEN:44,ACTION_PLP_PRODUCT_VARIANT_CHANGE:45,ACTION_PDP_PRODUCT_VARIANT_CHANGE:46,ACTION_PLP_BOTTOM_SHEET_SEE_MORE_DETAILS:47,ACTION_UPDATE_VARIANT_SELECTION:48,ACTION_VIEW_PRODUCT_VARIANTS_BOTTOM_SHEET:49,ACTION_WATCH_PRODUCT_VIDEO:50,ACTION_DETAIL_VIDEO_CLICK:51,ACTION_FULL_VIDEO_SWIPE:52,ACTION_LIST_LOAD:53,ACTION_DETAIL_LOAD:54});f.CATALOG_VIEW_ACTION=a}),66); __d("WAWebWamEnumDeepLinkOpenFrom",[],(function(a,b,c,d,e,f){a=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,DEEP_LINK_MESSENGER_APP:6});f.DEEP_LINK_OPEN_FROM=a}),66); __d("WAWebBizCatalogViewWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumBizPlatform","WAWebWamEnumCatalogEntryPoint","WAWebWamEnumCatalogViewAction","WAWebWamEnumDeepLinkOpenFrom","WAWebWamEnumEntryPointConversationInitiated"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({BizCatalogView:[3006,{adId:[26,a.TYPES.STRING],bizPlatform:[14,d("WAWebWamEnumBizPlatform").BIZ_PLATFORM],cartToggle:[13,a.TYPES.BOOLEAN],catalogCategoryId:[19,a.TYPES.STRING],catalogEntryPoint:[2,d("WAWebWamEnumCatalogEntryPoint").CATALOG_ENTRY_POINT],catalogEventSampled:[11,a.TYPES.BOOLEAN],catalogOwnerJid:[10,a.TYPES.STRING],catalogReportReasonCode:[8,a.TYPES.STRING],catalogSessionId:[3,a.TYPES.STRING],catalogViewAction:[1,d("WAWebWamEnumCatalogViewAction").CATALOG_VIEW_ACTION],collectionId:[15,a.TYPES.STRING],collectionIndex:[16,a.TYPES.STRING],deepLinkOpenFrom:[12,d("WAWebWamEnumDeepLinkOpenFrom").DEEP_LINK_OPEN_FROM],entryPointConversationInitiated:[22,d("WAWebWamEnumEntryPointConversationInitiated").ENTRY_POINT_CONVERSATION_INITIATED],entryPointConversionApp:[20,a.TYPES.STRING],entryPointConversionSource:[21,a.TYPES.STRING],hasVariants:[23,a.TYPES.BOOLEAN],isNewProductAddedToCart:[7,a.TYPES.BOOLEAN],isOrderMsgAttached:[5,a.TYPES.BOOLEAN],orderId:[4,a.TYPES.STRING],productId:[9,a.TYPES.STRING],productIndex:[17,a.TYPES.STRING],quantity:[6,a.TYPES.INTEGER],sequenceNumber:[18,a.TYPES.INTEGER],variantTypes:[24,a.TYPES.STRING],variantsExtraAttributes:[25,a.TYPES.STRING]},[1,1,1],"private",0]},{BizCatalogView:[]});g.BizCatalogViewWamEvent=b}),98); __d("WAWebWamEnumCatalogBizAction",[],(function(a,b,c,d,e,f){a=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_ITEM_CLICK:21,ACTION_CARD_MORE_CLICK:22,ACTION_LIST_IMPRESSION:23,ACTION_DETAIL_IMAGE_CLICK:25,ACTION_DETAIL_LINK_CLICK:26,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_CHANGE_ORDER:80,ACTION_COLLECTION_ITEM_CHANGE_ORDER:81,ACTION_ERROR_SAVING_ITEM:82,ACTION_MEDIA_DELETE_SUCCESS:83,ACTION_SAVING_PRODUCT_PROGRESS_BAR:84,ACTION_CONTINUE_SAVING_PRODUCT:85,ACTION_ABORT_SAVING_PRODUCT:86,ACTION_CLICK_SAVE_PRODUCT:87,ACTION_CHOOSE_PRODUCT_INTENT:88,ACTION_DETAIL_VIDEO_CLICK:89,ACTION_WATCH_PRODUCT_VIDEO:90,ACTION_FULL_VIDEO_SWIPE:91,ACTION_PROCEED_TO_REPLACE_MEDIA:92,ACTION_PRODUCT_LINK_SHARE_TO_STATUS_BTN_IMPRESSION:93,ACTION_PRODUCT_LINK_SHARE_TO_STATUS_BTN_CLICKED:94,ACTION_CATALOG_LINK_SHARE_TO_STATUS_BTN_IMPRESSION:95,ACTION_CATALOG_LINK_SHARE_TO_STATUS_BTN_CLICKED:96});f.CATALOG_BIZ_ACTION=a}),66); __d("WAWebCatalogBizWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumCatalogBizAction","WAWebWamEnumCatalogEntryPoint","WAWebWamEnumDeepLinkOpenFrom","WAWebWamEnumLastMessageDirection"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({CatalogBiz:[1722,{adId:[19,a.TYPES.STRING],cartToggle:[13,a.TYPES.BOOLEAN],catalogAppealReason:[4,a.TYPES.STRING],catalogBizAction:[1,d("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION],catalogEntryPoint:[7,d("WAWebWamEnumCatalogEntryPoint").CATALOG_ENTRY_POINT],catalogSessionId:[3,a.TYPES.STRING],collectionCount:[18,a.TYPES.INTEGER],collectionId:[14,a.TYPES.STRING],collectionIndex:[15,a.TYPES.STRING],deepLinkOpenFrom:[8,d("WAWebWamEnumDeepLinkOpenFrom").DEEP_LINK_OPEN_FROM],entryPointConversionSource:[20,a.TYPES.STRING],errorCode:[5,a.TYPES.INTEGER],extraAttributes:[24,a.TYPES.STRING],isOrderMsgAttached:[10,a.TYPES.BOOLEAN],lastMessageDirection:[21,d("WAWebWamEnumLastMessageDirection").LAST_MESSAGE_DIRECTION],messageDepth:[22,a.TYPES.INTEGER],orderId:[9,a.TYPES.STRING],productCount:[6,a.TYPES.INTEGER],productId:[2,a.TYPES.STRING],productIds:[12,a.TYPES.STRING],productIndex:[16,a.TYPES.STRING],quantity:[11,a.TYPES.INTEGER],threadIdHmac:[23,a.TYPES.STRING]},[1,1,1],"regular"]},{CatalogBiz:[]});g.CatalogBizWamEvent=b}),98); __d("WAWebProductCatalogSession",["WALogger"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Session ID requested without being set, returning a randon accidental session. Please investigate."]);h=function(){return a};return a}var i="accidental_session";a=function(){function a(a){this.accidental=a||!1,this.initSessionId()}var b=a.prototype;b.isAccidental=function(){return this.accidental};b.initSessionId=function(){this.sessionId=this.newSessionId()};b.newSessionId=function(){this.sessionId=Math.floor(2147483648*Math.random());return this.sessionId};b.toString=function(){var a=""+this.sessionId;this.accidental&&(d("WALogger").ERROR(h()),a=i+"_"+a);return a};return a}();g.ProductCatalogSession=a}),98); __d("WAWebProductCatalogContext",["WAWebProductCatalogSession","WAWebWamEnumBizPlatform"],(function(a,b,c,d,e,f,g){function h(a,b,c){a===void 0&&(a=new(d("WAWebProductCatalogSession").ProductCatalogSession)());b===void 0&&(b=d("WAWebWamEnumBizPlatform").BIZ_PLATFORM.UNKNOWN);return{type:"product_catalog",session:a,entryPoint:c,bizPlatform:b}}function i(){return h(new(d("WAWebProductCatalogSession").ProductCatalogSession)(!0))}function a(a){return j(a).session.toString()}function j(a){return a.type==="product_catalog"?a:i()}function b(a){return{catalogSessionId:a.session.toString(),bizPlatform:a.bizPlatform,catalogEntryPoint:a.entryPoint}}g.buildProductCatalogContext=h;g.getProductCatalogSessionId=a;g.getProductCatalogContext=j;g.toDataForCatalogViewEvents=b}),98); __d("WAWebProductCatalogEventUtils",["WAWebBizCatalogViewWamEvent","WAWebBizGatingUtils","WAWebCatalogBizWamEvent","WAWebUserPrefsMeUser","WAWebWid","WAWebWidFactory","isStringNullOrEmpty"],(function(a,b,c,d,e,f,g){a=function(a){var b;!c("isStringNullOrEmpty")(a.catalogOwnerJid)?b=d("WAWebWidFactory").createWid(a.catalogOwnerJid):a.catalogOwnerWid?b=a.catalogOwnerWid:a.product&&(b=a.product.catalogWid);return b instanceof c("WAWebWid")&&d("WAWebUserPrefsMeUser").isMeAccount(b)};b=function(a){var b=a.isOwner,c=a.catalogBizAction,e=a.catalogViewAction,f=a.bizActionConfig,g=a.bizPlatform,h=a.catalogOwnerJid;a=babelHelpers.objectWithoutPropertiesLoose(a,["isOwner","catalogBizAction","catalogViewAction","bizActionConfig","bizPlatform","catalogOwnerJid"]);if(c&&b){new(d("WAWebCatalogBizWamEvent").CatalogBizWamEvent)(babelHelpers["extends"]({catalogBizAction:c},a,f)).commit();return}if(e&&d("WAWebBizGatingUtils").isPSForCatalogViewEnabled()){new(d("WAWebBizCatalogViewWamEvent").BizCatalogViewWamEvent)(babelHelpers["extends"]({catalogViewAction:e,bizPlatform:g,catalogOwnerJid:h},a)).commit();return}};g.isCatalogOwner=a;g.logCatalogViewOrBizEvent=b}),98); __d("WAWebProductCatalogLogEvents",["WAWebBizCatalogUtils","WAWebBizCatalogViewWamEvent","WAWebCatalogBizWamEvent","WAWebProductCatalogContext","WAWebProductCatalogEventUtils","WAWebProductCatalogSession","WAWebUserPrefsMeUser","WAWebWamEnumCatalogBizAction","WAWebWamEnumCatalogEntryPoint","WAWebWamEnumCatalogViewAction","WAWebWidFactory","isStringNullOrEmpty"],(function(a,b,c,d,e,f,g){function a(a){var b=a.catalogOwnerWid;a=a.catalogContext;d("WAWebProductCatalogEventUtils").logCatalogViewOrBizEvent(babelHelpers["extends"]({},d("WAWebProductCatalogContext").toDataForCatalogViewEvents(a),{isOwner:d("WAWebProductCatalogEventUtils").isCatalogOwner({catalogOwnerWid:b}),catalogOwnerJid:b.toJid()}))}function b(a){var b=a.product;a=a.catalogContext;d("WAWebProductCatalogEventUtils").logCatalogViewOrBizEvent(babelHelpers["extends"]({isOwner:d("WAWebProductCatalogEventUtils").isCatalogOwner({product:b}),catalogBizAction:d("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_CARD_ITEM_CLICK},d("WAWebProductCatalogContext").toDataForCatalogViewEvents(a),{catalogOwnerJid:b.catalogWid.toJid()}))}function e(a){var b=a.catalogOwnerWid;a=a.catalogContext;d("WAWebProductCatalogEventUtils").logCatalogViewOrBizEvent(babelHelpers["extends"]({isOwner:d("WAWebProductCatalogEventUtils").isCatalogOwner({catalogOwnerWid:b}),catalogBizAction:d("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_CARD_MORE_CLICK,catalogOwnerJid:b.toJid()},d("WAWebProductCatalogContext").toDataForCatalogViewEvents(a)))}function f(a){var b=a.catalogOwnerWid,c=a.catalogContext;a=a.cartToggle;d("WAWebProductCatalogEventUtils").logCatalogViewOrBizEvent(babelHelpers["extends"]({isOwner:d("WAWebProductCatalogEventUtils").isCatalogOwner({catalogOwnerWid:b}),catalogViewAction:d("WAWebWamEnumCatalogViewAction").CATALOG_VIEW_ACTION.ACTION_LIST_IMPRESSION,catalogOwnerJid:b.toJid(),cartToggle:a},d("WAWebProductCatalogContext").toDataForCatalogViewEvents(c)))}function h(a){var b=a.catalogOwnerWid;a=a.catalogContext;var c=d("WAWebProductCatalogEventUtils").isCatalogOwner({catalogOwnerWid:b});d("WAWebProductCatalogEventUtils").logCatalogViewOrBizEvent(babelHelpers["extends"]({isOwner:c,catalogBizAction:d("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_SHARE_CATALOG_LINK_CLICK,catalogViewAction:d("WAWebWamEnumCatalogViewAction").CATALOG_VIEW_ACTION.ACTION_SHARE_CATALOG_LINK_CLICK,catalogOwnerJid:b.toJid()},d("WAWebProductCatalogContext").toDataForCatalogViewEvents(a)))}function i(a){var b=a.product;a=a.catalogContext;d("WAWebProductCatalogEventUtils").logCatalogViewOrBizEvent(babelHelpers["extends"]({catalogOwnerJid:b.catalogWid.toJid(),isOwner:d("WAWebProductCatalogEventUtils").isCatalogOwner({product:b})},d("WAWebProductCatalogContext").toDataForCatalogViewEvents(a)))}function j(a){var b=a.product;a=a.catalogContext;d("WAWebProductCatalogEventUtils").logCatalogViewOrBizEvent(babelHelpers["extends"]({isOwner:d("WAWebProductCatalogEventUtils").isCatalogOwner({product:b}),catalogBizAction:d("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_DETAIL_IMAGE_CLICK,catalogViewAction:d("WAWebWamEnumCatalogViewAction").CATALOG_VIEW_ACTION.ACTION_DETAIL_IMAGE_CLICK,catalogOwnerJid:b.catalogWid.toJid(),productId:b.id.toString()},d("WAWebProductCatalogContext").toDataForCatalogViewEvents(a)))}function k(a){var b=a.product;a=a.catalogContext;d("WAWebProductCatalogEventUtils").logCatalogViewOrBizEvent(babelHelpers["extends"]({catalogOwnerJid:b.catalogWid.toJid(),isOwner:d("WAWebProductCatalogEventUtils").isCatalogOwner({product:b}),catalogBizAction:d("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_DETAIL_LINK_CLICK,catalogViewAction:d("WAWebWamEnumCatalogViewAction").CATALOG_VIEW_ACTION.ACTION_DETAIL_LINK_CLICK,productId:b.id.toString()},d("WAWebProductCatalogContext").toDataForCatalogViewEvents(a)))}function l(a){var b=a.product;a=a.catalogSessionId;d("WAWebProductCatalogEventUtils").logCatalogViewOrBizEvent({catalogOwnerJid:b.catalogWid.toJid(),isOwner:d("WAWebProductCatalogEventUtils").isCatalogOwner({product:b}),catalogSessionId:a})}function m(a){var b=a.product;a=a.catalogSessionId;d("WAWebProductCatalogEventUtils").logCatalogViewOrBizEvent({catalogOwnerJid:b.catalogWid.toJid(),isOwner:d("WAWebProductCatalogEventUtils").isCatalogOwner({product:b}),catalogSessionId:a})}function n(a){var b=a.product;a=a.catalogSessionId;d("WAWebProductCatalogEventUtils").logCatalogViewOrBizEvent({catalogOwnerJid:b.catalogWid.toJid(),isOwner:d("WAWebProductCatalogEventUtils").isCatalogOwner({product:b}),catalogSessionId:a})}function o(a){var b=a.product;a=a.catalogSessionId;d("WAWebProductCatalogEventUtils").logCatalogViewOrBizEvent({catalogOwnerJid:b.catalogWid.toJid(),isOwner:d("WAWebProductCatalogEventUtils").isCatalogOwner({product:b}),catalogBizAction:d("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_FULL_IMAGE_SWIPE,catalogViewAction:d("WAWebWamEnumCatalogViewAction").CATALOG_VIEW_ACTION.ACTION_FULL_IMAGE_SWIPE,catalogSessionId:a,productId:b.id.toString()})}function p(a){var b=a.product,c=a.catalogContext,e=a.cartToggle;a=a.collectionId;a=d("WAWebBizCatalogUtils").getProductStatsInFetched(b.catalogWid.toString(),a,b);d("WAWebProductCatalogEventUtils").logCatalogViewOrBizEvent(babelHelpers["extends"]({catalogOwnerJid:b.catalogWid.toJid(),isOwner:d("WAWebProductCatalogEventUtils").isCatalogOwner({product:b}),catalogBizAction:d("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_DETAIL_IMPRESSION,catalogViewAction:d("WAWebWamEnumCatalogViewAction").CATALOG_VIEW_ACTION.ACTION_DETAIL_IMPRESSION,cartToggle:e},a,d("WAWebProductCatalogContext").toDataForCatalogViewEvents(c)))}function q(a){var b=a.product,c=a.catalogSessionId;a=a.reason;new(d("WAWebBizCatalogViewWamEvent").BizCatalogViewWamEvent)({catalogViewAction:d("WAWebWamEnumCatalogViewAction").CATALOG_VIEW_ACTION.ACTION_REPORT_PRODUCT_SUCCESS,catalogSessionId:c,catalogOwnerJid:b.catalogWid.toJid(),catalogReportReasonCode:a,productId:b.id.toString()}).commit()}function r(a){var b=a.product,c=a.catalogSessionId;a=a.reason;new(d("WAWebBizCatalogViewWamEvent").BizCatalogViewWamEvent)({catalogViewAction:d("WAWebWamEnumCatalogViewAction").CATALOG_VIEW_ACTION.ACTION_REPORT_PRODUCT_FAILURE,catalogOwnerJid:b.catalogWid.toJid(),catalogSessionId:c,catalogReportReasonCode:a,productId:b.id.toString()}).commit()}function s(a){var b=a.product;a=a.catalogContext;var c=d("WAWebProductCatalogEventUtils").isCatalogOwner({product:b});d("WAWebProductCatalogEventUtils").logCatalogViewOrBizEvent(babelHelpers["extends"]({isOwner:c,catalogOwnerJid:b.catalogWid.toJid(),catalogBizAction:d("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_QUOTED_PRODUCT_IN_CONVERSATION_CLICK},d("WAWebProductCatalogContext").toDataForCatalogViewEvents(a)))}function t(a){var b=a.product;a=a.catalogContext;d("WAWebProductCatalogEventUtils").logCatalogViewOrBizEvent(babelHelpers["extends"]({isOwner:d("WAWebProductCatalogEventUtils").isCatalogOwner({product:b}),catalogOwnerJid:b.catalogWid.toJid(),catalogBizAction:d("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_PRODUCT_IN_CONVERSATION_CLICK},d("WAWebProductCatalogContext").toDataForCatalogViewEvents(a)))}function u(a){var b=a.product;a=a.catalogContext;d("WAWebProductCatalogEventUtils").logCatalogViewOrBizEvent(babelHelpers["extends"]({isOwner:d("WAWebProductCatalogEventUtils").isCatalogOwner({product:b}),catalogBizAction:d("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_SHARE_PRODUCT_LINK_CLICK,catalogOwnerJid:b.catalogWid.toJid(),catalogViewAction:d("WAWebWamEnumCatalogViewAction").CATALOG_VIEW_ACTION.ACTION_SHARE_PRODUCT_LINK_CLICK,productId:b.id.toString()},d("WAWebProductCatalogContext").toDataForCatalogViewEvents(a)))}function v(a,b){d("WAWebProductCatalogEventUtils").logCatalogViewOrBizEvent(babelHelpers["extends"]({isOwner:d("WAWebProductCatalogEventUtils").isCatalogOwner({product:a}),catalogBizAction:d("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_MESSAGE_BUSINESS_BUTTON_CLICK,catalogOwnerJid:a.catalogWid.toJid(),catalogViewAction:d("WAWebWamEnumCatalogViewAction").CATALOG_VIEW_ACTION.ACTION_MESSAGE_BUSINESS_BUTTON_CLICK,productId:a.id.toString()},d("WAWebProductCatalogContext").toDataForCatalogViewEvents(b)))}function w(a,b){var e=!1,f="";a.businessOwnerJid!=null&&(f=a.businessOwnerJid,e=d("WAWebUserPrefsMeUser").getMeUser().equals(d("WAWebWidFactory").createWid(f)));d("WAWebProductCatalogEventUtils").logCatalogViewOrBizEvent({isOwner:e,catalogOwnerJid:f,catalogBizAction:d("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_QUOTED_PRODUCT_MESSAGE_SEND,catalogViewAction:d("WAWebWamEnumCatalogViewAction").CATALOG_VIEW_ACTION.ACTION_QUOTED_PRODUCT_MESSAGE_SEND,productId:a==null?void 0:(e=a.productId)==null?void 0:e.toString(),catalogSessionId:c("isStringNullOrEmpty")(b)?new(d("WAWebProductCatalogSession").ProductCatalogSession)().toString():b})}function x(a){var b=a.product;a=a.catalogContext;d("WAWebProductCatalogEventUtils").logCatalogViewOrBizEvent(babelHelpers["extends"]({isOwner:d("WAWebProductCatalogEventUtils").isCatalogOwner({product:b}),catalogBizAction:d("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_SHARE_PRODUCT_COPY_LINK_CLICK,catalogOwnerJid:b.catalogWid.toJid(),catalogViewAction:d("WAWebWamEnumCatalogViewAction").CATALOG_VIEW_ACTION.ACTION_SHARE_PRODUCT_COPY_LINK_CLICK,productId:b.id.toString()},d("WAWebProductCatalogContext").toDataForCatalogViewEvents(a)))}function y(a){var b=a.product;a=a.catalogContext;d("WAWebProductCatalogEventUtils").logCatalogViewOrBizEvent(babelHelpers["extends"]({isOwner:d("WAWebProductCatalogEventUtils").isCatalogOwner({product:b}),catalogOwnerJid:b.catalogWid.toJid(),catalogBizAction:d("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_SHARE_PRODUCT_VIA_WA_LINK_CLICK,catalogViewAction:d("WAWebWamEnumCatalogViewAction").CATALOG_VIEW_ACTION.ACTION_SHARE_PRODUCT_VIA_WA_LINK_CLICK,productId:b.id.toString()},d("WAWebProductCatalogContext").toDataForCatalogViewEvents(a)))}function z(a){a=new(d("WAWebCatalogBizWamEvent").CatalogBizWamEvent)({catalogBizAction:d("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_CATALOG_IN_CONVERSATION_CLICK,catalogEntryPoint:d("WAWebWamEnumCatalogEntryPoint").CATALOG_ENTRY_POINT.CATALOG_ENTRY_POINT_ATTACHMENT_PANEL,catalogSessionId:a});a.commit()}function A(a){var b=a.product;a=a.catalogSessionId;d("WAWebProductCatalogEventUtils").logCatalogViewOrBizEvent({isOwner:d("WAWebProductCatalogEventUtils").isCatalogOwner({product:b}),catalogBizAction:d("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_SEND_PRODUCT_MESSAGE,catalogOwnerJid:b.catalogWid.toJid(),catalogViewAction:d("WAWebWamEnumCatalogViewAction").CATALOG_VIEW_ACTION.ACTION_SEND_PRODUCT_MESSAGE,catalogSessionId:a,productId:b.id.toString()})}function B(a){a.catalogOwnerWid;a=a.catalogSessionId;a=new(d("WAWebCatalogBizWamEvent").CatalogBizWamEvent)({catalogBizAction:d("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_SEND_CATALOG_CLICK,catalogSessionId:a});a.commit()}function C(a){var b=a.catalogOwnerWid;a=a.catalogContext;d("WAWebProductCatalogEventUtils").logCatalogViewOrBizEvent(babelHelpers["extends"]({isOwner:d("WAWebProductCatalogEventUtils").isCatalogOwner({catalogOwnerWid:b}),catalogBizAction:d("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_SHARE_CATALOG_COPY_LINK_CLICK,catalogOwnerJid:b.toJid(),catalogViewAction:d("WAWebWamEnumCatalogViewAction").CATALOG_VIEW_ACTION.ACTION_SHARE_CATALOG_COPY_LINK_CLICK},d("WAWebProductCatalogContext").toDataForCatalogViewEvents(a)))}function D(a){var b=a.catalogOwnerWid;a=a.catalogContext;d("WAWebProductCatalogEventUtils").logCatalogViewOrBizEvent(babelHelpers["extends"]({catalogOwnerJid:b.toJid(),isOwner:d("WAWebProductCatalogEventUtils").isCatalogOwner({catalogOwnerWid:b}),catalogBizAction:d("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_SHARE_CATALOG_VIA_WA_LINK_CLICK,catalogViewAction:d("WAWebWamEnumCatalogViewAction").CATALOG_VIEW_ACTION.ACTION_SHARE_CATALOG_VIA_WA_LINK_CLICK},d("WAWebProductCatalogContext").toDataForCatalogViewEvents(a)))}function E(a,b){b={has_catalog:b};a=new(d("WAWebCatalogBizWamEvent").CatalogBizWamEvent)({catalogBizAction:d("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_PRODUCT_ADD_CLICKED,catalogSessionId:a.session.toString(),catalogEntryPoint:a.entryPoint,extraAttributes:JSON.stringify(b)});a.commit()}function F(a){a=new(d("WAWebCatalogBizWamEvent").CatalogBizWamEvent)({catalogBizAction:d("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_PRODUCT_ADD_SUCCESS,catalogEntryPoint:a.entryPoint,catalogSessionId:a.session.toString()});a.commit()}function G(a){a=new(d("WAWebCatalogBizWamEvent").CatalogBizWamEvent)({catalogBizAction:d("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_PRODUCT_ADD_FAILED,catalogEntryPoint:a.entryPoint,catalogSessionId:a.session.toString()});a.commit()}function H(a,b){a=new(d("WAWebCatalogBizWamEvent").CatalogBizWamEvent)({catalogBizAction:d("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_PRODUCT_EDIT_CLICKED,productId:a.id.toString(),catalogEntryPoint:b.entryPoint,catalogSessionId:b.session.toString()});a.commit()}function I(a,b){a=new(d("WAWebCatalogBizWamEvent").CatalogBizWamEvent)({catalogBizAction:d("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_PRODUCT_EDIT_SUCCESS,catalogEntryPoint:b.entryPoint,productId:a.id.toString(),catalogSessionId:b.session.toString()});a.commit()}function J(a,b,c){a=new(d("WAWebCatalogBizWamEvent").CatalogBizWamEvent)({catalogBizAction:d("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_PRODUCT_EDIT_FAILED,catalogEntryPoint:b.entryPoint,productId:a.id.toString(),errorCode:c,catalogSessionId:b.session.toString()});a.commit()}function K(a,b,c){a=new(d("WAWebCatalogBizWamEvent").CatalogBizWamEvent)({catalogBizAction:d("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_PRODUCT_DELETE_CLICKED,catalogEntryPoint:c.entryPoint,productId:a.id.toString(),productCount:b,catalogSessionId:c.session.toString()});a.commit()}function L(a,b,c){a=new(d("WAWebCatalogBizWamEvent").CatalogBizWamEvent)({catalogBizAction:d("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_PRODUCT_DELETE_SUCCESS,catalogEntryPoint:c.entryPoint,productId:a.id.toString(),productCount:b,catalogSessionId:c.session.toString()});a.commit()}function M(a,b,c,e){a=new(d("WAWebCatalogBizWamEvent").CatalogBizWamEvent)({catalogBizAction:d("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_PRODUCT_DELETE_FAILED,catalogEntryPoint:c.entryPoint,productId:a.id.toString(),productCount:b,errorCode:e,catalogSessionId:c.session.toString()});a.commit()}function N(a){a=new(d("WAWebCatalogBizWamEvent").CatalogBizWamEvent)({catalogBizAction:d("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_ONBOARD_IMPRESSION,catalogEntryPoint:a.entryPoint,catalogSessionId:a.session.toString()});a.commit()}function O(a){a=new(d("WAWebCatalogBizWamEvent").CatalogBizWamEvent)({catalogBizAction:d("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_CREATE_PRODUCT_CATALOG,catalogEntryPoint:a.entryPoint,catalogSessionId:a.session.toString()});a.commit()}function P(a){a=new(d("WAWebCatalogBizWamEvent").CatalogBizWamEvent)({catalogBizAction:d("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_CREATE_PRODUCT_CATALOG_SUCCESS,catalogEntryPoint:a.entryPoint,catalogSessionId:a.session.toString()});a.commit()}function Q(a,b){b=new(d("WAWebCatalogBizWamEvent").CatalogBizWamEvent)({catalogBizAction:d("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_CREATE_PRODUCT_CATALOG_FAILED,catalogEntryPoint:a.entryPoint,errorCode:b,catalogSessionId:a.session.toString()});b.commit()}function R(a){a=new(d("WAWebCatalogBizWamEvent").CatalogBizWamEvent)({catalogBizAction:d("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_APPEAL_PRODUCT_CLICKED,catalogEntryPoint:d("WAWebWamEnumCatalogEntryPoint").CATALOG_ENTRY_POINT.CATALOG_ENTRY_POINT_SETTINGS,catalogSessionId:a});a.commit()}function S(a){a=new(d("WAWebCatalogBizWamEvent").CatalogBizWamEvent)({catalogBizAction:d("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_APPEAL_PRODUCT_SUCCESS,catalogEntryPoint:d("WAWebWamEnumCatalogEntryPoint").CATALOG_ENTRY_POINT.CATALOG_ENTRY_POINT_SETTINGS,catalogSessionId:a});a.commit()}function T(a,b){b=new(d("WAWebCatalogBizWamEvent").CatalogBizWamEvent)({catalogBizAction:d("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_APPEAL_PRODUCT_FAILED,catalogEntryPoint:d("WAWebWamEnumCatalogEntryPoint").CATALOG_ENTRY_POINT.CATALOG_ENTRY_POINT_SETTINGS,errorCode:b,catalogSessionId:a});b.commit()}function U(a,b){b=new(d("WAWebCatalogBizWamEvent").CatalogBizWamEvent)({catalogBizAction:d("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_MENU_CLICK,catalogEntryPoint:b==null?void 0:b.entryPoint,catalogSessionId:b==null?void 0:b.session.toString(),productId:a});b.commit()}function V(a,b){b=new(d("WAWebCatalogBizWamEvent").CatalogBizWamEvent)({catalogBizAction:d("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_PRODUCT_HIDE_CLICKED,catalogEntryPoint:b.entryPoint,catalogSessionId:b.session.toString(),productId:a});b.commit()}function W(a,b){b=new(d("WAWebCatalogBizWamEvent").CatalogBizWamEvent)({catalogBizAction:d("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_PRODUCT_HIDE_SUCCESS,catalogEntryPoint:b.entryPoint,catalogSessionId:b.session.toString(),productId:a});b.commit()}function X(a,b){b=new(d("WAWebCatalogBizWamEvent").CatalogBizWamEvent)({catalogBizAction:d("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_PRODUCT_HIDE_CANCELLED,catalogEntryPoint:b.entryPoint,catalogSessionId:b.session.toString(),productId:a});b.commit()}function Y(a,b){b=new(d("WAWebCatalogBizWamEvent").CatalogBizWamEvent)({catalogBizAction:d("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_PRODUCT_HIDE_FAILED,catalogEntryPoint:b.entryPoint,catalogSessionId:b.session.toString(),productId:a});b.commit()}function Z(a,b){b=new(d("WAWebCatalogBizWamEvent").CatalogBizWamEvent)({catalogBizAction:d("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_PRODUCT_UNHIDE_CLICKED,catalogEntryPoint:b.entryPoint,catalogSessionId:b.session.toString(),productId:a});b.commit()}function $(a,b){b=new(d("WAWebCatalogBizWamEvent").CatalogBizWamEvent)({catalogBizAction:d("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_PRODUCT_UNHIDE_SUCCESS,catalogEntryPoint:b.entryPoint,catalogSessionId:b.session.toString(),productId:a});b.commit()}function aa(a,b){b=new(d("WAWebCatalogBizWamEvent").CatalogBizWamEvent)({catalogBizAction:d("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_PRODUCT_UNHIDE_CANCELLED,catalogEntryPoint:b.entryPoint,catalogSessionId:b.session.toString(),productId:a});b.commit()}function ba(a,b){b=new(d("WAWebCatalogBizWamEvent").CatalogBizWamEvent)({catalogBizAction:d("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_PRODUCT_UNHIDE_FAILED,catalogEntryPoint:b.entryPoint,catalogSessionId:b.session.toString(),productId:a});b.commit()}g.logBusinessProfileCatalogView=a;g.logProfileProductClick=b;g.logCarouselViewMoreClick=e;g.logCatalogListView=f;g.logCatalogShareLinkClick=h;g.logCatalogListDetailClick=i;g.logDetailImageClick=j;g.logDetailLinkClick=k;g.logImageCarouselModalView=l;g.logImageListClick=m;g.logFullImageView=n;g.logImageNavigate=o;g.logProductDetailView=p;g.logReportProductSuccess=q;g.logReportProductFailure=r;g.logProductInquiryClick=s;g.logProductMsgClick=t;g.logProductShareLinkClick=u;g.logProductMessageBusinessClick=v;g.logProductMessageBusinessSend=w;g.logShareProductCopyLinkClick=x;g.logShareProductViaWALinkClick=y;g.logCatalogAttachmentButtonClick=z;g.logProductMessageSent=A;g.logSendCatalogClick=B;g.logShareCatalogCopyLinkClick=C;g.logShareCatalogViaWALinkClick=D;g.logAddProductClick=E;g.logAddProductSuccess=F;g.logAddProductFailed=G;g.logEditProductClick=H;g.logEditProductSuccess=I;g.logEditProductFailed=J;g.logDeleteProductClick=K;g.logDeleteProductSuccess=L;g.logDeleteProductFailed=M;g.logCatalogOnboardImpression=N;g.logCreateProductCatalogClick=O;g.logCreateProductCatalogSuccess=P;g.logCreateProductCatalogFailed=Q;g.logAppealProductCatalogClick=R;g.logAppealProductCatalogSuccess=S;g.logAppealProductCatalogFailed=T;g.logCatalogContextMenuClick=U;g.logCatalogProductHideClick=V;g.logCatalogProductHideSuccess=W;g.logCatalogProductHideCancelled=X;g.logCatalogProductHideFailed=Y;g.logCatalogProductShowClick=Z;g.logCatalogProductShowSuccess=$;g.logCatalogProductShowCancelled=aa;g.logCatalogProductShowFailed=ba}),98); __d("WAWebProductCatalogMetaLinkingGatingUtils",["fbt","WAWebABProps","WAWebBizGatingUtils","WAWebBusinessProfileCollection","WAWebBusinessProfileTypes","WAWebUserPrefsMeUser","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g,h){"use strict";function a(){return h._(/*BTDS*/"__JHASH__0NQR5PGKJRP__JHASH__")}function c(){if(!m())return!1;var a=d("WAWebBusinessProfileCollection").BusinessProfileCollection.get(d("WAWebUserPrefsMeUser").getMeUser());return n(a)}function e(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){return!m()?!1:j(a)});return i.apply(this,arguments)}function f(){if(d("WAWebBizGatingUtils").isCatalogVariantsViewingEnabled())return!1;if(m())return!1;var a=d("WAWebBusinessProfileCollection").BusinessProfileCollection.get(d("WAWebUserPrefsMeUser").getMeUser());return n(a)}function j(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebBusinessProfileCollection").BusinessProfileCollection.fetchBizProfile(a));return n(a)});return k.apply(this,arguments)}function l(a){return n(a)}function m(){return d("WAWebABProps").getABPropConfigValue("meta_catalog_linking_m2_enabled")}function n(a){if(o())return!0;return d("WAWebBizGatingUtils").isCatalogVariantsViewingEnabled()?!1:(a==null?void 0:(a=a.profileOptions)==null?void 0:a.commerceExperience)===d("WAWebBusinessProfileTypes").CommerceExperienceTypes.META_CATALOG}function o(){var a=window.location.search;a=new URLSearchParams(a);return a.get("force_disable_catalog")==="1"}g.getDisabledMetaLinkedCatalogTooltipText=a;g.shouldShowMetaLinkedDisabledCatalogTooltipForSelf=c;g.shouldShowMetaLinkedDisabledCatalogTooltip=e;g.shouldDisableCatalogDueToMetaLinkingForSelf=f;g.shouldDisableCatalogDueToMetaLinking=j;g.shouldDisableCatalogDueToMetaLinkingForProfile=l;g.linkedCatalogDisabledTooltipEnabled=m}),226); __d("WAWebAnnouncementSpeakerIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k="announcement-speaker";function a(a){var b=a.iconXstyle,e=a.height,f=a.width,g=a.viewBox;a=babelHelpers.objectWithoutPropertiesLoose(a,["iconXstyle","height","width","viewBox"]);var h;if(g){var l=g.x;l=l===void 0?0:l;var m=g.y;m=m===void 0?0:m;var n=g.width;n=n===void 0?0:n;g=g.height;g=g===void 0?0:g;h=[l,m,n,g].join(" ")}l=212;m=212;(e!=null||f!=null)&&(l=e,m=f);return j.jsx(d("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers["extends"]({name:k},a,{children:j.jsxs("svg",{viewBox:(n=h)!=null?n:"0 0 212 212",height:l,width:m,preserveAspectRatio:"xMidYMid meet",className:(i||(i=c("stylex")))(b),fill:"currentColor",children:[j.jsx("title",{children:k}),j.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"})]})}))}a.displayName=a.name+" [from "+f.id+"]";g.AnnouncementSpeakerIcon=a}),98); __d("WAWebAvatarSpinner.react",["fbt","WAWebClassnames","WAWebSpinner.react","react","stylex"],(function(a,b,c,d,e,f,g,h){var i,j,k=i||c("react"),l={container:{position:"x10l6tqk",top:"x13vifvy",start:"x17qophe",display:"x78zum5",alignItems:"x6s0dn4",justifyContent:"xl56j7k",width:"xh8yej3",height:"x5yr21d",backgroundColor:"x146q241",borderTopStartRadius:"x14yjl9h",borderTopEndRadius:"xudhj91",borderBottomEndRadius:"x18nykt9",borderBottomStartRadius:"xww2gxu",$$css:!0}};function a(a){var b=a.ref;a=babelHelpers.objectWithoutPropertiesLoose(a,["ref"]);var e=a.className,f=a.xstyle;a=a.size;a=a===void 0?50:a;return k.jsx("div",{"aria-label":h._(/*BTDS*/"__JHASH__-vC9DaC52BS__JHASH__"),ref:b,className:d("WAWebClassnames").classnamesConvertMeToStylexPlease((j||(j=c("stylex")))(l.container,f),e),children:k.jsx(d("WAWebSpinner.react").Spinner,{size:a,stroke:3,color:"solidwhite"})})}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),226); __d("WAWebChatProfilePictureGatingUtils",["WAWebABProps","WAWebWid"],(function(a,b,c,d,e,f,g){function h(){return d("WAWebABProps").getABPropConfigValue("group_chat_profile_pictures_v2_enabled")}function a(a){return h()&&a!=null&&c("WAWebWid").isUser(a)&&!c("WAWebWid").isPSA(a)}g.shouldDisplayInitialsInProfilePicture=a}),98); __d("WAWebCommunityGeneralChatImage.react",["bx","react"],(function(a,b,c,d,e,f,g){var h,i=h||c("react"),j=c("bx").getURL(c("bx")("10639"));b=""+window.location.origin+j;function a(){return i.jsx("div",{className:"x10l6tqk x13vifvy x17qophe xh8yej3 x5yr21d x1xsqp64 x18d0r48 x1vjfegm",style:{backgroundImage:"url("+j+")"},"aria-hidden":!0})}a.displayName=a.name+" [from "+f.id+"]";g.GeneralChatPlaceholderFullUrl=b;g.CommunityGeneralChatImage=a}),98); __d("WAWebCommunitySquircleIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k="community-squircle";function a(a){var b=a.iconXstyle,e=a.height,f=a.width,g=a.viewBox,h=a.innerStyles;a=babelHelpers.objectWithoutPropertiesLoose(a,["iconXstyle","height","width","viewBox","innerStyles"]);var l;if(g){var m=g.x;m=m===void 0?0:m;var n=g.y;n=n===void 0?0:n;var o=g.width;o=o===void 0?0:o;g=g.height;g=g===void 0?0:g;l=[m,n,o,g].join(" ")}m=180;n=180;(e!=null||f!=null)&&(m=e,n=f);return j.jsx(d("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers["extends"]({name:k},a,{children:j.jsxs("svg",{viewBox:(o=l)!=null?o:"0 0 180 180",height:m,width:n,preserveAspectRatio:"xMidYMid meet",className:(i||(i=c("stylex")))(b),fill:"none",children:[j.jsx("title",{children:k}),j.jsx("path",{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",className:i(h==null?void 0:h.background)}),j.jsx("path",{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",className:i(h==null?void 0:h.primary)})]})}))}a.displayName=a.name+" [from "+f.id+"]";g.CommunitySquircleIcon=a}),98); __d("WAWebDefaultBroadcastIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k="default-broadcast";function a(a){var b=a.iconXstyle,e=a.height,f=a.width,g=a.viewBox;a=babelHelpers.objectWithoutPropertiesLoose(a,["iconXstyle","height","width","viewBox"]);var h;if(g){var l=g.x;l=l===void 0?0:l;var m=g.y;m=m===void 0?0:m;var n=g.width;n=n===void 0?0:n;g=g.height;g=g===void 0?0:g;h=[l,m,n,g].join(" ")}l=212;m=212;(e!=null||f!=null)&&(l=e,m=f);return j.jsx(d("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers["extends"]({name:k},a,{children:j.jsxs("svg",{viewBox:(n=h)!=null?n:"0 0 212 212",height:l,width:m,preserveAspectRatio:"xMidYMid meet",className:(i||(i=c("stylex")))(b),version:"1.1",x:"0px",y:"0px",enableBackground:"new 0 0 212 212",children:[j.jsx("title",{children:k}),j.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"}),j.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"})]})}))}a.displayName=a.name+" [from "+f.id+"]";g.DefaultBroadcastIcon=a}),98); __d("WAWebDefaultCommunityRefreshedIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k="default-community-refreshed";function a(a){var b=a.iconXstyle,e=a.height,f=a.width,g=a.viewBox,h=a.innerStyles;a=babelHelpers.objectWithoutPropertiesLoose(a,["iconXstyle","height","width","viewBox","innerStyles"]);var l;if(g){var m=g.x;m=m===void 0?0:m;var n=g.y;n=n===void 0?0:n;var o=g.width;o=o===void 0?0:o;g=g.height;g=g===void 0?0:g;l=[m,n,o,g].join(" ")}m=212;n=212;(e!=null||f!=null)&&(m=e,n=f);return j.jsx(d("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers["extends"]({name:k},a,{children:j.jsxs("svg",{viewBox:(o=l)!=null?o:"0 0 48 48",height:m,width:n,preserveAspectRatio:"xMidYMid meet",className:(i||(i=c("stylex")))(b),fill:"none",children:[j.jsx("title",{children:k}),j.jsx("path",{d:"M15.029 24.901a9.5 9.5 0 0 0-2.965.346c-.592.167-1.264.44-1.828.875-.576.444-1.1 1.108-1.203 2.022-.048.427-.033 1.342-.021 1.86.02.924.777 1.996 1.684 1.996h3.767c-.224-.475-.357-1.356-.374-1.918-.016-.551-.06-2.039.048-2.828.055-.412.153-.797.281-1.154a5.4 5.4 0 0 1 .61-1.199M33.937 32h3.767c.907 0 1.663-1.072 1.684-1.996.012-.518.027-1.433-.021-1.86-.104-.914-.627-1.578-1.203-2.022-.564-.435-1.236-.708-1.828-.875a9.5 9.5 0 0 0-2.965-.346c.24.35.45.748.61 1.199.129.357.227.742.282 1.154.107.79.064 2.277.048 2.828-.017.562-.15 1.443-.374 1.918",fill:"#606263",className:i(h==null?void 0:h.primary)}),j.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.803 24.383a16 16 0 0 1 4.397-.616c1.818 0 3.335.308 4.397.616.548.159 1.202.383 1.788.743.594.366 1.183.913 1.477 1.734q.117.321.17.696c.076.56.047 1.82.028 2.46-.027.918-.781 1.984-1.684 1.984H18.024c-.903 0-1.657-1.066-1.684-1.984-.019-.64-.048-1.9.028-2.46q.053-.375.17-.696c.294-.821.883-1.368 1.477-1.734.585-.36 1.24-.585 1.787-.743m10.591-4.632a3.37 3.37 0 0 1 3.377-3.369 3.37 3.37 0 0 1 3.378 3.37 3.38 3.38 0 0 1-3.378 3.381 3.38 3.38 0 0 1-3.378-3.382M19.696 17.51A4.51 4.51 0 0 1 24.2 13a4.51 4.51 0 0 1 4.504 4.51 4.5 4.5 0 0 1-4.504 4.496 4.5 4.5 0 0 1-4.504-4.497m-8.444 2.242a3.37 3.37 0 0 1 3.378-3.369 3.37 3.37 0 0 1 3.377 3.37 3.38 3.38 0 0 1-3.377 3.381 3.38 3.38 0 0 1-3.378-3.382",fill:"#606263",className:i(h==null?void 0:h.primary)})]})}))}a.displayName=a.name+" [from "+f.id+"]";g.DefaultCommunityRefreshedIcon=a}),98); __d("WAWebDefaultContactRefreshedIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k="default-contact-refreshed";function a(a){var b=a.iconXstyle,e=a.height,f=a.width,g=a.viewBox,h=a.innerStyles;a=babelHelpers.objectWithoutPropertiesLoose(a,["iconXstyle","height","width","viewBox","innerStyles"]);var l;if(g){var m=g.x;m=m===void 0?0:m;var n=g.y;n=n===void 0?0:n;var o=g.width;o=o===void 0?0:o;g=g.height;g=g===void 0?0:g;l=[m,n,o,g].join(" ")}m=212;n=212;(e!=null||f!=null)&&(m=e,n=f);return j.jsx(d("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers["extends"]({name:k},a,{children:j.jsxs("svg",{viewBox:(o=l)!=null?o:"0 0 48 48",height:m,width:n,preserveAspectRatio:"xMidYMid meet",className:(i||(i=c("stylex")))(b),fill:"none",children:[j.jsx("title",{children:k}),j.jsx("path",{d:"M24 23q-1.857 0-3.178-1.322Q19.5 20.357 19.5 18.5t1.322-3.178T24 14t3.178 1.322Q28.5 16.643 28.5 18.5t-1.322 3.178T24 23m-6.75 10q-.928 0-1.59-.66-.66-.662-.66-1.59v-.9q0-.956.492-1.758A3.3 3.3 0 0 1 16.8 26.87a16.7 16.7 0 0 1 3.544-1.308q1.8-.435 3.656-.436 1.856 0 3.656.436T31.2 26.87q.816.422 1.308 1.223T33 29.85v.9q0 .928-.66 1.59-.662.66-1.59.66z",fill:"#606263",className:i(h==null?void 0:h.primary)})]})}))}a.displayName=a.name+" [from "+f.id+"]";g.DefaultContactRefreshedIcon=a}),98); __d("WAWebDefaultGroupIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k="default-group";function a(a){var b=a.iconXstyle,e=a.height,f=a.width,g=a.viewBox,h=a.innerStyles;a=babelHelpers.objectWithoutPropertiesLoose(a,["iconXstyle","height","width","viewBox","innerStyles"]);var l;if(g){var m=g.x;m=m===void 0?0:m;var n=g.y;n=n===void 0?0:n;var o=g.width;o=o===void 0?0:o;g=g.height;g=g===void 0?0:g;l=[m,n,o,g].join(" ")}m=212;n=212;(e!=null||f!=null)&&(m=e,n=f);return j.jsx(d("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers["extends"]({name:k},a,{children:j.jsxs("svg",{viewBox:(o=l)!=null?o:"0 0 212 212",height:m,width:n,preserveAspectRatio:"xMidYMid meet",className:(i||(i=c("stylex")))(b),fill:"none",children:[j.jsx("title",{children:k}),j.jsx("path",{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",className:i(h==null?void 0:h.background)}),j.jsx("path",{fill:"currentColor",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",className:i(h==null?void 0:h.primary)})]})}))}a.displayName=a.name+" [from "+f.id+"]";g.DefaultGroupIcon=a}),98); __d("WAWebDefaultGroupRefreshedIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k="default-group-refreshed";function a(a){var b=a.iconXstyle,e=a.height,f=a.width,g=a.viewBox,h=a.innerStyles;a=babelHelpers.objectWithoutPropertiesLoose(a,["iconXstyle","height","width","viewBox","innerStyles"]);var l;if(g){var m=g.x;m=m===void 0?0:m;var n=g.y;n=n===void 0?0:n;var o=g.width;o=o===void 0?0:o;g=g.height;g=g===void 0?0:g;l=[m,n,o,g].join(" ")}m=212;n=212;(e!=null||f!=null)&&(m=e,n=f);return j.jsx(d("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers["extends"]({name:k},a,{children:j.jsxs("svg",{viewBox:(o=l)!=null?o:"0 0 48 48",height:m,width:n,preserveAspectRatio:"xMidYMid meet",className:(i||(i=c("stylex")))(b),fill:"none",children:[j.jsx("title",{children:k}),j.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.822 21.678Q19.143 23 21 23t3.178-1.322T25.5 18.5t-1.322-3.178Q22.857 14 21 14t-3.178 1.322T16.5 18.5t1.322 3.178M12.66 32.34q.66.66 1.589.661h13.5q.928 0 1.59-.66.66-.662.66-1.59v-.9q0-.956-.492-1.758A3.3 3.3 0 0 0 28.2 26.87a16.7 16.7 0 0 0-3.544-1.308q-1.8-.435-3.656-.436-1.856 0-3.656.436T13.8 26.869a3.3 3.3 0 0 0-1.308 1.223A3.3 3.3 0 0 0 12 29.85v.9q0 .928.66 1.59m21.09.66h-2.392A4.16 4.16 0 0 0 32 30.75v-.9c0-1-.263-1.95-.788-2.804a5.3 5.3 0 0 0-1.675-1.713q.563.093 1.119.228 1.8.436 3.544 1.308.815.422 1.308 1.223.492.802.492 1.758v.9q0 .928-.661 1.59-.66.66-1.59.66M27 23a4.6 4.6 0 0 1-1.18-.147c1.105-1.211 1.68-2.692 1.68-4.353s-.575-3.142-1.68-4.353A4.6 4.6 0 0 1 27 14q1.856 0 3.178 1.322Q31.5 16.643 31.5 18.5t-1.322 3.178T27 23",fill:"#606263",className:i(h==null?void 0:h.primary)})]})}))}a.displayName=a.name+" [from "+f.id+"]";g.DefaultGroupRefreshedIcon=a}),98); __d("WAWebDefaultNewsletterIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k="default-newsletter";function a(a){var b=a.iconXstyle,e=a.height,f=a.width,g=a.viewBox,h=a.innerStyles;a=babelHelpers.objectWithoutPropertiesLoose(a,["iconXstyle","height","width","viewBox","innerStyles"]);var l;if(g){var m=g.x;m=m===void 0?0:m;var n=g.y;n=n===void 0?0:n;var o=g.width;o=o===void 0?0:o;g=g.height;g=g===void 0?0:g;l=[m,n,o,g].join(" ")}m=212;n=212;(e!=null||f!=null)&&(m=e,n=f);return j.jsx(d("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers["extends"]({name:k},a,{children:j.jsxs("svg",{viewBox:(o=l)!=null?o:"0 0 212 212",height:m,width:n,preserveAspectRatio:"xMidYMid meet",className:(i||(i=c("stylex")))(b),fill:"none",children:[j.jsx("title",{children:k}),j.jsx("rect",{width:212,height:212,rx:106,fill:"currentColor",className:i(h==null?void 0:h.background)}),j.jsx("path",{d:"M157.123 99.0265C154.027 75.5432 134.626 56.8186 111.097 54.6979C80.5503 51.9047 55.3184 75.388 54.7508 105.906C54.5444 116.872 58.7239 126.286 60.8395 130.32L54.6992 150.648C53.5124 154.579 57.1759 158.252 61.0975 157.062L81.1179 151.062C88.7546 155.304 97.3201 157.528 106.092 157.528C136.742 157.528 161.2 130.527 157.072 99.0265H157.123ZM85.7103 119.82C87.1034 121.889 86.9486 124.682 85.1943 126.441C82.8723 128.82 79.0024 128.355 77.1448 125.562C73.3781 119.975 71.1593 113.199 71.1593 105.958C71.1593 98.7161 73.5329 91.4229 77.6092 85.6813C79.4152 83.1468 83.1819 82.9916 85.4007 85.2158C87.2066 87.0262 87.3614 89.8194 85.9167 91.8884C83.1303 95.8712 81.5307 100.733 81.5307 105.958C81.5307 111.182 83.1303 115.837 85.8135 119.768L85.7103 119.82ZM106.35 113.716C102.067 113.716 98.61 110.251 98.61 105.958C98.61 101.664 102.067 98.1989 106.35 98.1989C110.633 98.1989 114.09 101.664 114.09 105.958C114.09 110.251 110.633 113.716 106.35 113.716ZM134.471 126.337C132.665 128.872 128.899 129.027 126.732 126.803C124.926 124.993 124.771 122.199 126.216 120.13C129.002 116.148 130.653 111.234 130.653 106.009C130.653 100.785 128.95 95.7678 126.112 91.7849C124.616 89.6642 124.719 86.8193 126.525 84.9572C128.692 82.7847 132.407 82.8882 134.265 85.4227C138.496 91.216 140.973 98.3023 140.973 106.061C140.973 113.82 138.548 120.648 134.471 126.389V126.337Z",fill:"#FFFFFF",className:i(h==null?void 0:h.primary)})]})}))}a.displayName=a.name+" [from "+f.id+"]";g.DefaultNewsletterIcon=a}),98); __d("WAWebDefaultUserColorIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k="default-user-color";function a(a){var b=a.iconXstyle,e=a.height,f=a.width,g=a.viewBox;a=babelHelpers.objectWithoutPropertiesLoose(a,["iconXstyle","height","width","viewBox"]);var h;if(g){var l=g.x;l=l===void 0?0:l;var m=g.y;m=m===void 0?0:m;var n=g.width;n=n===void 0?0:n;g=g.height;g=g===void 0?0:g;h=[l,m,n,g].join(" ")}l=212;m=212;(e!=null||f!=null)&&(l=e,m=f);return j.jsx(d("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers["extends"]({name:k},a,{children:j.jsxs("svg",{viewBox:(n=h)!=null?n:"0 0 212 212",height:l,width:m,preserveAspectRatio:"xMidYMid meet",className:(i||(i=c("stylex")))(b),version:"1.1",x:"0px",y:"0px",enableBackground:"new 0 0 212 212",children:[j.jsx("title",{children:k}),j.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"}),j.jsxs("g",{children:[j.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"}),j.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"})]})]})}))}a.displayName=a.name+" [from "+f.id+"]";g.DefaultUserColorIcon=a}),98); __d("WAWebDefaultUserIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k="default-user";function a(a){var b=a.iconXstyle,e=a.height,f=a.width,g=a.viewBox,h=a.innerStyles;a=babelHelpers.objectWithoutPropertiesLoose(a,["iconXstyle","height","width","viewBox","innerStyles"]);var l;if(g){var m=g.x;m=m===void 0?0:m;var n=g.y;n=n===void 0?0:n;var o=g.width;o=o===void 0?0:o;g=g.height;g=g===void 0?0:g;l=[m,n,o,g].join(" ")}m=212;n=212;(e!=null||f!=null)&&(m=e,n=f);return j.jsx(d("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers["extends"]({name:k},a,{children:j.jsxs("svg",{viewBox:(o=l)!=null?o:"0 0 212 212",height:m,width:n,preserveAspectRatio:"xMidYMid meet",className:(i||(i=c("stylex")))(b),version:"1.1",x:"0px",y:"0px",enableBackground:"new 0 0 212 212",children:[j.jsx("title",{children:k}),j.jsx("path",{fill:"#DFE5E7",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",className:i(h==null?void 0:h.background)}),j.jsxs("g",{children:[j.jsx("path",{fill:"#FFFFFF",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",className:i(h==null?void 0:h.primary)}),j.jsx("path",{fill:"#FFFFFF",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",className:i(h==null?void 0:h.primary)})]})]})}))}a.displayName=a.name+" [from "+f.id+"]";g.DefaultUserIcon=a}),98); __d("WAWebDefaultUserSquareIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k="default-user-square";function a(a){var b=a.iconXstyle,e=a.height,f=a.width,g=a.viewBox,h=a.innerStyles;a=babelHelpers.objectWithoutPropertiesLoose(a,["iconXstyle","height","width","viewBox","innerStyles"]);var l;if(g){var m=g.x;m=m===void 0?0:m;var n=g.y;n=n===void 0?0:n;var o=g.width;o=o===void 0?0:o;g=g.height;g=g===void 0?0:g;l=[m,n,o,g].join(" ")}m=212;n=212;(e!=null||f!=null)&&(m=e,n=f);return j.jsx(d("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers["extends"]({name:k},a,{children:j.jsxs("svg",{viewBox:(o=l)!=null?o:"0 0 212 212",height:m,width:n,preserveAspectRatio:"xMidYMid meet",className:(i||(i=c("stylex")))(b),version:"1.1",x:"0px",y:"0px",enableBackground:"new 0 0 212 212",children:[j.jsx("title",{children:k}),j.jsx("path",{fill:"#DFE5E7",d:"M0,0h212v212H0V0z",className:i(h==null?void 0:h.background)}),j.jsx("path",{fill:"#FFFFFF",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",className:i(h==null?void 0:h.primary)})]})}))}a.displayName=a.name+" [from "+f.id+"]";g.DefaultUserSquareIcon=a}),98); __d("WAWebDisappearingIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k="disappearing";function a(a){var b=a.iconXstyle,e=a.height,f=a.width,g=a.viewBox;a=babelHelpers.objectWithoutPropertiesLoose(a,["iconXstyle","height","width","viewBox"]);var h;if(g){var l=g.x;l=l===void 0?0:l;var m=g.y;m=m===void 0?0:m;var n=g.width;n=n===void 0?0:n;g=g.height;g=g===void 0?0:g;h=[l,m,n,g].join(" ")}l=36;m=36;(e!=null||f!=null)&&(l=e,m=f);return j.jsx(d("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers["extends"]({name:k},a,{children:j.jsxs("svg",{viewBox:(n=h)!=null?n:"0 0 36 36",height:l,width:m,preserveAspectRatio:"xMidYMid meet",className:(i||(i=c("stylex")))(b),fill:"none",children:[j.jsx("title",{children:k}),j.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"}),j.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"}),j.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"})]})}))}a.displayName=a.name+" [from "+f.id+"]";g.DisappearingIcon=a}),98); __d("WAWebDisappearingMessagesRefreshedIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k="disappearing-messages-refreshed";function a(a){var b=a.iconXstyle,e=a.height,f=a.width,g=a.viewBox;a=babelHelpers.objectWithoutPropertiesLoose(a,["iconXstyle","height","width","viewBox"]);var h;if(g){var l=g.x;l=l===void 0?0:l;var m=g.y;m=m===void 0?0:m;var n=g.width;n=n===void 0?0:n;g=g.height;g=g===void 0?0:g;h=[l,m,n,g].join(" ")}l=24;m=24;(e!=null||f!=null)&&(l=e,m=f);return j.jsx(d("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers["extends"]({name:k},a,{children:j.jsxs("svg",{viewBox:(n=h)!=null?n:"0 0 24 24",height:l,width:m,preserveAspectRatio:"xMidYMid meet",className:(i||(i=c("stylex")))(b),fill:"none",children:[j.jsx("title",{children:k}),j.jsx("path",{d:"M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C12.0547 22 12.1094 21.9996 12.1639 21.9987C12.7775 21.9888 13.2669 21.4834 13.257 20.8698C13.2471 20.2563 12.7417 19.7669 12.1281 19.7767C12.0855 19.7774 12.0428 19.7778 12 19.7778C7.70445 19.7778 4.22222 16.2955 4.22222 12C4.22222 7.70445 7.70445 4.22222 12 4.22222C12.0428 4.22222 12.0855 4.22257 12.1281 4.22325C12.7417 4.23314 13.2471 3.74375 13.257 3.13018C13.2669 2.51661 12.7775 2.0112 12.1639 2.00132C12.1094 2.00044 12.0547 2 12 2Z",fill:"currentColor"}),j.jsx("path",{d:"M16.8592 3.25814C16.3231 2.95957 15.6465 3.15213 15.3479 3.68825C15.0493 4.22437 15.2419 4.90102 15.778 5.19959C15.8522 5.24089 15.9256 5.28338 15.9983 5.32703C16.5243 5.643 17.2069 5.4727 17.5229 4.94665C17.8389 4.4206 17.6686 3.738 17.1425 3.42203C17.0491 3.36591 16.9546 3.31127 16.8592 3.25814Z",fill:"currentColor"}),j.jsx("path",{d:"M19.0534 6.47712C19.5794 6.16115 20.262 6.33145 20.578 6.8575C20.6341 6.95093 20.6887 7.04537 20.7419 7.14077C21.0404 7.67689 20.8479 8.35353 20.3118 8.65211C19.7756 8.95068 19.099 8.75811 18.8004 8.22199C18.7591 8.14782 18.7166 8.07439 18.673 8.00173C18.357 7.47568 18.5273 6.79309 19.0534 6.47712Z",fill:"currentColor"}),j.jsx("path",{d:"M21.9987 11.8361C21.9888 11.2225 21.4834 10.7331 20.8698 10.743C20.2563 10.7529 19.7669 11.2583 19.7767 11.8719C19.7774 11.9145 19.7778 11.9572 19.7778 12C19.7778 12.0428 19.7774 12.0855 19.7767 12.1281C19.7669 12.7417 20.2563 13.2471 20.8698 13.257C21.4834 13.2669 21.9888 12.7775 21.9987 12.1639C21.9996 12.1094 22 12.0547 22 12C22 11.9453 21.9996 11.8906 21.9987 11.8361Z",fill:"currentColor"}),j.jsx("path",{d:"M20.3118 15.3479C20.8479 15.6465 21.0404 16.3231 20.7419 16.8592C20.6887 16.9546 20.6341 17.0491 20.578 17.1425C20.262 17.6686 19.5794 17.8389 19.0534 17.5229C18.5273 17.2069 18.357 16.5243 18.673 15.9983C18.7166 15.9256 18.7591 15.8522 18.8004 15.778C19.099 15.2419 19.7756 15.0493 20.3118 15.3479Z",fill:"currentColor"}),j.jsx("path",{d:"M17.1425 20.578C17.6686 20.262 17.8389 19.5794 17.5229 19.0534C17.2069 18.5273 16.5243 18.357 15.9983 18.673C15.9256 18.7166 15.8522 18.7591 15.778 18.8004C15.2419 19.099 15.0493 19.7756 15.3479 20.3118C15.6465 20.8479 16.3231 21.0404 16.8592 20.7419C16.9546 20.6887 17.0491 20.6341 17.1425 20.578Z",fill:"currentColor"}),j.jsx("path",{d:"M16.7811 7.6229C16.5556 7.39749 16.1988 7.37213 15.9438 7.5634L11.3327 11.0217C10.6836 11.5085 10.6161 12.4574 11.1899 13.0312L11.3728 13.2141C11.9465 13.7878 12.8954 13.7204 13.3823 13.0713L16.8406 8.46018C17.0318 8.20516 17.0065 7.84831 16.7811 7.6229Z",fill:"currentColor"})]})}))}a.displayName=a.name+" [from "+f.id+"]";g.DisappearingMessagesRefreshedIcon=a}),98); __d("WAWebDoubleChevronIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k="double-chevron";function a(a){var b=a.iconXstyle,e=a.height,f=a.width,g=a.viewBox;a=babelHelpers.objectWithoutPropertiesLoose(a,["iconXstyle","height","width","viewBox"]);var h;if(g){var l=g.x;l=l===void 0?0:l;var m=g.y;m=m===void 0?0:m;var n=g.width;n=n===void 0?0:n;g=g.height;g=g===void 0?0:g;h=[l,m,n,g].join(" ")}l=66;m=66;(e!=null||f!=null)&&(l=e,m=f);return j.jsx(d("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers["extends"]({name:k},a,{children:j.jsxs("svg",{viewBox:(n=h)!=null?n:"0 0 66 66",height:l,width:m,preserveAspectRatio:"xMidYMid meet",className:(i||(i=c("stylex")))(b),fill:"none",children:[j.jsx("title",{children:k}),j.jsx("path",{d:"M52.1731 31.43L41.2382 16.1374C40.3179 14.8382 38.8292 14.0532 37.2323 14.0532C33.1994 14.0532 30.8716 18.6004 33.1994 21.8755L41.1299 32.9999L33.1994 44.1243C30.8446 47.3994 33.1994 51.9466 37.2323 51.9466C38.8292 51.9466 40.345 51.1616 41.2652 49.8624L52.2002 34.5698C52.8498 33.6224 52.8498 32.3774 52.1731 31.43Z",fill:"currentColor"}),j.jsx("path",{d:"M33.2264 31.43L22.3186 16.1374C21.3712 14.8382 19.8826 14.0532 18.2856 14.0532C14.2527 14.0532 11.8979 18.6004 14.2527 21.8755L22.1832 32.9999L14.2527 44.1243C11.8979 47.3994 14.2527 51.9466 18.2856 51.9466C19.8826 51.9466 21.3983 51.1616 22.3186 49.8624L33.2535 34.5698C33.9031 33.6224 33.9031 32.3774 33.2264 31.43Z",fill:"currentColor"})]})}))}a.displayName=a.name+" [from "+f.id+"]";g.DoubleChevronIcon=a}),98); __d("WAWebHasAcceptedBizBotTos",["WAWebBotTos","WAWebTos","react","useWAWebListener"],(function(a,b,c,d,e,f,g){"use strict";var h,i=(h||d("react")).useState;function a(){var a=i(d("WAWebBotTos").hasAcceptedBizBotTos),b=a[0],c=a[1];d("useWAWebListener").useListener(d("WAWebTos").TosManager,"change",function(){c(d("WAWebBotTos").hasAcceptedBizBotTos())});return b}g.useHasAcceptedBizBotTos=a}),98); __d("WAWebIdleComponent.react",["WAWebIdleTaskRunner","WAWebWid","react","useLazyRef","useWAWebPrevious"],(function(a,b,c,d,e,f,g){var h,i;b=i||d("react");var j=h||(h=c("react")),k=b.useEffect,l=b.useState;function a(a){var b=a.children,e=a.onComplex,f=a.waitIdle,g=f===void 0?!1:f,h=a.id;f=l(function(){return d("WAWebIdleTaskRunner").UIBusyTasks.isBusy()});var i=f[0],m=f[1],n=function(){m(!1)},o=c("useLazyRef")(function(){return g?d("WAWebIdleTaskRunner").UIBusyTasks.enqueue(n):null}),p=c("useWAWebPrevious")(h);k(function(){return function(){g&&o.current!=null&&d("WAWebIdleTaskRunner").UIBusyTasks.dequeue(o.current)}},[]);k(function(){if(!c("WAWebWid").equals(p,h)||!g){i&&o.current!=null&&d("WAWebIdleTaskRunner").UIBusyTasks.dequeue(o.current);var a=d("WAWebIdleTaskRunner").UIBusyTasks.isBusy();a&&g&&(o.current=d("WAWebIdleTaskRunner").UIBusyTasks.enqueue(n));m(a)}},[h,o,i,p,g]);return i&&g?j.jsx(j.Fragment,{children:b}):e()}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),98); __d("WAWebInitialsFromNameUtils",["$InternalEnum","WAWebL10N"],(function(a,b,c,d,e,f,g){e=b("$InternalEnum").Mirrored(["ARABIC","LATIN","HEBREW","THAI","GUJARATI","DEVANAGARI","CYRILLIC","BENGALI","HAN"]);f=new RegExp(/[\u0600-\u0604\u0606-\u060B\u060D-\u061A\u061C-\u061E\u0620-\u063F\u0641-\u064A\u0656-\u066F\u0671-\u06DC\u06DE-\u06FF\u0750-\u077F\u0870-\u088E\u0890\u0891\u0898-\u08E1\u08E3-\u08FF\uFB50-\uFBC2\uFBD3-\uFD3D\uFD40-\uFD8F\uFD92-\uFDC7\uFDCF\uFDF0-\uFDFF\uFE70-\uFE74\uFE76-\uFEFC]/);b=new RegExp(/[A-Za-z\xAA\xBA\xC0-\xD6\xD8-\xF6\xF8-\u0249\u02E0-\u02E4\u1D00-\u1D25\u1D2C-\u1D5C\u1D62-\u1D65\u1D6B-\u1D77\u1D79-\u1DBE\u1E00-\u1EFF\u2071\u207F\u2090-\u209C\u212A\u212B\u2132\u214E\u2160-\u2188\u2C60-\u2C7F\uA722-\uA787\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA7FF\uAB30-\uAB5A\uAB5C-\uAB64\uAB66-\uAB69\uFB00-\uFB06\uFF21-\uFF3A\uFF41-\uFF5A]/);var h=new RegExp(/[\u0591-\u05C7\u05D0-\u05EA\u05EF-\u05F4\uFB1D-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFB4F]/),i=new RegExp(/[\u0E01-\u0E3A\u0E40-\u0E5B]/),j=new RegExp(/[\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AF1\u0AF9-\u0AFF]/),k=new RegExp(/[\u0900-\u0950\u0955-\u0963\u0966-\u097F\uA8E0-\uA8FF]/),l=new RegExp(/[\u0400-\u0484\u0487-\u052F\u1C80-\u1C88\u1D2B\u1D78\u2DE0-\u2DFF\uA640-\uA69F\uFE2E\uFE2F]/),m=new RegExp(/[\u0980-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09FE]/),n=new RegExp(/[\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u3005\u3007\u3021-\u3029\u3038-\u303B\u3400-\u4DBF\u4E00-\u9FFF\uF900-\uFA6D\uFA70-\uFAD9]/),o=new Map([[e.ARABIC,f],[e.LATIN,b],[e.HEBREW,h],[e.THAI,i],[e.GUJARATI,j],[e.DEVANAGARI,k],[e.CYRILLIC,l],[e.BENGALI,m],[e.HAN,n]]),p=new RegExp(/[\u093A\u093B\u093E-\u094C\u094E\u094F\u0955-\u0957\u0962\u0963]/),q=new RegExp(/[\u09BE-\u09CC\u09E2\u09E3]/),r=new RegExp(/[\u0ABE-\u0ACC\u0AE2\u0AE3]/),s=new RegExp(/[\u0E30-\u0E59]/),t=a([f,i,j,k,m]),u=a([k,m,j]),v=a(Array.from(o.values()));function w(a){return Array.from(o.keys()).find(function(b){b=o.get(b);return b==null?void 0:b.test(a)})}function x(a){return t.test(a)}function y(a){return n.test(a)}function z(a){return v.test(a)}function a(a){return new RegExp(a.map(function(a){return a.source}).join("|"))}function A(a){var b=!1;a.firstName!=null&&(b=x(a.firstName));var c=a.firstName!=null&&a.firstName!==""&&!y(a.firstName);b=b!==!0&&a.lastName!=null&&a.lastName!=="";a.firstName!=null&&a.firstName!==""&&n.test(a.firstName)&&!b&&(c=!0);a=a.lastName===""&&a.firstName==="";a=c!==!0&&b!==!0&&!a;return{showFirstNameInitial:c,showLastNameInitial:b,showPushnameInitial:a}}function B(a,b,d){a=a==null?void 0:a.trim();var e=null;a!=null&&b!=null&&(a==null?void 0:a.length)>0?e=b.trim().replace(a,"").trim():e=b==null?void 0:b.trim();b=c("WAWebL10N").getFullLocale();a=a==null?void 0:a.toLocaleUpperCase(b);e=(e=e)==null?void 0:e.toLocaleUpperCase(b);d=d==null?void 0:d.toLocaleUpperCase(b);return{firstName:a,lastName:e,pushname:d}}function C(a){var b=a.charAt(0);a=a.charAt(1);var c=null,d=null;k.test(b)?(c=k,d=p):m.test(b)?(c=m,d=q):j.test(b)&&(c=j,d=r);if(c==null||d==null)return;return a!=null&&c.test(b)&&!d.test(b)&&d.test(a)?b+a:c.test(b)?b:null}function D(a,b){var c=a.charAt(0);if(u.test(a))return C(a);if(c!=null&&i.test(c)&&s.test(c)){var d=a==null?void 0:a.slice(1).trim();d=d==null?void 0:d.charAt(0);return z(d)&&!s.test(d)?d:null}if(y(a)&&!b)return a.slice(0,2);return z(c)?c:null}function E(a){a=B(a.shortName,a.name,a.pushname);var b=A(a),c=null,d=null,e=a.firstName,f=b.showFirstNameInitial===!0&&b.showLastNameInitial===!1;b.showFirstNameInitial===!0&&e!=null&&(c=D(e,f));b.showLastNameInitial===!0&&a.lastName!=null&&(d=D(a.lastName,f));b.showPushnameInitial===!0&&a.pushname!=null&&(c=D(a.pushname,!0),d=null);c!=null&&d!=null&&w(c)!==w(d)&&(d=null);return{firstInitial:c,secondInitial:d}}function d(a){return E({shortName:a==null?void 0:a.shortName,name:a==null?void 0:a.name,pushname:a==null?void 0:a.pushname})}g.InitialsAlphabets=e;g.supportedAlphabetsMap=o;g.getInitialsFromNames=E;g.getInitialsFromContact=d}),98); __d("useWAWebGroupColors",["WALogger","WAWebThemeContext"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(['Group color id "','" does not have a corresponding style']);h=function(){return a};return a}var i={color_light_1:{color:"xijeqtt",$$css:!0},color_light_2:{color:"xkgnp4b",$$css:!0},color_light_3:{color:"x240ipn",$$css:!0},color_light_4:{color:"xskf257",$$css:!0},color_light_5:{color:"xebwusc",$$css:!0},color_light_6:{color:"x3wc6wf",$$css:!0},color_light_7:{color:"x8s8ybf",$$css:!0},color_light_8:{color:"x162sf37",$$css:!0},color_light_9:{color:"x197m9ru",$$css:!0},color_light_10:{color:"x98wywu",$$css:!0},color_light_11:{color:"x1y1pzmv",$$css:!0},color_light_12:{color:"xkgndj",$$css:!0},color_light_13:{color:"x1454dyk",$$css:!0},color_light_14:{color:"xcwjfjl",$$css:!0},color_light_15:{color:"xgz8yji",$$css:!0},color_light_16:{color:"xyaa4h1",$$css:!0},color_light_17:{color:"x1n9d4q5",$$css:!0},background_light_1:{backgroundColor:"x6wgc6a",$$css:!0},background_light_2:{backgroundColor:"x17y5562",$$css:!0},background_light_3:{backgroundColor:"x1cu8r8a",$$css:!0},background_light_4:{backgroundColor:"xznryv8",$$css:!0},background_light_5:{backgroundColor:"x1n3fz2",$$css:!0},background_light_6:{backgroundColor:"xx4wtn9",$$css:!0},background_light_7:{backgroundColor:"x18a7xdx",$$css:!0},background_light_8:{backgroundColor:"x1vwqcvr",$$css:!0},background_light_9:{backgroundColor:"x1qcddwk",$$css:!0},background_light_10:{backgroundColor:"x1lrj34z",$$css:!0},background_light_11:{backgroundColor:"x1hvcrje",$$css:!0},background_light_12:{backgroundColor:"x1yh949v",$$css:!0},background_light_13:{backgroundColor:"x1tcvzfv",$$css:!0},background_light_14:{backgroundColor:"x1fu2t9j",$$css:!0},background_light_15:{backgroundColor:"x1fwelf4",$$css:!0},background_light_16:{backgroundColor:"xfhxl41",$$css:!0},background_light_17:{backgroundColor:"x18um00n",$$css:!0},color_dark_1:{color:"xijeqtt",$$css:!0},color_dark_2:{color:"xkgnp4b",$$css:!0},color_dark_3:{color:"x1hncw2u",$$css:!0},color_dark_4:{color:"xskf257",$$css:!0},color_dark_5:{color:"xs7ovuj",$$css:!0},color_dark_6:{color:"x1wxwh9x",$$css:!0},color_dark_7:{color:"x1n9d4q5",$$css:!0},color_dark_8:{color:"x98wywu",$$css:!0},color_dark_9:{color:"x18hhy9w",$$css:!0},color_dark_10:{color:"xbpqssb",$$css:!0},color_dark_11:{color:"x162sf37",$$css:!0},color_dark_12:{color:"x7y2iuh",$$css:!0},color_dark_13:{color:"xah1503",$$css:!0},color_dark_14:{color:"xyee0rz",$$css:!0},color_dark_15:{color:"xcwjfjl",$$css:!0},color_dark_16:{color:"xgz8yji",$$css:!0},color_dark_17:{color:"xly5uq6",$$css:!0},background_dark_1:{backgroundColor:"x6wgc6a",$$css:!0},background_dark_2:{backgroundColor:"x17y5562",$$css:!0},background_dark_3:{backgroundColor:"x1xd7cei",$$css:!0},background_dark_4:{backgroundColor:"xznryv8",$$css:!0},background_dark_5:{backgroundColor:"x3yiujs",$$css:!0},background_dark_6:{backgroundColor:"x1sim4je",$$css:!0},background_dark_7:{backgroundColor:"x18um00n",$$css:!0},background_dark_8:{backgroundColor:"x1lrj34z",$$css:!0},background_dark_9:{backgroundColor:"x1g15lxm",$$css:!0},background_dark_10:{backgroundColor:"x1jb1lhd",$$css:!0},background_dark_11:{backgroundColor:"x1vwqcvr",$$css:!0},background_dark_12:{backgroundColor:"xxln43k",$$css:!0},background_dark_13:{backgroundColor:"xcpx4u6",$$css:!0},background_dark_14:{backgroundColor:"x1vnpq5e",$$css:!0},background_dark_15:{backgroundColor:"x1fu2t9j",$$css:!0},background_dark_16:{backgroundColor:"x1fwelf4",$$css:!0},background_dark_17:{backgroundColor:"xd7yu05",$$css:!0}};function j(a,b,c){var e=i[b+"_"+c+"_"+a];e==null&&(d("WALogger").WARN(h(),a),e=i[b+"_"+c+"_1"]);return e}function a(a,b){var c=d("WAWebThemeContext").useTheme();c=c.theme;return j(a,b,c)}g.useGroupsColorStyle=a}),98); __d("WAWebInitialsProfilePicture.react",["$InternalEnum","WABidi","WAWebInitialsFromNameUtils","react","stylex","useWAWebGroupColors"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k=b("$InternalEnum").Mirrored(["Default","GroupChatProfilePicture"]),l={initialsBackground:{width:"xh8yej3",height:"x5yr21d",borderTopStartRadius:"x14yjl9h",borderTopEndRadius:"xudhj91",borderBottomEndRadius:"x18nykt9",borderBottomStartRadius:"xww2gxu",color:"x1awj2ng",display:"x78zum5",alignItems:"x6s0dn4",justifyContent:"xl56j7k",$$css:!0}};function a(a){var b=a.backgroundColorId,e=a.initialsData;a=a.theme;a=a===void 0?k.Default:a;b=d("useWAWebGroupColors").useGroupsColorStyle(b,"background");var f=e.firstInitial!=null&&e.secondInitial!=null,g=d("WAWebInitialsFromNameUtils").supportedAlphabetsMap.get(d("WAWebInitialsFromNameUtils").InitialsAlphabets.HAN),h=!1;if(g&&e.secondInitial!=null&&g.test(e==null?void 0:e.secondInitial)){g=((g=e.secondInitial)==null?void 0:g.length)||0;h=g>1}g=e.firstInitial!=null&&d("WABidi").dir(e.firstInitial)==="rtl"?"rtl":"ltr";return j.jsx("div",babelHelpers["extends"]({},(i||(i=c("stylex"))).props(l.initialsBackground,b),{children:j.jsxs("div",babelHelpers["extends"]({dir:g},{0:{},8:{className:"x1aueamr"},4:{className:"x1f6kntn"},12:{className:"x1f6kntn"},2:{className:"x1nxh6w3"},10:{className:"x1nxh6w3"},6:{className:"x1nxh6w3"},14:{className:"x1nxh6w3"},1:{className:"x1ncwhqj"},9:{className:"x1ncwhqj"},5:{className:"x1ncwhqj"},13:{className:"x1ncwhqj"},3:{className:"x1ncwhqj"},11:{className:"x1ncwhqj"},7:{className:"x1ncwhqj"},15:{className:"x1ncwhqj"}}[!!(a===k.Default)<<3|!!(a===k.GroupChatProfilePicture)<<2|!!(a===k.GroupChatProfilePicture&&f)<<1|!!h<<0],{children:[j.jsx("div",babelHelpers["extends"]({"data-testid":void 0},{className:"x1rg5ohu xk50ysn"},{children:e.firstInitial})),j.jsx("div",babelHelpers["extends"]({"data-testid":void 0},{className:"x1rg5ohu xk50ysn"},{children:e.secondInitial}))]}))}))}a.displayName=a.name+" [from "+f.id+"]";g.ThemeType=k;g.InitialsProfilePicture=a}),98); __d("WAWebSingleChevronInCircleIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k="single-chevron-in-circle";function a(a){var b=a.iconXstyle,e=a.height,f=a.width,g=a.viewBox;a=babelHelpers.objectWithoutPropertiesLoose(a,["iconXstyle","height","width","viewBox"]);var h;if(g){var l=g.x;l=l===void 0?0:l;var m=g.y;m=m===void 0?0:m;var n=g.width;n=n===void 0?0:n;g=g.height;g=g===void 0?0:g;h=[l,m,n,g].join(" ")}l=20;m=20;(e!=null||f!=null)&&(l=e,m=f);return j.jsx(d("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers["extends"]({name:k},a,{children:j.jsxs("svg",{viewBox:(n=h)!=null?n:"0 0 20 20",height:l,width:m,preserveAspectRatio:"xMidYMid meet",className:(i||(i=c("stylex")))(b),fill:"none",children:[j.jsx("title",{children:k}),j.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.0034 1.66992C14.6034 1.66992 18.3367 5.40326 18.3367 10.0033C18.3367 14.6033 14.6034 18.3366 10.0034 18.3366C5.40338 18.3366 1.67004 14.6033 1.67004 10.0033C1.67004 5.40326 5.40338 1.66992 10.0034 1.66992ZM10.0034 3.33659C6.32004 3.33659 3.33671 6.31992 3.33671 10.0033C3.33671 13.6866 6.32004 16.6699 10.0034 16.6699C13.6867 16.6699 16.67 13.6866 16.67 10.0033C16.67 6.31992 13.6867 3.33659 10.0034 3.33659ZM10.7327 9.99904L8.57734 12.1565C8.25234 12.4815 8.26068 13.0148 8.57734 13.3398C8.90234 13.6648 9.42734 13.6648 9.75234 13.3398L12.4994 10.5907C12.8244 10.2657 12.8244 9.74071 12.4994 9.41571L9.75563 6.67319C9.43063 6.34819 8.90563 6.34819 8.58063 6.67319C8.25563 6.99819 8.25563 7.52319 8.58063 7.84819L10.7327 9.99904Z",fill:"currentColor "})]})}))}a.displayName=a.name+" [from "+f.id+"]";g.SingleChevronInCircleIcon=a}),98); __d("WAWebVisibilityOffOutlineIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k="visibility-off-outline";function a(a){var b=a.iconXstyle,e=a.height,f=a.width,g=a.viewBox;a=babelHelpers.objectWithoutPropertiesLoose(a,["iconXstyle","height","width","viewBox"]);var h;if(g){var l=g.x;l=l===void 0?0:l;var m=g.y;m=m===void 0?0:m;var n=g.width;n=n===void 0?0:n;g=g.height;g=g===void 0?0:g;h=[l,m,n,g].join(" ")}l=24;m=24;(e!=null||f!=null)&&(l=e,m=f);return j.jsx(d("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers["extends"]({name:k},a,{children:j.jsxs("svg",{viewBox:(n=h)!=null?n:"0 0 24 24",height:l,width:m,preserveAspectRatio:"xMidYMid meet",className:(i||(i=c("stylex")))(b),fill:"none",children:[j.jsx("title",{children:k}),j.jsx("path",{d:"M12 5.97505C15.79 5.97505 19.17 8.10505 20.82 11.475C20.23 12.695 19.4 13.745 18.41 14.595L19.82 16.005C21.21 14.775 22.31 13.235 23 11.475C21.27 7.08505 17 3.97505 12 3.97505C10.73 3.97505 9.51 4.17505 8.36 4.54505L10.01 6.19505C10.66 6.06505 11.32 5.97505 12 5.97505ZM10.93 7.11505L13 9.18505C13.57 9.43505 14.03 9.89505 14.28 10.465L16.35 12.535C16.43 12.195 16.49 11.835 16.49 11.465C16.5 8.98505 14.48 6.97505 12 6.97505C11.63 6.97505 11.28 7.02505 10.93 7.11505ZM2.01 3.84505L4.69 6.52505C3.06 7.80505 1.77 9.50505 1 11.475C2.73 15.865 7 18.975 12 18.975C13.52 18.975 14.98 18.685 16.32 18.155L19.74 21.575L21.15 20.165L3.42 2.42505L2.01 3.84505ZM9.51 11.345L12.12 13.955C12.08 13.965 12.04 13.975 12 13.975C10.62 13.975 9.5 12.855 9.5 11.475C9.5 11.425 9.51 11.395 9.51 11.345ZM6.11 7.94505L7.86 9.69505C7.63 10.245 7.5 10.845 7.5 11.475C7.5 13.955 9.52 15.975 12 15.975C12.63 15.975 13.23 15.845 13.77 15.615L14.75 16.595C13.87 16.835 12.95 16.975 12 16.975C8.21 16.975 4.83 14.845 3.18 11.475C3.88 10.045 4.9 8.86505 6.11 7.94505Z",fill:"currentColor"})]})}))}a.displayName=a.name+" [from "+f.id+"]";g.VisibilityOffOutlineIcon=a}),98); __d("WAWebWaChatPsaIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k="wa-chat-psa";function a(a){var b=a.iconXstyle,e=a.height,f=a.width,g=a.viewBox;a=babelHelpers.objectWithoutPropertiesLoose(a,["iconXstyle","height","width","viewBox"]);var h;if(g){var l=g.x;l=l===void 0?0:l;var m=g.y;m=m===void 0?0:m;var n=g.width;n=n===void 0?0:n;g=g.height;g=g===void 0?0:g;h=[l,m,n,g].join(" ")}l=360;m=360;(e!=null||f!=null)&&(l=e,m=f);return j.jsx(d("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers["extends"]({name:k},a,{children:j.jsxs("svg",{viewBox:(n=h)!=null?n:"0 0 360 360",height:l,width:m,preserveAspectRatio:"xMidYMid meet",className:(i||(i=c("stylex")))(b),version:"1.1",id:"Layer_1",x:"0px",y:"0px",enableBackground:"new 0 0 360 360",children:[j.jsx("title",{children:k}),j.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"}),j.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"}),j.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"}),j.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"})]})}))}a.displayName=a.name+" [from "+f.id+"]";g.WaChatPsaIcon=a}),98); __d("WAWebDetailImage.react",["fbt","$InternalEnum","WALogger","WAShiftTimer","WAWebAnnouncementSpeakerIcon.react","WAWebAvatarSpinner.react","WAWebBizGatingUtils","WAWebBotGating","WAWebChatCollection","WAWebChatCommunityUtils","WAWebChatEphemerality","WAWebChatGetters","WAWebChatProfilePictureGatingUtils","WAWebClassnames","WAWebCommonCTWAConsumerTransparency","WAWebCommunityGatingUtils","WAWebCommunityGeneralChatImage.react","WAWebCommunitySquircleIcon.react","WAWebContactCollection","WAWebDefaultBroadcastIcon.react","WAWebDefaultCommunityRefreshedIcon.react","WAWebDefaultContactRefreshedIcon.react","WAWebDefaultGroupIcon.react","WAWebDefaultGroupRefreshedIcon.react","WAWebDefaultNewsletterIcon.react","WAWebDefaultUserColorIcon.react","WAWebDefaultUserIcon.react","WAWebDefaultUserSquareIcon.react","WAWebDisappearingIcon.react","WAWebDisappearingMessagesRefreshedIcon.react","WAWebDoubleChevronIcon.react","WAWebDoubleChevronInCircleIcon.react","WAWebGroupType","WAWebHasAcceptedBizBotTos","WAWebIdleComponent.react","WAWebImg.react","WAWebInitialsFromNameUtils","WAWebInitialsProfilePicture.react","WAWebKeyboardIsKeyActivation","WAWebMiscErrors","WAWebMiscGatingUtils","WAWebMmsClientIsErrorRetryable","WAWebProfilePicThumbCollection","WAWebPsaVerifiedBlueIcon.react","WAWebPsaVerifiedIcon.react","WAWebSingleChevronInCircleIcon.react","WAWebStateUtils","WAWebUIRefreshGatingUtils","WAWebUISpacing","WAWebUnjoinedSubgroupMetadataCollection","WAWebUseIsKeyboardUser","WAWebUserPrefsMeUser","WAWebVisibilityOffOutlineIcon.react","WAWebWaChatPsaIcon.react","WAWebWid","WDSFocusStateStyles","cr:5981","gkx","react","stylex","useLazyRef","useWAWebEventTargetValue","useWAWebForceUpdate","useWAWebGroupColors","useWAWebListener","useWAWebModelValues"],(function(a,b,c,d,e,f,g,h){var i,j,k;function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[GCPP] User contact not in collection"]);l=function(){return a};return a}e=k||d("react");var m=i||(i=c("react")),n=e.useEffect,o=e.useRef,p=e.useState,q=b("cr:5981")==null?void 0:b("cr:5981").InternalStatusWarningImageOverlay,r=b("$InternalEnum").Mirrored(["ExtraSmall","Small","Medium","Large","Refresh","None"]),s=b("$InternalEnum").Mirrored(["Low","High"]),t=b("$InternalEnum").Mirrored(["Circle","Square","Squircle"]),u=b("$InternalEnum").Mirrored(["GroupChatProfilePicture","Status"]),v={announcementSpeaker:{color:"x1o6zcso",$$css:!0},communitySquircle:{color:"x6k2sxb",$$css:!0},newsletter:{color:"x1oc2adj",$$css:!0},avatarDefaultPSA:{borderTopStartRadius:"x14yjl9h",borderTopEndRadius:"xudhj91",borderBottomEndRadius:"x18nykt9",borderBottomStartRadius:"xww2gxu",$$css:!0},dimmed:{opacity:"xavfwda",$$css:!0},avatar:{position:"x1n2onr6",borderTopStartRadius:"x14yjl9h",borderTopEndRadius:"xudhj91",borderBottomEndRadius:"x18nykt9",borderBottomStartRadius:"xww2gxu",$$css:!0},status:{backgroundColor:"x1gle93d",$$css:!0},avatarSquare:{borderTopStartRadius:"x168nmei",borderTopEndRadius:"x13lgxp2",borderBottomEndRadius:"x5pf9jr",borderBottomStartRadius:"xo71vjh",$$css:!0},avatarImage:{position:"x1n2onr6",display:"x1lliihq",width:"xh8yej3",height:"x5yr21d",overflowX:"x6ikm8r",overflowY:"x10wlt62",borderTopStartRadius:"x14yjl9h",borderTopEndRadius:"xudhj91",borderBottomEndRadius:"x18nykt9",borderBottomStartRadius:"xww2gxu",objectFit:"xl1xv1r",objectPosition:"x115dhu7",opacity:"xg01cxk",transition:"x17vty23",$$css:!0},isLoaded:{opacity:"x1hc1fzr",$$css:!0},avatarImageNoTransition:{transition:"xq2gx43",$$css:!0},avatarSquircle:{clipPath:"x1f2iure",borderTopStartRadius:"x168nmei",borderTopEndRadius:"x13lgxp2",borderBottomEndRadius:"x5pf9jr",borderBottomStartRadius:"xo71vjh",$$css:!0},groupProfilePicture:{position:"x10l6tqk",start:"x1d21pym",left:null,right:null,width:"xgd8bvy",height:"x1fgtraw",$$css:!0},groupProfilePictureInBubble:{width:"x14qfxbe",height:"xc9qbxq",$$css:!0},svgSize:{width:"xh8yej3",height:"x5yr21d",$$css:!0},profilePictureOutlineRefreshed:{outline:"x4u6w88",outlineOffset:"x1g40iwv",$$css:!0},circleIconRefreshed:{borderTopStartRadius:"x14yjl9h",borderTopEndRadius:"xudhj91",borderBottomEndRadius:"x18nykt9",borderBottomStartRadius:"xww2gxu",backgroundColor:"x1q3ci2r",$$css:!0},squircleIconRefreshed:{clipPath:"x1f2iure",backgroundColor:"x1q3ci2r",$$css:!0},avatarBorder:{borderTopWidth:"xamhcws",borderEndWidth:"xol2nv",borderBottomWidth:"xlxy82",borderStartWidth:"x19p7ews",borderTopStyle:"x13fuv20",borderEndStyle:"xu3j5b3",borderBottomStyle:"x1q0q8m5",borderStartStyle:"x26u7qi",borderTopColor:"x16jw5py",borderEndColor:"x1vxtsqp",borderBottomColor:"xd9srri",borderStartColor:"xbhygzs",$$css:!0},avatarProfileRingBorder:{borderTopWidth:"xamhcws",borderEndWidth:"xol2nv",borderBottomWidth:"xlxy82",borderStartWidth:"x19p7ews",borderTopStyle:"x13fuv20",borderEndStyle:"xu3j5b3",borderBottomStyle:"x1q0q8m5",borderStartStyle:"x26u7qi",borderTopColor:"x15v8gs4",borderEndColor:"x162so29",borderBottomColor:"x1bjh4cy",borderStartColor:"x1glpscf",boxSizing:"x9f619",$$css:!0},avatarDefaultAnnouncementGroup:{backgroundColor:"x13vkxft",$$css:!0},inviteModal:{borderTopWidth:"xamhcws",borderEndWidth:"xol2nv",borderBottomWidth:"xlxy82",borderStartWidth:"x19p7ews",borderTopStyle:"x13fuv20",borderEndStyle:"xu3j5b3",borderBottomStyle:"x1q0q8m5",borderStartStyle:"x26u7qi",borderTopColor:"xbafujx",borderEndColor:"x1luuugu",borderBottomColor:"xl389m7",borderStartColor:"x1et3sre",backgroundColor:"x1v8jjaa",$$css:!0},outline:{borderTopColor:"xyj1x25",borderEndColor:"x1mh0e9j",borderBottomColor:"x1v2jjsl",borderStartColor:"xa5e9bk",borderTopStyle:"x13fuv20",borderEndStyle:"xu3j5b3",borderBottomStyle:"x1q0q8m5",borderStartStyle:"x26u7qi",borderTopWidth:"x178xt8z",borderEndWidth:"xm81vs4",borderBottomWidth:"xso031l",borderStartWidth:"xy80clv",$$css:!0},badge:{position:"x10l6tqk",end:"x1up323v",bottom:"x48lskh",zIndex:"x42zw1d",boxSizing:"x9f619",width:"xw4jnvo",height:"x1qx5ct2",pointerEvents:"x47corl",borderTopStartRadius:"x14yjl9h",borderTopEndRadius:"xudhj91",borderBottomEndRadius:"x18nykt9",borderBottomStartRadius:"xww2gxu",$$css:!0},chatList:{backgroundColor:"x150wa6m",$$css:!0},conversationHeader:{backgroundColor:"x1pl83jw",$$css:!0},subgroupJoinModal:{backgroundColor:"x150wa6m",width:"x1849jeq",height:"x1gnnpzl",end:"xds687c",left:null,right:null,bottom:"x1ey2m1c",$$css:!0},badgeIconSVG:{width:"x1xp8n7a",height:"xmix8c7",$$css:!0},polls:{borderTopWidth:"x178xt8z",borderEndWidth:"xm81vs4",borderBottomWidth:"xso031l",borderStartWidth:"xy80clv",borderTopStyle:"x13fuv20",borderEndStyle:"xu3j5b3",borderBottomStyle:"x1q0q8m5",borderStartStyle:"x26u7qi",$$css:!0},pollsSender:{borderTopColor:"x2q17o7",borderEndColor:"x18085pc",borderBottomColor:"x1ucqoxt",borderStartColor:"x1jwnv8o",$$css:!0},pollsReceiver:{borderTopColor:"x1ca3cpu",borderEndColor:"x18203mh",borderBottomColor:"x1vwx84n",borderStartColor:"x16243dv",$$css:!0},backgroundFill:{fill:"xl21vc0",$$css:!0},primaryFill:{fill:"x1d6ck0k",$$css:!0},badgeIconPathSVG:{color:"xfect85",$$css:!0},dataSharingIcon:{color:"xht95ry",$$css:!0},dataSharingUpdatedStyleIcon:{color:"xrl28ub",$$css:!0},subgroupJoinModalSvgStyle:{width:"xgd8bvy",height:"x1fgtraw",$$css:!0},groupProfilePictureSticky:{position:"x7wzq59",top:"x1eu8d0j",$$css:!0}},w=100;function x(a){var b,e=a.profilePicThumbImg,f=a.spinnerClassName,g=a.spinnerXstyle,h=a.spinnerSize,i=a.imgClassName,k=a.imgXstyle,l=a.alt,q=a.onLoad,r=a.profilePicThumb,s=a.loader,u=s===void 0?!1:s;s=a.theme;var x=a.loadingAnimation;x=x===void 0?!0:x;var y=a.id;y=p((d("WAWebBotGating").isBotReceiveEnabled()&&y instanceof c("WAWebWid")&&(y==null?void 0:y.isBot()))!==!0);var z=y[0],A=y[1];y=p(!1);var B=y[0],C=y[1];y=p(!1);var D=y[0],E=y[1];y=p(e);var F=y[0];y=y[1];var G=d("WAWebUIRefreshGatingUtils").uiRefreshM1Enabled(),H=o(Boolean(e)),I=o(!1),J=s!=="business",K=c("useLazyRef")(function(){return u&&J?new(d("WAShiftTimer").ShiftTimer)(function(){E(!0)}):null});e!==F&&(y(e),A(!0),C(!1),E(!1));s=function(a){(a=K.current)==null?void 0:a.cancel();r.markMms4HostSuccess();A(!1);C(!0);q==null?void 0:q()};y=function(a){var b;(b=K.current)==null?void 0:b.cancel();if(a instanceof d("WAWebMiscErrors").ServerStatusError)switch(a.status){case 403:r.markStale({eurl:!0});I.current||(I.current=!0,r.validate());break;case 410:r.markStale();break;default:d("WAWebMmsClientIsErrorRetryable").isRetriableStatusCode(a.status)&&r.markMms4HostFailure();break}A(!1);C(!1)};n(function(){var a,b=K;(a=b.current)==null?void 0:a.onOrAfter(w);return function(){var a;(a=b.current)==null?void 0:a.cancel()}},[r,K]);e=function(){return!J?!1:!!u&&D&&z&&!(!d("WAWebStateUtils").unproxy(r).stale&&!F)};i=d("WAWebClassnames").classnamesConvertMeToStylexPlease((b={},b[i]=typeof i==="string",b),(j||(j=c("stylex")))(x===!1&&H.current&&v.avatarImageNoTransition,v.avatarImage,a.shape===t.Square&&v.avatarSquare,a.shape===t.Squircle&&v.avatarSquircle,!z&&v.isLoaded,G&&a.shape!==t.Squircle&&v.profilePictureOutlineRefreshed,k));var L,M;e()&&(L=m.jsx(c("WAWebAvatarSpinner.react"),{className:f,xstyle:g,size:h}));F&&(M=m.jsx(c("WAWebImg.react"),{src:F,hasPrivacyChecks:!0,crossOrigin:!1,className:i,draggable:!1,onLoad:s,onError:y,alt:l}));b=B?null:a.defaultIcon;x===!1&&(b=M!=null?null:a.defaultIcon);return m.jsxs(m.Fragment,{children:[L,b,M]})}x.displayName=x.name+" [from "+f.id+"]";function y(a){var b=d("useWAWebModelValues").useModelValues(a.profilePicThumb,["imgFull"]);return m.jsx(x,babelHelpers["extends"]({},a,{profilePicThumbImg:b.imgFull}))}y.displayName=y.name+" [from "+f.id+"]";function z(a){var b=d("useWAWebModelValues").useModelValues(a.profilePicThumb,["img"]);return m.jsx(x,babelHelpers["extends"]({},a,{profilePicThumbImg:b.img}))}z.displayName=z.name+" [from "+f.id+"]";function A(a){if(a==="group_profile_picture"||a==="group_profile_picture_in_bubble")return u.GroupChatProfilePicture;return a==="status"?u.Status:null}var B=28;function C(a){if(typeof a==="string")switch(a){case r.ExtraSmall:return 40;case r.Small:return 49;case r.Medium:return 100;case r.Large:return 200;case r.Refresh:return 128;case r.None:return void 0}else return a}function a(a){var b=a.id,e=a.size,f=a.quality,g=f===void 0?s.Low:f,i=a.loader,k=a.onClick,n=a.onLoad;f=a.quoted;var p=a.shape,u=a.border,w=a.waitIdle,x=a.ephemeralIcon,F=a.checkmarkIcon,G=a.hiddenSubgroupIcon,H=a.theme,I=a.alt,J=a.xstyle,K=a.authorColor,L=a.loadPicture,M=L===void 0?!0:L;L=a.loadAnimation;var aa=L===void 0?!0:L;L=a.tabIndex;var N=a.ariaLabel,O=a.testId,ba=a.tabOrder;O=a.showOutline;O=O===void 0?!1:O;var ca=a.enableAdsDataSharingIcon,P=a.enableBizAiDataSharingIcon;P=P===void 0?!1:P;var Q=a.groupProfilePictureSticky;Q=Q===void 0?!1:Q;var R=d("useWAWebForceUpdate").useForceUpdateDONOTUSE(),S=o(null),T=c("WAWebUseIsKeyboardUser")();T=T.isKeyboardUser;var U=d("WAWebChatCollection").ChatCollection.get(b),da=d("WAWebHasAcceptedBizBotTos").useHasAcceptedBizBotTos(),V;typeof e==="number"?V=e>0?e:r.Small:V=e!=null?e:r.Small;var W={height:C(V),width:C(V)};k&&(W.cursor="pointer");var X,Y;if(U!=null&&((V=U.groupMetadata)==null?void 0:(V=V.participants)==null?void 0:V.iAmMember())){if(d("WAWebChatGetters").getIsGroup(U)){X=(V=U.groupMetadata)==null?void 0:V.groupType;Y=U.groupMetadata}}else{V=c("WAWebUnjoinedSubgroupMetadataCollection").get(b.toString());X=V==null?void 0:V.groupType;Y=V}d("useWAWebListener").useListener(U!=null&&d("WAWebChatGetters").getIsGroup(U)?Y:U,"change:ephemeralDuration",R);V=c("useWAWebEventTargetValue")(Y,"change:hiddenSubgroup",function(){var a;return((a=Y)==null?void 0:a.hiddenSubgroup)===!0});var Z=(j||(j=c("stylex")))(v.avatar,H==="status"&&v.status,p===t.Square&&v.avatarSquare,p===t.Squircle&&v.avatarSquircle,H==="group_profile_picture"&&v.groupProfilePicture,H==="group_profile_picture_in_bubble"&&v.groupProfilePictureInBubble,H==="status_profile_photo_ring"&&v.avatarProfileRingBorder,H==="invite_modal"&&v.inviteModal,(H==="polls_sender"||H==="polls_receiver")&&v.polls,H==="polls_sender"&&v.pollsSender,H==="polls_receiver"&&v.pollsReceiver,d("WAWebChatCommunityUtils").isIntegrityDeactivatedCommunity(U)&&v.dimmed,u===!0&&v.avatarBorder,X===d("WAWebGroupType").GroupType.LINKED_ANNOUNCEMENT_GROUP&&v.avatarDefaultAnnouncementGroup,k!=null&&T&&H==="group_profile_picture"&&d("WDSFocusStateStyles").WDSFocusStateStyles.genericFocus,k!=null&&T&&H==="chatlist_header_profile_photo"&&d("WDSFocusStateStyles").WDSFocusStateStyles.genericFocus,O&&v.outline,H==="group_profile_picture"&&Q&&v.groupProfilePictureSticky,J);R=function(a){if(c("WAWebKeyboardIsKeyActivation")(a)){(a=S.current)==null?void 0:a.click()}};var ea=k!=null?{tabIndex:L,role:"button","aria-label":N,onKeyDown:R}:{};u=A(H);var $=m.jsx(E,{id:b,quoted:f,groupType:X,theme:u,authorColor:K,shape:a.shape});if(H==="group_profile_picture"&&d("WAWebChatProfilePictureGatingUtils").shouldDisplayInitialsInProfilePicture(b)){T=d("WAWebContactCollection").ContactCollection.get(b);if(T){O=d("WAWebInitialsFromNameUtils").getInitialsFromContact(T);if(O.firstInitial!=null||O.secondInitial!=null){$=m.jsx(d("WAWebInitialsProfilePicture.react").InitialsProfilePicture,{initialsData:O,theme:d("WAWebInitialsProfilePicture.react").ThemeType.GroupChatProfilePicture,backgroundColorId:(Q=K)!=null?Q:1})}}else d("WALogger").DEV(l())}J=function(){var a,f;M?f=d("WAWebProfilePicThumbCollection").ProfilePicThumbCollection.gadd(b):f=d("WAWebProfilePicThumbCollection").ProfilePicThumbCollection.get(b);f?g===s.High?a=m.jsx(y,{profilePicThumb:f,defaultIcon:$,loader:i,onLoad:n,alt:I,shape:p,id:b}):a=m.jsx(z,{profilePicThumb:f,defaultIcon:$,loader:i,onLoad:n,alt:I,loadingAnimation:aa,shape:p,id:b}):a=$;return m.jsxs("div",babelHelpers["extends"]({"data-testid":void 0,ref:S,"data-tab":ba},ea,{className:Z,style:W,onClick:k,children:[a,!c("gkx")("26258")&&(typeof e!=="number"||e>=B)&&q?m.jsx(q,{id:b}):null]}))};L=m.jsx(c("WAWebIdleComponent.react"),{id:b,onComplex:J,waitIdle:w,children:m.jsx("div",babelHelpers["extends"]({ref:S},ea,{className:Z,style:W,onClick:k,children:$}))});if(a.emojiBadge!=null&&d("WAWebUserPrefsMeUser").isMeAccount(b))return m.jsxs("div",babelHelpers["extends"]({className:"x1n2onr6"},{"aria-label":h._(/*BTDS*/"__JHASH__C8RkWq2-FVH__JHASH__"),children:[m.jsx("div",babelHelpers["extends"]({className:"x10l6tqk x1up323v x48lskh x42zw1d x9f619 xw4jnvo x1qx5ct2 x47corl x14yjl9h xudhj91 x18nykt9 xww2gxu x1pl83jw"},{children:a.emojiBadge})),L]}));f=(R=U==null?void 0:(N=U.contact.businessProfile)==null?void 0:N.isBizBot1p)!=null?R:!1;u=da&&d("WAWebBizGatingUtils").isUpdatedConsumerDisclosureUiRowEnabled();H=P&&f&&u;T=Boolean(x!=null&&U&&d("WAWebChatEphemerality").isEphemeralSettingOn(U));O=ca===!0&&U!=null&&d("WAWebCommonCTWAConsumerTransparency").shouldShowConsumerTransparencyDisclosure(U);K=G!=null&&F==null&&V;if(H||T===!0||F||O||K){w=(J=(Q=x)!=null?Q:F)!=null?J:G;return m.jsxs("div",babelHelpers["extends"]({className:"x1n2onr6"},{"aria-label":h._(/*BTDS*/"__JHASH__a-GSRkRs_yT__JHASH__"),children:[m.jsx("div",babelHelpers["extends"]({},(j||(j=c("stylex"))).props(v.badge,d("WAWebUISpacing").uiPadding.all1,w==="chat-list"&&v.chatList,w==="conversation-header"&&v.conversationHeader,w==="subgroup-join-modal"&&v.subgroupJoinModal),{children:m.jsx(D,{iconScheme:w,shouldShowEphemeralIcon:T,shouldShowHiddenSubgroupIcon:K,shouldShowAdsDataSharingIcon:O,shouldShowBizAiDataSharingIcon:H})})),L]}))}return L}a.displayName=a.name+" [from "+f.id+"]";function D(a){var b=a.iconScheme,c=a.shouldShowAdsDataSharingIcon;c=c===void 0?!1:c;var e=a.shouldShowBizAiDataSharingIcon;e=e===void 0?!1:e;var f=a.shouldShowEphemeralIcon;f=f===void 0?!1:f;a=a.shouldShowHiddenSubgroupIcon;a=a===void 0?!1:a;if(e)return m.jsx(d("WAWebDoubleChevronInCircleIcon.react").DoubleChevronInCircleIcon,{iconXstyle:[v.svgSize,v.badgeIconSVG,v.dataSharingUpdatedStyleIcon]});if(c)return d("WAWebCommonCTWAConsumerTransparency").shouldShowUpdatedConsumerDisclosure()?m.jsx(d("WAWebSingleChevronInCircleIcon.react").SingleChevronInCircleIcon,{iconXstyle:[v.svgSize,v.badgeIconSVG,v.dataSharingUpdatedStyleIcon]}):m.jsx(d("WAWebDoubleChevronIcon.react").DoubleChevronIcon,{iconXstyle:[v.svgSize,v.badgeIconSVG,v.dataSharingIcon]});e=d("WAWebMiscGatingUtils").isBlueEnabled()?d("WAWebPsaVerifiedBlueIcon.react").PsaVerifiedBlueIcon:d("WAWebPsaVerifiedIcon.react").PsaVerifiedIcon;f===!0?c=d("WAWebUIRefreshGatingUtils").uiRefreshM1Enabled()?d("WAWebDisappearingMessagesRefreshedIcon.react").DisappearingMessagesRefreshedIcon:d("WAWebDisappearingIcon.react").DisappearingIcon:a?c=d("WAWebVisibilityOffOutlineIcon.react").VisibilityOffOutlineIcon:c=e;return m.jsx(c,{xstyle:v.badgeIconPathSVG,iconXstyle:[v.svgSize,v.badgeIconSVG,b==="subgroup-join-modal"&&v.subgroupJoinModalSvgStyle]})}D.displayName=D.name+" [from "+f.id+"]";function E(a){var b=a.authorColor,e=a.groupType,f=a.id,g=a.quoted,h=a.shape,i=a.theme;a=a.xstyle;var j=d("WAWebUIRefreshGatingUtils").uiRefreshM1Enabled(),k=j?m.jsx(d("WAWebDefaultContactRefreshedIcon.react").DefaultContactRefreshedIcon,{iconXstyle:[v.svgSize,v.circleIconRefreshed,v.profilePictureOutlineRefreshed,a],"aria-hidden":!0,innerStyles:{primary:v.primaryFill}}):m.jsx(d("WAWebDefaultUserIcon.react").DefaultUserIcon,{iconXstyle:[v.svgSize,a],"aria-hidden":!0,innerStyles:{primary:v.primaryFill,background:v.backgroundFill}});c("WAWebWid").isUser(f)&&!c("WAWebWid").isPSA(f)&&g?k=m.jsx(d("WAWebDefaultUserSquareIcon.react").DefaultUserSquareIcon,{iconXstyle:[v.svgSize,a],"aria-hidden":!0,innerStyles:{primary:v.primaryFill,background:v.backgroundFill}}):c("WAWebWid").isGroup(f)?e===d("WAWebGroupType").GroupType.LINKED_ANNOUNCEMENT_GROUP?k=m.jsx(d("WAWebAnnouncementSpeakerIcon.react").AnnouncementSpeakerIcon,{iconXstyle:[v.svgSize,v.announcementSpeaker,a],directional:!0,"aria-hidden":!0}):e===d("WAWebGroupType").GroupType.COMMUNITY||h===t.Squircle?k=j?m.jsx(d("WAWebDefaultCommunityRefreshedIcon.react").DefaultCommunityRefreshedIcon,{iconXstyle:[v.svgSize,v.communitySquircle,v.squircleIconRefreshed,a],"aria-hidden":!0,innerStyles:{primary:v.primaryFill}}):m.jsx(d("WAWebCommunitySquircleIcon.react").CommunitySquircleIcon,{iconXstyle:[v.svgSize,v.communitySquircle,a],"aria-hidden":!0,innerStyles:{primary:v.primaryFill,background:v.backgroundFill}}):e===d("WAWebGroupType").GroupType.LINKED_GENERAL_GROUP&&d("WAWebCommunityGatingUtils").communityGeneralChatUIEnabled()?k=m.jsx(d("WAWebCommunityGeneralChatImage.react").CommunityGeneralChatImage,{}):k=j?m.jsx(d("WAWebDefaultGroupRefreshedIcon.react").DefaultGroupRefreshedIcon,{iconXstyle:[v.svgSize,v.circleIconRefreshed,v.profilePictureOutlineRefreshed,a],"aria-hidden":!0,innerStyles:{primary:v.primaryFill}}):m.jsx(d("WAWebDefaultGroupIcon.react").DefaultGroupIcon,{iconXstyle:[v.svgSize,a],"aria-hidden":!0,innerStyles:{primary:v.primaryFill,background:v.backgroundFill}}):c("WAWebWid").isBroadcast(f)?k=m.jsx(d("WAWebDefaultBroadcastIcon.react").DefaultBroadcastIcon,{iconXstyle:[v.svgSize,a],"aria-hidden":!0}):c("WAWebWid").isPSA(f)?k=m.jsx(d("WAWebWaChatPsaIcon.react").WaChatPsaIcon,{iconXstyle:[v.svgSize,v.avatarDefaultPSA,a],"aria-hidden":!0}):c("WAWebWid").isNewsletter(f)&&(k=m.jsx(d("WAWebDefaultNewsletterIcon.react").DefaultNewsletterIcon,{iconXstyle:[v.svgSize,v.newsletter,a],"aria-hidden":!0,innerStyles:{primary:v.primaryFill,background:v.backgroundFill}}));g=m.createElement("div",babelHelpers["extends"]({},{0:{className:"x10l6tqk x13vifvy x17qophe x78zum5 x6s0dn4 xl56j7k xh8yej3 x5yr21d"},1:{className:"x10l6tqk x13vifvy x17qophe x78zum5 x6s0dn4 xl56j7k xh8yej3 x5yr21d xfimr68 x1jpgh95"}}[!!(i===u.Status)<<0],{key:"default"}),k);e=d("useWAWebGroupColors").useGroupsColorStyle((h=b)!=null?h:1,"color");i===u.GroupChatProfilePicture&&(g=m.createElement("div",babelHelpers["extends"]({className:"x10l6tqk x13vifvy x17qophe x78zum5 x6s0dn4 xl56j7k xh8yej3 x5yr21d"},{key:"default"}),m.jsx(d("WAWebDefaultUserColorIcon.react").DefaultUserColorIcon,{iconXstyle:[v.svgSize,a],xstyle:e})));return g}E.displayName=E.name+" [from "+f.id+"]";g.DetailImageSize=r;g.DetailImageQuality=s;g.DetailImageShape=t;g.DefaultIconThemeType=u;g.DetailImageCommon=x;g.getSize=C;g.DetailImage=a;g.ImageIcon=D;g.DefaultIcon=E}),226); __d("WAWebFormatComponentUtils",[],(function(a,b,c,d,e,f){function a(a){a=typeof a==="string"?[a]:[].concat(a);typeof a[0]==="string"&&(a[0]=a[0].replace(" ",""));return a}f.removeFirstLeadingSpace=a}),66); __d("WAWebBlockQuoteMutatorComponent.react",["WABidi","WAWebCopyPasteSelectable.react","WAWebFormatComponentUtils","WAWebL10N","WAWebUISpacing","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k={quote:{display:"x1rg5ohu",position:"x1n2onr6",width:"xh8yej3",color:"xbs004d",$$css:!0},quotedColor:{color:"x15rks2t",borderTopColor:"x1b4hy2t",borderEndColor:"xaeiroq",borderBottomColor:"x1tnzt7h",borderStartColor:"xdc8vam",$$css:!0}};function a(a){var b=a.children;b=b===void 0?"":b;var e=a.inline;e=e===void 0?!1:e;var f=a.quoted;f=f===void 0?!1:f;var g=a.selectable;a=a.text;a=d("WABidi").dir(a);var h=a==="rtl"!==c("WAWebL10N").isRTL(),l="> ";return e?j.jsx(d("WAWebCopyPasteSelectable.react").SelectableSpan,{dir:a,selectable:g,prePlainText:l,className:{0:"xt0psk2 x14atkfc xbs004d x19jh3bc x26u7qi xjnu75l x1w4ip6v x1t2a60a",2:"xt0psk2 x14atkfc x15rks2t x1b4hy2t xaeiroq x1tnzt7h x19jh3bc x26u7qi xjnu75l x1w4ip6v x1t2a60a",1:"xt0psk2 x14atkfc x19jh3bc x26u7qi x1w4ip6v x1t2a60a xbs004d x10qsr78 xu3j5b3 x18pw4m5 xeyog9w x1mpkggp",3:"xt0psk2 x14atkfc x19jh3bc x26u7qi x1w4ip6v x1t2a60a x15rks2t x1b4hy2t x1tnzt7h xdc8vam x10qsr78 xu3j5b3 x18pw4m5 xeyog9w x1mpkggp"}[!!f<<1|!!h<<0],children:b}):j.jsxs(d("WAWebCopyPasteSelectable.react").SelectableBlockQuote,{dir:a,selectable:g,prePlainText:l,className:(i||(i=c("stylex")))([k.quote,f&&k.quotedColor,!f&&d("WAWebUISpacing").uiMargin.vert4]),children:[j.jsx("div",babelHelpers["extends"]({},{0:{className:"x10l6tqk x17qophe x13vifvy x5yr21d x1g8rjiy x1plhrm9 x146dn1l x11t77rh x1thhq0t xf6uls8"},2:{className:"x10l6tqk x17qophe x13vifvy x5yr21d x1g8rjiy x1plhrm9 x146dn1l x11t77rh x1thhq0t xf6uls8 xds687c"},1:{className:"x10l6tqk x17qophe x13vifvy x5yr21d x1g8rjiy x146dn1l x11t77rh x1thhq0t xf6uls8 xtwfq29"},3:{className:"x10l6tqk x17qophe x13vifvy x5yr21d x1g8rjiy x146dn1l x11t77rh x1thhq0t xf6uls8 xds687c xtwfq29"}}[!!h<<1|!!f<<0])),j.jsx("div",babelHelpers["extends"]({},{0:{className:"x1rg5ohu xvpee5o xj0a0fe xeaf4i8"},1:{className:"x1rg5ohu xj0a0fe xeaf4i8 xkhd6sd x14uny0o"}}[!!h<<0],{children:d("WAWebFormatComponentUtils").removeFirstLeadingSpace(b)}))]})}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),98); __d("WAWebBulletedListItemMutatorComponent.react",["WABidi","WAWebCopyPasteSelectable.react","WAWebFormatComponentUtils","WAWebL10N","react"],(function(a,b,c,d,e,f,g){var h,i=h||c("react");function j(a){if(a==null||a==="")return;return d("WABidi").dir(a)}function k(a){a=j(a)==="rtl";return a!==c("WAWebL10N").isRTL()}function a(a){var b=a.children;b=b===void 0?"":b;var c=a.inline;c=c===void 0?!1:c;var e=a.selectable,f=a.symbol;a=a.text;if(c)return i.jsxs(d("WAWebCopyPasteSelectable.react").SelectableSpan,{selectable:e,children:["\u2022",b]});c=f+" ";return i.jsx("li",babelHelpers["extends"]({dir:"auto"},{0:{className:"x1ye3gou x1jieuv1 xo7wnuk x1sy0ulg xt1y1ed xlu7um4 xm78dhd x1r4uxqn"},1:{className:"x1jieuv1 xo7wnuk xlu7um4 xm78dhd x1r4uxqn xp4054r xkhd6sd xn6708d x1rwch9a x1xcqooi"}}[!!k(a)<<0],{children:i.jsx(d("WAWebCopyPasteSelectable.react").SelectableSpan,{selectable:e,prePlainText:c,children:d("WAWebFormatComponentUtils").removeFirstLeadingSpace(b)})}))}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),98); __d("WAWebNumberedListItemMutatorComponent.react",["WABidi","WAWebCopyPasteSelectable.react","WAWebFormatComponentUtils","WAWebL10N","WAWebUISpacing","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k={dirMismatch:{textAlign:"xp4054r",listStylePosition:"x1cy9i3i",$$css:!0}};function l(a){if(a==null||a==="")return;return d("WABidi").dir(a)}function m(a){a=l(a)==="rtl";return a!==c("WAWebL10N").isRTL()}function a(a){var b=a.children;b=b===void 0?"":b;var e=a.inline;e=e===void 0?!1:e;var f=a.numbering,g=a.selectable;a=a.text;if(e)return j.jsxs(d("WAWebCopyPasteSelectable.react").SelectableSpan,{selectable:g,children:[f,b]});e=f+" ";return j.jsx("li",babelHelpers["extends"]({dir:"auto",value:f.replace(".","")},(i||(i=c("stylex"))).props([m(a)&&k.dirMismatch,d("WAWebUISpacing").uiPadding.start2]),{children:j.jsx(d("WAWebCopyPasteSelectable.react").SelectableSpan,{selectable:g,prePlainText:e,children:d("WAWebFormatComponentUtils").removeFirstLeadingSpace(b)})}))}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),98); __d("WAWebTextMutatorComponentUtils",["WAWebBulletedListItemMutatorComponent.react","WAWebNumberedListItemMutatorComponent.react"],(function(a,b,c,d,e,f,g){function a(a){a=Array.isArray(a)?a:[a];var b=[],d=[];for(a of a)if(typeof a==="string"&&a.match(/^\r?\n$/)&&d.length)d.push(a);else if(a!=null&&typeof a==="object"&&(a.type===c("WAWebBulletedListItemMutatorComponent.react")||a.type===c("WAWebNumberedListItemMutatorComponent.react")))d.push(a);else{var e=a;d.length&&(b.push({isList:!0,children:d}),d=[],typeof e==="string"&&(e=e.replace(/^\r?\n/g,"")));b.push({isList:!1,children:e})}d.length&&b.push({isList:!0,children:d});return b}g.groupListChildren=a}),98); __d("WAWebBulletedListMutatorComponent.react",["WAWebL10N","WAWebTextMutatorComponentUtils","WAWebUISpacing","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k={ul:{wordBreak:"x13faqbe",whiteSpace:"xeaf4i8",position:"x1n2onr6",$$css:!0}};function a(a){var b=a.children;b=b===void 0?"":b;var e=a.inline;e=e===void 0?!1:e;var f=a.largerIndentation,g=f===void 0?!1:f;f=a.quoted;var h=f===void 0?!1:f;if(e)return b;var l=[];d("WAWebTextMutatorComponentUtils").groupListChildren(b).forEach(function(a,b){a.isList?l.push(j.jsx("ul",babelHelpers["extends"]({},(i||(i=c("stylex"))).props(k.ul,!h&&d("WAWebUISpacing").uiMargin.vert4,d("WAWebUISpacing").uiMargin.start18,g?d("WAWebUISpacing").uiMargin.start18:d("WAWebUISpacing").uiMargin.start8),{dir:c("WAWebL10N").isRTL()?"rtl":"ltr",children:a.children}),b)):l.push(a.children)});return l}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),98); __d("WAWebFormatFilter",[],(function(a,b,c,d,e,f){function a(a,b){if(a.length===1)return a;var c=[],d;while(d=a.pop()){var e=d,f=e[0],g=e[3];e=e[4];e=b[e];var h=e[0];e=e[2];var i=!0,j=c.length;for(j=j-1;j>=0;--j){var k=c[j],l=k[2],m=k[3];k=k[4];if(f>m)continue;m=b[k];k=m[0];m=m[2];if(g>l){if(e<m&&c.splice(j,1))continue;i=!1;break}if(k.mutates&&!(i=!1))break;if(h.compatibility){h.nestable(k)||(i=!1);break}if(!h.nestable(k)&&!k.compatibility&&e<m&&c.splice(j,1))continue;if(!h.compatibility&&!k.format){i=!1;break}}i&&c.push(d)}return c}f["default"]=a}),66); __d("WAWebFormatFlatten",[],(function(a,b,c,d,e,f){function a(a){var b=[];for(var c=0;c<a.length;++c)for(var d=0;d<a[c].length;++d){var e=a[c][d],f=e[0];e=e[1];b.push([f,e,c])}return b}f["default"]=a}),66); __d("WAWebFormatMatch",[],(function(a,b,c,d,e,f){function a(a,b,c){c===void 0&&(c=Infinity);var d=[];for(var e=0;e<b.length;++e){var f=b[e],g=f[0];f=f[1];g=g.match(a,f,c);f=[];var h=g.length;for(var i=0,j=g[i];i<h;j=g[++i])f[i]=[j[0],j[1],j[2],j[3],e,j[4]];f.length&&d.push(f)}for(i=0;i<d.length;i++){h=b[d[i][0][4]][0].conflictResolvers;if(!h)continue;for(j=0;j<d.length;j++){g=b[d[j][0][4]][0];f=h.get(g);f==null?void 0:f(d[i],d[j])}}e=[];for(c=0;c<d.length;++c)e[c]=d[c].length-1;a=[];g=0;while(d.length){for(f=0,j=-1;f<d.length;++f)d[f][e[f]][0]>j&&(g=f,j=d[f][e[f]][0]);a.push(d[g][e[g]]);--e[g]<0&&(d.splice(g,1),e.splice(g,1))}return a}f["default"]=a}),66); __d("WAWebFormatParse",["WAUnicodeUtils","WAWebFormatFilter","WAWebFormatFlatten","WAWebFormatMatch","WAWebFormatParseTree"],(function(a,b,c,d,e,f,g){function a(a,b,d){d===void 0&&(d=Infinity);return h(a,c("WAWebFormatFlatten")(b),d)}function h(a,b,e){e===void 0&&(e=Infinity);var f=c("WAWebFormatMatch")(a,b,e);f=f.length?c("WAWebFormatParseTree")(a,c("WAWebFormatFilter")(f,b),b):{children:[{type:"text",value:a}]};b=d("WAUnicodeUtils").numCodepoints(a);e<b&&i(f,{limit:e});return f}function i(a,b){if(b.limit<=0)return;if(a.type&&a.type==="text"){if(a.value.length>=b.limit){var c=d("WAUnicodeUtils").toArray(a.value);c.length>=b.limit&&(c=c.slice(0,b.limit));a.value=c.join("");b.limit-=c.length}else b.limit-=a.value.length;return}else if(a.type&&a.type==="delimiter")return;c=0;while(c<a.children.length){i(a.children[c],b);if(b.limit<=0)break;c++}a.children=a.children.slice(0,c+1)}g.parse=a;g._parse=h}),98); __d("WAWebFormatParseTree",["WAWebFormatParse"],(function(a,b,c,d,e,f,g){function a(a,b,c){var e={children:[]},f=0,g=e,i=0;for(var j=0;j<b.length;++j){var k=b[j],l=k[0],m=k[1];while(g.parent&&l>(i=g.match[2])){f<=i&&g.children.push({type:"text",value:a.substring(f,i+1)});f=g.match[3]+1;if(g.mutator.fragment){var n=g.parent.children;n.pop();n.push.apply(n,g.children)}i!==g.match[3]&&g.parent.children.push({type:"delimiter",value:a.substring(i+1,f)});g=g.parent}f<l&&g.children.push({type:"text",value:a.substring(f,l)});n=c[k[4]];var o=n[0];n=n[1];var p=o.mutates;f=m;l!==m&&g.children.push({type:"delimiter",value:a.substring(l,m)});l={children:[],match:k,mutator:o,opts:n,parent:g};if(p){m=a.substring(k[1],k[2]+1);n=o.mutate(m,k[5]);p=h(o,c,l);m=d("WAWebFormatParse")._parse(n,p);l.children=m.children;f=k[2]+1}g.children.push(l);g=l}do{if(!g.match)continue;o=g.match;n=o[2];p=o[3];f<=n&&g.children.push({type:"text",value:a.substring(f,n+1)});f=p+1;if(g.mutator.fragment){m=g.parent.children;m.pop();m.push.apply(m,g.children)}n!==p&&g.parent.children.push({type:"delimiter",value:a.substring(n+1,f)})}while(g.parent&&(g=g.parent)&&g.parent);f!==a.length&&g.children.push({type:"text",value:a.substring(f)});return e}function h(a,b,c){a=a.format;var d=[];c=i(c);for(var e=0;e<b.length;++e){if(!a&&!b[e][0].compatibility)continue;if(c.includes(b[e][0]))continue;d.push(b[e])}return d}function i(a){a=a;var b=[];do a.mutator&&b.push(a.mutator);while(a.parent&&(a=a.parent));return b}g["default"]=a}),98); __d("WAWebFormatSerialize",["err"],(function(a,b,c,d,e,f,g){function a(a,b,c){return a.onRoot(i(a,b.children,c),c)}function h(a,b,d){if(b.type){var e=b.value;switch(b.type){case"text":return a.onText(e,d);case"delimiter":return a.onDelimiter(e,d);default:throw c("err")("Invalid node type")}}return a.onMutator(b.mutator,i(a,b.children,d),b.match[5],b.opts,d)}function i(a,b,c){return b.reduce(function(b,d){b.push(h(a,d,c));return b},[])}g["default"]=a}),98); __d("WAWebFormat",["WAWebFormatParse","WAWebFormatSerialize"],(function(a,b,c,d,e,f,g){function a(a,b,e,f,g){g===void 0&&(g=Infinity);return c("WAWebFormatSerialize")(e,d("WAWebFormatParse").parse(a,b,g),f)}g["default"]=a}),98); __d("WAWebFormatSerializer",["err"],(function(a,b,c,d,e,f,g){a=function(){function a(){}a.onMutator=function(a,b,d,e,f){throw c("err")("Subclasses of `Serializer` must override `onMutator()`")};a.onRoot=function(a,b){throw c("err")("Subclasses of `Serializer` must override `onRoot()`")};a.onText=function(a,b){throw c("err")("Subclasses of `Serializer` must override `onText()`")};a.onDelimiter=function(a,b){throw c("err")("Subclasses of `Serializer` must override `onDelimiter()`")};return a}();g["default"]=a}),98); __d("WAWebJsxTextSerializer",[],(function(a,b,c,d,e,f){function a(a){return a}f["default"]=a}),66); __d("WAWebNumberedListMutatorComponent.react",["WAWebL10N","WAWebTextMutatorComponentUtils","WAWebUISpacing","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k={ol:{wordBreak:"x13faqbe",whiteSpace:"xeaf4i8",position:"x1n2onr6",listStyle:"xua7rxp",$$css:!0}};function a(a){var b=a.children;b=b===void 0?"":b;var e=a.inline;e=e===void 0?!1:e;var f=a.largerIndentation,g=f===void 0?!1:f;f=a.quoted;var h=f===void 0?!1:f;if(e)return b;var l=[];d("WAWebTextMutatorComponentUtils").groupListChildren(b).forEach(function(a,b){a.isList?l.push(j.jsx("ol",babelHelpers["extends"]({},(i||(i=c("stylex"))).props(k.ol,d("WAWebUISpacing").uiMargin.start30,!h&&d("WAWebUISpacing").uiMargin.vert4,g?d("WAWebUISpacing").uiMargin.start30:d("WAWebUISpacing").uiMargin.start20),{dir:c("WAWebL10N").isRTL()?"rtl":"ltr",children:a.children}),b)):l.push(a.children)});return l}a.displayName=a.name+" [from "+f.id+"]";a.displayName="NumberedList";g["default"]=a}),98); __d("WAWebJsxSerializer.react",["WAWebBulletedListMutatorComponent.react","WAWebFormatSerializer","WAWebJsxTextSerializer","WAWebNumberedListMutatorComponent.react","react"],(function(a,b,c,d,e,f,g){var h,i=(h||d("react")).cloneElement;a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}return b}(c("WAWebFormatSerializer"));a.onText=c("WAWebJsxTextSerializer");a.onDelimiter=function(a){return void 0};a.onRoot=function(a){k(a);return j(a)};a.onMutator=function(a,b,c,d){return a.jsx(j(b),c,d)};function j(a){var b=[];for(var c=0;c<a.length;c++){var d=a[c];if(d===void 0)continue;if(typeof d==="string"){b.push(d);continue}var e="jsx-child-"+c;b.push(i(d,{key:e}))}return b}function k(a){var b=-1;for(var d of a){var e;if((d==null?void 0:d.type)!==c("WAWebNumberedListMutatorComponent.react"))continue;e=d==null?void 0:(e=d.props)==null?void 0:e.children;if(Array.isArray(e))for(e of e){var f;f=e==null?void 0:(f=e.props)==null?void 0:f.numbering;f!=null&&(b=Math.max(b,parseInt(f,10)))}}if(b>=10)for(f=0;f<a.length;f++){e=a[f];if((e==null?void 0:e.type)!==c("WAWebNumberedListMutatorComponent.react")&&(e==null?void 0:e.type)!==c("WAWebBulletedListMutatorComponent.react"))continue;a[f]=i(e,{largerIndentation:!0})}}g["default"]=a}),98); __d("WAWebHocComponent_DEPRECATED.react",["WANullthrows","react"],(function(a,b,c,d,e,f,g){var h;b=(h||d("react")).Component;function a(a){if(typeof a==="string")return a;if(!a)return"Component";var b=a.displayName;if(b!=null&&b!=="")return b;b=a.name;return b!=null&&b!==""?b:"Component"}e=function(a){babelHelpers.inheritsLoose(b,a);function b(b){var c;c=a.call(this,b)||this;c.setComponent=function(a){c.component=a};c.state=babelHelpers["extends"]({},c.state);return c}var d=b.prototype;d.getComponent=function(){return this.component instanceof b?this.component.getComponent():c("WANullthrows")(this.component)};return b}(b);g.getHocComponentDisplayName=a;g.WrappedComponent=e}),98); __d("WAWebListenerHoc_DEPRECATED",["WAAbortError","WALogger","WAWebCmd","WAWebDocumentFlushed","WAWebHocComponent_DEPRECATED.react","WAWebUIListener","react"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Listener added after unmounting"]);i=function(){return a};return a}var j=h||c("react"),k=function(){function a(){var a=this;this._mounted=!1;this._unmounted=!1;this._listeners=new Set();this._remove=function(b){b.disengage(),a._listeners["delete"](b)}}var b=a.prototype;b._add=function(a){if(this._unmounted){d("WALogger").WARN(i());return}this._listeners.add(a);this._mounted&&a.engage()};b.internalUseOnlyMarkMounted=function(){this._mounted=!0,this._listeners.forEach(function(a){a.engage()})};b.internalUseOnlyMarkUnmounted=function(){this._unmounted=!0,this._listeners.forEach(this._remove),this._abortController&&this._abortController.abort()};b.add=function(a,b,c,e){var f=this;a=new(d("WAWebUIListener").Listener)(a,b,function(){f._unmounted||c.apply(this,arguments)},e,c);this._add(a)};b.addOnce=function(a,b,c,e){var f=this,g=new(d("WAWebUIListener").Listener)(a,b,function(){f._remove(g),f._unmounted||c.apply(this,arguments)},e,c);this._add(g)};b.remove=function(a,b,c,d){var e=this;this._listeners.forEach(function(f){f.represents(a,b,c,d)&&e._remove(f)})};b.uiIdle=function(a){if(d("WAWebCmd").Cmd.uiBusy){this.addOnce(d("WAWebCmd").Cmd,"ui_idle",a);return}this._abortController=this._abortController||new AbortController();d("WAWebDocumentFlushed").documentFlushed({signal:this._abortController.signal}).then(function(){a()},function(a){if(a.name!==d("WAAbortError").ABORT_ERROR)throw a})};b.testsOnlyGetListeners=function(){return this._listeners};return a}();function a(a){var b,c,e;return c=b=function(b){babelHelpers.inheritsLoose(c,b);function c(){var a,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(a=c=b.call.apply(b,[this].concat(e))||this,c.listeners=new k(),a)||babelHelpers.assertThisInitialized(c)}var d=c.prototype;d.componentDidMount=function(){this.listeners.internalUseOnlyMarkMounted()};d.componentWillUnmount=function(){this.listeners.internalUseOnlyMarkUnmounted()};d.render=function(){return j.jsx(a,babelHelpers["extends"]({ref:this.setComponent},this.props,{listeners:this.listeners}))};return c}(d("WAWebHocComponent_DEPRECATED.react").WrappedComponent),b.defaultProps=(e=a.defaultProps)!=null?e:void 0,b.displayName="Listener("+d("WAWebHocComponent_DEPRECATED.react").getHocComponentDisplayName(a)+")",b.wrappedComponent=null,c}g.Listeners=k;g.ListenerHOC=a}),98); __d("WAWebEmojiText.react",["WABidi","WANullthrows","WAWebBlockQuoteMutatorComponent.react","WAWebBulletedListMutatorComponent.react","WAWebClassnames","WAWebCopyPasteSelectable.react","WAWebEmoji","WAWebFormat","WAWebFormatConfiguration","WAWebJsxSerializer.react","WAWebL10N","WAWebListenerHoc_DEPRECATED","WAWebNonEmptyString","WAWebNumberedListMutatorComponent.react","WAWebUA","lodash","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j;a=j||d("react");var k=h||(h=c("react"));b=a.PureComponent;var l=a.createRef,m=[c("WAWebBulletedListMutatorComponent.react"),c("WAWebNumberedListMutatorComponent.react"),c("WAWebBlockQuoteMutatorComponent.react")],n={breakWord:{wordBreak:"x13faqbe",$$css:!0},clickable:{cursor:"x1ypdohk",":hover_textDecoration":"xt0b8zv",$$css:!0},dirMismatch:{display:"x1lliihq",width:"xh8yej3",$$css:!0},ellipsify:{flexGrow:"x1iyjqo2",overflowX:"x6ikm8r",overflowY:"x10wlt62",position:"x1n2onr6",textOverflow:"xlyipyv",whiteSpace:"xuxw1ft",$$css:!0},inlineblock:{display:"x1rg5ohu",$$css:!0},displayBlock:{display:"x1lliihq",$$css:!0},multiline:{whiteSpace:"x1fj9vlw",$$css:!0},preserveWhitespace:{whiteSpace:"x126k92a",$$css:!0},preformatted:{whiteSpace:"x1sdyfia",width:"xm6i5cn",display:"x1rg5ohu",$$css:!0}};e={SMALL:"SMALL",LARGE:"LARGE"};var o=4096,p=12;function q(a){return d("WAWebEmoji").EmojiUtil.containsEmoji(a.substring(0,o))}f=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,e;for(var f=arguments.length,g=new Array(f),h=0;h<f;h++)g[h]=arguments[h];return(b=e=a.call.apply(a,[this].concat(g))||this,e.state={text:String(e.props.text||""),ellipsified:null},e.refContainer=l(),e.$1=!1,e.$2=c("lodash").debounce(function(){e.setState({ellipsified:null},e.ellipsify)},10),e.$3=function(a){var b=[],e=c("WAWebL10N").LR("ltr","rtl"),f=function a(b){if(b==null)return e;if(typeof b==="string"){var c;return(c=d("WABidi").dir(b))!=null?c:e}return a(b==null?void 0:(c=b.props)==null?void 0:(b=c.children)==null?void 0:b[0])},g=[],h=function(){if(g.length===0)return;b.push({dir:f(g[0]),content:g});g=[]};for(a of a)if(typeof a==="string"){var i=a.split(/(\r?\n)/);i.forEach(function(a){a!==""&&g.push(a),a.match(/\r?\n/)&&h()})}else m.includes(a.type)?(h(),b.push({dir:e,content:[a]})):g.push(a);h();return b},e.ellipsify=function(){var a=e.refContainer.current;if(!a)return;var b=c("WANullthrows")(a.parentElement),f=a.querySelectorAll("img");if(!f.length)return;var g=a.clientWidth;a.style.overflow="visible";g=a.clientWidth!==g;a.style.overflow="hidden";if(!g)return;g=Boolean(c("WAWebL10N").isRTL())===Boolean(e.props.dirMismatch);b=g?b.clientWidth-u(b,a)-p:p;b=s(f,b,g);g=f[b];e.setState({ellipsified:d("WAWebNonEmptyString").asMaybeNonEmptyString(r(a,g))})},e.$4=function(){return q(e.state.text)&&e.ellipsify()},e.$5=function(a,b){var d=e.props.direction,f=e.$3(a);return f.map(function(a,e){var g=d==null||a.dir===d||a.dir==="rtl"===c("WAWebL10N").isRTL(),h=g?null:a.dir,i=f.length-1===e;g={0:"",2:"x1lliihq xh8yej3",1:"x1lliihq",3:"xh8yej3 x1lliihq"}[!!!g<<1|!!(!i&&g)<<0];return k.jsxs("span",{dir:h,className:g,children:[a.content,i&&b?String.fromCodePoint(8230):null]},e)})},e.$6=function(){if(e.$1)return;e.$1=!0;e.props.listeners.add(window,"resize",e.$2)},e.componentDidMount=function(){!d("WAWebUA").UA.supportsEmojiEllipsification&&e.props.ellipsify&&q(e.state.text)&&e.$6();if(d("WAWebUA").UA.supportsEmojiEllipsification||!e.props.ellipsify)return;e.$4()},e.$7=function(){if(!e.$1)return;e.$1=!1;e.props.listeners.remove(window,"resize",e.$2)},e.render=function(){if(!e.state.text)return null;var a=e.props,b=a.onClick,f=a.ellipsify,g=a.dirMismatch,h=a.inferLinesDirection,j=a.inlineblock,l=a.direction,m=a.textLimit,p=a.multiline,q=a.preserveWhitespace,r=a.preformatted,s=a.breakWord,t=a.emojiXstyle;a=a.displayBlock;var u=e.state.ellipsified!=null?e.state.ellipsified:e.state.text;l=l==="inherit"?null:l||"auto";var v=!!e.props.selectable;t=e.props.formatters||d("WAWebFormatConfiguration").EmojiOnly({selectable:v,emojiXstyle:t});m=m?m:Infinity;f&&u.length>o&&m>o&&(m=o);g=g===!0&&!h;h=d("WAWebClassnames").classnamesConvertMeToStylexPlease(e.props.className,(i||(i=c("stylex")))(f&&n.ellipsify,j&&n.inlineblock,a&&n.displayBlock,b&&n.clickable,g&&n.dirMismatch,p&&n.multiline,q===!0&&n.preserveWhitespace,r===!0&&n.preformatted,s&&n.breakWord,e.props.xstyle));f=u;j=c("WAWebFormat")(f,t,c("WAWebJsxSerializer.react"),void 0,m);a=e.state.ellipsified!=null||u.length>m;g=e.props.inferLinesDirection?e.$5(j,a):j;q=(p=e.props.title)!=null?p:e.state.text;return k.jsx(d("WAWebCopyPasteSelectable.react").Selectable,{"data-testid":void 0,className:h,dir:l,element:e.props.element,onClick:b,ref:e.refContainer,selectable:v,"aria-label":(r=e.props.ariaLabel)!=null?r:void 0,title:e.props.titlify?q:void 0,style:{minHeight:((s=e.props.minTextHeight)!=null?s:0)+"px"},children:g})},b)||babelHelpers.assertThisInitialized(e)}var e=b.prototype;e.getElement=function(){return this.refContainer.current};b.getDerivedStateFromProps=function(a,b){var c,e=null;c=String((c=a.text)!=null?c:"");c!==b.text&&(e={text:c});if(d("WAWebUA").UA.supportsEmojiEllipsification||!a.ellipsify||e==null)return e;q(c)||(e=babelHelpers["extends"]({},e,{ellipsified:null}));return e};e.getWidth=function(){var a=this.refContainer.current;return!a?0:a.getBoundingClientRect().width};e.componentDidUpdate=function(a,b){if(d("WAWebUA").UA.supportsEmojiEllipsification||!this.props.ellipsify||b.text===this.state.text)return;q(this.state.text)?(this.$2(),this.$6()):this.$7()};e.componentWillUnmount=function(){this.$2.cancel()};return b}(b);f.defaultProps={element:"span",emojiSize:e.SMALL,textLimit:Infinity};a=d("WAWebListenerHoc_DEPRECATED").ListenerHOC(f);b=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.getElement=function(){return c.getComponent().getElement()},b)||babelHelpers.assertThisInitialized(c)}var c=b.prototype;c.getWidth=function(){return this.getComponent().getWidth()};return b}(a);function r(a,b,c){c===void 0&&(c={found:!1});if(a===b){c.found=!0;return""}else if(a instanceof HTMLImageElement)return a.alt;else if(a.nodeType===Node.TEXT_NODE)return a.nodeValue;var d=t(a),e="",f=0;while(f<a.childNodes.length){e+=r(a.childNodes[f],b,c);if(c.found)break;else f++}if(d==null)return e;f=d[0];a=d[1];return""+f+e+a}function s(a,b,c){var d=0;while(d<a.length){var e=a[d];if(c&&e.offsetLeft+e.clientWidth>=b)break;if(!c&&e.offsetLeft<=b)break;d++}return d}function t(a){if(a instanceof Element)switch(a.tagName){case"CODE":return["```","```"];case"STRONG":return["*","*"];case"EM":return["_","_"];case"DEL":return["~","~"];case"LI":return["* ",""];default:return null}return null}function u(a,b){var c=0;a=a.childNodes;for(var d=0;d<a.length;d++){var e=a[d];if(e===b)break;c+=e instanceof Element?e.clientWidth:0}return c}g.EMOJI_SIZE=e;g.EmojiText=b}),98); __d("WAWebErrorBoundary.react",["WALogger","WAWebButton.react","WAWebCmd","WAWebFlex.react","WAWebModal.react","WAWebModalManager","WAWebText.react","WAWebToast.react","WAWebToastManager","WAWebUISpacing","WAWebUnstyledButton.react","asyncToGeneratorRuntime","gkx","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j;function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["","\n","\n",""],["","\\n","\\n",""]);k=function(){return a};return a}var l=j||c("react");a=(h||(h=d("react"))).PureComponent;var m={redBox:{height:"x5yr21d",width:"xh8yej3",display:"x78zum5",justifyContent:"xl56j7k",alignItems:"x6s0dn4",textAlign:"x2b8uid",backgroundColor:"x76b9fu",color:"xfungia",pointerEvents:"x71s49j",flexDirection:"xdt5ytf",cursor:"x1ypdohk",$$css:!0},codeContainer:{whiteSpace:"x126k92a",backgroundColor:"x1qbu5l5",fontSize:"x190qgfh",height:"xqt63rz",overflowX:"xw2csxc",overflowY:"x1odjw0f",$$css:!0}};function n(a){var e=a.boundaryName;a=a.error;a=(a=a)!=null?a:{};var f=a.stack;a=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){f!=null&&(yield navigator.clipboard.writeText(f),d("WAWebToastManager").ToastManager.open(l.jsx(d("WAWebToast.react").Toast,{msg:"Stack copied"})))});return function(){return a.apply(this,arguments)}}();var g=function(){var a="Uncaught render error at "+e;d("WAWebCmd").Cmd.trigger("trigger_bugreport_v2",a)};return l.jsx(d("WAWebModal.react").Modal,{title:"Error stack from "+e,type:d("WAWebModal.react").ModalTheme.Multiline,children:f!=null?l.jsxs(l.Fragment,{children:[l.jsx("div",babelHelpers["extends"]({},(i||(i=c("stylex"))).props([m.codeContainer,d("WAWebUISpacing").uiPadding.all10]),{children:l.jsx("code",{children:f})})),l.jsxs("div",babelHelpers["extends"]({},(i||(i=c("stylex"))).props(d("WAWebUISpacing").uiPadding.vert10),{children:[l.jsx(d("WAWebText.react").WAWebTextSmall,{xstyle:d("WAWebUISpacing").uiPadding.bottom10,children:"Check the console for more information"}),l.jsxs(d("WAWebFlex.react").FlexRow,{columnGap:8,justify:"end",marginTop:16,children:[l.jsx(d("WAWebButton.react").WAWebButtonSecondary,{onClick:a,children:"Copy error stack"}),l.jsx(d("WAWebButton.react").WAWebButtonSecondary,{onClick:g,children:"Report this bug"})]})]}))]}):"No error stack found, check console"})}n.displayName=n.name+" [from "+f.id+"]";function o(a){var b=a.boundaryName;a=a.handleClick;if(!c("gkx")("26258"))return l.jsxs(c("WAWebUnstyledButton.react"),{xstyle:m.redBox,onClick:a,children:["Uncaught error at ",b," [Click for more info]"]});return}o.displayName=o.name+" [from "+f.id+"]";e=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.state={error:null},c.$1=function(){d("WAWebModalManager").ModalManager.open(l.jsx(n,{error:c.state.error,boundaryName:c.props.name}))},b)||babelHelpers.assertThisInitialized(c)}b.getDerivedStateFromError=function(a){return{error:a}};var c=b.prototype;c.componentDidCatch=function(a,b){var c=this.props,e=c.sendLogs;e=e===void 0?!0:e;c=c.type;if(e===!0){e=c==="fatal"?{sendLogsType:d("WALogger").SendLogsType.EXTREMELY_BAD_USER_EXPERIENCE_SAD}:{};d("WALogger").ERROR(k(),a,a.stack,b.componentStack).sendLogs("[ErrorBoundary]["+this.props.name+"] "+a.message,e).tags("error-boundary")}};c.render=function(){var a=this.state.error,b=this.props.fallback;b=b===void 0?o:b;return a!=null?l.jsx(b,{boundaryName:this.props.name,handleClick:this.$1}):(a=this.props.children)!=null?a:null};return b}(a);g.ErrorBoundary=e}),98); __d("WAWebLockScreenResolver",["WAComms","WALogger","WAResolvable","WAWebChatCollection","WAWebCmd","WAWebCryptoEncKeyHelper","WAWebDbEncryptionKey","WAWebModalManager","WAWebMsgCollection","WAWebUserPrefsInfoStore","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[screeen-lock] passcode derived key is null when trying to encrypt"]);h=function(){return a};return a}c=function(){function a(){this.deferred=new(d("WAResolvable").Resolvable)()}var b=a.prototype;b.waitForPasscode=function(){var a;d("WAWebCmd").Cmd.openLockScreenModal();return(a=this.deferred)==null?void 0:a.promise};b.waitForPasscodeAfterIncorrectAttempt=function(){var a;this.deferred=new(d("WAResolvable").Resolvable)();d("WAWebCmd").Cmd.incorrectPasscodeLockScreen();return(a=this.deferred)==null?void 0:a.promise};b.enterPasscode=function(a){this.deferred.resolve(a)};b.correctPasscodeEntered=function(a){this.deferred=new(d("WAResolvable").Resolvable)(),d("WAWebCmd").Cmd.correctPasscodeLockScreen(a),d("WAWebModalManager").ModalManager.close()};return a}();e=new c();function a(){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(d("WAWebUserPrefsInfoStore").waNoiseInfo.cachedPasscodeDerivedKey==null){d("WALogger").WARN(h()).sendLogs("[screeen-lock] passcode derived key is null when trying to encrypt");location.reload();return}var a=d("WAComms").getComms();if(a==null){location.reload();return}var b=d("WAWebChatCollection").ChatCollection.getActive();b&&d("WAWebCmd").Cmd.closeChat(b);yield d("WAWebMsgCollection").MsgCollection.encryptAndClearModels();d("WAWebUserPrefsInfoStore").waNoiseInfo.resetCachedPasscodeDerivedKey();d("WAWebDbEncryptionKey").DbEncKeyStore.deleteKeyCache();d("WAWebDbEncryptionKey").DbEncKeyStore.resetDB();if(a.softCloseSocket)a.softCloseSocket();else{location.reload();return}yield d("WAWebCryptoEncKeyHelper").initEncSalt();a.socketLoop.start()});return i.apply(this,arguments)}g.LockScreenResolvable=e;g.lockScreenAndTriggerUnlockFlow=a}),98); __d("WAWebChatAssignmentIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k="chat-assignment";function a(a){var b=a.iconXstyle,e=a.height,f=a.width,g=a.viewBox;a=babelHelpers.objectWithoutPropertiesLoose(a,["iconXstyle","height","width","viewBox"]);var h;if(g){var l=g.x;l=l===void 0?0:l;var m=g.y;m=m===void 0?0:m;var n=g.width;n=n===void 0?0:n;g=g.height;g=g===void 0?0:g;h=[l,m,n,g].join(" ")}l=16;m=20;(e!=null||f!=null)&&(l=e,m=f);return j.jsx(d("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers["extends"]({name:k},a,{children:j.jsxs("svg",{viewBox:(n=h)!=null?n:"0 0 20 16",height:l,width:m,preserveAspectRatio:"xMidYMid meet",className:(i||(i=c("stylex")))(b),fill:"none",children:[j.jsx("title",{children:k}),j.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"}),j.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.09961 8.06427H0.0996094V6.25781H7.09961V8.06427Z",fill:"currentColor"}),j.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"})]})}))}a.displayName=a.name+" [from "+f.id+"]";g.ChatAssignmentIcon=a}),98); __d("WAWebSvgButton.react",["WAWebUnstyledButton.react","WDSFocusStateStyles","react"],(function(a,b,c,d,e,f,g){var h,i=h||c("react"),j={disabled:{opacity:"x5dmra7",$$css:!0}};function a(a){var b=a.ref;a=babelHelpers.objectWithoutPropertiesLoose(a,["ref"]);var e=a.Icon,f=a.disabled,g=a.onClick,h=a.type,k=a.title,l=a["aria-label"],m=a.dataTab,n=a.className_DONOTUSE,o=a.xstyle,p=a.testid;p=a.tabIndex;a=babelHelpers.objectWithoutPropertiesLoose(a,["Icon","disabled","onClick","type","title","aria-label","dataTab","className_DONOTUSE","xstyle","testid","tabIndex"]);return i.jsx(c("WAWebUnstyledButton.react"),{ref:b,xstyle:[o,d("WDSFocusStateStyles").WDSFocusStateStyles.genericFocus],disabled:f,onClick:g,"aria-label":l,title:k,dataTab:m,className_DONOTUSE:n,type:h,testid:void 0,tabIndex:p,children:i.jsx(e,babelHelpers["extends"]({},a,{xstyle:f===!0&&j.disabled}))})}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),98); __d("WAWebName.react",["fbt","WAArrayMoveToFirst","WALogger","WAReplaceRepeatingWhitespace","WAWebABProps","WAWebBusinessProfileTypes","WAWebChatAssignmentIcon.react","WAWebChatContactUtils","WAWebChatGetters","WAWebClassnames","WAWebContactGetters","WAWebElevatedPushNamesFlag","WAWebEmojiText.react","WAWebErrorBoundary.react","WAWebFormatConfiguration","WAWebFrontendChatGetters","WAWebFrontendContactGetters","WAWebGroupType","WAWebLabels.react","WAWebLidMigrationUtils","WAWebMiscGatingUtils","WAWebNewsletterName.react","WAWebParticipantListUtils","WAWebPsaVerifiedBlueIcon.react","WAWebPsaVerifiedIcon.react","WAWebSvgButton.react","WAWebUISpacing","WAWebUserPrefsMeUser","WAWebWamEnumOppositeVisibleIdentificationType","cr:17281","react","stylex","useWAWebChatValues","useWAWebContactValues","useWAWebForceUpdate","useWAWebListener","useWAWebModelValues"],(function(a,b,c,d,e,f,g,h){var i,j;function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["displayName:",",\n formattedName:",",\n name:",",\n formattedShortName:",",\n formattedUser:",""]);k=function(){return a};return a}var l=i||c("react"),m={disableGrow:{flexGrow:"x1c4vz4f",$$css:!0},spaceBefore:{"::before_content":"xjuopq5","::before_whiteSpace":"xulcptl",$$css:!0},chatAssignmentIconAssignedToYou:{color:"x29oog3",$$css:!0},chatAssignmentIconAssignedToOthers:{color:"xms21op",$$css:!0},icon:{display:"x78zum5",flex:"x3psx0u",verticalAlign:"x16dsc37",$$css:!0},labels:{display:"x3nfvp2",alignItems:"x6s0dn4",height:"x1ta3ar0",color:"x1eqw3am",verticalAlign:"x16dsc37",$$css:!0},hasLabels:{display:"x1jfb8zj",overflowX:"xuce83p",overflowY:"x1bft6iq",textOverflow:"x1i7k8ik",whiteSpace:"xq9mrsl",$$css:!0}},n=function(a){var b=a.contact,c=a.showNotifyName,e=a.elevatedPushNamesEnabled,f=a.useLiftMeUp,g=a.useDisplayName,i=a.useShortName,j=a.useVerifiedName,k=a.you;a=a.showMessageYourselfName;var l=e&&d("WAWebElevatedPushNamesFlag").pushNameCanBeUsed(b);if(a&&d("WAWebContactGetters").getIsMe(b)){return{displayName:h._(/*BTDS*/"__JHASH__-h0nmVG_H_G__JHASH__",[h._param("nameOrPhoneNumber",j?b.verifiedName:(a=b.name)!=null?a:d("WAWebFrontendContactGetters").getFormattedPhone(b))])}}a=d("WAWebFrontendContactGetters").getDisplayName(b);var m=d("WAWebContactGetters").getPushname(b);if(g&&a){g=d("WAWebFrontendContactGetters").getDisplayNameType(b);return g===d("WAWebWamEnumOppositeVisibleIdentificationType").OPPOSITE_VISIBLE_IDENTIFICATION_TYPE.PHONE_NUMBER&&f&&m!=null?{displayName:"~"+m}:{displayName:a}}if(i&&!l){g=d("WAWebFrontendContactGetters").getFormattedShortName(b);if(g)return{displayName:g}}if(j&&b.verifiedName)return{displayName:b.verifiedName};if(k&&d("WAWebContactGetters").getIsMe(b))return{displayName:d("WAWebFrontendContactGetters").getFormattedName(b)};if(c&&l){a=d("WAWebContactGetters").getNotifyName(b);if(a!=null)return{displayName:e?d("WAWebChatContactUtils").getFormattedNotifyName(a):"~"+a,displayNameAriaLabel:d("WAWebABProps").getABPropConfigValue("elevated_push_names_v2_m2_enabled")?d("WAWebChatContactUtils").getAccessibleNotifyName(a):void 0}}if(!f)return{displayName:d("WAWebFrontendContactGetters").getFormattedUser(b)};i=d("WAWebFrontendContactGetters").getFormattedUserAndType(b).type;if(i===d("WAWebWamEnumOppositeVisibleIdentificationType").OPPOSITE_VISIBLE_IDENTIFICATION_TYPE.PHONE_NUMBER&&m!=null)return{displayName:b.verifiedName};else if(d("WAWebContactGetters").getIsBusiness(b)&&b.verifiedLevel===d("WAWebBusinessProfileTypes").VERIFIED_LEVEL.HIGH)return{displayName:b.verifiedName};return{displayName:"~"+m}},o=function(a){var b=d("WAWebUserPrefsMeUser").assertGetMe().getDeviceId();if(a.some(function(a){return a.deviceId===b})){var c=h._(/*BTDS*/"__JHASH__sM300gCBSuH__JHASH__");c=l.jsx(d("WAWebChatAssignmentIcon.react").ChatAssignmentIcon,{width:18,height:12,xstyle:[d("WAWebUISpacing").uiMargin.end4,m.chatAssignmentIconAssignedToYou],title:c})}else if(a.length>0){a=h._(/*BTDS*/"__JHASH__hEmHbdMvv9N__JHASH__",[h._param("agentName",a[0].name)]);c=l.jsx(d("WAWebChatAssignmentIcon.react").ChatAssignmentIcon,{width:18,height:12,xstyle:[d("WAWebUISpacing").uiMargin.end4,m.chatAssignmentIconAssignedToOthers],title:a})}else c=null;return c};function p(a){var e=a.contact,f=a.element;f=f===void 0?"span":f;var g=a.highlightText,i=a.titlify,p=a.ellipsify,q=a.breakWord,r=a.you;r=r===void 0?!1:r;var s=a.selectable,t=a.useShortName;t=t===void 0?!1:t;var u=a.useDisplayName;u=u===void 0?!1:u;var v=a.onClick,w=a.showLabelIcon;w=w===void 0?!1:w;var x=a.showBusinessCheckmark,y=a.showNotifyName;y=y===void 0?!1:y;var z=a.elevatedPushNamesEnabled;z=z===void 0?!1:z;var A=a.useLiftMeUp;A=A===void 0?!1:A;var B=a.useVerifiedName;B=B===void 0?!1:B;var C=a.firstLabel,D=a.xstyle,E=a.showChatAssignmentIcon;E=E===void 0?!1:E;var F=a.assignedAgents;F=F===void 0?[]:F;var G=a.skipCheckMark;G=G===void 0?!1:G;var H=a.showMessageYourselfName;H=H===void 0?!1:H;var I=a.testid;I=a.isVerifiedNewsletter;var J=a.makeCheckmarkClickable;J=J===void 0?!1:J;var K=a.checkmarkLarge;K=K===void 0?!1:K;var L=a.truncateName,M=d("useWAWebContactValues").useContactValues(e.id,[d("WAWebContactGetters").getIsPSA,d("WAWebContactGetters").getIsIAS,d("WAWebContactGetters").getIsCAPISupportAccount,d("WAWebFrontendContactGetters").getFormattedUser,d("WAWebFrontendContactGetters").getFormattedName,d("WAWebFrontendContactGetters").getFormattedShortName,d("WAWebFrontendContactGetters").getFormattedPhone,d("WAWebFrontendContactGetters").getDisplayName,d("WAWebContactGetters").getLabels,d("WAWebContactGetters").getName,d("WAWebContactGetters").getNotifyName,d("WAWebContactGetters").getIsMe,d("WAWebContactGetters").getVerifiedName,d("WAWebContactGetters").getId]),N=M[0],O=M[1],P=M[2],Q=M[3],R=M[4],S=M[5];M[6];M[7];var T=M[8],U=M[9];M[10];M[11];M[12];M=M[13];var V;g!=null&&g!==""&&(V=d("WAWebFormatConfiguration").SearchName({terms:[g]}));g=n({contact:e,showNotifyName:y,elevatedPushNamesEnabled:z,useLiftMeUp:A,useDisplayName:u,useShortName:t,useVerifiedName:B,you:r,showMessageYourselfName:H});e=g.displayName;y=g.displayNameAriaLabel;if(!e){d("WALogger").ERROR(k(),e,R,U,S,Q).sendLogs("display name is null or undefined");return""}z=d("WAWebLidMigrationUtils").getShouldShowLidDebugUI(M)&&b("cr:17281");A=c("WAReplaceRepeatingWhitespace")(e.toString());u=l.jsxs("div",babelHelpers["extends"]({},{0:{className:"x78zum5"},1:{className:"xlrdbfi xuxw1ft x6ikm8r x10wlt62 xlyipyv x78zum5"}}[!!(L===!0)<<0],{children:[l.jsx(d("WAWebEmojiText.react").EmojiText,{text:A,ariaLabel:y!=null?c("WAReplaceRepeatingWhitespace")(y.toString()):void 0,element:f,className:d("WAWebClassnames").classnamesConvertMeToStylexPlease(null,a.className),formatters:V,titlify:i,ellipsify:p,breakWord:q,direction:"auto",selectable:s,inlineblock:!0,onClick:v,xstyle:D,testid:void 0}),H&&l.jsx(d("WAWebEmojiText.react").EmojiText,{testid:void 0,text:h._(/*BTDS*/"__JHASH__d2gbT47C9l7__JHASH__"),xstyle:m.spaceBefore}),z&&b("cr:17281")&&l.jsx(b("cr:17281"),{})]}));t=a.labels||T;(t==null?void 0:t.length)&&C!=null&&c("WAArrayMoveToFirst")(t,C);B=w===!0&&(t==null?void 0:t.length)?l.jsx(d("WAWebLabels.react").Labels,{labels:t,showName:!1}):null;r=!G&&(N||O||P||Boolean(x)||I);g=E?o(F):null;if(r===!0){if(d("WAWebMiscGatingUtils").isBlueEnabled()){R=K?24:16;U=J&&v?l.jsx(c("WAWebSvgButton.react"),{height:R,width:R,Icon:d("WAWebPsaVerifiedBlueIcon.react").PsaVerifiedBlueIcon,"aria-label":h._(/*BTDS*/"__JHASH__Q01S-11A5Bz__JHASH__"),onClick:v}):l.jsx(d("WAWebPsaVerifiedBlueIcon.react").PsaVerifiedBlueIcon,{height:R,width:R})}else U=l.jsx(d("WAWebPsaVerifiedIcon.react").PsaVerifiedIcon,{});return l.jsxs("div",babelHelpers["extends"]({},(j||(j=c("stylex"))).props(d("WAWebNewsletterName.react").styles.verified,m.disableGrow),{children:[u,l.jsx("div",babelHelpers["extends"]({},j.props(I===!0?d("WAWebNewsletterName.react").styles.newsletterIcon:[m.icon,d("WAWebUISpacing").uiMargin.top1,d("WAWebUISpacing").uiMargin.start3]),{children:U})),l.jsxs("div",babelHelpers["extends"]({className:"x3nfvp2 x6s0dn4 x1ta3ar0 x1eqw3am x16dsc37"},{children:[g,B]}))]}))}return g||B?l.jsxs("div",babelHelpers["extends"]({},(j||(j=c("stylex"))).props(d("WAWebNewsletterName.react").styles.verified,!!B&&!H&&m.hasLabels),{children:[u,l.jsxs("div",babelHelpers["extends"]({className:"x3nfvp2 x6s0dn4 x1ta3ar0 x1eqw3am x16dsc37"},{children:[g,B]}))]})):l.jsx("div",babelHelpers["extends"]({},(j||(j=c("stylex"))).props(m.disableGrow,d("WAWebNewsletterName.react").styles.verified),{children:u}))}p.displayName=p.name+" [from "+f.id+"]";function q(a){var e=a.chat,f=a.element,g=a.highlightText,i=a.titlify,k=a.ellipsify,n=a.breakWord,p=a.onClick,q=a.showLabelIcon,r=a.firstLabel,s=a.className,t=a.xstyle,u=a.showChatAssignmentIcon;u=u===void 0?!1:u;var v=a.assignedAgents;v=v===void 0?[]:v;var w=a.testid;w=a.overrideCommunityAnnouncementGroupName;w=w===void 0?!1:w;var x=a.checkmarkLarge;x=x===void 0?!1:x;var y,z=d("useWAWebChatValues").useChatValues(a.chat.id,[d("WAWebFrontendChatGetters").getFormattedTitle,d("WAWebChatGetters").getLabels]);z[0];z=z[1];var A=d("useWAWebModelValues").useModelValues(a.groupMetadata,["support","isUnnamed","participants","groupType","isLidAddressingMode","isCag"]),B=d("useWAWebForceUpdate").useForceUpdateDONOTUSE();d("useWAWebListener").useListener(A.participants,"bulk_add bulk_remove reset sort change:isAdmin change:isSuperAdmin remove add",B);g!=null&&g!==""&&(y=d("WAWebFormatConfiguration").SearchName({terms:[g]}));B=a.labels||z;(B==null?void 0:B.length)&&r!=null&&c("WAArrayMoveToFirst")(B,r);g=q===!0&&(B==null?void 0:B.length)?l.jsx(d("WAWebLabels.react").Labels,{labels:B,showName:!1}):null;a=w&&A.groupType===d("WAWebGroupType").GroupType.LINKED_ANNOUNCEMENT_GROUP?h._(/*BTDS*/"__JHASH__x2ZQLkFbyM5__JHASH__"):c("WAReplaceRepeatingWhitespace")((A==null?void 0:A.isUnnamed)?d("WAWebParticipantListUtils").calculateUnnamedGroupFullParticipantsList(A,!0):e.title());z=d("WAWebLidMigrationUtils").getShouldShowLidDebugUIForGroups(A.isLidAddressingMode);r=l.jsxs(l.Fragment,{children:[l.jsx(d("WAWebEmojiText.react").EmojiText,{text:a,element:f,className:s,xstyle:t,formatters:y,titlify:i,ellipsify:k,breakWord:n,direction:"auto",inlineblock:!0,onClick:p,testid:void 0}),z&&b("cr:17281")&&l.jsx(b("cr:17281"),{isCAG:A.isCag})]});q=A.support;if(q){B=x?24:20;return l.jsxs("div",babelHelpers["extends"]({},(j||(j=c("stylex"))).props(d("WAWebNewsletterName.react").styles.verified,!!g&&m.hasLabels),{children:[r,l.jsx("div",babelHelpers["extends"]({},j.props(m.icon,d("WAWebUISpacing").uiMargin.top1,d("WAWebUISpacing").uiMargin.start3),{children:d("WAWebMiscGatingUtils").isBlueEnabled()?l.jsx(d("WAWebPsaVerifiedBlueIcon.react").PsaVerifiedBlueIcon,{width:B,height:B}):l.jsx(d("WAWebPsaVerifiedIcon.react").PsaVerifiedIcon,{})})),l.jsx("div",babelHelpers["extends"]({},j.props(m.labels,d("WAWebUISpacing").uiMargin.start8),{children:g}))]}))}w=u?o(v):null;return w||g?l.jsxs("span",babelHelpers["extends"]({className:"x1jfb8zj xuce83p x1bft6iq x1i7k8ik xq9mrsl"},{children:[l.jsx("span",babelHelpers["extends"]({className:"x1c4vz4f"},{children:r})),l.jsxs("div",babelHelpers["extends"]({},(j||(j=c("stylex"))).props(m.labels,d("WAWebUISpacing").uiMargin.start8),{children:[w,g]}))]})):r}q.displayName=q.name+" [from "+f.id+"]";function r(a){var b;b=(b=d("useWAWebChatValues").useOptionalChatValues((b=a.chat)==null?void 0:b.id,[d("WAWebChatGetters").getIsUser,d("WAWebChatGetters").getIsNewsletter,d("WAWebFrontendChatGetters").getGroupMetadata,d("WAWebFrontendChatGetters").getFormattedTitle]))!=null?b:[!1,!1,null,null];var c=b[0],e=b[1],f=b[2],g=b[3];if(a.chat&&f!=null&&!c&&!e){b=a.chat;var h=babelHelpers.objectWithoutPropertiesLoose(a,["chat"]);return l.jsx(d("WAWebErrorBoundary.react").ErrorBoundary,{name:"group-name",fallback:function(){return l.jsx("span",{children:g})},children:l.jsx(q,babelHelpers["extends"]({chat:b,groupMetadata:f},h))})}if(a.chat&&!c&&e){b=a.chat;f=babelHelpers.objectWithoutPropertiesLoose(a,["chat"]);return l.jsx(d("WAWebNewsletterName.react").NewsletterName,babelHelpers["extends"]({chat:b},f))}if(a.chat){h=a.chat;c=babelHelpers.objectWithoutPropertiesLoose(a,["chat"]);e=h.contact;b=c}else{f=a.contact;h=babelHelpers.objectWithoutPropertiesLoose(a,["contact"]);e=f;b=h}return l.jsx(p,babelHelpers["extends"]({contact:e},b))}r.displayName=r.name+" [from "+f.id+"]";function a(a){var b=a.chat,d=a.contact;a=a.xstyle;return l.jsxs("span",babelHelpers["extends"]({},(j||(j=c("stylex"))).props(a),{children:[l.jsx(r,{contact:d,useShortName:Boolean(d.shortName),showNotifyName:!0,elevatedPushNamesEnabled:!0,useLiftMeUp:!0}),l.jsx("span",{children:"\xa0\u2022\xa0"}),b.groupMetadata&&l.jsx(q,{chat:b,groupMetadata:b.groupMetadata})]}))}a.displayName=a.name+" [from "+f.id+"]";g.ContactName=p;g.GroupName=q;g.Name=r;g.ContactAndGroupName=a}),226); __d("WAWebNotificationTone",["Promise","WAWebNoop","bx"],(function(a,b,c,d,e,f,g){var h,i=new window.Audio(c("bx").getURL(c("bx")("9561")));function a(){i.play()["catch"](c("WAWebNoop"))}function d(a){return(h||(h=b("Promise"))).resolve(a)}g.playNotification=a;g.cachePath=d}),98); __d("WAWebBaseNotification",["Promise","WAAbortError","WALogger","WAWebEnvironment","WAWebMuteCollection","WAWebNotificationBanner","WAWebNotificationConstants","WAWebNotificationTone","asyncToGeneratorRuntime","cr:3133","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["WABaseNotification:_closeNotification()"]);i=function(){return a};return a}e=(a=b("cr:3133"))!=null?a:{};var j=e.shouldShowBanner;f=function(){function a(){var a=this;this.closeBanner=function(){a.notificationBanner!=null&&(d("WALogger").LOG(i()),a.notificationBanner.close())}}var e=a.prototype;e.shouldPlaySound=function(){return d("WAWebMuteCollection").MuteCollection.getGlobalSounds()};e.shouldMute=function(a){return null};e.shouldShowBanner=function(){return j?j():window.Notification&&window.Notification.permission===d("WAWebNotificationConstants").PERMISSION_ALLOWED&&d("WAWebMuteCollection").MuteCollection.getGlobalNotifications()};e.shouldSquelch=function(){return null};e.shouldSuppressBanner=function(a){return!1};e.buildKey=function(){throw c("err")("WABaseNotification: must implement `buildKey` method")};e.getBannerOptions=function(){throw c("err")("WABaseNotification: must implement `getBannerOptions` method")};e.getIcon=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){throw c("err")("WABaseNotification: must implement `getIcon` method")});function d(){return a.apply(this,arguments)}return d}();e.matchesChat=function(a){return!1};e.beforeBannerShown=function(){return(h||(h=b("Promise"))).resolve()};e.afterBannerShown=function(a){};e.getChatKind=function(){throw c("err")("WABaseNotification: must implement `getChatKind` method")};e.performLogging=function(){};e.isReplyable=function(){return!1};e.triggerNotification=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield this.shouldMute(a));a||(a=(yield this.shouldSquelch()));var b=!1;if(a)if(this.shouldSuppressBanner(a))b=!0;else throw new(d("WAAbortError").AbortError)("Notification mute/squelched "+a);var c;(yield this.shouldShowBanner())&&(yield this.beforeBannerShown(),c=(yield this.showBanner(b)),this.afterBannerShown(c),this.performLogging());!a&&(yield this.shouldPlaySound())&&this.playSound();return c});function c(b){return a.apply(this,arguments)}return c}();e.showBanner=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a===void 0&&(a=!1);this.abortController=new AbortController();var b=this.getBannerOptions(),e=(yield this.getIcon());if(this.abortController.signal.aborted)throw new(d("WAAbortError").AbortError)("Aborted through abortController");if(!c("WAWebEnvironment").isWindows&&window.Notification.permission!==d("WAWebNotificationConstants").PERMISSION_ALLOWED)throw new(d("WAAbortError").AbortError)("Permission Denied");b=new(c("WAWebNotificationBanner"))(babelHelpers["extends"]({},b,{icon:e,key:this.buildKey(),isReplyable:this.isReplyable(),suppressBanner:a}));this.notificationBanner=b;return b});function e(b){return a.apply(this,arguments)}return e}();e.playSound=function(){d("WAWebNotificationTone").playNotification()};return a}();g.WABaseNotification=f}),98); __d("WAWebBannerContextMenuActions",["$InternalEnum"],(function(a,b,c,d,e,f){a=b("$InternalEnum").Mirrored(["None","MuteChatForEightHours","MuteChatForOneWeek","MuteChat","DisableNotifications"]);c=a;f["default"]=c}),66); __d("WAWebMuteExpirations",["fbt","WAWeb-moment","WAWebClock"],(function(a,b,c,d,e,f,g,h){var i=[{getLabel:function(){return h._(/*BTDS*/"__JHASH__YW0GMyGg5TG__JHASH__")},duration:8,radioId:"8-hours"},{getLabel:function(){return h._(/*BTDS*/"__JHASH__hSf1oX_Xq3Y__JHASH__")},duration:7*24,radioId:"1-week"},{getLabel:function(){return h._(/*BTDS*/"__JHASH__OCt3i8YXKoP__JHASH__")},duration:Number.POSITIVE_INFINITY,radioId:"always"}];function a(){return i[0].duration}function b(a){return a===Number.POSITIVE_INFINITY?d("WAWebClock").MUTE_ALWAYS_EXPIRATION_SENTINEL:a*60*60+c("WAWeb-moment")().unix()}g.ALL_MUTE_DURATIONS=i;g.getDefaultMuteDuration=a;g.calculateMuteExpiration=b}),226); __d("WAWebBaseNotificationBanner",["Promise","WALogger","WATypeUtils","WAWebBannerContextMenuActions","WAWebChatCollection","WAWebChatEntryPoint","WAWebChatMessageSearch","WAWebCmd","WAWebComposeBoxActions","WAWebEnvironment","WAWebGroupType","WAWebL10N","WAWebModalManager","WAWebMsgCollection","WAWebMsgType","WAWebMuteCollection","WAWebMuteExpirations","WAWebNewsletterCollection","WAWebNoop","WAWebSendTextMsgChatAction","asyncToGeneratorRuntime","cr:3133"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["mute failed: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["native notification close"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["native notification error"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["Failed to create notification: ",":",""]);l=function(){return a};return a}e=(a=b("cr:3133"))!=null?a:{};var m=e.closeMessageNotification,n=e.showMessageNotification;f=function(){function a(a,e,f,g,i){var j=this;this.isReplyable=!1;this.close=function(){j.$3().then(function(){j.notification&&d("WATypeUtils").isFunction(j.notification.close)&&j.notification.close(),m==null?void 0:m(j.key,j.tag)})["catch"](c("WAWebNoop"))};this.$4=function(){j.waitingPromise.resolver();window.removeEventListener("beforeunload",j.close);var a=j.notification;a&&(a.removeEventListener("click",j.$5),a.removeEventListener("close",j.$4));j.msg&&j.msg.off("change:type",j.$6)};this.$5=function(){j.$1==null?void 0:j.$1();window.focus();var a=j.chat,b=j.msg,e=j.doNotOpenChat==null?!1:j.doNotOpenChat;if(!a)return;if(!e){var f;e=b&&b!==a.msgs.last()?d("WAWebChatMessageSearch").getSearchContext(a,b.id):void 0;if(((f=a.groupMetadata)==null?void 0:f.groupType)===d("WAWebGroupType").GroupType.LINKED_ANNOUNCEMENT_GROUP&&((f=a.groupMetadata)==null?void 0:f.parentGroup)&&b!=null&&(b.subtype===d("WAWebGroupType").GROUP_ACTIONS.LINKED_GROUP_PROMOTE||b.subtype===d("WAWebGroupType").GROUP_ACTIONS.LINKED_GROUP_DEMOTE)){d("WAWebCmd").Cmd.openCommunityHome((f=a.groupMetadata)==null?void 0:f.parentGroup)}else{b=c("WAWebEnvironment").isWindows?d("WAWebCmd").Cmd.openChatFromUnread(a,d("WAWebChatEntryPoint").ChatEntryPoint.Notification):d("WAWebCmd").Cmd.openChatAt({chat:a,msgContext:e,chatEntryPoint:d("WAWebChatEntryPoint").ChatEntryPoint.Notification});void b.then(function(b){b&&d("WAWebComposeBoxActions").ComposeBoxActions.focus(a)})}}d("WAWebModalManager").ModalManager.closeMedia();j.close()};this.$6=function(){if(!j.msg||j.msg.type!==d("WAWebMsgType").MSG_TYPE.REVOKED)return;j.close()};this.msg=e!=null?d("WAWebMsgCollection").MsgCollection.get(e):null;this.chat=(e=d("WAWebChatCollection").ChatCollection.get(a))!=null?e:c("WAWebNewsletterCollection").get(a);this.tag=f;this.key=g;this.$1=i.onClick;this.canBlock=i.canBlock;this.doNotOpenChat=i.doNotOpenChat;this.isReplyable=i.isReplyable;e=new(h||(h=b("Promise")))(function(a){j.waitingPromise={resolver:a}});this.waitingPromise.promise=e;try{this.$2(g,f,i)}catch(a){d("WALogger").LOG(l(),a.name,a.message).devConsole(a),this.waitingPromise.resolver()}}var e=a.prototype;e.$3=function(){return(h||(h=b("Promise"))).resolve()};e.waitForClose=function(){return this.waitingPromise.promise};e.detach=function(){this.$4()};e.click=function(){this.$5()};e.quickReply=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=this.chat;b&&b.isReadOnly!==!0&&this.isReplyable&&(yield d("WAWebSendTextMsgChatAction").sendTextMsgToChat(b,a));this.$4()});function c(b){return a.apply(this,arguments)}return c}();e.$2=function(a,b,e){var f=e.title,g=e.notification,h=e.renotify,i=e.footer,l=e.isReplyable,m=e.contextMenuItems,o=e.suppressBanner;e=babelHelpers.objectWithoutPropertiesLoose(e,["title","notification","renotify","footer","isReplyable","contextMenuItems","suppressBanner"]);e.body&&e.body.charCodeAt(0)>=128&&(e.body=" "+e.body);h=babelHelpers["extends"]({tag:b,renotify:(h=h)!=null?h:Boolean(b),dir:"auto",lang:c("WAWebL10N").getNormalizedLocale(),silent:!0},e);if(n)n({key:a,tag:b,title:f,body:h.body,icon:h.icon,footer:i,contextMenuItems:m,isReplyable:l,suppressBanner:o});else{this.notification=new g(f,h);(e=this.notification)==null?void 0:e.addEventListener("error",function(a){d("WALogger").LOG(k()).devConsole(a)});(a=this.notification)==null?void 0:a.addEventListener("close",function(a){d("WALogger").LOG(j()).devConsole(a)});(b=this.notification)==null?void 0:b.addEventListener("click",this.$5);(i=this.notification)==null?void 0:i.addEventListener("close",this.$4)}this.msg&&this.msg.on("change:type",this.$6);window.addEventListener("beforeunload",this.close)};e.contextMenuClick=function(a){var b=this.chat;if(!b)return;switch(a){case c("WAWebBannerContextMenuActions").MuteChatForEightHours:this.$7(b,d("WAWebMuteExpirations").ALL_MUTE_DURATIONS[0].duration);break;case c("WAWebBannerContextMenuActions").MuteChatForOneWeek:this.$7(b,d("WAWebMuteExpirations").ALL_MUTE_DURATIONS[1].duration);break;case c("WAWebBannerContextMenuActions").MuteChat:this.$7(b,d("WAWebMuteExpirations").ALL_MUTE_DURATIONS[2].duration);break;case c("WAWebBannerContextMenuActions").DisableNotifications:d("WAWebMuteCollection").MuteCollection.setGlobalNotifications(!1);break;case c("WAWebBannerContextMenuActions").None:break}this.$4()};e.$7=function(a,b){a.mute.mute({expiration:d("WAWebMuteExpirations").calculateMuteExpiration(b),sendDevice:!0})["catch"](function(a){d("WALogger").LOG(i(),a)})};return a}();g["default"]=f}),98); __d("WAWebCurrencyData",[],(function(a,b,c,d,e,f){a="USD";b=2;c={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};d={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"]};f.DEFAULT_CURRENCY=a;f.DEFAULT_DIGITS=b;f.CURRENCY_DIGITS=c;f.REGION_TO_CURRENCY=d}),66); __d("WAWebCurrencyUtils",["WAWebCurrencyData","WAWebL10N"],(function(a,b,c,d,e,f,g){var h={IDR:"in-ID",MXN:"es-MX",INR:"en-IN"},i=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"]),j=["es-ES","pt-BR"],k=function(){var a;return[(a=c("WAWebL10N")).getFullLocale(),a.normalizeLocaleToBcp47Compliant(a.getNormalizedLocale()),a.normalizeLocaleToBcp47Compliant(a.getLocale())].filter(Boolean)},l=function(a,b,c,d){d===void 0&&(d=k());var e="symbol";j.includes(Array.isArray(d)?d[0]:d)&&(e="code");return new Intl.NumberFormat(d,babelHelpers["extends"]({style:"currency",currency:a,currencyDisplay:e},c)).format(b)},m=function(a,b,c,d){return l(a,b/1e3,c,d)};function n(a){return new Intl.NumberFormat(a).format(1.1).substring(1,2)}function o(a){return new Intl.NumberFormat(a).format(1e4).substring(2,3)}function p(a,b){b=m(b,0,{},a);return b.replace(/\d+([,.]\d+)?/g,"").trim()}function a(a,b){var c=k(),d=n(c);c=p(c,a);a=m(a,b);b=a.replace(c,"").trim();a=b.indexOf(d);d=a===-1?b:b.substring(0,a);b=a===-1?"":b.substring(a);return{symbol:c,integer:d,decimal:b}}function b(a){return p(h[a],a)}function q(a,b){var c=k();a=p(c,a);var d=o(c);c=n(c);return r(b,a,c,d)}function r(a,b,c,d){a=a.replace(b,"").trim();b=a.split(d).join("");a=parseFloat(b.replace(c,".")||"0");return Math.round(a*1e3)}function e(a,b,c,e){var f=k(),g=d("WAWebCurrencyData").CURRENCY_DIGITS[a]!==void 0?d("WAWebCurrencyData").CURRENCY_DIGITS[a]:d("WAWebCurrencyData").DEFAULT_DIGITS;a=q(a,b);if(c!=null&&a<c)return!1;if(e!=null&&a>e)return!1;c=b.replace(/\D+$/g,"");e=n(f);return Number.isNaN(a)||c!==b||(b.split(e)[1]||"").length>g?!1:!0}function f(a){a=d("WAWebCurrencyData").REGION_TO_CURRENCY[a.toUpperCase()];return(a==null?void 0:a.length)>0?a[0]:d("WAWebCurrencyData").DEFAULT_CURRENCY}function s(a){return i.has(a)}g.formatAmount=l;g.formatAmount1000=m;g.formatAmount1000ToParts=a;g.formatLocalSymbol=b;g.valueFromString=q;g.parseValueFromString=r;g.validatePriceString=e;g.currencyForCountryShortcode=f;g.isSupportedCurrency=s}),98); __d("WAWebBizFormatInteractiveMsg",["fbt","WAWebBizOrderDetailsParams","WAWebBrazilPixKeyFormattingUtils","WAWebCurrencyUtils","WAWebInteractiveMessageType","WAWebInteractiveMessagesNativeFlowName","WAWebOrderDetails","WAWebOrderPaymentStatus","WAWebOrderStatus","WAWebUserPrefsTypes"],(function(a,b,c,d,e,f,g,h){function a(a,b){b=b===void 0?{}:b;b=b.formatAsSearchResult;b=b===void 0?!1:b;if(a.interactiveType===c("WAWebInteractiveMessageType").SHOPS_STOREFRONT){var d;return a.caption||((d=a.interactiveHeader)==null?void 0:d.title)||""}if(a.nativeFlowName===c("WAWebInteractiveMessagesNativeFlowName").PAYMENT_INFO){d=k(a);if(d!=null)return d}if(a.nativeFlowName===c("WAWebInteractiveMessagesNativeFlowName").ORDER_DETAILS){d=j(a);if(d!=null)return d}if(a.nativeFlowName===c("WAWebInteractiveMessagesNativeFlowName").ORDER_STATUS){d=i(a);if(d!=null)return d}return[(d=a.interactiveHeader)==null?void 0:d.title,b?(d=a.interactiveHeader)==null?void 0:d.subtitle:null,a.caption,a.footer].filter(Boolean).join("\n")}function i(a){var b=d("WAWebOrderStatus").getOrderStatusInfo(a);return b==null?null:l(a.caption,b==null?void 0:b.status).toString()}function j(a){a=d("WAWebOrderDetails").getOrderInfo(a);if(a==null)return null;var b=a.items,c=a.totalAmount;a=a.currency;a=d("WAWebCurrencyUtils").formatAmount(a,c);return b[0].name+" \xb7 "+a}function k(a){var b,c;a=d("WAWebOrderDetails").getOrderInfo(a);if(a==null)return null;a=a==null?void 0:a.paymentSettings;var e=h._(/*BTDS*/"__JHASH___XgDbJVZXGG__JHASH__");a=a==null?void 0:(a=a.at(0))==null?void 0:a[d("WAWebBizOrderDetailsParams").PaymentSettingType.PIX_STATIC_CODE];b=(b=a==null?void 0:a.merchant_name)!=null?b:"";c=(c=a==null?void 0:a.key)!=null?c:"";a=d("WAWebUserPrefsTypes").PixKeyType.cast(a==null?void 0:a.key_type);return b+" \xb7 "+e.toString()+": "+d("WAWebBrazilPixKeyFormattingUtils").getFormattedPixKey(c,a)}function b(a){var b=d("WAWebOrderPaymentStatus").getOrderPaymentStatusInfoFromNativeFlow(a);return b==null?null:m(a.caption,b==null?void 0:b.paymentStatus).toString()}function e(a){a=d("WAWebOrderPaymentStatus").getOrderPaymentStatusInfoFromNativeFlow(a);return a==null?null:n(a==null?void 0:a.paymentMethod)}function l(a,b){var c="";switch(b){case d("WAWebOrderStatus").OrderStatus.Pending:c=h._(/*BTDS*/"__JHASH__OpL-aF0LLcb__JHASH__");break;case d("WAWebOrderStatus").OrderStatus.Canceled:c=h._(/*BTDS*/"__JHASH__dqN1P-hqsi6__JHASH__");break;case d("WAWebOrderStatus").OrderStatus.PartiallyShipped:c=h._(/*BTDS*/"__JHASH__Nbl2ZE8xWFn__JHASH__");break;case d("WAWebOrderStatus").OrderStatus.Complete:c=h._(/*BTDS*/"__JHASH__zA9ReI3u5Xz__JHASH__");break;case d("WAWebOrderStatus").OrderStatus.Shipped:c=h._(/*BTDS*/"__JHASH__0U1wE-uTyYM__JHASH__");break;case d("WAWebOrderStatus").OrderStatus.Processing:c=h._(/*BTDS*/"__JHASH__i_iQoqv0lPL__JHASH__");break;case d("WAWebOrderStatus").OrderStatus.PaymentRequested:c=h._(/*BTDS*/"__JHASH__CuEbmuWb8zo__JHASH__");break;case d("WAWebOrderStatus").OrderStatus.PreparingToShip:c=h._(/*BTDS*/"__JHASH__kpqX7FPe2Vn__JHASH__");break;case d("WAWebOrderStatus").OrderStatus.Delivered:c=h._(/*BTDS*/"__JHASH__Jo9QLUZOC5h__JHASH__");break}return(a==null?void 0:a.toLowerCase().includes(c.toString().toLowerCase()))?a||"":(c.toString()+"\n"+(a||"")).trim()}function m(a,b){var c="";switch(b){case d("WAWebOrderPaymentStatus").OrderPaymentStatus.Captured:c=h._(/*BTDS*/"__JHASH__49YJI4vNJ_l__JHASH__");break;case d("WAWebOrderPaymentStatus").OrderPaymentStatus.Pending:c=h._(/*BTDS*/"__JHASH__Fsk-E3whq3c__JHASH__");break}return(c.toString()+"\n"+((b=a)!=null?b:"")).trim()}function n(a){var b="";switch(a){case d("WAWebOrderPaymentStatus").OrderPaymentMethod.PaymentInstruction:b=h._(/*BTDS*/"__JHASH__TCKi2aJ0-Ul__JHASH__");break;case d("WAWebOrderPaymentStatus").OrderPaymentMethod.Confirm:b=h._(/*BTDS*/"__JHASH__jjxgeWmztWN__JHASH__");break}return b.toString()}g.formatInteractive=a;g.formatOrderStatusMessage=i;g.formatOrderDetailsMessagePreview=j;g.formatPaymentInfoMessagePreview=k;g.formatOrderPaymentStatusMessage=b;g.formatOrderPaymentMethodMessage=e;g.appendPrefilledMsg=l;g.appendPrefilledOrderPaymentMsg=m}),226); __d("WAWebFormatCallLog",["fbt","WAWebMsgGetters"],(function(a,b,c,d,e,f,g,h){function a(a){if(d("WAWebMsgGetters").getIsCallSilenced(a))return h._(/*BTDS*/"__JHASH__pNEyT-bARXr__JHASH__");var b=i(a.subtype);if(b!=null)return b;var c=d("WAWebMsgGetters").getCallOutcome(a),e=d("WAWebMsgGetters").getIsAdHocGroupCall(a),f=d("WAWebMsgGetters").getIsMissedCall(a);c&&(b=d("WAWebMsgGetters").getIsVideoCall(a)?j(e,f):k(e,f));return(c=b)!=null?c:""}function i(a){switch(a){case"miss":return h._(/*BTDS*/"__JHASH__GKysATqsTey__JHASH__");case"miss_video":return h._(/*BTDS*/"__JHASH__lEnYTT1STey__JHASH__");case"miss_group":return h._(/*BTDS*/"__JHASH__SNq-D-RGESz__JHASH__");case"miss_group_video":return h._(/*BTDS*/"__JHASH__x_gFD2CUvWw__JHASH__")}}function j(a,b){return b?a?h._(/*BTDS*/"__JHASH__x_gFD2CUvWw__JHASH__"):h._(/*BTDS*/"__JHASH__lEnYTT1STey__JHASH__"):h._(/*BTDS*/"__JHASH__AyZ72T116dA__JHASH__")}function k(a,b){return b?a?h._(/*BTDS*/"__JHASH__SNq-D-RGESz__JHASH__"):h._(/*BTDS*/"__JHASH__GKysATqsTey__JHASH__"):h._(/*BTDS*/"__JHASH__De1f-xAch2T__JHASH__")}g["default"]=a}),226); __d("WAWebFormatEventDateString",["fbt","WATimeUtils","WAWeb-moment","WAWebClock","WAWebL10N"],(function(a,b,c,d,e,f,g,h){function a(a,b){a=d("WATimeUtils").castToUnixTime(a);var e=c("WAWeb-moment").unix(a);if(b==null||b===0)return i(e,{showAmPm:!0});b=d("WATimeUtils").castToUnixTime(b);var f=c("WAWeb-moment").unix(b);if(d("WATimeUtils").sameDay(a,b)){a=e.format("a")===f.format("a");return h._(/*BTDS*/"__JHASH__obZVR6NH8fm__JHASH__",[h._param("start-date",i(e,{showAmPm:!a})),h._param("end-time",i(f,{showAmPm:!0,timeOnly:!0,lowercase:!0}))])}return h._(/*BTDS*/"__JHASH__XJ0TTjrTukk__JHASH__",[h._param("start-date",i(e,{showAmPm:!0})),h._param("end-date",i(f,{showAmPm:!0,lowercase:!0}))])}function i(a,b){var e=d("WATimeUtils").unixTime(),f=d("WATimeUtils").castToUnixTime(a.unix());if(b.timeOnly===!0)return d("WAWebClock").Clock.timestampStr(f);var g="LT";b.showAmPm===!1&&(g="h:mm");var i=d("WATimeUtils").sameDay(d("WATimeUtils").castToUnixTime(c("WAWeb-moment")().subtract(1,"day").unix()),f);if(i)return b.lowercase===!0?h._(/*BTDS*/"__JHASH__EelcNYW4Xhs__JHASH__",[h._param("time",a.format(g))]):h._(/*BTDS*/"__JHASH__HV_ie4JSOk3__JHASH__",[h._param("time",a.format(g))]);i=d("WATimeUtils").sameDay(e,f);if(i)return b.lowercase===!0?h._(/*BTDS*/"__JHASH__EQpTq-l_Nv4__JHASH__",[h._param("time",a.format(g))]):h._(/*BTDS*/"__JHASH__maRXSo6evJB__JHASH__",[h._param("time",a.format(g))]);e=d("WATimeUtils").sameDay(d("WATimeUtils").castToUnixTime(c("WAWeb-moment")().add(1,"day").unix()),f);if(e)return b.lowercase===!0?h._(/*BTDS*/"__JHASH__q5HUTSsfd-X__JHASH__",[h._param("time",a.format(g))]):h._(/*BTDS*/"__JHASH__l-aNe25zai8__JHASH__",[h._param("time",a.format(g))]);i="ddd, MMM D";f="MMM D, YYYY";c("WAWebL10N").getLanguage()!=="en"&&(i="LL",f="LL");e=a.isSame(c("WAWeb-moment")(),"year");return e?h._(/*BTDS*/"__JHASH__6__nWh2D1-V__JHASH__",[h._param("date",a.format(i)),h._param("time",a.format(g))]):h._(/*BTDS*/"__JHASH__pdXKZYVi0nt__JHASH__",[h._param("date",a.format(f)),h._param("time",a.format(g))])}g.getEventDateStringFor=a}),226); __d("WAWebFormatNfmText",["WAWebBizFormatInteractiveMsg","WAWebInteractiveMessagesNativeFlowName"],(function(a,b,c,d,e,f,g){function h(a){if(a.nativeFlowName===c("WAWebInteractiveMessagesNativeFlowName").ORDER_STATUS){var b=d("WAWebBizFormatInteractiveMsg").formatOrderStatusMessage(a);if(b!=null)return b}else if(a.nativeFlowName===c("WAWebInteractiveMessagesNativeFlowName").PAYMENT_STATUS){b=d("WAWebBizFormatInteractiveMsg").formatOrderPaymentStatusMessage(a);if(b!=null)return b}else if(a.nativeFlowName===c("WAWebInteractiveMessagesNativeFlowName").PAYMENT_METHOD){b=d("WAWebBizFormatInteractiveMsg").formatOrderPaymentMethodMessage(a);if(b!=null)return b}return a.caption||""}function a(a){if(a.nativeFlowName===c("WAWebInteractiveMessagesNativeFlowName").ORDER_DETAILS){var b=d("WAWebBizFormatInteractiveMsg").formatOrderDetailsMessagePreview(a);if(b!=null)return b}else if(a.nativeFlowName===c("WAWebInteractiveMessagesNativeFlowName").PAYMENT_INFO){b=d("WAWebBizFormatInteractiveMsg").formatPaymentInfoMessagePreview(a);if(b!=null)return b}return h(a)}g.formatNFMText=h;g.formatNFMTextPreview=a}),98); __d("WAWebFormatOversizedMsg",["fbt"],(function(a,b,c,d,e,f,g,h){function a(a){return h._(/*BTDS*/"__JHASH__MocuVxBIn8b__JHASH__")}function b(a){return h._(/*BTDS*/"__JHASH__MocuVxBIn8b__JHASH__")}g.formatOversizedMsgText=a;g.formatOversizedMsgNotification=b}),226); __d("WAWebRichResponseStrings",["fbt"],(function(a,b,c,d,e,f,g,h){"use strict";function a(){return h._(/*BTDS*/"__JHASH__78LBJHjHX5Q__JHASH__")}g.getWholeRichResponseUnsupportedText=a}),226); __d("WAWebFormatUnknownMsg",["fbt","WAWebCommonMsgUtils","WAWebMsgGetters","WAWebMsgType","WAWebRichResponseStrings"],(function(a,b,c,d,e,f,g,h){function i(a){return d("WAWebMsgGetters").getIsNewsletterMsg(a)?h._(/*BTDS*/"__JHASH__Acq239AkZFX__JHASH__"):h._(/*BTDS*/"__JHASH__oaZ0Phiq32V__JHASH__")}function j(a){return d("WAWebMsgGetters").getIsNewsletterMsg(a)?h._(/*BTDS*/"__JHASH__jZIAi2ZlUHy__JHASH__"):h._(/*BTDS*/"__JHASH__zwrV7ksXbp7__JHASH__")}function k(a){return d("WAWebMsgGetters").getIsNewsletterMsg(a)?h._(/*BTDS*/"__JHASH__Ws06712SUaA__JHASH__"):h._(/*BTDS*/"__JHASH__MPptqf77Oya__JHASH__")}function l(a){return d("WAWebMsgGetters").getIsSentByMe(a)?j(a):i(a)}function a(a){if(a.futureproofType===d("WAWebMsgType").MSG_TYPE.REACTION)return d("WAWebMsgGetters").getIsSentByMe(a)?h._(/*BTDS*/"__JHASH__o5lTfiX9OhA__JHASH__"):h._(/*BTDS*/"__JHASH__xspkkrBTBJ6__JHASH__");else if(a.futureproofType===d("WAWebMsgType").MSG_TYPE.PROTOCOL&&a.futureproofSubtype==="message_edit")return d("WAWebMsgGetters").getIsSentByMe(a)?h._(/*BTDS*/"__JHASH__eF5_HBfENGd__JHASH__"):h._(/*BTDS*/"__JHASH__0pRLyC3DXOZ__JHASH__");else if(a.futureproofType===d("WAWebMsgType").MSG_TYPE.KEEP_IN_CHAT)return d("WAWebMsgGetters").getIsSentByMe(a)?l(a):h._(/*BTDS*/"__JHASH__plXrnrgbBO1__JHASH__");else if(a.futureproofType===d("WAWebMsgType").MSG_TYPE.PIN_MESSAGE)return d("WAWebMsgGetters").getIsSentByMe(a)?h._(/*BTDS*/"__JHASH__U1rdjmy6rvn__JHASH__"):h._(/*BTDS*/"__JHASH__pV16elO2_HS__JHASH__");else if(a.futureproofType===d("WAWebMsgType").MSG_TYPE.ALBUM)return h._(/*BTDS*/"__JHASH__k2D_VLEuwC0__JHASH__");else if(a.type===d("WAWebMsgType").MSG_TYPE.AUTOMATED_GREETING_MESSAGE)return h._(/*BTDS*/"__JHASH__e6IL6ZcJdwA__JHASH__");else if(d("WAWebCommonMsgUtils").isRichResponseMsg(a.type))return d("WAWebRichResponseStrings").getWholeRichResponseUnsupportedText();if(d("WAWebMsgGetters").getIsSentByMe(a))return l(a);switch(a.subtype){case"phone":return k(a);case"phone_only_feature":return h._(/*BTDS*/"__JHASH__e6IL6ZcJdwA__JHASH__");default:return l(a)}}function b(a){if(a.futureproofType===d("WAWebMsgType").MSG_TYPE.REACTION)return h._(/*BTDS*/"__JHASH__xspkkrBTBJ6__JHASH__");switch(a.subtype){case"phone":return k(a);case"phone_only_feature":return h._(/*BTDS*/"__JHASH__e6IL6ZcJdwA__JHASH__");default:return i(a)}}g.defaultFutureproofMsgText=l;g.formatUnknownMsgText=a;g.formatUnknownMsgNotification=b}),226); __d("WAWebVcardUtils",["fbt","WATypeUtils","WAWebFbtIntlList","WAWebVcardParsingUtils","err","lodash"],(function(a,b,c,d,e,f,g,h){function a(a){var b;b=(b=a.ORG)==null?void 0:b[0];a=(a=a.TITLE)==null?void 0:a[0];if(b&&Array.isArray(b.value)&&b.value.length>0){var e=null;(a==null?void 0:a.value)&&(e=(""+a.value).trim());a=b.value;b=a[0];a=a.slice(1);a.push(b);b=c("WAWebFbtIntlList")(a.map(function(a){return d("WATypeUtils").isString(a)?a.trim():""}).filter(function(a){return a.length}),c("WAWebFbtIntlList").CONJUNCTIONS.NONE,c("WAWebFbtIntlList").DELIMITERS.COMMA).toString();return(e||"")+(((a=e)==null?void 0:a.length)&&b.length?" - ":"")+b}return""}function b(a){var b;b=(b={jabber:h._(/*BTDS*/"__JHASH__OuQm9JSX8mw__JHASH__"),"skype-username":h._(/*BTDS*/"__JHASH__tvKGTT8_UbE__JHASH__"),skype:h._(/*BTDS*/"__JHASH__tvKGTT8_UbE__JHASH__"),msn:h._(/*BTDS*/"__JHASH__prO-hgAZ9ja__JHASH__"),aim:h._(/*BTDS*/"__JHASH__1ZHcMAT2t7T__JHASH__"),yahoo:h._(/*BTDS*/"__JHASH__gVn_Xd4S8tK__JHASH__"),icq:h._(/*BTDS*/"__JHASH__bVdWJ9cuu-T__JHASH__"),"wa-biz-description":h._(/*BTDS*/"__JHASH__IzLmtPv9U2t__JHASH__")},b[d("WAWebVcardParsingUtils").WA_BIZ_NAME]=h._(/*BTDS*/"__JHASH__6qoYC-17JBv__JHASH__"),b);b=a.properties["X-ABLabel"]||b[a.type.toLowerCase()];if(b!=null&&b!=="")return d("WAWebVcardParsingUtils").clean(String(b));var e={TEL:[[["cell"],h._(/*BTDS*/"__JHASH__gMhBYz48iZ3__JHASH__")],[["iphone"],h._(/*BTDS*/"__JHASH__sN9bnqkAMkG__JHASH__")],[["main"],h._(/*BTDS*/"__JHASH__5yUtNZwqk_U__JHASH__")],[["home","fax"],h._(/*BTDS*/"__JHASH__dzsekyipUIm__JHASH__")],[["work","fax"],h._(/*BTDS*/"__JHASH__TRAaK8wdYyy__JHASH__")],[["home"],h._(/*BTDS*/"__JHASH__jJm1Fsw0TlH__JHASH__")],[["work"],h._(/*BTDS*/"__JHASH__myH-jdBcWC___JHASH__")],[["pager"],h._(/*BTDS*/"__JHASH__SqAlWAv3Uep__JHASH__")],[[],h._(/*BTDS*/"__JHASH__jJm1Fsw0TlH__JHASH__")]],EMAIL:[[["home"],h._(/*BTDS*/"__JHASH__jJm1Fsw0TlH__JHASH__")],[["work"],h._(/*BTDS*/"__JHASH__myH-jdBcWC___JHASH__")],[["internet"],h._(/*BTDS*/"__JHASH__C5FUAc6Ridd__JHASH__")]],URL:[[["home"],h._(/*BTDS*/"__JHASH__jJm1Fsw0TlH__JHASH__")],[["work"],h._(/*BTDS*/"__JHASH__myH-jdBcWC___JHASH__")]],ADR:[[["home"],h._(/*BTDS*/"__JHASH__jJm1Fsw0TlH__JHASH__")],[["work"],h._(/*BTDS*/"__JHASH__myH-jdBcWC___JHASH__")]]};b=a.type;c("lodash").forOwn(e,function(d){if(d){var e=d[0];d=d[1];if(c("lodash").difference(e,(e=(e=a.properties)==null?void 0:(e=e.type)==null?void 0:e.map(function(a){return a.toLowerCase()}))!=null?e:[]).length===0){b=d;return!1}}});return b}function i(a){return j(a.map(function(a){return a.displayName})).toString()}function j(a){var b=a.find(function(a){return!!a});if(!a.length)return h._(/*BTDS*/"__JHASH__mK7pAdCVz4q__JHASH__");if(!b)return h._(/*BTDS*/"__JHASH__xk5oXCsm1jl__JHASH__",[h._plural(a.length,"count")]);return a.length===1?b:h._(/*BTDS*/"__JHASH__MD97mOkn7um__JHASH__",[h._plural(a.length-1,"count"),h._param("contactName",b)])}function e(a){if(a.length===0)throw c("err")("No vcards provided");return a.length===1?a[0]:{displayName:i(a),vcard:a.map(function(a){return a.vcard}).join("\n"),isMultiVcard:!0}}g.vcardGetOrganizationString=a;g.vcardGetType=b;g.getNameString=i;g.getNameStringFromNames=j;g.mergeVcards=e}),226); __d("WAWebGetNotificationStrings",["fbt","WABidi","WALogger","WAWebAlbumsFormatAlbumMessageText","WAWebBizFormatInteractiveMsg","WAWebClock","WAWebContactCollection","WAWebContactGetters","WAWebCurrencyUtils","WAWebFormatBroadcastNotification","WAWebFormatCallLog","WAWebFormatE2ENotification","WAWebFormatEventDateString","WAWebFormatGroupNotification","WAWebFormatNfmText","WAWebFormatOversizedMsg","WAWebFormatPaymentMsg","WAWebFormatRevokedMsg","WAWebFormatUnknownMsg","WAWebFrontendMsgGetters","WAWebInteractiveMessageType","WAWebInteractiveMessagesNativeFlowName","WAWebL10N","WAWebMsgGetters","WAWebUA","WAWebUnformatMsg","WAWebVcardUtils","WAWebWidToFormattedNameOrNumber","cr:4404","fbs"],(function(a,b,c,d,e,f,g,h){function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["getNotificationBody: Unrecognized type ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["getNotificationBody: Unrecognized type ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["getNotificationBody: Unrecognized type ",""]);k=function(){return a};return a}b=(b=b("cr:4404"))!=null?b:{};var l=b.getNotificationBodyForPreviewOff;function a(a){var b=a.shouldShowNotificationPreview(),e=a.safe(),f="";if(l&&!b)return l().toString();switch(e.type){case"chat":b&&(f=c("WAWebUnformatMsg")(a,a.body));break;case"image":var g="";d("WAWebUA").UA.hasEmoji&&(g=e.isViewOnce?"1\ufe0f\u20e3 ":"\ud83d\udcf7 ");f=g+(b&&c("WAWebUnformatMsg")(a,a.caption)||c("fbs")._(/*BTDS*/"__JHASH__61VT29fhkzd__JHASH__").toString());break;case"product":g=d("WAWebUA").UA.hasEmoji?"\ud83d\uded2 ":"";f=g+(d("WAWebFrontendMsgGetters").getText(a)&&c("WAWebUnformatMsg")(a,d("WAWebFrontendMsgGetters").getText(a))||h._(/*BTDS*/"__JHASH__veU1IOEuglB__JHASH__").toString());break;case"interactive":if(a.interactiveType===c("WAWebInteractiveMessageType").SHOPS_STOREFRONT){g=d("WAWebUA").UA.hasEmoji?"\ud83d\udecd\ufe0f ":"";f=g+c("WAWebUnformatMsg")(a,a.body!=null?a.body:(g=a.interactiveHeader)==null?void 0:g.title)||"";break}if(a.interactiveType===c("WAWebInteractiveMessageType").NATIVE_FLOW&&a.nativeFlowName===c("WAWebInteractiveMessagesNativeFlowName").ORDER_DETAILS){g=a;f=d("WAWebBizFormatInteractiveMsg").formatOrderDetailsMessagePreview(g)||((g=a.caption)!=null?g:"");g=d("WAWebUA").UA.hasEmoji?"\ud83d\udcc3 ":"";f=g+f;break}if(a.interactiveType===c("WAWebInteractiveMessageType").NATIVE_FLOW&&a.nativeFlowName===c("WAWebInteractiveMessagesNativeFlowName").PAYMENT_INFO){g=a;f=d("WAWebBizFormatInteractiveMsg").formatPaymentInfoMessagePreview(g)||((g=a.caption)!=null?g:"");break}if(a.interactiveType===c("WAWebInteractiveMessageType").NATIVE_FLOW&&a.nativeFlowName===c("WAWebInteractiveMessagesNativeFlowName").ORDER_STATUS){g=a;f=d("WAWebBizFormatInteractiveMsg").formatOrderStatusMessage(g)||((g=a.caption)!=null?g:"");break}d("WALogger").WARN(k(),a.type);return"";case"native_flow":if(a.nativeFlowName===c("WAWebInteractiveMessagesNativeFlowName").ORDER_DETAILS){g=a;var n=d("WAWebUA").UA.hasEmoji?"\ud83d\udcc3 ":"";f=n+(d("WAWebFormatNfmText").formatNFMTextPreview(g)||((n=a.caption)!=null?n:""));break}if(a.nativeFlowName===c("WAWebInteractiveMessagesNativeFlowName").PAYMENT_INFO){g=a;f=d("WAWebFormatNfmText").formatNFMTextPreview(g)||((n=a.caption)!=null?n:"");break}d("WALogger").WARN(j(),a.type);return"";case"sticker":g=d("WAWebUA").UA.hasEmoji?"\ud83d\udc9f":"";f=h._(/*BTDS*/"__JHASH__8Sv0mYKHNjK__JHASH__",[h._param("stickerIcon",g)]);break;case"video":n="";a.isGif?(n=d("WAWebUA").UA.hasEmoji?"\ud83d\udc7e ":"",g=b&&c("WAWebUnformatMsg")(a,a.caption)||"GIF"):(d("WAWebUA").UA.hasEmoji&&(n=e.isViewOnce?"1\ufe0f\u20e3 ":"\ud83c\udfa5 "),g=b&&c("WAWebUnformatMsg")(a,a.caption)||c("fbs")._(/*BTDS*/"__JHASH__cyjBvbS2TQY__JHASH__").toString(),e.isViewOnce||(g=g+" ("+d("WAWebClock").Clock.durationStr(a.duration)+")"));f=""+n+g;break;case"ptv":n=d("WAWebUA").UA.hasEmoji?"\ud83c\udfa5 ":"";g=b&&c("WAWebUnformatMsg")(a,a.caption)||h._(/*BTDS*/"__JHASH__AI-gC7r29lC__JHASH__");g=g.toString()+" ("+d("WAWebClock").Clock.durationStr(a.duration)+")";f=""+n+g;break;case"ptt":n="";g=h._(/*BTDS*/"__JHASH__2QkHxnGh4wt__JHASH__").toString();d("WAWebUA").UA.hasEmoji&&(n=e.isViewOnce?"1\ufe0f\u20e3 ":"\ud83c\udfa4 ");e.isViewOnce||(g=g+" ("+d("WAWebClock").Clock.durationStr(a.duration)+")");f=""+n+g;break;case"audio":n=d("WAWebUA").UA.hasEmoji?"\ud83c\udfb5 ":"";f=n+" "+c("fbs")._(/*BTDS*/"__JHASH__9-qi5Sph54S__JHASH__").toString()+" ("+d("WAWebClock").Clock.durationStr(a.duration)+")";break;case"location":g=d("WAWebUA").UA.hasEmoji?"\ud83d\udccd ":"";a.isLive?n=b&&c("WAWebUnformatMsg")(a,a.comment)||h._(/*BTDS*/"__JHASH__VHuorsyCFIS__JHASH__").toString():n=b&&a.loc||c("fbs")._(/*BTDS*/"__JHASH__6FYSIQuDjf___JHASH__").toString();f=g+" "+n;break;case"groups_v4_invite":f=h._(/*BTDS*/"__JHASH__-MKYnzTW4lu__JHASH__");break;case"newsletter_admin_invite":f=h._(/*BTDS*/"__JHASH__sfOpmNxH5VR__JHASH__");break;case"gp2":f=c("WAWebFormatGroupNotification")(a,!0);break;case"broadcast_notification":f=c("WAWebFormatBroadcastNotification")(a);break;case"notification":f=(g=a.body)!=null?g:"";break;case"vcard":n=d("WAWebUA").UA.hasEmoji?"\ud83d\udc64 ":"";f=n+(a.subtype||c("fbs")._(/*BTDS*/"__JHASH__Eq6ogxCH8Yt__JHASH__").toString());break;case"multi_vcard":g=d("WAWebUA").UA.hasEmoji?"\ud83d\udc65 ":"";f=g+d("WAWebVcardUtils").getNameString(a.vcardList).toString();break;case"document":if(a.isVcardOverMmsDocument){n=d("WAWebUA").UA.hasEmoji?"\ud83d\udc64 ":"";f=n+(a.filename||h._(/*BTDS*/"__JHASH__xk5oXCsm1jl__JHASH__",[h._plural(a.pageCount,"count")]).toString());break}g=d("WAWebUA").UA.hasEmoji?"\ud83d\udcc4 ":"";n=a.caption;(a.caption==null||a.caption==="")&&(n=a.filename);f=g+(b&&c("WAWebUnformatMsg")(a,n)||c("fbs")._(/*BTDS*/"__JHASH__pfQesg8NiLE__JHASH__").toString());break;case"e2e_notification":f=d("WAWebFormatE2ENotification").formatE2ENotification(e);break;case"call_log":f=c("WAWebFormatCallLog")(a);break;case"ciphertext":f=h._(/*BTDS*/"__JHASH__0DbVseUW2Is__JHASH__");break;case"revoked":f=d("WAWebFormatRevokedMsg").formatRevokedMsg(e);break;case"payment":f=m(a);break;case"oversized":f=d("WAWebFormatOversizedMsg").formatOversizedMsgNotification(a);break;case"unknown":f=d("WAWebFormatUnknownMsg").formatUnknownMsgNotification(a);break;case"list":f=(((g=a.list)==null?void 0:g.title)||"")+" "+(((b=a.list)==null?void 0:b.description)||"");break;case"list_response":f=(((n=a.listResponse)==null?void 0:n.title)||"")+" "+(((g=a.listResponse)==null?void 0:g.description)||"");break;case"poll_result_snapshot":case"poll_creation":b=d("WAWebUA").UA.hasEmoji?"\ud83d\udcca ":"";f=""+b+c("WAWebUnformatMsg")(a,a.pollName);break;case"event_creation":n=d("WAWebUA").UA.hasEmoji?"\ud83d\udcc6 ":"";b=a.eventStartTime!=null?d("WAWebFormatEventDateString").getEventDateStringFor(a.eventStartTime,(g=a.eventEndTime)!=null?g:void 0):null;f=h._(/*BTDS*/"__JHASH__z4fLLERd57F__JHASH__",[h._param("eventIcon",n),h._param("eventName",a.eventName),h._param("eventTime",b)]);break;case"album":g=d("WAWebUA").UA.hasEmoji?"\ud83d\udcf7 ":"";n=c("WAWebAlbumsFormatAlbumMessageText")({msg:a,options:{}});f=h._(/*BTDS*/"__JHASH__Gl1QY3uXHof__JHASH__",[h._param("albumIcon",g),h._param("photoAndVideoCountText",n)]);break;case"order":b=d("WAWebUA").UA.hasEmoji?"\ud83d\uded2 ":"";f=h._(/*BTDS*/"__JHASH__7XG5gqNRTcm__JHASH__",[h._plural(a.itemCount,"count"),h._param("shoppingCartIcon",b),h._param("message",a.message!=null&&a.message!==""?"\n"+a.message:"")]);break;case"sticker-pack":g=d("WAWebUA").UA.hasEmoji?"\ud83d\udc9f ":"";f=h._(/*BTDS*/"__JHASH__HMFGR-3GQIB__JHASH__",[h._param("stickerPackIcon",g)]);break;case"notification_template":case"protocol":case"hsm":case"template_button_reply":case"debug":case"debug_placeholder":case"interactive_response":case"keep_in_chat":case"request_phone_number":case"automated_greeting_message":case"rich_response":return"";default:e.type;d("WALogger").WARN(i(),a.type);return""}return f.toString()}function e(a){var b=a.msgDir,e=c("WAWebL10N").isRTL()?"rtl":"ltr";if(a.body&&a.author==null&&a.action==null)return a.body;var f=a.body,g=a.author;a=a.action;g==null&&(g="");a==null?a="":a=e==="ltr"?c("WAWebL10N").isolateLTR(a):c("WAWebL10N").isolateRTL(a);if(g){var h=d("WABidi").dir(g);if(e==="ltr"&&(!b||b==="ltr")&&(!h||h==="ltr"))return a?g+"\u200e: "+a+"\u200e "+f+"\u200e":g+"\u200e: "+f+"\u200e";else if(e==="ltr"&&(!b||b==="ltr"))return a?"\u200e\u202b"+g+"\u202c: "+a+"\u200e "+f+"\u200e":"\u200e\u202b"+g+"\u202c: "+f+"\u200e";else if(e==="ltr"&&(!h||h==="ltr"))return a?g+"\u200e: "+a+"\u200e \u202b"+f+"\u202c\u200e":g+"\u200e: \u202b"+f+"\u202c\u200e";else if(e==="ltr")return a?"\u202b"+g+"\u200f: "+a+" "+f+"\u200f":"\u202b"+g+"\u200f: "+f+"\u200f";else if((!b||b==="rtl")&&(!h||h==="rtl"))return a?g+"\u200f: "+a+"\u200f "+f+"\u200f":g+"\u200f: "+f+"\u200f";else if(!b||b==="rtl")return a?"\u200f\u202a"+g+"\u202c: "+a+"\u200f "+f+"\u200f":"\u200f\u202a"+g+"\u202c: "+f+"\u200f";else if(!h||h==="rtl")return a?g+"\u200f: "+a+"\u200f \u202a"+f+"\u202c\u200f":g+"\u200f: \u202a"+f+"\u202c\u200f";return a?"\u202a"+g+"\u200e: "+a+" "+f+"\u200e":"\u202a"+g+"\u200e: "+f+"\u200e$"}return a?a+" "+f:f}function m(a){if(a.subtype==="invite")return d("WAWebFormatPaymentMsg").formatPaymentInviteMessageText(a.id);var b=a.paymentCurrency&&a.paymentAmount1000;if(!b)return h._(/*BTDS*/"__JHASH__oRCssWDoCcM__JHASH__");if(a.subtype!=="send"&&a.subtype!=="request")return h._(/*BTDS*/"__JHASH__ZQiQBMXFeNX__JHASH__");var e;b=d("WAWebCurrencyUtils").formatAmount1000(a.paymentCurrency,a.paymentAmount1000);var f=c("WAWebWidToFormattedNameOrNumber")(d("WAWebMsgGetters").getSender(a)),g=c("WAWebWidToFormattedNameOrNumber")(a.paymentMessageReceiverJid),i=d("WAWebContactCollection").ContactCollection.get(a.paymentMessageReceiverJid);i=i!=null&&d("WAWebContactGetters").getIsMe(i);var j=a.paymentAmount1000/1e3;a.subtype==="send"?d("WAWebMsgGetters").getIsGroupMsg(a)?e=i?h._(/*BTDS*/"__JHASH__iVIscEvIwMM__JHASH__",[h._param("amount",b,[0,j]),h._param("senderName",f)]):h._(/*BTDS*/"__JHASH__zV-lKLggMkf__JHASH__",[h._param("amount",b,[0,j]),h._param("senderName",f),h._param("receiverName",g)]):e=h._(/*BTDS*/"__JHASH__StBvh5qL2D2__JHASH__",[h._param("amount",b,[0,j])]):d("WAWebMsgGetters").getIsGroupMsg(a)?e=i?h._(/*BTDS*/"__JHASH__f0QE1OkX19___JHASH__",[h._param("amount",b,[0,j]),h._param("senderName",f)]):h._(/*BTDS*/"__JHASH__Pa-V2ii0Y-R__JHASH__",[h._param("amount",b,[0,j]),h._param("senderName",f),h._param("receiverName",g)]):e=h._(/*BTDS*/"__JHASH__hPCncjeVVqi__JHASH__",[h._param("amount",b,[0,j])]);return e}function n(a){a===void 0&&(a=1);return h._(/*BTDS*/"__JHASH__xXmr__JuU6B__JHASH__",[h._plural(a,"newMessageCount")])}n.displayName=n.name+" [from "+f.id+"]";g.getNotificationMessageBody=a;g.getNotificationBody=e;g.getPluralMessageNotificationBody=n}),226); __d("WAWebNotificationBackend",["Promise","WAWebAiHandoffNotification","WAWebCommentNotification","WAWebMsgGetters","WAWebNotificationController","WAWebNotificationsDeviceSwitchNotification","WAWebNotificationsMsgNotification","WAWebNotificationsReactionNotification","WAWebNotificationsStatusReactionNotification","WAWebPollsVoteNotification","WAWebStatusGatingUtils","WAWebStatusNotification"],(function(a,b,c,d,e,f,g){var h;function a(a){return d("WAWebNotificationController").WANotificationController.triggerNotification(new(d("WAWebNotificationsMsgNotification").WAMsgNotification)({msg:a}))}function c(a){return d("WAWebStatusGatingUtils").isStatusLikesReceiveEnabled()&&d("WAWebMsgGetters").getIsStatus(a)?d("WAWebNotificationController").WANotificationController.triggerNotification(new(d("WAWebNotificationsStatusReactionNotification").WAStatusReactionNotification)({reactionMsg:a})):d("WAWebNotificationController").WANotificationController.triggerNotification(new(d("WAWebNotificationsReactionNotification").WAReactionNotification)({reactionMsg:a}))}function e(a){return d("WAWebNotificationController").WANotificationController.triggerNotification(new(d("WAWebCommentNotification").WACommentNotification)({commentMsg:a}))}function f(a){return d("WAWebNotificationController").WANotificationController.closeOrCancelNotification("comment:"+a.toString())}function i(a){a=new(d("WAWebPollsVoteNotification").PollVoteNotification)({creationMsg:a});var c=d("WAWebNotificationController").WANotificationController.getNotification(a.buildKey());return c instanceof d("WAWebPollsVoteNotification").PollVoteNotification&&c.bodyText===a.bodyText?(h||(h=b("Promise"))).resolve():d("WAWebNotificationController").WANotificationController.triggerNotification(a)}function j(a){return d("WAWebNotificationController").WANotificationController.triggerNotification(new(d("WAWebNotificationsDeviceSwitchNotification").WADeviceSwitchNotification)(a))}function k(a){return d("WAWebNotificationController").WANotificationController.triggerNotification(new(d("WAWebAiHandoffNotification").AiHandoffNotification)({chat:a}))}function l(){d("WAWebNotificationController").WANotificationController.closeOrCancelAllNotifications()}function m(a){d("WAWebNotificationController").WANotificationController.closeOrCancelNotificationsForChat(a)}function n(a){return d("WAWebNotificationController").WANotificationController.triggerNotification(new(d("WAWebStatusNotification").WAStatusNotification)({msg:a}))}function o(a){d("WAWebNotificationController").WANotificationController.setAppContext(a)}g.showMsgNotification=a;g.showReactionNotification=c;g.showCommentNotification=e;g.removeCommentNotification=f;g.showPollVoteNotification=i;g.showDeviceSwitchNotification=j;g.showAiHandoffNotification=k;g.shutdownAsNeeded=l;g.closeNotifications=m;g.showStatusNotification=n;g.setAppContext=o}),98); __d("WAWebNotificationBanner",["WAWebBaseNotificationBanner","WAWebEmoji","WAWebURLUtils"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(b){var e=b.wid,f=b.msgId,g=b.tag,h=b.title,i=b.body,j=b.icon,k=b.onClick,l=b.renotify,m=b.doNotOpenChat,n=b.key,o=b.footer,p=b.isReplyable,q=b.contextMenuItems;b=b.suppressBanner;return a.call(this,e,f,g,n,{title:d("WAWebEmoji").EmojiUtil.normalizeAllEmojis(h),notification:window.Notification,body:d("WAWebEmoji").EmojiUtil.normalizeAllEmojis(i),icon:c("WAWebURLUtils").relToAbs(j),onClick:k,renotify:l,doNotOpenChat:m,footer:o,isReplyable:p,contextMenuItems:q,suppressBanner:b})||this}return b}(c("WAWebBaseNotificationBanner"));g["default"]=a}),98); __d("WAWebNotificationController",["WAAbortError","WALogger","WAWebFrontendMsgGetters","WAWebNotificationsMsgNotification","asyncToGeneratorRuntime","cr:4692"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["WANotificationController:_removeNotificationFromMap not removing due to strict equality"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["WANotificationController:_removeNotificationFromMap cannot find notification in map with key: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["WANotificationController: notification aborted: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["WANotificationController: notification not invoked:"]);k=function(){return a};return a}var l=(a=b("cr:4692"))!=null?a:null;c=function(){function a(){this.map=new Map(),this.lastMsgNotifByChat=new Map(),this.$1=null,this.$2=null,l&&(this.$1=new l(this))}var c=a.prototype;c.notificationExists=function(a){return this.map.has(a)};c.getNotification=function(a){return this.map.get(a)};c.closeOrCancelNotification=function(a){var b=this.getNotification(a);b&&(b.notificationBanner?b.notificationBanner.close():b.abortController&&b.abortController.abort(),this.$3(a))};c.closeOrCancelAllNotifications=function(){var a=this;this.map.forEach(function(b,c){a.closeOrCancelNotification(c)})};c.closeOrCancelNotificationsForChat=function(a){var b=this;this.map.forEach(function(c,d){c.matchesChat(a)&&b.closeOrCancelNotification(d)})};c.triggerNotification=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=this,c=a.buildKey();this.$4(c,a);try{var e=(yield a.triggerNotification(this.$2==null?void 0:this.$2()));if(e!=null){if(d("WAWebNotificationsMsgNotification").shouldReplaceMsgNotificationManually()&&a instanceof d("WAWebNotificationsMsgNotification").WAMsgNotification){var f=d("WAWebFrontendMsgGetters").getChat(a.msg).id.toString(),g=this.lastMsgNotifByChat.get(f);g&&self.setTimeout(function(){return g.close()},2e3);this.lastMsgNotifByChat.set(f,e);e.waitForClose().then(function(){b.lastMsgNotifByChat.get(f)===e&&b.lastMsgNotifByChat["delete"](f)})}e.waitForClose().then(function(){b.$3(c)})}else d("WALogger").LOG(k()).devConsole(a),this.$3(c)}catch(e){d("WAAbortError").catchAbort(function(e){d("WALogger").LOG(j(),e).devConsole(a),b.$3(c)})(e)}return a});function c(b){return a.apply(this,arguments)}return c}();c.setAppContext=function(a){this.$2=a};c.$4=function(a,b){this.map.set(a,b)};c.$3=function(a,b){var c=this.getNotification(a);if(c==null){d("WALogger").LOG(i(),a);return}if(b!=null&&c!==b){d("WALogger").LOG(h());return}this.map["delete"](a)};return a}();e=new c();g.WANotificationController=e}),98); __d("WAWebNotificationHelpers",["fbt","WANullthrows","WAWebChatCollection","WAWebChatGetters","WAWebCmd","WAWebEnvironment","WAWebFbtCommon","WAWebFrontendContactGetters","WAWebFrontendMsgGetters","WAWebGroupMetadataCollection","WAWebMsgGetters","WAWebMuteGetters","WAWebOfflineHandler","WAWebParticipantListUtils","WAWebQuotedMsgModelUtils","WAWebSettingsGetters","WAWebSettingsModel","WAWebUserPrefsMeUser","WAWebUserPrefsNotifications","gkx"],(function(a,b,c,d,e,f,g,h){function a(a){return document.hasFocus()&&a.active}function i(){return document.hasFocus()}function b(){return d("WAWebOfflineHandler").OfflineMessageHandler.isResumeOnSocketDisconnectInProgress()||!d("WAWebCmd").Cmd.isOfflineDeliveryEnd}function e(a,b){b===void 0&&(b=!0);if(!d("WAWebChatGetters").getIsGroup(a))return!1;if(d("WAWebChatGetters").getIsGroup(a)&&a.isReadOnly)return!1;var e=Date.now(),f=a.squelch||0;if(e>f){if(!b)return!1;c("WAWebGroupMetadataCollection").find(a.id).then(function(b){if(b!=null){b=j(a.id,b);a.squelch=Date.now()+b}});return!1}return!0}function j(a,b){a=b.participants.length;return Math.min(120,30+5*a)*1e3}function f(a){return!!((a=d("WAWebFrontendMsgGetters").getChat(a).groupMetadata)==null?void 0:a.isParentGroup)}function k(a){if(c("gkx")("26258"))return!1;if(!d("WAWebMsgGetters").getIsGroupMsg(a))return!1;if(m(a))return!1;return d("WAWebUserPrefsNotifications").getIgnoreNondirectGroupMsg()?!0:!1}function l(a){var b=d("WAWebFrontendMsgGetters").getChat(a);if(b==null)return!1;if(!d("WAWebMuteGetters").getIsMuted(b.mute))return!1;if(!d("WAWebChatGetters").getIsGroup(b))return!0;if(m(a)){b=d("WAWebChatCollection").ChatCollection.get(d("WAWebMsgGetters").getSender(a));return b!=null&&d("WAWebMuteGetters").getIsMuted(b.mute)===!0}return!0}function m(a){var b=d("WAWebUserPrefsMeUser").getMeUser();return a.isMentioned(b)||d("WAWebQuotedMsgModelUtils").isQuotedMsg(a,b)}function n(a){var b=d("WAWebFrontendMsgGetters").getChat(a);if(!d("WAWebSettingsGetters").getShowArchiveV2(c("WAWebSettingsModel")))return!1;if(!b.archive)return!1;if(!d("WAWebChatGetters").getIsGroup(b))return!0;if(m(a)){b=d("WAWebChatCollection").ChatCollection.get(d("WAWebMsgGetters").getSender(a));return b!=null&&d("WAWebMuteGetters").getIsMuted(b.mute)===!0}return!0}function o(a){return d("WAWebChatGetters").getIsGroup(a)?h._(/*BTDS*/"__JHASH__DqLQ7JJlR3w__JHASH__"):h._(/*BTDS*/"__JHASH__ovnYOY2OPxo__JHASH__")}function p(a){var b;if(a.isLocked)return c("WAWebFbtCommon")("WhatsApp").toString();if((b=a.groupMetadata)==null?void 0:b.isUnnamed)return d("WAWebParticipantListUtils").calculateUnnamedGroupFullParticipantsList(c("WANullthrows")(a.groupMetadata),!0);b=a.msgs.last();if((b==null?void 0:b.subtype)==="sender_invite"){var e=d("WAWebFrontendContactGetters").getFormattedName(a.contact);return(b==null?void 0:b.templateParams)&&(b==null?void 0:b.templateParams[0])==="true"?h._(/*BTDS*/"__JHASH__B7WI35Kg7I2__JHASH__",[h._param("receiver_name",e)]).toString():h._(/*BTDS*/"__JHASH__YwnAF53aSbj__JHASH__",[h._param("receiver_name",e)]).toString()}return d("WAWebFrontendContactGetters").getFormattedName(a.contact)||o(a).toString()}function q(a){return c("WAWebEnvironment").isWindows?i()&&(a==null?void 0:a.isChatsSurfaceActive)===!0:i()}g.chatIsActive=a;g.appIsActive=i;g.isOfflineResumeInProgress=b;g.shouldSquelch=e;g._calculateTimeoutFromGroupMetadata=j;g.isCommunityHomeAdd=f;g.shouldIgnoreGroupMsg=k;g.isMutedAndNotMentioned=l;g.isMeUserMentionedOrQuoted=m;g.isArchivedAndNotMentioned=n;g.getNotificationTitle=p;g.shouldMuteDueToAppState=q}),226); __d("WAWebNotificationIconUtils",["WAAbortError","WACustomError","WAFilteredCatch","WALogger","WAPromiseRaceAbort","WAPromiseTimeout","WAWebChatGetters","WAWebNotificationTone","WAWebProfilePicThumbCollection","asyncToGeneratorRuntime","bx"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["NotificationBackend:IconLoadTimeoutError:",""]);h=function(){return a};return a}var i=(e=c("bx")).getURL(e("11319")),j=e.getURL(e("9555")),k=e.getURL(e("9556")),l=e.getURL(e("11370"));function m(a){return d("WAWebChatGetters").getIsNewsletter(a)?l:d("WAWebChatGetters").getIsGroup(a)?j:k}function a(a,b,c){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){return a.isLocked?i:o(a.id,b,(b=c)!=null?b:m(a))});return n.apply(this,arguments)}function o(a,b,e){return d("WAPromiseTimeout").promiseTimeout(c("WAPromiseRaceAbort")(d("WAWebProfilePicThumbCollection").ProfilePicThumbCollection.find(a),b),1500,"showNotificationTimeout").then(function(a){if(b.aborted)throw new(d("WAAbortError").AbortError)();a=(a=a==null?void 0:a.img)!=null?a:e;return d("WAWebNotificationTone").cachePath(a)})["catch"](d("WAFilteredCatch").filteredCatch(d("WACustomError").TimeoutError,function(b){d("WALogger").LOG(h(),a.toString()).devConsole(b);return d("WAWebNotificationTone").cachePath(e)}))}g.USER_DEFAULT_ICON=k;g.getDefaultChatNotificationIcon=m;g.getChatNotificationIcon=a;g.getNotificationIconByWid=o}),98); __d("WAWebNotificationsChatAssignmentNotification",["fbt","WANullthrows","WAWebBaseNotification","WAWebChatCollection","WAWebChatGetters","WAWebConnModel","WAWebEnvironment","WAWebFrontendChatGetters","WAWebGetNotificationStrings","WAWebMuteCollection","WAWebMuteGetters","WAWebNotificationHelpers","WAWebNotificationIconUtils","WAWebNotificationMuteReason","WAWebUserPrefsMeUser","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g,h){a=function(a){babelHelpers.inheritsLoose(e,a);function e(b){var e,f=b.chats;b=b.assignmentTimestamps;e=a.call(this)||this;e.$WAWebNotificationsChatAssignmentNotification$p_1=function(){};e.chats=f.map(function(a){return d("WAWebChatCollection").ChatCollection.get(a)}).filter(function(a){return a!=null});e.primaryChat=c("WANullthrows")(e.chats[0]);e.assignmentTimestamps=b;e.businessName=(f=d("WAWebConnModel").Conn.pushname)!=null?f:h._(/*BTDS*/"__JHASH__ePeaC9vZcPg__JHASH__").toString();return e}var f=e.prototype;f.shouldMute=function(a){if(d("WAWebNotificationHelpers").shouldMuteDueToAppState(a))return c("WAWebNotificationMuteReason").AppState;if(this.chats.filter(function(a){return a&&d("WAWebMuteGetters").getIsMuted(a.mute)}).length===this.chats.length)return c("WAWebNotificationMuteReason").MutedChat;if(this.chats.filter(function(a){return a==null?void 0:a.archive}).length===this.chats.length)return c("WAWebNotificationMuteReason").ArchivedChat;if(d("WAWebMuteGetters").getIsMuted(d("WAWebMuteCollection").MuteCollection.globalMute()))return c("WAWebNotificationMuteReason").GlobalMute;return d("WAWebNotificationHelpers").isOfflineResumeInProgress()&&!c("WAWebEnvironment").isWindows?c("WAWebNotificationMuteReason").OfflineResumeInProgress:null};f.buildKey=function(){return"chat_assignment:"+this.chats.map(function(a){return a==null?void 0:a.id.toString()}).join("-")+this.assignmentTimestamps};f.matchesChat=function(a){return this.chats.length>1?!1:this.primaryChat.equals(a)};f.getChatKind=function(){return d("WAWebFrontendChatGetters").getKind(this.primaryChat)};f.performLogging=function(){};f.getIcon=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){return d("WAWebNotificationIconUtils").getNotificationIconByWid(d("WAWebUserPrefsMeUser").getMeUser(),this.abortController.signal,d("WAWebNotificationIconUtils").USER_DEFAULT_ICON)});function c(){return a.apply(this,arguments)}return c}();f.getBannerOptions=function(){var a=d("WAWebGetNotificationStrings").getNotificationBody(babelHelpers["extends"]({},i(this.primaryChat,this.businessName,this.chats.length)));return{wid:this.primaryChat.id,title:this.businessName,body:a,onClick:this.$WAWebNotificationsChatAssignmentNotification$p_1}};return e}(d("WAWebBaseNotification").WABaseNotification);function i(a,b,c){var e;c===1?d("WAWebChatGetters").getIsGroup(a)?e=h._(/*BTDS*/"__JHASH__cJ3nWRUtGPf__JHASH__",[h._param("businessName",b),h._param("chatName",a.formattedTitle)]):e=h._(/*BTDS*/"__JHASH__X7KjmzTJwyp__JHASH__",[h._param("businessName",b),h._param("chatName",a.formattedTitle)]):e=h._(/*BTDS*/"__JHASH__3LyohFTHukl__JHASH__",[h._param("businessNme",b),h._param("numberOfChats",c)]);return{body:e.toString()}}g.WAWebNotificationsChatAssignmentNotification=a}),226); __d("WAWebNotificationsDeviceSwitchNotification",["fbt","WAWebBaseNotification","WAWebMuteCollection","WAWebMuteGetters","WAWebNotificationHelpers","WAWebNotificationIconUtils","WAWebNotificationMuteReason","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g,h){a=function(a){babelHelpers.inheritsLoose(e,a);function e(b){var c,d=b.wid;b=b.otpCode;c=a.call(this)||this;c.wid=d;c.otpCode=b;return c}var f=e.prototype;f.shouldPlaySound=function(){return a.prototype.shouldPlaySound.call(this)};f.shouldMute=function(a){if(d("WAWebMuteGetters").getIsMuted(d("WAWebMuteCollection").MuteCollection.globalMute()))return c("WAWebNotificationMuteReason").GlobalMute;return d("WAWebNotificationHelpers").appIsActive()?c("WAWebNotificationMuteReason").AppState:null};f.buildKey=function(){return"registration:"+this.wid.toString()};f.getChatKind=function(){return null};f.getIcon=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){return d("WAWebNotificationIconUtils").getNotificationIconByWid(this.wid,this.abortController.signal,d("WAWebNotificationIconUtils").USER_DEFAULT_ICON)});function c(){return a.apply(this,arguments)}return c}();f.getBannerOptions=function(){var a=h._(/*BTDS*/"__JHASH__lExWzzlNO9k__JHASH__",[h._param("otpCode",this.otpCode)]).toString(),b=h._(/*BTDS*/"__JHASH__7fypcEiOQ6Y__JHASH__").toString();return{wid:this.wid,title:b,body:a,doNotOpenChat:!0}};return e}(d("WAWebBaseNotification").WABaseNotification);g.WADeviceSwitchNotification=a}),226); __d("WAWebMediaUtils",["WABinary"],(function(a,b,c,d,e,f,g){function h(a){return btoa(String.fromCharCode.apply(null,d("WABinary").Binary.build(a).readByteArray()))}function a(a){return"data:image/jpeg;base64,"+h(a)}g.convertToBase64=h;g.convertToDataURI=a}),98); __d("WAWebNotificationsMsgNotification",["fbt","WAWebBaseNotification","WAWebBizAiAgentStatusUtils","WAWebBotGating","WAWebBotTypes","WAWebChatThreadLogging","WAWebElevatedPushNamesFlag","WAWebEnvironment","WAWebFrontendChatGetters","WAWebFrontendMsgGetters","WAWebGetNotificationStrings","WAWebGroupSafetyCheckUtils","WAWebMediaUtils","WAWebMsgGetters","WAWebMsgType","WAWebMuteCollection","WAWebMuteGetters","WAWebNotificationController","WAWebNotificationEngagementWamEvent","WAWebNotificationHelpers","WAWebNotificationIconUtils","WAWebNotificationMuteReason","WAWebUA","WAWebViewMode.flow","WAWebViewModeUtils","asyncToGeneratorRuntime","cr:3133","cr:4404","gkx"],(function(a,b,c,d,e,f,g,h){e=(a=b("cr:3133"))!=null?a:{};var i=e.shouldIgnoreSquelchForGroupMention,j=e.shouldSuppressBanner,k=e.isReplyable,l=e.getContextMenuItems;a=(f=b("cr:4404"))!=null?f:{};var m=a.getMessageNotificationFooter,n=a.getNotificationBodyForPreviewOff,o=new Set([d("WAWebMsgType").MSG_TYPE.ALBUM]);e=function(a){babelHelpers.inheritsLoose(e,a);function e(b){var c;b=b.msg;c=a.call(this)||this;c.msg=b;return c}var f=e.prototype;f.shouldPlaySound=function(){return a.prototype.shouldPlaySound.call(this)&&!d("WAWebMsgGetters").getIsEdited(this.msg)};f.shouldMute=function(a){if(c("WAWebEnvironment").isWindows&&this.msg.viewed)return c("WAWebNotificationMuteReason").IgnoreViewedMsgs;var b=d("WAWebFrontendMsgGetters").getChat(this.msg);if(d("WAWebMuteGetters").getIsMuted(d("WAWebMuteCollection").MuteCollection.globalMute()))return c("WAWebNotificationMuteReason").GlobalMute;if(d("WAWebNotificationHelpers").shouldMuteDueToAppState(a))return c("WAWebNotificationMuteReason").AppState;if(d("WAWebGroupSafetyCheckUtils").shouldMuteMentionWhileGroupSafetyChecked(this.msg))return c("WAWebNotificationMuteReason").GroupSafetyCheck;if(d("WAWebNotificationHelpers").isMutedAndNotMentioned(this.msg))return c("WAWebNotificationMuteReason").MutedChat;if(d("WAWebNotificationHelpers").isArchivedAndNotMentioned(this.msg))return c("WAWebNotificationMuteReason").ArchivedChat;if(d("WAWebNotificationHelpers").isCommunityHomeAdd(this.msg))return c("WAWebNotificationMuteReason").IgnoreAddedToCommunityHome;if(!c("gkx")("26258")&&d("WAWebNotificationHelpers").shouldIgnoreGroupMsg(this.msg))return c("WAWebNotificationMuteReason").IgnoreGroupMsg;if(d("WAWebMsgGetters").getIsFutureproof(this.msg))return c("WAWebNotificationMuteReason").IgnoreFutureProof;if(d("WAWebNotificationHelpers").isOfflineResumeInProgress()&&!c("WAWebEnvironment").isWindows)return c("WAWebNotificationMuteReason").OfflineResumeInProgress;if(d("WAWebMsgGetters").getIsBizContentPlaceholder(this.msg))return c("WAWebNotificationMuteReason").IgnoreBizContentPlaceholder;if(d("WAWebMsgGetters").getIsCallSilenced(this.msg))return c("WAWebNotificationMuteReason").IgnoreCallMsgs;if(b.id.isBot()&&(!d("WAWebBotGating").isBotEnabled()||this.msg.botMsgBodyType===d("WAWebBotTypes").BotMsgBodyType.VOICE))return c("WAWebNotificationMuteReason").IgnoreBotMsgs;if(p(this.msg))return c("WAWebNotificationMuteReason").IgnoreInternalSilentTag;if(!d("WAWebViewModeUtils").isViewModeVisibleInSurface(d("WAWebViewMode.flow").ViewModeSurface.NOTIFICATION,this.msg.viewMode))return c("WAWebNotificationMuteReason").IgnoreHiddenViewModeMsgs;return d("WAWebBizAiAgentStatusUtils").shouldMuteNotification(b)?c("WAWebNotificationMuteReason").AIRepliesOn:null};f.shouldSquelch=function(){var a=d("WAWebNotificationController").WANotificationController.notificationExists(this.buildKey());if(a&&(d("WAWebMsgGetters").getIsEdited(this.msg)||o.has(this.msg.type)))return null;return(i==null?void 0:i(this.msg))?null:d("WAWebNotificationHelpers").shouldSquelch(d("WAWebFrontendMsgGetters").getChat(this.msg))?c("WAWebNotificationMuteReason").GroupFlood:null};f.shouldSuppressBanner=function(a){return!!j&&j(a)};f.buildKey=function(){var a;return"msg:"+((a=(a=this.msg.latestEditMsgKey)==null?void 0:a.toString())!=null?a:this.msg.id.toString())};f.matchesChat=function(a){return a.equals(d("WAWebFrontendMsgGetters").getMaybeChat(this.msg))};f.getChatKind=function(){return d("WAWebFrontendChatGetters").getKind(d("WAWebFrontendMsgGetters").getChat(this.msg))};f.getDefaultIcon=function(){return d("WAWebMsgGetters").getIsProductListMessage(this.msg)?d("WAWebMediaUtils").convertToDataURI(d("WAWebMsgGetters").getProductListHeaderImage(this.msg)):d("WAWebNotificationIconUtils").getDefaultChatNotificationIcon(d("WAWebFrontendMsgGetters").getChat(this.msg))};f.getIcon=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){return d("WAWebNotificationIconUtils").getChatNotificationIcon(d("WAWebFrontendMsgGetters").getChat(this.msg),this.abortController.signal,this.getDefaultIcon())});function c(){return a.apply(this,arguments)}return c}();f.getBannerOptions=function(){var a=this.msg,e=q(a);a=d("WAWebGetNotificationStrings").getNotificationBody(babelHelpers["extends"]({},e,{msgDir:d("WAWebFrontendMsgGetters").getDir(a)}));var f=d("WAWebFrontendMsgGetters").getChat(this.msg),g=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield d("WAWebChatThreadLogging").getChatThreadID(f.id.toJid()));new(d("WAWebNotificationEngagementWamEvent").NotificationEngagementWamEvent)({threadId:a}).commit()});return function(){return a.apply(this,arguments)}}();return{wid:f.id,msgId:this.msg.id.toString(),tag:r()?this.msg.id.toString():f.id.toString(),title:d("WAWebNotificationHelpers").getNotificationTitle(f),body:a,onClick:function(){c("gkx")("26258")||g()},renotify:!d("WAWebMsgGetters").getIsEdited(this.msg),footer:e.footer,contextMenuItems:this.getContextMenuItems()}};f.isReplyable=function(){var a;return(a=k==null?void 0:k(this.msg))!=null?a:!1};f.getContextMenuItems=function(){var a;return(a=l==null?void 0:l(this.msg))!=null?a:[]};return e}(d("WAWebBaseNotification").WABaseNotification);function p(a){return!c("gkx")("26258")&&((a=a.body)==null?void 0:(a=a.toLowerCase())==null?void 0:a.includes("@silent"))===!0}function q(a){var b=null,c=d("WAWebFrontendMsgGetters").getChat(a),e=d("WAWebElevatedPushNamesFlag").elevatedPushNamesM2Enabled(c);e=d("WAWebMsgGetters").getIsGroupMsg(a)||d("WAWebMsgGetters").getIsMetaBotInvokeResponse(a)?a.displayName({withPushName:e,withPushNameOnly:e,newPushNameFormatting:e,showVerifiedName:e}):void 0;if(c.isLocked)return{body:d("WAWebGetNotificationStrings").getPluralMessageNotificationBody(c.unreadCount).toString()};else if(a.type===d("WAWebMsgType").MSG_TYPE.CHAT&&!a.shouldShowNotificationPreview()){var f;f=(f=n==null?void 0:n())!=null?f:null;f!=null?b=f:d("WAWebMsgGetters").getIsGroupMsg(a)?e!=null?(b=h._(/*BTDS*/"__JHASH__xWfZqnNO_oH__JHASH__",[h._param("name",e)]),e=void 0):b=h._(/*BTDS*/"__JHASH__6aj3VtUl3iu__JHASH__"):b=d("WAWebGetNotificationStrings").getPluralMessageNotificationBody(c.unreadCount)}else a.type===d("WAWebMsgType").MSG_TYPE.NOTIFICATION_TEMPLATE&&a.subtype==="sender_invite"?a.templateParams&&a.templateParams[0]==="true"?b=h._(/*BTDS*/"__JHASH__7o4U1sgrj9d__JHASH__"):b=h._(/*BTDS*/"__JHASH__OWzIPA9T2wW__JHASH__"):b=d("WAWebGetNotificationStrings").getNotificationMessageBody(a);a=(f=m==null?void 0:m(c.unreadCount))!=null?f:null;return babelHelpers["extends"]({body:b.toString(),author:e},a!=null&&{footer:a.toString()})}function r(){return d("WAWebUA").UA.isBlink&&d("WAWebUA").UA.os===d("WAWebUA").OS_TYPE.MAC}g.eligibleMessagesForNotificationRetriggering=o;g.WAMsgNotification=e;g.getNotificationParts=q;g.shouldReplaceMsgNotificationManually=r}),226); __d("WAWebStateConcern",["WALogger","WAWebBaseMirror","WAWebBaseModel","WAWebCollections","WAWebProxyStateFactory","WAWebStreamModel"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose([""," given invalid object for ",": ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose([""," was not supplied the "," model with keys ","."]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(['Unknown StateHOC concern type "','"']);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(['READ ONLY: Cannot write to proxied property "','", created in <'," />, it is not writable."]);k=function(){return a};return a}b("WAWebCollections");function l(a){if(typeof a==="string")return a;return a.toString?a.toString():"Invalid Object"}function m(a,b,c,e){var f={$ProxyState$ComponentName:{value:a},proxyBitMask:{value:d("WAWebBaseMirror").genBitMask(b.prototype.mirrorMask,c)}},g=function(b){var c={};c.enumerable=!0;c.get=function(){return this.$ProxyState$state.get(b)};c.set=function(){d("WALogger").ERROR(k(),b,a)};e||(c.set=function(a){this.$ProxyState$state.set(b,a)});f[b]=c};for(c of c)g(c);function h(a){b.call(this,a)}h.prototype=Object.create(b.prototype,f);h.prototype.constructor=h;return h}a=function(){function a(a,b,c,e,f){f===void 0&&(f=!1);this.componentName=a;this.name=b;this.$1=e;this.keys=c;e=d("WAWebProxyStateFactory").ProxyStates[b];e||d("WALogger").ERROR(j(),b).sendLogs("state-hoc-error");this.$2=e;this.$3=m(a,e,c,f)}var b=a.prototype;b.getModel=function(a){return a instanceof this.$2?a.$ProxyState$state:a};b.getModelAndValidate=function(a){a=a instanceof this.$2?a.$ProxyState$state:a;if(!a){d("WAWebStreamModel").Stream.mode===d("WAWebStreamModel").StreamMode.MAIN&&d("WALogger").ERROR(i(),this.componentName,this.name,String(this.keys)).sendLogs("state-hoc-error");return null}if(!(a instanceof d("WAWebBaseModel").BaseModel)){d("WALogger").ERROR(h(),this.componentName,this.name,l(a)).sendLogs("state-hoc-error");return null}return a};b.createProxy=function(a){return new this.$3(a)};b.attachConcern=function(a,b,c){a.incObservers(!this.$1),a.mirror.addListener(c,b,this)};b.detachConcern=function(a,b){a.decObservers(),a.mirror.removeListener(b)};return a}();g["default"]=a}),98); __d("WAWebCxtUrl",["WAWebL10N"],(function(a,b,c,d,e,f,g){var h="https://faq.whatsapp.com";function i(a){return h+"/cxt/?entrypointid="+a+"&platform=web&lang="+c("WAWebL10N").getNormalizedLocale()}function a(){return i("invite-via-link-unavailable")}function b(){return i("community-no-longer-available")}g.getGroupInviteGrowthLockedFaqUrl=a;g.getCommunityNotAvailableFaqUrl=b}),98); __d("WAWebSuspendedCommunityUtils",["fbt","WAWebChatCollection","WAWebConfirmPopup.react","WAWebCxtUrl","WAWebExternalLink.react","WAWebModalManager","WAWebSuspendedCommunityModalLoadable","react"],(function(a,b,c,d,e,f,g,h){var i,j=i||c("react");e="community-suspend-appeal";f="suspendedCommunityModal";function a(){d("WAWebModalManager").ModalManager.open(j.jsx(d("WAWebConfirmPopup.react").ConfirmPopup,{onOK:function(){d("WAWebModalManager").ModalManager.close()},onCancel:function(){d("WAWebModalManager").ModalManager.close(),d("WAWebExternalLink.react").openExternalLink(d("WAWebCxtUrl").getCommunityNotAvailableFaqUrl())},okText:h._(/*BTDS*/"__JHASH__P1c0P2l7ww6__JHASH__"),cancelText:h._(/*BTDS*/"__JHASH__gQ-OwVRxNrz__JHASH__"),title:h._(/*BTDS*/"__JHASH__T7eSzqWZvY4__JHASH__")}),{transition:"modal-flow"})}function b(a){a=(a=a.groupMetadata)==null?void 0:a.parentGroup;if(a==null)return;a=d("WAWebChatCollection").ChatCollection.get(a);if(a==null)return;d("WAWebModalManager").ModalManager.open(j.jsx(d("WAWebSuspendedCommunityModalLoadable").SuspendedCommunityModalLoadable,{community:a}),{transition:"modal-flow"})}g.SUSPENDED_COMMUNITY_SUPPORT_TAG=e;g.SUSPENDED_COMMUNITY_MODAL_ENTRYPOINT_ID=f;g.openTerminatedCommunityModal=a;g.openSuspendedCommunityModal=b}),226); __d("WAWebArrowForwardIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k="arrow-forward";function a(a){var b=a.iconXstyle,e=a.height,f=a.width,g=a.viewBox;a=babelHelpers.objectWithoutPropertiesLoose(a,["iconXstyle","height","width","viewBox"]);var h;if(g){var l=g.x;l=l===void 0?0:l;var m=g.y;m=m===void 0?0:m;var n=g.width;n=n===void 0?0:n;g=g.height;g=g===void 0?0:g;h=[l,m,n,g].join(" ")}l=30;m=30;(e!=null||f!=null)&&(l=e,m=f);return j.jsx(d("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers["extends"]({name:k},a,{children:j.jsxs("svg",{viewBox:(n=h)!=null?n:"0 0 30 30",height:l,width:m,preserveAspectRatio:"xMidYMid meet",className:(i||(i=c("stylex")))(b),version:"1.1",x:"0px",y:"0px",enableBackground:"new 0 0 30 30",children:[j.jsx("title",{children:k}),j.jsx("path",{fill:"currentColor",d:"M15,7l-1.4,1.4l5.6,5.6H7v2h12.2l-5.6,5.6L15,23l8-8L15,7z"})]})}))}a.displayName=a.name+" [from "+f.id+"]";g.ArrowForwardIcon=a}),98); __d("WAWebGetThreadType",["WAWebChatGetters","WAWebGroupType","WAWebWamEnumThreadType"],(function(a,b,c,d,e,f,g){function a(a){if(d("WAWebChatGetters").getIsBroadcast(a))return d("WAWebWamEnumThreadType").THREAD_TYPE.BROADCAST;else if(d("WAWebChatGetters").getIsNewsletter(a))return d("WAWebWamEnumThreadType").THREAD_TYPE.CHANNEL;a=a==null?void 0:a.groupMetadata;if(!a)return d("WAWebWamEnumThreadType").THREAD_TYPE.INDIVIDUAL;switch(a.groupType){case d("WAWebGroupType").GroupType.COMMUNITY:return d("WAWebWamEnumThreadType").THREAD_TYPE.PARENT_GROUP;case d("WAWebGroupType").GroupType.DEFAULT:return d("WAWebWamEnumThreadType").THREAD_TYPE.GROUP;case d("WAWebGroupType").GroupType.LINKED_SUBGROUP:return d("WAWebWamEnumThreadType").THREAD_TYPE.SUB_GROUP;case d("WAWebGroupType").GroupType.LINKED_ANNOUNCEMENT_GROUP:return d("WAWebWamEnumThreadType").THREAD_TYPE.DEFAULT_SUB_GROUP;case d("WAWebGroupType").GroupType.LINKED_GENERAL_GROUP:return d("WAWebWamEnumThreadType").THREAD_TYPE.SUB_GROUP}}g.getThreadType=a}),98); __d("WAWebWamEnumUserRoleType",[],(function(a,b,c,d,e,f){a=Object.freeze({MEMBER:0,ADMIN:1,CADMIN:2});f.USER_ROLE_TYPE=a}),66); __d("WAWebGetUserRole",["WAWebWamEnumUserRoleType"],(function(a,b,c,d,e,f,g){function a(a){a=a==null?void 0:a.groupMetadata;if(a==null)return null;var b=a.participants.iAmAdmin();a=b&&a.isParentGroup;if(a===!0)return d("WAWebWamEnumUserRoleType").USER_ROLE_TYPE.CADMIN;else if(b===!0)return d("WAWebWamEnumUserRoleType").USER_ROLE_TYPE.ADMIN;return d("WAWebWamEnumUserRoleType").USER_ROLE_TYPE.MEMBER}g.getUserRole=a}),98); __d("WAWebWamEnumChatFilterActionTypes",[],(function(a,b,c,d,e,f){a=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,VIEW:9,GROUP_NAVIGATION:10,GROUP_DISCOVERY:11,GROUP_JOIN:12,SUBGROUP_SWITCHER_CLICK:13,SUBGROUP_MENTION_CLICK:14,COMMUNITY_RICH_SYSTEM_MESSAGE_CLICK:15,GROUP_SYSTEM_MESSAGE_CLICK:16,NESTING_VIEW_COMMUNITY_CLICK:17,SELECT_COMMUNITY_ADMINS_CAN_ADD_GROUPS:18,SELECT_EVERYONE_CAN_ADD_GROUPS:19,GROUP_JOIN_REQUEST:20,NOTIFICATION_RECEIVED:21,NOTIFICATION_RENDERED:22,TAP_TO_OPEN:23,TAP_TO_REPLY:24,VOIP_CALLBACK:25,VOIP_MESSAGE:26,VOIP_DECLINE:27,MARK_AS_READ:28,AI_NEW_CHAT_CLICK:29,AI_TAB_SELECTION_CLICK:30,AI_PERSONA_SELECTION_CLICK:31,AI_TOS_VIEW:32,AI_TOS_ACCEPT_CLICK:33,AI_TOS_DISMISS_CLICK:34,AI_NEW_UGC_CLICK:35,AI_UGC_CREATION_START_CLICK:36,AI_GENDER_AGE_SELECTION_CLICK:37,AI_PERSONALITY_SELECTION_CLICK:38,AI_INTEREST_SELECTION_CLICK:39,AI_AVATAR_SELECTION_CLICK:40,AI_NAME_SELECTION_CLICK:41,AI_UGC_CREATION_FINISH_CLICK:42,REQUEST_WAITLIST_DIALOG_APPEAR:43,REQUEST_WAITLIST_SELECT:44,FILTER_VIEWED:45,FILTER_EMPTY_STATE_VIEWED:46,BUSINESS_SERP_LOADED:47,BIZ_SEE_MORE_CLICKED:48,IMPRESSION:49,BIZ_SEARCH_SET_LOCATION_CLICKED:50,CLOSE_BTN_CLICKED:51,AI_CHAT_CLICK:52,NEW_CHAT_CLICK:53,SERP_LOADED:54,CLICK:55,ENTER:56,DISMISS:57,SEND_MESSAGE_SUCCESS:58,META_AI_MODEL_SETTING_SHOW:59,META_AI_MODEL_UPDATE:60,AI_CHARACTER_EXPLORE_CLICK:61,AI_CHARACTER_EXISTING_CHAT_CLICK:62,AI_CHARACTER_PREVIEWED:63,AI_CHARACTER_PROMPT_CLICK:64,AI_CHARACTER_START_CHATTING_CLICK:65,AI_CHARACTER_SHARE_CLICKED:66,AI_CHARACTER_CREATOR_PROFILE_CLICK:67,AI_TOS_DISMISS_NOT_ACCEPTED:68,AI_TOS_DISMISS_AUTO_ACCEPTED:69,AI_CHARACTER_CHAT_CLICK:70,AI_HOME_IMPRESSION:71,AI_VOICE_NUX_VIEW:72,AI_VOICE_NUX_ALLOW:73,AI_VOICE_NUX_DISMISS:74,AI_VOICE_MIC_PERMISSION_VIEW:75,AI_VOICE_MIC_PERMISSION_ALLOW:76,AI_VOICE_MIC_PERMISSION_DISMISS:77,AI_VOICE_AUDIO_RECORDING_PERMISSION_VIEW:78,AI_VOICE_AUDIO_RECORDING_PERMISSION_WHILE_USING_THE_APP_CLICK:79,AI_VOICE_AUDIO_RECORDING_PERMISSION_ONLY_THIS_TIME_CLICK:80,AI_VOICE_HALF_SHEET_VIEW:81,AI_VOICE_HALF_SHEET_CONNECT:82,AI_VOICE_FULL_SHEET_VIEW:83,SCAN:84,AI_VOICE_MIC_PERMISSION_REDIRECT_TO_SETTING:85,AI_VOICE_SEARCH_CHATS_LIST_CLICK:86,AI_VOICE_CHAT_THREAD_CLICK:87,AI_VOICE_FAB_CLICK:88,XMA_REELS_PLUGIN_PREVIEWED:89,XMA_REELS_CLICKED:90,AI_MEMORY_DELETE:91,AI_MEMORY_ALL_DELETE:92,AI_MEMORY_DISMISS_CLICK:93,AI_MEMORY_BOTTOM_SHEET_VIEW_ALL_CLICK:94,AI_MEMORY_VIEW:95,AI_MULTIMODAL_SESSION_BEGIN:96,AI_VOICE_TO_TEXT_TRANSITION:97,AI_VOICE_CONNECTION_ERROR:98,AI_VOICE_TAP_ICEBREAKER:99,AI_MULTIMODAL_HISTORY_FETCH:100,AI_LISTENING_ENABLE:101,AI_LISTENING_DISABLE:102,AI_TAB_CLICK:103,AI_TAB_IMPRESSION:104,AI_DISCOVERY_CLICK:105,AI_DISCOVERY_PREVIEW:106,AI_CHARACTER_AUDIO_MUTED:107,AI_CHARACTER_AUDIO_UNMUTED:108,AI_TAB_CHARACTER_PREVIEWED:109,AI_CHARACTER_IMPRESSION:110,AI_INLINE_TOS_RENDERED:111,AI_INLINE_TOS_VIEWED_ATTEMPT:112,AI_INLINE_TOS_VIEWED:113,AI_INITIATION_CONTINUE_ACCEPTED:114,NOVICE_AI_TAB_CLICK:115,AI_VOICE_BACKGROUND_CALL:116,AI_VOICE_FOREGROUND_CALL:119,AI_VOICE_START_CALL:120,AI_VOICE_END_CALL:121,AI_VOICE_AUTO_END_CALL:122,AI_NULL_STATE_PROMPT_SEND:125,AI_NULL_STATE_HISTORY_FETCH:126,AI_VOICE_CONVERSATION_STARTER_CLICK:127,AI_VOICE_START_VOICE_MODE:128,AI_VOICE_SEND_TEXT:129,AI_TOS_NOTICE_ID_ERROR:130,AI_HOME_PULL_TO_REFRESH:131,AI_VOICE_VIEW_VOICE_SELECTION:132,AI_VOICE_SKIP_VOICE_SELECTION:133,AI_VOICE_CANCEL_VOICE_SELECTION:134,AI_VOICE_SELECT_VOICE_SELECTION:135,AI_VOICE_ON_DEFAULT_ENABLED:136,AI_VOICE_ON_DEFAULT_DISABLED:137,AI_MEMORY_UPDATED:138,AI_CREATION_BUTTON_CLICK:139,AI_CREATION_TOS_PREVIEWED:140,AI_CREATION_PREVIEW:141,AI_CREATION_DESCRIPTION_SUBMIT:142,AI_CREATION_PERSONALITY_CATEGORY_PREVIEW:143,AI_CREATION_PERSONALITY_SUBMIT:144,AI_CREATION_AVATAR_CREATE_PREVIEWED:145,AI_CREATION_AVATAR_SUBMIT:146,AI_CREATION_AUDIENCE_PUBLIC:147,AI_CREATION_AUDIENCE_ONLY_ME:148,AI_CREATION_CONFIRMED:149,AI_CREATION_DELETION_STARTED:150,AI_CREATION_DELETION_COMPLETED:151,AI_CREATION_REPORT_STARTED:152,AI_CREATION_REPORT_COMPLETED:153,AI_CREATION_NAMING_PREVIEWED:154,AI_CREATION_NAMING_SUBMIT:155,AI_CREATION_INTRO_PREVIEWED:156,AI_CREATION_INTRO_SUBMIT:157,AI_CREATION_REVIEW_PREVIEWED:158,AI_CREATION_SUBMIT:159,AI_CHAT_THREAD_VOICE_VIEW:160,AI_VOICE_CONVERSATION_STARTER_VIEW:161,AI_HIDE_REQUEST_SUBMITTED:162,AI_CHARACTER_EXPLORE_VIEWED:163,META_AI_CHAT_THREAD_VIEWED_TEXT:164,META_AI_CHAT_THREAD_VIEWED_VOICE:165,TAP_TO_FORWARD:166,TAP_TO_COPY:167,TAP_TO_STAR:168,TAP_TO_DELETE:169,TAP_TO_REACT:170,SWIPE_TO_REPLY:171,AI_CREATION_AVATAR_EDIT_CLICK:172,AI_CREATION_AVATAR_CREATE_NEW:173,AI_CREATION_VOICE_SELECTION_PREVIEWED:174,AI_CREATION_NAMING_EDIT_SAVED:175,AI_CREATION_DESCRIPTION_EDIT_SAVED:176,AI_CREATION_INTRODUCTION_EDIT_SAVED:177,AI_CREATION_WELCOME_MSG_SAVED:178,AI_CREATION_ICEBREAKER_SAVED:179,AI_CREATION_INSTRUCTIONS_SAVED:180,AI_CREATION_INSTRUCTIONS_DELETED:181,AI_CREATION_EXAMPLE_DIALOG_SAVED:182,AI_CREATION_EXAMPLE_DIALOG_DELETED:183,AI_CREATION_ADVANCED_SETTINGS_PREVIEWED:184,AI_CREATION_VOICE_PREVIEWED:185,AI_CREATION_VOICE_SUBMIT:186,AI_VOICE_TOS_ACCEPT_CLICK:187,AI_VOICE_TOS_VIEW:188,AI_CREATION_AVATAR_REGENERATION:189});f.CHAT_FILTER_ACTION_TYPES=a}),66); __d("WAWebGroupJourneyWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumChatFilterActionTypes","WAWebWamEnumSurfaceType","WAWebWamEnumThreadType","WAWebWamEnumTsSurface","WAWebWamEnumUserRoleType"],(function(a,b,c,d,e,f,g){a=d("WAWebWamCodegenUtils").defineEvents({GroupJourney:[4512,{actionType:[1,d("WAWebWamEnumChatFilterActionTypes").CHAT_FILTER_ACTION_TYPES],appSessionId:[2,d("WAWebWamCodegenUtils").TYPES.STRING],groupSize:[3,d("WAWebWamCodegenUtils").TYPES.INTEGER],surface:[4,d("WAWebWamEnumSurfaceType").SURFACE_TYPE],threadType:[5,d("WAWebWamEnumThreadType").THREAD_TYPE],uiSurface:[7,d("WAWebWamEnumTsSurface").TS_SURFACE],userRole:[6,d("WAWebWamEnumUserRoleType").USER_ROLE_TYPE]},[1,1,1],"regular"]},{GroupJourney:[]});g.GroupJourneyWamEvent=a}),98); __d("WAWebCommunityGroupJourneyEventImpl",["WALogger","WAWebGetSharedSessionId","WAWebGetThreadType","WAWebGetUserRole","WAWebGroupJourneyWamEvent","WAWebWamEnumSurfaceType"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["No relevant communtiy journey log for this invite modal"]);h=function(){return a};return a}a=function(){function a(a){var b=a.action,c=a.surface;a=a.chat;this.action=b;this.surface=c;this.chat=a;this.sessionId=d("WAWebGetSharedSessionId").getSharedSessionId()}a.inviteModalSourceToSurface=function(a){switch(a){case"community_home":return d("WAWebWamEnumSurfaceType").SURFACE_TYPE.COMMUNITY_HOME;case"community_nav":return d("WAWebWamEnumSurfaceType").SURFACE_TYPE.COMMUNITY_NAV;case"subgroup_switcher":return d("WAWebWamEnumSurfaceType").SURFACE_TYPE.COMMUNITY_NAV_SHEET;case"invite_link":return d("WAWebWamEnumSurfaceType").SURFACE_TYPE.CHAT;case"group_mention":return d("WAWebWamEnumSurfaceType").SURFACE_TYPE.CHAT;case"other":d("WALogger").ERROR(h());return null}};var b=a.prototype;b.shouldLogThreadType=function(){switch(this.surface){case d("WAWebWamEnumSurfaceType").SURFACE_TYPE.CHAT:case d("WAWebWamEnumSurfaceType").SURFACE_TYPE.CHATLIST:case d("WAWebWamEnumSurfaceType").SURFACE_TYPE.COMMUNITY_HOME:case d("WAWebWamEnumSurfaceType").SURFACE_TYPE.COMMUNITY_TAB:case d("WAWebWamEnumSurfaceType").SURFACE_TYPE.COMMUNITY_NAV:case d("WAWebWamEnumSurfaceType").SURFACE_TYPE.COMMUNITY_NAV_SHEET:case d("WAWebWamEnumSurfaceType").SURFACE_TYPE.COMMUNITY_SETTINGS:case d("WAWebWamEnumSurfaceType").SURFACE_TYPE.GROUP_INFO:return!0;default:return!1}};b.getThreadType=function(){var a;return!this.shouldLogThreadType()||((a=this.chat)==null?void 0:a.groupMetadata)==null?null:d("WAWebGetThreadType").getThreadType(this.chat)};b.getGroupSize=function(){var a;a=(a=this.chat)==null?void 0:a.groupMetadata;return a==null?0:(a=a.participants.length)!=null?a:0};b.getUserRole=function(){return d("WAWebGetUserRole").getUserRole(this.chat)};b.commit=function(){var a=new(d("WAWebGroupJourneyWamEvent").GroupJourneyWamEvent)({actionType:this.action,appSessionId:this.sessionId,surface:this.surface,groupSize:this.getGroupSize()}),b=this.getThreadType();b!=null&&(a.threadType=b);b=this.getUserRole();b!=null&&(a.userRole=b);a.commit()};return a}();g.CommunityGroupJourneyEvent=a}),98); __d("WAWebMessageCommunityCard.react",["WAWebArrowForwardIcon.react","WAWebChatCollection","WAWebChatGroupUtils","WAWebCmd","WAWebCommunityGeneralChatImage.react","WAWebCommunityGroupJourneyEventImpl","WAWebCommunitySquircleIcon.react","WAWebDetailImage.react","WAWebFlex.react","WAWebGroupMetadataCollection","WAWebText_DONOTUSE.react","WAWebUISpacing","WAWebUnstyledButton.react","WAWebWamEnumChatFilterActionTypes","WAWebWamEnumSurfaceType","WAWebWid","WAWebWidFactory","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k={communitySquircle:{color:"x1oc2adj",$$css:!0},footerButton:{color:"x1jrnqrx",display:"x78zum5",justifyContent:"xl56j7k",borderTopWidth:"x178xt8z",borderTopStyle:"x13fuv20",borderTopColor:"x11ca4hs",width:"xh8yej3",$$css:!0},list:{textAlign:"x1yc453h",position:"x1n2onr6",$$css:!0}};function a(a){var b=a.title,e=a.subtitle,f=a.body,g=a.footer,h=a.subgroupId,l=a.openNavigation,m=l===void 0?!1:l,n=a.onFooterClick,o=null;a.communityId&&(o=a.communityId instanceof c("WAWebWid")?a.communityId:d("WAWebWidFactory").createWid(a.communityId));var p=h?d("WAWebChatCollection").ChatCollection.get(h):null;a=p?Boolean(d("WAWebChatGroupUtils").isCommunityAnnouncementGroup(p)||((l=p.groupMetadata)==null?void 0:l.isParentGroup)):!1;l=p?d("WAWebChatGroupUtils").isCommunityGeneralGroup(p):!1;var q=function(a){var b;if(!o||!((b=c("WAWebGroupMetadataCollection").get(o))==null?void 0:b.hasJoined()))return;p&&new(d("WAWebCommunityGroupJourneyEventImpl").CommunityGroupJourneyEvent)({action:d("WAWebWamEnumChatFilterActionTypes").CHAT_FILTER_ACTION_TYPES.COMMUNITY_RICH_SYSTEM_MESSAGE_CLICK,surface:d("WAWebWamEnumSurfaceType").SURFACE_TYPE.CHAT,chat:p}).commit();a&&(a.preventDefault(),a.stopPropagation());if(n)return n();if(!m){d("WAWebCmd").Cmd.openCommunityTabbedInfo(o);return}d("WAWebCmd").Cmd.openCommunityHome(o)},r;l||(o?r=j.jsx(d("WAWebDetailImage.react").DetailImage,{id:o,shape:d("WAWebDetailImage.react").DetailImageShape.Squircle}):r=j.jsx(d("WAWebCommunitySquircleIcon.react").CommunitySquircleIcon,{width:49,height:49,iconXstyle:k.communitySquircle}));var s;l?s=j.jsx("div",babelHelpers["extends"]({className:"x14yjl9h xudhj91 x18nykt9 xww2gxu xpyat2d x1exxlbk x1n2onr6"},{children:j.jsx(d("WAWebCommunityGeneralChatImage.react").CommunityGeneralChatImage,{})})):h&&!a&&(s=j.jsxs(j.Fragment,{children:[j.jsx(d("WAWebDetailImage.react").DetailImage,{id:h,xstyle:d("WAWebUISpacing").uiMargin.end8}),j.jsx(d("WAWebArrowForwardIcon.react").ArrowForwardIcon,{directional:!0,xstyle:d("WAWebUISpacing").uiMargin.end8})]}));l=j.jsxs(d("WAWebFlex.react").FlexRow,{justify:"center",align:"center",children:[s,r]});a=j.jsxs("div",babelHelpers["extends"]({},(i||(i=c("stylex"))).props(d("WAWebUISpacing").uiMargin.top8,d("WAWebUISpacing").uiMargin.bottom12),{children:[j.jsx(d("WAWebText_DONOTUSE.react").TextHeader,{color:"primary",weight:"medium",level:"3",children:b}),e!=null?j.jsx(d("WAWebText_DONOTUSE.react").Text,{as:"p",size:"13",children:e}):null]}));h=g!=null?j.jsx(c("WAWebUnstyledButton.react"),{xstyle:[k.footerButton,d("WAWebUISpacing").uiPadding.all12],onClick:q,children:j.jsx(d("WAWebText_DONOTUSE.react").Text,{as:"span",size:"14",weight:"medium",children:g})}):null;return j.jsxs(j.Fragment,{children:[j.jsxs("div",babelHelpers["extends"]({},i.props(d("WAWebUISpacing").uiPadding.horiz24,d("WAWebUISpacing").uiPadding.top12,f&&d("WAWebUISpacing").uiPadding.bottom16),{children:[l,a,f]})),h]})}a.displayName=a.name+" [from "+f.id+"]";function b(a){a=a.items;return j.jsx("ul",babelHelpers["extends"]({},(i||(i=c("stylex"))).props(k.list,d("WAWebUISpacing").uiMargin.start24),{children:a.map(function(a,b){return j.jsx("li",babelHelpers["extends"]({className:"xo7wnuk xbo2z39 x1hmns74"},{children:a}),b)})}))}b.displayName=b.name+" [from "+f.id+"]";g.MessageCommunityCard=a;g.BulletedList=b}),98); __d("WAWebMessageCommunityLinkGroup.react",["fbt","WAWebFormatParticipantNames","WAWebGroupMetadataCollection","WAWebMessageCommunityCard.react","WAWebUserPrefsMeUser","react"],(function(a,b,c,d,e,f,g,h){var i,j=i||c("react");function a(a){var b,e,f=a.templateParams,g=a.clickable,i=a.author;a=a.chat;var l=f[0],m=c("WAWebGroupMetadataCollection").get(l);m=m==null?void 0:m.participants.iAmAdmin();b=(b=a.groupMetadata)==null?void 0:b.membershipApprovalMode;e=(e=a.groupMetadata)==null?void 0:e.hiddenSubgroup;e===!0?e=h._(/*BTDS*/"__JHASH__u4W_J7UHaNA__JHASH__"):b===!0?e=h._(/*BTDS*/"__JHASH__wKEeCtYBzvJ__JHASH__"):e=h._(/*BTDS*/"__JHASH__4YYaut4Mr8K__JHASH__");b=[h._(/*BTDS*/"__JHASH__YLgPn3TAKk-__JHASH__"),e,h._(/*BTDS*/"__JHASH__Ff13Rs_k_Si__JHASH__")];e=[h._(/*BTDS*/"__JHASH__RC7QOFhIGaU__JHASH__"),e];var n=m===!0?h._(/*BTDS*/"__JHASH__lRPx9CnFwho__JHASH__"):h._(/*BTDS*/"__JHASH__NX3VVlswriZ__JHASH__");return j.jsx(d("WAWebMessageCommunityCard.react").MessageCommunityCard,{communityId:l,subgroupId:a.id,title:k({templateParams:f,clickable:g,author:i}),body:j.jsx(d("WAWebMessageCommunityCard.react").BulletedList,{items:m===!0?e:b}),footer:n,openNavigation:!m})}a.displayName=a.name+" [from "+f.id+"]";function k(a){var b=a.templateParams,c=a.clickable;a=a.author;var e=a?d("WAWebFormatParticipantNames").getFormattedName(a,c):null;c=d("WAWebFormatParticipantNames").getFormattedCommunityNameWithAlternative({jid:b[0],asString:!c,alternativeStringName:b[1]});b=Boolean(!c);a=d("WAWebUserPrefsMeUser").isMeAccount(a);if(!b)return a?h._(/*BTDS*/"__JHASH__lJ8kQW-fXTb__JHASH__",[h._param("community",c)]):e!=null?h._(/*BTDS*/"__JHASH__rvf8u1jwrNE__JHASH__",[h._param("author",e),h._param("community",c)]):h._(/*BTDS*/"__JHASH__dDe27rByDp4__JHASH__",[h._param("community",c)]);return a?h._(/*BTDS*/"__JHASH__zzXfF03-Qsf__JHASH__"):e!=null?h._(/*BTDS*/"__JHASH__R_yqB4sONTV__JHASH__",[h._param("author",e)]):h._(/*BTDS*/"__JHASH__77l7pNVbILb__JHASH__")}g.MessageCommunityLinkGroup=a;g.communityLinkGroupTitle=k}),226); __d("WAWebMessageCommunitySubgroupWelcome.react",["fbt","WAWebFormatParticipantNames","WAWebMessageCommunityCard.react","react"],(function(a,b,c,d,e,f,g,h){var i,j=i||c("react");function a(a){var b=a.templateParams,c=a.clickable,e=a.author;a=a.chat;var f=b[0],g=[h._(/*BTDS*/"__JHASH__K9IIZxjFKng__JHASH__"),h._(/*BTDS*/"__JHASH__fQie1zs5vBy__JHASH__")],i=h._(/*BTDS*/"__JHASH__dPRZGC0imB0__JHASH__");return j.jsx(d("WAWebMessageCommunityCard.react").MessageCommunityCard,{communityId:f,subgroupId:a.id,title:k({templateParams:b,clickable:c,author:e}),body:j.jsx(d("WAWebMessageCommunityCard.react").BulletedList,{items:g}),footer:i,openNavigation:!0})}a.displayName=a.name+" [from "+f.id+"]";function k(a){var b=a.templateParams,c=a.clickable;a=a.author;a=a?d("WAWebFormatParticipantNames").getFormattedName(a,c):null;c=d("WAWebFormatParticipantNames").getFormattedCommunityNameWithAlternative({jid:b[0],asString:!c,alternativeStringName:b[1]});b=Boolean(!c);return!b?a!=null?h._(/*BTDS*/"__JHASH__7y4M-hzXFaN__JHASH__",[h._param("user_name",a),h._param("community",c)]):h._(/*BTDS*/"__JHASH__06Mw6d2V3jH__JHASH__",[h._param("community",c)]):a!=null?h._(/*BTDS*/"__JHASH__WFB2V8dn73F__JHASH__",[h._param("user_name",a)]):h._(/*BTDS*/"__JHASH__odOGz_1GOLk__JHASH__")}g.MessageCommunitySubgroupWelcome=a;g.communitySubgroupWelcomeTitle=k}),226); __d("WAWebMessageCommunityWelcomeAdmin.react",["fbt","WAWebFormatLinkNotification","WAWebGroupMetadataCollection","WAWebMessageCommunityCard.react","WAWebUISpacing","WAWebUserPrefsMeUser","WAWebWid","WAWebWidFactory","react","stylex"],(function(a,b,c,d,e,f,g,h){var i,j,k=i||c("react");function a(a){var b=a.templateParams,e=a.chat;a=a.author;var f=b[0]instanceof c("WAWebWid")?b[0]:d("WAWebWidFactory").createWid(b[0]),g=c("WAWebGroupMetadataCollection").get(f);(g==null?void 0:g.parentGroup)&&(f=g.parentGroup);g=d("WAWebUserPrefsMeUser").isMeAccount((g=e.groupMetadata)==null?void 0:g.owner);if(!g)return k.jsx("div",babelHelpers["extends"]({},(j||(j=c("stylex"))).props(d("WAWebUISpacing").uiPadding.horiz12,d("WAWebUISpacing").uiPadding.top5,d("WAWebUISpacing").uiPadding.bottom6),{children:d("WAWebFormatLinkNotification").formatLinkNotification("community_create",a,null,b,!0)}));g=k.jsx("div",babelHelpers["extends"]({},(j||(j=c("stylex"))).props(d("WAWebUISpacing").uiPadding.horiz10),{children:h._(/*BTDS*/"__JHASH__tGl1autT1_4__JHASH__")}));var i=h._(/*BTDS*/"__JHASH__ZfdfswZuohB__JHASH__");return k.jsx(d("WAWebMessageCommunityCard.react").MessageCommunityCard,{communityId:f,subgroupId:e.id,title:l({templateParams:b,chat:e,author:a}),subtitle:g,footer:i})}a.displayName=a.name+" [from "+f.id+"]";function l(a){var b=a.templateParams,c=a.chat;a=a.author;c=d("WAWebUserPrefsMeUser").isMeAccount((c=c.groupMetadata)==null?void 0:c.owner);return!c?d("WAWebFormatLinkNotification").formatLinkNotifAsFbt("community_create",a,null,b):h._(/*BTDS*/"__JHASH__-YcE06gfnUI__JHASH__")}l.displayName=l.name+" [from "+f.id+"]";g.MessageCommunityWelcomeAdmin=a;g.communityWelcomeAdminTitle=l}),226); __d("WAWebMessageCommunityWelcomeMember.react",["fbt","WAWebFormatParticipantNames","WAWebMessageCommunityCard.react","react"],(function(a,b,c,d,e,f,g,h){var i,j=i||c("react");function a(a){var b=a.templateParams,c=a.clickable,e=a.author;a=a.chat;b=b[0];e=e?d("WAWebFormatParticipantNames").getFormattedName(e,c):null;c=[j.jsx(j.Fragment,{children:e==null||e===""?h._(/*BTDS*/"__JHASH__MPVn9flpZsh__JHASH__"):h._(/*BTDS*/"__JHASH__ibt7WXNQt5C__JHASH__",[h._param("author",e)])}),h._(/*BTDS*/"__JHASH__0OEhITglM34__JHASH__")];e=h._(/*BTDS*/"__JHASH__tlcmxWFOsfg__JHASH__");return j.jsx(d("WAWebMessageCommunityCard.react").MessageCommunityCard,{communityId:b,subgroupId:a.id,title:k(),body:j.jsx(d("WAWebMessageCommunityCard.react").BulletedList,{items:c}),footer:e})}a.displayName=a.name+" [from "+f.id+"]";function k(){return h._(/*BTDS*/"__JHASH__xo6lb8SJnjj__JHASH__")}k.displayName=k.name+" [from "+f.id+"]";g.MessageCommunityWelcomeMember=a;g.communityWelcomeMemberTitle=k}),226); __d("WAWebBizGetCustomUrlUserGraphqlQuery.graphql",[],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"data"}],b=[{alias:null,args:[{kind:"Variable",name:"data",variableName:"data"}],concreteType:"WAWebBizGetCustomUrlUserGraphqlQueryResponse",kind:"LinkedField",name:"xwa_custom_url_get_user",plural:!1,selections:[{alias:null,args:null,concreteType:"boolean",kind:"ScalarField",name:"success",plural:!1,storageKey:null},{alias:null,args:null,concreteType:"WAWebBizGetCustomUrlUser",kind:"LinkedField",name:"user",plural:!1,selections:[{alias:null,args:null,concreteType:"string",name:"jid",kind:"ScalarField",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"number",kind:"ScalarField",name:"error_code",plural:!1,storageKey:null},{alias:null,args:null,concreteType:"string",kind:"ScalarField",name:"error_text",plural:!1,storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"WAWebBizGetCustomUrlUserGraphqlQuery",selections:b,type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"WAWebBizGetCustomUrlUserGraphqlQuery",selections:b},params:{id:"WAWebBizGetCustomUrlUserGraphqlQuery",metadata:{},name:"WAWebBizGetCustomUrlUserGraphqlQuery",operationKind:"query",text:null}}}();b=a;f["default"]=b}),66); __d("WAWebBizGetCustomUrlUserGraphql",["WAWebBizGetCustomUrlUserGraphqlQuery.graphql","WAWebGraphQLServerError","WAWebRelayClient","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;a=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){return d("WAWebRelayClient").fetchQuery(h!==void 0?h:h=b("WAWebBizGetCustomUrlUserGraphqlQuery.graphql"),{data:{custom_url:{path:a}}}).then(i)["catch"](function(a){if(a instanceof d("WAWebGraphQLServerError").GraphQLServerError){var b;return{type:"graphql-error",errorCode:(b=(b=a.source)==null?void 0:b.errors[0].code)!=null?b:0,errorText:(a=(b=a.source)==null?void 0:b.errors[0].message)!=null?a:""}}return{type:"graphql-error",errorCode:0,errorText:"unknown error"}})});return function(b){return a.apply(this,arguments)}}();function i(a){var b;if(!(a==null?void 0:(b=a.xwa_custom_url_get_user)==null?void 0:b.success)===!0){var c;b=a==null?void 0:(b=a.xwa_custom_url_get_user)==null?void 0:b.error_code;c=a==null?void 0:(c=a.xwa_custom_url_get_user)==null?void 0:c.error_text;return{type:"error",errorCode:j(b),errorText:(b=c)!=null?b:""}}a=a==null?void 0:(c=a.xwa_custom_url_get_user)==null?void 0:(b=c.user)==null?void 0:b.jid;return a==null||a===""?{type:"error",errorCode:500,errorText:"null or missing userJid"}:{type:"success",user:{jid:a}}}function j(a){switch(a){case"CODE_404":return 404;case"CODE_400":return 400;case"CODE_403":return 403;case"CODE_500":return 500;default:return 0}}g.queryCustomUrlUser=a;g.parseResponse=i}),98); __d("WAWebBizGetCustomUserJob",["WADeprecatedSendIq","WADeprecatedWapParser","WAWap","WAWapDeprecatedSmaxID","WAWebBackendErrors","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h=new(c("WADeprecatedWapParser"))("customURLResponse",function(a){a.assertTag("iq");a.assertFromServer();a=a.child("user");a=a.attrUserJid("jid");return{user:{jid:a}}});function a(a){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b;b=(b=d("WAWap")).wap("iq",{smax_id:b.SMAX_ID(c("WAWapDeprecatedSmaxID").BtmCustomUrlGetUser),xmlns:"fb:thrift_iq",type:"get",to:b.S_WHATSAPP_NET,id:b.generateId()},b.wap("custom_url",null,b.wap("path",null,a)));a=(yield d("WADeprecatedSendIq").deprecatedSendIq(b,h));if(!a.success)throw new(d("WAWebBackendErrors").ServerStatusCodeError)(a.errorCode,a.errorText);return a.result});return i.apply(this,arguments)}g.getUserByCustomURL=a}),98); __d("WAWebBizGetWidFromPathCustomUrlAction",["WALogger","WAWebBackendErrors","WAWebBizGatingUtils","WAWebBizGetCustomUrlUserGraphql","WAWebBizGetCustomUserJob","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[custom-url] Error fetching user by custom url "," ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[custom-url] Error fetching user by custom url ",""]);i=function(){return a};return a}function a(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b;if(d("WAWebBizGatingUtils").isGetCustomUrlUserGraphqlMigrationEnabled()){var c=(yield k(a));c!=null&&(b=d("WAWebWidFactory").createUserWid(c))}else try{c=(yield d("WAWebBizGetCustomUserJob").getUserByCustomURL(a));b=d("WAWebWidFactory").createUserWid(c.user.jid)}catch(a){if(a instanceof d("WAWebBackendErrors").ServerStatusCodeError){a.statusCode!==404&&d("WALogger").ERROR(i(),a.message).sendLogs("get-user-by-custom-url-error");return null}throw a}return b});return j.apply(this,arguments)}function k(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebBizGetCustomUrlUserGraphql").queryCustomUrlUser(a));if(a.type==="error"){a.errorCode!==404&&d("WALogger").ERROR(h(),a.errorCode,a.errorText).sendLogs("get-user-by-custom-url-graphql-error");return null}return(a=a.user)==null?void 0:a.jid});return l.apply(this,arguments)}g.getWidfromPath=a}),98); __d("WAWebVelocityTransitionGroup",["WAWebClassnames","WAWebVelocityTransition","react","react-transition-group","stylex"],(function(a,b,c,d,e,f,g){var h,i,j,k=j||c("react"),l=(h||(h=d("react"))).Children;function a(a){var b=a.ref;a=babelHelpers.objectWithoutPropertiesLoose(a,["ref"]);var e=l.toArray(a.children),f=a.transitionName,g=f===void 0?"default":f,h=a.delay,j=a.onAnimationComplete;f=a.component;f=f===void 0?"span":f;var m=a.testid;m=a.appear;var n=a.enter,o=a.exit,p=a.displayName,q=a.xstyle;a=a.className_DONOTUSE;return k.jsx(f,{ref:b,className:d("WAWebClassnames").classnamesConvertMeToStylexPlease(a,(i||(i=c("stylex")))(q)),"data-testid":void 0,children:k.jsx(d("react-transition-group").TransitionGroup,{component:null,appear:m,enter:n,exit:o,children:e==null?void 0:e.map(function(a){return k.jsx(d("WAWebVelocityTransition").VelocityTransition,{transitionName:g,delay:h,onAnimationComplete:j,displayName:p,children:a},a.key)})})})}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),98); __d("useWAWebFlow",["$InternalEnum","WANullthrows","WAWebUimUie.react","WAWebVelocityTransitionGroup","react","useWAWebStableCallback","useWAWebUIM"],(function(a,b,c,d,e,f,g){var h,i;e=i||d("react");var j=h||(h=c("react")),k=e.useCallback,l=e.useEffect,m=e.useMemo,n=e.useReducer,o=e.useRef,p={container:{height:"x5yr21d",start:"x17qophe",left:null,right:null,overflowX:"x6ikm8r",overflowY:"x10wlt62",position:"x10l6tqk",top:"x13vifvy",width:"xh8yej3",$$css:!0}};function q(){function a(a){var b=a.ref,e=babelHelpers.objectWithoutPropertiesLoose(a,["ref"]);a=e.flow;var f=e.children,g=e.displayName;g=g===void 0?"FlowDrawer":g;var h=a.pop,i=a.transition;a=a.activeKey;if(f==null)return null;var k=function(){e.requestFocus&&e.requestFocus()},l=function(a){e.requestDismiss?e.requestDismiss(a):h()};return j.jsx(c("WAWebVelocityTransitionGroup"),{ref:b,transitionName:i,xstyle:p.container,displayName:g+"-"+a,children:j.jsx(d("WAWebUimUie.react").UIE,{displayName:g+"-"+a,escapable:!0,requestFocus:k,requestDismiss:l,children:f},a)})}a.displayName=a.name+" [from "+f.id+"]";return a}var r=b("$InternalEnum").Mirrored(["DrawerLeft","DrawerRight","Modal","None"]);function s(a){var b=a.initialStep;a=a.initialTransition;return{stack:b!=null?[b]:[],previousStep:null,transition:a,activeKey:1,ended:!1,isPushed:!0}}function t(a,b){var c;switch(b.type){case"transition":return babelHelpers["extends"]({},a,{transition:(c=(c=b.payload)==null?void 0:c.transition)!=null?c:a.transition});case"push":return((c=b.payload)==null?void 0:c.step)==null?a:babelHelpers["extends"]({},a,{previousStep:a.stack[a.stack.length-1],stack:a.stack.concat(b.payload.step),activeKey:a.activeKey+1,ended:!1,isPushed:!0});case"pop":c=a.stack.slice(0,-1);return c.length>=1?babelHelpers["extends"]({},a,{previousStep:a.stack[a.stack.length-1],stack:c,activeKey:a.activeKey-1,isPushed:!1}):!a.ended?babelHelpers["extends"]({},a,{ended:!0}):a;default:return a}}function a(a,b){var d=c("useWAWebUIM")();b=b||{};var e=b.transitions;e=e===void 0?r.None:e;var f=b.onEnd;b=u(e);var g=b.pushTransition,h=b.popTransition;e=n(t,{initialStep:a,initialTransition:g},s);var i=e[0],j=e[1],p=o(null),v=k(function(a){j({type:"transition",payload:{transition:a}})},[]);b=k(function(a,b){b===void 0&&(b=g);v(b);var c=p.current;p.current=function(){c==null?void 0:c(),j({type:"push",payload:{step:a}})}},[g,v]);a=k(function(a){a===void 0&&(a=h),v(a),p.current=function(){return j({type:"pop"})}},[h,v]);l(function(){p.current!=null&&(p.current(),p.current=null)});var w=c("useWAWebStableCallback")(function(a){f?f(a):c("WANullthrows")(d).requestDismiss(a)});e=c("useWAWebStableCallback")(function(){return i.stack.length});l(function(){i.ended&&w()},[w,i.ended]);var x=m(function(){return q()},[]);b={push:b,pop:a,end:w,stackSize:e,step:i.stack[i.stack.length-1],previousStep:i.previousStep,transition:i.transition,activeKey:i.activeKey,isPushed:i.isPushed};return[x,b]}function u(a){switch(a){case r.DrawerLeft:return{pushTransition:"flow-transition-drawer-pop",popTransition:"flow-transition-drawer-push"};case r.DrawerRight:return{pushTransition:"flow-transition-drawer-push",popTransition:"flow-transition-drawer-pop"};case r.Modal:return{pushTransition:"flow-transition-modal-push",popTransition:"flow-transition-modal-pop"};case r.None:return{pushTransition:"none",popTransition:"none"}}}g.FlowTransitions=r;g.useFlow=a}),98); __d("WAWebOpenChatFlow.react",["fbt","$InternalEnum","WAAbortError","WALogger","WAPromiseDelays","WATimeUtils","WAWebBizGetWidFromPathCustomUrlAction","WAWebBotProfileCollection","WAWebCmd","WAWebComposeBoxActions","WAWebConfirmPopup.react","WAWebExternalLink.react","WAWebFbtCommon","WAWebFindChatAction","WAWebFlex.react","WAWebLinkify","WAWebNoop","WAWebQueryExistsJob","WAWebSpinner.react","WAWebUserPrefsMeUser","asyncToGeneratorRuntime","err","react","useWAWebFlow"],(function(a,b,c,d,e,f,g,h){var i,j;function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["OpenChatFlow chatWid couldn't be created from provided props."]);k=function(){return a};return a}var l=j||d("react"),m=i||(i=c("react")),n=l.useEffect,o=l.useRef,p=250,q=500,r=new Map();function a(){r.clear()}function s(a){return t.apply(this,arguments)}function t(){t=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!a.isUser())return a;var b=r.get(a.user);if(b)return b;b=(yield d("WAWebQueryExistsJob").queryWidExists(a));b=b==null?a:b.wid;r.set(a.user,b);return b});return t.apply(this,arguments)}var u=b("$InternalEnum").Mirrored(["Confirm","Error"]);function e(a){var e=d("useWAWebFlow").useFlow(),f=e[0],g=e[1],i=o(),j=function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var b=a.targetId,c=a.customURL;if(b!=null)return b;if(c!=null){var e=(yield d("WAWebBizGetWidFromPathCustomUrlAction").getWidfromPath(c));return e}d("WALogger").ERROR(k()).devConsole({targetId:b,customURL:c})});return function(){return c.apply(this,arguments)}}(),l=function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){var c=a.msgText,e=a.ctwaContextLinkData,f=a.clearPreviousText;f=f===void 0?!1:f;if(e){var g=d("WAWebLinkify").findLink(e.sourceUrl||"",!1,d("WAWebUserPrefsMeUser").getMaybeMeUser());g=(g==null?void 0:g.suspiciousCharacters)!=null&&g.suspiciousCharacters.size>0;g&&(e=void 0)}e&&(c=e.icebreaker);b.active&&c!=null&&c!==""?(f&&d("WAWebComposeBoxActions").ComposeBoxActions.setTextContent(b,""),d("WAWebComposeBoxActions").ComposeBoxActions.paste(b,c),e&&d("WAWebComposeBoxActions").ComposeBoxActions.setCtwaContextLinkData(b,e)):(f&&b.setComposeContents({text:""}),c!=null&&c!==""&&b.setComposeContents({text:c,timestamp:d("WATimeUtils").unixTime()}),yield d("WAWebCmd").Cmd.openChatFromUnread(b).then(function(a){a&&(d("WAWebComposeBoxActions").ComposeBoxActions.focus(b),e&&d("WAWebComposeBoxActions").ComposeBoxActions.setCtwaContextLinkData(b,e))}));a.sendLogAttributes!=null&&d("WAWebComposeBoxActions").ComposeBoxActions.addMsgSendingLogAttributes(b,a.sendLogAttributes)});return function(a){return c.apply(this,arguments)}}(),r=function(){g.push(u.Error)};e=function(){var a;(a=i.current)==null?void 0:a.controller.abort();i.current=void 0;g.end()};n(function(){var e=function(){var e=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=!1,f=new AbortController();d("WAPromiseDelays").delayMs(p).then(function(){if(f.signal.aborted)throw new(d("WAAbortError").AbortError)();e=!0;g.push(u.Confirm)})["catch"](d("WAAbortError").catchAbort(c("WAWebNoop")));var h=Date.now(),k=new AbortController(),m=k.signal,n=(yield j());if(n==null){var o=a.fallbackURL;o!=null&&d("WAWebExternalLink.react").openExternalLink(o);g.end();return}o=s(n).then(function(a){var b;b=(b=d("WAWebBotProfileCollection").BotProfileCollection.getDefaultBot())==null?void 0:b.id;if(a.isBot()&&(b==null||!b.equals(a)))throw c("err")("invalid bot chat");return d("WAWebFindChatAction").findOrCreateLatestChat(a,"debugOpenChatFlow",{forceUsync:!0})}).then(function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){if(m.aborted)throw new(d("WAAbortError").AbortError)();e||f.abort();var c=Date.now()-h;c=e?Math.max(q+p-c,0):0;yield l(b.chat);yield d("WAPromiseDelays").delayMs(c);g.end();a.onSuccess(b)});return function(a){return c.apply(this,arguments)}}())["catch"](d("WAAbortError").catchAbort(c("WAWebNoop")))["catch"](function(b){f.abort(),a.onError==null?void 0:a.onError(b),r()});i.current={controller:k,promise:o}});return function(){return e.apply(this,arguments)}}();e()["catch"](c("WAWebNoop"))},[]);if(g.step==null)return null;var t=null;switch(g.step){case u.Confirm:t=m.jsx(d("WAWebConfirmPopup.react").ConfirmPopup,{title:h._(/*BTDS*/"__JHASH__1bODDxe_PHW__JHASH__"),onCancel:e,cancelText:h._(/*BTDS*/"__JHASH__JomY4EcHzcJ__JHASH__"),children:m.jsx(d("WAWebFlex.react").FlexRow,{justify:"center",align:"center",children:m.jsx(d("WAWebSpinner.react").Spinner,{stroke:6,size:24})})});break;case u.Error:a.customError!=null?t=a.customError:t=m.jsx(d("WAWebConfirmPopup.react").ConfirmPopup,{onOK:function(){return g.end()},okText:c("WAWebFbtCommon")("OK"),children:h._(/*BTDS*/"__JHASH__9QVtpa6tgpD__JHASH__")});break}return m.jsx(f,{flow:g,children:t})}e.displayName=e.name+" [from "+f.id+"]";g.clearChatIdCorrectionCache=a;g.OpenChatFlow=e}),226); __d("WAWebExtractRangeFromMatch",[],(function(a,b,c,d,e,f){function a(a,b){b===void 0&&(b=0);var c=a.index,d=a[0],e=c+d.length-1;e=[c,c,e,e,a];if(b){b=(a=a[b])!=null?a:"";e[1]=c+d.indexOf(b);e[2]=e[1]+b.length-1}return e}f["default"]=a}),66); __d("WAWebExtractRangesUsingRegex",["WAWebExtractRangeFromMatch"],(function(a,b,c,d,e,f,g){function a(a,b,d,e){d===void 0&&(d=0);var f=[];b.lastIndex=0;var g;while((g=b.exec(a))&&b.lastIndex>0)e&&(g=e(g,b)),g&&f.push(c("WAWebExtractRangeFromMatch")(g,d));return f}g["default"]=a}),98); __d("WAWebFormatMutator",["err"],(function(a,b,c,d,e,f,g){a=function(){function a(){}a.match=function(a,b,d){throw c("err")("Subclasses of `Mutator` must override `match()`")};a.mutate=function(a,b,c){return a};return a}();a.nestable=function(){return!0};a.format=!0;a.fragment=!1;a.compatibility=!1;a.mutates=!1;g["default"]=a}),98); __d("WAWebCreateRegexMutator",["WAWebExtractRangesUsingRegex","WAWebFormatMutator"],(function(a,b,c,d,e,f,g){function a(a,b,d){b===void 0&&(b=0);return function(e){babelHelpers.inheritsLoose(f,e);function f(){return e.apply(this,arguments)||this}f.match=function(e){return c("WAWebExtractRangesUsingRegex")(e,a,b,d)};return f}(c("WAWebFormatMutator"))}g["default"]=a}),98); __d("WAWebBlockQuoteFormatMutator",["WAWebBlockQuoteMutatorComponent.react","WAWebCreateRegexMutator","react"],(function(a,b,c,d,e,f,g){var h,i=h||c("react");a=/(?:^)\>(\s(?! +)[^\n]+(?:$)(?:\n|$))/gm;b=/(?:^)\>(\s(?! +)[^\n]*(?:$)(?:\n|$))/gm;d=c("WAWebCreateRegexMutator")(a,1);e=c("WAWebCreateRegexMutator")(b,1);f=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}b.jsx=function(a,b,d){var e=d.selectable;e=e===void 0?!1:e;var f=d.inline;f=f===void 0?!1:f;d=d.quoted;d=d===void 0?!1:d;b=b[1];return i.jsx(c("WAWebBlockQuoteMutatorComponent.react"),{selectable:e,inline:f,text:b,quoted:d,children:a})};return b}(d);f.unformatDecorations={pre:">"};a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}return b}(e);g.BlockQuote=f;g.BlockQuoteWithEmpty=a}),98); __d("WAWebAdjustDelimitedRange",[],(function(a,b,c,d,e,f){function a(a){return function(b,c){var d=2*a.length+b[1].length;d=b[0].length-d;d>0&&(b.index+=d,b[0]=b[0].slice(d));c.lastIndex--;return b}}f["default"]=a}),66); __d("WAWebBoldFormatRegex",[],(function(a,b,c,d,e,f){a=/(?:^|(?:[\t-\r -\/:-@\[-`\{-~\xA0-\xA9\xAB-\xB1\xB4\xB6-\xB8\xBB\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u037E\u0384\u0385\u0387\u03F6\u0482\u055A-\u055F\u0589\u058A\u058D-\u058F\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0600-\u060F\u061B\u061C\u061E\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070D\u070F\u07F6-\u07F9\u07FE\u07FF\u0830-\u083E\u085E\u08E2\u0964\u0965\u0970\u09F2\u09F3\u09FA\u09FB\u09FD\u0A76\u0AF0\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0C84\u0D4F\u0D79\u0DF4\u0E3F\u0E4F\u0E5A\u0E5B\u0F01-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F85\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u104A-\u104F\u109E\u109F\u10FB\u1360-\u1368\u1390-\u1399\u1400\u166D\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DB\u1800-\u180A\u180E\u1940\u1944\u1945\u19DE-\u19FF\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B6A\u1B74-\u1B7C\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2000-\u2064\u2066-\u206F\u207A-\u207E\u208A-\u208E\u20A0-\u20BF\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2775\u2794-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2CE5-\u2CEA\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3000-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u303F\u309B\u309C\u30A0\u30FB\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAA77-\uAA79\uAADE\uAADF\uAAF0\uAAF1\uAB5B\uABEB\uFB29\uFBB2-\uFBC1\uFD3E\uFD3F\uFDFC\uFDFD\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD]|\uD800[\uDD00-\uDD02\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDC77\uDC78\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEC8\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB-\uDCC1\uDCCD\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3F]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3F\uDF44\uDF45]|\uD81B[\uDE97-\uDE9A]|\uD82F[\uDC9C\uDC9F-\uDCA3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE8B]|\uD83A[\uDD5E\uDD5F]|\uD83B[\uDCAC\uDCB0\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]|\uDB40[\uDC01\uDC20-\uDC7F]))\*(?![\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]|\u20E3|\uFE0F\u20E3)((?:[\0-\t\x0B-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]))\*(?=$|(?!\u20E3|\uFE0F\u20E3))(?=$|(?:[\t-\r -\/:-@\[-`\{-~\xA0-\xA9\xAB-\xB1\xB4\xB6-\xB8\xBB\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u037E\u0384\u0385\u0387\u03F6\u0482\u055A-\u055F\u0589\u058A\u058D-\u058F\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0600-\u060F\u061B\u061C\u061E\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070D\u070F\u07F6-\u07F9\u07FE\u07FF\u0830-\u083E\u085E\u08E2\u0964\u0965\u0970\u09F2\u09F3\u09FA\u09FB\u09FD\u0A76\u0AF0\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0C84\u0D4F\u0D79\u0DF4\u0E3F\u0E4F\u0E5A\u0E5B\u0F01-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F85\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u104A-\u104F\u109E\u109F\u10FB\u1360-\u1368\u1390-\u1399\u1400\u166D\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DB\u1800-\u180A\u180E\u1940\u1944\u1945\u19DE-\u19FF\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B6A\u1B74-\u1B7C\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2000-\u2064\u2066-\u206F\u207A-\u207E\u208A-\u208E\u20A0-\u20BF\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2775\u2794-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2CE5-\u2CEA\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3000-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u303F\u309B\u309C\u30A0\u30FB\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAA77-\uAA79\uAADE\uAADF\uAAF0\uAAF1\uAB5B\uABEB\uFB29\uFBB2-\uFBC1\uFD3E\uFD3F\uFDFC\uFDFD\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD]|\uD800[\uDD00-\uDD02\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDC77\uDC78\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEC8\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB-\uDCC1\uDCCD\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3F]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3F\uDF44\uDF45]|\uD81B[\uDE97-\uDE9A]|\uD82F[\uDC9C\uDC9F-\uDCA3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE8B]|\uD83A[\uDD5E\uDD5F]|\uD83B[\uDCAC\uDCB0\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]|\uDB40[\uDC01\uDC20-\uDC7F]))/g;b=a;f["default"]=b}),66); __d("WAWebBoldMutatorComponent.react",["WAWebCopyPasteSelectable.react","react"],(function(a,b,c,d,e,f,g){var h,i=h||c("react");function a(a){var b=a.children;b=b===void 0?"":b;a=a.selectable;return i.jsx(d("WAWebCopyPasteSelectable.react").SelectableStrong,{selectable:a,appTextTemplate:"*${appText}*",children:b})}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),98); __d("WAWebBoldFormatMutator",["WAWebAdjustDelimitedRange","WAWebBoldFormatRegex","WAWebBoldMutatorComponent.react","WAWebCreateRegexMutator","react"],(function(a,b,c,d,e,f,g){var h,i=h||c("react");a=c("WAWebAdjustDelimitedRange")("*");b=c("WAWebCreateRegexMutator")(c("WAWebBoldFormatRegex"),1,a);d=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}b.jsx=function(a,b,d){b=d.selectable;d=b===void 0?!1:b;return i.jsx(c("WAWebBoldMutatorComponent.react"),{selectable:d,children:a})};return b}(b);g["default"]=d}),98); __d("WAWebClickable.react",["$InternalEnum","WAWebClassnames","WAWebKeyboardIsKeyActivation","WAWebUseIsKeyboardUser","WDSFocusStateStyles","react","stylex","useMergeRefs"],(function(a,b,c,d,e,f,g){var h,i,j,k=j||c("react"),l=(h||(h=d("react"))).useRef,m=b("$InternalEnum").Mirrored(["Default","Image"]),n={imageFocus:{":focus_filter":"x1cm50aa",$$css:!0}};function a(a){var b=a.ref;a=babelHelpers.objectWithoutPropertiesLoose(a,["ref"]);var e=a.as;e=e===void 0?"div":e;var f=a.onClick,g=a.dataTestId;g=a.className;var h=a.children,j=a.inlineStyle,o=a.preventDefaultKeyboard,p=o===void 0?!1:o;o=a.xstyle;e=e;var q=c("WAWebUseIsKeyboardUser")();q=q.isKeyboardUser;var r=l(null);b=c("useMergeRefs")(b,r);var s=function(a){if(c("WAWebKeyboardIsKeyActivation")(a)&&f){var b;(b=r.current)==null?void 0:b.click();p&&a.preventDefault()}},t,u,v,w,x,y;if(f){var z;t=(z=a.role)!=null?z:"button";u=a.ariaLabel;v=(z=a.tabIndex)!=null?z:0;w=(z=a.focusTheme)!=null?z:m.Default;x=a.title;y=a["data-tab"]}return k.jsx(e,{onClick:f,role:t,tabIndex:v,"data-testid":void 0,"aria-label":u,title:x,"data-tab":y,ref:b,className:d("WAWebClassnames").classnamesConvertMeToStylexPlease(g,(i||(i=c("stylex")))(o,q&&m.Default===w&&d("WDSFocusStateStyles").WDSFocusStateStyles.genericFocus,q&&m.Image===w&&n.imageFocus)),onKeyDown:s,style:j,children:h})}a.displayName=a.name+" [from "+f.id+"]";e=a;g.FocusTheme=m;g.Clickable=e}),98); __d("WAWebBotCommandMutatorComponent.react",["WAWebClickable.react","WAWebComposeBoxActions","react"],(function(a,b,c,d,e,f,g){var h,i=h||c("react"),j={link:{color:"x1a06ls3",$$css:!0}};function a(a){a=a.children;var b=a===void 0?"":a;a=function(){d("WAWebComposeBoxActions").ComposeBoxActions.paste(null,String(b)+" ",{insertLeadingSpace:!0})};return i.jsx(d("WAWebClickable.react").Clickable,{as:"span",xstyle:j.link,onClick:a,children:b})}a.displayName=a.name+" [from "+f.id+"]";g.BotCommandMutatorComponent=a}),98); __d("WAWebBotCommandFormatMutator",["WAWebBotCommandMutatorComponent.react","WAWebExtractRangesUsingRegex","WAWebFormatMutator","escapeRegex","react"],(function(a,b,c,d,e,f,g){var h,i=h||c("react");a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}b.match=function(a,b){b=(b=b)!=null?b:{};b=b.commands;if(!b||b.length===0)return[];b=b.map(function(a){return c("escapeRegex")("/"+a.name)});b=new RegExp("("+b.join("|")+")(?=$|\\s)","gmi");var d=!1;return c("WAWebExtractRangesUsingRegex")(a,b,0,function(a){if(d)return null;d=!0;return a})};return b}(c("WAWebFormatMutator"));a.format=!1;a.jsx=function(a,b){return i.jsx(d("WAWebBotCommandMutatorComponent.react").BotCommandMutatorComponent,{children:a})};g.BotCommand=a}),98); __d("WAWebBulletedListFormatMutator",["WAWebBulletedListMutatorComponent.react","WAWebCreateRegexMutator","react"],(function(a,b,c,d,e,f,g){var h,i=h||c("react");a=/((?:^)(?:[\*\-\•] (?! +)(?:[^\n]+)(?:\n(?:[\*\-\•] (?! +)[^\n]+)){0,})(?:\n|$))/gm;b=c("WAWebCreateRegexMutator")(a,0);d=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}b.jsx=function(a,b,d){return i.jsx(c("WAWebBulletedListMutatorComponent.react"),babelHelpers["extends"]({},d,{children:a}))};return b}(b);d.nestable=function(){return!1};g["default"]=d}),98); __d("WAWebBulletedListItemFormatMutator",["WAWebBulletedListFormatMutator","WAWebBulletedListItemMutatorComponent.react","WAWebCreateRegexMutator","react"],(function(a,b,c,d,e,f,g){var h,i=h||c("react");b=/(?:^)[\*\•]( (?! +)[^\n]+(?:$))/gm;d=/(?:^)\-( (?! +)[^\n]+(?:$))/gm;e=/(?:^)\*( (?! +)[^\n]*(?:$))/gm;f=/(?:^)\-( (?! +)[^\n]*(?:$))/gm;var j=new Set([c("WAWebBulletedListFormatMutator")]);function a(a,b){var d;a=c("WAWebCreateRegexMutator")(a,1);a=(d=a=function(a){babelHelpers.inheritsLoose(d,a);function d(){return a.apply(this,arguments)||this}d.jsx=function(a,d,e){var f=e.selectable;f=f===void 0?!1:f;e=e.inline;d=d[1];return i.jsx(c("WAWebBulletedListItemMutatorComponent.react"),{inline:e,selectable:f,text:d,symbol:b,children:a})};return d}(a),a.displayName="BulletedListItem",a.nestable=function(a){return j.has(a)},a.unformatDecorations={pre:b},d);return a}b=a(b,"*");d=a(d,"-");e=a(e,"*");a=a(f,"-");g.BulletedListItem=b;g.HyphenListItem=d;g.BulletedListItemWithEmpty=e;g.HyphenListItemWithEmpty=a}),98); __d("WAWebCodeMutatorComponent.react",["WAWebCopyPasteSelectable.react","react"],(function(a,b,c,d,e,f,g){var h,i=h||c("react");function a(a){var b=a.children;b=b===void 0?"":b;a=a.selectable;return i.jsx(d("WAWebCopyPasteSelectable.react").SelectableCode,{selectable:a,appTextTemplate:"```${appText}```",children:b})}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),98); __d("WAWebCodeFormatMutator",["WAWebCodeMutatorComponent.react","WAWebCreateRegexMutator","react"],(function(a,b,c,d,e,f,g){var h,i=h||c("react"),j=/```([\s\S]*?\S[\s\S]*?)```/g;a=c("WAWebCreateRegexMutator")(j,1);b=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}b.jsx=function(a,b,d){b=d.selectable;d=b===void 0?!1:b;return i.jsx(c("WAWebCodeMutatorComponent.react"),{selectable:d,children:a})};return b}(a);b.format=!1;d=function(a){return a.replace(j," ")};g.Code=b;g.removeCodeBlocks=d}),98); __d("WAWebEmojiMutatorComponent.react",["WAWebEmoji.react","WAWebMessageLargeEmoji.react","react","useWAWebABPropConfigValue"],(function(a,b,c,d,e,f,g){var h,i=h||c("react");function a(a){var b=a.emoji,e=a.selectable,f=a.size;a=a.xstyle;d("useWAWebABPropConfigValue").useABPropConfigValue("custom_racing_emoji");d("useWAWebABPropConfigValue").useABPropConfigValue("custom_racing_emoji_feb2025");return f==="xlarge"?i.jsx(d("WAWebMessageLargeEmoji.react").LargeEmoji,{emoji:b,xstyle:a,size:d("WAWebMessageLargeEmoji.react").SIZE.XLARGE,element:"span",selectable:e}):i.jsx(c("WAWebEmoji.react"),{emoji:b,xstyle:a,selectable:e,size:f})}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),98); __d("WAWebEmojiFormatMutator",["WAUnicodeUtils","WAWebEmoji","WAWebEmojiMutatorComponent.react","WAWebExtractRangesUsingRegex","WAWebFormatMutator","react"],(function(a,b,c,d,e,f,g){var h,i=h||c("react");a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}b.jsx=function(a,b,d){a=b[0];b=d.size;var e=d.selectable;e=e===void 0?!1:e;d=d.emojiXstyle;return i.jsx(c("WAWebEmojiMutatorComponent.react"),{emoji:a,size:b,selectable:e,xstyle:d})};b.match=function(a,b,e){b=e!=null&&e!==0?e:a.length;e=d("WAUnicodeUtils").firstNCodepoints(a,b);return c("WAWebExtractRangesUsingRegex")(e,d("WAWebEmoji").EmojiUtil.emojiRegex(),0,j)};return b}(c("WAWebFormatMutator"));a.compatibility=!0;function j(a,b){return!d("WAWebEmoji").EmojiUtil.getGlyphId(a[0])?null:a}g["default"]=a}),98); __d("WAWebHeadingFormatMutator",["$InternalEnum","WAWebBotGating","WAWebCreateRegexMutator","WAWebRichTextHeading.react","react"],(function(a,b,c,d,e,f,g){var h,i=h||c("react"),j=b("$InternalEnum")({LEVEL_1:1,LEVEL_2:2,LEVEL_3:3,LEVEL_4:4});a=/^(#{1,4})\s([^\n]+)(?:$)(?:\n|$)/gm;e=c("WAWebCreateRegexMutator")(a,2);function k(a){switch(a){case"#":return j.LEVEL_1;case"##":return j.LEVEL_2;case"###":return j.LEVEL_3;case"####":return j.LEVEL_4;default:return j.LEVEL_4}}f=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}b.jsx=function(a,b){a=b[2];b=b[1];return i.jsx(c("WAWebRichTextHeading.react"),{level:k(b),text:a})};return b}(e);var l=new Set([j.LEVEL_1,j.LEVEL_2]),m=new Set([j.LEVEL_3,j.LEVEL_4]),n=function(a){return l.has(a)},o=function(a){return m.has(a)};b=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}b.jsx=function(a,b){a=b[2];var e=k(b[1]);if(n(e)&&d("WAWebBotGating").isRichResponseHeadingReceiverEnabled())return i.jsx(c("WAWebRichTextHeading.react"),{level:e,text:a});return o(e)&&d("WAWebBotGating").isRichResponseSubheadingReceiverEnabled()?i.jsx(c("WAWebRichTextHeading.react"),{level:e,text:a}):i.jsx("span",{children:b[0]})};return b}(e);a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}b.jsx=function(a,b){a=b[2];return i.jsx("span",{children:a})};return b}(e);g.HeadingLevel=j;g.RegexMutator=e;g.Heading=f;g.AIRichResponseHeading=b;g.HeadlessHeading=a}),98); __d("WAWebRichTextHeading.react",["WAWebHeadingFormatMutator","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k={base:{display:"x1rg5ohu",width:"xh8yej3",$$css:!0},LEVEL_1:{fontSize:"x579bpy",lineHeight:"x1cpheol",marginBottom:"x12nagc",$$css:!0},LEVEL_2:{fontSize:"x1q74xe4",lineHeight:"x1vy86p0",marginBottom:"x12nagc",$$css:!0},LEVEL_3:{fontSize:"xngnso2",lineHeight:"xcgk4ki",marginBottom:"x12nagc",$$css:!0},LEVEL_4:{fontSize:"x1aueamr",lineHeight:"xgif2c7",marginBottom:"x12nagc",$$css:!0}};function l(a){switch(a){case d("WAWebHeadingFormatMutator").HeadingLevel.LEVEL_1:return[k.base,k.LEVEL_1];case d("WAWebHeadingFormatMutator").HeadingLevel.LEVEL_2:return[k.base,k.LEVEL_2];case d("WAWebHeadingFormatMutator").HeadingLevel.LEVEL_3:return[k.base,k.LEVEL_3];case d("WAWebHeadingFormatMutator").HeadingLevel.LEVEL_4:return[k.base,k.LEVEL_4]}}function a(a){var b=a.level;a=a.text;return j.jsx("span",{className:(i||(i=c("stylex")))(l(b)),children:a})}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),98); __d("WAWebHighlightMutatorComponent.react",["WAWebCopyPasteSelectable.react","react"],(function(a,b,c,d,e,f,g){var h,i=h||c("react");function a(a){var b=a.children;b=b===void 0?"":b;a=a.selectable;return i.jsx(d("WAWebCopyPasteSelectable.react").SelectableSpan,{className:"matched-text",selectable:a,children:b})}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),98); __d("WAWebHighlightFormatMutator",["WAWebExtractRangesUsingRegex","WAWebFormatMutator","WAWebHighlightMutatorComponent.react","WAWebL10N","escapeRegex","react"],(function(a,b,c,d,e,f,g){var h,i=h||c("react");a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}b.match=function(a,b){if(!b)return[];var d=b.terms,e=b.boundary;e=e===void 0?!1:e;b=b.ignoreDiacritics;b=b===void 0?!1:b;if(!d.length||d.every(function(a){return a.length===0}))return[];b=b&&c("WAWebL10N").isLatinAlphabetLanguage(a)&&d.every(function(a){return c("WAWebL10N").isLatinAlphabetLanguage(a)})&&!c("WAWebL10N").isRTL();a=b?c("WAWebL10N").removeAccents(a):a;a=c("WAWebExtractRangesUsingRegex")(a,j(d,e,b));return a};return b}(c("WAWebFormatMutator"));a.jsx=function(a,b,d){b=d.selectable;return i.jsx(c("WAWebHighlightMutatorComponent.react"),{selectable:b,children:a})};function j(a,b,d){d=d?a.map(function(a){return c("WAWebL10N").removeAccents(a)}):a;a=d.filter(function(a){return a.trim().length>0});d=a.map(c("escapeRegex")).join("|");return c("WAWebL10N").isRTL()?new RegExp((b?"(?:^|\\b)":"")+"(\\S+)?("+d+")(\\S+)?","ig"):new RegExp((b?"(?:^|\\b)":"")+"("+d+")","ig")}g["default"]=a}),98); __d("WAWebInlineCodeFormatRegex",[],(function(a,b,c,d,e,f){a=/(?:^|(?:[\t-\r -\/:-@\[-`\{-~\xA0-\xA9\xAB-\xB1\xB4\xB6-\xB8\xBB\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u037E\u0384\u0385\u0387\u03F6\u0482\u055A-\u055F\u0589\u058A\u058D-\u058F\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0600-\u060F\u061B\u061C\u061E\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070D\u070F\u07F6-\u07F9\u07FE\u07FF\u0830-\u083E\u085E\u08E2\u0964\u0965\u0970\u09F2\u09F3\u09FA\u09FB\u09FD\u0A76\u0AF0\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0C84\u0D4F\u0D79\u0DF4\u0E3F\u0E4F\u0E5A\u0E5B\u0F01-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F85\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u104A-\u104F\u109E\u109F\u10FB\u1360-\u1368\u1390-\u1399\u1400\u166D\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DB\u1800-\u180A\u180E\u1940\u1944\u1945\u19DE-\u19FF\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B6A\u1B74-\u1B7C\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2000-\u2064\u2066-\u206F\u207A-\u207E\u208A-\u208E\u20A0-\u20BF\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2775\u2794-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2CE5-\u2CEA\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3000-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u303F\u309B\u309C\u30A0\u30FB\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAA77-\uAA79\uAADE\uAADF\uAAF0\uAAF1\uAB5B\uABEB\uFB29\uFBB2-\uFBC1\uFD3E\uFD3F\uFDFC\uFDFD\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD]|\uD800[\uDD00-\uDD02\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDC77\uDC78\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEC8\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB-\uDCC1\uDCCD\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3F]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3F\uDF44\uDF45]|\uD81B[\uDE97-\uDE9A]|\uD82F[\uDC9C\uDC9F-\uDCA3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE8B]|\uD83A[\uDD5E\uDD5F]|\uD83B[\uDCAC\uDCB0\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]|\uDB40[\uDC01\uDC20-\uDC7F]))`(?![\t-\r `\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])((?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])|(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])(?:[\0-\t\x0B-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]))`(?=$|(?:[\t-\r -\/:-@\[-`\{-~\xA0-\xA9\xAB-\xB1\xB4\xB6-\xB8\xBB\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u037E\u0384\u0385\u0387\u03F6\u0482\u055A-\u055F\u0589\u058A\u058D-\u058F\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0600-\u060F\u061B\u061C\u061E\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070D\u070F\u07F6-\u07F9\u07FE\u07FF\u0830-\u083E\u085E\u08E2\u0964\u0965\u0970\u09F2\u09F3\u09FA\u09FB\u09FD\u0A76\u0AF0\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0C84\u0D4F\u0D79\u0DF4\u0E3F\u0E4F\u0E5A\u0E5B\u0F01-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F85\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u104A-\u104F\u109E\u109F\u10FB\u1360-\u1368\u1390-\u1399\u1400\u166D\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DB\u1800-\u180A\u180E\u1940\u1944\u1945\u19DE-\u19FF\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B6A\u1B74-\u1B7C\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2000-\u2064\u2066-\u206F\u207A-\u207E\u208A-\u208E\u20A0-\u20BF\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2775\u2794-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2CE5-\u2CEA\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3000-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u303F\u309B\u309C\u30A0\u30FB\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAA77-\uAA79\uAADE\uAADF\uAAF0\uAAF1\uAB5B\uABEB\uFB29\uFBB2-\uFBC1\uFD3E\uFD3F\uFDFC\uFDFD\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD]|\uD800[\uDD00-\uDD02\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDC77\uDC78\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEC8\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB-\uDCC1\uDCCD\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3F]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3F\uDF44\uDF45]|\uD81B[\uDE97-\uDE9A]|\uD82F[\uDC9C\uDC9F-\uDCA3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE8B]|\uD83A[\uDD5E\uDD5F]|\uD83B[\uDCAC\uDCB0\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]|\uDB40[\uDC01\uDC20-\uDC7F]))/g;b=a;f["default"]=b}),66); __d("WAWebInlineCodeMutatorComponent.react",["WAWebCopyPasteSelectable.react","WAWebUISpacing","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k={code:{borderTopStartRadius:"x1lcm9me",borderTopEndRadius:"x1yr5g0i",borderBottomEndRadius:"xrt01vj",borderBottomStartRadius:"x10y3i5r",backgroundColor:"x1bu39yj",color:"x1bvqhpb",$$css:!0},quotedColor:{color:"x15rks2t",$$css:!0}};function a(a){var b=a.children;b=b===void 0?"":b;var e=a.quoted;a=a.selectable;return j.jsx(d("WAWebCopyPasteSelectable.react").SelectableCode,{selectable:a,appTextTemplate:"`${appText}`",className:(i||(i=c("stylex")))(k.code,e&&k.quotedColor,d("WAWebUISpacing").uiPadding.horiz4,d("WAWebUISpacing").uiPadding.vert2),children:b})}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),98); __d("WAWebInlineCodeFormatMutator",["WAWebAdjustDelimitedRange","WAWebCreateRegexMutator","WAWebInlineCodeFormatRegex","WAWebInlineCodeMutatorComponent.react","react"],(function(a,b,c,d,e,f,g){var h,i=h||c("react");a=c("WAWebAdjustDelimitedRange")("`");b=c("WAWebCreateRegexMutator")(c("WAWebInlineCodeFormatRegex"),1,a);d=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}b.jsx=function(a,b,d){b=d.selectable;b=b===void 0?!1:b;d=d.quoted;d=d===void 0?!1:d;return i.jsx(c("WAWebInlineCodeMutatorComponent.react"),{selectable:b,quoted:d,children:a})};return b}(b);d.format=!1;g["default"]=d}),98); __d("WAWebItalicFormatRegex",[],(function(a,b,c,d,e,f){a=/(?:^|(?:[\t-\r -\/:-@\[-`\{-~\xA0-\xA9\xAB-\xB1\xB4\xB6-\xB8\xBB\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u037E\u0384\u0385\u0387\u03F6\u0482\u055A-\u055F\u0589\u058A\u058D-\u058F\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0600-\u060F\u061B\u061C\u061E\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070D\u070F\u07F6-\u07F9\u07FE\u07FF\u0830-\u083E\u085E\u08E2\u0964\u0965\u0970\u09F2\u09F3\u09FA\u09FB\u09FD\u0A76\u0AF0\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0C84\u0D4F\u0D79\u0DF4\u0E3F\u0E4F\u0E5A\u0E5B\u0F01-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F85\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u104A-\u104F\u109E\u109F\u10FB\u1360-\u1368\u1390-\u1399\u1400\u166D\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DB\u1800-\u180A\u180E\u1940\u1944\u1945\u19DE-\u19FF\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B6A\u1B74-\u1B7C\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2000-\u2064\u2066-\u206F\u207A-\u207E\u208A-\u208E\u20A0-\u20BF\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2775\u2794-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2CE5-\u2CEA\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3000-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u303F\u309B\u309C\u30A0\u30FB\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAA77-\uAA79\uAADE\uAADF\uAAF0\uAAF1\uAB5B\uABEB\uFB29\uFBB2-\uFBC1\uFD3E\uFD3F\uFDFC\uFDFD\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD]|\uD800[\uDD00-\uDD02\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDC77\uDC78\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEC8\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB-\uDCC1\uDCCD\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3F]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3F\uDF44\uDF45]|\uD81B[\uDE97-\uDE9A]|\uD82F[\uDC9C\uDC9F-\uDCA3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE8B]|\uD83A[\uDD5E\uDD5F]|\uD83B[\uDCAC\uDCB0\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]|\uDB40[\uDC01\uDC20-\uDC7F]))_((?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])|(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])(?:[\0-\t\x0B-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]))_(?=$|(?:[\t-\r -\/:-@\[-`\{-~\xA0-\xA9\xAB-\xB1\xB4\xB6-\xB8\xBB\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u037E\u0384\u0385\u0387\u03F6\u0482\u055A-\u055F\u0589\u058A\u058D-\u058F\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0600-\u060F\u061B\u061C\u061E\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070D\u070F\u07F6-\u07F9\u07FE\u07FF\u0830-\u083E\u085E\u08E2\u0964\u0965\u0970\u09F2\u09F3\u09FA\u09FB\u09FD\u0A76\u0AF0\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0C84\u0D4F\u0D79\u0DF4\u0E3F\u0E4F\u0E5A\u0E5B\u0F01-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F85\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u104A-\u104F\u109E\u109F\u10FB\u1360-\u1368\u1390-\u1399\u1400\u166D\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DB\u1800-\u180A\u180E\u1940\u1944\u1945\u19DE-\u19FF\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B6A\u1B74-\u1B7C\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2000-\u2064\u2066-\u206F\u207A-\u207E\u208A-\u208E\u20A0-\u20BF\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2775\u2794-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2CE5-\u2CEA\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3000-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u303F\u309B\u309C\u30A0\u30FB\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAA77-\uAA79\uAADE\uAADF\uAAF0\uAAF1\uAB5B\uABEB\uFB29\uFBB2-\uFBC1\uFD3E\uFD3F\uFDFC\uFDFD\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD]|\uD800[\uDD00-\uDD02\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDC77\uDC78\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEC8\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB-\uDCC1\uDCCD\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3F]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3F\uDF44\uDF45]|\uD81B[\uDE97-\uDE9A]|\uD82F[\uDC9C\uDC9F-\uDCA3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE8B]|\uD83A[\uDD5E\uDD5F]|\uD83B[\uDCAC\uDCB0\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]|\uDB40[\uDC01\uDC20-\uDC7F]))/g;b=a;f["default"]=b}),66); __d("WAWebItalicMutatorComponent.react",["WAWebCopyPasteSelectable.react","react"],(function(a,b,c,d,e,f,g){var h,i=h||c("react");function a(a){var b=a.children;b=b===void 0?"":b;a=a.selectable;return i.jsx(d("WAWebCopyPasteSelectable.react").SelectableEm,{selectable:a,appTextTemplate:"_${appText}_",children:b})}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),98); __d("WAWebItalicFormatMutator",["WAWebAdjustDelimitedRange","WAWebCreateRegexMutator","WAWebItalicFormatRegex","WAWebItalicMutatorComponent.react","react"],(function(a,b,c,d,e,f,g){var h,i=h||c("react");a=c("WAWebAdjustDelimitedRange")("_");b=c("WAWebCreateRegexMutator")(c("WAWebItalicFormatRegex"),1,a);d=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}b.jsx=function(a,b,d){b=d.selectable;d=b===void 0?!1:b;return i.jsx(c("WAWebItalicMutatorComponent.react"),{selectable:d,children:a})};return b}(b);g["default"]=d}),98); __d("WAWebNumberedListFormatMutator",["WAWebCreateRegexMutator","WAWebNumberedListMutatorComponent.react","react"],(function(a,b,c,d,e,f,g){var h,i=h||c("react");a=/((?:^)(?:(\d{1,2})\. (?! +)(?:[^\n]+)(?:\n(?:(\d{1,2})\. [^\n]+)){0,})(?:\n|$))/gm;b=c("WAWebCreateRegexMutator")(a,0);d=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}b.jsx=function(a,b,d){return i.jsx(c("WAWebNumberedListMutatorComponent.react"),babelHelpers["extends"]({},d,{children:a}))};return b}(b);d.nestable=function(){return!1};g["default"]=d}),98); __d("WAWebNumberedListItemFormatMutator",["WAWebCreateRegexMutator","WAWebNumberedListFormatMutator","WAWebNumberedListItemMutatorComponent.react","react"],(function(a,b,c,d,e,f,g){var h,i=h||c("react");b=/(?:^)(\d{1,2}\.)( (?! +)[^\n]+(?:$))/gm;d=/(?:^)(\d{1,2}\.)( (?! +)[^\n]*(?:$))/gm;var j=new Set([c("WAWebNumberedListFormatMutator")]);function a(a){var b;a=c("WAWebCreateRegexMutator")(a,2);a=(b=a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}b.jsx=function(a,b,d){var e=d.selectable;e=e===void 0?!1:e;d=d.inline;var f=b[1];b=b[2];return i.jsx(c("WAWebNumberedListItemMutatorComponent.react"),{inline:d,selectable:e,text:b,numbering:f,children:a})};return b}(a),a.displayName="NumberedListItem",a.nestable=function(a){return j.has(a)},a.unformatDecorations={pre:function(a){return a[1]}},b);return a}e=a(b);f=a(d);g.NumberedListItem=e;g.NumberedListItemWithEmpty=f}),98); __d("WAWebStrikethroughFormatRegex",[],(function(a,b,c,d,e,f){a=/(?:^|(?:[\t-\r -\/:-@\[-`\{-~\xA0-\xA9\xAB-\xB1\xB4\xB6-\xB8\xBB\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u037E\u0384\u0385\u0387\u03F6\u0482\u055A-\u055F\u0589\u058A\u058D-\u058F\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0600-\u060F\u061B\u061C\u061E\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070D\u070F\u07F6-\u07F9\u07FE\u07FF\u0830-\u083E\u085E\u08E2\u0964\u0965\u0970\u09F2\u09F3\u09FA\u09FB\u09FD\u0A76\u0AF0\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0C84\u0D4F\u0D79\u0DF4\u0E3F\u0E4F\u0E5A\u0E5B\u0F01-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F85\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u104A-\u104F\u109E\u109F\u10FB\u1360-\u1368\u1390-\u1399\u1400\u166D\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DB\u1800-\u180A\u180E\u1940\u1944\u1945\u19DE-\u19FF\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B6A\u1B74-\u1B7C\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2000-\u2064\u2066-\u206F\u207A-\u207E\u208A-\u208E\u20A0-\u20BF\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2775\u2794-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2CE5-\u2CEA\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3000-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u303F\u309B\u309C\u30A0\u30FB\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAA77-\uAA79\uAADE\uAADF\uAAF0\uAAF1\uAB5B\uABEB\uFB29\uFBB2-\uFBC1\uFD3E\uFD3F\uFDFC\uFDFD\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD]|\uD800[\uDD00-\uDD02\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDC77\uDC78\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEC8\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB-\uDCC1\uDCCD\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3F]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3F\uDF44\uDF45]|\uD81B[\uDE97-\uDE9A]|\uD82F[\uDC9C\uDC9F-\uDCA3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE8B]|\uD83A[\uDD5E\uDD5F]|\uD83B[\uDCAC\uDCB0\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]|\uDB40[\uDC01\uDC20-\uDC7F]))~((?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])|(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])(?:[\0-\t\x0B-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]))~(?=$|(?:[\t-\r -\/:-@\[-`\{-~\xA0-\xA9\xAB-\xB1\xB4\xB6-\xB8\xBB\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u037E\u0384\u0385\u0387\u03F6\u0482\u055A-\u055F\u0589\u058A\u058D-\u058F\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0600-\u060F\u061B\u061C\u061E\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070D\u070F\u07F6-\u07F9\u07FE\u07FF\u0830-\u083E\u085E\u08E2\u0964\u0965\u0970\u09F2\u09F3\u09FA\u09FB\u09FD\u0A76\u0AF0\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0C84\u0D4F\u0D79\u0DF4\u0E3F\u0E4F\u0E5A\u0E5B\u0F01-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F85\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u104A-\u104F\u109E\u109F\u10FB\u1360-\u1368\u1390-\u1399\u1400\u166D\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DB\u1800-\u180A\u180E\u1940\u1944\u1945\u19DE-\u19FF\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B6A\u1B74-\u1B7C\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2000-\u2064\u2066-\u206F\u207A-\u207E\u208A-\u208E\u20A0-\u20BF\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2775\u2794-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2CE5-\u2CEA\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3000-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u303F\u309B\u309C\u30A0\u30FB\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAA77-\uAA79\uAADE\uAADF\uAAF0\uAAF1\uAB5B\uABEB\uFB29\uFBB2-\uFBC1\uFD3E\uFD3F\uFDFC\uFDFD\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD]|\uD800[\uDD00-\uDD02\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDC77\uDC78\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEC8\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB-\uDCC1\uDCCD\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3F]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3F\uDF44\uDF45]|\uD81B[\uDE97-\uDE9A]|\uD82F[\uDC9C\uDC9F-\uDCA3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE8B]|\uD83A[\uDD5E\uDD5F]|\uD83B[\uDCAC\uDCB0\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]|\uDB40[\uDC01\uDC20-\uDC7F]))/g;b=a;f["default"]=b}),66); __d("WAWebStrikethroughMutatorComponent.react",["WAWebCopyPasteSelectable.react","react"],(function(a,b,c,d,e,f,g){var h,i=h||c("react");function a(a){var b=a.children;b=b===void 0?"":b;a=a.selectable;return i.jsx(d("WAWebCopyPasteSelectable.react").SelectableDel,{selectable:a,appTextTemplate:"~${appText}~",children:b})}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),98); __d("WAWebStrikethroughFormatMutator",["WAWebAdjustDelimitedRange","WAWebCreateRegexMutator","WAWebStrikethroughFormatRegex","WAWebStrikethroughMutatorComponent.react","react"],(function(a,b,c,d,e,f,g){var h,i=h||c("react");a=c("WAWebAdjustDelimitedRange")("_");b=c("WAWebCreateRegexMutator")(c("WAWebStrikethroughFormatRegex"),1,a);d=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}b.jsx=function(a,b,d){b=d.selectable;return i.jsx(c("WAWebStrikethroughMutatorComponent.react"),{selectable:b,children:a})};return b}(b);g["default"]=d}),98); __d("WAWebFormatConfiguration",["WAWebABProps","WAWebBlockQuoteFormatMutator","WAWebBoldFormatMutator","WAWebBotCommandFormatMutator","WAWebBotGating","WAWebBulletedListFormatMutator","WAWebBulletedListItemFormatMutator","WAWebCodeFormatMutator","WAWebEmojiFormatMutator","WAWebGroupMentionFormatMutator","WAWebHeadingFormatMutator","WAWebHighlightFormatMutator","WAWebInlineCodeFormatMutator","WAWebItalicFormatMutator","WAWebLinkFormatMutator","WAWebMentionFormatMutator","WAWebNoop","WAWebNumberedListFormatMutator","WAWebNumberedListItemFormatMutator","WAWebPhoneNumberFormatMutator","WAWebRawGroupMentionFormatMutator","WAWebRawMentionMutator","WAWebRawShortNameMentionFormatMutator","WAWebStatusLinkFormatMutator","WAWebStrikethroughFormatMutator","WAWebTextMentionFormatMutator","cr:6000","gkx"],(function(a,b,c,d,e,f,g){a=function(a){a=a===void 0?{}:a;var b=a.selectable;a=a.emojiXstyle;return[[[c("WAWebEmojiFormatMutator"),{selectable:b,emojiXstyle:a}]]]};e=function(a){a=a===void 0?{}:a;a=a.selectable;return[[[c("WAWebEmojiFormatMutator"),{selectable:a,size:"large"}]]]};f=function(a){a=a===void 0?{}:a;var b=a.links,e=a.selectable,f=a.linkXstyle;a=a.emojiXstyle;return[[[d("WAWebCodeFormatMutator").Code,{selectable:e}]],[[d("WAWebStatusLinkFormatMutator").StatusLink,{links:b,selectable:e,linkXstyle:f}]],[[c("WAWebBoldFormatMutator"),{selectable:e}],[c("WAWebItalicFormatMutator"),{selectable:e}],[c("WAWebStrikethroughFormatMutator"),{selectable:e}]],[[c("WAWebEmojiFormatMutator"),{selectable:e,size:"xlarge",emojiXstyle:a}]]]};var h=function(a){a=a===void 0?{}:a;a=a.selectable;return[[[d("WAWebCodeFormatMutator").Code,{selectable:a}]],[[c("WAWebBoldFormatMutator"),{selectable:a}],[c("WAWebItalicFormatMutator"),{selectable:a}],[c("WAWebStrikethroughFormatMutator"),{selectable:a}]],[[c("WAWebEmojiFormatMutator"),{selectable:a}]]]},i=function(a){a=a===void 0?{}:a;a=a.selectable;return[[[c("WAWebEmojiFormatMutator"),{selectable:a}]]]},j=function(a){a=a===void 0?{}:a;var e=a.mentions,f=a.groupMentions,g=a.links,h=a.phoneNumbers,i=a.selectable,j=a.trusted,k=a.fromMe,l=a.fromChatWid,m=a.commands,n=a.parseInlineCode;n=n===void 0?!1:n;var o=a.parseLists;o=o===void 0?!1:o;var p=a.parseQuotes;p=p===void 0?!1:p;var q=a.parseHeadings;q=q===void 0?!1:q;a=a.onLinkClick;a=a===void 0?c("WAWebNoop"):a;h=j&&h!=null&&h.length>0?[[c("WAWebPhoneNumberFormatMutator"),{phoneNumbers:h,selectable:i,fromMe:k}]]:null;var r;(d("WAWebBotGating").isBizBot3pEnabled()||d("WAWebBotGating").isMetaBotCommandsEnabled())&&m&&m.length>0&&(r=[[d("WAWebBotCommandFormatMutator").BotCommand,{commands:m,selectable:i}]]);return[[[d("WAWebCodeFormatMutator").Code,{selectable:i}]],n?[[c("WAWebInlineCodeFormatMutator"),{selectable:i}]]:null,o?[[d("WAWebBulletedListItemFormatMutator").BulletedListItem,{selectable:i}]]:null,o?[[d("WAWebBulletedListItemFormatMutator").HyphenListItem,{selectable:i}]]:null,o?[[c("WAWebBulletedListFormatMutator"),{selectable:i}]]:null,o?[[d("WAWebNumberedListItemFormatMutator").NumberedListItem,{selectable:i}]]:null,o?[[c("WAWebNumberedListFormatMutator"),{selectable:i}]]:null,j?[[c("WAWebLinkFormatMutator"),{links:g,selectable:i,onLinkClick:a}]]:null,e?[[c("WAWebMentionFormatMutator"),{mentions:e,selectable:i}]]:null,q?[[d("WAWebHeadingFormatMutator").Heading,{selectable:i}]]:null,f?[[d("WAWebGroupMentionFormatMutator").GroupMention,{groupMentions:f,selectable:i,fromChatWid:l}]]:null,!c("gkx")("26258")&&b("cr:6000")?b("cr:6000")(i):null,h,[[c("WAWebBoldFormatMutator"),{selectable:i}],[c("WAWebItalicFormatMutator"),{selectable:i}],[c("WAWebStrikethroughFormatMutator"),{selectable:i}]],[[c("WAWebEmojiFormatMutator"),{selectable:i}]],p?[[d("WAWebBlockQuoteFormatMutator").BlockQuote,{selectable:i}]]:null,r].filter(Boolean)},k=function(a){var b=a.boundary,e=a.terms,f=a.selectable,g=a.mentions;a=a.groupMentions;return[[[c("WAWebTextMentionFormatMutator"),{mentions:g,selectable:f}]],[[d("WAWebGroupMentionFormatMutator").GroupMention,{groupMentions:a,selectable:f,clickable:!1}]],[[c("WAWebBoldFormatMutator"),{selectable:f}],[c("WAWebItalicFormatMutator"),{selectable:f}],[c("WAWebStrikethroughFormatMutator"),{selectable:f}]],[[c("WAWebHighlightFormatMutator"),{terms:e,boundary:b,selectable:f,ignoreDiacritics:!0}]],[[c("WAWebEmojiFormatMutator"),{selectable:f}]]]},l=function(a){a=a.terms;return[[[c("WAWebHighlightFormatMutator"),{terms:a,ignoreDiacritics:!0}]],[[c("WAWebEmojiFormatMutator"),{selectable:!1}]]]},m=function(a){a===void 0&&(a={});var b=d("WAWebABProps").getABPropConfigValue("enable_clear_formatted_preview");a=a;var e=a.mentions,f=a.groupMentions,g=a.selectable;a=a.isDraftMessage;return[b?null:[[d("WAWebCodeFormatMutator").Code,{selectable:g}]],e?[[c("WAWebTextMentionFormatMutator"),{mentions:e,selectable:g,lastMessage:!0,isDraftMessage:a}]]:null,f?[[d("WAWebGroupMentionFormatMutator").GroupMention,{groupMentions:f,selectable:g,clickable:!1,lastMessage:!0,isDraftMessage:a}]]:null,b?null:[[c("WAWebBoldFormatMutator"),{selectable:g}],[c("WAWebItalicFormatMutator"),{selectable:g}],[c("WAWebStrikethroughFormatMutator"),{selectable:g}]],[[c("WAWebEmojiFormatMutator"),{selectable:g}]]].filter(Boolean)},n=function(a){var b=a.boundary,e=a.mentions,f=a.groupMentions,g=a.terms;a=a.selectable;return[[[d("WAWebCodeFormatMutator").Code,{selectable:a}]],[[c("WAWebTextMentionFormatMutator"),{mentions:e,selectable:a}]],[[d("WAWebGroupMentionFormatMutator").GroupMention,{groupMentions:f,selectable:a,clickable:!1}]],[[c("WAWebBoldFormatMutator"),{selectable:a}],[c("WAWebItalicFormatMutator"),{selectable:a}],[c("WAWebStrikethroughFormatMutator"),{selectable:a}]],[[c("WAWebHighlightFormatMutator"),{terms:g,boundary:b,selectable:a}]],[[c("WAWebEmojiFormatMutator"),{selectable:a}]]]},o=function(a){a=a===void 0?{}:a;a=a.selectable;return[[[d("WAWebCodeFormatMutator").Code,{selectable:a}]],[[c("WAWebBoldFormatMutator"),{selectable:a}],[c("WAWebItalicFormatMutator"),{selectable:a}],[c("WAWebStrikethroughFormatMutator"),{selectable:a}]],[[c("WAWebEmojiFormatMutator"),{selectable:a}]]]},p=function(a){var b=a.mentions,e=a.groupMentions;a=a.selectable;return[[[d("WAWebCodeFormatMutator").Code,{selectable:a}]],[[c("WAWebInlineCodeFormatMutator"),{selectable:a}]],[[c("WAWebTextMentionFormatMutator"),{mentions:b,selectable:a}]],[[d("WAWebGroupMentionFormatMutator").GroupMention,{groupMentions:e,selectable:a,clickable:!1}]],[[c("WAWebBoldFormatMutator"),{selectable:a}],[c("WAWebItalicFormatMutator"),{selectable:a}],[c("WAWebStrikethroughFormatMutator"),{selectable:a}]],[[c("WAWebEmojiFormatMutator"),{selectable:a}]],[[d("WAWebBlockQuoteFormatMutator").BlockQuote,{selectable:a}]]].filter(Boolean)},q=function(a){var b=a.mentions,e=a.groupMentions;a=a.selectable;return[[[d("WAWebCodeFormatMutator").Code,{selectable:a}]],[[c("WAWebInlineCodeFormatMutator"),{selectable:a,quoted:!0}]],[[d("WAWebBulletedListItemFormatMutator").BulletedListItem,{selectable:a}]],[[d("WAWebBulletedListItemFormatMutator").HyphenListItem,{selectable:a}]],[[c("WAWebBulletedListFormatMutator"),{selectable:a,quoted:!0}]],[[d("WAWebNumberedListItemFormatMutator").NumberedListItem,{selectable:a}]],[[c("WAWebNumberedListFormatMutator"),{selectable:a,quoted:!0}]],[[c("WAWebTextMentionFormatMutator"),{mentions:b,selectable:a,theme:{quoted:!0}}]],[[d("WAWebGroupMentionFormatMutator").GroupMention,{groupMentions:e,selectable:a,theme:{quoted:!0},clickable:!1}]],[[c("WAWebBoldFormatMutator"),{selectable:a}],[c("WAWebItalicFormatMutator"),{selectable:a}],[c("WAWebStrikethroughFormatMutator"),{selectable:a}]],[[c("WAWebEmojiFormatMutator"),{selectable:a}]],[[d("WAWebBlockQuoteFormatMutator").BlockQuote,{selectable:a,quoted:!0}]]].filter(Boolean)},r=function(a){var b=a.mentions,e=a.groupMentions;a=a.selectable;return[[[d("WAWebCodeFormatMutator").Code,{selectable:a}]],[[c("WAWebRawMentionMutator"),{mentions:b,selectable:a}]],[[d("WAWebRawGroupMentionFormatMutator").RawGroupMention,{groupMentions:e}]],[[c("WAWebBoldFormatMutator"),{selectable:a}],[c("WAWebItalicFormatMutator"),{selectable:a}],[c("WAWebStrikethroughFormatMutator"),{selectable:a}]]].filter(Boolean)},s=function(a){var b=a.mentions,e=a.groupMentions,f=a.selectable;a=a.groupMetadata;return[[[d("WAWebCodeFormatMutator").Code,{selectable:f}]],[[c("WAWebInlineCodeFormatMutator"),{selectable:f}]],[[c("WAWebRawShortNameMentionFormatMutator"),{mentions:b,selectable:f,groupMetadata:a}]],[[d("WAWebRawGroupMentionFormatMutator").RawGroupMention,{groupMentions:e}]],[[c("WAWebBoldFormatMutator"),{selectable:f}],[c("WAWebItalicFormatMutator"),{selectable:f}],[c("WAWebStrikethroughFormatMutator"),{selectable:f}]],[[d("WAWebBlockQuoteFormatMutator").BlockQuote,{selectable:f}]]].filter(Boolean)},t=function(a){var e=a.links,f=Boolean(a.expandedFormattingEnabled);a=Boolean((a=a.bulletPointsEnabled)!=null?a:f);var g=!0;return[[[d("WAWebCodeFormatMutator").Code,{selectable:g}]],f?[[c("WAWebInlineCodeFormatMutator"),{selectable:g}]]:null,a?[[d("WAWebBulletedListItemFormatMutator").BulletedListItem,{selectable:g}]]:null,a?[[d("WAWebBulletedListItemFormatMutator").HyphenListItem,{selectable:g}]]:null,a?[[c("WAWebBulletedListFormatMutator"),{selectable:g}]]:null,f?[[d("WAWebNumberedListItemFormatMutator").NumberedListItem,{selectable:g}]]:null,f?[[c("WAWebNumberedListFormatMutator"),{selectable:g}]]:null,[[c("WAWebLinkFormatMutator"),{links:e,selectable:g}]],[[c("WAWebBoldFormatMutator"),{selectable:g}],[c("WAWebItalicFormatMutator"),{selectable:g}],[c("WAWebStrikethroughFormatMutator"),{selectable:g}]],!c("gkx")("26258")&&b("cr:6000")?b("cr:6000")(g):null,[[c("WAWebEmojiFormatMutator"),{selectable:g}]],f?[[d("WAWebBlockQuoteFormatMutator").BlockQuote,{selectable:g}]]:null].filter(Boolean)},u=function(a){var e=Boolean(a==null?void 0:a.expandedFormattingEnabled);a=Boolean((a=a==null?void 0:a.bulletPointsEnabled)!=null?a:e);var f=!0;return[[[d("WAWebCodeFormatMutator").Code,{selectable:f}]],e?[[c("WAWebInlineCodeFormatMutator"),{selectable:f}]]:null,a?[[d("WAWebBulletedListItemFormatMutator").BulletedListItem,{selectable:f}]]:null,a?[[d("WAWebBulletedListItemFormatMutator").HyphenListItem,{selectable:f}]]:null,a?[[c("WAWebBulletedListFormatMutator"),{selectable:f}]]:null,e?[[d("WAWebNumberedListItemFormatMutator").NumberedListItem,{selectable:f}]]:null,e?[[c("WAWebNumberedListFormatMutator"),{selectable:f}]]:null,[[c("WAWebBoldFormatMutator"),{selectable:f}],[c("WAWebItalicFormatMutator"),{selectable:f}],[c("WAWebStrikethroughFormatMutator"),{selectable:f}]],!c("gkx")("26258")&&b("cr:6000")?b("cr:6000")(f):null,[[c("WAWebEmojiFormatMutator"),{selectable:f}]],e?[[d("WAWebBlockQuoteFormatMutator").BlockQuote,{selectable:f}]]:null].filter(Boolean)},v=function(a){a=a===void 0?{}:a;var b=a.links,d=a.selectable;a=a.trusted;return[a===!0?[[c("WAWebLinkFormatMutator"),{links:b,selectable:d}]]:null,[[c("WAWebEmojiFormatMutator"),{selectable:d}]]].filter(Boolean)},w=function(a){a===void 0&&(a={});a=a;var b=a.mentions,e=a.groupMentions,f=a.selectable;a=a.isDraftMessage;return[[[d("WAWebCodeFormatMutator").Code,{selectable:f}]],[[c("WAWebInlineCodeFormatMutator"),{selectable:f}]],[[d("WAWebBulletedListItemFormatMutator").BulletedListItem,{selectable:f,inline:!0}]],[[d("WAWebBulletedListItemFormatMutator").HyphenListItem,{selectable:f,inline:!0}]],[[c("WAWebBulletedListFormatMutator"),{selectable:f,inline:!0}]],[[d("WAWebNumberedListItemFormatMutator").NumberedListItem,{selectable:f,inline:!0}]],[[c("WAWebNumberedListFormatMutator"),{selectable:f,inline:!0}]],b?[[c("WAWebTextMentionFormatMutator"),{mentions:b,selectable:f,lastMessage:!0,isDraftMessage:a}]]:null,e?[[d("WAWebGroupMentionFormatMutator").GroupMention,{groupMentions:e,selectable:f,clickable:!1,lastMessage:!0,isDraftMessage:a}]]:null,[[c("WAWebBoldFormatMutator"),{selectable:f}],[c("WAWebItalicFormatMutator"),{selectable:f}],[c("WAWebStrikethroughFormatMutator"),{selectable:f}]],[[c("WAWebEmojiFormatMutator"),{selectable:f}]],[[d("WAWebBlockQuoteFormatMutator").BlockQuote,{selectable:f,inline:!0}]]].filter(Boolean)},x=function(a){var b=a.selectable,e=a.parseHeadings;e=e===void 0?!0:e;var f=a.parseHeadlessHeadings;f=f===void 0?!1:f;var g=a.parseLists;g=g===void 0?!0:g;var h=a.parseQuotes;h=h===void 0?!0:h;var i=a.parseInlineCode;i=i===void 0?!0:i;var j=a.showLinks;j=j===void 0?!0:j;var k=a.links;a=a.onLinkClick;a=a===void 0?c("WAWebNoop"):a;return[[[d("WAWebCodeFormatMutator").Code,{selectable:b}]],i?[[c("WAWebInlineCodeFormatMutator"),{selectable:b}]]:null,[[c("WAWebBoldFormatMutator"),{selectable:b}],[c("WAWebItalicFormatMutator"),{selectable:b}],[c("WAWebStrikethroughFormatMutator"),{selectable:b}]],[[c("WAWebEmojiFormatMutator"),{selectable:b}]],h?[[d("WAWebBlockQuoteFormatMutator").BlockQuote,{selectable:b}]]:null,g?[[d("WAWebBulletedListItemFormatMutator").BulletedListItem,{selectable:b}]]:null,g?[[d("WAWebBulletedListItemFormatMutator").HyphenListItem,{selectable:b}]]:null,g?[[c("WAWebBulletedListFormatMutator"),{selectable:b}]]:null,g?[[d("WAWebNumberedListItemFormatMutator").NumberedListItem,{selectable:b}]]:null,g?[[c("WAWebNumberedListFormatMutator"),{selectable:b}]]:null,j?[[c("WAWebLinkFormatMutator"),{links:k,selectable:b,onLinkClick:a}]]:null,e?[[d("WAWebHeadingFormatMutator").AIRichResponseHeading,{selectable:b}]]:null,f?[[d("WAWebHeadingFormatMutator").HeadlessHeading,{selectable:b}]]:null].filter(Boolean)};g.EmojiOnly=a;g.LargeEmojiOnly=e;g.StatusText=f;g.StatusCaption=h;g.Compatibility=i;g.Conversation=j;g.Search=k;g.SearchName=l;g.LastMessage=m;g.FTSMessage=n;g.QuickReply=o;g.Unformat=p;g.QuotedMention=q;g.FormattedNotification=r;g.FormattedGroupNotification=s;g.TrustedGroupDesc=t;g.UntrustedGroupDesc=u;g.HeaderAndFooter=v;g.InlineMessage=w;g.RichResponse=x}),98); __d("WAWebFormatRevokedMsg",["fbt","WAWebContactCollection","WAWebFrontendContactGetters","WAWebMsgGetters","WAWebWidFormat"],(function(a,b,c,d,e,f,g,h){var i=function(a){var b=d("WAWebContactCollection").ContactCollection.get(a);return!b?d("WAWebWidFormat").widToFormattedUser(a):b.shortName||b.name||d("WAWebFrontendContactGetters").getDisplayName(b)};function j(a){if(d("WAWebMsgGetters").getIsRevokedByMe(a))return h._(/*BTDS*/"__JHASH__Tg8xHWjZylf__JHASH__");else if(a.revokeSender==null)return h._(/*BTDS*/"__JHASH__Ud5MkGGLhR4__JHASH__");return h._(/*BTDS*/"__JHASH__7WCUnGPo5nL__JHASH__",[h._param("admin",i(a.revokeSender))])}function k(a){return d("WAWebMsgGetters").getIsSentByMe(a)?h._(/*BTDS*/"__JHASH__L-dKQmTItq5__JHASH__"):h._(/*BTDS*/"__JHASH__J56rWNCth3M__JHASH__")}function a(a){var b;b=(b=a.subtype)!=null?b:"sender";switch(b){case"sender":return k(a);case"admin":return j(a)}}function b(a){var b;b=(b=a.subtype)!=null?b:"sender";switch(b){case"sender":return k(a);case"admin":return d("WAWebMsgGetters").getIsNewsletterMsg(a)?l(a):j(a)}}function l(a){return d("WAWebMsgGetters").getIsRevokedByMe(a)?h._(/*BTDS*/"__JHASH__bz_JUjsZ8t4__JHASH__"):h._(/*BTDS*/"__JHASH__qY2dj_qt1Nk__JHASH__")}g.formatRevokedComment=a;g.formatRevokedMsg=b}),226); __d("WAWebGroupMentionFormatMutator",["WAWebExtractRangesUsingRegex","WAWebFormatMutator","WAWebGroupMetadataCollection","WAWebRichTextInputConst","WAWebTextGroupMentionWrapperMutatorComponent.react","WAWebUnjoinedSubgroupMetadataCollection","react"],(function(a,b,c,d,e,f,g){var h,i=h||c("react");a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}b.match=function(a,b){if(!b)return[];var e=b.groupMentions,f=b.isDraftMessage;b=b.fromChatWid;this.fromChatWid=b;if(f===!0){f=c("WAWebExtractRangesUsingRegex")(a,new RegExp(d("WAWebRichTextInputConst").groupJidRegexStr,"g"));for(var g=0;g<f.length;++g){var h=f[g][4][1],i=c("WAWebUnjoinedSubgroupMetadataCollection").get(h)||c("WAWebGroupMetadataCollection").get(h);if(!i||!i.subject)return[];f[g][4]={groupJid:h.slice(1),groupSubject:i.subject,fromChatWid:b}}return f}if(!e||Object.keys(e).length===0)return[];h=k(e);i=c("WAWebExtractRangesUsingRegex")(a,h);for(g=0;g<i.length;++g){f=i[g][4][0];i[g][4]={groupJid:f.slice(1),groupSubject:e[f],fromChatWid:b}}return i};b.jsx=function(a,b,d){a=d.selectable;var e=d.theme,f=d.clickable;f=f===void 0?!0:f;d=d.lastMessage;return i.jsx(c("WAWebTextGroupMentionWrapperMutatorComponent.react"),{groupSubject:b.groupSubject,groupJid:b.groupJid,selectable:a,clickable:f,theme:e,lastMessage:d,fromChatWid:this.fromChatWid})};return b}(c("WAWebFormatMutator"));a.compatibility=!0;function j(a){var b=/[\\^$.*+?()[\]{}|]/g,c=RegExp(b.source);return a&&c.test(a)?a.replace(b,"\\$&"):a}function k(a){a=Object.keys(a).map(j).join("|");return new RegExp("("+a+")","g")}g.GroupMention=a}),98); __d("WAWebInternFormatRegex",[],(function(a,b,c,d,e,f){a=/(^|(?:[\t-\r -\/:-@\[-`\{-~\xA0-\xA9\xAB-\xB1\xB4\xB6-\xB8\xBB\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u037E\u0384\u0385\u0387\u03F6\u0482\u055A-\u055F\u0589\u058A\u058D-\u058F\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0600-\u060F\u061B\u061C\u061E\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070D\u070F\u07F6-\u07F9\u07FE\u07FF\u0830-\u083E\u085E\u08E2\u0964\u0965\u0970\u09F2\u09F3\u09FA\u09FB\u09FD\u0A76\u0AF0\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0C84\u0D4F\u0D79\u0DF4\u0E3F\u0E4F\u0E5A\u0E5B\u0F01-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F85\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u104A-\u104F\u109E\u109F\u10FB\u1360-\u1368\u1390-\u1399\u1400\u166D\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DB\u1800-\u180A\u180E\u1940\u1944\u1945\u19DE-\u19FF\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B6A\u1B74-\u1B7C\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2000-\u2064\u2066-\u206F\u207A-\u207E\u208A-\u208E\u20A0-\u20BF\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2775\u2794-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2CE5-\u2CEA\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3000-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u303F\u309B\u309C\u30A0\u30FB\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAA77-\uAA79\uAADE\uAADF\uAAF0\uAAF1\uAB5B\uABEB\uFB29\uFBB2-\uFBC1\uFD3E\uFD3F\uFDFC\uFDFD\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD]|\uD800[\uDD00-\uDD02\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDC77\uDC78\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEC8\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB-\uDCC1\uDCCD\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3F]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3F\uDF44\uDF45]|\uD81B[\uDE97-\uDE9A]|\uD82F[\uDC9C\uDC9F-\uDCA3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE8B]|\uD83A[\uDD5E\uDD5F]|\uD83B[\uDCAC\uDCB0\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]|\uDB40[\uDC01\uDC20-\uDC7F]))(([DPST\u017F][0-9]{6,16})|(L[0-9]{6,16}[A-Z\u017F\u212A]{0,5})|(r[A-Z\u017F\u212A]{2,32}[0-9A-F]{8,40}))(?=$|(?:[\t-\r -\/:-@\[-`\{-~\xA0-\xA9\xAB-\xB1\xB4\xB6-\xB8\xBB\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u037E\u0384\u0385\u0387\u03F6\u0482\u055A-\u055F\u0589\u058A\u058D-\u058F\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0600-\u060F\u061B\u061C\u061E\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070D\u070F\u07F6-\u07F9\u07FE\u07FF\u0830-\u083E\u085E\u08E2\u0964\u0965\u0970\u09F2\u09F3\u09FA\u09FB\u09FD\u0A76\u0AF0\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0C84\u0D4F\u0D79\u0DF4\u0E3F\u0E4F\u0E5A\u0E5B\u0F01-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F85\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u104A-\u104F\u109E\u109F\u10FB\u1360-\u1368\u1390-\u1399\u1400\u166D\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DB\u1800-\u180A\u180E\u1940\u1944\u1945\u19DE-\u19FF\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B6A\u1B74-\u1B7C\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2000-\u2064\u2066-\u206F\u207A-\u207E\u208A-\u208E\u20A0-\u20BF\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2775\u2794-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2CE5-\u2CEA\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3000-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u303F\u309B\u309C\u30A0\u30FB\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAA77-\uAA79\uAADE\uAADF\uAAF0\uAAF1\uAB5B\uABEB\uFB29\uFBB2-\uFBC1\uFD3E\uFD3F\uFDFC\uFDFD\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD]|\uD800[\uDD00-\uDD02\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDC77\uDC78\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEC8\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB-\uDCC1\uDCCD\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3F]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3F\uDF44\uDF45]|\uD81B[\uDE97-\uDE9A]|\uD82F[\uDC9C\uDC9F-\uDCA3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE8B]|\uD83A[\uDD5E\uDD5F]|\uD83B[\uDCAC\uDCB0\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]|\uDB40[\uDC01\uDC20-\uDC7F]))/gi;b=a;f["default"]=b}),66); __d("WAWebLinkMutatorComponent.react",["WAWebCopyPasteSelectable.react","react"],(function(a,b,c,d,e,f,g){var h,i=h||c("react"),j={link:{textDecoration:"x1bvjpef x1lku1pv x11iimpl xbvygy2 x1wp9yj1 x1e2wovf",color:"x1ph7ams x17f7hit",backgroundColor:"x1k74hu9 xn69kzl",textUnderlineOffset:"xrys4gj xhmieyt",$$css:!0}};function a(a){var b=a.children;b=b===void 0?"":b;var c=a.className,e=a.href,f=a.onClick;a=a.selectable;return i.jsx(d("WAWebCopyPasteSelectable.react").SelectableLink,{onClick:function(a){f==null?void 0:f()},onContextMenu:function(a){f==null?void 0:f()},className:c,xstyle:j.link,href:e,title:e,target:"_blank",rel:"noopener noreferrer",selectable:a,children:b})}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),98); __d("WAWebInternMutatorComponent.react",["WAWebLinkMutatorComponent.react","react"],(function(a,b,c,d,e,f,g){var h,i=h||c("react");function a(a){return i.jsx(c("WAWebLinkMutatorComponent.react"),babelHelpers["extends"]({},a,{children:a.children}))}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),98); __d("WAWebInternFormatMutator",["WAWebCreateRegexMutator","WAWebInternFormatRegex","WAWebInternMutatorComponent.react","WAWebLinkFormatMutator","WAWebMentionFormatMutator","react"],(function(a,b,c,d,e,f,g){var h,i=h||c("react");b=c("WAWebCreateRegexMutator")(c("WAWebInternFormatRegex"),2,a);d=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}b.jsx=function(a,b,d){d=d.selectable;d=d===void 0?!1:d;b=k(b);return i.jsx(c("WAWebInternMutatorComponent.react"),{href:b,selectable:d,children:a})};return b}(b);d.format=!1;d.compatibility=!0;d.nestable=function(a){return a!==c("WAWebLinkFormatMutator")&&a!==c("WAWebMentionFormatMutator")};function a(a,b){b=a[1];b&&(a.index+=b.length,a[0]=a[0].slice(b.length));return a}var j="https://www.internalfb.com/intern/bunny/?q=";function k(a){a[0];a[1];a[2];var b=a[3],c=a[4];a=a[5];return""+j+((b=(b=b)!=null?b:c)!=null?b:a)}g["default"]=d}),98); __d("WAWebLinkFormatMutator",["WAWebBoldFormatMutator","WAWebCodeFormatMutator","WAWebFormatMutator","WAWebInlineCodeFormatMutator","WAWebItalicFormatMutator","WAWebLinkMutatorComponent.react","WAWebStrikethroughFormatMutator","WAWebSuspiciousLinkMutatorComponent.react","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react");b=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}b.jsx=function(a,b,d){var e=d.selectable;e=e===void 0?!1:e;var f=d.linkXstyle;d=d.onLinkClick;var g=b.href,h=b.suspiciousCharacters;return(h==null?void 0:h.size)?j.jsx(c("WAWebSuspiciousLinkMutatorComponent.react"),{onClick:d,className:(i||(i=c("stylex")))(f),link:b,selectable:e,children:a}):j.jsx(c("WAWebLinkMutatorComponent.react"),{className:(i||(i=c("stylex")))(f),onClick:d,href:g,selectable:e,children:a})};return b}(c("WAWebFormatMutator"));b.format=!1;b.compatibility=!0;b.match=function(a,b,c){if(!b)return[];a=b.links;c=a===void 0?[]:a;return c.map(k)};b.conflictResolvers=new Map([[c("WAWebBoldFormatMutator"),a],[c("WAWebItalicFormatMutator"),a],[c("WAWebStrikethroughFormatMutator"),a],[c("WAWebInlineCodeFormatMutator"),a],[d("WAWebCodeFormatMutator").Code,a]]);function k(a){var b=a.index,c=a.url;c=b+c.length-1;return[b,b,c,c,a]}function a(a,b){var c=0,d=0;while(c<a.length&&d<b.length){var e=b[d][3]-a[c][3];if(e>0)c++;else if(e<0)d++;else{e=b[d][3]-b[d][2];a[c][2]-=e;a[c][3]-=e;var f=a[c][5];f.href=f.href.slice(0,-e);f.path=f.path&&f.path.slice(0,-e);f.url=f.url.slice(0,-e);d++;c++}}}g["default"]=b}),98); __d("WAWebMentionFormatMutator",["WAWebContactCollection","WAWebExtractRangesUsingRegex","WAWebFormatMutator","WAWebMentionMutatorComponent.react","WAWebRichTextInputConst","WAWebWidFactory","escapeRegex","isEmptyObject","react"],(function(a,b,c,d,e,f,g){var h,i=h||c("react");a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}b.match=function(a,b){if(!b)return[];var e=b.mentions,f=b.groupMetadata;b=b.isDraftMessage;if(b===!0){b=c("WAWebExtractRangesUsingRegex")(a,new RegExp(d("WAWebRichTextInputConst").userJidRegexStr,"g"));for(var g=0;g<b.length;++g){var h=b[g][4][1];h=d("WAWebWidFactory").createUserWid(h);h=d("WAWebContactCollection").ContactCollection.get(h);if(h==null)return[];b[g][4]={contact:h,groupMetadata:f}}return b}if(!e||c("isEmptyObject")(e))return[];h=j(e);g=c("WAWebExtractRangesUsingRegex")(a,h);for(b=0;b<g.length;++b)g[b][4]={contact:e[g[b][4][0]],groupMetadata:f};return g};b.jsx=function(a,b,d){a=d.selectable;d=d.lastMessage;return i.jsx(c("WAWebMentionMutatorComponent.react"),{mentionMeta:b,selectable:a,lastMessage:d})};return b}(c("WAWebFormatMutator"));a.compatibility=!0;function j(a){a=Object.keys(a).map(c("escapeRegex")).join("|");return new RegExp("("+a+")","g")}g["default"]=a}),98); __d("WAWebPhoneNumberFormatMutator",["WAWebFormatMutator","WAWebInternFormatMutator","WAWebLinkFormatMutator","WAWebMentionFormatMutator","WAWebPhoneNumberMutatorComponent.react","react"],(function(a,b,c,d,e,f,g){var h,i=h||c("react");a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}b.jsx=function(a,b,d){a=d.selectable;a=a===void 0?!1:a;d=d.fromMe;b=b.phone;return i.jsx(c("WAWebPhoneNumberMutatorComponent.react"),{phoneNumber:b,selectable:a,fromMe:d})};return b}(c("WAWebFormatMutator"));a.format=!1;a.compatibility=!0;a.nestable=function(a){return a!==c("WAWebLinkFormatMutator")&&a!==c("WAWebInternFormatMutator")&&a!==c("WAWebMentionFormatMutator")};a.match=function(a,b,c){if(!b)return[];a=b.phoneNumbers;c=a===void 0?[]:a;return c.map(j)};function j(a){var b=a.index,c=a.phone;c=b+c.length-1;return[b,b,c,c,a]}g["default"]=a}),98); __d("WAWebRawGroupMentionFormatMutator",["WAWebGroupMentionFormatMutator"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}return b}(d("WAWebGroupMentionFormatMutator").GroupMention);a.mutates=!0;a.mutate=function(a,b){a=b.groupSubject;return"@"+a};g.RawGroupMention=a}),98); __d("WAWebRawMentionMutator",["WAWebABProps","WAWebChatContactUtils","WAWebContactGetters","WAWebElevatedPushNamesFlag","WAWebFrontendContactGetters","WAWebMentionFormatMutator"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}return b}(c("WAWebMentionFormatMutator"));a.mutates=!0;a.mutate=function(a,b){a=b.contact;b=d("WAWebElevatedPushNamesFlag").pushNameCanBeUsed(a)&&d("WAWebABProps").getABPropConfigValue("elevated_push_names_v2_m2_enabled")?d("WAWebChatContactUtils").getFormattedNotifyName(d("WAWebContactGetters").getNotifyName(a),!1).toString():d("WAWebFrontendContactGetters").getDisplayName(a);return"@"+b};g["default"]=a}),98); __d("WAWebRawShortNameMentionFormatMutator",["WAWebFrontendContactGetters","WAWebMentionFormatMutator","WAWebMiscGatingUtils"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}return b}(c("WAWebMentionFormatMutator"));a.mutates=!0;a.mutate=function(a,b){a=b.contact;b=b.groupMetadata;return d("WAWebMiscGatingUtils").isDropLastNameEnabled()&&b&&b.hasUniqueShortNameMention(a)?"@"+a.shortName:"@"+d("WAWebFrontendContactGetters").getDisplayName(a)};g["default"]=a}),98); __d("WAWebStatusLinkFormatMutator",["WAWebLinkFormatMutator","WAWebLongLinkMutatorComponent.react","react"],(function(a,b,c,d,e,f,g){var h,i=h||c("react"),j=34,k=12,l="...";function m(a,b){a=Math.min(b.length,Math.max(b.length-k,b.length+a.length-j));return b.length-a}function n(a,b){a=b.length>k||b.length+a.length>j?b.slice(0,m(a,b)):b;return a}function o(a){var b=a.domain;a=a.path;return[b.replace(/^www\./,""),a==null||a.length===1?"":a]}function p(a,b){var c=n(a,b);a=a+(c.length===1?"":c);a=a.length>j?""+l+a.slice(a.length-j):a;b=b!==c?l:"";return a+b}a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}b.jsx=function(b,c,e){b=o(c);var f=b[0];b=b[1];var g=p(f,b);if(g!==f+b){var h;return i.jsx(d("WAWebLongLinkMutatorComponent.react").LongLink,{xstyle:e.linkXstyle,selectable:(h=e.selectable)!=null?h:!1,link:c,children:g})}return a.jsx.call(this,[f+b],c,e)};return b}(c("WAWebLinkFormatMutator"));g.cleanUrl=o;g.redactUrl=p;g.StatusLink=a}),98); __d("WAWebTextMentionFormatMutator",["WAWebMentionFormatMutator","WAWebTextMentionMutatorComponent.react","react"],(function(a,b,c,d,e,f,g){var h,i=h||c("react");a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}b.jsx=function(a,b,d){a=b.contact;b=d.selectable;var e=d.theme;d=d.lastMessage;return i.jsx(c("WAWebTextMentionMutatorComponent.react"),{contact:a,selectable:b,theme:e,lastMessage:d})};return b}(c("WAWebMentionFormatMutator"));g["default"]=a}),98); __d("WAWebMentionMutatorComponentBase.react",["WABidi","WAWebCopyPasteSelectable.react","WAWebEmojiFormatMutator","WAWebFormat","WAWebJsxSerializer.react","WAWebUIRefreshGatingUtils","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k={matchedMention:{cursor:"x1ypdohk",color:"x1a06ls3",$$css:!0},lastMessage:{fontWeight:"xk50ysn",$$css:!0},matchedMentionRefresh:{color:"xo1mcw5",fontWeight:"x1xlr1w8",textDecoration:"x1hl2dhg",":hover_textDecoration":"xt0b8zv",":focus-visible_textDecoration":"xbvygy2",":focus-visible_color":"x17f7hit",":focus-visible_backgroundColor":"xp30eni",":focus-visible_textUnderlineOffset":"xhmieyt",$$css:!0}};function a(a){var b=a.onClick,e=a.theme,f=a.selectable,g=a.text,h=a.jid,l=a.ariaLabel;a=a.lastMessage;var m=d("WABidi").dir(g)||"auto";e=(e=e==null?void 0:e.quoted)!=null?e:!1;var n=c("WAWebFormat")(g,[[[c("WAWebEmojiFormatMutator"),{selectable:f}]]],c("WAWebJsxSerializer.react"),void 0,Infinity);e=b&&!e;e=[e===!0&&k.matchedMention,a===!0&&k.lastMessage,e===!0&&a!==!0&&d("WAWebUIRefreshGatingUtils").uiRefreshM1Enabled()&&k.matchedMentionRefresh];return j.jsxs(d("WAWebCopyPasteSelectable.react").SelectableSpan,{dir:"auto","data-jid":h,"data-display":g,className:(i||(i=c("stylex")))(e),onClick:b,plainText:"@"+g,selectable:f,"aria-label":l,selectAll:!0,appTextTemplate:"\u200b"+h+"\u200b",children:["@",j.jsx("span",{dir:m,children:n})]})}a.displayName=a.name+" [from "+f.id+"]";g.MentionBase=a}),98); __d("WAWebChatTextMentionMutatorComponent.react",["WAWebABProps","WAWebChatContactUtils","WAWebContactGetters","WAWebElevatedPushNamesFlag","WAWebFrontendContactGetters","WAWebMentionMutatorComponentBase.react","react","useWAWebContactValues"],(function(a,b,c,d,e,f,g){var h,i=h||c("react");function a(a){var b=a.contact,c=a.onClick,e=a.theme,f=a.selectable,g=a.lastMessage;a=d("useWAWebContactValues").useContactValues(a.contact.id,[d("WAWebContactGetters").getId,d("WAWebFrontendContactGetters").getDisplayName,d("WAWebContactGetters").getNotifyName]);var h=a[0],j=a[1];a=a[2];var k;d("WAWebElevatedPushNamesFlag").pushNameCanBeUsed(b)&&d("WAWebABProps").getABPropConfigValue("elevated_push_names_v2_m2_enabled")?(b=d("WAWebChatContactUtils").getFormattedNotifyName(a,!1).toString(),k=d("WAWebChatContactUtils").getAccessibleNotifyName(a).toString()):b=j;return i.jsx(d("WAWebMentionMutatorComponentBase.react").MentionBase,{text:b,jid:h.toString(),onClick:c,theme:e,selectable:f,ariaLabel:k,lastMessage:g})}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),98); __d("WAWebStatusContext",["react"],(function(a,b,c,d,e,f,g){var h;a=(h||d("react")).createContext;b=a({statusItemViewEventRef:null});g.StatusContext=b}),98); __d("WAWebLongLinkMutatorComponent.react",["WAWebCmd","WAWebCopyPasteSelectable.react","WAWebLongLinkPop.react","WAWebModalManager","WAWebStatusContext","WAWebSuspiciousLinkMutatorComponent.react","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j,k=j||c("react"),l=(h||(h=d("react"))).useContext,m={link:{cursor:"x1ypdohk",$$css:!0}};function a(a){var b=a.children;b=b===void 0?"":b;var e=a.link,f=a.selectable;a=a.xstyle;var g=l(d("WAWebStatusContext").StatusContext),h=g.statusItemViewEventRef;return((g=e.suspiciousCharacters)==null?void 0:g.size)?k.jsx(c("WAWebSuspiciousLinkMutatorComponent.react"),{className:(i||(i=c("stylex")))(a),link:e,selectable:f,children:b}):k.jsx(d("WAWebCopyPasteSelectable.react").SelectableLink,{onClick:function(a){a.preventDefault(),d("WAWebModalManager").ModalManager.open(k.jsx(d("WAWebLongLinkPop.react").LongLinkPopup,{link:e,statusItemViewEventRef:h})),d("WAWebCmd").Cmd.openLongLinkModal()},selectable:f,className:(i||(i=c("stylex")))(m.link,a),children:b})}a.displayName=a.name+" [from "+f.id+"]";g.LongLink=a}),98); __d("WAWebMentionMutatorComponent.react",["WAWebTextMentionWrapperMutatorComponent.react","react"],(function(a,b,c,d,e,f,g){var h,i=h||c("react");function a(a){var b=a.mentionMeta,d=a.theme,e=a.selectable;a=a.lastMessage;return i.jsx(c("WAWebTextMentionWrapperMutatorComponent.react"),{contact:b.contact,theme:d,selectable:e,lastMessage:a})}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),98); __d("WAWebPhoneNumberMutatorComponent.react",["WAWebPhoneNumberWrapperMutatorComponent.react","react"],(function(a,b,c,d,e,f,g){var h,i=h||c("react");function a(a){var b=a.phoneNumber,d=a.selectable;a=a.fromMe;return i.jsx(c("WAWebPhoneNumberWrapperMutatorComponent.react"),{selectable:d,phoneNumber:b,fromMe:a})}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),98); __d("WAWebChatRefreshedIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k="chat-refreshed";function a(a){var b=a.iconXstyle,e=a.height,f=a.width,g=a.viewBox;a=babelHelpers.objectWithoutPropertiesLoose(a,["iconXstyle","height","width","viewBox"]);var h;if(g){var l=g.x;l=l===void 0?0:l;var m=g.y;m=m===void 0?0:m;var n=g.width;n=n===void 0?0:n;g=g.height;g=g===void 0?0:g;h=[l,m,n,g].join(" ")}l=24;m=24;(e!=null||f!=null)&&(l=e,m=f);return j.jsx(d("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers["extends"]({name:k},a,{children:j.jsxs("svg",{viewBox:(n=h)!=null?n:"0 0 24 24",height:l,width:m,preserveAspectRatio:"xMidYMid meet",className:(i||(i=c("stylex")))(b),fill:"none",children:[j.jsx("title",{children:k}),j.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.00013 9L0.940133 5.53C0.540219 4.86348 1.01283 4 1.79012 4H19.3335C20.8062 4 22.0001 5.19391 22.0001 6.66667V17.3333C22.0001 18.8061 20.8062 20 19.3335 20H5.6668C4.19404 20 3.00013 18.8061 3.00013 17.3333V9ZM5.00013 8.44603L3.53252 6H19.3335C19.7017 6 20.0001 6.29848 20.0001 6.66667V17.3333C20.0001 17.7015 19.7017 18 19.3335 18H5.6668C5.29861 18 5.00013 17.7015 5.00013 17.3333V8.44603Z",fill:"currentColor"}),j.jsx("path",{d:"M7.00013 10C7.00013 9.44772 7.44785 9 8.00013 9H17.0001C17.5524 9 18.0001 9.44772 18.0001 10C18.0001 10.5523 17.5524 11 17.0001 11H8.00013C7.44785 11 7.00013 10.5523 7.00013 10Z",fill:"currentColor"}),j.jsx("path",{d:"M7.00013 14C7.00013 13.4477 7.44785 13 8.00013 13H14.0001C14.5524 13 15.0001 13.4477 15.0001 14C15.0001 14.5523 14.5524 15 14.0001 15H8.00013C7.44785 15 7.00013 14.5523 7.00013 14Z",fill:"currentColor"})]})}))}a.displayName=a.name+" [from "+f.id+"]";g.ChatRefreshedIcon=a}),98); __d("WAWebCopyRefreshedIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k="copy-refreshed";function a(a){var b=a.iconXstyle,e=a.height,f=a.width,g=a.viewBox;a=babelHelpers.objectWithoutPropertiesLoose(a,["iconXstyle","height","width","viewBox"]);var h;if(g){var l=g.x;l=l===void 0?0:l;var m=g.y;m=m===void 0?0:m;var n=g.width;n=n===void 0?0:n;g=g.height;g=g===void 0?0:g;h=[l,m,n,g].join(" ")}l=24;m=24;(e!=null||f!=null)&&(l=e,m=f);return j.jsx(d("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers["extends"]({name:k},a,{children:j.jsxs("svg",{viewBox:(n=h)!=null?n:"0 0 24 24",height:l,width:m,preserveAspectRatio:"xMidYMid meet",className:(i||(i=c("stylex")))(b),fill:"none",children:[j.jsx("title",{children:k}),j.jsx("path",{d:"M9 18C8.45 18 7.97917 17.8042 7.5875 17.4125C7.19583 17.0208 7 16.55 7 16V4C7 3.45 7.19583 2.97917 7.5875 2.5875C7.97917 2.19583 8.45 2 9 2H18C18.55 2 19.0208 2.19583 19.4125 2.5875C19.8042 2.97917 20 3.45 20 4V16C20 16.55 19.8042 17.0208 19.4125 17.4125C19.0208 17.8042 18.55 18 18 18H9ZM9 16H18V4H9V16ZM5 22C4.45 22 3.97917 21.8042 3.5875 21.4125C3.19583 21.0208 3 20.55 3 20V7C3 6.71667 3.09583 6.47917 3.2875 6.2875C3.47917 6.09583 3.71667 6 4 6C4.28333 6 4.52083 6.09583 4.7125 6.2875C4.90417 6.47917 5 6.71667 5 7V20H15C15.2833 20 15.5208 20.0958 15.7125 20.2875C15.9042 20.4792 16 20.7167 16 21C16 21.2833 15.9042 21.5208 15.7125 21.7125C15.5208 21.9042 15.2833 22 15 22H5Z",fill:"currentColor"})]})}))}a.displayName=a.name+" [from "+f.id+"]";g.CopyRefreshedIcon=a}),98); __d("WAWebPhoneNumberWrapperMutatorComponent.react",["fbt","WALogger","WAPhoneUtils","WAWebChatRefreshedIcon.react","WAWebCopyPasteSelectable.react","WAWebCopyRefreshedIcon.react","WAWebDropdownItem.react","WAWebFlex.react","WAWebGetOrQueryUsyncInfoContactAction","WAWebPhoneNumberContactAction","WAWebSpinner.react","WAWebText.react","WAWebUIRefreshGatingUtils","WAWebUimUie.react","WAWebUimUieMenu.react","asyncToGeneratorRuntime","react"],(function(a,b,c,d,e,f,g,h){var i,j;function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["handlePhoneClick getUsync failed with exceptions ",""]);k=function(){return a};return a}var l=j||c("react"),m=(i||(i=d("react"))).useState,n={spinnerContainer:{width:"xc5o50y",height:"x6hvgyk",$$css:!0},spinnerText:{marginTop:"xcxhlts",paddingStart:"xvpee5o",paddingEnd:"x14uny0o",textAlign:"x2b8uid",$$css:!0},menuItem:{paddingStart:"x1ye3gou",paddingEnd:"xn6708d",$$css:!0},textualLinkRefreshed:{color:"xo1mcw5",fontWeight:"x1xlr1w8",textDecoration:"x1hl2dhg",":hover_textDecoration":"xt0b8zv",":focus-visible_textDecoration":"xbvygy2",":focus-visible_color":"x17f7hit",":focus-visible_backgroundColor":"xp30eni",":focus-visible_textUnderlineOffset":"xhmieyt",$$css:!0}};function a(a){var e=a.fromMe,f=a.phoneNumber;a=a.selectable;var g=m(null),i=g[0],j=g[1];g=m(null);var o=g[0],p=g[1];g=m(null);var q=g[0],r=g[1];g=m(null);var s=g[0],t=g[1];function u(a){var c;q&&q.isCached(f)?c=q:(c=d("WAWebGetOrQueryUsyncInfoContactAction").usyncContactCached(),r(c));function e(a,b){return g.apply(this,arguments)}function g(){g=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){try{a=(yield c.getOrRun(a));w(a,b)}catch(a){w(null,b),t(null),d("WALogger").ERROR(k(),a).sendLogs("handlePhoneClick-getUsync")}});return g.apply(this,arguments)}c.isCached(f)||v(a);e(f,a)}function v(a){var b=l.jsxs(d("WAWebFlex.react").FlexColumn,{xstyle:n.spinnerContainer,align:"center",justify:"center",children:[l.jsx(d("WAWebSpinner.react").Spinner,{size:50,stroke:4,color:"highlight"}),l.jsx(d("WAWebText.react").WAWebTextSmall,{as:"span",xstyle:n.spinnerText,children:h._(/*BTDS*/"__JHASH__5bUyKVxsG-x__JHASH__")},"phone_number_wrapper_loading_text")]});p({menu:b,event:a});j(null)}function w(a,b){var c=[],g=d("WAWebUIRefreshGatingUtils").uiRefreshM1Enabled();if(a==null?void 0:a.wid){var i=d("WAPhoneUtils").formatPhone(a.wid.user);c.push(l.jsx(d("WAWebDropdownItem.react").DropdownItem,{testid:void 0,xstyle:n.menuItem,action:function(b){return d("WAWebPhoneNumberContactAction").handleOpenChat(b,a.wid,e)},icon:g?l.jsx(d("WAWebChatRefreshedIcon.react").ChatRefreshedIcon,{}):null,children:h._(/*BTDS*/"__JHASH__BqpSJtN9lm7__JHASH__",[h._param("chat-with-phoneNumber",l.jsx("span",{dir:"ltr",children:i}))])},"message-on-whatsapp"))}c.push(l.jsx(d("WAWebDropdownItem.react").DropdownItem,{testid:void 0,xstyle:n.menuItem,action:function(){return d("WAWebPhoneNumberContactAction").handleCopyPhoneNumber(f,a==null?void 0:a.wid,e)},icon:g?l.jsx(d("WAWebCopyRefreshedIcon.react").CopyRefreshedIcon,{}):null,children:h._(/*BTDS*/"__JHASH__QJcgRuZltlB__JHASH__")},"copy-phone-number"));p(null);j({menu:c,event:b});t(a==null?void 0:a.wid);d("WAWebPhoneNumberContactAction").logClickOnPhoneNumber(a==null?void 0:a.wid,e)}g=null;var x=null;i&&(g=l.jsx(d("WAWebUimUie.react").UIE,{displayName:"ContextMenu",escapable:!0,popable:!0,dismissOnWindowResize:!0,requestDismiss:function(){j(null),d("WAWebPhoneNumberContactAction").logCloseDialog(s,e)},children:l.jsx(c("WAWebUimUieMenu.react"),{contextMenu:i})}));o&&(x=l.jsx(d("WAWebUimUie.react").UIE,{displayName:"ContextSpinner",escapable:!0,popable:!0,dismissOnWindowResize:!0,requestDismiss:function(){p(null)},children:l.jsx(c("WAWebUimUieMenu.react"),{contextMenu:o})}));return l.jsxs(l.Fragment,{children:[l.jsx(d("WAWebCopyPasteSelectable.react").SelectableLink,{onClick:u,selectable:a,xstyle:d("WAWebUIRefreshGatingUtils").uiRefreshM1Enabled()&&n.textualLinkRefreshed,style:{cursor:"pointer"},children:f}),g,x]})}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),226); __d("WAWebShortNameTextMentionMutatorComponent.react",["WAWebContactGetters","WAWebFrontendContactGetters","WAWebMentionMutatorComponentBase.react","WAWebMiscGatingUtils","react","useWAWebContactValues","useWAWebModelValues"],(function(a,b,c,d,e,f,g){var h,i=h||c("react");function a(a){var b=a.contact,c=a.onClick,e=a.theme,f=a.selectable,g=a.lastMessage,h=d("useWAWebContactValues").useContactValues(a.contact.id,[d("WAWebContactGetters").getId,d("WAWebFrontendContactGetters").getDisplayName,d("WAWebContactGetters").getShortName,d("WAWebContactGetters").getIsMyContact]),j=h[0],k=h[1],l=h[2];h[3];var m=d("useWAWebModelValues").useModelValues(a.groupMetadata,["uniqueShortNameMap"]);h=function(){return d("WAWebMiscGatingUtils").isDropLastNameEnabled()&&m&&m.hasUniqueShortNameMention(b)?l:k};a=h();return i.jsx(d("WAWebMentionMutatorComponentBase.react").MentionBase,{text:a,jid:j.toString(),theme:e,selectable:f,onClick:c,lastMessage:g})}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),98); __d("WAWebSuspiciousLinkMutatorComponent.react",["WAWebCmd","WAWebCopyPasteSelectable.react","WAWebModalManager","WAWebSuspiciousLinkPopup.react","react"],(function(a,b,c,d,e,f,g){var h,i=h||c("react");function a(a){var b=a.children;b=b===void 0?"":b;var e=a.className,f=a.link,g=a.onClick;a=a.selectable;return i.jsx(d("WAWebCopyPasteSelectable.react").SelectableLink,{className:e,onClick:function(){d("WAWebModalManager").ModalManager.open(i.jsx(c("WAWebSuspiciousLinkPopup.react"),{link:f})),d("WAWebCmd").Cmd.openLongLinkModal(),g==null?void 0:g()},onContextMenu:function(a){g==null?void 0:g()},selectable:a,style:{cursor:"pointer"},children:b})}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),98); __d("WAWebGroupMetadataContext",["react"],(function(a,b,c,d,e,f,g){var h;a=(h||d("react")).createContext;b=a(null);g["default"]=b}),98); __d("WAWebTextGroupMentionWrapperMutatorComponent.react",["WALogger","WAWebChatCollection","WAWebChatEntryPoint","WAWebCmd","WAWebCommunityGroupJourneyEventImpl","WAWebFindChatAction","WAWebGroupMetadataCollection","WAWebGroupMetadataContext","WAWebMentionMutatorComponentBase.react","WAWebUnjoinedSubgroupMetadataCollection","WAWebWamEnumChatFilterActionTypes","WAWebWamEnumSurfaceType","react"],(function(a,b,c,d,e,f,g){var h,i;function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["No local model found for given group mention JID"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["Failed to find chat from group mention even though we have gmd for it"]);k=function(){return a};return a}var l=i||c("react"),m=(h||(h=d("react"))).useContext;function a(a){var b,e=m(c("WAWebGroupMetadataContext")),f=function(){var b=a.fromChatWid;b&&new(d("WAWebCommunityGroupJourneyEventImpl").CommunityGroupJourneyEvent)({action:d("WAWebWamEnumChatFilterActionTypes").CHAT_FILTER_ACTION_TYPES.SUBGROUP_MENTION_CLICK,surface:d("WAWebWamEnumSurfaceType").SURFACE_TYPE.CHAT,chat:d("WAWebChatCollection").ChatCollection.get(b)}).commit();b=c("WAWebUnjoinedSubgroupMetadataCollection").get(a.groupJid);if(b){d("WAWebCmd").Cmd.openCommunitySubgroupJoinModal(b,"group_mention");return}b=c("WAWebGroupMetadataCollection").get(a.groupJid);b?d("WAWebFindChatAction").findOrCreateLatestChat(b.id,"groupMentionWrapper").then(function(b){b=b.chat;void d("WAWebCmd").Cmd.openChatBottom(b,d("WAWebChatEntryPoint").ChatEntryPoint.Mention).then(function(b){b&&new(d("WAWebCommunityGroupJourneyEventImpl").CommunityGroupJourneyEvent)({action:d("WAWebWamEnumChatFilterActionTypes").CHAT_FILTER_ACTION_TYPES.GROUP_NAVIGATION,surface:d("WAWebWamEnumSurfaceType").SURFACE_TYPE.CHAT,chat:d("WAWebChatCollection").ChatCollection.get(a.groupJid)}).commit()})})["catch"](function(a){return d("WALogger").ERROR(k()).devConsole(a)}):d("WALogger").ERROR(j()).devConsole(a.groupJid)};b=(b=(b=a.theme)==null?void 0:b.quoted)!=null?b:!1;e=c("WAWebGroupMetadataCollection").get((e=e==null?void 0:e.parentGroup)!=null?e:"");e=e!=null?e.joinedSubgroups.some(function(b){return b.toString()===a.groupJid})||e.unjoinedSubgroups.some(function(b){return b.toString()===a.groupJid}):!1;e=a.clickable===!0&&e===!0&&b===!1;b=e?f:void 0;return l.jsx(d("WAWebMentionMutatorComponentBase.react").MentionBase,{text:a.groupSubject,jid:a.groupJid,theme:a.theme,selectable:a.selectable,lastMessage:a.lastMessage,onClick:b})}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),98); __d("WAWebWrapperDisplayTypeContext",["react"],(function(a,b,c,d,e,f,g){var h;a=(h||d("react")).createContext;b=a(null);g["default"]=b}),98); __d("WAWebTextMentionMutatorComponent.react",["WAWebChatTextMentionMutatorComponent.react","WAWebClickable.react","WAWebDisplayType","WAWebGroupMetadataContext","WAWebMiscGatingUtils","WAWebShortNameTextMentionMutatorComponent.react","WAWebWrapperDisplayTypeContext","react"],(function(a,b,c,d,e,f,g){var h,i,j=i||c("react"),k=(h||(h=d("react"))).useContext;function a(a){var b=k(c("WAWebGroupMetadataContext")),e=k(c("WAWebWrapperDisplayTypeContext")),f=j.jsx(c("WAWebChatTextMentionMutatorComponent.react"),babelHelpers["extends"]({},a));d("WAWebMiscGatingUtils").isDropLastNameEnabled()&&b&&(f=j.jsx(c("WAWebShortNameTextMentionMutatorComponent.react"),babelHelpers["extends"]({},a,{groupMetadata:b})));if(d("WAWebMiscGatingUtils").messageListA11yRedesignEnabled()&&e===d("WAWebDisplayType").DISPLAY_TYPE.CONVERSATION)return j.jsx(d("WAWebClickable.react").Clickable,{as:"span",onClick:a.onClick,children:f});return e===d("WAWebDisplayType").DISPLAY_TYPE.EDITING?j.jsx("span",babelHelpers["extends"]({className:"x1a06ls3"},{children:f})):f}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),98); __d("WAWebTextMentionWrapperMutatorComponent.react",["fbt","WAWebBotProfileCollection","WAWebChatCollection","WAWebChatEntryPoint","WAWebChatGroupUtils","WAWebCmd","WAWebConfirmPopup.react","WAWebDisplayType","WAWebFindChatAction","WAWebModalManager","WAWebSimpleSignalPNToFBIDMigration","WAWebTextMentionMutatorComponent.react","WAWebWrapperDisplayTypeContext","react"],(function(a,b,c,d,e,f,g,h){var i,j,k=j||c("react"),l=(i||(i=d("react"))).useContext;function a(a){var b=a.contact,e=a.lastMessage,f=a.selectable;a=a.theme;var g=l(c("WAWebWrapperDisplayTypeContext")),i=function(){var a,c;a=(a=d("WAWebSimpleSignalPNToFBIDMigration").getDeprecatedPnChatForFbidInvoke(b.id))!=null?a:b.id;c=(c=d("WAWebBotProfileCollection").BotProfileCollection.getDefaultBot())==null?void 0:c.id;if(a.isBot()&&!a.equals(c)&&!d("WAWebChatCollection").ChatCollection.get(a)){d("WAWebModalManager").ModalManager.open(k.jsx(d("WAWebConfirmPopup.react").ConfirmPopup,{onOK:function(){d("WAWebModalManager").ModalManager.close()},children:h._(/*BTDS*/"__JHASH__hRkuhBsCvED__JHASH__")}));return}c=d("WAWebChatGroupUtils").getOneToOneContactFromGroupContact(a,"text_mention");if(c==null)return;d("WAWebFindChatAction").findOrCreateLatestChat(c,"textMentionWrapper").then(function(a){a=a.chat;return d("WAWebCmd").Cmd.openChatBottom(a,d("WAWebChatEntryPoint").ChatEntryPoint.Mention)})},j;g!==d("WAWebDisplayType").DISPLAY_TYPE.EDITING&&(j=i);return k.jsx(c("WAWebTextMentionMutatorComponent.react"),{contact:b,theme:a,selectable:f,onClick:j,lastMessage:e})}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),226); __d("WAWebSystemMessageGatingUtils",["WAWebABProps"],(function(a,b,c,d,e,f,g){function a(){return Boolean(d("WAWebABProps").getABPropConfigValue("system_msg_text_styling"))}function b(){return Boolean(d("WAWebABProps").getABPropConfigValue("system_msg_truncation"))}g.systemMessageActionTextStylingEnabled=a;g.systemMessageTextTruncationEnabled=b}),98); __d("WAWebFormatAddNotification",["fbt","WAWebSystemMessageGatingUtils","WAWebSystemMessagesUtils"],(function(a,b,c,d,e,f,g,h){function a(a){var b=a.author,c=a.authorClickable,e=a.subject,f=a.subjectClickable,g=a.participantsClickable;a=a.participantsCount;var i=d("WAWebSystemMessageGatingUtils").systemMessageTextTruncationEnabled();if(b){if(d("WAWebSystemMessagesUtils").isMe(b))return i&&a!=null&&a>3?h._(/*BTDS*/"__JHASH__IgZO-ocGGzg__JHASH__",[h._param("names",g),h._param("participants_count",a-2)]):h._(/*BTDS*/"__JHASH__8xAKgh-Dj-j__JHASH__",[h._param("names",g)]);else if(d("WAWebSystemMessagesUtils").isMe(e))return c!=null?h._(/*BTDS*/"__JHASH__BAbg7l2pPhs__JHASH__",[h._param("user_name",c)]):h._(/*BTDS*/"__JHASH__oDs47I-J4Lx__JHASH__");return c!=null?i&&a!=null&&a>3?h._(/*BTDS*/"__JHASH__wRkofNjOnGB__JHASH__",[h._param("user_name",c),h._param("names",g),h._param("participants_count",a-2)]):h._(/*BTDS*/"__JHASH__ljauCLeI_rS__JHASH__",[h._param("user_name",c),h._param("names",g)]):i&&a!=null&&a>3?h._(/*BTDS*/"__JHASH__5D6WFdfaWbq__JHASH__",[h._param("names",g),h._param("participants_count",a-2)]):h._(/*BTDS*/"__JHASH__8bx-IhOpqEC__JHASH__",[h._param("names",g)])}else if(d("WAWebSystemMessagesUtils").isMe(e))return h._(/*BTDS*/"__JHASH__XJKsiTmuNiM__JHASH__");return h._(/*BTDS*/"__JHASH__2Fn4GrAlKs7__JHASH__",[h._param("user_name",f)])}g.formatAddNotification=a}),226); __d("WAWebFormatAnnounceNotification",["fbt","WAWebSystemMessagesUtils"],(function(a,b,c,d,e,f,g,h){function a(a){var b=a.author,c=a.authorClickable;a=a.body;return a==="on"?d("WAWebSystemMessagesUtils").isMe(b)?h._(/*BTDS*/"__JHASH__VD3US4VtliK__JHASH__"):h._(/*BTDS*/"__JHASH__Zc0TH0afHQJ__JHASH__",[h._param("user_name",c)]):d("WAWebSystemMessagesUtils").isMe(b)?h._(/*BTDS*/"__JHASH__5B0oqfWMeIP__JHASH__"):h._(/*BTDS*/"__JHASH__zDJfYGMA4u8__JHASH__",[h._param("user_name",c)])}g.formatAnnounceNotification=a}),226); __d("WAWebFormatBroadcastNotification",["fbt","WAWebFormatParticipantNames"],(function(a,b,c,d,e,f,g,h){function a(a){var b=a.subtype,c=a.body;a=a.recipients;if(b==="create"){c=parseInt(c,10);return h._(/*BTDS*/"__JHASH__cJxuW7vE1M5__JHASH__",[h._plural(c,"count")]).toString()}else if(b==="add"){c=a.length;return h._(/*BTDS*/"__JHASH__wUrTOwzviLl__JHASH__",[h._plural(c),h._param("name",d("WAWebFormatParticipantNames").getFormattedNames(a,!1))]).toString()}else if(b==="remove"){c=a.length;return h._(/*BTDS*/"__JHASH__9hnK_J-qgFm__JHASH__",[h._plural(c),h._param("name",d("WAWebFormatParticipantNames").getFormattedNames(a,!1))]).toString()}return""}g["default"]=a}),226); __d("WAWebFormatCommunityOwnerUpdateNotification",["fbt","WAWebChatCommunityUtils","WAWebFormatParticipantNames","WAWebSystemMessagesUtils"],(function(a,b,c,d,e,f,g,h){function a(a){var b=a.author,c=a.templateParams;a=a.clickable;var e=b?d("WAWebFormatParticipantNames").getFormattedName(b,a):null;c=d("WAWebChatCommunityUtils").getNewCommunityOwnerFromTemplateParams(c);a=c!=null?d("WAWebFormatParticipantNames").getFormattedName(c,a):null;if(b!=null){if(d("WAWebSystemMessagesUtils").isMe(b))return h._(/*BTDS*/"__JHASH__DDrq6gx3Ms___JHASH__",[h._param("user_name",a)]);else if(d("WAWebSystemMessagesUtils").isMe(c))return h._(/*BTDS*/"__JHASH__0Nta9QAVQrx__JHASH__",[h._param("user_name",e)]);return h._(/*BTDS*/"__JHASH__P2En-qkvXih__JHASH__",[h._param("author_name",e),h._param("user_name",a)])}return d("WAWebSystemMessagesUtils").isMe(c)?h._(/*BTDS*/"__JHASH__6ckJruQt9HE__JHASH__"):h._(/*BTDS*/"__JHASH__4WvSFOcOukC__JHASH__",[h._param("user_name",a)])}g.formatCommunityOwnerUpdateNotification=a}),226); __d("WAWebFormatCreateNotification",["fbt","WAWebSystemMessagesUtils","react"],(function(a,b,c,d,e,f,g,h){var i,j=i||c("react");function a(a){var b=a.chat,c=a.author,e=a.authorClickable,f=a.groupSubject;a=a.groupSubjectAsString;a=a?f:j.jsx(d("WAWebSystemMessagesUtils").FormattedText,{text:f});if(d("WAWebSystemMessagesUtils").isMe(c))return f?h._(/*BTDS*/"__JHASH__qz9eLl4MSVC__JHASH__",[h._param("group_subject",a)]):h._(/*BTDS*/"__JHASH__gFOO0xmUCNX__JHASH__");else if(f)return e!=null?h._(/*BTDS*/"__JHASH__k8PK_KYGaX-__JHASH__",[h._param("user_name",e),h._param("group_subject",a)]):h._(/*BTDS*/"__JHASH__DITV_eY-TrO__JHASH__",[h._param("group_subject",a)]);if(e!=null){c=b?b.title():"";return c.trim()===""?h._(/*BTDS*/"__JHASH__VLr0DS5GZRY__JHASH__",[h._param("user_name",e)]):h._(/*BTDS*/"__JHASH__k8PK_KYGaX-__JHASH__",[h._param("user_name",e),h._param("group_subject",c)])}return h._(/*BTDS*/"__JHASH__iEX5m5FoSPo__JHASH__")}a.displayName=a.name+" [from "+f.id+"]";g.formatCreateNotification=a}),226); __d("WAWebFormatCreatedSubgroupSuggestionNotification",["fbt","WAWebFormatParticipantNames","WAWebSystemMessageGatingUtils"],(function(a,b,c,d,e,f,g,h){function a(a,b,c){a=d("WAWebFormatParticipantNames").getFormattedName(a,c);c=b[0];b=d("WAWebSystemMessageGatingUtils").systemMessageActionTextStylingEnabled();return b?h._(/*BTDS*/"__JHASH__1l0UMR6G_Jg__JHASH__",[h._param("suggestion-owner",a),h._param("suggested-group-name",c)]):h._(/*BTDS*/"__JHASH__B5pdNqBQFFT__JHASH__",[h._param("suggestion-owner",a),h._param("suggested-group-name",c)])}g["default"]=a}),226); __d("WAWebFormatDeleteNotification",["fbt","WAWebChatGroupUtils"],(function(a,b,c,d,e,f,g,h){function a(a){a=a.chat;return d("WAWebChatGroupUtils").isCommunityAnnouncementGroup(a)?h._(/*BTDS*/"__JHASH__mxx81v4QY5A__JHASH__"):d("WAWebChatGroupUtils").isSupportGroup(a)?h._(/*BTDS*/"__JHASH__R2_xVN5V2XJ__JHASH__"):h._(/*BTDS*/"__JHASH__PqIPmn4VVgX__JHASH__")}g.formatDeleteNotification=a}),226); __d("WAWebWamEnumSystemMessageTypeType",[],(function(a,b,c,d,e,f){a=Object.freeze({E2E_ENCRYPTED_MESSAGES_CALLS:1,E2E_ENCRYPTED_MESSAGES:2,E2E_ENCRYPTED_BROADCAST_LIST:3,E2E_ENCRYPTED_MESSAGE_YOURSELF:4,OFFICIAL_ACCOUNT_INFO:8,GROUP_ADD:9,GROUP_RESET_INVITE:10,COMMUNITY_DESCRIPTION_CHANGED:11,GROUP_DESCRIPTION_CHANGED:12,GROUP_PARTICIPANTS_CHANGED:13,COMMUNITY_MEMBERS_CHANGED:14,GROUP_INVITE_LINK_UNAVAILABLE:15,GROUP_INVITE_LINK_AVAILABLE:16,GROUP_JOIN_REQUEST:17,GROUP_SUGGEST:18});f.SYSTEM_MESSAGE_TYPE_TYPE=a}),66); __d("WAWebFormatDescriptionNotification",["fbt","WAWebSystemMessageGatingUtils","WAWebSystemMessagesUtils","WAWebWamEnumSystemMessageTypeType"],(function(a,b,c,d,e,f,g,h){var i=d("WAWebSystemMessageGatingUtils").systemMessageActionTextStylingEnabled();function j(a){var b=a.author,c=a.authorClickable,e=a.isParentGroup;e=e===void 0?!1:e;a=a.shouldFormatAsLastMsg;a=a===void 0?!1:a;if(a){if(d("WAWebSystemMessagesUtils").isMe(b))return e===!0?{text:h._(/*BTDS*/"__JHASH__rEwDaO-74eH__JHASH__"),enumType:d("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.COMMUNITY_DESCRIPTION_CHANGED}:{text:h._(/*BTDS*/"__JHASH__mUiGzoosvhe__JHASH__"),enumType:d("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.GROUP_DESCRIPTION_CHANGED};else if(c!=null)return e===!0?{text:h._(/*BTDS*/"__JHASH__mLdX6iSoxJJ__JHASH__",[h._param("user_name",c)]),enumType:d("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.COMMUNITY_DESCRIPTION_CHANGED}:{text:h._(/*BTDS*/"__JHASH__-NBUziJx978__JHASH__",[h._param("user_name",c)]),enumType:d("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.GROUP_DESCRIPTION_CHANGED};return e===!0?{text:h._(/*BTDS*/"__JHASH__9zLGFMsYIe5__JHASH__"),enumType:d("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.COMMUNITY_DESCRIPTION_CHANGED}:{text:h._(/*BTDS*/"__JHASH__1jYeti3AsGP__JHASH__"),enumType:d("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.GROUP_DESCRIPTION_CHANGED}}if(d("WAWebSystemMessagesUtils").isMe(b))return e===!0?{text:i?h._(/*BTDS*/"__JHASH__t_j94ad5YJf__JHASH__"):h._(/*BTDS*/"__JHASH__eRb43gZowig__JHASH__"),enumType:d("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.COMMUNITY_DESCRIPTION_CHANGED}:{text:i?h._(/*BTDS*/"__JHASH__3vrLxPctyCO__JHASH__"):h._(/*BTDS*/"__JHASH__qoeKQ6oAHl1__JHASH__"),enumType:d("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.GROUP_DESCRIPTION_CHANGED};else if(c!=null)return e===!0?{text:i?h._(/*BTDS*/"__JHASH__C-9upMEUQ6N__JHASH__",[h._param("user_name",c)]):h._(/*BTDS*/"__JHASH__BsETYJ1iF7O__JHASH__",[h._param("user_name",c)]),enumType:d("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.COMMUNITY_DESCRIPTION_CHANGED}:{text:i?h._(/*BTDS*/"__JHASH__opIQiaNOEt8__JHASH__",[h._param("user_name",c)]):h._(/*BTDS*/"__JHASH__bMJVrUq-155__JHASH__",[h._param("user_name",c)]),enumType:d("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.GROUP_DESCRIPTION_CHANGED};return e===!0?{text:i?h._(/*BTDS*/"__JHASH__Xp8KS2XmvzW__JHASH__"):h._(/*BTDS*/"__JHASH__aoHzWwu4PqD__JHASH__"),enumType:d("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.COMMUNITY_DESCRIPTION_CHANGED}:{text:i?h._(/*BTDS*/"__JHASH__TVgzEFZZhdQ__JHASH__"):h._(/*BTDS*/"__JHASH__VANGI9EhHnE__JHASH__"),enumType:d("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.COMMUNITY_DESCRIPTION_CHANGED}}function a(a){var b=a.author,c=a.authorClickable,d=a.isParentGroup;d=d===void 0?!1:d;a=a.shouldFormatAsLastMsg;a=a===void 0?!1:a;return j({author:b,authorClickable:c,isParentGroup:d,shouldFormatAsLastMsg:a}).text}g.formatDescriptionNotification=a}),226); __d("WAWebLimitSharingGatingUtils",["WAWebABProps"],(function(a,b,c,d,e,f,g){"use strict";function a(){return d("WAWebABProps").getABPropConfigValue("render_updated_disclosure")}function b(){return d("WAWebABProps").getABPropConfigValue("limit_sharing_enabled_for_group_chat")}function c(){return d("WAWebABProps").getABPropConfigValue("limit_sharing_enabled_for_1on1_chat")}function e(){return d("WAWebABProps").getABPropConfigValue("limit_sharing_protocol_message_receiver_enabled")}g.isRenderUpdatedDisclosureGatingEnabled=a;g.isLimitSharingSetterGatingEnabledForGroupChat=b;g.isLimitSharingSetterGatingEnabledFor1on1Chat=c;g.isLimitSharingReceiverGatingEnabledForChat=e}),98); __d("WAWebSupportChatStrings",["fbt"],(function(a,b,c,d,e,f,g,h){function a(){return h._(/*BTDS*/"__JHASH__0r8elpBidB1__JHASH__")}function b(){return h._(/*BTDS*/"__JHASH__2dZoQlcqYq-__JHASH__")}function c(){return h._(/*BTDS*/"__JHASH__VfxYH48RNuC__JHASH__")}function d(){return h._(/*BTDS*/"__JHASH__6vsNUtc0j-u__JHASH__")}function e(){return h._(/*BTDS*/"__JHASH__9UMSCFpd0fN__JHASH__")}function f(){return h._(/*BTDS*/"__JHASH__6kfyjvlooAM__JHASH__")}function i(){return h._(/*BTDS*/"__JHASH__dPnEH-rk99L__JHASH__")}function j(){return h._(/*BTDS*/"__JHASH__iIl2UNqLMqQ__JHASH__")}function k(){return h._(/*BTDS*/"__JHASH__9GKPLDAxUEh__JHASH__")}function l(){return h._(/*BTDS*/"__JHASH__bXO3zsKDisu__JHASH__")}function m(){return h._(/*BTDS*/"__JHASH__oMltytkoNzZ__JHASH__")}function n(){return h._(/*BTDS*/"__JHASH__QbWKj1BgJJi__JHASH__")}function o(){return h._(/*BTDS*/"__JHASH__YW4kgvPMV_h__JHASH__")}function p(){return h._(/*BTDS*/"__JHASH__qUguzLqduL4__JHASH__")}g.SupportChatSubtitle=a;g.SupportChatSystemMessage=b;g.SupportChatLearnMoreLinkText=c;g.SupportChatSecurityModalText=d;g.SupportChatDescription=e;g.SupportChatStartButtonText=f;g.SupportChatConfirmationModalText=i;g.SupportChatDeviceInfoAIDisclaimer=j;g.SupportChatDeviceInfoAISmbDisclaimer=k;g.SupportAINuxDisclaimer=l;g.SupportAINuxSmbDisclaimer=m;g.SupportChatDeviceInfoDisclaimer=n;g.SupportChatNoInternetModalTitle=o;g.SupportChatNoInternetModalMessage=p}),226); __d("WAWebFormatE2ENotification",["fbt","WALogger","WAWebABPropsSupportGroup","WAWebChatGetters","WAWebChatGroupUtils","WAWebContactCollection","WAWebContactGetters","WAWebFormatE2ENotificationForDeviceChange","WAWebFrontendContactGetters","WAWebFrontendMsgGetters","WAWebLimitSharingGatingUtils","WAWebSupportChatStrings","WAWebSystemMessageGatingUtils","WAWebUserPrefsMeUser","WAWebWamEnumSystemMessageTypeType","WAWebWid","WAWebWidFormat"],(function(a,b,c,d,e,f,g,h){function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["generateE2ENotification: receive identity notification of self"]);i=function(){return a};return a}function j(a){var b=d("WAWebSystemMessageGatingUtils").systemMessageActionTextStylingEnabled();switch(a.subtype){case"identity":var e=a.body==null?null:d("WAWebContactCollection").ContactCollection.get(a.body);if(e!=null&&d("WAWebContactGetters").getIsMe(e)){d("WALogger").ERROR(i()).sendLogs("SelfIdentityNotificationError");var f=d("WAWebFrontendMsgGetters").getChat(a.unsafe());if(d("WAWebChatGetters").getIsUser(f)){var g=f.contact?d("WAWebFrontendContactGetters").getFormattedName(f.contact):d("WAWebWidFormat").widToFormattedUser(f.id);return{text:b?h._(/*BTDS*/"__JHASH__iAJlweVMIXA__JHASH__",[h._param("contactName",g)]):h._(/*BTDS*/"__JHASH__Y0clu2dPq25__JHASH__",[h._param("contactName",g)])}}else if(d("WAWebChatGetters").getIsGroup(f))return{text:b?h._(/*BTDS*/"__JHASH__KXAqItH86-Z__JHASH__"):h._(/*BTDS*/"__JHASH__d24_7Mm9yEv__JHASH__")};else if(d("WAWebChatGetters").getIsBroadcast(f))return{text:b?h._(/*BTDS*/"__JHASH__tkiGYDLio93__JHASH__"):h._(/*BTDS*/"__JHASH__kJkaRPeEqgX__JHASH__")}}g=e?d("WAWebFrontendContactGetters").getFormattedName(e):d("WAWebWidFormat").widToFormattedUser(a.body);return{text:b?h._(/*BTDS*/"__JHASH__iAJlweVMIXA__JHASH__",[h._param("contactName",g)]):h._(/*BTDS*/"__JHASH__Y0clu2dPq25__JHASH__",[h._param("contactName",g)])};case"device":return{text:d("WAWebFormatE2ENotificationForDeviceChange").formatE2ENotificationForDeviceChange(a),enumType:d("WAWebFormatE2ENotificationForDeviceChange").getE2ENotificationForDeviceChangeEnum(a)};case"encrypt":f=a.id.remote;if(c("WAWebWid").isGroup(f)){if(d("WAWebChatGroupUtils").isSupportGroup(d("WAWebFrontendMsgGetters").getMaybeChat(a.unsafe())))return{text:d("WAWebSupportChatStrings").SupportChatSystemMessage()};return d("WAWebLimitSharingGatingUtils").isRenderUpdatedDisclosureGatingEnabled()?{text:b?h._(/*BTDS*/"__JHASH__XazDEgv5Y3o__JHASH__"):h._(/*BTDS*/"__JHASH__ePVpZsTzbnk__JHASH__"),enumType:d("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.E2E_ENCRYPTED_MESSAGES}:{text:b?h._(/*BTDS*/"__JHASH__EsI0hg2O-ib__JHASH__"):h._(/*BTDS*/"__JHASH__h82RUqM6Eje__JHASH__"),enumType:d("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.E2E_ENCRYPTED_MESSAGES}}else if(c("WAWebABPropsSupportGroup")(f.user))return{text:d("WAWebSupportChatStrings").SupportChatSystemMessage()};else if(c("WAWebWid").isBroadcast(f))return{text:b?h._(/*BTDS*/"__JHASH__96RBlZVf-uw__JHASH__"):h._(/*BTDS*/"__JHASH__-xfFULu0lpe__JHASH__"),enumType:d("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.E2E_ENCRYPTED_BROADCAST_LIST};else if(d("WAWebUserPrefsMeUser").isMeAccount(f))return d("WAWebLimitSharingGatingUtils").isRenderUpdatedDisclosureGatingEnabled()?{text:b?h._(/*BTDS*/"__JHASH__Zx9sGyf9ZGn__JHASH__"):h._(/*BTDS*/"__JHASH__BomzdYDN7w2__JHASH__"),enumType:d("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.E2E_ENCRYPTED_MESSAGE_YOURSELF}:{text:b?h._(/*BTDS*/"__JHASH__RC55y4iaCQC__JHASH__"):h._(/*BTDS*/"__JHASH__e89sUCjusrI__JHASH__"),enumType:d("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.E2E_ENCRYPTED_MESSAGE_YOURSELF};return d("WAWebLimitSharingGatingUtils").isRenderUpdatedDisclosureGatingEnabled()?{text:b?h._(/*BTDS*/"__JHASH__cL12twlmckR__JHASH__"):h._(/*BTDS*/"__JHASH__A9z70sEIkHI__JHASH__"),enumType:d("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.E2E_ENCRYPTED_MESSAGES}:{text:b?h._(/*BTDS*/"__JHASH__lATbzIm6AOC__JHASH__"):h._(/*BTDS*/"__JHASH__Dprz8wUXmKN__JHASH__"),enumType:d("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.E2E_ENCRYPTED_MESSAGES};case"encrypt_now":return d("WAWebLimitSharingGatingUtils").isRenderUpdatedDisclosureGatingEnabled()?{text:b?h._(/*BTDS*/"__JHASH__OD3Xwiy8M7f__JHASH__"):h._(/*BTDS*/"__JHASH__gCbRpw-HP3k__JHASH__"),enumType:d("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.E2E_ENCRYPTED_MESSAGES_CALLS}:{text:b?h._(/*BTDS*/"__JHASH__nToESVFUtD-__JHASH__"):h._(/*BTDS*/"__JHASH__n6lvEtbdRv4__JHASH__"),enumType:d("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.E2E_ENCRYPTED_MESSAGES_CALLS};case"e2e_identity_unavailable":return{text:h._(/*BTDS*/"__JHASH__BmTELsfRzRg__JHASH__")};case"chat_psa":return{text:b?h._(/*BTDS*/"__JHASH__fvOQZZ-lprj__JHASH__"):h._(/*BTDS*/"__JHASH__zZN-rSjj4JW__JHASH__"),enumType:d("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.OFFICIAL_ACCOUNT_INFO};default:return{text:""}}}function a(a){return j(a).text}function b(a){return j(a).enumType}g.formatE2ENotification=a;g.getE2ENotificationEnum=b}),226); __d("WAWebFormatE2ENotificationForDeviceChange",["fbt","invariant","WAWebChatGetters","WAWebContactCollection","WAWebContactGetters","WAWebFrontendContactGetters","WAWebFrontendMsgGetters","WAWebSystemMessageGatingUtils","WAWebWidFormat"],(function(a,b,c,d,e,f,g,h,i){function j(a,b){b===void 0&&(b=!1);a.subtype==="device"||i(0,56347);var c=d("WAWebSystemMessageGatingUtils").systemMessageActionTextStylingEnabled(),e=a.body?d("WAWebContactCollection").ContactCollection.get(a.body):null,f,g=a.devicesAdded===1&&a.devicesRemoved===0,j=a.devicesAdded===0&&a.devicesRemoved===1,k=!g&&!j;if(e!=null&&d("WAWebContactGetters").getIsMe(e)){var l=d("WAWebFrontendMsgGetters").getChat(a.unsafe());if(d("WAWebChatGetters").getIsUser(l)){var m=d("WAWebFrontendContactGetters").getFormattedName(l.contact);!b?f=c?h._(/*BTDS*/"__JHASH__iAJlweVMIXA__JHASH__",[h._param("contactName",m)]):h._(/*BTDS*/"__JHASH__Y0clu2dPq25__JHASH__",[h._param("contactName",m)]):g?a.isThisDeviceAdded?f=h._(/*BTDS*/"__JHASH__bwXmvErxScx__JHASH__",[h._param("contactName",m)]):f=h._(/*BTDS*/"__JHASH__dUjWiVvXwSa__JHASH__",[h._param("contactName",m)]):j?f=h._(/*BTDS*/"__JHASH__ACqaQ72vBxC__JHASH__",[h._param("contactName",m)]):k&&(f=h._(/*BTDS*/"__JHASH__hHBVJHSHiUq__JHASH__",[h._param("contactName",m)]))}else d("WAWebChatGetters").getIsGroup(l)?!b?f=c?h._(/*BTDS*/"__JHASH__KXAqItH86-Z__JHASH__"):h._(/*BTDS*/"__JHASH__d24_7Mm9yEv__JHASH__"):g?a.isThisDeviceAdded?f=h._(/*BTDS*/"__JHASH__VkApoG3MnPD__JHASH__"):f=h._(/*BTDS*/"__JHASH__sYzckmA1A8g__JHASH__"):j?f=h._(/*BTDS*/"__JHASH__82M1aI7aNzf__JHASH__"):k&&(f=h._(/*BTDS*/"__JHASH__YST1pd8T_0c__JHASH__")):d("WAWebChatGetters").getIsBroadcast(l)&&(!b?f=c?h._(/*BTDS*/"__JHASH__tkiGYDLio93__JHASH__"):h._(/*BTDS*/"__JHASH__kJkaRPeEqgX__JHASH__"):g?a.isThisDeviceAdded?f=h._(/*BTDS*/"__JHASH__X385zLUpJa1__JHASH__"):f=h._(/*BTDS*/"__JHASH__OkxmRes6dTV__JHASH__"):j?f=h._(/*BTDS*/"__JHASH__Gtd58JvkzFk__JHASH__"):k&&(f=h._(/*BTDS*/"__JHASH__KQAP2o387cr__JHASH__")))}else{m=a.body;e=m==null?null:d("WAWebContactCollection").ContactCollection.get(m);l=e?d("WAWebFrontendContactGetters").getFormattedName(e):d("WAWebWidFormat").widToFormattedUser(m);!b?f=c?h._(/*BTDS*/"__JHASH__iAJlweVMIXA__JHASH__",[h._param("contactName",l)]):h._(/*BTDS*/"__JHASH__Y0clu2dPq25__JHASH__",[h._param("contactName",l)]):g?f=h._(/*BTDS*/"__JHASH__RPRLzpTxBtv__JHASH__",[h._param("contactName",l)]):j?f=h._(/*BTDS*/"__JHASH__CHadHJK-X-r__JHASH__",[h._param("contactName",l)]):k&&(f=h._(/*BTDS*/"__JHASH__fiVap3egZBO__JHASH__",[h._param("contactName",l)]))}f!=null||i(0,56348);return{text:f}}function a(a,b){b===void 0&&(b=!1);return j(a,b).text}function b(a,b){b===void 0&&(b=!1);return j(a,b).enumType}g.formatE2ENotificationForDeviceChange=a;g.getE2ENotificationForDeviceChangeEnum=b}),226); __d("WAWebFormatEphemeralSetting",["fbt","WALogger","WANullthrows","WAWebABProps","WAWebBizCoexGatingUtils","WAWebChatEphemerality","WAWebContactCollection","WAWebContactGetters","WAWebEphemeralConstants","WAWebEphemeralFbtKic","WAWebEphemeralityTypes","WAWebFrontendContactGetters","WAWebFrontendMsgGetters","WAWebStateUtils","WAWebUserPrefsMeUser","WAWebWid","err"],(function(a,b,c,d,e,f,g,h){function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Cannot parse msg to build DM system message"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["getDisappearingMessageDurationString: Weeks are not an option for DM system messages"]);j=function(){return a};return a}function a(a){a=m(a);var b=a.newDuration;a=a.initiatingUser;var e=d("WAWebUserPrefsMeUser").isMeAccount(c("WANullthrows")(a));if(e)e=d("WAWebEphemeralFbtKic").getDisappearingModeYouStringKic(b);else{a=d("WAWebContactCollection").ContactCollection.gadd(c("WANullthrows")(a));e=d("WAWebEphemeralFbtKic").getDisappearingModeOtherStringKic(b,d("WAWebFrontendContactGetters").getFormattedName(a))}return e}function b(a){return r(d("WAWebStateUtils").unproxy(a.unsafe()))}function k(a){if(d("WAWebFrontendMsgGetters").getChat(a)!=null){var b=d("WAWebFrontendMsgGetters").getChat(a).msgs;a=b.indexOf(a);for(a=a-1;a>=0;a--){var c=b.at(a);if(c!=null&&c.type!=="debug"&&(c.type!=="gp2"||c.subtype==="ephemeral"))return c}}}function l(a){a=k(a);if(a!=null){if(a.ephemeralDuration!=null&&a.ephemeralDuration>0)return!0;if((a.subtype==="ephemeral"||a.subtype==="disappearing_mode")&&a.templateParams[0]!=null&&a.templateParams[0]!=="0")return!0}return!1}function m(a){var b,d;a.templateParams.length?(d=parseInt(a.templateParams[0],10),b=a.templateParams[1]):(b=a.ephemeralSettingUser,d=a.ephemeralDuration);if(d==null)throw c("err")("Duration cannot be null for DM notification");return{newDuration:(a=d)!=null?a:0,disappearingModeTrigger:null,initiatingUser:b}}function n(a){var b,c;a.ephemeralSettingUser!==void 0?c=a.ephemeralSettingUser:c=a.from;return{newDuration:(b=a.ephemeralDuration)!=null?b:0,disappearingModeTrigger:a.disappearingModeTrigger,initiatingUser:c}}function o(a){var b=a.initiatorUsername,c=a.initiatorIsMe;a=a.state;if(c){if(a==="update")return h._(/*BTDS*/"__JHASH__k3foWD6C0Ou__JHASH__");else if(a==="on")return h._(/*BTDS*/"__JHASH__3rvxQm7fwnn__JHASH__");return h._(/*BTDS*/"__JHASH__rDEaHtlRT7d__JHASH__")}else if(b!=null){if(a==="update")return h._(/*BTDS*/"__JHASH__bWukMNoK9Lm__JHASH__",[h._param("name",b)]);else if(a==="on")return h._(/*BTDS*/"__JHASH__h4UAN3cCjDo__JHASH__",[h._param("name",b)]);return h._(/*BTDS*/"__JHASH__00g0Y0b6u5g__JHASH__",[h._param("name",b)])}if(a==="update")return h._(/*BTDS*/"__JHASH__6_ExMnWmekp__JHASH__");else if(a==="on")return h._(/*BTDS*/"__JHASH__95BnGlLz6rC__JHASH__");return h._(/*BTDS*/"__JHASH__5-3TGa3WQMS__JHASH__")}function p(a){a=d("WAWebEphemeralConstants").getDurationForString(a);var b=a.duration;a=a.unit;switch(a){case d("WAWebEphemeralConstants").DurationUnit.Seconds:return h._(/*BTDS*/"__JHASH__Svoe5IvXqcl__JHASH__",[h._plural(b,"duration")]);case d("WAWebEphemeralConstants").DurationUnit.Minutes:return h._(/*BTDS*/"__JHASH__5ijP7aYFO6I__JHASH__",[h._plural(b,"duration")]);case d("WAWebEphemeralConstants").DurationUnit.Hours:return h._(/*BTDS*/"__JHASH__2S8rQ_MOanH__JHASH__",[h._plural(b,"duration")]);case d("WAWebEphemeralConstants").DurationUnit.Days:return h._(/*BTDS*/"__JHASH__a_D-Dk9bl1Z__JHASH__",[h._plural(b,"duration")]);case d("WAWebEphemeralConstants").DurationUnit.Weeks:d("WALogger").ERROR(j());return h._(/*BTDS*/"__JHASH__77BlMqYl-i2__JHASH__",[h._plural(b,"duration")])}}function q(a){a=p(a);return h._(/*BTDS*/"__JHASH__s7aA3WqFfRa__JHASH__",[h._param("dm-duration",a)])}function r(a){var b=null;switch(a.type){case"gp2":case"notification_template":b=m(a);break;case"protocol":b=n(a);break;default:break}if(b==null){d("WALogger").ERROR(i()).tags("DM","DDM").devConsole(a);throw c("err")("Cannot parse msg to build DM system message")}var e=null,f=d("WAWebUserPrefsMeUser").isMePrimary(b.initiatingUser);if(d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&b.disappearingModeTrigger===d("WAWebEphemeralityTypes").DisappearingModeTrigger.BizSupportFbHosting)return s(f);var g=null;!b.newDuration?g="off":l(a)?g="update":g="on";g==="update"&&!d("WAWebABProps").getABPropConfigValue("dm_updated_system_message")&&(g="on");if(b.initiatingUser!=null&&!f){var h=d("WAWebContactCollection").ContactCollection.gadd(b.initiatingUser);e=d("WAWebContactGetters").getIsMyContact(h)?d("WAWebFrontendContactGetters").getFormattedName(h):d("WAWebFrontendContactGetters").getFormattedPhone(h)}h=d("WAWebFrontendMsgGetters").getMaybeChat(a);h=h&&d("WAWebChatEphemerality").shouldShowEphemeralSetting(h)&&(c("WAWebWid").isUser(h.id)||((a=h.groupMetadata)==null?void 0:a.canSetEphemeralSetting()));return t({newDuration:b.newDuration,state:g,initiatorUsername:e,initiatorIsMe:f,userCanChange:h===!0})}function s(a){var b=h._(/*BTDS*/"__JHASH__VxKDXwmrZZX__JHASH__"),c=h._(/*BTDS*/"__JHASH__ShGMzMOpsve__JHASH__");return a?c:b}function t(a){var b=a.newDuration,c=a.state,d=a.initiatorUsername,e=a.initiatorIsMe;a=a.userCanChange;d=o({initiatorUsername:d,initiatorIsMe:e,state:c});e=h._(/*BTDS*/"__JHASH__B_GrurKg9Zj__JHASH__");if(!b)return a!==!0?d:h._(/*BTDS*/"__JHASH__giEibd2apxO__JHASH__",[h._param("dm-sm-event",d),h._param("dm-sm-action",e)]);c=q(b);return a!==!0?h._(/*BTDS*/"__JHASH__cXCgiG67rv3__JHASH__",[h._param("dm-sm-event",d),h._param("dm-sm-explanation",c)]):h._(/*BTDS*/"__JHASH__FCc2NfFv7a7__JHASH__",[h._param("dm-sm-event",d),h._param("dm-sm-explanation",c),h._param("dm-sm-action",e)])}function e(){return h._(/*BTDS*/"__JHASH__g_28ORDvVoq__JHASH__")}g.getDefaultDisappearingModeSystemMessageText=a;g.getDisappearingModeUpdateSystemMessageText=b;g.getDisappearingMessageDurationString=p;g.formatEphemeralSetting=r;g.buildEphemeralSystemMessage=t;g.getDMUnsupportedSystemMessageText=e}),226); __d("WAWebFormatAllowNonAdminSubGroupCreationNotification",["fbt","WAWebCommunityGatingUtils","WAWebGroupType"],(function(a,b,c,d,e,f,g,h){function a(a,b){b=b[0]&&d("WAWebGroupType").GroupSettingChangeSystemMessageToggleEnabled.cast(b[0].toString())===d("WAWebGroupType").GroupSettingChangeSystemMessageToggleEnabled.On;a=Boolean((a=a.groupMetadata)==null?void 0:a.participants.iAmAdmin());if(b)return a?h._(/*BTDS*/"__JHASH__7yApn3Wzx7J__JHASH__"):h._(/*BTDS*/"__JHASH__n-VxxNLTED3__JHASH__");return d("WAWebCommunityGatingUtils").memberSuggestedGroupsEnabled()?a?h._(/*BTDS*/"__JHASH__f1zUEt58a97__JHASH__"):h._(/*BTDS*/"__JHASH__Re-cRpx9YxY__JHASH__"):a?h._(/*BTDS*/"__JHASH__xU6DWFBsD9y__JHASH__"):h._(/*BTDS*/"__JHASH__SOsR9yiCq-c__JHASH__")}g["default"]=a}),226); __d("WAWebMessageCommunityEmptySubgroupWelcomeTitle.react",["fbt"],(function(a,b,c,d,e,f,g,h){function a(a){return h._(/*BTDS*/"__JHASH__AUDnV1NrRJA__JHASH__",[h._param("subgroup_name",a)])}g.communityEmptySubgroupWelcomeTitle=a}),226); __d("WAWebMessageCommunityGeneralChatAutoAddDisabledNotification.react",["fbt","WAWebCommunityGatingUtils","WAWebGroupType"],(function(a,b,c,d,e,f,g,h){function a(a,b){b=(b=d("WAWebGroupType").GeneralChatAutoAddDisabledReasonEnum.cast((b=b[0])==null?void 0:b.toString()))!=null?b:d("WAWebGroupType").GeneralChatAutoAddDisabledReasonEnum.Full;if(b===d("WAWebGroupType").GeneralChatAutoAddDisabledReasonEnum.Server)return h._(/*BTDS*/"__JHASH__9t2bgshlQvg__JHASH__");return d("WAWebCommunityGatingUtils").communityGeneralChatV2Enabled()?h._(/*BTDS*/"__JHASH__F_Otx8VJEac__JHASH__",[h._param("subgroup_name",a)]):h._(/*BTDS*/"__JHASH__dVT-fzi2lLN__JHASH__",[h._param("subgroup_name",a)])}g.communityGeneralChatAutoAddDisabledNotification=a}),226); __d("WAWebMessageCommunityGeneralChatWelcomeTitle.react",["fbt"],(function(a,b,c,d,e,f,g,h){function a(a){return h._(/*BTDS*/"__JHASH__4cCqp0IsQi4__JHASH__",[h._param("subgroup_name",a)])}g.communityGeneralChatWelcomeTitle=a}),226); __d("WAWebFormatGroupNotification",["fbt","WALogger","WAWebChatGroupUtils","WAWebContactCollection","WAWebFormatAddNotification","WAWebFormatAllowNonAdminSubGroupCreationNotification","WAWebFormatAnnounceNotification","WAWebFormatCommunityOwnerUpdateNotification","WAWebFormatCreateNotification","WAWebFormatCreatedSubgroupSuggestionNotification","WAWebFormatDeleteNotification","WAWebFormatDescriptionNotification","WAWebFormatEphemeralSetting","WAWebFormatLeaveNotification","WAWebFormatLinkNotification","WAWebFormatMembershipApprovalNotification","WAWebFormatParticipantNames","WAWebFormatPictureNotification","WAWebFormatPromoteDemoteNotification","WAWebFormatRemoveNotification","WAWebFormatReportToAdminNotification","WAWebFormatRestrictNotification","WAWebFormatSubjectNotification","WAWebFrontendContactGetters","WAWebFrontendMsgGetters","WAWebL10N","WAWebMessageCommunityEmptySubgroupWelcomeTitle.react","WAWebMessageCommunityGeneralChatAutoAddDisabledNotification.react","WAWebMessageCommunityGeneralChatWelcomeTitle.react","WAWebMessageCommunityLinkGroup.react","WAWebMessageCommunitySubgroupWelcome.react","WAWebMessageCommunityWelcomeAdmin.react","WAWebMessageCommunityWelcomeMember.react","WAWebUserPrefsMeUser","WAWebWidFormat"],(function(a,b,c,d,e,f,g,h){function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["wa:formatGroupNotification:unknown message subtype: ",""]);i=function(){return a};return a}function a(a,b){var e="",f=a.get("type"),g=a.get("subtype"),j=a.displayName(),k=a.get("author"),l=a.get("body"),m,n;b=!!b;if(f!=="gp2")return e;f=a.recipients||[];var o=d("WAWebFormatParticipantNames").getFormattedNames(f,!1),p=f[0],q=p?d("WAWebContactCollection").ContactCollection.get(p):void 0;q=q?d("WAWebFrontendContactGetters").getFormattedName(q):p?d("WAWebWidFormat").widToFormattedUser(p):"";switch(g){case"add":e=d("WAWebFormatAddNotification").formatAddNotification({author:k,authorClickable:j,subject:p,subjectClickable:q,participantsClickable:o});break;case"remove":e=d("WAWebFormatRemoveNotification").formatRemoveNotification({author:k,authorClickable:j,subject:p,subjectClickable:q,participantsClickable:o});break;case"leave":e=d("WAWebFormatLeaveNotification").formatLeaveNotification({body:l,subject:p,participantsClickable:o});break;case"picture":e=d("WAWebFormatPictureNotification").formatPictureNotification({author:k,authorClickable:j,body:l});break;case"subject":e=d("WAWebFormatSubjectNotification").formatSubjectNotification(d("WAWebFrontendMsgGetters").getChat(a),k,j,l);break;case"modify":m=d("WAWebWidFormat").widToFormattedUser(k);n=d("WAWebWidFormat").widToFormattedUser(p);e=m===j?h._(/*BTDS*/"__JHASH__ed6NlgAnz8g__JHASH__",[h._param("name",j),h._param("new_number",n)]):h._(/*BTDS*/"__JHASH__iFi7c7YeI-4__JHASH__",[h._param("name",j)]);break;case"create":e=d("WAWebFormatCreateNotification").formatCreateNotification({author:k,authorClickable:j,groupSubject:l,groupSubjectAsString:!0});break;case"delete":e=d("WAWebFormatDeleteNotification").formatDeleteNotification({chat:d("WAWebFrontendMsgGetters").getChat(a)});break;case"promote":case"demote":case"linked_group_promote":case"linked_group_demote":e=d("WAWebFormatPromoteDemoteNotification").formatPromoteDemoteNotification({subtype:g,subject:p,subjectClickable:q,participantsClickable:o,participantsCount:f.length});break;case"invite":e=d("WAWebUserPrefsMeUser").isMeAccount(p)?h._(/*BTDS*/"__JHASH__vzqFfqy3krS__JHASH__"):h._(/*BTDS*/"__JHASH__JdnUywS1T79__JHASH__",[h._param("name",q)]);break;case"revoke_invite":e=d("WAWebUserPrefsMeUser").isMeAccount(k)?h._(/*BTDS*/"__JHASH__LVdgDZRSuUW__JHASH__"):h._(/*BTDS*/"__JHASH__pUHmVoO3zQe__JHASH__",[h._param("name",j)]);break;case"description":e=d("WAWebFormatDescriptionNotification").formatDescriptionNotification({author:k,authorClickable:j,shouldFormatAsLastMsg:b});break;case"parent_group_description":e=d("WAWebFormatDescriptionNotification").formatDescriptionNotification({author:k,authorClickable:j,isParentGroup:!0,shouldFormatAsLastMsg:b});break;case"announce":e=d("WAWebFormatAnnounceNotification").formatAnnounceNotification({author:k,authorClickable:j,body:l});break;case"restrict":e=d("WAWebFormatRestrictNotification").formatRestrictNotification({author:k,authorClickable:j,templateParams:a.templateParams});break;case"no_frequently_forwarded":l==="on"?e=d("WAWebUserPrefsMeUser").isMeAccount(k)?h._(/*BTDS*/"__JHASH__4LorbqMnXy6__JHASH__"):h._(/*BTDS*/"__JHASH__q-CtyF7YZOI__JHASH__",[h._param("name",j)]):e=d("WAWebUserPrefsMeUser").isMeAccount(k)?h._(/*BTDS*/"__JHASH__62V2Fy85boC__JHASH__"):h._(/*BTDS*/"__JHASH__3A1sj_DPtTZ__JHASH__",[h._param("name",j)]);break;case"announce_msg_bounce":e=h._(/*BTDS*/"__JHASH__9aNXpW86F1v__JHASH__");break;case"v4_add_invite_sent":e=h._(/*BTDS*/"__JHASH__WF5aGcRuMMv__JHASH__",[h._param("participants",o)]).toString();break;case"v4_add_invite_join":e=h._(/*BTDS*/"__JHASH__5Q8Obf7-l5d__JHASH__",[h._param("participants",o)]).toString();break;case"ephemeral":return d("WAWebFormatEphemeralSetting").formatEphemeralSetting(a);case"growth_locked":e=h._(/*BTDS*/"__JHASH__QieMr8hjFMa__JHASH__");break;case"growth_unlocked":e=h._(/*BTDS*/"__JHASH__TAz0HUNnWBs__JHASH__");break;case"linked_group_join":case"parent_group_link":case"parent_group_link_membership_approval":case"sibling_group_link":case"sub_group_link":case"parent_group_unlink":case"sibling_group_unlink":case"sub_group_unlink":case"integrity_parent_group_unlink":case"delete_parent_group":case"delete_parent_group_unlink":case"auto_add":case"default_sub_group_admin_add":case"invite_auto_add":e=d("WAWebFormatLinkNotification").formatLinkNotifAsFbt(g,k,p,a.templateParams);break;case"community_participant_add_rich":case"community_invite_rich":case"community_invite_auto_add_rich":case"subgroup_admin_triggered_auto_add":case"subgroup_admin_triggered_invite_auto_add":e=d("WAWebMessageCommunityWelcomeMember.react").communityWelcomeMemberTitle();break;case"sub_group_participant_add_rich":case"sub_group_invite_rich":e=d("WAWebMessageCommunitySubgroupWelcome.react").communitySubgroupWelcomeTitle({templateParams:a.templateParams,clickable:!1,author:k});break;case"community_link_parent_group_rich":e=d("WAWebMessageCommunityLinkGroup.react").communityLinkGroupTitle({templateParams:a.templateParams,clickable:!1,author:k});break;case"community_create":e=d("WAWebMessageCommunityWelcomeAdmin.react").communityWelcomeAdminTitle({templateParams:a.templateParams,author:k,chat:d("WAWebFrontendMsgGetters").getChat(a)});break;case"membership_approval_mode":case"membership_approval_request":case"created_membership_requests":e=d("WAWebFormatMembershipApprovalNotification").formatMembershipApprovalNotification(g,k,a.templateParams);break;case"ephemeral_keep_in_chat":e=h._(/*BTDS*/"__JHASH__KY0z9P2_7D0__JHASH__");break;case"initial_pHash_mismatch":case"default_sub_group_promote":case"default_sub_group_demote":d("WAWebChatGroupUtils").isCommunityAnnouncementGroup(d("WAWebFrontendMsgGetters").getChat(a))?e=h._(/*BTDS*/"__JHASH__isyXKPGe8B1__JHASH__"):e=h._(/*BTDS*/"__JHASH__HuDtwmEYR1T__JHASH__");break;case"allow_admin_reports":e=d("WAWebFormatReportToAdminNotification").formatReportToAdminNotification(k,a.templateParams);break;case"allow_non_admin_sub_group_creation":e=c("WAWebFormatAllowNonAdminSubGroupCreationNotification")(d("WAWebFrontendMsgGetters").getChat(a),a.templateParams);break;case"empty_subgroup_create":m=a.templateParams[2];e=d("WAWebMessageCommunityEmptySubgroupWelcomeTitle.react").communityEmptySubgroupWelcomeTitle(m);break;case"created_subgroup_suggestion":e=c("WAWebFormatCreatedSubgroupSuggestionNotification")(k,a.templateParams,!1);break;case"general_chat_add":n=a.templateParams[1];e=d("WAWebMessageCommunityGeneralChatWelcomeTitle.react").communityGeneralChatWelcomeTitle(n);break;case"general_group_auto_add_disabled":e=d("WAWebMessageCommunityGeneralChatAutoAddDisabledNotification.react").communityGeneralChatAutoAddDisabledNotification(d("WAWebFrontendMsgGetters").getChat(a).formattedTitle,a.templateParams);break;case"community_owner_update":e=d("WAWebFormatCommunityOwnerUpdateNotification").formatCommunityOwnerUpdateNotification({author:k,templateParams:a.templateParams,clickable:!1});break;default:d("WALogger").LOG(i(),g);break}c("WAWebL10N").isRTL()&&(e=c("WAWebL10N").forceRTL(String(e)));return e}g["default"]=a}),226); __d("WAWebFormatLeaveNotification",["fbt","WAWebGroupType","WAWebSystemMessagesUtils"],(function(a,b,c,d,e,f,g,h){function a(a){var b=a.body,c=a.subject;a=a.participantsClickable;if(c)return d("WAWebSystemMessagesUtils").isMe(c)?h._(/*BTDS*/"__JHASH__grB1e4ctGFi__JHASH__"):h._(/*BTDS*/"__JHASH__2hrfpiICVjM__JHASH__",[h._param("user_name",a)]);else if(b===d("WAWebGroupType").DELETE_REASON.INTEGRITY_DELETE_PARENT)return h._(/*BTDS*/"__JHASH__mxx81v4QY5A__JHASH__");return h._(/*BTDS*/"__JHASH__F3Vb5lmYgoS__JHASH__")}g.formatLeaveNotification=a}),226); __d("WAWebStringsWithMultiplePluralParts",["fbt"],(function(a,b,c,d,e,f,g,h){function a(a,b){return h._(/*BTDS*/"__JHASH__Gwl6KHbVARL__JHASH__",[h._plural(a,"count"),h._plural(a),h._param("contact",b)]).toString()}function b(a,b){return h._(/*BTDS*/"__JHASH__-W144V9az_q__JHASH__",[h._plural(a,"count"),h._plural(a),h._param("contact",b)]).toString()}function c(a,b){return i(a,b).toString()}function i(a,b){return h._(/*BTDS*/"__JHASH__6Bi1UcvRCG3__JHASH__",[h._plural(b),h._plural(b),h._param("group-names",a.formattedNames)])}function d(a,b){return j(a,b).toString()}function j(a,b){return h._(/*BTDS*/"__JHASH__A2KZsl1T0VH__JHASH__",[h._plural(b),h._plural(b),h._param("group-names",a.formattedNames)])}g.getCannotForwardCapabilityContactString=a;g.getCannotForwardFileMissingAndCapabilityContactString=b;g.getCommunityGroupsAddedString=c;g.getCommunityGroupsAddedStringComponent=i;g.getCommunityGroupsRemovedString=d;g.getCommunityGroupsRemovedStringComponent=j}),226); __d("WAWebFormatLinkNotification",["fbt","WALogger","WAWebFormatParticipantNames","WAWebPairList","WAWebStringsWithMultiplePluralParts","WAWebUserPrefsMeUser","WAWebWid"],(function(a,b,c,d,e,f,g,h){function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["generateInviteAutoAddNotification, I am subject, has subgroup name"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["generateInviteAutoAddNotification, I am subject, not part of community"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["generateAddNotification"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["generateParentGroupLinkNotification, no author"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["generateParentGroupLinkNotification, I am not author"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["generateParentGroupLinkNotification, I am author"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["generateParentGroupUnlinkNotification, no author"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["generateParentGroupUnlinkNotification, I am not author"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["generateParentGroupUnlinkNotification, I am author"]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["generateIntegrityParentGroupUnlinkNotification"]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["generateDeleteParentGroupNotification: render community deactivate, I am not author"]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["generateDeleteParentGroupNotification: render community deactivate, I am author"]);t=function(){return a};return a}function u(){var a=babelHelpers.taggedTemplateLiteralLoose(["wa:formatLinkNotification:unknown message subtype: ",""]);u=function(){return a};return a}var v=function(a){return a instanceof c("WAWebWid")&&d("WAWebUserPrefsMeUser").isMeAccount(a)};function w(a){return!a}function a(a,b,c,d){return x(a,b,c,d,!1)}function x(a,b,c,e,f){var g=b?d("WAWebFormatParticipantNames").getFormattedName(b,f,a):null,h=c?d("WAWebFormatParticipantNames").getFormattedName(c,f):null;switch(a){case"parent_group_link":return H(e,f,b,g);case"sibling_group_link":return I(e,f,b,g,a);case"sub_group_link":break;case"parent_group_unlink":return G(e,f,b,g);case"integrity_parent_group_unlink":return F(e,f);case"delete_parent_group_unlink":case"delete_parent_group":return E(e,g,b,f);case"sibling_group_unlink":return J(e,f,b,g);case"sub_group_unlink":break;case"community_create":return K(e,f,b,g);case"linked_group_join":return L(c,h);case"auto_add":case"default_sub_group_admin_add":return M(e,f,g);case"invite_auto_add":return N(e,f,c,h);default:d("WALogger").LOG(u(),a);break}}function y(a){return h._(/*BTDS*/"__JHASH__y2wct8AIYqH__JHASH__",[h._param("community_name",a)])}function z(){return h._(/*BTDS*/"__JHASH__r6ovEWT08ss__JHASH__")}function A(a,b){return h._(/*BTDS*/"__JHASH__CS1vlNyzZ57__JHASH__",[h._param("author",a),h._param("community_name",b)])}function B(a){return h._(/*BTDS*/"__JHASH___KOPBnYq_Ha__JHASH__",[h._param("author",a)])}function C(a){return h._(/*BTDS*/"__JHASH__bkHqixFdCL0__JHASH__",[h._param("community_name",a)])}function D(){return h._(/*BTDS*/"__JHASH__zqIOyeFlODd__JHASH__")}function E(a,b,c,e){var f;a[0]!=null&&typeof a[0]==="string"&&!w(a[0])&&(f=d("WAWebFormatParticipantNames").getClickableDeactivatedCommunityName(a[0],e));if(f!=null&&b!=null){if(v(c)){d("WALogger").LOG(t());return h._(/*BTDS*/"__JHASH__G5QIOWA1Ge___JHASH__",[h._param("community",d("WAWebFormatParticipantNames").getCommunityNameInQuotationMarks(f,!e))])}d("WALogger").LOG(s());return h._(/*BTDS*/"__JHASH__JYAI3t_pCxi__JHASH__",[h._param("author",b),h._param("community",d("WAWebFormatParticipantNames").getCommunityNameInQuotationMarks(f,!e))])}if(v(c))return h._(/*BTDS*/"__JHASH__ZlDi50TPwUM__JHASH__");return b!=null?h._(/*BTDS*/"__JHASH__ZP1g9HqlhMo__JHASH__",[h._param("author",b)]):h._(/*BTDS*/"__JHASH__Q0FgCrZXH4t__JHASH__")}function F(a,b){a=d("WAWebFormatParticipantNames").getClickableIntegrityDeactivateCommunityName(a[0],a[1],b,!0);if(a!=null){d("WALogger").LOG(r());return h._(/*BTDS*/"__JHASH__twnGVK9ZAks__JHASH__",[h._param("community",d("WAWebFormatParticipantNames").getCommunityNameInQuotationMarks(a,!b))])}return h._(/*BTDS*/"__JHASH__MEeFGKwGaFB__JHASH__")}function G(a,b,c,e){a=a.slice(0);a=d("WAWebFormatParticipantNames").getFormattedCommunityNameWithAlternative({jid:a[0],asString:!b,alternativeStringName:a[1]});if(a!=null&&v(c)){d("WALogger").LOG(q());return h._(/*BTDS*/"__JHASH__9y1K2eO6onZ__JHASH__",[h._param("community",d("WAWebFormatParticipantNames").getCommunityNameInQuotationMarks(a,!b))])}else if(a==null&&v(c))return h._(/*BTDS*/"__JHASH__umn_A-_8ehC__JHASH__");else if(a!=null&&c!=null){d("WALogger").LOG(p());return h._(/*BTDS*/"__JHASH__-vDvSLKr9U-__JHASH__",[h._param("author",e),h._param("community",d("WAWebFormatParticipantNames").getCommunityNameInQuotationMarks(a,!b))])}else if(a!=null&&c==null){d("WALogger").LOG(o());return h._(/*BTDS*/"__JHASH__FgP6KUDLiy8__JHASH__",[h._param("community",d("WAWebFormatParticipantNames").getCommunityNameInQuotationMarks(a,!b))])}else if(a==null&&c!=null)return h._(/*BTDS*/"__JHASH__9XCBYFm0hPq__JHASH__",[h._param("author",e)]);return h._(/*BTDS*/"__JHASH__w7yANqoynm3__JHASH__")}function H(a,b,c,e){a=d("WAWebFormatParticipantNames").getFormattedCommunityNameWithAlternative({jid:a[0],asString:!b,alternativeStringName:a[1]});if(!w(a)&&v(c)){d("WALogger").LOG(n());return h._(/*BTDS*/"__JHASH__8NL6T3BeC0E__JHASH__",[h._param("community",d("WAWebFormatParticipantNames").getCommunityNameInQuotationMarks(a,!b))])}else if(w(a)&&v(c))return h._(/*BTDS*/"__JHASH__KSLWyjVkhr9__JHASH__");else if(!w(a)&&c!=null){d("WALogger").LOG(m());return h._(/*BTDS*/"__JHASH__PjK8xUgEjLB__JHASH__",[h._param("author",e),h._param("community",d("WAWebFormatParticipantNames").getCommunityNameInQuotationMarks(a,!b))])}else if(!w(a)&&c==null){d("WALogger").LOG(l());return h._(/*BTDS*/"__JHASH__vPNku38qhpZ__JHASH__",[h._param("community",d("WAWebFormatParticipantNames").getCommunityNameInQuotationMarks(a,!b))])}else if(w(a)&&c!=null)return h._(/*BTDS*/"__JHASH__T0_6AtiYTeo__JHASH__",[h._param("author",e)]);return h._(/*BTDS*/"__JHASH__8BjAuq8-7XC__JHASH__")}function I(a,b,c,e,f){a=a.slice(0);f=d("WAWebFormatParticipantNames").getFormattedGroupListForCommunity(a,!b,f);a=d("WAWebPairList").unFlattenPairList(a).length;if(c!=null&&!v(c))return f==null?h._(/*BTDS*/"__JHASH__BiNjS84pu6D__JHASH__",[h._plural(a,"count"),h._param("author",e)]):h._(/*BTDS*/"__JHASH__MiHjHn8j97J__JHASH__",[h._plural(a),h._param("author",e),h._param("groups",f)]);if(f==null)return h._(/*BTDS*/"__JHASH__BJcNwPWNm-y__JHASH__",[h._plural(a,"count")]);return!b?d("WAWebStringsWithMultiplePluralParts").getCommunityGroupsAddedString({formattedNames:f},a):d("WAWebStringsWithMultiplePluralParts").getCommunityGroupsAddedStringComponent({formattedNames:f,count:a},a)}function J(a,b,c,e){a=a.slice(0);var f=d("WAWebFormatParticipantNames").getFormattedGroupListForCommunity(a,!b);a=d("WAWebPairList").unFlattenPairList(a).length;if(c!=null&&!v(c))return f==null?h._(/*BTDS*/"__JHASH__ZfOUwhpSUuX__JHASH__",[h._plural(a,"count"),h._param("author",e)]):h._(/*BTDS*/"__JHASH__Y2T7D278TOi__JHASH__",[h._plural(a),h._param("author",e),h._param("groups",f)]);if(f==null)return h._(/*BTDS*/"__JHASH__KOTUKHRaQFM__JHASH__",[h._plural(a,"count")]);return!b?d("WAWebStringsWithMultiplePluralParts").getCommunityGroupsRemovedString({formattedNames:f},a):d("WAWebStringsWithMultiplePluralParts").getCommunityGroupsRemovedStringComponent({formattedNames:f,count:a},a)}function K(a,b,c,e){b=d("WAWebFormatParticipantNames").getFormattedCommunityNameWithAlternative({jid:a[0],asString:!b,alternativeStringName:a[1]});if(w(b)){if(e!=null)return B(e);else if(v(c))return z();return D()}if(v(c))return y(b);else if(e!=null)return A(e,b);return C(b)}function L(a,b){return v(a)?h._(/*BTDS*/"__JHASH__Vf2eLSc2jcI__JHASH__"):h._(/*BTDS*/"__JHASH__6_Fco6jmExg__JHASH__",[h._param("author",b)])}function M(a,b,c){if(a&&a.length>=2){a=d("WAWebFormatParticipantNames").getFormattedCommunityNameWithAlternative({jid:a[0],asString:!b,alternativeStringName:a[1]});if(!w(a)){d("WALogger").LOG(k());return h._(/*BTDS*/"__JHASH__Ooxgg8ezpGO__JHASH__",[h._param("author",c),h._param("community",d("WAWebFormatParticipantNames").getCommunityNameInQuotationMarks(a,!b))])}return h._(/*BTDS*/"__JHASH__CzGjFGxYkGD__JHASH__",[h._param("author",c)])}return h._(/*BTDS*/"__JHASH__IywyOyH9GT1__JHASH__",[h._param("author",c)])}function N(a,b,c,e){var f,g=!1;a&&a.length>=3&&(f=d("WAWebFormatParticipantNames").getFormattedNameIfExists(a[0]),f==null&&(f=a[1]),a[2]==="true"&&(g=!0));if(!g){if(v(c)){if(!w(f)){d("WALogger").LOG(j());return h._(/*BTDS*/"__JHASH__QYZ5ZvCMUx___JHASH__",[h._param("group-name",d("WAWebFormatParticipantNames").getCommunityNameInQuotationMarks(f,!b))])}return h._(/*BTDS*/"__JHASH__a_lNnZBCEN1__JHASH__")}return h._(/*BTDS*/"__JHASH__OS2w4BQ1Y28__JHASH__",[h._param("user_name",e)])}if(v(c)){if(!w(f)){d("WALogger").LOG(i());return h._(/*BTDS*/"__JHASH__QsHwjrB6wXh__JHASH__",[h._param("group-name",d("WAWebFormatParticipantNames").getCommunityNameInQuotationMarks(f,!b))])}return h._(/*BTDS*/"__JHASH__DBt5BXBZ3VQ__JHASH__")}return h._(/*BTDS*/"__JHASH__OS2w4BQ1Y28__JHASH__",[h._param("user_name",e)])}g.formatLinkNotifAsFbt=a;g.formatLinkNotification=x}),226); __d("WAWebFormatMembershipApprovalNotification",["fbt","WALogger","WAWebFormatParticipantNames","WAWebGroupType","WAWebSystemMessageGatingUtils","WAWebUserPrefsMeUser","WAWebWamEnumSystemMessageTypeType","WAWebWidFactory"],(function(a,b,c,d,e,f,g,h){function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["wa:formatMembershipApprovalNotification:unknown message subtype: ",""]);i=function(){return a};return a}function j(a,b,c){var e=d("WAWebSystemMessageGatingUtils").systemMessageActionTextStylingEnabled(),f;b&&(f=d("WAWebFormatParticipantNames").getFormattedName(b,!1));switch(a){case"membership_approval_mode":var g=c[0]&&d("WAWebGroupType").GroupSettingChangeSystemMessageToggleEnabled.cast(c[0].toString())===d("WAWebGroupType").GroupSettingChangeSystemMessageToggleEnabled.On,j=c[1]&&d("WAWebGroupType").GroupSettingChangeSystemMessageIsAdmin.cast(c[1].toString())===d("WAWebGroupType").GroupSettingChangeSystemMessageIsAdmin.Admin;if(g){if(f==null)return{text:j?h._(/*BTDS*/"__JHASH__zpqOQ9KpneE__JHASH__"):h._(/*BTDS*/"__JHASH__yzGQyclKE_6__JHASH__")};return d("WAWebUserPrefsMeUser").isMeAccount(b)?{text:h._(/*BTDS*/"__JHASH__hcI5w-or5-8__JHASH__")}:{text:j?h._(/*BTDS*/"__JHASH__gD5ZtpAMJrJ__JHASH__",[h._param("author",f)]):h._(/*BTDS*/"__JHASH__m1n6qCqkBOl__JHASH__",[h._param("author",f)])}}return f==null?{text:h._(/*BTDS*/"__JHASH__YDweG3SB6qj__JHASH__")}:d("WAWebUserPrefsMeUser").isMeAccount(b)?{text:h._(/*BTDS*/"__JHASH__DbMfLR1IFzb__JHASH__")}:{text:j?h._(/*BTDS*/"__JHASH__NO9tS5y2m2Q__JHASH__",[h._param("author",f)]):h._(/*BTDS*/"__JHASH__lfdo0Cziyge__JHASH__",[h._param("author",f)])};case"membership_approval_request":return{text:e?h._(/*BTDS*/"__JHASH__pv3K7QLlct3__JHASH__",[h._param("author",f)]):h._(/*BTDS*/"__JHASH___buBvy7hfaa__JHASH__",[h._param("author",f)]),enumType:d("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.GROUP_JOIN_REQUEST};case"created_membership_requests":g=c.map(function(a){return d("WAWebFormatParticipantNames").getFormattedName(d("WAWebWidFactory").createWid(a.toString()),!1)});b=g[0];j=g.slice(1);return{text:e?h._(/*BTDS*/"__JHASH__r7iC40CO09X__JHASH__",[h._param("author",b),h._param("authors",j)]):h._(/*BTDS*/"__JHASH__1s5UmRkLddE__JHASH__",[h._param("author",b),h._param("authors",j)]),enumType:d("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.GROUP_JOIN_REQUEST};default:d("WALogger").LOG(i(),a);break}return{text:""}}function a(a,b,c){return j(a,b,c).text}g.formatMembershipApprovalNotification=a}),226); __d("WAWebClickableLink.react",["WAWebClassnames","asyncToGeneratorRuntime","react","stylex","useWAWebStaticButtonA11y"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react");function a(a){var e,f=a.children,g=a.href,h=a.onClick,k=a.title,l=a.className,m=a.tabIndex,n=a.xstyle,o=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(g!=null&&(a.metaKey||a.altKey))return;a.preventDefault();yield h(a)});return function(b){return a.apply(this,arguments)}}(),p=c("useWAWebStaticButtonA11y")(h),q=p[0];p=p[1];return j.jsx("a",babelHelpers["extends"]({},p,{ref:q,"data-testid":void 0,className:d("WAWebClassnames").classnamesConvertMeToStylexPlease(l,"x1xlr1w8 xt0b8zv xbvygy2 x17f7hit xp30eni xhmieyt",(i||(i=c("stylex")))(n)),href:(p=g)!=null?p:void 0,onClick:o,role:"button",rel:"noreferrer noopener",target:"_blank",title:k,tabIndex:(q=m)!=null?q:void 0,"data-tab":a["data-tab"],children:f}))}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),98); __d("WAWebL10NEnumeration.react",["fbt"],(function(a,b,c,d,e,f,g,h){function a(a,b){b===void 0&&(b=!1);if(a.length===0)return"";var c=a[0];if(a.length===1){var d=h._(/*BTDS*/"__JHASH__7Fh9pbyLbLe__JHASH__",[h._param("A",c)]);return b?d.toString():d}d=a[a.length-1];if(a.length===2)return i(c,d,b);c=a.slice(0,a.length-2);a=a[a.length-2];return j(c,a,d,b)}function i(a,b,c){c===void 0&&(c=!1);a=h._(/*BTDS*/"__JHASH__KpDuOoe0Ahg__JHASH__",[h._param("A",a),h._param("B",b)]);return c?a.toString():a}function j(a,b,c,d){d===void 0&&(d=!1);var e=function(a,b){return h._(/*BTDS*/"__JHASH__0pRuYLPKooH__JHASH__",[h._param("A",b),h._param("B",a)])};a=a.reverse();a=d?a.reduce(function(a,b){return e(a,b).toString()},""):a.reduce(function(a,b){return e(a,b)},null);a=h._(/*BTDS*/"__JHASH__db0pg8u3WD9__JHASH__",[h._param("A",a),h._param("B",b),h._param("C",c)]);return d?a.toString():a}g["default"]=a}),226); __d("WAWebFormatParticipantNames",["fbt","WAWebClickableLink.react","WAWebCmd","WAWebCommunityGroupJourneyEventImpl","WAWebComposeBoxActions","WAWebConfirmPopup.react","WAWebContactCollection","WAWebEmojiText.react","WAWebFbtIntlList","WAWebFindChatAction","WAWebGroupMetadataCollection","WAWebL10NEnumeration.react","WAWebModalManager","WAWebName.react","WAWebPairList","WAWebSuspendedCommunityUtils","WAWebToast.react","WAWebToastManager","WAWebUnjoinedSubgroupMetadataCollection","WAWebWamEnumChatFilterActionTypes","WAWebWamEnumSurfaceType","fbs","react"],(function(a,b,c,d,e,f,g,h){var i,j=i||c("react"),k={linkColor:{color:"x14m1o6m",$$css:!0}};function l(a,b){return function(c){c&&(c.preventDefault(),c.stopPropagation()),void d("WAWebFindChatAction").findOrCreateLatestChat(a,"formatParticipantNames").then(function(a){var c=a.chat;b==="sibling_group_link"&&new(d("WAWebCommunityGroupJourneyEventImpl").CommunityGroupJourneyEvent)({action:d("WAWebWamEnumChatFilterActionTypes").CHAT_FILTER_ACTION_TYPES.GROUP_SYSTEM_MESSAGE_CLICK,surface:d("WAWebWamEnumSurfaceType").SURFACE_TYPE.CHAT,chat:c}).commit();void d("WAWebCmd").Cmd.openChatFromUnread(c).then(function(a){a&&d("WAWebComposeBoxActions").ComposeBoxActions.focus(c)})})}}function m(a){return function(b){b&&(b.preventDefault(),b.stopPropagation()),d("WAWebCmd").Cmd.openCommunityHome(a,void 0)}}function a(a){return function(b){b&&(b.preventDefault(),b.stopPropagation()),d("WAWebCmd").Cmd.openCommunityTabbedInfo(a,void 0,!1,!0)}}function n(a){return function(b){b&&(b.preventDefault(),b.stopPropagation()),d("WAWebModalManager").ModalManager.open(j.jsx(d("WAWebConfirmPopup.react").ConfirmPopup,{onOK:function(){return d("WAWebModalManager").ModalManager.close()},children:h._(/*BTDS*/"__JHASH__ZO_YYbUIVKT__JHASH__",[h._param("community",j.jsx(d("WAWebName.react").Name,{contact:a}))])}))}}function o(){d("WAWebToastManager").ToastManager.open(j.jsx(d("WAWebToast.react").Toast,{msg:h._(/*BTDS*/"__JHASH__VrO7NOshW0h__JHASH__")}))}function p(a,b){return b?j.jsx(c("WAWebClickableLink.react"),{onClick:o,xstyle:k.linkColor,children:j.jsx(d("WAWebEmojiText.react").EmojiText,{text:a})}):a}function b(a,b,c,e){var f=d("WAWebContactCollection").ContactCollection.get(a.toString());if(e===!1&&f!=null)return v(a,c?m(a):null);if(b==null||b==="")return null;return e===!1&&c?j.jsx(d("WAWebEmojiText.react").EmojiText,{text:b,onClick:d("WAWebSuspendedCommunityUtils").openTerminatedCommunityModal}):b}function q(a,b){b===void 0&&(b=!1);var e=d("WAWebContactCollection").ContactCollection.get(a.toString());if(!e)return null;if(b)return e.name;b=c("WAWebGroupMetadataCollection").get(a);var f=m(a);(b==null?void 0:b.joinedSubgroups.length)||(f=n(e));return v(a,f)}function e(a,b){return b?c("fbs")._(/*BTDS*/"__JHASH__FbCabaA85O___JHASH__",[c("fbs")._param("community-name",a)]):j.jsx("span",babelHelpers["extends"]({className:"xuxw1ft"},{children:h._(/*BTDS*/"__JHASH__FbCabaA85O___JHASH__",[h._param("community-name",a)])}))}function r(a){var b=a.jid,c=a.asString;c=c===void 0?!1:c;a=a.alternativeStringName;b=q(b,c);if(b==null&&a)return p(a,!c);else if(typeof b==="string"&&!c)return j.jsx(d("WAWebEmojiText.react").EmojiText,{text:b});return b}function s(a,b,e){b===void 0&&(b=!1);if(d("WAWebContactCollection").ContactCollection.get(a.toString())!=null&&!b)return v(a,l(a,e));b=c("WAWebUnjoinedSubgroupMetadataCollection").get(a.toString());return(b==null?void 0:b.subject)?b.subject:null}function t(a,b,e){b===void 0&&(b=!1);a=d("WAWebPairList").unFlattenPairList(a).map(function(a){var c=a[0];a=a[1];c=s(c,b,e);return c!==""&&c!=null?c:a});return c("WAWebL10NEnumeration.react")(a,b)}function u(a,b,c){b===void 0&&(b=!0);if(!a.isUser())return v(a,b?l(a,c):null);b=b?l(a,c):null;return v(a,b)}function v(a,b){a=d("WAWebContactCollection").ContactCollection.gadd(a,{silent:!0});return j.jsx(d("WAWebName.react").Name,{contact:a,showNotifyName:!0,elevatedPushNamesEnabled:!0,onClick:b})}v.displayName=v.name+" [from "+f.id+"]";function w(a,b,d){b===void 0&&(b=!0);d===void 0&&(d=!1);if(!Array.isArray(a))return u(a,b);a=a.map(function(a){return u(a,b)});return c("WAWebFbtIntlList")(a,d?c("WAWebFbtIntlList").CONJUNCTIONS.NONE:c("WAWebFbtIntlList").CONJUNCTIONS.AND,c("WAWebFbtIntlList").DELIMITERS.COMMA)}g.openCommunity=m;g.openCommunityInfo=a;g.getClickableDeactivatedCommunityName=p;g.getClickableIntegrityDeactivateCommunityName=b;g.getCommunityNameInQuotationMarks=e;g.getFormattedCommunityNameWithAlternative=r;g.getFormattedNameIfExists=s;g.getFormattedGroupListForCommunity=t;g.getFormattedName=u;g.getFormattedNames=w}),226); __d("WAWebFormatPictureNotification",["fbt","WAWebSystemMessagesUtils"],(function(a,b,c,d,e,f,g,h){function a(a){var b=a.author,c=a.authorClickable;a=a.body;if(a==="remove")return d("WAWebSystemMessagesUtils").isMe(b)?h._(/*BTDS*/"__JHASH__pHH_KX01Q8b__JHASH__"):c!=null?h._(/*BTDS*/"__JHASH__BMHCgKPzE5O__JHASH__",[h._param("user_name",c)]):h._(/*BTDS*/"__JHASH__dlL2cZ79myQ__JHASH__");else if(d("WAWebSystemMessagesUtils").isMe(b))return h._(/*BTDS*/"__JHASH__g74Y-zK4odZ__JHASH__");return c!=null?h._(/*BTDS*/"__JHASH__S5COZkvcH-L__JHASH__",[h._param("user_name",c)]):h._(/*BTDS*/"__JHASH__lHBHJ6A64hb__JHASH__")}g.formatPictureNotification=a}),226); __d("WAWebFormatPromoteDemoteNotification",["fbt","WALogger","WAWebSystemMessagesUtils"],(function(a,b,c,d,e,f,g,h){function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["wa:formatPromoteDemoteNotification:unknown message subtype: ",""]);i=function(){return a};return a}function a(a){var b=a.subtype,c=a.participantsCount,e=a.subject,f=a.subjectClickable;a=a.participantsClickable;switch(b){case"promote":return c===1&&d("WAWebSystemMessagesUtils").isMe(e)?h._(/*BTDS*/"__JHASH__ufuUvFzlASW__JHASH__"):h._(/*BTDS*/"__JHASH__IHSBDk8mc8X__JHASH__",[h._plural(c),h._param("participant_names",a)]);case"demote":return c===1&&d("WAWebSystemMessagesUtils").isMe(e)?h._(/*BTDS*/"__JHASH__ydHyJHWxDMO__JHASH__"):h._(/*BTDS*/"__JHASH__jWMxqDYVdSY__JHASH__",[h._plural(c),h._param("participant_names",a)]);case"linked_group_promote":return d("WAWebSystemMessagesUtils").isMe(e)?h._(/*BTDS*/"__JHASH___pqxn0XoqB0__JHASH__"):h._(/*BTDS*/"__JHASH__LN0LpVRc6SF__JHASH__",[h._param("name",f)]);case"linked_group_demote":return d("WAWebSystemMessagesUtils").isMe(e)?h._(/*BTDS*/"__JHASH____RIPotpXAN__JHASH__"):h._(/*BTDS*/"__JHASH__gopdcNxy7Qj__JHASH__",[h._param("name",f)]);default:d("WALogger").LOG(i(),b);return""}}g.formatPromoteDemoteNotification=a}),226); __d("WAWebFormatRemoveNotification",["fbt","WAWebLidMigrationUtils","WAWebSystemMessagesUtils","WAWebWid"],(function(a,b,c,d,e,f,g,h){function a(a){var b=a.author,e=a.authorClickable,f=a.subject,g=a.subjectClickable;a=a.participantsClickable;if(b){if(c("WAWebWid").equals.apply(c("WAWebWid"),d("WAWebLidMigrationUtils").toCommonAddressingMode(b,f)))return h._(/*BTDS*/"__JHASH__3KpRo4zJqIW__JHASH__");else if(d("WAWebSystemMessagesUtils").isMe(b))return h._(/*BTDS*/"__JHASH__blZXaSFqWo3__JHASH__",[h._param("names",a)]);else if(d("WAWebSystemMessagesUtils").isMe(f))return e!=null?h._(/*BTDS*/"__JHASH__oWGFuUCCPgV__JHASH__",[h._param("user_name",e)]):h._(/*BTDS*/"__JHASH__n4f62WaHOx2__JHASH__");return e!=null?h._(/*BTDS*/"__JHASH__OupRPf1iqVw__JHASH__",[h._param("user_name",e),h._param("names",a)]):h._(/*BTDS*/"__JHASH__XNde0BU4ws9__JHASH__",[h._param("names",a)])}else if(d("WAWebSystemMessagesUtils").isMe(f))return h._(/*BTDS*/"__JHASH__3KpRo4zJqIW__JHASH__");return h._(/*BTDS*/"__JHASH__vzVVU59_ZOY__JHASH__",[h._param("user_name",g)])}g.formatRemoveNotification=a}),226); __d("WAWebFormatReportToAdminNotification",["fbt","WAWebFormatParticipantNames","WAWebGroupType","WAWebUserPrefsMeUser"],(function(a,b,c,d,e,f,g,h){function a(a,b){var c=b[0]&&d("WAWebGroupType").GroupSettingChangeSystemMessageToggleEnabled.cast(b[0].toString())===d("WAWebGroupType").GroupSettingChangeSystemMessageToggleEnabled.On;b=b[1]&&d("WAWebGroupType").GroupSettingChangeSystemMessageIsAdmin.cast(b[1].toString())===d("WAWebGroupType").GroupSettingChangeSystemMessageIsAdmin.Admin;var e=d("WAWebUserPrefsMeUser").isMeAccount(a);if(e){e=h._(/*BTDS*/"__JHASH__NQaMHu2pCdI__JHASH__");var f=h._(/*BTDS*/"__JHASH__rl1I-LFYWTu__JHASH__");return c?e:f}if(a){e=d("WAWebFormatParticipantNames").getFormattedName(a,!1);f=h._(/*BTDS*/"__JHASH__5F3cRv87VHH__JHASH__",[h._param("author",e)]);a=h._(/*BTDS*/"__JHASH__F1m1aHbPVfJ__JHASH__",[h._param("author",e)]);var g=h._(/*BTDS*/"__JHASH__qMwIBY0oE-P__JHASH__",[h._param("author",e)]);e=h._(/*BTDS*/"__JHASH__32Gi9IXN1Zq__JHASH__",[h._param("author",e)]);return b?c?f:a:c?g:e}f=h._(/*BTDS*/"__JHASH__yDZh5pDxVLz__JHASH__");a=h._(/*BTDS*/"__JHASH__H8mfv6I4Yhr__JHASH__");g=h._(/*BTDS*/"__JHASH__YipnPlQS5GJ__JHASH__");e=h._(/*BTDS*/"__JHASH__SgktDA0wjrO__JHASH__");return b?c?f:a:c?g:e}g.formatReportToAdminNotification=a}),226); __d("WAWebFormatRestrictNotification",["fbt","WAWebSystemMessagesUtils"],(function(a,b,c,d,e,f,g,h){var i=256;function a(a){var b=a.author,c=a.authorClickable;a=a.templateParams;var e=a[0];if(e==="on"){if(a[1]!=null){e=parseInt(a[1],10)||i;return h._(/*BTDS*/"__JHASH__UHaEaRwmPQd__JHASH__",[h._plural(e,"threshold")])}return d("WAWebSystemMessagesUtils").isMe(b)?h._(/*BTDS*/"__JHASH__H7jekDdvsQx__JHASH__"):c!=null?h._(/*BTDS*/"__JHASH__zWrpaJkIcWL__JHASH__",[h._param("user_name",c)]):h._(/*BTDS*/"__JHASH__w9IUy_3diq9__JHASH__")}else if(d("WAWebSystemMessagesUtils").isMe(b))return h._(/*BTDS*/"__JHASH__gYH85Uu-mKs__JHASH__");return c!=null?h._(/*BTDS*/"__JHASH___u486A01hSU__JHASH__",[h._param("user_name",c)]):h._(/*BTDS*/"__JHASH__rmr4xgg6dOz__JHASH__")}g.formatRestrictNotification=a}),226); __d("WAWebFormatSubjectNotification",["fbt","WAWebChatGroupUtils","WAWebUserPrefsMeUser"],(function(a,b,c,d,e,f,g,h){function a(a,b,c,e){if(d("WAWebChatGroupUtils").isCommunityAnnouncementGroup(a))return d("WAWebUserPrefsMeUser").isMeAccount(b)?h._(/*BTDS*/"__JHASH__GWQwh4FTOB___JHASH__",[h._param("community_name",e)]):c!=null?h._(/*BTDS*/"__JHASH__nTnHf-Q5wpg__JHASH__",[h._param("user",c),h._param("community_name",e)]):h._(/*BTDS*/"__JHASH__g1iqAEA2Fwo__JHASH__",[h._param("community_name",e)]);return d("WAWebUserPrefsMeUser").isMeAccount(b)?h._(/*BTDS*/"__JHASH__oppHWKgH9Ot__JHASH__",[h._param("group_name",e)]):c!=null?h._(/*BTDS*/"__JHASH__1-x-ozcTygr__JHASH__",[h._param("user",c),h._param("group_name",e)]):h._(/*BTDS*/"__JHASH__oQ6kGQgFlR3__JHASH__",[h._param("group_name",e)])}g.formatSubjectNotification=a}),226); __d("WAWebSystemMessagesUtils",["WAWebEmojiText.react","WAWebUserPrefsMeUser","WAWebWid","react"],(function(a,b,c,d,e,f,g){var h,i=h||c("react");function a(a){return a instanceof c("WAWebWid")&&d("WAWebUserPrefsMeUser").isMeAccount(a)}function b(a){a=a.text;return i.jsx(d("WAWebEmojiText.react").EmojiText,{direction:"auto",text:a})}b.displayName=b.name+" [from "+f.id+"]";g.isMe=a;g.FormattedText=b}),98); __d("WAWebUnformatSerializer",["WAWebFormatSerializer"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}return b}(c("WAWebFormatSerializer"));a.onDelimiter=function(){return void 0};a.onMutator=function(a,b,c){if(a.unformatDecorations!=null){a=a.unformatDecorations;var d=a.pre;a=a.post;return h([typeof d==="function"?d(c):d].concat(b,[a]))}return h(b)};a.onRoot=function(a){return h(a)};a.onText=function(a){return a};function h(a){return a.filter(Boolean).join("")}g["default"]=a}),98); __d("WAWebUnformatMsg",["WAWebCommonMsgUtils","WAWebFormat","WAWebFormatConfiguration","WAWebFrontendMsgGetters","WAWebMiscGatingUtils","WAWebUnformatSerializer"],(function(a,b,c,d,e,f,g){var h;function i(){h||(h=d("WAWebFormatConfiguration").Unformat({mentions:{}}));return h}function a(a,b){b=(b=b)!=null?b:"";if(d("WAWebCommonMsgUtils").isRichResponseMsg(a.type)){var e=d("WAWebFormatConfiguration").RichResponse({links:[],parseHeadlessHeadings:!0,parseHeadings:!1});return c("WAWebFormat")(b,e,c("WAWebUnformatSerializer"))}e=a.mentionMap();var f=a.groupMentionMap();if(!e&&!f)return j(b);if(d("WAWebMiscGatingUtils").isDropLastNameEnabled()){a=d("WAWebFrontendMsgGetters").getChat(a).groupMetadata;if(a){a=d("WAWebFormatConfiguration").FormattedGroupNotification({mentions:e,groupMentions:f,groupMetadata:a});return c("WAWebFormat")(b,a,c("WAWebUnformatSerializer"))}}a=d("WAWebFormatConfiguration").FormattedNotification({mentions:e,groupMentions:f});return c("WAWebFormat")(b,a,c("WAWebUnformatSerializer"))}function j(a){return c("WAWebFormat")(a,i(),c("WAWebUnformatSerializer"))}g["default"]=a}),98); __d("WAWebWidToFormattedNameOrNumber",["WAWebContactCollection","WAWebFrontendContactGetters","WAWebWidFormat"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WAWebContactCollection").ContactCollection.get(a);return b?d("WAWebFrontendContactGetters").getFormattedName(b):d("WAWebWidFormat").widToFormattedUser(a)}g["default"]=a}),98); __d("WAWebFrontendChatGetters",["WALogger","WAWebBotGating","WAWebChatConstants","WAWebChatFlowTypes","WAWebChatGetters","WAWebChatModelDerivedMethods","WAWebConstantsDeprecated","WAWebContactCollection","WAWebContactGetters","WAWebGetters","WAWebGettersCaches","WAWebGroupType","WAWebHostedGroupUtils","WAWebLastAddOnDBSerialization","WAWebMsgGetters","WAWebMsgType","WAWebPrivacyModeSystemMsg","WAWebWid"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["chat:unknown kind id:",""]);h=function(){return a};return a}b=d("WAWebGetters").createGetterFactories({root:(a=d("WAWebChatGetters")).getChatUnsafe,createCache:d("WAWebGettersCaches").createFrontendChatCache});e=b.field;f=b.computed;b=b.clearCacheFor;b=b;var i=e("groupMetadata"),j=e("contact"),k=e("pendingSeenCount",{"default":0}),l=e("unreadMsgAnchor"),m=e("composeQuotedMsg"),n=e("composeQuotedMsgRemoteJid"),o=e("quotedMsgAdminGroupJid"),p=e("quotedMsgAdminGroupSubject"),q=e("quotedMsgAdminParentGroupJid"),r=e("msgs"),s=e("msgsLength"),t=e("msgsChanged"),u=e("isParentGroup"),v=e("groupType"),w=e("hasCapi"),x=e("createdLocally"),y=e("pendingDeleteForMeCount"),z=e("attachMediaContents"),A=e("formattedTitle"),B=e("assignedAgent"),C=e("isAssignedToMe",{"default":!1}),D=e("mute"),E=e("presence"),F=e("newsletterMetadata"),G=e("promises",{getDefault:function(){return{reportSpamAndBlockSender:void 0,reportSpamBlockClear:void 0,reportSpamExitClear:void 0,sendNotSpam:void 0,sendUnstarAll:void 0,updateSortTime:void 0,setPin:void 0,setArchive:void 0,updateDraftMessage:void 0}}}),H=e("isFavorite",{"default":!1}),I=e("trusted"),J=e("active"),K=e("pendingAction"),L=e("pttRecordingSession");e=e("unopenedByAssignedAgent",{"default":!1});var M=f(function(a){var b=a[0],c=a[1],e=a[2],f=a[3],g=a[4];a=a[5];if(c)return a===d("WAWebGroupType").GroupType.COMMUNITY?d("WAWebChatFlowTypes").ChatKindType.Community:d("WAWebChatFlowTypes").ChatKindType.Group;else if(e)return d("WAWebChatFlowTypes").ChatKindType.Broadcast;else if(f)return d("WAWebChatFlowTypes").ChatKindType.Chat;else if(g)return d("WAWebChatFlowTypes").ChatKindType.Newsletter;d("WALogger").LOG(h(),b.toLogString());return void 0},[a.getId,a.getIsGroup,a.getIsBroadcast,a.getIsUser,a.getIsNewsletter,v]);v=f(function(a){var b=a[0];a=a[1];return b&&a===d("WAWebGroupType").GroupType.LINKED_ANNOUNCEMENT_GROUP},[a.getIsGroup,v]);w=f(function(a){a=a[0];return d("WAWebHostedGroupUtils").isWAHostedGroupEnabled()&&a===!0},[w]);var N=f(function(a){var b=a[0];a=a[1];if(!a)return!1;if(b===d("WAWebChatFlowTypes").ChatKindType.Chat){b=d("WAWebPrivacyModeSystemMsg").getReducedPrivacyMode(a.privacyMode);if(b===d("WAWebPrivacyModeSystemMsg").ReducedPrivacyMode.FB||b===d("WAWebPrivacyModeSystemMsg").ReducedPrivacyMode.BSP)return!1}return a.isHosted===!0?!1:!0},[M,j]);k=f(function(a){var b=a[0];a=a[1];return b===c("WAWebConstantsDeprecated").MARKED_AS_UNREAD?b:Math.max(0,b-a)},[a.getUnreadCount,k]);l=f(function(a){var b=a[0],c=a[1];a=a[2];if(b===0)return!1;if(c){var e=c.msgChunk;e=e?e.getModelsArray():[];return c!==e.find(function(a){return d("WAWebMsgGetters").getIsUnreadType(a)})}c=a.last();e=c!=null&&d("WAWebMsgGetters").getIsSentByMe(c);if(e)return!1;if(a.msgLoadState.noEarlierMsgs){c=a.filter(function(a){return d("WAWebMsgGetters").getIsUnreadType(a)});return c.length!==b}return!0},[a.getUnreadCount,l,r]);x=f(function(a){var b=a[0],e=a[1],f=a[2],g=a[3],h=a[4],i=a[5],j=a[6],k=a[7];a[8];if(e)return!1;if(b.isBot()&&!d("WAWebBotGating").isBotEnabled())return!1;if(f)return b.user==="chat"?!0:!1;if(c("WAWebWid").isStatus(b))return!1;if(g===d("WAWebChatConstants").ConversationEndOfHistoryTransferModelPropType.NOT_INCLUDED_IN_HIST_SYNC&&j.length===0)return!1;if(h&&i===!0)return!1;a=j.some(function(a){return a.isRealMessage()});return k!==!0||a},[a.getId,a.getIsLocked,a.getIsBroadcast,a.getEndOfHistoryTransferType,a.getIsGroup,u,r,x,s]);s=f(function(a){var b=a[0];a[1];a[2];for(a=b.length-1;a>=0;a--){var c=b.at(a);if(c&&d("WAWebChatModelDerivedMethods").isPreviewMessage(c))return c}if(b.length>0)return b.last()},[r,t,y]);t=f(function(a){var b=a[0],c=a[1],e=a[2];a=a[3];if(!c)return!1;if(!e&&!a)return!1;c=d("WAWebContactCollection").ContactCollection.get(a||b);return c!=null&&d("WAWebContactGetters").getIsMyContact(c)?!1:!0},[a.getId,a.getIsUser,a.getChangeNumberOldJid,a.getChangeNumberNewJid]);y=f(function(a){var b=a[0];a=a[1];if(b)return b;if(a)return d("WAWebLastAddOnDBSerialization").lastAddOnPreviewFromDeprecatedLastReactionPreview(a)},[a.getChatlistPreview,a.getLastReactionPreview]);f=f(function(a){var b=a[0];a=a[1];if((b==null?void 0:(b=b.text)==null?void 0:b.trim())!=="")return!0;return a?!0:!1},[a.getDraftMessage,z]);g.clearFrontendChatGetterCacheFor=b;g.getGroupMetadata=i;g.getContact=j;g.getComposeQuotedMsg=m;g.getComposeQuotedMsgRemoteJid=n;g.getQuotedMsgAdminGroupJid=o;g.getQuotedMsgAdminGroupSubject=p;g.getQuotedMsgAdminParentGroupJid=q;g.getMsgs=r;g.getIsParentGroup=u;g.getAttachMediaContents=z;g.getFormattedTitle=A;g.getAssignedAgent=B;g.getIsAssignedToMe=C;g.getMute=D;g.getPresence=E;g.getNewsletterMetadata=F;g.getPromises=G;g.getIsFavorite=H;g.getTrusted=I;g.getActive=J;g.getPendingAction=K;g.getPttRecordingSession=L;g.getUnopenedByAssignedAgent=e;g.getKind=M;g.getIsCAG=v;g.getIsCapiHostedGroup=w;g.getIsE2ee=N;g.getOptimisticUnreadCount=k;g.getShouldShowUnreadDivider=l;g.getShouldAppearInList=x;g.getPreviewMessage=s;g.getShowChangeNumberNotification=t;g.getDerivedLastAddOnPreview=y;g.getHasDraftMessage=f}),98); __d("WAWebAnimatedEmojiAssetLoader",["WAConcurrentPriorityPromiseQueue","WALogger","WAWebEmojiConst","WAWebMediaHostsUtil","WAWebPonyfillsFetch","WAWebURLUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["initAnimatedEmojiAssets: Fetching of animated emoji asset failed"]);h=function(){return a};return a}var i,j="/wa/static/network_resource",k="nw_media";function a(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e;i=(e=i)!=null?e:new Map();var f=new(c("WAConcurrentPriorityPromiseQueue"))(5,{emojis:5});e=(yield d("WAWebMediaHostsUtil").getStaticMediaHostName());var g=""+e+j;d("WAWebEmojiConst").getSupportedAnimatedEmojisAssetIdsMapping(a).forEach(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a[0];a=a[1];try{var e,j=c("WAWebURLUtils").build(g,{cat:k,id:a,_nc_cat:1});a=(yield f.enqueue(function(){return c("WAWebPonyfillsFetch")(j)},{group:"emojis",priority:1}));a=(yield a.json());(e=i)==null?void 0:e.set(b,a)}catch(a){d("WALogger").LOG(h()).devConsole(a)}});return function(b){return a.apply(this,arguments)}}())});return l.apply(this,arguments)}function e(a){var b;return(b=i)==null?void 0:b.get(a)}g.initAnimatedEmojiAssets=a;g.getAnimatedEmojiAsset=e}),98); __d("WAWebProductCatalogCatalogConstants",[],(function(a,b,c,d,e,f){a=96;b=104;c=40;d=95;f.PRODUCT_LIST_ITEM_HEIGHT=a;f.CART_PRODUCT_LIST_ITEM_HEIGHT=b;f.MAX_REPLY_PRODUCT_TITLE_LENGTH=c;f.MAX_REPLY_PRODUCT_DESC_LENGTH=d}),66); __d("WAWebFrontendMsgGetters",["WABidi","WALogger","WANullthrows","WAWebAck","WAWebAnimatedEmojiAssetLoader","WAWebAnimatedEmojiGatingUtils","WAWebBizSystemMsgSubtypes","WAWebChatCollection","WAWebChatGroupUtils","WAWebCommonMsgUtils","WAWebEmoji","WAWebFormatNfmText","WAWebGetters","WAWebGettersCaches","WAWebL10N","WAWebMessageAssociation.flow","WAWebMsgDataUtils","WAWebMsgGetters","WAWebMsgKey","WAWebMsgModelUtils","WAWebMsgType","WAWebNewsletterCollection","WAWebNewsletterMembershipUtil","WAWebProductCatalogCatalogConstants","WAWebProtobufsE2E.pb","WAWebPtvGatingUtils","WAWebTemplateButtonSubtype","WAWebUserPrefsMeUser","lodash"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["getChat: unexpected null chat"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["getChat: msgKey = ",", type = ",""]);i=function(){return a};return a}e=d("WAWebGetters").createGetterFactories({root:(b=d("WAWebMsgGetters")).getMsgUnsafe,createCache:d("WAWebGettersCaches").createFrontendMessagesCache});f=e.field;var j=e.computed;e=e.clearCacheFor;e=e;var k=j(function(a){var b=a[0],c=a[1],e=a[2];a=a[3];return d("WAWebMsgModelUtils").typeIsMms({type:b,subtype:c,headerType:e,interactiveHeader:a})},[b.getType,b.getSubtype,b.getHeaderType,b.getInteractiveHeader]),l=j(function(a){var b=a[0],c=a[1];a=a[2];return b!=null&&b<d("WAWebAck").ACK.SENT&&c&&a},[b.getAck,k,b.getIsSentByMe]),m=j(function(a){var b=a[0],c=a[1];a=a[2];b=d("WAWebMsgDataUtils").eventTypeFromMsgType(b);if(!a)return d("WAWebCommonMsgUtils").EventType.IGNORE;return c?b===d("WAWebCommonMsgUtils").EventType.IGNORE?d("WAWebCommonMsgUtils").EventType.IGNORE:d("WAWebCommonMsgUtils").EventType.NOTEWORTHY:b},[b.getMsgUnsafe,b.getInvis,b.getIsNewMsg]),n=function(a){switch(a.type){case"interactive":return d("WAWebMsgGetters").getNativeFlowName(a)!=null?d("WAWebFormatNfmText").formatNFMText(a):d("WAWebMsgGetters").getCaption(a);case"native_flow":return d("WAWebFormatNfmText").formatNFMText(a)}return null},o=j(function(a){var b=a[0],e=a[1],f=a[2],g=a[3],h=a[4],i=a[5],j=a[6],k=a[7],l=a[8],m=a[9],o=a[10],p=a[11],q=a[12],r=a[13];a=a[14];if(m||o)return e===d("WAWebMsgType").MSG_TYPE.CHAT?g:h;switch(e){case"chat":case"interactive_response":case"automated_greeting_message":return g;case"image":case"video":case"ptv":case"document":case"sticker-pack":return h;case"location":return j?i:void 0;case"payment":return k==null?void 0:k.body;case"groups_v4_invite":return i;case"list":return p==null?void 0:p.description;case"product":return c("lodash").truncate(f,{length:d("WAWebProductCatalogCatalogConstants").MAX_REPLY_PRODUCT_TITLE_LENGTH});case"hsm":return g;case"template_button_reply":return g;case"interactive":return q!=null?n(b):h;case"native_flow":return n(b);case"poll_creation":case"poll_result_snapshot":return l;case"newsletter_admin_invite":return r==null?void 0:r.inviteMessage;case"event_creation":return a;default:e;return void 0}},[b.getMsgUnsafe,b.getType,b.getTitle,b.getBody,b.getCaption,b.getComment,b.getIsLive,b.getPaymentNoteMsg,b.getPollName,b.getIsFromTemplate,b.getIsDynamicReplyButtonsMsg,b.getList,b.getNativeFlowName,b.getNewsletterAdminInviteInfo,b.getEventName]),p=j(function(a){a=a[0];a=a==null?void 0:a.newsletterId;if(a==null)return!1;a=(a=c("WAWebNewsletterCollection").get(a))==null?void 0:a.newsletterMetadata;return d("WAWebNewsletterMembershipUtil").iAmAdmin(a)&&!d("WAWebNewsletterMembershipUtil").iAmOwner(a)},[b.getNewsletterAdminInviteInfo]),q=j(function(a){var b=a[0],c=a[1],e=a[2];a=a[3];if(b===d("WAWebMsgType").MSG_TYPE.VCARD)return c?d("WABidi").dir(c):void 0;if(e==null)return;b=(a==null?void 0:a.length)?e.replace(/@\d+@g.us/,""):e;c=d("WABidi").dir(b);return c},[b.getType,b.getSubtype,o,b.getGroupMentions]),r=j(function(a){a=a[0];return a==="rtl"||a===void 0&&c("WAWebL10N").isRTL()},[q]),s=j(function(a){var b=a[0],c=a[1];a=a[2];return b===d("WAWebMsgType").MSG_TYPE.VCARD?c?d("WABidi").dir(c)==="rtl":!1:!!a&&d("WABidi").dir(a)==="rtl"},[b.getType,b.getSubtype,o]),t=j(function(a){var b=a[0];a=a[1];return b!=null||a!=null},[o,b.getFooter]),u=function(a){return d("WAWebMsgGetters").getIsNewsletterMsg(a)?c("WAWebNewsletterCollection"):d("WAWebChatCollection").ChatCollection};function a(a){var b=d("WAWebChatCollection").ChatCollection;d("WAWebMsgGetters").getIsNewsletterMsg(a)&&(b=c("WAWebNewsletterCollection"));return c("WANullthrows")(b.get(c("WAWebMsgKey").from(a.id).remote))}var v=function(a){var b=u(a).get(c("WAWebMsgKey").from(a.id).remote);b==null&&(d("WALogger").LOG(i(),a.id.toString(),a.type),d("WALogger").ERROR(h()).sendLogs("get-chat-unexpected-null"));return b},w=function(a){return u(a).get(c("WAWebMsgKey").from(a.id).remote)},x=f("carouselCards"),y=j(function(a){a=a[0];return a==null?null:a.slice()},[x]),z=f("buttons"),A=j(function(a){var b=a[0];a=a[1];return b&&a!=null&&a.length>0},[b.getIsFromTemplate,z]),B=j(function(a){var b=a[0];a=a[1];if(!b)return!1;if(a==null)return!1;b=a.at(0);return b==null?!1:b.subtype===d("WAWebTemplateButtonSubtype").TEMPLATE_BUTTON_SUBTYPE.QUICK_REPLY},[A,z]),C=j(function(a){a=a[0];return a},[b.getMsgUnsafe]),D=j(function(a){a=a[0];return a.type===d("WAWebMsgType").MSG_TYPE.PRODUCT&&a.id&&a.id.id.startsWith(d("WAWebBizSystemMsgSubtypes").PRODUCT_INQUIRY_TYPE)?a:null},[C,b.getType,b.getId]),E=j(function(a){a=a[0];switch(a.type){case d("WAWebMsgType").MSG_TYPE.GP2:return a;default:return null}},[C,b.getType]),F=j(function(a){a=a[0];return a.type===d("WAWebMsgType").MSG_TYPE.BROADCAST_NOTIFICATION?a:null},[C,b.getType]),G=j(function(a){a=a[0];return a.type==="product"?a:null},[C,b.getType]),H=j(function(a){a=a[0];return a.type===d("WAWebMsgType").MSG_TYPE.REVOKED?a:null},[C,b.getType]),I=f("associationType"),J=j(function(a){var b=a[0];a[1];var c=a[2],e=a[3];a[4];var f=a[5];a[6];var g=a[7],h=a[8],i=a[9];a=a[10];return(b.type===d("WAWebMsgType").MSG_TYPE.IMAGE||b.type===d("WAWebMsgType").MSG_TYPE.VIDEO&&b.isGif!==!0)&&!c&&!f&&!(h!==d("WAWebMessageAssociation.flow").MessageAssociationType.MEDIA_ALBUM&&h!==d("WAWebMessageAssociation.flow").MessageAssociationType.MEDIA_POLL&&(e!=null||g))&&!i&&!a?b:null},[C,b.getType,b.getIsNotification,b.getCaption,b.getIsForwarded,H,b.getIsGif,b.getQuotedMsg,I,b.getCtwaContext,b.getIsViewOnce]),K=j(function(a){var b=a[0];a=a[1];return d("WAWebMsgModelUtils").notRefiningTypeIsUrl({type:b,subtype:a})},[b.getType,b.getSubtype]),L=j(function(a){var b=a[0];a[1];var c=a[2];a=a[3];if(c)return null;switch(b.type){case d("WAWebMsgType").MSG_TYPE.IMAGE:case d("WAWebMsgType").MSG_TYPE.STICKER:case d("WAWebMsgType").MSG_TYPE.AUDIO:case d("WAWebMsgType").MSG_TYPE.PTT:case d("WAWebMsgType").MSG_TYPE.VIDEO:case d("WAWebMsgType").MSG_TYPE.PTV:case d("WAWebMsgType").MSG_TYPE.DOCUMENT:return b}return a?b:null},[C,b.getType,b.getIsViewOnce,K]),M=j(function(a){var b=a[0];a[1];var c=a[2],e=a[3],f=a[4],g=a[5];a=a[6];var h=v(b.unsafe());return b.type===d("WAWebMsgType").MSG_TYPE.STICKER&&!c&&!e&&!f&&!g&&!a&&!d("WAWebChatGroupUtils").isCommunityAnnouncementGroup(h)?b:null},[C,b.getType,b.getIsNotification,H,b.getQuotedMsg,b.getCtwaContext,b.getIsNewsletterMsg]),N=j(function(a){var b=a[0];a[1];return b.type===d("WAWebMsgType").MSG_TYPE.DOCUMENT?b:null},[C,b.getType]),O=j(function(a){var b=a[0];a[1];return b.type===d("WAWebMsgType").MSG_TYPE.IMAGE?b:null},[C,b.getType]),P=j(function(a){var b=a[0];a[1];return b.type===d("WAWebMsgType").MSG_TYPE.VIDEO?b:null},[C,b.getType]),Q=j(function(a){var b=a[0];a[1];return b.type===d("WAWebMsgType").MSG_TYPE.AUDIO?b:null},[C,b.getType]),R=j(function(a){var b=a[0];a[1];return b.type===d("WAWebMsgType").MSG_TYPE.PTT?b:null},[C,b.getType]),S=j(function(a){var b=a[0];a[1];return b.type===d("WAWebMsgType").MSG_TYPE.PTV?b:null},[C,b.getType]),T=j(function(a){var b=a[0];a[1];return b.type===d("WAWebMsgType").MSG_TYPE.POLL_CREATION?b:null},[C,b.getType]),U=j(function(a){var b=a[0];a[1];return b.type===d("WAWebMsgType").MSG_TYPE.POLL_CREATION||b.type===d("WAWebMsgType").MSG_TYPE.POLL_RESULT_SNAPSHOT?b:null},[C,b.getType]),V=j(function(a){var b=a[0];a[1];return b.type===d("WAWebMsgType").MSG_TYPE.POLL_RESULT_SNAPSHOT?b:null},[C,b.getType]),aa=j(function(a){var b=a[0];a[1];return b.type===d("WAWebMsgType").MSG_TYPE.EVENT_CREATION?b:null},[C,b.getType]),ba=j(function(a){var b=a[0];a[1];return b.type===d("WAWebMsgType").MSG_TYPE.ALBUM?b:null},[C,b.getType]),ca=j(function(a){var b=a[0];a[1];return b.type===d("WAWebMsgType").MSG_TYPE.CALL_LOG?b:null},[C,b.getType]),da=j(function(a){var b=a[0];a[1];return b.type===d("WAWebMsgType").MSG_TYPE.POLL_UPDATE?b:null},[C,b.getType]),ea=j(function(a){var b=a[0];a[1];return d("WAWebMsgModelUtils").typeIsMms(b)?b:null},[C,b.getType]),fa=j(function(a){var b=a[0];a[1];a[2];return d("WAWebMsgModelUtils").typeIsUrl(b)?b:null},[C,b.getType,b.getSubtype]),W=j(function(a){var b=a[0];a[1];return b.type===d("WAWebMsgType").MSG_TYPE.IMAGE||b.type===d("WAWebMsgType").MSG_TYPE.VIDEO?b:null},[C,b.getType]),ga=j(function(a){a[0];var b=a[1],c=a[2];a=a[3];return(b!=null||c!=null)&&a?(a=b)!=null?a:c:null},[b.getType,W,R,b.getIsViewOnce]),ha=j(function(a){var b=a[0];a[1];var c=a[2];a=a[3];if(b.type===d("WAWebMsgType").MSG_TYPE.PTT)return b;return b.type===d("WAWebMsgType").MSG_TYPE.AUDIO&&a&&c!=null?b:null},[C,b.getType,b.getWaveform,b.getIsOpus]),X=f("senderObj"),ia=f("mediaData"),ja=f("replyButtons"),ka=f("pendingDeleteForMe",{"default":!1});f=f("botPluginType");var la=j(function(a){var b=a[0],c=a[1];a=a[2];return(a==null?void 0:(a=a.id)==null?void 0:a.isBot())&&(c===d("WAWebProtobufsE2E.pb").BotPluginMetadata$PluginType.SEARCH||c===d("WAWebProtobufsE2E.pb").BotPluginMetadata$PluginType.REELS)?b:null},[C,f,X]),ma=j(function(a){var b=a[0];a[1];a=a[2];return b.type===d("WAWebMsgType").MSG_TYPE.RICH_RESPONSE&&a!=null?b:null},[C,b.getType,b.getRichResponse]),na=j(function(a){a=a[0];return d("WAWebMsgModelUtils").getCelebrationAnimationType(a)},[o]),Y=j(function(a){var b=a[0];a=a[1];return d("WAWebMsgModelUtils").isAnimatedEmoji(b,a)},[b.getBody,b.getType]),Z=j(function(a){var b=a[0];a=a[1];return d("WAWebMsgModelUtils").isSingleEmojiMessageText(b,a)},[b.getBody,b.getType]),$=j(function(a){var b=a[0],c=a[1];a=a[2];a=d("WAWebAnimatedEmojiGatingUtils").isStaticSingleEmojiUIEnabled()&&a!=null;return b===d("WAWebMsgType").MSG_TYPE.CHAT&&(c||a)},[b.getType,Y,Z]),oa=j(function(a){var b=a[0],c=a[1],e=a[2];a=a[3];switch(b){case d("WAWebMsgType").MSG_TYPE.STICKER:return Boolean(!e&&!c);case d("WAWebMsgType").MSG_TYPE.CHAT:return a;case d("WAWebMsgType").MSG_TYPE.PTV:return d("WAWebPtvGatingUtils").isPtvReceivingEnabled();default:return!1}},[b.getType,b.getCtwaContext,b.getQuotedMsg,$]),pa=j(function(a){a=a[0];if(a==null)return;a=d("WAWebEmoji").EmojiUtil.normalizeEmojiFromString(a);if(a==null)return;return d("WAWebAnimatedEmojiAssetLoader").getAnimatedEmojiAsset(a)},[b.getBody]),qa=j(function(a){var b=a[0],c=a[1],d=a[2],e=a[3];a=a[4];var f;b&&(f=c?e.remote:d==null?void 0:d.newsletterId);return(b=f)!=null?b:a.id},[b.getHasOriginatedFromNewsletter,b.getIsNewsletterMsg,b.getForwardedNewsletterMessageInfo,b.getId,X]),ra=j(function(a){var b=a[0];a=a[1];return!b&&d("WAWebUserPrefsMeUser").isMeAccount(a)},[b.getIsNewsletterMsg,b.getSender]);j=j(function(a){var b=a[0],c=a[1];a=a[2];b=w(b.unsafe());var d;c&&(d=b==null?void 0:b.contact);return(c=d)!=null?c:a},[C,b.getIsNewsletterMsg,X]);g.clearFrontendMsgGetterCacheFor=e;g.getIsMms=k;g.getIsUnsentMedia=l;g.getEventType=m;g.getText=o;g.getIsNewsletterInviteAccepted=p;g.getDir=q;g.getIsRTL=r;g.getRtl=s;g.getHasBodyOrFooter=t;g.getChatCollection=u;g.getCurrentChat=a;g.getChat=v;g.getMaybeChat=w;g.getCarouselCardsCollection=x;g.getCarouselCards=y;g.getButtons=z;g.getHasTemplateButtons=A;g.getIsQuickReply=B;g.getSafeMsg=C;g.getAsProductInquiry=D;g.getAsGroupNotification=E;g.getAsBroadcastNotification=F;g.getAsProduct=G;g.getAsRevoked=H;g.getAssociationType=I;g.getAsAlbumAsset=J;g.getIsUrlMessage=K;g.getAsAutoDownloadableMedia=L;g.getAsGroupedSticker=M;g.getAsDoc=N;g.getAsImage=O;g.getAsVideo=P;g.getAsAudio=Q;g.getAsPtt=R;g.getAsPtv=S;g.getAsPollCreation=T;g.getAsPoll=U;g.getAsPollResultSnapshot=V;g.getAsEventCreation=aa;g.getAsAlbum=ba;g.getAsCallLog=ca;g.getAsPollUpdate=da;g.getAsMms=ea;g.getAsUrl=fa;g.getAsVisualMedia=W;g.getAsViewOnce=ga;g.getAsPttLike=ha;g.getSenderObj=X;g.getMediaData=ia;g.getReplyButtons=ja;g.getPendingDeleteForMe=ka;g.getBotPluginType=f;g.getAsBotPluginCarouselMsg=la;g.getAsRichResponse=ma;g.getCelebrationAnimationCandidate=na;g.getIsAnimatedEmoji=Y;g.getIsSingleEmoji=Z;g.getIsTransparentMsgEmoji=$;g.getIsTransparentMsg=oa;g.getJSONAssetForAnimatedEmoji=pa;g.getMsgSenderId=qa;g.getShouldDisplaySelf=ra;g.getSenderForReplyMsg=j}),98); __d("WAWebFrontendPollVoteGetters",["WANullthrows","WAWebAck","WAWebContactCollection","WAWebFrontendMsgGetters","WAWebGetters","WAWebGettersCaches","WAWebMsgCollection","WAWebPollVoteGetters","WAWebUserPrefsMeUser"],(function(a,b,c,d,e,f,g){b=d("WAWebGetters").createGetterFactories({root:(a=d("WAWebPollVoteGetters")).getPollVoteUnsafe,createCache:d("WAWebGettersCaches").createFrontendPollVotesCache});e=b.field;f=b.computed;b=b.clearCacheFor;b=b;e=e("isSendFailure",{"default":!1});var h=f(function(a){a=a[0];a=c("WANullthrows")(d("WAWebMsgCollection").MsgCollection.get(a));return c("WANullthrows")(d("WAWebFrontendMsgGetters").getAsPollCreation(a))},[a.getParentMsgKey]),i=f(function(a){a=a[0];return d("WAWebContactCollection").ContactCollection.gadd(a)},[a.getSender]);f=f(function(a){var b=a[0],c=a[1];a=a[2];b=d("WAWebUserPrefsMeUser").isMeAccount(b)&&c!=null&&c<d("WAWebAck").ACK.CLOCK;return b||Boolean(a)},[a.getSender,a.getAck,e]);g.clearFrontendPollVoteGetterCacheFor=b;g.getParentMsg=h;g.getSenderObj=i;g.getIsFailed=f}),98); __d("WAWebUseValuesUtils",["WAWebDummyCacheMap","WAWebGetters","lodash"],(function(a,b,c,d,e,f,g){var h=new(d("WAWebDummyCacheMap").FakeCacheMap)(),i=c("lodash").memoize(function(a){return d("WAWebGetters").createGetterFactories({root:a,createCache:function(){return h}})});a=c("lodash").memoize(function(a){var b=a[0].$$root;b=i(b);b=b.computed;return b(function(a){return a},a)},function(a){return a.map(l).join("-")});var j=new WeakMap(),k=0;function l(a){var b=j.get(a);b==null&&(b=(k++).toString(),j.set(a,b));return b}g.computedForComponent=a}),98); __d("useWAWebValues",["WAArraysShallowEqual","WANullthrows","WAWebNoop","WAWebUseValuesUtils","react","useWAWebStableCallback"],(function(a,b,c,d,e,f,g){var h;b=h||d("react");var i=b.useEffect,j=b.useMemo,k=b.useRef,l=b.useState,m=function(a){return c("WAWebNoop")};function a(a,b,d){a=n(a,b,d);return c("WANullthrows")(a)}function n(a,b,e){var f=j(function(){return d("WAWebUseValuesUtils").computedForComponent(b)},b),g=l(function(){return a==null?null:f(a)}),h=g[0],n=g[1],p=c("useWAWebStableCallback")(function(){n(function(b){var c=a==null?null:f(a);return o(b,c)?b:c})});g=k(a);var q=g.current;a!==q&&(g.current=a,p());var r=(q=e==null?void 0:e.subscribe)!=null?q:m;i(function(){return r(function(){p()})},[r,p]);return h}function o(a,b){if(a==b)return!0;return a==null||b==null?!1:c("WAArraysShallowEqual")(a,b,function(a,b){if(a===b)return!0;return Array.isArray(a)&&Array.isArray(b)&&a.length===0&&b.length===0?!0:!1})}g.useValues=a;g.useOptionalValues=n}),98); __d("useWAWebCollectionValues",["invariant","WANullthrows","react","useWAWebListener","useWAWebValues"],(function(a,b,c,d,e,f,g,h){var i;e=i||d("react");var j=e.useCallback,k=e.useMemo,l=e.useState;function a(a,b,d,e){var f=m(a,b,d,e);a=l(function(){return c("WANullthrows")(f,"[useCollectionValues] Expected model to be present in collection")});b=a[0];d=a[1];f!=null&&f!==b&&d(f);return b}function m(a,b,c,e){var f=k(function(){return Array.isArray(a)?a:[a]},[a]),g;typeof c==="function"&&Array.isArray(e)?(g=c,e=e):(Array.isArray(c)||h(0,72179),g=function(a){return a},e=c);c=l(function(){return b==null?null:o(f,b)});var i=c[0],j=c[1],m=function(){var a=b==null?null:o(f,b);(a!==i||(a==null?void 0:a.id.toString())!==(i==null?void 0:i.id.toString()))&&j(a)};m();d("useWAWebListener").useListeners(f.map(function(a){return{source:a,eventOrEvents:"add",callback:function(){m()}}}));c=i==null?null:g(i);return d("useWAWebValues").useOptionalValues(c,e,{subscribe:n(i)})}function b(a,b){return d("useWAWebValues").useValues(a,b,{subscribe:n(a)})}function n(a){return j(function(b){if(a==null)return;a.on("change",b);a.incObservers(!0);return function(){a.decObservers(),a.off("change",b)}},[a])}function o(a,b){for(a of a){var c=a.get(b);if(c!=null)return c}return null}g.useCollectionValues=a;g.useOptionalCollectionValues=m;g.useModelGetterValues=b}),98); __d("useWAWebChatValues",["WAWebChatCollection","WAWebNewsletterCollection","useWAWebCollectionValues"],(function(a,b,c,d,e,f,g){function a(a,b){return d("useWAWebCollectionValues").useCollectionValues([d("WAWebChatCollection").ChatCollection,c("WAWebNewsletterCollection")],a,b)}function b(a,b){return d("useWAWebCollectionValues").useOptionalCollectionValues([d("WAWebChatCollection").ChatCollection,c("WAWebNewsletterCollection")],a,b)}g.useChatValues=a;g.useOptionalChatValues=b}),98); __d("useWAWebContactValues",["WAWebContactCollection","useWAWebCollectionValues"],(function(a,b,c,d,e,f,g){function a(a,b){return d("useWAWebCollectionValues").useCollectionValues(d("WAWebContactCollection").ContactCollection,a,b)}function b(a,b){return d("useWAWebCollectionValues").useOptionalCollectionValues(d("WAWebContactCollection").ContactCollection,a,b)}g.useContactValues=a;g.useOptionalContactValues=b}),98); __d("useWAWebModelValues",["WACustomError","WALogger","WANullthrows","WAWebStateConcern","WAWebStateUtils","react"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["useModelValues hook received an unexpected `null` model"],["useModelValues hook received an unexpected \\`null\\` model"]);i=function(){return a};return a}b=h||d("react");var j=b.useCallback,k=b.useEffect,l=b.useRef,m=b.useState,n=function(b){babelHelpers.inheritsLoose(a,b);function a(a){a="Received a null value for model key: "+a;return b.call(this,a)||this}return a}(d("WACustomError").customError("StateHookMissingModelError"));function a(a,b,e){if(a==null){d("WALogger").ERROR(i()).devConsole("See https://fburl.com/wiki/h7g96q1s for ways to handle this").sendLogs("state-hook-null-model");throw new n("Unknown")}a=o(a,b,e);return c("WANullthrows")(a)}function o(a,b,e){e=(e=e)!=null?e:{};var f=e.isStrong,g=f===void 0?!0:f,h=e.componentName,i=a?d("WAWebStateUtils").unproxy(a):null,n=l();function o(){if(!i)return null;if(n.current==null){var a;if(!i)return null;n.current=new(c("WAWebStateConcern"))((a=h)!=null?a:"Hook(useModelValues)",i.proxyName,Array.from(new Set(b)),g,!0)}return n.current}f=m(function(){var a=o();if(!a)return null;var b=a.getModelAndValidate(i);return!b?null:a.createProxy(b)});var p=f[0],q=f[1],r=j(function(a,b){b=a.getModelAndValidate(b);q(b?a.createProxy(b):null)},[]);k(function(){var a=o();if(!a||!p)return;var b=a.getModel(i);a.attachConcern(b,p.proxyBitMask,r);return function(){a.detachConcern(b,r)}},[i,p,r]);e=m(i);a=e[0];f=e[1];e=o();if(a!==i&&e){a&&e.detachConcern(a,r);a=e.getModelAndValidate(i);f(a);q(a?e.createProxy(a):null)}!e&&p!=null&&q(null);return p}g.StateHookMissingModelError=n;g.useModelValues=a;g.useOptionalModelValues=o}),98); __d("WAWebGroupSafetyCheckModalLoadable",["JSResourceForInteraction","WAWebLazyLoadedRetriable","WAWebLoadingConfirmPopup.react","asyncToGeneratorRuntime","react","react-loadable"],(function(a,b,c,d,e,f,g){"use strict";var h,i=h||c("react");a=c("WAWebLazyLoadedRetriable")(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield c("JSResourceForInteraction")("WAWebGroupSafetyCheckModal.react").__setRef("WAWebGroupSafetyCheckModalLoadable").load());return a}),"GroupSafetyCheckModal");d=c("react-loadable")({loader:a,loading:function(a){return i.jsx(c("WAWebLoadingConfirmPopup.react"),{error:Boolean(a.error)})}});g.GroupSafetyCheckModalLoadable=d}),98); __d("WAWebSuspendedCommunityModalLoadable",["fbt","JSResourceForInteraction","WAWebLazyLoadedRetriable","WAWebLoadingConfirmPopup.react","asyncToGeneratorRuntime","react","react-loadable"],(function(a,b,c,d,e,f,g,h){var i,j=i||c("react");a=c("WAWebLazyLoadedRetriable")(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield c("JSResourceForInteraction")("WAWebSuspendedCommunityModal.react").__setRef("WAWebSuspendedCommunityModalLoadable").load());return a.SuspendedCommunityModal}),"SuspendedCommunityModal");d=c("react-loadable")({loader:a,loading:function(a){return j.jsx(c("WAWebLoadingConfirmPopup.react"),{title:h._(/*BTDS*/"__JHASH__os2bL1t9MK3__JHASH__"),error:Boolean(a.error)})}});g.SuspendedCommunityModalLoadable=d}),226); __d("WAWebLoadingConfirmPopup.react",["WAWebConfirmPopup.react","WAWebLazyLoadLoading.react","WAWebModalManager","react"],(function(a,b,c,d,e,f,g){var h,i=h||c("react");function a(a){var b=a.error,e=a.okText;a=a.title;var f=function(){return void 0},g=function(){return d("WAWebModalManager").ModalManager.close()};return i.jsx(d("WAWebConfirmPopup.react").ConfirmPopup,{title:a,onOK:f,okText:e,okDisabled:!0,onCancel:g,children:i.jsx("div",babelHelpers["extends"]({className:"x1n2onr6 x1vd4hg5"},{children:i.jsx(c("WAWebLazyLoadLoading.react"),{error:b})}))})}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),98); __d("WAWebConfirmPopup.react",["fbt","Promise","WAWebButton.react","WAWebFbtCommon","WAWebKeyboardHotKeys.react","WAWebModal.react","WAWebModalManager","WAWebNoop","WAWebUIRefreshGatingUtils","asyncToGeneratorRuntime","react"],(function(a,b,c,d,e,f,g,h){var i,j,k=j||c("react");function l(a){var b=a.ref,e=babelHelpers.objectWithoutPropertiesLoose(a,["ref"]);a=e.buttonAlign;a=a===void 0?"end":a;var f=function(a){a.stopPropagation(),a.preventDefault(),e.onOK==null?void 0:e.onOK()},g=function(a){a.stopPropagation(),a.preventDefault(),e.onCancel==null?void 0:e.onCancel(a)};f=e.onOK?k.jsx(d("WAWebButton.react").Button,{testid:void 0,type:e.okButtonType?e.okButtonType:"primary",onClick:f,disabled:e.okDisabled,spinner:e.okSpinner===!0,children:e.okText!=null?e.okText:c("WAWebFbtCommon")("OK")}):null;var i=function(){if(e.cancelButtonType)return e.cancelButtonType;else if(e.onOK&&d("WAWebUIRefreshGatingUtils").uiRefreshM1Enabled())return"plain-white";else if(e.onOK)return"secondary"};i=e.onCancel?k.jsx(d("WAWebButton.react").Button,{testid:void 0,type:i(),disabled:e.cancelDisabled,onClick:g,children:e.cancelText!=null&&e.cancelText!==""?e.cancelText:h._(/*BTDS*/"__JHASH__JomY4EcHzcJ__JHASH__")}):null;var j=e.extraButtonProps?k.jsx(m,babelHelpers["extends"]({},e.extraButtonProps)):null;g={escape:e.onCancel?g:c("WAWebNoop")};if(j){var l;j=[i,j,f];l=k.jsxs(d("WAWebButton.react").ButtonGroup,{direction:(l=e.buttonsDirection)!=null?l:"vertical",align:a,children:[j[0],j[1],j[2]]})}else{l=k.jsxs(d("WAWebButton.react").ButtonGroup,{direction:(j=e.buttonsDirection)!=null?j:"horizontal",align:a,children:[i,f]})}return k.jsx(d("WAWebKeyboardHotKeys.react").HotKeys,{"data-testid":void 0,handlers:g,ref:b,children:k.jsx(d("WAWebModal.react").Modal,{actions:l,controlsStyle:e.buttonGroupStyle,children:e.children,cover:e.cover,onDragChange:e.onDragChange,onOverlayClick:e.onOverlayClick,onDrop:e.onDrop,type:e.type,title:e.title,testid:void 0,overflow:e.overflow,ariaLabel:e.ariaLabel,contentRef:e.contentRef})})}l.displayName=l.name+" [from "+f.id+"]";function m(a){var b=a.primary;b=b===void 0?!1:b;var c=a.disabled;c=c===void 0?!1:c;var e=a.text,f=a.type,g=a.onClick;a=a.spinner;var h=function(a){a.stopPropagation(),a.preventDefault(),g()};return k.jsx(d("WAWebButton.react").Button,{testid:void 0,type:(f=f)!=null?f:b?"primary":"secondary",onClick:h,disabled:c,spinner:a,children:e})}m.displayName=m.name+" [from "+f.id+"]";function a(a){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=a.onOK,e=a.onCancel,f=a.onOverlayClick,g=babelHelpers.objectWithoutPropertiesLoose(a,["onOK","onCancel","onOverlayClick"]);return new(i||(i=b("Promise")))(function(a){var b=function(){c==null?void 0:c(),d("WAWebModalManager").ModalManager.close(),a(!0)},h=function(b){e==null?void 0:e(b),d("WAWebModalManager").ModalManager.close(),a(!1)},i=function(b){f==null?void 0:f(b),d("WAWebModalManager").ModalManager.close(),a(!1)};d("WAWebModalManager").ModalManager.open(k.jsx(l,babelHelpers["extends"]({onOverlayClick:i,onCancel:h,onOK:b},g)))})});return n.apply(this,arguments)}g.ConfirmPopup=l;g.waitForConfirmPopup=a}),226); __d("WAWebWamEnumUrlStatusClicked",[],(function(a,b,c,d,e,f){a=Object.freeze({ONE_CLICK:1,TWO_CLICKS:2,NO_CLICK:3});f.URL_STATUS_CLICKED=a}),66); __d("WAWebLongLinkPop.react",["fbt","WAWebCmd","WAWebConfirmPopup.react","WAWebExternalLink.react","WAWebModal.react","WAWebModalManager","WAWebWamEnumUrlStatusClicked","react"],(function(a,b,c,d,e,f,g,h){var i,j=i||c("react"),k=function(){d("WAWebModalManager").ModalManager.close(),d("WAWebCmd").Cmd.closeLongLinkModal(!0)};function a(a){var b=a.link,c=function(){var c;((c=a.statusItemViewEventRef)==null?void 0:c.current)!=null&&(a.statusItemViewEventRef.current.urlStatusClicked=d("WAWebWamEnumUrlStatusClicked").URL_STATUS_CLICKED.TWO_CLICKS);d("WAWebModalManager").ModalManager.close();d("WAWebExternalLink.react").openExternalLink(b.href)};return j.jsx(d("WAWebConfirmPopup.react").ConfirmPopup,{title:h._(/*BTDS*/"__JHASH__YxStWgYYMLs__JHASH__"),okText:h._(/*BTDS*/"__JHASH__x0aQ7w-e6hn__JHASH__"),cancelText:h._(/*BTDS*/"__JHASH__JomY4EcHzcJ__JHASH__"),onOK:c,onCancel:k,type:d("WAWebModal.react").ModalTheme.LinkPopup,children:j.jsx("div",{children:b.href})})}a.displayName=a.name+" [from "+f.id+"]";g.LongLinkPopup=a}),226); __d("WAWebDomElementIs",[],(function(a,b,c,d,e,f){function a(a,b){return a instanceof HTMLElement&&a.tagName.toLowerCase()===b.toLowerCase()}f["default"]=a}),66); __d("WAWebDomIsTextNode",[],(function(a,b,c,d,e,f){function a(a){return Boolean(a&&a.nodeType===3)}f["default"]=a}),66); __d("WAWebDomRangeGetContents",["invariant","WAWebDomIsTextNode"],(function(a,b,c,d,e,f,g,h){function a(a){if(a.collapsed)return[];if(a.startContainer===a.endContainer)return c("WAWebDomIsTextNode")(a.startContainer)?[a.startContainer]:Array.prototype.slice.call(a.startContainer.childNodes,a.startOffset,a.endOffset);var b=a.commonAncestorContainer.childNodes,d;a.commonAncestorContainer===a.startContainer?d=b[0]:d=i(a.commonAncestorContainer,a.startContainer);d||h(0,56328);a.commonAncestorContainer===a.endContainer?b=b[b.length-1]:b=i(a.commonAncestorContainer,a.endContainer);b||h(0,56327);a=b;b=function(a){return a==null?void 0:a.nextSibling};var e=[];d=d;while(d&&d!==a)e.push(d),d=b(d)||b(d.parentNode);e.push(a);return e}function i(a,b){b=b;while(b.parentNode!==a){if(!b.parentNode)return null;b=b.parentNode}return b}g["default"]=a}),98); __d("WAWebCopyPasteClipboard",["WADepthFirstTraversal","WAWebCopyPasteCopyable.react","WAWebCopyPasteSelectable.react","WAWebDomElementIs","WAWebDomIsTextNode","WAWebDomRangeGetContents","lodash"],(function(a,b,c,d,e,f,g){a="application/whatsapp";var h=function(){function a(a){this.$1=a||""}var b=a.prototype;b.append=function(a,b){b===void 0&&(b="");this.$1=[this.toString(),a].filter(function(a){return a}).join(b);return this};b.prepend=function(a,b){b===void 0&&(b="");this.$1=[a,this.toString()].filter(function(a){return a}).join(b);return this};b.toString=function(){return this.$1};return a}(),i=function(){a.fromEl=function(b,c){c===void 0&&(c=d("WAWebCopyPasteCopyable.react").isCopyable(b));c=c?d("WAWebCopyPasteCopyable.react").getAppTextTemplateData(b):null;return new a("",c)};a.getTemplate=function(b){b=b;if(!b)return null;if(!(b instanceof HTMLElement)){if(!b.parentElement)return null;b=b.parentElement}var c=new a("${appText}");b=b;var e=5,f=0,g=!1;while(b&&f<e)b instanceof HTMLElement&&d("WAWebCopyPasteCopyable.react").isCopyable(b)?(c=a.fromEl(b,!0).append(c.toString()),g=g||!c.isPlainText(),e=5):f++,b=b.parentElement;return g?c.toString():null};function a(a,b){a===void 0&&(a=""),this.$1=new h(a),this.$2=b}var b=a.prototype;b.append=function(a,b){b===void 0&&(b="");this.$1.append(a,b);return this};b.prepend=function(a,b){b===void 0&&(b="");this.$1.prepend(a,b);return this};b.isPlainText=function(){return this.$2==null};b.toString=function(){return this.$2!=null?this.$2.replace(/\$\{appText\}/g,this.$1.toString()):this.$1.toString()};return a}();b=function(){function a(a,b){a=a||"";this.$1=new h(a);b!=null&&b!==""&&(this.$2=new i(a,b))}a.$3=function(b){var e=this;b=d("WAWebCopyPasteCopyable.react").findCopyableChildren(b);return c("lodash").reduceRight(b,function(a,b){return a.prepend(e.fromEl(b),"\n")},new a())};a.$4=function(a,b,e){var f=b.cloneContents().childNodes;b=c("WAWebDomRangeGetContents")(b);var g=[],h=[];for(var i=0;i<f.length;i++){var j=f[i],k=b[i].parentElement;k=(e||d("WAWebCopyPasteSelectable.react").isSelectable(b[i])||d("WAWebCopyPasteSelectable.react").hasSelectableChildren(j))&&(a.contains(b[i])||k!=null&&k.contains(a));k&&(g.push(j),h.push(b[i]))}f=g;b=h;k=e;if(f.length===1){j=f[0];k=k||d("WAWebCopyPasteSelectable.react").isSelectable(b[0]);k||(f=d("WAWebCopyPasteSelectable.react").findSelectableChildren(j),k=!1)}return{rangeNodes:f,parentIsSelectable:k}};a.fromCopyableEl=function(b,e){var f=this;e===void 0&&(e=!1);var g=d("WAWebCopyPasteCopyable.react").getPrePlainTextData(b)||"";g=new a(g);var h=d("WAWebCopyPasteCopyable.react").getPlainTextData(b),i=d("WAWebCopyPasteCopyable.react").getAppTextTemplateData(b);i=new a("",i);if(h!=null){i.appendPlainText(h);return g.append(i)}if(e||d("WAWebCopyPasteSelectable.react").isSelectable(b)){if(c("WAWebDomElementIs")(b,"br"))return g.appendPlainText("\n");c("lodash").reduceRight(b.childNodes,function(a,b){var d=c("WAWebDomElementIs")(b,"div")?"\n":"";return a.prepend(f.fromSelectableNode(b),d)},i);return g.append(i)}i.append(this.$3(b));return g.append(i)};a.fromEl=function(a,b){b===void 0&&(b=!1);return d("WAWebCopyPasteCopyable.react").isCopyable(a)||b?this.fromCopyableEl(a,b):this.$3(a)};a.fromNode=function(b,c){if(b instanceof HTMLElement)return this.fromEl(b,c);return c?this.fromSelectableNode(b):new a()};a.fromRange=function(b,e){var f=this,g=e.commonAncestorContainer,h=i.getTemplate(g);h=new a("",h);var j=d("WAWebCopyPasteSelectable.react").isSelectAll(g)?g:d("WAWebCopyPasteSelectable.react").findSelectAllParent(g);if(j instanceof HTMLElement)return h.append(this.fromCopyableEl(j));j=this.$4(b,e,d("WAWebCopyPasteSelectable.react").isSelectable(g));var k=j.parentIsSelectable;b=j.rangeNodes;return c("lodash").reduceRight(b,function(a,b){b=f.fromNode(b,k);var c=!k&&!b.toAppString().endsWith("\n")?"\n":"";return a.prepend(b,c)},h)};a.fromSelectableNode=function(b){var e=this;if(c("WAWebDomIsTextNode")(b))return new a(b.textContent);if(!(b instanceof HTMLElement))return new a();var f=b,g=new a();c("WADepthFirstTraversal")(f,function(a){return c("WAWebDomIsTextNode")(a)||d("WAWebCopyPasteCopyable.react").isCopyable(a)?[]:Array.from(a.childNodes)},function(a){var f;d("WAWebCopyPasteCopyable.react").isCopyable(a)&&a instanceof HTMLElement?(f=e.fromCopyableEl(a,!0),g.append(f)):c("WAWebDomIsTextNode")(a)?g.appendPlainText(a.textContent):c("WAWebDomElementIs")(b,"br")&&g.appendPlainText("\n")});return g};a.fromSelection=function(b,d){var e=this,f=new a();return c("lodash").range(d.rangeCount).map(function(a){a=d.getRangeAt(a);return e.fromRange(b,a)}).reduce(function(a,b){return a.append(b,"\n")},f)};var b=a.prototype;b.append=function(a,b){b===void 0&&(b="");a.hasAppText()?(this.$2=this.$2||new i(this.toPlainString()),this.$2.append(a.toAppString(),b)):this.hasAppText()&&this.$2.append(a.toAppString(),b);this.$1.append(a.toPlainString(),b);return this};b.appendPlainText=function(b,c){c===void 0;this.append(new a(b));return this};b.prepend=function(a,b){b===void 0&&(b="");a.hasAppText()?(this.$2=this.$2||new i(this.toPlainString()),this.$2.prepend(a.toAppString(),b)):this.hasAppText()&&this.$2.prepend(a.toAppString(),b);this.$1.prepend(a.toPlainString(),b);return this};b.hasAppText=function(){return Boolean(this.$2)};b.toAppText=function(){return this.hasAppText()?this.$2:new i(this.toPlainString())};b.toPlainString=function(){return this.$1.toString()};b.toAppString=function(){return this.hasAppText()?this.$2.toString():this.toPlainString()};return a}();g.APP_TEXT_MIMETYPE=a;g.Clipboard=b}),98); __d("WAWebCopyPasteCopyableArea.react",["WAWebClassnames","WAWebCopyPasteClipboard","react"],(function(a,b,c,d,e,f,g){var h,i=h||c("react"),j="copyable-area";function a(a){var b=a.canCut,c=a.children,e=a.className,f=a.ref,g=a.testid;g=babelHelpers.objectWithoutPropertiesLoose(a,["canCut","children","className","ref","testid"]);a=babelHelpers["extends"]({},g,{className:d("WAWebClassnames").classnamesConvertMeToStylexPlease(e,"xnpuxes",j),onCopy:l,onCut:b?m:void 0});return i.jsx("div",babelHelpers["extends"]({},a,{ref:f,"data-testid":void 0,children:c}))}a.displayName=a.name+" [from "+f.id+"]";function k(a,b){b=a.currentTarget;if(!(b instanceof HTMLElement))return!1;b=d("WAWebCopyPasteClipboard").Clipboard.fromSelection(b,window.getSelection());a.clipboardData.setData("text/plain",b.toPlainString());try{a.clipboardData.setData(d("WAWebCopyPasteClipboard").APP_TEXT_MIMETYPE,b.toAppString())}catch(a){}return!0}function l(a){k(a,window.getSelection())&&(a.stopPropagation(),a.preventDefault())}function m(a){var b=window.getSelection();k(a,b)&&(b.deleteFromDocument(),a.stopPropagation(),a.preventDefault(),a.target.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0})))}g["default"]=a}),98); __d("WAWebDragAndDrop.react",["react","useWAWebPrevious","useWAWebTimeout"],(function(a,b,c,d,e,f,g){var h,i;b=i||d("react");var j=h||(h=c("react")),k=b.useEffect,l=b.useImperativeHandle,m=b.useState;function n(a){if(!a.dataTransfer)return;try{if(!a.dataTransfer.dropEffect)return}catch(a){return}}function a(a){var b=a.ref;a=babelHelpers.objectWithoutPropertiesLoose(a,["ref"]);var e=a.disableFromWithin,f=a.onDrop,g=a.onDragChange;a=m(!1);var h=a[0],i=a[1];a=m(!1);var o=a[0],p=a[1];a=m(!1);var q=a[0],r=a[1];a=d("useWAWebTimeout").useTimeout(function(){p(!1),r(!1)},250);var s=a[0],t=a[1],u=c("useWAWebPrevious")(o),v=function(a){if(!e)return;i(!0)},w=function(a){if(!e)return;i(!1)};a=function(a){a.preventDefault();a.stopPropagation();p(!1);r(!0);if(!f||h)return;f(a)};var x=function(a){a.preventDefault();a.stopPropagation();t();if(o||h)return;p(!0);r(!1);n(a)},y=function(a){a.preventDefault();a.stopPropagation();if(!o)return;p(!1);r(!1)},z=function(a){s(),a.preventDefault(),a.stopPropagation()};k(function(){if(u==null||u===o||!g)return;g(o,q)},[q,o,g,u]);l(b,function(){return{onDragStart:v,onDragEnd:w,onDragOver:x,onDragLeave:z}});return j.jsx("div",{className:"x10l6tqk x13vifvy x17qophe x1wvqwft xh8yej3 x5yr21d",style:o?{}:{display:"none"},onDrop:a,onDragLeave:y},"mask")}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),98); __d("WAWebModal.react",["$InternalEnum","WAWebCopyPasteCopyableArea.react","WAWebDragAndDrop.react","WAWebL10NFbtTypeUtils","WAWebModalManager","WAWebTimeSpentLoggingNavigation","WAWebUIRefreshGatingUtils","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j,k=j||c("react"),l=(h||(h=d("react"))).useRef,m=b("$InternalEnum").Mirrored(["Box","BoxLarge","Flex","Guide","Tower","Auto","AutoWrap","Invite","InviteNew","ColumnButtons","Multiline","Upgrade","Promote","CommandPalette","CommandPaletteV2","QuickReplies","StatusViewerList","LinkPopup","StatusReport","ChatAssignment","TowerLarge","HistorySyncProgress","MessageEdit","ForwardMediaWithCaption","MessageActionsModal","DataSharing","UpdatedDataSharing","MessageLabelDeprecation","DeleteNewsletter","Small","LabelList","LabelEdit","LabelChooseColor","Comments","BotNut","EventCreation","AdAccountRecovery","MusicAttribution","BusinessHours","MediaHub","GroupSafetyCheck"]),n={overlay:{position:"xixxii4",top:"x13vifvy",start:"x17qophe",left:null,right:null,boxSizing:"x9f619",width:"xh8yej3",height:"x5yr21d",$$css:!0},backdrop:{zIndex:"x1bpt9pm",overflowX:"xw2csxc",overflowY:"x1odjw0f",backgroundColor:"xa03szm",$$css:!0},backdropRefreshed:{backgroundColor:"x1honnu5",$$css:!0},backdropMediaHub:{zIndex:"x16p50fe",$$css:!0},popup:{boxSizing:"x9f619",display:"x78zum5",flexGrow:"x1c4vz4f",flexShrink:"x2lah0s",flexBasis:"xdl72j9",flexDirection:"xdt5ytf",width:"xvue9z",paddingTop:"x1xy6bms",paddingEnd:"xxbr6pl",paddingBottom:"xx6bls6",paddingStart:"xbbxn1n",overflowX:"x6ikm8r",overflowY:"x10wlt62",backgroundColor:"x1v8jjaa",borderTopStartRadius:"xkwfhqy",borderTopEndRadius:"x17e6fzg",borderBottomEndRadius:"x15dh256",borderBottomStartRadius:"x1t7u3xy",boxShadow:"x1shw4ur",$$css:!0},popupMaterial:{borderTopStartRadius:"x1tlxs6b",borderTopEndRadius:"x1g8br2z",borderBottomEndRadius:"x1gn5b1j",borderBottomStartRadius:"x230xth",boxShadow:"xs2e80n",$$css:!0},popupSmall:{width:"x1l2rt3b",$$css:!0},popupAutoWrap:{minWidth:"x1htk8sl",width:"x14atkfc",$$css:!0},popupAutoWrapContents:{maxWidth:"x1m189uc",minWidth:"xgqtt45",$$css:!0},popupBody:{position:"x1n2onr6",flexGrow:"x1iyjqo2",flexShrink:"xs83m0k",flexBasis:"x1l7klhg",overflowWrap:"x1mzt3pk",whiteSpace:"xeaf4i8",$$css:!0},popupTitle:{marginBottom:"xieb3on",fontSize:"x1603h9y",fontWeight:"xo1l8bm",lineHeight:"x132q4wb",textAlign:"x1yc453h",$$css:!0},backdropCover:{backgroundColor:"x14zpict",$$css:!0},showOverStatus:{zIndex:"x1omtkq1",$$css:!0},popupContents:{fontSize:"x12lqup9",lineHeight:"x1o1kx08",$$css:!0},popupBox:{position:"x1n2onr6",width:"xvue9z",height:"x1egiwwb",paddingTop:"xexx8yu",paddingEnd:"x4uap5",paddingBottom:"x18d9i69",paddingStart:"xkhd6sd",$$css:!0},popupBoxLarge:{position:"x1n2onr6",width:"x1qfffx7",height:"xjr88my",paddingTop:"xexx8yu",paddingEnd:"x4uap5",paddingBottom:"x18d9i69",paddingStart:"xkhd6sd",$$css:!0},popupFlex:{width:"x14atkfc",paddingTop:"xexx8yu",paddingEnd:"x4uap5",paddingBottom:"x18d9i69",paddingStart:"xkhd6sd",backgroundColor:"x1iek97a",$$css:!0},popupAuto:{width:"x14atkfc",paddingTop:"xexx8yu",paddingEnd:"x4uap5",paddingBottom:"x18d9i69",paddingStart:"xkhd6sd",transform:"x15j3iad",$$css:!0},popupAutoTitle:{marginTop:"xdj266r",marginEnd:"x11i5rnm",marginBottom:"xat24cr",marginStart:"x1mh8g0r",$$css:!0},popupAutoBody:{position:"x1uhb9sk",$$css:!0},popupAutoContents:{backgroundColor:"x150wa6m",$$css:!0},popupAutoControls:{paddingTop:"x889kno",paddingEnd:"x1mpkggp",paddingBottom:"xs9asl8",paddingStart:"x1t2a60a",backgroundColor:"x150wa6m",$$css:!0},popupFlexInvite:{height:"x1ad3yod",paddingTop:"xexx8yu",paddingEnd:"x4uap5",paddingBottom:"x18d9i69",paddingStart:"xkhd6sd",backgroundColor:"x1iek97a",$$css:!0},popupFlexInviteNew:{width:"xr6pica",paddingTop:"x1p5oq8j",paddingEnd:"xljvro7",paddingBottom:"x84yb8i",paddingStart:"x1xfsgkm",$$css:!0},popupFlexInviteNewControls:{paddingTop:"xyamay9",justifyContent:"xl56j7k",$$css:!0},popupFlexUpgradeControls:{paddingTop:"x10lzpyj",paddingEnd:"x1mpkggp",paddingBottom:"x18d9i69",paddingStart:"x1t2a60a",$$css:!0},popupFlexControls:{paddingTop:"x123j3cw",paddingEnd:"x1gtfrk1",paddingBottom:"x156go17",paddingStart:"x1sqk8ge",$$css:!0},popupTower:{position:"x1n2onr6",flexGrow:"x1iyjqo2",flexShrink:"xs83m0k",flexBasis:"x1l7klhg",width:"xs8rnei",paddingTop:"xexx8yu",paddingEnd:"x4uap5",paddingBottom:"x18d9i69",paddingStart:"xkhd6sd",marginTop:"x1coevs8",marginEnd:"x11i5rnm",marginBottom:"xui9b5u",marginStart:"x1mh8g0r","@media screen and (min-height: 1000px)_marginTop":"xg3pqpk","@media screen and (min-height: 1000px)_marginEnd":"x5frtva","@media screen and (min-height: 1000px)_marginBottom":"x1a6k631","@media screen and (min-height: 1000px)_marginStart":"x9b845u","@media screen and (max-height: 700px)_marginTop":"x1n7bigs","@media screen and (max-height: 700px)_marginEnd":"x180mg20","@media screen and (max-height: 700px)_marginBottom":"x12v3509","@media screen and (max-height: 700px)_marginStart":"x14m7gzy",$$css:!0},popupTowerLarge:{width:"x1qfffx7",$$css:!0},popupControls:{display:"x78zum5",flexWrap:"x8hhl5t",justifyContent:"x13a6bvl",paddingTop:"x13crsa5",paddingEnd:"x1mpkggp",paddingBottom:"x18d9i69",paddingStart:"x1t2a60a",textAlign:"xp4054r",whiteSpace:"xuxw1ft",$$css:!0},popupGuideBackdrop:{backgroundColor:"xglhzf2",$$css:!0},popupGuidePopup:{width:"x14atkfc",maxWidth:"x65f84u",paddingTop:"xexx8yu",paddingEnd:"x4uap5",paddingBottom:"x18d9i69",paddingStart:"xkhd6sd",backgroundColor:"xjbqb8w",boxShadow:"x1gnnqk1",$$css:!0},popupColumnButtonsControls:{flexDirection:"xdt5ytf",flexWrap:"x1a02dak",alignItems:"xuk3077",$$css:!0},popupMultilineContents:{whiteSpace:"x1fj9vlw",$$css:!0},popupStatusViewerList:{paddingTop:"xexx8yu",paddingEnd:"x4uap5",paddingBottom:"x18d9i69",paddingStart:"xkhd6sd",$$css:!0},popupPromote:{width:"x3p9ev8",$$css:!0},popupPromoteControls:{justifyContent:"xl56j7k",textAlign:"x2b8uid",paddingTop:"xexx8yu",paddingEnd:"x4uap5",paddingBottom:"x18d9i69",paddingStart:"xkhd6sd",$$css:!0},popupForwardMediaWithCaption:{width:"x1l895tw",$$css:!0},popupForwardMediaWithCaptionControls:{textAlign:"x2b8uid",paddingTop:"xexx8yu",paddingEnd:"x4uap5",paddingBottom:"x18d9i69",paddingStart:"xkhd6sd",$$css:!0},popupMessageActionsModal:{width:"x1l2rt3b",$$css:!0},popupMessageActionsModalControls:{textAlign:"x2b8uid",paddingTop:"xexx8yu",paddingEnd:"x4uap5",paddingBottom:"x18d9i69",paddingStart:"xkhd6sd",$$css:!0},popupCommandPalette:{position:"xixxii4",paddingTop:"xexx8yu",paddingEnd:"x4uap5",paddingBottom:"x18d9i69",paddingStart:"xkhd6sd",width:"x3p9ev8",maxHeight:"x179dxpb",top:"x15nb5xm",borderTopStartRadius:"xwrnaw0",borderTopEndRadius:"x1r3e1ht",borderBottomEndRadius:"x56h04v",borderBottomStartRadius:"xmwzclc",overflowX:"x1plvlek",overflowY:"xryxfnj",backgroundColor:"x1k74hu9",$$css:!0},popupCommandPaletteV2:{width:"xvue9z",borderTopStartRadius:"xyi19xy",borderTopEndRadius:"x1ccrb07",borderBottomEndRadius:"xtf3nb5",borderBottomStartRadius:"x1pc53ja",$$css:!0},popupQuickReplies:{width:"xvue9z",paddingTop:"xexx8yu",paddingEnd:"x4uap5",paddingBottom:"x18d9i69",paddingStart:"xkhd6sd",transform:"x15j3iad",$$css:!0},popupQuickRepliesTitle:{marginTop:"xdj266r",marginEnd:"x11i5rnm",marginBottom:"xat24cr",marginStart:"x1mh8g0r",$$css:!0},popupQuickRepliesBody:{position:"x1uhb9sk",$$css:!0},popupQuickRepliesContents:{paddingTop:"xexx8yu",paddingEnd:"x13omvei",paddingBottom:"x18d9i69",paddingStart:"x1m6arcz",backgroundColor:"x150wa6m",$$css:!0},popupQuickRepliesControls:{paddingTop:"xyamay9",paddingEnd:"x13omvei",paddingBottom:"xx6bls6",paddingStart:"x1m6arcz",backgroundColor:"x150wa6m",$$css:!0},popupChatAssignment:{width:"x1l2rt3b",$$css:!0},popupHistorySyncProgress:{width:"x1l2rt3b",$$css:!0},popupDataSharing:{paddingTop:"x1p5oq8j",paddingEnd:"xxbr6pl",paddingBottom:"xwxc41k",paddingStart:"xbbxn1n",width:"x1l2rt3b",$$css:!0},popupUpdatedDataSharing:{paddingTop:"x1p5oq8j",paddingEnd:"xxbr6pl",paddingBottom:"xwxc41k",paddingStart:"xbbxn1n",width:"xbstwhj",$$css:!0},popupMessageLabelDeprecation:{paddingTop:"x1p5oq8j",paddingEnd:"xxbr6pl",paddingBottom:"xwxc41k",paddingStart:"xbbxn1n",width:"xu45tvi",$$css:!0},popupMessageEdit:{paddingTop:"xexx8yu",paddingEnd:"x4uap5",paddingBottom:"x18d9i69",paddingStart:"xkhd6sd",position:"x1n2onr6",width:"x1c4ky7w",maxHeight:"x179dxpb",$$css:!0},popupMessageEditBody:{minHeight:"x2lwn1j",$$css:!0},popupMessageEditContents:{height:"x5yr21d",$$css:!0},popupDeleteNewsletter:{width:"x1l2rt3b",paddingTop:"x1p5oq8j",paddingEnd:"xxbr6pl",paddingBottom:"xwxc41k",paddingStart:"xbbxn1n",$$css:!0},popupDeleteNewsletterBody:{display:"x78zum5",flexDirection:"xdt5ytf",$$css:!0},popupDeleteNewsletterContents:{flexGrow:"x1iyjqo2",$$css:!0},popupLabelList:{width:"x1l2rt3b",paddingTop:"xexx8yu",paddingEnd:"x4uap5",paddingBottom:"x18d9i69",paddingStart:"xkhd6sd",backgroundColor:"x150wa6m",$$css:!0},popupLabelListControls:{paddingTop:"x1p5oq8j",paddingBottom:"xwxc41k",paddingEnd:"x1pi30zi",$$css:!0},popupLabelListContents:{maxHeight:"xubnuyq",overflowY:"x1odjw0f",$$css:!0},popupLabelEdit:{width:"x1l2rt3b",paddingTop:"xexx8yu",paddingEnd:"x4uap5",paddingBottom:"x18d9i69",paddingStart:"xkhd6sd",transform:"x15j3iad",$$css:!0},popupLabelEditTitle:{marginTop:"xdj266r",marginEnd:"x11i5rnm",marginBottom:"xat24cr",marginStart:"x1mh8g0r",$$css:!0},popupLabelEditControls:{paddingTop:"x1cnzs8",paddingEnd:"x1pi30zi",paddingBottom:"xx6bls6",paddingStart:"x1swvt13",backgroundColor:"x150wa6m",$$css:!0},popupLabelEditContents:{backgroundColor:"x150wa6m",$$css:!0},popupLabelChooseColor:{width:"x14atkfc",paddingTop:"xexx8yu",paddingEnd:"x4uap5",paddingBottom:"x18d9i69",paddingStart:"xkhd6sd",transform:"x15j3iad",$$css:!0},popupLabelChooseColorTitle:{marginTop:"xdj266r",marginEnd:"x11i5rnm",marginBottom:"xat24cr",marginStart:"x1mh8g0r",$$css:!0},popupLabelChooseColorControls:{paddingTop:"x1cnzs8",paddingEnd:"x1pi30zi",paddingBottom:"xx6bls6",paddingStart:"x1swvt13",$$css:!0},popupComments:{paddingTop:"xexx8yu",paddingEnd:"x4uap5",paddingBottom:"x18d9i69",paddingStart:"xkhd6sd",maxHeight:"x12f24lm",backgroundColor:"xntdpzj",$$css:!0},popupBotNut:{width:"xht4xr3",$$css:!0},popupEventCreation:{width:"x1peuizl",borderTopStartRadius:"x1lq5wgf",borderTopEndRadius:"xgqcy7u",borderBottomEndRadius:"x30kzoy",borderBottomStartRadius:"x9jhf4c",paddingTop:"xexx8yu",paddingEnd:"x4uap5",paddingBottom:"x18d9i69",paddingStart:"xkhd6sd",$$css:!0},popupAdAccountRecovery:{width:"x14rvwrp",$$css:!0},popupBusinessHoursControls:{paddingTop:"x1cnzs8",paddingEnd:"x1pi30zi",paddingBottom:"xx6bls6",paddingStart:"x1swvt13",$$css:!0},popupMediaHub:{position:"x1n2onr6",width:"xhfkudu",height:"x1d9x2de",paddingTop:"xexx8yu",paddingEnd:"x4uap5",paddingBottom:"x18d9i69",paddingStart:"xkhd6sd",$$css:!0},popupMediaHubContents:{height:"x5yr21d",$$css:!0},popupFlexGroupSafetyCheckCenterControls:{justifyContent:"xl56j7k",$$css:!0}},o={hidden:{overflowX:"x6ikm8r",overflowY:"x10wlt62",$$css:!0},visible:{overflowX:"x1plvlek",overflowY:"xryxfnj",$$css:!0}};function a(a){var b,e,f=a.ref,g=babelHelpers.objectWithoutPropertiesLoose(a,["ref"]);a=g.overflow;a=a===void 0?"hidden":a;var h=l(null),j=l(null),p=l(),q=function(a){var b;(b=h.current)==null?void 0:b.onDragOver(a)},r=function(a){var b;(b=h.current)==null?void 0:b.onDragStart(a)},s=function(a){var b;(b=h.current)==null?void 0:b.onDragEnd(a)},t=g.type===m.StatusViewerList&&g.dimensions?{height:g.dimensions.height+"px",width:g.dimensions.width+"px"}:null;a=[n.popup,o[a],d("WAWebUIRefreshGatingUtils").uiRefreshM1Enabled()&&n.popupMaterial];var u=[n.overlay,n.backdrop,d("WAWebUIRefreshGatingUtils").uiRefreshM1Enabled()&&n.backdropRefreshed,g.type===m.MediaHub&&n.backdropMediaHub];g.cover===!0&&u.push(n.backdropCover);d("WAWebTimeSpentLoggingNavigation").useTsNavigation((b=g.tsNavigationData)!=null?b:{surface:"unknown"});var v,w,x,y;if(g.type!=null)switch(g.type){case m.Invite:a.push(n.popupFlexInvite);break;case m.InviteNew:a.push(n.popupFlexInviteNew);y=n.popupFlexInviteNewControls;break;case m.Upgrade:y=n.popupFlexUpgradeControls;break;case m.Box:a.push(n.popupBox);break;case m.BoxLarge:a.push(n.popupBoxLarge);break;case m.Flex:a.push(n.popupFlex);y=n.popupFlexControls;break;case m.Tower:a.push(n.popupTower);break;case m.TowerLarge:a.push(n.popupTower,n.popupTowerLarge);break;case m.Auto:a.push(n.popupAuto);v=n.popupAutoTitle;w=n.popupAutoBody;x=n.popupAutoContents;y=n.popupAutoControls;break;case m.ColumnButtons:y=n.popupColumnButtonsControls;break;case m.Multiline:x=n.popupMultilineContents;break;case m.StatusViewerList:a.push(n.popupStatusViewerList);u.push(n.showOverStatus);break;case m.Promote:case m.BotNut:a.push(n.popupPromote);g.type===m.BotNut&&a.push(n.popupBotNut);y=n.popupPromoteControls;break;case m.CommandPalette:a.push(n.popupCommandPalette);break;case m.CommandPaletteV2:a.push(n.popupCommandPalette);a.push(n.popupCommandPaletteV2);break;case m.QuickReplies:a.push(n.popupQuickReplies);v=n.popupQuickRepliesTitle;w=n.popupQuickRepliesBody;x=n.popupQuickRepliesContents;y=n.popupQuickRepliesControls;break;case m.ChatAssignment:a.push(n.popupChatAssignment);break;case m.HistorySyncProgress:a.push(n.popupHistorySyncProgress);break;case m.DataSharing:a.push(n.popupDataSharing);break;case m.UpdatedDataSharing:a.push(n.popupUpdatedDataSharing);break;case m.MessageLabelDeprecation:a.push(n.popupMessageLabelDeprecation);break;case m.MessageEdit:a.push(n.popupMessageEdit);w=n.popupMessageEditBody;x=n.popupMessageEditContents;break;case m.Guide:a.push(n.popupGuidePopup);u.push(n.popupGuideBackdrop);break;case m.StatusReport:u.push(n.showOverStatus);break;case m.MusicAttribution:u.push(n.showOverStatus);break;case m.LinkPopup:u.push(n.showOverStatus);break;case m.LabelList:a.push(n.popupLabelList);x=n.popupLabelListContents;y=n.popupLabelListControls;break;case m.LabelEdit:a.push(n.popupLabelEdit);v=n.popupLabelEditTitle;y=n.popupLabelEditControls;x=n.popupLabelEditContents;break;case m.LabelChooseColor:a.push(n.popupLabelChooseColor);v=n.popupLabelChooseColorTitle;y=n.popupLabelChooseColorControls;break;case m.ForwardMediaWithCaption:a.push(n.popupForwardMediaWithCaption);y=n.popupForwardMediaWithCaptionControls;break;case m.MessageActionsModal:a.push(n.popupMessageActionsModal);y=n.popupMessageActionsModalControls;break;case m.DeleteNewsletter:a.push(n.popupDeleteNewsletter);w=n.popupDeleteNewsletterBody;x=n.popupDeleteNewsletterContents;break;case m.Comments:a.push(n.popupComments);break;case m.EventCreation:a.push(n.popupEventCreation);break;case m.Small:a.push(n.popupSmall);break;case m.AutoWrap:a.push(n.popupAutoWrap);x=n.popupAutoWrapContents;break;case m.AdAccountRecovery:a.push(n.popupAdAccountRecovery);break;case m.BusinessHours:a.push(n.popupAuto);v=n.popupAutoTitle;w=n.popupAutoBody;x=n.popupAutoContents;y=n.popupBusinessHoursControls;break;case m.MediaHub:a.push(n.popupMediaHub);x=n.popupMediaHubContents;break;case m.GroupSafetyCheck:y=n.popupFlexGroupSafetyCheckCenterControls;break}b=g.actions!=null?k.jsx("div",babelHelpers["extends"]({},(i||(i=c("stylex"))).props(n.popupControls,y,g.controlsStyle),{children:g.actions})):null;var z=g.title!=null?k.jsx("h1",{"data-testid":void 0,className:(i||(i=c("stylex")))(n.popupTitle,v),children:g.title}):null,A=function(a){p.current=a.target},B=function(a){if(a.target!==j.current||p.current!==j.current)return;g.onOverlayClick?g.onOverlayClick==null?void 0:g.onOverlayClick(a):d("WAWebModalManager").ModalManager.getRef(function(a){(a==null?void 0:a.contains(j.current))&&d("WAWebModalManager").ModalManager.close()})},C=function(a){return d("WAWebL10NFbtTypeUtils").isStringOrFbt(a)?a.toString():""};C=(C(g.title)+" "+C(g.children)).trim();A=k.jsx("div",babelHelpers["extends"]({ref:j,onClick:B,onMouseDown:A},{className:"x9f619 x78zum5 xdt5ytf x6s0dn4 xl56j7k xh8yej3 xpb48g7 x1jn0hjm x1us19tq"},{"data-testid":void 0,"aria-label":(B=g.ariaLabel)!=null?B:Boolean(C)?C:void 0,role:"dialog",children:k.jsx("div",{className:(i||(i=c("stylex")))(a),"data-animate-modal-popup":!0,style:t,ref:g.contentRef,children:k.jsxs("div",babelHelpers["extends"]({},i.props(n.popupBody,w),{"data-animate-modal-body":!0,children:[z,k.jsx("div",babelHelpers["extends"]({"data-testid":void 0},i.props(n.popupContents,x),{children:g.children})),b]}))})}));return k.jsxs(c("WAWebCopyPasteCopyableArea.react"),{className:i(u),onDragOver:q,onDragStart:r,onDragEnd:s,ref:f,"data-animate-modal-backdrop":!0,children:[g.onDrop&&k.jsx(c("WAWebDragAndDrop.react"),{ref:h,disableFromWithin:!0,onDragChange:g.onDragChange,onDrop:g.onDrop}),A]})}a.displayName=a.name+" [from "+f.id+"]";g.ModalTheme=m;g.Modal=a}),98); __d("WAWebSuspiciousLinkPopup.react",["fbt","WAWebCmd","WAWebConfirmPopup.react","WAWebExternalLink.react","WAWebFaqUrl","WAWebModal.react","WAWebModalManager","react"],(function(a,b,c,d,e,f,g,h){var i,j,k=j||c("react"),l=(i||(i=d("react"))).Fragment,m=".",n=function(){d("WAWebModalManager").ModalManager.close(),d("WAWebCmd").Cmd.closeLongLinkModal(!0)};function a(a){var b=a.link;a=function(){var a=b.href;d("WAWebExternalLink.react").openExternalLink(a);d("WAWebModalManager").ModalManager.close();d("WAWebCmd").Cmd.closeLongLinkModal(!0)};var c=b.suspiciousCharacters,e=b.domain,f=b.href,g=e.split(m),i=g.map(function(a,b){var d=!1,e=a.split("").map(function(a,e){var f=c!=null&&c.has(a);d=f||d;f=f?"x117nqv4":void 0;return k.jsx("span",{className:f,children:a},b+"-"+e+"-"+a)}),f=d?"xghrzdh":void 0;return k.jsxs(l,{children:[k.jsx("span",{className:f,children:e}),b+1!==g.length?k.jsx("span",{children:m}):null]},b+"-"+a)});f=f.split(e);e=f[0];f=f[1];return k.jsxs(d("WAWebConfirmPopup.react").ConfirmPopup,{title:h._(/*BTDS*/"__JHASH__4ruJ1XErkWF__JHASH__"),okText:h._(/*BTDS*/"__JHASH__JomY4EcHzcJ__JHASH__"),cancelText:h._(/*BTDS*/"__JHASH__x0aQ7w-e6hn__JHASH__"),onOK:n,onCancel:a,type:d("WAWebModal.react").ModalTheme.LinkPopup,children:[k.jsxs("div",babelHelpers["extends"]({className:"xyorhqc"},{children:[h._(/*BTDS*/"__JHASH__ZtDgJjRCW7z__JHASH__")," ",k.jsx(d("WAWebExternalLink.react").ExternalLink,{href:d("WAWebFaqUrl").getSuspiciousLinkFaqUrl(),children:h._(/*BTDS*/"__JHASH__RR1bpeluTQm__JHASH__")})]})),k.jsxs("div",babelHelpers["extends"]({className:"x104kibb x1jquxbb x1anpbxc x6ikm8r x10wlt62 x1fc57z9 xlyipyv x1mzt3pk x1gzmk7r x1ua5tub"},{children:[e,i,f]}))]})}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),226); __d("WAWebSuspendedGroupMediaDownloadFailureModal.react",["fbt","WAWebConfirmPopup.react","WAWebModalManager","react"],(function(a,b,c,d,e,f,g,h){var i,j=i||c("react");function a(){var a=function(){return d("WAWebModalManager").ModalManager.close()};return j.jsx(d("WAWebConfirmPopup.react").ConfirmPopup,{onOK:a,title:h._(/*BTDS*/"__JHASH__OxCXkOLtmHs__JHASH__"),children:h._(/*BTDS*/"__JHASH__6_Sr87F7HLx__JHASH__")})}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),226); __d("WAWebCollections",["WAWebAdCollection","WAWebAgentCollection","WAWebBlocklistCollection","WAWebBotProfileCollection","WAWebBusinessCategoriesResultCollection","WAWebBusinessProfileCollection","WAWebCallCollection","WAWebCatalogCollection","WAWebChatAssignmentCollection","WAWebChatCollection","WAWebChatPreferenceCollection","WAWebCommentCollection","WAWebCommunityActivityCollection","WAWebContactCollection","WAWebConversionTupleCollection","WAWebDailyAggregatedStatsCollection","WAWebEmojiVariantCollection","WAWebEventResponseCollection","WAWebFavoriteCollection","WAWebFavoriteStickerCollection","WAWebFlattenedReactionCollection","WAWebGroupMetadataCollection","WAWebLabelCollection","WAWebMsgCollection","WAWebMsgInfoCollection","WAWebMuteCollection","WAWebNewsletterCollection","WAWebNewsletterMetadataCollection","WAWebOptOutListCollection","WAWebOrderCollection","WAWebPinInChatCollection","WAWebPollsPollVoteCollection","WAWebPremiumMessageCollection","WAWebPresenceCollection","WAWebProfilePicThumbCollection","WAWebQuickReplyCollection","WAWebReactionsCollection","WAWebRecentEmojiCollection","WAWebRecentReactionsCollection","WAWebRecentStickerCollection","WAWebRecentStickerCollectionMd","WAWebStarredMsgCollection","WAWebStatusCollection","WAWebStickerCollection","WAWebStickerPackCollectionMd","WAWebStickerSearchCollection","WAWebSubscriptionCollection","WAWebTextStatusCollection","WAWebUnattributedMessageCollection","WAWebUnjoinedSubgroupMetadataCollection","WAWebUserDisclosureCollection"],(function(a,b,c,d,e,f,g){a={AdCollection:d("WAWebAdCollection").AdCollection,Blocklist:d("WAWebBlocklistCollection").BlocklistCollection,OptOutList:d("WAWebOptOutListCollection").OptOutListCollection,BotProfile:d("WAWebBotProfileCollection").BotProfileCollection,BusinessCategoryResult:d("WAWebBusinessCategoriesResultCollection").BusinessCategoriesResultCollection,BusinessProfile:d("WAWebBusinessProfileCollection").BusinessProfileCollection,Call:c("WAWebCallCollection"),Catalog:d("WAWebCatalogCollection").CatalogCollection,Chat:d("WAWebChatCollection").ChatCollection,ChatAssignment:d("WAWebChatAssignmentCollection").ChatAssignmentCollection,ChatPreference:c("WAWebChatPreferenceCollection"),Contact:d("WAWebContactCollection").ContactCollection,ConversionTuple:c("WAWebConversionTupleCollection"),DailyAggregatedStats:d("WAWebDailyAggregatedStatsCollection").DailyAggregatedStatsCollection,EmojiVariant:d("WAWebEmojiVariantCollection").EmojiVariantCollection,FavoriteCollection:d("WAWebFavoriteCollection").FavoriteCollection,GroupMetadata:c("WAWebGroupMetadataCollection"),Label:d("WAWebLabelCollection").LabelCollection,Msg:d("WAWebMsgCollection").MsgCollection,MsgInfo:d("WAWebMsgInfoCollection").MsgInfoCollection,Mute:d("WAWebMuteCollection").MuteCollection,Order:d("WAWebOrderCollection").OrderCollection,PollVote:d("WAWebPollsPollVoteCollection").PollVoteCollection,Presence:d("WAWebPresenceCollection").PresenceCollection,ProfilePicThumb:d("WAWebProfilePicThumbCollection").ProfilePicThumbCollection,QuickReply:d("WAWebQuickReplyCollection").QuickReplyCollection,RecentEmoji:d("WAWebRecentEmojiCollection").RecentEmojiCollection,RecentSticker:d("WAWebRecentStickerCollection").RecentStickerCollection,StarredMsg:d("WAWebStarredMsgCollection").AllStarredMsgsCollection,TextStatus:d("WAWebTextStatusCollection").TextStatusCollection,Status:d("WAWebStatusCollection").StatusCollection,Sticker:d("WAWebStickerCollection").StickerCollection,StickerSearch:d("WAWebStickerSearchCollection").StickerSearchCollection,RecentStickerMD:d("WAWebRecentStickerCollectionMd").RecentStickerCollectionMd,StickerPackCollectionMD:d("WAWebStickerPackCollectionMd").StickerPackCollectionMd,FavoriteSticker:d("WAWebFavoriteStickerCollection").FavoriteStickerCollection,Reactions:d("WAWebReactionsCollection").ReactionsCollection,RecentReactions:d("WAWebRecentReactionsCollection").RecentReactionsCollection,UnjoinedSubgroupMetadataCollection:c("WAWebUnjoinedSubgroupMetadataCollection"),AgentCollection:d("WAWebAgentCollection").AgentCollection,SubscriptionCollection:d("WAWebSubscriptionCollection").SubscriptionCollection,UnattributedMessageCollection:d("WAWebUnattributedMessageCollection").UnattributedMessageCollection,CommunityActivityCollection:c("WAWebCommunityActivityCollection"),CommentCollection:d("WAWebCommentCollection").CommentCollection,PinInChat:d("WAWebPinInChatCollection").PinInChatCollection,NewsletterCollection:c("WAWebNewsletterCollection"),NewsletterMetadataCollection:c("WAWebNewsletterMetadataCollection"),PremiumMessageCollection:d("WAWebPremiumMessageCollection").PremiumMessageCollection,FlattenedReactionsCollection:d("WAWebFlattenedReactionCollection").FlattenedReactionsCollection,UserDisclosureCollection:d("WAWebUserDisclosureCollection").UserDisclosureCollection,EventResponseCollection:d("WAWebEventResponseCollection").EventResponseCollection};g["default"]=a}),98); __d("WAWebConversionTupleCollection",["WATimeUtils","WAWebApiParse","WAWebBaseCachePolicy","WAWebBaseCollection","WAWebConversionTupleModel","WAWebUserPrefsKeys"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}var c=b.prototype;c.initializeFromCache=function(a){if(!a)return;var b=d("WATimeUtils").unixTime()-d("WAWebConversionTupleModel").ConversionTupleExpiry;a=a.filter(function(a){return a.timestamp-b>0});a=a.map(function(a){var b=a.conversionData;a=babelHelpers.objectWithoutPropertiesLoose(a,["conversionData"]);if(b==null)return a;b=d("WAWebApiParse").parseConversionData(b);return b?babelHelpers["extends"]({},a,{conversionData:b}):a});this.add(a);this.saveToCache()};return b}(d("WAWebBaseCollection").BaseCollection);a.model=d("WAWebConversionTupleModel").ConversionTuple;a.cachePolicy={id:d("WAWebUserPrefsKeys").COLLECTIONS_KEYS.CONVERSION_TUPLE_COLLECTION,policy:d("WAWebBaseCachePolicy").CACHE_POLICY.LOAD,delay:1e3};b=new a();g["default"]=b}),98); __d("WAWebConversionTupleModel",["WABinary","WALogger","WATimeUtils","WAWebAlarm","WAWebBaseModel","WAWebConversionTupleCollection","WAWebWid"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Invalid conversionTuple timer"]);h=function(){return a};return a}var i=7*24*60*60;a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.conversionData=d("WAWebBaseModel").prop(),c.conversionSource=d("WAWebBaseModel").prop(),c.ctwaSignals=d("WAWebBaseModel").prop(),c.timestamp=d("WAWebBaseModel").prop(function(){return d("WATimeUtils").unixTime()}),c.alarmId=d("WAWebBaseModel").session(),b)||babelHelpers.assertThisInitialized(c)}var e=b.prototype;e.initialize=function(){var b=this;a.prototype.initialize.call(this);this.listenTo(this,"change:timestamp",function(){return b.$ConversionTupleImpl$p_1()});this.$ConversionTupleImpl$p_1()};e.$ConversionTupleImpl$p_1=function(){var a=this,b=this.timestamp+i;if(b<0){d("WALogger").WARN(h());this["delete"]();return}this.alarmId=c("WAWebAlarm").setLocalTimeout(function(){a["delete"]()},b*1e3,this.alarmId)};e.$ConversionTupleImpl$p_2=function(){if(this.alarmId==null)return;c("WAWebAlarm").clearTimeout(this.alarmId);this.alarmId=void 0};e.toJSON=function(){var a=this.serialize(),b=a.conversionData;a=babelHelpers.objectWithoutPropertiesLoose(a,["conversionData"]);if(b instanceof ArrayBuffer){var c=new(d("WABinary").Binary)(b);a.conversionData=c.readString(b.byteLength)}return a};e["delete"]=function(){a.prototype["delete"].call(this),this.getCollection().remove(this.id),this.$ConversionTupleImpl$p_2()};e.getCollection=function(){return c("WAWebConversionTupleCollection")};return b}(d("WAWebBaseModel").BaseModel);a.Proxy="conversionTuple";a.idClass=c("WAWebWid");b=d("WAWebBaseModel").defineModel(a);g.ConversionTupleExpiry=i;g.ConversionTuple=b}),98); __d("WAWebProductSelectors",[],(function(a,b,c,d,e,f){var g=function(a){return a.salePriceAmount1000!=null&&(a.salePriceStartDate==null||a.salePriceStartDate<=Date.now())&&(a.salePriceEndDate==null||a.salePriceEndDate>Date.now())},h=function(a){return g(a)?a.salePriceAmount1000:a.priceAmount1000};a=function(a){var b;return g(a)?Math.max(0,((b=a.priceAmount1000)!=null?b:0)-((b=a.salePriceAmount1000)!=null?b:0)):0};b=function(a){var b=a.currency,c=a.priceAmount1000;a=h(a);return!b||c==null||a==null};f.isSalePriceActive=g;f.getActivePrice=h;f.getSavings=a;f.isEmptyPrice=b}),66); __d("WAWebBizCreateProductInquiry",["WATimeUtils","WAWebAck","WAWebMediaOpaqueData","WAWebMsgKey","WAWebMsgModel","WAWebMsgType","WAWebProductSelectors","WAWebUserPrefsMeUser","WAWebViewMode.flow"],(function(a,b,c,d,e,f,g){function a(a,b,e,f){b={ack:d("WAWebAck").ACK.CLOCK,id:new(c("WAWebMsgKey"))({id:"product_inquiry_"+c("WAWebMsgKey").newId_DEPRECATED(),remote:b,fromMe:!0}),from:b,to:d("WAWebUserPrefsMeUser").getMeUser(),t:d("WATimeUtils").unixTime(),type:d("WAWebMsgType").MSG_TYPE.PRODUCT,kind:d("WAWebMsgType").MsgKind.Product,viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE,title:a.name,description:a.description,businessOwnerJid:b.toString({legacy:!0}),productId:a.id.toString(),url:a.url,productImageCount:a.getProductImageCollectionCount(),body:e.preview instanceof c("WAWebMediaOpaqueData")?e.preview.getBase64():null,currencyCode:a.currency,priceAmount1000:a.priceAmount1000,salePriceAmount1000:d("WAWebProductSelectors").isSalePriceActive(a)?a.salePriceAmount1000:null,sessionId:f,retailerId:a.retailerId};f=new(d("WAWebMsgModel").Msg)(b);f.mediaData.set(e);return f}g.createProductInquiry=a}),98); __d("WAWebBusinessCategoriesResultCollection",["WAWebBaseCollection","WAWebBizBusinessProfileAction","WAWebBusinessCategoriesResultModel","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(c,a);function c(){var c,e;for(var f=arguments.length,g=new Array(f),h=0;h<f;h++)g[h]=arguments[h];return(c=e=a.call.apply(a,[this].concat(g))||this,e.findImpl=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield d("WAWebBizBusinessProfileAction").queryBusinessCategories(a)),c=b.categories;b=b.notABizId;return{id:a,categories:c,notABizId:b}});return function(b){return a.apply(this,arguments)}}(),c)||babelHelpers.assertThisInitialized(e)}return c}(d("WAWebBaseCollection").BaseCollection);a.model=d("WAWebBusinessCategoriesResultModel").BusinessCategoriesResult;a.staleCollection=!0;c=new a();g.BusinessCategoriesResultCollectionImpl=a;g.BusinessCategoriesResultCollection=c}),98); __d("WAWebBusinessCategoriesResultModel",["WAWebBaseModel","WAWebBusinessCategoriesResultCollection"],(function(a,b,c,d,e,f,g){a="__empty_query__";b=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.categories=d("WAWebBaseModel").prop(),c.notABizId=d("WAWebBaseModel").prop(),b)||babelHelpers.assertThisInitialized(c)}var c=b.prototype;c.getCollection=function(){return d("WAWebBusinessCategoriesResultCollection").BusinessCategoriesResultCollection};return b}(d("WAWebBaseModel").BaseModel);b.Proxy="BusinessCategoriesResult";c=d("WAWebBaseModel").defineModel(b);g.BUSINESS_CATEGORY_EMPTY_STR_ID=a;g.BusinessCategoriesResult=c}),98); __d("WAWebApiDirectConnectionKeys",["WALogger","WAWebSchemaDirectConnectionKeys"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[direct-connection] Removing direct connection keys from persistent DB"]);h=function(){return a};return a}function a(a){return d("WAWebSchemaDirectConnectionKeys").getDirectConnectionKeysTable().createOrMerge(a.id,a)}function b(a){d("WALogger").DEV(h());return d("WAWebSchemaDirectConnectionKeys").getDirectConnectionKeysTable().remove(a)}function c(a){return d("WAWebSchemaDirectConnectionKeys").getDirectConnectionKeysTable().get(a)}g.createOrUpdateDirectConnectionKeys=a;g.removeDirectConnectionKeys=b;g.fetchDirectConnectionKeys=c}),98); __d("WAWebBusinessDirectConnectionModel",["WAWebBaseModel","WAWebWid"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.cypher=d("WAWebBaseModel").prop(),c.cypherExpirationTimestamp=d("WAWebBaseModel").prop(),c.cypherType=d("WAWebBaseModel").prop(),c.postcode=d("WAWebBaseModel").prop(),c.postcodeSetByUser=d("WAWebBaseModel").prop(),c.postcodeLocationName=d("WAWebBaseModel").prop(),b)||babelHelpers.assertThisInitialized(c)}return b}(d("WAWebBaseModel").BaseModel);a.Proxy="business_direct_connection";a.idClass=c("WAWebWid");b=d("WAWebBaseModel").defineModel(a);g["default"]=b}),98); __d("WAWebBusinessDirectConnectionCollection",["Promise","WALogger","WANullthrows","WAWebApiDirectConnectionKeys","WAWebBaseCollection","WAWebBizBusinessProfileAction","WAWebBusinessDirectConnectionModel","WAWebBusinessDirectUtils","WAWebDirectConnectionCypher","WAWebDirectConnectionUtils","WAWebPersistedJobDefinitions","WAWebPersistedJobManager","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[direct-connection] cypher found in client cache. Using cached cypher"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[direct-connection] cypher not found / usable cypher in client cache."]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[direct-connection] removing cypher from cache"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[direct-connection] Received 421 from Direct Connection request during verify postcode. Renewing certificate and retrying."]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[direct-connection] certificate is null during verify postcode"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["[direct-connection] verify postcode: using cypherType: ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["[direct-connection] verify and save postcode called"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["[direct-connection] Post code data could not be found"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["[direct-connection] no certificate returned from the get_public_key IQ"]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["[direct-connection] new cypher type ",""]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["[direct-connection] Cannot generate cypher"]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["[direct-connection] cypher not found / cypher unusable in client DB. Generating direct connection keys"]);t=function(){return a};return a}function u(){var a=babelHelpers.taggedTemplateLiteralLoose(["[direct-connection] cypher found in client persistent DB. Using stored cypher ",""]);u=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(e,a);function e(){return a.apply(this,arguments)||this}var f=e.prototype;f._getValidCertAndSignedUserInfo=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e){if(!e&&(c==null?void 0:c.certificateChain)){e=(yield (h||(h=b("Promise"))).all([d("WAWebBusinessDirectUtils").getValidCertificate(d("WAWebDirectConnectionUtils").stringToCertificateString(c.certificateChain)),d("WAWebBizBusinessProfileAction").querySignedUserInfo(a)]));c=e[0];e=e[1];if(c)return{signedUserInfo:e,validCertificate:c}}e=(yield (h||(h=b("Promise"))).all([d("WAWebBizBusinessProfileAction").querySignedUserInfo(a),d("WAWebBusinessDirectUtils").fetchCertificateFullChain(a)]));c=e[0];a=e[1];e=a.certificateString;a=a.leaftCertificateCommonName;if(c.businessDomain!==a)throw new(d("WAWebBusinessDirectUtils").DCCertificateDomainMismatchError)("[direct-connection] certificate common name does not match business domain");a=(yield d("WAWebBusinessDirectUtils").getValidCertificate(e));return{signedUserInfo:c,validCertificate:a}});function a(b,c,d){return a.apply(this,arguments)}return a}();f._getCypherTypeForConversation=function(a,b){return d("WAWebBusinessDirectUtils").userHasSentMessageToBusiness(a)||b?d("WAWebDirectConnectionCypher").CypherType.PhoneNumberAndPostcode:d("WAWebDirectConnectionCypher").CypherType.Postcode};f._fetchPostcode=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if(typeof (b==null?void 0:b.postcode)==="string"&&b.postcodeSetByUser===!0){return{postcode:b.postcode,postcodeSetByUser:b.postcodeSetByUser,postcodeLocationName:(b=b.postcodeLocationName)!=null?b:""}}b=(yield d("WAWebBusinessDirectUtils").fetchDefaultPostcode(a));if(b)return babelHelpers["extends"]({},b,{postcodeSetByUser:!1})});function a(b,c){return a.apply(this,arguments)}return a}();f._getCypherFromDborApi=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b===void 0&&(b=!1);var c=(yield d("WAWebApiDirectConnectionKeys").fetchDirectConnectionKeys(a.toJid()));if(!b&&c&&this._isRowDataInGoodCondition(a,c)){d("WALogger").DEV(u(),c.cypherType);return{id:a,cypher:d("WAWebDirectConnectionCypher").stringToCypherString(c.cypher),cypherExpirationTimestamp:c.cypherExpirationTimestamp,cypherType:c.cypherType,certificateChain:c.certificateChain,postcode:c.postcode,postcodeSetByUser:c.postcodeSetByUser,postcodeLocationName:c.postcodeLocationName}}d("WALogger").DEV(t());var e=this._getCypherTypeForConversation(a,typeof (c==null?void 0:c.postcode)==="string"&&c.postcodeSetByUser===!0);e=(yield this.genNewCypher(a,e,{rowData:c,forceRenew:b}));if(e==null){d("WALogger").ERROR(s());return null}yield d("WAWebApiDirectConnectionKeys").createOrUpdateDirectConnectionKeys(babelHelpers["extends"]({},e,{id:a.toJid(),cypher:d("WAWebDirectConnectionCypher").cypherStringToString(e.cypher)}));return e});function a(b,c){return a.apply(this,arguments)}return a}();f._verifyPostcode=function(a,b){return d("WAWebPersistedJobManager").getJobManager().waitUntilCompleted(d("WAWebPersistedJobDefinitions").jobSerializers.verifyPostcode(a,b))};f._updateModel=function(a){return this.set([a])};f.genNewCypher=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e,f){var g=f.rowData;f=f.forceRenew;d("WALogger").DEV(r(),e);f=(yield (h||(h=b("Promise"))).all([this._getValidCertAndSignedUserInfo(a,g,Boolean(f)),this._fetchPostcode(a,g)]));g=f[0];var i=g.validCertificate;g=g.signedUserInfo;f=f[1];if(i==null){d("WALogger").WARN(q());return null}if(f==null){d("WALogger").WARN(p());return null}var j=c("WANullthrows")(yield d("WAWebBusinessDirectUtils").getCypher(i.chain,f.postcode,g,e));j=j.cypher;g=e===d("WAWebDirectConnectionCypher").CypherType.PhoneNumberAndPostcode?g.phoneNumberSignatureExpiration:null;i=d("WAWebDirectConnectionUtils").certificateStringToString(i.string);return{id:a,cypher:j,cypherExpirationTimestamp:g,cypherType:e,certificateChain:i,postcode:f.postcode,postcodeSetByUser:f.postcodeSetByUser,postcodeLocationName:f.postcodeLocationName}});function e(b,c,d){return a.apply(this,arguments)}return e}();f.verifyAndSavePostcode=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e){e===void 0&&(e=!1);d("WALogger").DEV(o());var f=(yield d("WAWebApiDirectConnectionKeys").fetchDirectConnectionKeys(a.toJid())),g=d("WAWebDirectConnectionCypher").CypherType.PhoneNumberAndPostcode;d("WALogger").DEV(n(),g);f=(yield this._getValidCertAndSignedUserInfo(a,f,e));e=f.validCertificate;f=f.signedUserInfo;if(e==null){d("WALogger").WARN(m());return null}var h=c("WANullthrows")(yield d("WAWebBusinessDirectUtils").getCypher(e.chain,b,f,g)),i=h.cypher,j=h.exportedAesKey;h=h.iv;f=g===d("WAWebDirectConnectionCypher").CypherType.PhoneNumberAndPostcode?f.phoneNumberSignatureExpiration:null;try{var k=(yield this._verifyPostcode(a,i)),p=k.resultCode;k=k.encryptedLocationName;if(p==="success"&&typeof k==="string"){j=(yield d("WAWebDirectConnectionCypher").decryptDataWithSymmetricKeyToString(j,k,h));k=d("WAWebDirectConnectionUtils").certificateStringToString(e.string);h={cypherExpirationTimestamp:f,certificateChain:k,cypherType:g,postcode:b,postcodeSetByUser:!0,postcodeLocationName:j};yield d("WAWebApiDirectConnectionKeys").createOrUpdateDirectConnectionKeys(babelHelpers["extends"]({id:a.toJid(),cypher:d("WAWebDirectConnectionCypher").cypherStringToString(i)},h));this._updateModel(babelHelpers["extends"]({id:a,cypher:i},h));return{resultCode:p,decryptedLocationName:j}}return{resultCode:p}}catch(c){if(d("WAWebBusinessDirectUtils").errorIsDirectConnectionCypherError421(c)){d("WALogger").DEV(l());return this.verifyAndSavePostcode(a,b,!0)}throw c}});function e(b,c,d){return a.apply(this,arguments)}return e}();f.removeCypher=function(a){var c=this.get(a);if(c){d("WALogger").DEV(k());this.remove(c);return d("WAWebApiDirectConnectionKeys").removeDirectConnectionKeys(a.toJid())}return(h||(h=b("Promise"))).resolve()};f._isCypherInGoodCondition=function(a,b,c,e){return!d("WAWebBusinessDirectUtils").isCypherFromLaunch1(b)&&!d("WAWebBusinessDirectUtils").isCypherExpired(b,c)&&b===this._getCypherTypeForConversation(a,e)};f._isRowDataInGoodCondition=function(a,b){return this._isCypherInGoodCondition(a,b.cypherType,b.cypherExpirationTimestamp,b.postcodeSetByUser===!0)};f._isModelDataInGoodCondition=function(a,b){return this._isCypherInGoodCondition(a,b.cypherType,b.cypherExpirationTimestamp,b.postcodeSetByUser===!0)};f.getCypher=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=b===void 0?{}:b;b=b.forceRenew;b=b===void 0?!1:b;var c=b?null:this.get(a);if(!c||!this._isModelDataInGoodCondition(a,c)){d("WALogger").DEV(j());return[].concat(yield this.update(a,{forceRenewDirectConnection:b}))[0]}d("WALogger").DEV(i());return c});function c(b,c){return a.apply(this,arguments)}return c}();f.findImpl=function(a){return this._getCypherFromDborApi(a)};f._update=function(a,b){b=b.forceRenewDirectConnection;return this._getCypherFromDborApi(a,b)};return e}(d("WAWebBaseCollection").BaseCollection);a.model=c("WAWebBusinessDirectConnectionModel");e=new a();g["default"]=e}),98); __d("WAWebBusinessDirectUtils",["Promise","WAArraysShallowEqual","WACustomError","WALogger","WANullthrows","WAWeb-moment","WAWebBackendErrors","WAWebBizBusinessProfileAction","WAWebBusinessProfileCollection","WAWebBusinessProfileVersioningBridge","WAWebChatCollection","WAWebDirectConnectionCypher","WAWebDirectConnectionGatingUtils","WAWebDirectConnectionUtils","WAWebDirectConnectionX509","WAWebServerPropConstants","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[direct-connection] cypher is expired."]);i=function(){return a};return a}var j="YYYYMMDDTHHmmssZ",k=function(b){babelHelpers.inheritsLoose(a,b);function a(){return b.apply(this,arguments)||this}return a}(d("WACustomError").customError("DCCertificateDomainMismatchError"));function a(a,b,e){e===void 0&&(e=c("WAWeb-moment")());if(a!==d("WAWebDirectConnectionCypher").CypherType.PhoneNumberAndPostcode)return!1;if(b==null)return!0;a=c("WAWeb-moment")(b,j);b=!(a.isValid()&&a.isAfter(e));b&&d("WALogger").DEV(i());return b}function e(a){return!a}function f(a){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield d("WAWebDirectConnectionX509").extractCertificates(d("WAWebDirectConnectionUtils").certificateStringToString(a))),c=(yield d("WAWebDirectConnectionX509").validateCertificates(b.slice(1,-1),b.slice(-1)));c=c.result;return!c?null:{string:a,chain:b}});return l.apply(this,arguments)}function m(a,b,c){switch(a){case d("WAWebDirectConnectionCypher").CypherType.PhoneNumberAndPostcode:return{postcode:b,phone_number:c.phoneNumber,ttl_timestamp:c.phoneNumberSignatureExpiration,phone_number_signature:c.phoneNumberSignature};case d("WAWebDirectConnectionCypher").CypherType.Postcode:return{postcode:b}}}function n(a,b,c,e){e=m(e,b,c);return d("WAWebDirectConnectionCypher").genCypher(a[0],e)}function o(a){return p.apply(this,arguments)}function p(){p=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e;a=(yield (h||(h=b("Promise"))).all([d("WAWebBizBusinessProfileAction").queryBusinessPublicKey(a),d("WAWebDirectConnectionX509").fetchFromCABundle()]));var f=a[0].certificate;a=a[1];if(f==null)throw c("err")("[direct-connection] no certificate returned from the get_public_key IQ");f=(yield d("WAWebDirectConnectionX509").extractCertificates(d("WAWebDirectConnectionUtils").certificateStringToString(f)));e=f.length>0?(e=f[0].subject.typesAndValues.find(function(a){return a.type==="2.5.4.3"}))==null?void 0:e.value.valueBlock.value:null;a=c("WANullthrows")(yield d("WAWebDirectConnectionX509").genRootIssuers(f,a));return{certificateString:d("WAWebDirectConnectionX509").encodeToString([].concat(f,a)),leaftCertificateCommonName:e}});return p.apply(this,arguments)}function q(a){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){return Boolean(d("WAWebDirectConnectionGatingUtils").supportsDirectConnection()&&d("WAWebChatCollection").ChatCollection.get(a)!=null&&((a=(yield d("WAWebBusinessProfileCollection").BusinessProfileCollection.find(a)))==null?void 0:a.isBusinessDirectConnection()))});return r.apply(this,arguments)}function s(a){a=d("WAWebChatCollection").ChatCollection.get(a);return!!a&&a.hasMaybeSentMsgToChat()}function t(a){var b;return((b=a.directConnection)==null?void 0:b.enabled)===!0&&typeof ((b=a.directConnection.defaultPostcode)==null?void 0:b.code)==="string"}function u(a){return v.apply(this,arguments)}function v(){v=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b;a=(yield d("WAWebBusinessProfileCollection").BusinessProfileCollection.find(a));if(((b=a.directConnection)==null?void 0:b.enabled)&&a.directConnection.defaultPostcode)return{postcode:a.directConnection.defaultPostcode.code,postcodeLocationName:a.directConnection.defaultPostcode.locationName}});return v.apply(this,arguments)}var w=421;function x(a){return a instanceof d("WAWebBackendErrors").ServerStatusCodeError&&a.statusCode===w}var y=function(a,b){if(a===d("WAWebServerPropConstants").UNINITIALIZED_VALUE_WEB_BIZ_PROFILE_OPTIONS)return!1;a=(d("WAWebBusinessProfileVersioningBridge").getBusinessProfileQueryVersionWithCustomBizProfileOptions(a)&d("WAWebBusinessProfileVersioningBridge").DIRECT_CONNECTION_FLAG)>0;b=(d("WAWebBusinessProfileVersioningBridge").getBusinessProfileQueryVersionWithCustomBizProfileOptions(b)&d("WAWebBusinessProfileVersioningBridge").DIRECT_CONNECTION_FLAG)>0;return a!==b},z=function(a,b){return a!=null&&!c("WAArraysShallowEqual")(a,b)};g.timestampFormat=j;g.DCCertificateDomainMismatchError=k;g.isCypherExpired=a;g.isCypherFromLaunch1=e;g.getValidCertificate=f;g.getCypher=n;g.fetchCertificateFullChain=o;g.isCypherNeeded=q;g.userHasSentMessageToBusiness=s;g.businessSupportsPostcode=t;g.fetchDefaultPostcode=u;g.errorIsDirectConnectionCypherError421=x;g.isDirectConnectionFlagChanged=y;g.isDirectConnectionNumbersAbPropChanged=z}),98); __d("WAWebBusinessProfileCollection",["Promise","WALogger","WAWebABPropsLocalStorage","WAWebApiBusinessProfile","WAWebBaseCollection","WAWebBizBusinessProfileAction","WAWebBizGatingUtils","WAWebBusinessDirectUtils","WAWebBusinessProfileModel","WAWebBusinessProfileUtils","WAWebCmd","WAWebContactCollection","WAWebDirectConnectionGatingUtils","WAWebHandleBizBotAutomatedTypeAction","WAWebHandleBizBotWelcomeMsgProtocolModeAction","WAWebServerPropConstants","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[direct-connection] forcefully marking biz profile as stale"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Store:BusinessProfile:_findAndParse parse and save business profile from server ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["Store:BusinessProfile:_findAndParse No businessProfile found for ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["Received invalid business profile response"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["Store:BusinessProfile:_findAndParse businessProfile is only available to users (",")"]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["[direct-connection] Failed to force update biz profiles on abprop biz numbers change"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["[direct-connection] change in direct connection bit detected. marking relevant biz profiles from abprop numbers as stale"]);o=function(){return a};return a}a="catalog_exists";c=function(a){babelHelpers.inheritsLoose(c,a);function c(){var b;b=a.call(this)||this;b._inflightDbQueryMap=new Map();var c=d("WAWebABPropsLocalStorage").isABPropsAfterFirstSync()?d("WAWebDirectConnectionGatingUtils").directConnectionBusinessNumbersFromAbprop():null,e=d("WAWebABPropsLocalStorage").isABPropsAfterFirstSync()?d("WAWebBizGatingUtils").webBizProfileOptions():d("WAWebServerPropConstants").UNINITIALIZED_VALUE_WEB_BIZ_PROFILE_OPTIONS;b.listenTo(d("WAWebCmd").Cmd,"on_ab_props_update",function(){var a=d("WAWebBizGatingUtils").webBizProfileOptions();d("WAWebBusinessDirectUtils").isDirectConnectionFlagChanged(e,a)&&(d("WALogger").LOG(o()),b._markBizProfilesAsStale(d("WAWebDirectConnectionGatingUtils").directConnectionBusinessNumbersFromAbprop()));e=a;try{a=d("WAWebDirectConnectionGatingUtils").directConnectionBusinessNumbersFromAbprop();if(d("WAWebBusinessDirectUtils").isDirectConnectionNumbersAbPropChanged(c,a)){var f;b._markBizProfilesAsStale(Array.from(new Set(((f=c)!=null?f:[]).concat(a))))}c=a}catch(a){d("WALogger").ERROR(n()).verbose().devConsole(a).sendLogs("direct-connection-biz-number-abprop-sync-fail"+a)}});return b}var e=c.prototype;e.findImpl=function(a){return this._findAndParse(a,{queryCatalog:!0})};e._update=function(a,b){return this._findAndParse(a,{queryCatalog:!1,getMerchantCompliance:b==null?void 0:b.getMerchantCompliance})};e._findAndParse=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){var e=c.queryCatalog;c=c.getMerchantCompliance;var f=this.gadd(a);if(!f.id.isUserNotPSA()||f.id.isFbidBot()){d("WALogger").DEV(m(),String(a));return(h||(h=b("Promise"))).resolve({id:a})}c=d("WAWebBizBusinessProfileAction").queryBusinessProfile([{wid:f.id,tag:f.tag}],c);c=(yield c);if(!Array.isArray(c)){d("WALogger").WARN(l()).devConsole(c);return null}if(c.length===0){d("WALogger").LOG(k(),String(a));return{id:a}}c=c[0];var g=c.wid,i=c.tag;g={id:g,tag:i,dataSource:"server"};i=c.profile;if(i){var n=d("WAWebContactCollection").ContactCollection.get(a);n&&!n.isContactSyncCompleted&&(n.set("isBusiness",!0),n.set("forcedBusinessUpdateFromServer",!0));n=d("WAWebBusinessProfileUtils").parseBusinessProfile({id:c.wid,profile:i,queryCatalog:e});c=f.dataSource==="placeholder"?null:f.automatedType;i=n.automatedType;yield d("WAWebHandleBizBotAutomatedTypeAction").handleBizBotAutomatedTypeTransition(f.id,c,i);e=f.dataSource==="placeholder"?null:f.welcomeMsgProtocolMode;c=n.welcomeMsgProtocolMode;yield d("WAWebHandleBizBotWelcomeMsgProtocolModeAction").handleBizBotWelcomeMsgProtocolModeTransition(f.id,e,c);yield d("WAWebApiBusinessProfile").createOrMergeBusinessProfileRecordLidAware({id:g.id,automatedType:n.automatedType,welcomeMsgProtocolMode:n.welcomeMsgProtocolMode,prompts:n.prompts,commands:n.commands,commandsDescription:n.commandsDescription});d("WALogger").DEV(j(),a.toString()).devConsole(n);return babelHelpers["extends"]({},n,g)}return g});function a(b,c){return a.apply(this,arguments)}return a}();e.fetchBizProfile=function(a){var b=this.get(a);b&&b.markStale();return this.find(a)};e.getValid=function(a){a=this.get(a);if(a==null?void 0:a.isValid())return a};e.markProfileAsStale=function(a){(a=this.get(a))==null?void 0:a.markStale()};e.hasBusinessProfileInCache=function(a){return!!this.get(a)};e._markBizProfilesAsStale=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=this;yield (h||(h=b("Promise"))).all(a.map(function(a){return d("WAWebWidFactory").createUserWid(a)}).filter(function(a){return c.hasBusinessProfileInCache(a)}).map(function(a){d("WALogger").LOG(i()),c.markProfileAsStale(a)}))});function a(b){return a.apply(this,arguments)}return a}();return c}(d("WAWebBaseCollection").BaseCollection);c.model=d("WAWebBusinessProfileModel").BusinessProfile;c.staleCollection=!0;e=new c();g.CATALOG_EXISTS=a;g.BusinessProfileCollection=e}),98); __d("WAWebOrderRequestMsg.flow",["$InternalEnum"],(function(a,b,c,d,e,f){"use strict";a=b("$InternalEnum").Mirrored(["SMB_META_CATALOG","NATIVE","UNKNOWN"]);f.CatalogTypeForOrderRequestMessage=a}),66); __d("WAWebBusinessProfileModel",["WAWebBaseModel","WAWebBotGating","WAWebBotTypes","WAWebBusinessProfileCollection","WAWebBusinessProfileTypes","WAWebChatCollection","WAWebChatGroupUtils","WAWebContactCollection","WAWebLid1X1MigrationGating","WAWebLidMigrationUtils","WAWebOrderRequestMsg.flow","WAWebProductCatalogMetaLinkingGatingUtils","WAWebWid","WAWebWidFactory"],(function(a,b,c,d,e,f,g){var h="wa.me/";a=3;b=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.dataSource=d("WAWebBaseModel").prop("placeholder"),c.tag=d("WAWebBaseModel").prop(),c.description=d("WAWebBaseModel").prop(),c.categories=d("WAWebBaseModel").prop(),c.profileOptions=d("WAWebBaseModel").prop(),c.email=d("WAWebBaseModel").prop(),c.website=d("WAWebBaseModel").prop(),c.latitude=d("WAWebBaseModel").prop(),c.longitude=d("WAWebBaseModel").prop(),c.businessHours=d("WAWebBaseModel").prop(),c.catalogStatus=d("WAWebBaseModel").prop(),c.address=d("WAWebBaseModel").prop(),c.structuredAddress=d("WAWebBaseModel").prop(),c.legalEntityDetails=d("WAWebBaseModel").prop(),c.fbPage=d("WAWebBaseModel").prop(),c.igProfessional=d("WAWebBaseModel").prop(),c.isProfileLinked=d("WAWebBaseModel").prop(),c.directConnection=d("WAWebBaseModel").prop(),c.customUrlPath=d("WAWebBaseModel").prop(),c.isProfileLocked=d("WAWebBaseModel").prop(!0),c.memberSinceText=d("WAWebBaseModel").prop(),c.customUrl=d("WAWebBaseModel").derived(function(){var a;if(this.customUrlPath!=null)a=this.customUrlPath;else return null;return""+h+a},["customUrlPath"]),c.coverPhoto=d("WAWebBaseModel").prop(),c.automatedType=d("WAWebBaseModel").prop(d("WAWebBotTypes").BizBotAutomatedType.UNKNOWN),c.welcomeMsgProtocolMode=d("WAWebBaseModel").prop(d("WAWebBotTypes").BotWelcomeMsgProtocolModeType.NONE),c.prompts=d("WAWebBaseModel").prop(),c.commandsDescription=d("WAWebBaseModel").prop(),c.commands=d("WAWebBaseModel").prop(),c.stale=d("WAWebBaseModel").session(!0),c.isBizBot3p=d("WAWebBaseModel").derived(function(){return this.automatedType===d("WAWebBotTypes").BizBotAutomatedType.FULL_3P},["automatedType"]),c.isBizBot1p=d("WAWebBaseModel").derived(function(){return this.automatedType===d("WAWebBotTypes").BizBotAutomatedType.PARTIAL_1P},["automatedType"]),c.isCatalogDisabledDueToMetaLinking=d("WAWebBaseModel").derived(function(){return d("WAWebProductCatalogMetaLinkingGatingUtils").shouldDisableCatalogDueToMetaLinkingForProfile(this)},["profileOptions"]),b)||babelHelpers.assertThisInitialized(c)}var c=b.prototype;c.initialize=function(){var b=this;a.prototype.initialize.call(this);this.listenTo(this,"change:automatedType",function(){b.$BusinessProfileImpl$p_1(),b.$BusinessProfileImpl$p_2()});this.$BusinessProfileImpl$p_1();this.$BusinessProfileImpl$p_2()};c.markStale=function(){this.stale=!0,this.hasObservers()&&this.getCollection().find(this.id)};c.getCollection=function(){return d("WAWebBusinessProfileCollection").BusinessProfileCollection};c.isValid=function(){return Array.isArray(this.categories)};c.isBusinessDirectConnection=function(){var a;return(a=(a=(a=this.directConnection)==null?void 0:a.enabled)!=null?a:(a=this.profileOptions)==null?void 0:a.directConnection)!=null?a:!1};c.isBusinessLinkedMetaCatalog=function(){var a;return(this==null?void 0:(a=this.profileOptions)==null?void 0:a.commerceExperience)===d("WAWebBusinessProfileTypes").CommerceExperienceTypes.META_CATALOG};c.getCatalogType=function(){var a;if(((a=this.profileOptions)==null?void 0:a.commerceExperience)===d("WAWebBusinessProfileTypes").CommerceExperienceTypes.META_CATALOG)return d("WAWebOrderRequestMsg.flow").CatalogTypeForOrderRequestMessage.SMB_META_CATALOG;else if(((a=this.profileOptions)==null?void 0:a.commerceExperience)===d("WAWebBusinessProfileTypes").CommerceExperienceTypes.CATALOG)return d("WAWebOrderRequestMsg.flow").CatalogTypeForOrderRequestMessage.NATIVE;return d("WAWebOrderRequestMsg.flow").CatalogTypeForOrderRequestMessage.UNKNOWN};c.$BusinessProfileImpl$p_2=function(){if(!d("WAWebBotGating").isBizBot3pEnabled()||!this.isBizBot3p)return;var a=d("WAWebContactCollection").ContactCollection.get(this.id);a==null?void 0:a.updateName()};c.$BusinessProfileImpl$p_1=function(){var a=this.id&&this.id.isRegularUser()?d("WAWebLidMigrationUtils").toLid(this.id):null;a=d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()&&a!=null?d("WAWebChatCollection").ChatCollection.getChatByAccountLid(d("WAWebWidFactory").toChatWid(a)):d("WAWebChatCollection").ChatCollection.get(this.id);a&&d("WAWebChatGroupUtils").updateCanSend(a,this)};return b}(d("WAWebBaseModel").BaseModel);b.Proxy="businessProfile";b.idClass=c("WAWebWid");e=d("WAWebBaseModel").defineModel(b);f={description:null,email:null,website:null,latitude:null,longitude:null};g.BUSINESS_URL_DOMAIN=h;g.MAX_BUSINESS_CATEGORIES=a;g.BusinessProfile=e;g.DEFAULTS=f}),98); __d("WAWebSmbUtilsTimeUtils",["WAWeb-moment","WAWebClock"],(function(a,b,c,d,e,f,g){b="h:mm A";e="h:mmA";f="H:mm";var h="H.mm",i="HH:mm",j="HH.mm",k=[b,e,i,j,f,h];b=function(a){var b;a=a.trim();if(!a)return;for(var d of k){var e=c("WAWeb-moment")(a,d,!0);if(e.isValid()){b=e;break}}if(!b)return;e=b;d=c("WAWeb-moment")().startOf("day");a=e.diff(d);return c("WAWeb-moment").duration(a).asMinutes()};function a(a){return c("WAWeb-moment").utc().startOf("day").add(a,"minutes").format(d("WAWebClock").Clock.timestampStrFormat())}g.timeStringToMinutes=b;g.minutesToTime=a}),98); __d("WAWebSmbUtils",["fbt","WAWeb-moment","WAWebBusinessProfileTypes","WAWebSmbUtilsTimeUtils"],(function(a,b,c,d,e,f,g,h){function i(a){return c("WAWeb-moment").weekdays(a)}function j(a,b){switch(a==null?void 0:a.mode){case d("WAWebBusinessProfileTypes").BUSINESS_HOUR_MODES.SPECIFIC_HOURS:return b?l(a==null?void 0:a.hours):k(a==null?void 0:a.hours);case d("WAWebBusinessProfileTypes").BUSINESS_HOUR_MODES.APPOINTMENT_ONLY:return h._(/*BTDS*/"__JHASH__oKZd6YDl9yc__JHASH__");case d("WAWebBusinessProfileTypes").BUSINESS_HOUR_MODES.OPEN_24H:return h._(/*BTDS*/"__JHASH__mLVS1QrzI2k__JHASH__");default:return h._(/*BTDS*/"__JHASH__UAmb-1u2vgf__JHASH__")}}function k(a){return a?a.map(function(a){return a.map(d("WAWebSmbUtilsTimeUtils").minutesToTime).join(" - ")}).join("\n"):""}function l(a){if((a==null?void 0:a.length)===1)return a[0].map(d("WAWebSmbUtilsTimeUtils").minutesToTime).join(" - ");else if((a==null?void 0:a.length)===2){var b,c=(b=d("WAWebSmbUtilsTimeUtils")).minutesToTime(a[0][0]),e=b.minutesToTime(a[0][1]),f=b.minutesToTime(a[1][0]);b=b.minutesToTime(a[1][1]);return h._(/*BTDS*/"__JHASH__GLewW-rj0jO__JHASH__",[h._param("openTime",c),h._param("closeTime",e),h._param("additionalOpenTime",f),h._param("additionalCloseTime",b)])}return""}function a(a){a=encodeURIComponent(a);return"https://l.wl.co/l?u="+a}function b(a,b){var c=a.config,e=new Date().getDay();a=d("WAWebBusinessProfileTypes").DAYS_OF_WEEK.map(function(a,f){a=(e+f)%d("WAWebBusinessProfileTypes").DAYS_OF_WEEK.length;var g=d("WAWebBusinessProfileTypes").DAYS_OF_WEEK[a];a=i(a);g=j(c[g],b).toString();return{day:a,hours:g,first:f===0}});return a}function e(a){var b=a==null?{}:a.config;a=a||{};var e=a.note;a=a.timezone;var f,g=d("WAWebBusinessProfileTypes").DAYS_OF_WEEK.map(function(a,c){var e=b[a],g=!e;c=i(c);var h;e&&(f=e.mode,e.hours&&(h=e.hours.map(function(a){var b=a[0];a=a[1];return[d("WAWebSmbUtilsTimeUtils").minutesToTime(b),d("WAWebSmbUtilsTimeUtils").minutesToTime(a)]})));return{dayName:c,dayKey:a,closed:g,hours:h}}),h=c("WAWeb-moment").weekdays(!0,0);h=c("WAWeb-moment").weekdays().indexOf(h);h=g.splice(h);h=[].concat(h,g);return{mode:f,days:h,timezone:a,note:e}}g.getWebsiteLink=a;g.getBusinessHours=b;g.getBusinessHoursForEdit=e}),226); __d("WAWebBusinessProfileUtils",["fbt","WALogger","WAUpperFirst","WAWebBizGatingUtils","WAWebBotTypes","WAWebBusinessProfileModel","WAWebBusinessProfileTypes","WAWebCatalogCollection","WAWebContactCollection","WAWebExternalLink.react","WAWebSmbUtils","isStringNullOrEmpty"],(function(a,b,c,d,e,f,g,h){function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Store:BusinessProfile:missing catalog"]);i=function(){return a};return a}var j="catalog_exists",k="https://business.facebook.com/commerce/",l=function(a){var b=a.config;a=a.timezone;var c={};b.forEach(function(a){var b=a.day_of_week,e=a.mode;if(!d("WAWebBusinessProfileTypes").isBusinessHoursDayName(b))return;if(e===d("WAWebBusinessProfileTypes").BUSINESS_HOUR_MODES.SPECIFIC_HOURS){var f,g=a.open_time;a=a.close_time;c[b]||(c[b]={mode:e,hours:[]});g!=null&&a!=null&&((f=c[b])==null?void 0:f.hours)&&c[b].hours.push([g,a])}else c[b]={mode:e}});return{config:c,timezone:a}},m=function(a){var b;return(a==null?void 0:(b=a.profile_options)==null?void 0:b.commerce_experience)===d("WAWebBusinessProfileTypes").CommerceExperienceTypes.CATALOG||(a==null?void 0:(b=a.profile_options)==null?void 0:b.commerce_experience)===d("WAWebBusinessProfileTypes").CommerceExperienceTypes.META_CATALOG&&d("WAWebBizGatingUtils").isCatalogVariantsViewingEnabled()||(a==null?void 0:a.catalog_status)===j};b=function(a){if(a&&a instanceof d("WAWebBusinessProfileModel").BusinessProfile){var b;return((b=a.profileOptions)==null?void 0:b.commerceExperience)===d("WAWebBusinessProfileTypes").CommerceExperienceTypes.CATALOG||((b=a.profileOptions)==null?void 0:b.commerceExperience)===d("WAWebBusinessProfileTypes").CommerceExperienceTypes.META_CATALOG&&d("WAWebBizGatingUtils").isCatalogVariantsViewingEnabled()||a.catalogStatus===j}return m(a)};var n=function(a){var b;return(a==null?void 0:(b=a.profileOptions)==null?void 0:b.commerceExperience)===d("WAWebBusinessProfileTypes").CommerceExperienceTypes.SHOP&&Boolean(a==null?void 0:(b=a.profileOptions)==null?void 0:b.shopURL)};e=function(a){var b;return(a==null?void 0:(b=a.profileOptions)==null?void 0:b.commerceExperience)===d("WAWebBusinessProfileTypes").CommerceExperienceTypes.NONE||n(a)&&!!(a==null?void 0:(b=a.profileOptions)==null?void 0:b.isBanned)};f=function(a){a=a==null?void 0:(a=a.profileOptions)==null?void 0:a.shopURL;a!=null&&a!==""&&d("WAWebExternalLink.react").openExternalLink(a)};var o=function(a){a=a==null?void 0:(a=a.profileOptions)==null?void 0:a.commerceManagerURL;a=a!=null&&a!==""?a:k;d("WAWebExternalLink.react").openExternalLink(a)},p=function(a){return m(a)},q=function(a){var b=a.email,d=a.landline_number;a=a.mobile_number;b={email:b};c("isStringNullOrEmpty")(d)||(b.landlineNumber=d);c("isStringNullOrEmpty")(a)||(b.mobileNumber=a);return b},r=function(a){var b=a.email,c=a.landline_number;a=a.mobile_number;return q({email:b,landline_number:c,mobile_number:a})},s=function(a){var b=a.name,c=a.email,d=a.landline_number;a=a.mobile_number;c=q({email:c,landline_number:d,mobile_number:a});return babelHelpers["extends"]({},c,{name:b})},t=function(a){var b=a.entity_name,d=a.entity_type,e=a.is_registered,f=a.entity_type_custom,g=a.customer_care_details;a=a.grievance_officer_details;b={entityName:b,entityType:d,isRegistered:e};c("isStringNullOrEmpty")(f)||(b.entityTypeCustom=f);g&&(b.customerCareDetails=r(g));a&&(b.grievanceOfficerDetails=s(a));return b},u=function(a){var b=a.profile,e=a.id;a=a.queryCatalog;if(!b)return{id:e};var f=b.business_hours,g=b.catalog_status,h=b.structured_address,j=b.profile_options,k=b.address,m=b.legal_entity_details,n=b.fb_page,o=b.ig_professional,q=b.profile_is_linked,r=b.cover_photo,s=b.custom_url,u=b.automated_type,v=b.commands_description,w=b.welcome_message_protocol_mode,x=b.member_since_text,y=b.prompts,z=b.commands,A=babelHelpers.objectWithoutPropertiesLoose(b,["business_hours","catalog_status","structured_address","profile_options","address","legal_entity_details","fb_page","ig_professional","profile_is_linked","cover_photo","custom_url","automated_type","commands_description","welcome_message_protocol_mode","member_since_text","prompts","commands"]),B={id:e};f?B.businessHours=l(f):B.businessHours=null;x!=null&&d("WAWebBizGatingUtils").getFmxAgmEnabled()&&(B.memberSinceText=x);j&&(B.profileOptions={commerceExperience:j.commerce_experience,directConnection:j.direct_connection},j.cart_enabled!=null&&(B.profileOptions.cartEnabled=j.cart_enabled),j.shop_url!=null&&(B.profileOptions.shopURL=j.shop_url),j.commerce_manager_url!=null&&(B.profileOptions.commerceManagerURL=j.commerce_manager_url),j.is_banned!=null&&(B.profileOptions.isBanned=j.is_banned),j.is_profile_edit_disabled!=null&&(B.profileOptions.isProfileEditDisabled=j.is_profile_edit_disabled));p(b)&&(B.catalogStatus=g,a&&d("WAWebCatalogCollection").CatalogCollection.findCarouselCatalog(e).then(function(a){a=Array.isArray(a)?a[0]:a;var b=d("WAWebContactCollection").ContactCollection.get(e);b&&(b.businessCatalog=a)})["catch"](function(a){return d("WALogger").WARN(i()).devConsole(a)}));h?B.structuredAddress={streetAddress:h.street_address,cityId:h.city_id,localizedCityName:h.localized_city_name,zipCode:h.zip_code}:B.address=c("isStringNullOrEmpty")(k)?null:k;m&&(B.legalEntityDetails=t(m));n&&(B.fbPage={displayName:n.display_name,likes:n.likes,id:n.id});o&&(B.igProfessional={handle:o.ig_handle,followers:o.followers});q!=null&&(B.isProfileLinked=!!q);s!=null&&(B.customUrlPath=s);B.automatedType=(f=u)!=null?f:d("WAWebBotTypes").BizBotAutomatedType.UNKNOWN;B.welcomeMsgProtocolMode=(x=w)!=null?x:d("WAWebBotTypes").BotWelcomeMsgProtocolModeType.NONE;B.commandsDescription=(j=v)!=null?j:null;B.prompts=(b=y)!=null?b:null;B.commands=(g=z)!=null?g:null;B.coverPhoto=r!=null?{id:r.id,url:r.url}:null;return babelHelpers["extends"]({},d("WAWebBusinessProfileModel").DEFAULTS,A,B)},v=function(a){var b;return a.address!=null&&a.description!=null&&((b=a.businessHours)==null?void 0:b.config)!=null&&Object.keys(a.businessHours.config).length!==0&&a.email!=null&&((b=a.website)==null?void 0:b.length)!==0},w={OPEN:"open",CLOSED:"closed",OPEN_TODAY:"open_today",CLOSED_TODAY:"closed_today",OPEN_APPOINTMENT:"open_appointment",OPEN_24H:"open_24h",UNKNOWN:"unknown"};function x(a,b){if(a.timezone==null)return{status:"unknown"};b=b||new Date();var c=new Date(b.toLocaleString("en-US",{timeZone:a.timezone}));c=(b.getTime()-c.getTime())/1e3/60;a=a.config[d("WAWebBusinessProfileTypes").DAYS_OF_WEEK[b.getDay()]];if(!a)return{status:w.CLOSED_TODAY};var e=a.mode;switch(e){case d("WAWebBusinessProfileTypes").BUSINESS_HOUR_MODES.OPEN_24H:if(a)return{status:w.OPEN_24H};break;case d("WAWebBusinessProfileTypes").BUSINESS_HOUR_MODES.APPOINTMENT_ONLY:if(a)return{status:w.OPEN_APPOINTMENT};break;case d("WAWebBusinessProfileTypes").BUSINESS_HOUR_MODES.SPECIFIC_HOURS:e=b.getHours()*60+b.getMinutes();if(((b=a.hours)==null?void 0:b.length)===1){b=a.hours[0][0];var f=a.hours[0][1];if(e>=b&&e<=f)return{status:w.OPEN,openUntil:y(c+f)};else if(e<=b)return{status:w.CLOSED,opensAt:y(c+b)};return{status:w.CLOSED}}else if(((f=a.hours)==null?void 0:f.length)===2){b=a.hours[0][0];f=a.hours[0][1];var g=a.hours[1][0];a=a.hours[1][1];if(e>=b&&e<=f)return{status:w.OPEN,openUntil:y(c+f),additionalOpen:y(c+g),additionalClose:y(c+a)};else if(e<b)return{status:w.CLOSED,opensAt:y(c+b),additionalOpen:y(c+g),additionalClose:y(c+a)};else if(e>=g&&e<=a)return{status:w.OPEN,openUntil:y(c+a)};else if(e<g)return{status:w.CLOSED,opensAt:y(c+g)};return{status:w.CLOSED}}break}return{status:"unknown"}}function y(a){var b=new Date(),c=Math.floor(a/60);b.setHours(c);b.setMinutes(a%60);b.setSeconds(0);return b}function z(a){a=x(a);switch(a.status){case w.OPEN_24H:case w.OPEN_APPOINTMENT:case w.OPEN:return!0;case w.CLOSED:case w.CLOSED_TODAY:default:return!1}}function a(a){var b=z(a)?h._(/*BTDS*/"__JHASH__YN0rcyqz28Q__JHASH__"):h._(/*BTDS*/"__JHASH__s4SILnrE-g0__JHASH__"),e=h._(/*BTDS*/"__JHASH__pv_Z4S4PRUc__JHASH__");a=d("WAWebSmbUtils").getBusinessHours(a,!0);a=a.map(function(a){return c("WAUpperFirst")(a.day)+": "+a.hours}).join("\n");return[b,e,a].join("\n")}g.CATALOG_EXISTS=j;g.hasCatalog=b;g.hasShop=n;g.isShopBanned=e;g.goToShop=f;g.goToCommerceManager=o;g.parseBusinessProfile=u;g.isCompleteBizProfile=v;g.BUSINESS_OPEN_STATUS=w;g.getBusinessOpenState=x;g.quickReplyHoursStr=a}),226); __d("WAWebButtonCollection",["WAWebBaseCollection","WAWebButtonModel"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}return b}(d("WAWebBaseCollection").BaseCollection);a.model=c("WAWebButtonModel");g.ButtonCollection=a}),98); __d("WAWebChatProductMsgsCollection",["Promise","WAWebBaseCollection","WAWebFrontendMsgGetters","WAWebMsgModel"],(function(a,b,c,d,e,f,g){var h;a=function(a){babelHelpers.inheritsLoose(c,a);function c(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.hasProductBefore=!0,b)||babelHelpers.assertThisInitialized(c)}var e=c.prototype;e["delete"]=function(){a.prototype["delete"].call(this),this.stopListening(),this.reset()};e.queryProducts=function(a,c){c=a.msgs;this.hasProductBefore=!1;a=c.filter(function(a){return d("WAWebFrontendMsgGetters").getAsProduct(a)!=null});a.length===0?this.trigger("products_loaded"):this.add(a,{at:0});return(h||(h=b("Promise"))).resolve()};return c}(d("WAWebBaseCollection").BaseCollection);a.model=d("WAWebMsgModel").Msg;a.comparator=function(a,b){return a.t-b.t};g["default"]=a}),98); __d("WAWebMsgButtonReplyMsgModel",["WAWebBaseModel","WAWebMsgKey"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.unsyncedButtonReplies=d("WAWebBaseModel").prop(),b)||babelHelpers.assertThisInitialized(c)}return b}(d("WAWebBaseModel").BaseModel);a.Proxy="msgButtonReplyMsg";a.idClass=c("WAWebMsgKey");b=d("WAWebBaseModel").defineModel(a);g["default"]=b}),98); __d("WAWebMsgButtonReplyMsgCollection",["WAWebBaseCollection","WAWebMsgButtonReplyMsgModel"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}return b}(d("WAWebBaseCollection").BaseCollection);a.model=c("WAWebMsgButtonReplyMsgModel");g["default"]=a}),98); __d("WAWebTemplateButtonCollection",["WAWebBaseCollection","WAWebTemplateButtonModel"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}return b}(d("WAWebBaseCollection").BaseCollection);a.model=c("WAWebTemplateButtonModel");a.comparator=function(a,b){if(a.id<b.id)return-1;return a.id>b.id?1:0};g.TemplateButtonCollection=a}),98); __d("WAWebTemplateButtonReplyMsgCollection",["WAWebBaseCollection","WAWebMsgModel"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}return b}(d("WAWebBaseCollection").BaseCollection);a.model=d("WAWebMsgModel").Msg;a.comparator=function(a,b){return b.t-a.t};g["default"]=a}),98); __d("WAWebAgentCollection",["WAWebAgentModel","WAWebAgentModelUtils","WAWebBaseCollection","WAWebConnModel","WAWebSyncdOrphan"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b;b=a.call(this)||this;b.$AgentCollectionImpl$p_1=new Map();b.triggerDeviceIdMapUpdate=function(){b.$AgentCollectionImpl$p_1=new Map(),b.getModelsArray().forEach(function(a){b.$AgentCollectionImpl$p_1.set(a.deviceId,a)})};b.on("remove reset",b.triggerDeviceIdMapUpdate);d("WAWebConnModel").Conn.on("change:pushname",function(){var a=b.getModelsArray().filter(function(a){return a.deviceId===d("WAWebAgentModelUtils").PRIMARY_DEVICE_ID})[0];a!=null&&a.set("name",d("WAWebAgentModelUtils").getFormattedAgentNameForAgent(a))});return b}var c=b.prototype;c.add=function(b,c){b=a.prototype.add.call(this,b,c);this.triggerDeviceIdMapUpdate();d("WAWebSyncdOrphan").checkOrphanAgents(b.map(function(a){return(a=a==null?void 0:a.id)!=null?a:""}));return b};c.getByDeviceId=function(a){return this.$AgentCollectionImpl$p_1.get(a)};c.initializeFromCache=function(a){this.add(a,{merge:!0})};return b}(d("WAWebBaseCollection").BaseCollection);a.model=d("WAWebAgentModel").Agent;b=new a();g.AgentCollection=b}),98); __d("WAWebAgentModel",["WAWebAgentCollection","WAWebBaseModel"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.deviceId=d("WAWebBaseModel").prop(),c.name=d("WAWebBaseModel").prop(),c.isDeleted=d("WAWebBaseModel").prop(!1),b)||babelHelpers.assertThisInitialized(c)}var c=b.prototype;c.getCollection=function(){return d("WAWebAgentCollection").AgentCollection};return b}(d("WAWebBaseModel").BaseModel);a.Proxy="agent";b=d("WAWebBaseModel").defineModel(a);g.Agent=b}),98); __d("WAWebAgentModelUtils",["fbt","WAWebBizGatingUtils","WAWebConnModel","WAWebPremiumAccessEngine"],(function(a,b,c,d,e,f,g,h){function i(){return h._(/*BTDS*/"__JHASH__DTkdtzMVqEu__JHASH__",[h._param("business-name",d("WAWebConnModel").Conn.pushname)])}function a(){return d("WAWebBizGatingUtils").isMultiDeviceMessageAttributionEnabled()&&d("WAWebPremiumAccessEngine").isFeatureFlagEnabled("MD_EXTENSION")}var j=0;function k(a,b){return b===j?i().toString():a}function b(a){return k(a.name,a.deviceId)}g.canUserSeeMessageAttribution=a;g.PRIMARY_DEVICE_ID=j;g.getFormattedAgentName=k;g.getFormattedAgentNameForAgent=b}),226); __d("WAWebUnattributedMessageCollection",["WAWebBaseCachePolicy","WAWebBaseCollection","WAWebUnattributedMessageModel","WAWebUserPrefsKeys"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}return b}(d("WAWebBaseCollection").BaseCollection);a.model=d("WAWebUnattributedMessageModel").UnattributedMessage;a.cachePolicy={id:d("WAWebUserPrefsKeys").COLLECTIONS_KEYS.UNATTRIBUTED_MESSAGE_COLLECTION,policy:d("WAWebBaseCachePolicy").CACHE_POLICY.LOAD,delay:1e3};b=new a();g.UnattributedMessageCollection=b}),98); __d("WAWebUnattributedMessageModel",["WAWebBaseModel","WAWebUnattributedMessageCollection"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.deviceId=d("WAWebBaseModel").prop(),b)||babelHelpers.assertThisInitialized(c)}var c=b.prototype;c.getCollection=function(){return d("WAWebUnattributedMessageCollection").UnattributedMessageCollection};return b}(d("WAWebBaseModel").BaseModel);a.Proxy="unattributed_message";b=d("WAWebBaseModel").defineModel(a);g.UnattributedMessage=b}),98); __d("WAWebPremiumAccessEngine",["Promise","WALogger","WAWebBizGatingUtils","WAWebInitFromStorage","WAWebSubscriptionCollection","asyncToGeneratorRuntime","err","gkx"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["PremiumAccessEngine: error calling handler during initialize for feature ",", error ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["PremiumAccessEngine: config has no keys"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["PremiumAccessEngine: invalid config for key ",", value is empty array"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["PremiumAccessEngine: invalid config for key ",", value is not an array"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["PremiumAccessEngine: error calling handler for feature ",", error ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(['isFeatureFlagEnabled: trying to read feature "','" before PremiumAccessEngine has been initialized, error ',""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["PremiumAccessEngine: error calling handler during listen for feature ",", error ",""]);o=function(){return a};return a}var p="{}";c("gkx")("26258")||(p='{"CUSTOM_URL": ["WA_PREMIUM_1"], "MD_EXTENSION": ["WA_PREMIUM_1"]}');var q=new Map(),r=new Map(),s=!1,t=null;function a(a){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a===void 0&&(a=p);if(s)return;if(d("WAWebBizGatingUtils").isSmbOrangeEnabled()){yield d("WAWebInitFromStorage").restoreSubscriptions();t=A(a);a=z();a.forEach(function(a,b){r.set(b,{subscription:a[0].clone(),hasChanged:!1})});s=!0;yield (h||(h=b("Promise"))).resolve();q.forEach(function(a,b){var c=r.get(b);a.forEach(function(a){try{a((c==null?void 0:c.subscription)||null,(c==null?void 0:c.hasChanged)||!1)}catch(a){d("WALogger").ERROR(i(),b,a).sendLogs("PremiumAccessEngine")}})})}});return u.apply(this,arguments)}function e(a,c){if(!d("WAWebBizGatingUtils").isSmbOrangeEnabled()){(h||(h=b("Promise"))).resolve().then(function(){return c(null,!1)});return function(){return void 0}}var e=q.get(a);e||(e=new Set(),q.set(a,e));e.add(c);s&&(h||(h=b("Promise"))).resolve().then(function(){var b=r.get(a);try{c((b==null?void 0:b.subscription)||null,(b==null?void 0:b.hasChanged)||!1)}catch(b){d("WALogger").ERROR(o(),a,b).sendLogs("PremiumAccessEngine")}});return function(){var b=q.get(a);b&&b["delete"](c)}}function v(a){if(!d("WAWebBizGatingUtils").isSmbOrangeEnabled())return null;if(!s)throw c("err")("Premium access engine getFeatureFlagState() for feature "+a+" called before initialize()");return(a=(a=r.get(a))==null?void 0:a.subscription)!=null?a:null}function w(a){var b;try{b=v(a)}catch(b){d("WALogger").ERROR(n(),a,b).sendLogs("isFeatureFlagEnabled")}return b==null?!1:!b.isDeactivated||!1}function f(a){return!s?!1:w(a)}function x(){if(d("WAWebBizGatingUtils").isSmbOrangeEnabled()){if(!s)throw c("err")("Premium access engine update() called before initialize()");var a=z(),b=new Set();r.forEach(function(c,d){if(!a.has(d))c.hasChanged=!0,c.subscription=null,y(d),b.add(d);else{var e,f;e=(e=a.get(d))==null?void 0:e[0];!((f=c.subscription)==null?void 0:f.equal(e))?(c.hasChanged=!0,c.subscription=e==null?void 0:e.clone(),y(d)):c.hasChanged&&(c.hasChanged=!1,y(d))}});a.forEach(function(a,b){r.has(b)||(r.set(b,{hasChanged:!0,subscription:a[0].clone()}),y(b))});b.forEach(function(a){return r["delete"](a)})}}function y(a){var c=q.get(a),e=r.get(a);c&&e&&c.forEach(function(c){(h||(h=b("Promise"))).resolve().then(function(){c(e.subscription,e.hasChanged)})["catch"](function(b){d("WALogger").ERROR(m(),a,b).sendLogs("PremiumAccessEngine")})})}function z(){var a=new Map();t&&Object.entries(t).forEach(function(b){var c=b[0];b=b[1];if(c!=="MD_EXTENSION"&&c!=="CUSTOM_URL")return;b=b.map(function(a){return d("WAWebSubscriptionCollection").SubscriptionCollection.get(a)}).filter(Boolean);b.length>0&&(b.length>1&&B(b),a.set(c,b))});return a}function A(a){var b=!1,c=JSON.parse(a);a=Object.keys(c);a.length>0?a.forEach(function(a){var e=c[a];Array.isArray(e)||(b=!0,d("WALogger").ERROR(l(),a).sendLogs("PremiumAccessEngine"));e.length===0&&(b=!0,d("WALogger").ERROR(k(),a).sendLogs("PremiumAccessEngine"))}):(d("WALogger").DEV(j()),b=!0);return b?null:c}function B(a){a.sort(function(a,b){if(a.isDeactivated&&!b.isDeactivated)return 1;if(!a.isDeactivated&&b.isDeactivated)return-1;if(a.isDeactivated&&b.isDeactivated)return 0;if(a.isAutoRenewing&&!b.isAutoRenewing)return-1;if(b.isAutoRenewing&&!a.isAutoRenewing)return 1;return!a.isAutoRenewing&&!b.isAutoRenewing?(b.expirationDate||0)-(a.expirationDate||0):0})}g.initialize=a;g.listen=e;g.getFeatureFlagState=v;g.isFeatureFlagEnabled=w;g.isInitializedAndFeatureFlagEnabled=f;g.update=x}),98); __d("WAWebSubscriptionModel",["WAWebBaseModel","lodash"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.isDeactivated=d("WAWebBaseModel").prop(!1),c.isAutoRenewing=d("WAWebBaseModel").prop(!1),c.expirationDate=d("WAWebBaseModel").prop(),b)||babelHelpers.assertThisInitialized(c)}var e=b.prototype;e.equal=function(a){return!a?!1:a.id===this.id&&a.isAutoRenewing===this.isAutoRenewing&&a.isDeactivated===this.isDeactivated&&a.expirationDate===this.expirationDate};e.clone=function(){var a=c("lodash").clone(this);return a};return b}(d("WAWebBaseModel").BaseModel);a.Proxy="subscription";b=d("WAWebBaseModel").defineModel(a);g.Subscription=b}),98); __d("WAWebSubscriptionCollection",["WAWebBaseCollection","WAWebSubscriptionModel"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}var c=b.prototype;c.initializeFromCache=function(a){this.add(a,{merge:!0})};return b}(d("WAWebBaseCollection").BaseCollection);a.model=d("WAWebSubscriptionModel").Subscription;b=new a();g.SubscriptionCollection=b}),98); __d("WAWebCartCollection",["WALogger","WAWebBaseCachePolicy","WAWebBaseCollection","WAWebCartModel","WAWebLid1X1MigrationGating","WAWebLidMigrationUtils","WAWebUserPrefsCartLidMigration","WAWebUserPrefsKeys","WAWebWidFactory"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Error while restoring carts from cache, ",""]);h=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(b,a);function b(b,c){var d;d=a.call(this)||this;d.imageWidth=100;d.imageHeight=100;b!=null&&(d.imageWidth=b);c!=null&&(d.imageHeight=c);return d}var e=b.prototype;e.initializeFromCache=function(a){var b=this;try{a=a||[];a.forEach(function(a){var d=new(c("WAWebCartModel"))({id:a.id,itemCount:a.itemCount,total:a.total,currency:a.currency,message:a.message});b.add(d,{merge:!0});d=b.get(d.id);d==null?void 0:d.cartItemCollection.add(a.products,{merge:!0})})}catch(a){d("WALogger").WARN(h(),String(a))}};e.findCart=function(a){if(d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()&&d("WAWebUserPrefsCartLidMigration").isCartLidMigrationComplete()){var b=d("WAWebLidMigrationUtils").getEnforceCurrentLid(d("WAWebWidFactory").createUserWid(a));return this.gadd(b.toString())}return this.gadd(a)};return b}(d("WAWebBaseCollection").BaseCollection);a.model=c("WAWebCartModel");a.cachePolicy={id:d("WAWebUserPrefsKeys").COLLECTIONS_KEYS.CART_COLLECTION,policy:d("WAWebBaseCachePolicy").CACHE_POLICY.LOAD,delay:2e3};b=new a();g.CartCollection=b}),98); __d("WAWebCartItemCollection",["WAWebBaseCollection","WAWebCartItemModel"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}return b}(d("WAWebBaseCollection").BaseCollection);a.model=d("WAWebCartItemModel").CartItem;g.CartItemCollection=a}),98); __d("WAWebCartItemModel",["WAWebBaseModel","WAWebCartCollection"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.priceAmount1000=d("WAWebBaseModel").prop(),c.currency=d("WAWebBaseModel").prop(),c.name=d("WAWebBaseModel").prop(),c.quantity=d("WAWebBaseModel").prop(),c.imageHash=d("WAWebBaseModel").prop(),c.imageCdnUrl=d("WAWebBaseModel").prop(),c.maxAvailable=d("WAWebBaseModel").prop(),b)||babelHelpers.assertThisInitialized(c)}var c=b.prototype;c.getCollection=function(){return d("WAWebCartCollection").CartCollection};return b}(d("WAWebBaseModel").BaseModel);a.Proxy="cart-item";b=d("WAWebBaseModel").defineModel(a);g.CartItem=b}),98); __d("WAWebCartModel",["WAWebBaseModel","WAWebCartCollection","WAWebCartItemCollection"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.products=d("WAWebBaseModel").prop(),c.itemCount=d("WAWebBaseModel").prop(),c.total=d("WAWebBaseModel").prop(),c.currency=d("WAWebBaseModel").prop(),c.message=d("WAWebBaseModel").prop(),b)||babelHelpers.assertThisInitialized(c)}var c=b.prototype;c.countTotals=function(){var a=this.cartItemCollection.reduce(function(a,b){a.currency.add(b.currency);return{itemCount:a.itemCount+b.quantity,total:a.total+b.quantity*((b=b.priceAmount1000)!=null?b:0),currency:a.currency}},{itemCount:0,total:0,currency:new Set()}),b=a.currency.size===1;b={itemCount:a.itemCount,total:b?a.total:null,currency:b?a.currency.values().next().value:null};this.set(b,{silent:!0})};c.initialize=function(){a.prototype.initialize.call(this),this.cartItemCollection=new(d("WAWebCartItemCollection").CartItemCollection)(),this.listenTo(this,"change:cartItemCollection",this.countTotals)};c.getCollection=function(){return d("WAWebCartCollection").CartCollection};return b}(d("WAWebBaseModel").BaseModel);a.Proxy="cart";b=d("WAWebBaseModel").defineModel(a);g["default"]=b}),98); __d("WAWebAssignedAgentsCollection",["WAWebAgentModel","WAWebBaseCollection"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}return b}(d("WAWebBaseCollection").BaseCollection);a.model=d("WAWebAgentModel").Agent;g.AssignedAgentsCollection=a}),98); __d("WAWebChatAssignmentCollection",["WALogger","WAWebAgentCollection","WAWebAssignedAgentsCollection","WAWebBaseCollection","WAWebChatAssignmentModel","WAWebWidFactory"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["chat_assignment_collection:_handleAdd failed"]);h=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b;b=a.call(this)||this;b.$ChatAssignmentCollectionImpl$p_1=new Map();b.$ChatAssignmentCollectionImpl$p_2=new Map();b.$ChatAssignmentCollectionImpl$p_3=[];b.listenTo(babelHelpers.assertThisInitialized(b),"add",b.$ChatAssignmentCollectionImpl$p_4);b.listenTo(babelHelpers.assertThisInitialized(b),"remove",b.$ChatAssignmentCollectionImpl$p_5);b.listenTo(babelHelpers.assertThisInitialized(b),"change",b.$ChatAssignmentCollectionImpl$p_6);b.listenTo(d("WAWebAgentCollection").AgentCollection,"add",b.$ChatAssignmentCollectionImpl$p_7);return b}var c=b.prototype;c.$ChatAssignmentCollectionImpl$p_4=function(a){this.$ChatAssignmentCollectionImpl$p_1.set(a.chatId,!a.chatOpenedByAgent);var b=this.getAgentCollectionForChatId(d("WAWebWidFactory").createWid(a.chatId));if(a.agent==null){var c=d("WAWebAgentCollection").AgentCollection.get(a.agentId);c!=null?a.agent=c:d("WALogger").WARN(h()).sendLogs("chat_assignment_collection:_handleAdd: attempted to add assignment without agent")}a.agent!=null&&b.add(a.agent)};c.$ChatAssignmentCollectionImpl$p_5=function(a){var b=this.$ChatAssignmentCollectionImpl$p_2.get(a.chatId);b&&b.remove(a.agent);this.$ChatAssignmentCollectionImpl$p_1["delete"](a.chatId)};c.$ChatAssignmentCollectionImpl$p_6=function(a){this.$ChatAssignmentCollectionImpl$p_1.set(a.chatId,!a.chatOpenedByAgent),this.getAgentCollectionForChatId(d("WAWebWidFactory").createWid(a.chatId)).trigger("change",[])};c.$ChatAssignmentCollectionImpl$p_7=function(a){var b=this.$ChatAssignmentCollectionImpl$p_3.filter(function(b){return b.agentId===a.id});this.processChatAssignments(b)};c.processChatAssignments=function(a){var b=this,c=[];a.forEach(function(a){var e,f=d("WAWebAgentCollection").AgentCollection.get(a.agentId);if(((e=b.get(a.id))==null?void 0:e.agent.id)===a.agentId){(e=b.get(a.id))==null?void 0:e.set({chatOpenedByAgent:a.chatOpenedByAgent})}else f&&!f.isDeleted?c.push(new(d("WAWebChatAssignmentModel").ChatAssignment)({id:a.id,chatId:a.chatId,chatOpenedByAgent:a.chatOpenedByAgent,agent:f})):b.$ChatAssignmentCollectionImpl$p_3.push(a)});this.add(c,{merge:!0})};c.getChatUnopenedStatus=function(a){return!!this.$ChatAssignmentCollectionImpl$p_1.get(a.toString({legacy:!0}))};c.reset=function(){this.$ChatAssignmentCollectionImpl$p_2.forEach(function(a){a.reset()}),a.prototype.reset.call(this)};c.getAgentCollectionForChatId=function(a){var b=this.$ChatAssignmentCollectionImpl$p_2.get(a.toString({legacy:!0}));b||(b=new(d("WAWebAssignedAgentsCollection").AssignedAgentsCollection)(),this.$ChatAssignmentCollectionImpl$p_2.set(a.toString({legacy:!0}),b));return b};c.initializeFromCache=function(a){this.processChatAssignments(a)};return b}(d("WAWebBaseCollection").BaseCollection);a.model=d("WAWebChatAssignmentModel").ChatAssignment;b=new a();g.ChatAssignmentCollection=b}),98); __d("WAWebChatAssignmentModel",["WAWebBaseModel","WAWebChatAssignmentCollection"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.chatId=d("WAWebBaseModel").prop(),c.agent=d("WAWebBaseModel").prop(),c.agentId=d("WAWebBaseModel").prop(),c.chatOpenedByAgent=d("WAWebBaseModel").prop(),b)||babelHelpers.assertThisInitialized(c)}var c=b.prototype;c.getCollection=function(){return d("WAWebChatAssignmentCollection").ChatAssignmentCollection};return b}(d("WAWebBaseModel").BaseModel);a.Proxy="chat_assignment";b=d("WAWebBaseModel").defineModel(a);g.ChatAssignment=b}),98); __d("WAWebChatAssignmentUtils",["WAWebBizGatingUtils","WAWebPremiumAccessEngine","WAWebProtobufsE2E.pb"],(function(a,b,c,d,e,f,g){function h(){return d("WAWebBizGatingUtils").chatAssignmentEnabled()&&d("WAWebPremiumAccessEngine").isInitializedAndFeatureFlagEnabled("MD_EXTENSION")}function a(a){return a==null?!1:a.every(function(a){return i(a)})}function i(a){if(d("WAWebBizGatingUtils").isBizAiChatAssignmentHidingEnabled()===!1)return h();return a==null?!1:h()&&a.capiThreadControl!==d("WAWebProtobufsE2E.pb").Message$CloudAPIThreadControlNotification$CloudAPIThreadControl.CONTROL_TAKEN}function b(a){return a!==!0&&d("WAWebBizGatingUtils").chatAssignmentSystemMessagesEnabled()&&h()}g.canAssignChats=h;g.canAssignAllChats=a;g.canAssignChat=i;g.shouldUseChatAssignmentCTA=b}),98); __d("WAWebNoteCollection",["WAWebBaseCollection","WAWebNoteModel"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b;b=a.call(this)||this;b.queriedChatJids=new Set();return b}var c=b.prototype;c.maybeGetNoteByChatJid=function(a){var b=this.findFirst(function(b){return b.chatJid===a});return(b=b)!=null?b:null};c.hasCachedQueryForChatJid=function(a){return this.queriedChatJids.has(a)};c.updateCollectionFromDB=function(a,b){this.queriedChatJids.add(a);if(b==null)return;this.add(new(d("WAWebNoteModel").Note)(b),{merge:!0})};c.purgeNotesByChatJid=function(a){var b=this.where({chatJid:a});this.remove(b);this.queriedChatJids["delete"](a)};return b}(d("WAWebBaseCollection").BaseCollection);a.model=d("WAWebNoteModel").Note;b=new a();g.NoteCollection=b}),98); __d("WAWebBizOrderGetFriendlyRandomIdAction",[],(function(a,b,c,d,e,f){function a(){var a=typeof BigInt==="function"?BigInt:Number;return a(String(Date.now())+Math.random().toFixed(4).slice(-4)).toString(36).toUpperCase()}f["default"]=a}),66); __d("WAWebOrderCollection",["Promise","WAWebBaseCollection","WAWebBizOrderAction","WAWebBizOrderGetFriendlyRandomIdAction","WAWebCurrencyUtils","WAWebE2EProtoUtils","WAWebL10NCountryCodes","WAWebOrderModel","WAWebUserPrefsMeUser","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;a=function(a){babelHelpers.inheritsLoose(e,a);function e(b,c){var d;d=a.call(this)||this;d.width=80;d.height=80;b!=null&&(d.width=b);c!=null&&(d.height=c);return d}var f=e.prototype;f.addOrder=function(){var b=c("WAWebBizOrderGetFriendlyRandomIdAction")(),e=d("WAWebUserPrefsMeUser").getMeUser();a.prototype.add.call(this,{id:b,fetchedFromServer:!1,sellerJid:d("WAWebE2EProtoUtils").encodeJid(e),createdAt:Math.round(new Date().getTime()/1e3),currency:d("WAWebCurrencyUtils").currencyForCountryShortcode(d("WAWebL10NCountryCodes").getCountryShortcodeByPhone(e.user)),products:[],tax:null,subtotal:null,total:null});return this.assertGet(b)};f.findOrder=function(a,c,d){var e=this.get(a);return e!=null?(h||(h=b("Promise"))).resolve(e):this.$OrderCollectionImpl$p_1(a,c,d)};f.$OrderCollectionImpl$p_1=function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(c,e,f){f=(yield d("WAWebBizOrderAction").queryOrder(d("WAWebWidFactory").createWid(e),c,this.width,this.height,f));a.prototype.add.call(this,babelHelpers["extends"]({id:c,fetchedFromServer:!0,sellerJid:e},f));e=this.get(c);if(e!=null)return(h||(h=b("Promise"))).resolve(e)});function e(a,b,d){return c.apply(this,arguments)}return e}();return e}(d("WAWebBaseCollection").BaseCollection);a.model=c("WAWebOrderModel");a.staleCollection=!0;e=new a();g.OrderCollection=e}),98); __d("WAWebOrderItemCollection",["WAWebBaseCollection","WAWebOrderItemModel"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}return b}(d("WAWebBaseCollection").BaseCollection);a.model=c("WAWebOrderItemModel");g.OrderItemCollection=a}),98); __d("WAWebOrderItemModel",["WAWebBaseModel","WAWebOrderCollection","WAWebOrderItemGetters"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.price=d("WAWebBaseModel").prop(),c.currency=d("WAWebBaseModel").prop(),c.name=d("WAWebBaseModel").prop(),c.quantity=d("WAWebBaseModel").prop(),c.thumbnailId=d("WAWebBaseModel").prop(),c.thumbnailUrl=d("WAWebBaseModel").prop(),c.isCustomItem=d("WAWebBaseModel").prop(),c.isQuantitySet=d("WAWebBaseModel").prop(),b)||babelHelpers.assertThisInitialized(c)}var c=b.prototype;c.getCollection=function(){return d("WAWebOrderCollection").OrderCollection};c["delete"]=function(){a.prototype["delete"].call(this),d("WAWebOrderItemGetters").clearOrderItemGetterCacheFor(this)};return b}(d("WAWebBaseModel").BaseModel);a.Proxy="order-item";b=d("WAWebBaseModel").defineModel(a);g["default"]=b}),98); __d("WAWebOrderGetters",["WAWebGetters","WAWebGettersCaches"],(function(a,b,c,d,e,f,g){a=d("WAWebGetters").createGetterFactories({createCache:d("WAWebGettersCaches").createOrderCache});b=a.field;c=a.computed;e=a.clearCacheFor;f=e;d=b("products");a=c(function(a){a=a[0];return a.reduce(function(a,b){return a+b.quantity},0)},[d]);g.clearOrderGetterCacheFor=f;g.getTotalItemCount=a}),98); __d("WAWebOrderModel",["WAWebBaseModel","WAWebOrderCollection","WAWebOrderGetters","WAWebOrderItemCollection","WAWebOrderItemModel"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.products=d("WAWebBaseModel").prop(),c.itemCount=d("WAWebBaseModel").prop(),c.subtotal=d("WAWebBaseModel").prop(),c.tax=d("WAWebBaseModel").prop(),c.total=d("WAWebBaseModel").prop(),c.currency=d("WAWebBaseModel").prop(),c.createdAt=d("WAWebBaseModel").prop(),c.sellerJid=d("WAWebBaseModel").prop(),b)||babelHelpers.assertThisInitialized(c)}var e=b.prototype;e.initialize=function(){a.prototype.initialize.call(this),this.orderItemCollection=new(d("WAWebOrderItemCollection").OrderItemCollection)(),this.listenTo(this,"change:cartItemCollection",this.triggerItemCollectionUpdate),this.triggerItemCollectionUpdate()};e.triggerItemCollectionUpdate=function(){this.orderItemCollection.set(this.products.map(function(a){return new(c("WAWebOrderItemModel"))(babelHelpers["extends"]({},a))}),{merge:!0})};e.getCollection=function(){return d("WAWebOrderCollection").OrderCollection};e["delete"]=function(){a.prototype["delete"].call(this),d("WAWebOrderGetters").clearOrderGetterCacheFor(this)};return b}(d("WAWebBaseModel").BaseModel);a.Proxy="order";b=d("WAWebBaseModel").defineModel(a);g["default"]=b}),98); __d("WAWebProductCatalogLogQplEvents",["WAWebQplQuickPerformanceLoggerMarkerIds","WAWebQplQuickPerformanceLoggerModule"],(function(a,b,c,d,e,f,g){function a(a){d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.WHATSAPP_PRODUCT_MESSAGE_SEND,a)}function b(a){d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(d("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.WHATSAPP_CATALOG_VIEW,a)}g.qplPointProductMessageSend=a;g.qplPointCatalogView=b}),98); __d("WAWebCatalogCollection",["Promise","WALogger","WAWebBackendErrors","WAWebBaseCollection","WAWebBizGatingUtils","WAWebBizProductCatalogAction","WAWebBizProductCatalogBridge","WAWebBusinessProfileCollection","WAWebCatalogModel","WAWebCatalogVariantHelper","WAWebLidMigrationUtils","WAWebMsgGetters","WAWebProductCatalogLogQplEvents","WAWebQplQuickPerformanceLoggerModule","WAWebUserPrefsMeUser","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime","err","isStringNullOrEmpty"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Catalog data cleanup called on a non-existent catalogId"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Catalog:AdAccountRecoveryRequiredError received empty email mask"]);j=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.selfCatalogErrorEmailMask=null,c.findQueryImpl=function(a,b){return c._findImplCommon(a,b).then(function(a){return[a]})},c.findImpl=function(a){a=c.convertCatalogIdForLidMigration(a);return c._findImplCommon(a)},b)||babelHelpers.assertThisInitialized(c)}var f=e.prototype;f.addMsgAsProduct=function(b){var c=d("WAWebMsgGetters").getBusinessOwnerJid(b.unsafe());c=c!=null?d("WAWebWidFactory").createWid(c):null;if(c==null)return;var e=this.get(c),f=b.productId!=null?e==null?void 0:e.msgProductCollection.get(b.productId):null;e=b.productId!=null?e==null?void 0:e.productCollection.get(b.productId):null;if((e==null?void 0:e.t)&&e.t>=b.t)return;if(f==null?void 0:f.fetchedFromServer)return;f=d("WAWebBizProductCatalogBridge").mapMsgToProductModel(b);return a.prototype.add.call(this,{id:c,afterCursor:void 0,_msgs:[f],stale:!0,fetchedFromServer:!!e},{merge:!0})};f._queryProduct=function(){var e=b("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var f=e.catalogWid,g=e.productId,i=e.productMsgMediaData,j=e.width,k=e.height,l=e.shouldFetchComplianceFields;e=e.canLogQpl;j=(yield d("WAWebBizProductCatalogAction").queryProduct(f,g,j,k,l,e));if(j.error==="NOT_FOUND"){k=this.get(f);k==null?void 0:k.productCollection.remove(g);return(h||(h=b("Promise"))).reject(new(d("WAWebBackendErrors").E404)("CatalogCollection:findProduct:_queryProduct NOT_FOUND"))}if(!j.data)return a.prototype.add.call(this,{id:f,afterCursor:void 0});l=j.data;if(!l.image_cdn_urls)return(h||(h=b("Promise"))).reject(c("err")("CatalogCollection:findProduct:_queryProduct: could not find image_cdn_urls for product"));e=d("WAWebBizProductCatalogBridge").mapProductResponseToModel(l,f);e.productMsgMediaData=i;k=[e];return a.prototype.add.call(this,{id:f,afterCursor:void 0,_products:k,_msgs:k},{merge:!0})});function e(a){return e.apply(this,arguments)}return e}();f.findProduct=function(a){var d=a.catalogWid,e=a.productId,f=a.productMsgMediaData,g=a.shouldFetchComplianceFields;a=a.canLogQpl;d=this.convertCatalogIdForLidMigration(d);return c("isStringNullOrEmpty")(e)?(h||(h=b("Promise"))).reject(c("err")("CatalogCollection:findProduct Received productId type "+(e===void 0?"undefined":"null"))):this._queryProduct({catalogWid:d,productId:e,productMsgMediaData:f,shouldFetchComplianceFields:g,canLogQpl:a})};f._queryCatalog=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e,f,g,i,k){a=a?a.index:0;k&&d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(k,"datasource_catalog_start");var l,m,n;try{var o=(yield d("WAWebBusinessProfileCollection").BusinessProfileCollection.find(e));d("WAWebCatalogVariantHelper").shouldRequestVariantInfo(o)&&(l=d("WAWebCatalogVariantHelper").FULL_VARIANT_INFO_FIELDS,m=d("WAWebCatalogVariantHelper").VARIANT_THUMBNAIL_IMAGE_SIZE,n=d("WAWebCatalogVariantHelper").VARIANT_THUMBNAIL_IMAGE_SIZE);o=(yield d("WAWebBizProductCatalogAction").queryCatalog(e,f,10,void 0,void 0,g,i,l,m,n));k&&d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(k,"datasource_catalog_end");this.hasSelfCatalogErrorEmailMask()&&this.shouldUseCatalogErrorEmailMask(e)&&this.resetSelfCatalogErrorEmailMask();if(!o.data.length)return{id:e,afterCursor:""};var p=[];o.data.forEach(function(a){if(!a.image_cdn_urls)return;p.push(d("WAWebBizProductCatalogBridge").mapProductResponseToModel(a,e))});f={type:"success",catalog:o};this.trigger("catalog-loaded",f);return{id:e,afterCursor:o.paging.cursors.after,_products:p,fetchedFromServer:!0,index:a+p.length}}catch(a){if(a instanceof d("WAWebBackendErrors").AdAccountRecoveryRequiredError&&this.shouldUseCatalogErrorEmailMask(e)){if(c("isStringNullOrEmpty")(a.emailMask)){d("WALogger").ERROR(j()).sendLogs("catalog email mask empty");return(h||(h=b("Promise"))).reject(new(d("WAWebBackendErrors").AdAccountRecoveryRequiredEmailMaskEmptyError)())}this.updateSelfCatalogErrorEmailMask(a.emailMask)}else if(a instanceof d("WAWebBackendErrors").CatalogIncorrectNonceError&&this.shouldUseCatalogErrorEmailMask(e)){g={type:"incorrect-nonce"};this.trigger("catalog-loaded",g);return(h||(h=b("Promise"))).reject(a)}else this.hasSelfCatalogErrorEmailMask()&&this.shouldUseCatalogErrorEmailMask(e)&&this.resetSelfCatalogErrorEmailMask();i={type:"error"};this.trigger("catalog-loaded",i);return(h||(h=b("Promise"))).reject(a)}});function a(b,c,d,e,f,g){return a.apply(this,arguments)}return a}();f._findImplCommon=function(a,b){var e=this.get(a),f=e&&!e.stale?e.afterCursor:void 0;a=a instanceof c("WAWebWid")?a:d("WAWebWidFactory").createWid(a.toString());return this._queryCatalog(e,a,f,void 0,void 0,b==null?void 0:b.markerId)};f.findCarouselCatalog=function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){b=this.convertCatalogIdForLidMigration(b);var c=this.get(b);c&&c.set({index:0});b=(yield this._queryCatalog(c,b,void 0,void 0,!1));c&&c.markProductCollectionOld();return a.prototype.add.call(this,b,{merge:!0})});function d(a){return c.apply(this,arguments)}return d}();f.findNextProductPage=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=this.convertCatalogIdForLidMigration(a);b===!0&&d("WAWebProductCatalogLogQplEvents").qplPointCatalogView("datasource_start");a=(yield this.update(a));b===!0&&d("WAWebProductCatalogLogQplEvents").qplPointCatalogView("datasource_end");b=Array.isArray(a)?a[0]:a;return b.productCollection.getProductModels()});function c(b,c){return a.apply(this,arguments)}return c}();f.findCollectionMembership=function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b,c){b=this.convertCatalogIdForLidMigration(b);var d=this.get(b),e=d&&!d.stale?d.afterCursor:void 0;e=(yield this._queryCatalog(d,b,e,c));a.prototype.add.call(this,e,{merge:!0});d=this.get(b);d&&(d.stale=!1)});function d(a,b){return c.apply(this,arguments)}return d}();f.removeCatalog=function(a){a=this.convertCatalogIdForLidMigration(a);var b=this.get(a);!b?d("WALogger").ERROR(i()):this.remove(a)};f.get=function(b){return a.prototype.get.call(this,this.convertCatalogIdForLidMigration(b))};f.assertGet=function(b){return a.prototype.assertGet.call(this,this.convertCatalogIdForLidMigration(b))};f.convertCatalogIdForLidMigration=function(a){a=a instanceof c("WAWebWid")?a:d("WAWebWidFactory").createWid(a.toString());if(!d("WAWebBizGatingUtils").isLidMigrationForCatalogEnabled())return a;if(a.isLid()){var b=d("WAWebLidMigrationUtils").toPn(a);if(b!=null)return b}return a};f.getSelfCatalogErrorEmailMask=function(){return this.selfCatalogErrorEmailMask};f.updateSelfCatalogErrorEmailMask=function(a){this.selfCatalogErrorEmailMask=a,this.trigger("change:selfCatalogErrorEmailMask")};f.resetSelfCatalogErrorEmailMask=function(){this.updateSelfCatalogErrorEmailMask(null)};f.hasSelfCatalogErrorEmailMask=function(){return this.selfCatalogErrorEmailMask!=null};f.shouldUseCatalogErrorEmailMask=function(a){if(a==null)return!1;if(!d("WAWebUserPrefsMeUser").isMeAccount(a))return!1;return!d("WAWebBizGatingUtils").catalogTokenRecoveryEnabled()?!1:!0};return e}(d("WAWebBaseCollection").BaseCollection);a.model=c("WAWebCatalogModel");a.staleCollection=!0;e=new a();g.CatalogCollection=e}),98); __d("WAWebCatalogModel",["WANullthrows","WAWebBaseModel","WAWebBizProductCatalogAction","WAWebBizProductCatalogBridge","WAWebCatalogCollection","WAWebProductCollCollection","WAWebProductCollection","WAWebProductModel","WAWebWid","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.afterCursor=d("WAWebBaseModel").prop(),c.index=d("WAWebBaseModel").prop(),c.hasCatalogCategories=d("WAWebBaseModel").prop(),c.fetchedFromServer=d("WAWebBaseModel").session(),c._products=d("WAWebBaseModel").session(),c._msgs=d("WAWebBaseModel").session(),c.lastUsedCountryCode=d("WAWebBaseModel").session(),b)||babelHelpers.assertThisInitialized(c)}var f=e.prototype;f.initialize=function(){a.prototype.initialize.call(this),this.productCollection=new(d("WAWebProductCollection").ProductCollection)(),this.msgProductCollection=new(d("WAWebProductCollection").ProductCollection)(),this.collections=new(d("WAWebProductCollCollection").ProductCollCollection)(),this.listenTo(this,"change:_products",this.triggerProductUpdate),this.listenTo(this,"change:_msgs",this.triggerMsgUpdate),this.triggerProductUpdate(),this.triggerMsgUpdate()};f.triggerProductUpdate=function(){this._products&&this.productCollection.add(this._products,{merge:!0}),this._products=void 0};f.triggerMsgUpdate=function(){this._msgs&&this.msgProductCollection.add(this._msgs,{merge:!0}),this._msgs=void 0};f.markProductCollectionOld=function(){this.productCollection.forEach(function(a){return a.markOld()})};f.addProduct=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b,e=this.id;this.maybeUpdateLastUsedCountryCode((b=a.complianceInfo)==null?void 0:b.countryCodeOrigin);b=(yield d("WAWebBizProductCatalogAction").addProduct(a));a=this.productCollection.at(0);b.catalogWid=e;b.index=a?a.index-1:0;e=this.productCollection.add(b,{merge:!0,at:0})[0];return c("WANullthrows")(e)});function e(b){return a.apply(this,arguments)}return e}();f.editProduct=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b,e=(yield d("WAWebBizProductCatalogAction").editProduct(a));this.maybeUpdateLastUsedCountryCode((b=a.complianceInfo)==null?void 0:b.countryCodeOrigin);b=this.productCollection.add(e,{merge:!0})[0];this.collections&&this.collections.forEach(function(b){b.productCollection.get(a.id)&&b.productCollection.add(e,{merge:!0})});return c("WANullthrows")(b)});function e(b){return a.apply(this,arguments)}return e}();f.refreshProduct=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=this.productCollection.get(a);b&&(b.stale=!0);var c=(yield d("WAWebBizProductCatalogAction").queryProduct(this.id,a));if(c.data!=null){var e=d("WAWebBizProductCatalogBridge").mapProductResponseToModel(c.data,this.id);b&&this.productCollection.add(e,{merge:!0});this.collections&&this.collections.forEach(function(b){b.productCollection.get(a)&&b.productCollection.add(e,{merge:!0})})}});function c(b){return a.apply(this,arguments)}return c}();f.maybeUpdateLastUsedCountryCode=function(a){if(a==null)return;this.lastUsedCountryCode=a};f.pullProduct=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=(yield d("WAWebBizProductCatalogAction").queryProduct(this.id,a,void 0,void 0,void 0,b));b.error==="NOT_FOUND"&&this.productCollection.remove(a);if(b.data!=null){a=new(d("WAWebProductModel").Product)(d("WAWebBizProductCatalogBridge").mapProductResponseToModel(b.data,this.id));this.updateProduct(a)}});function c(b,c){return a.apply(this,arguments)}return c}();f.updateProduct=function(a){this.productCollection.add(a,{merge:!1})};f.getCollection=function(){return d("WAWebCatalogCollection").CatalogCollection};f.getMostRecentlyApprovedProduct=function(){return this.productCollection.findFirst(function(a){return!a.isHidden&&a.isSanctioned!==!0&&a.reviewStatus==="APPROVED"})};return e}(d("WAWebBaseModel").BaseModel);a.Proxy="catalog";a.idClass=c("WAWebWid");e=d("WAWebBaseModel").defineModel(a);g["default"]=e}),98); __d("WAWebBizCatalogManagementFetchCollectionsQuery_facebookRelayOperation",[],(function(a,b,c,d,e,f){e.exports="8971275712973018"}),null); __d("WAWebBizCatalogManagementFetchCollectionsQuery.graphql",["WAWebBizCatalogManagementFetchCollectionsQuery_facebookRelayOperation"],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"request"}],c=[{kind:"Variable",name:"request",variableName:"request"}],d={alias:null,args:null,concreteType:"XFBWhatsAppCatalogPagingInfo",kind:"LinkedField",name:"paging",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"after",storageKey:null}],storageKey:null},e={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},f={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},g={alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},h={alias:null,args:null,kind:"ScalarField",name:"original_image_url",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"request_image_url",storageKey:null},j={alias:null,args:null,kind:"ScalarField",name:"price",storageKey:null},k={alias:null,args:null,kind:"ScalarField",name:"status",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"can_appeal",storageKey:null},m={alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null},n=[f,m];j=[{alias:null,args:null,kind:"ScalarField",name:"availability",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:"XFBWhatsAppCatalogProductComplianceInfo",kind:"LinkedField",name:"compliance_info",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"country_code_origin",storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductComplianceInfoImporterAddress",kind:"LinkedField",name:"importer_address",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"city",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"country_code",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"postal_code",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"region",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"street1",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"street2",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"importer_name",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"currency",storageKey:null},g,e,{alias:null,args:null,kind:"ScalarField",name:"is_hidden",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"is_sanctioned",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"max_available",storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductMedia",kind:"LinkedField",name:"media",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductMediaImage",kind:"LinkedField",name:"images",plural:!0,selections:[e,h,i],storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductMediaVideo",kind:"LinkedField",name:"videos",plural:!0,selections:[e,{alias:null,args:null,kind:"ScalarField",name:"original_video_url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"thumbnail_url",storageKey:null}],storageKey:null}],storageKey:null},f,j,{alias:null,args:null,kind:"ScalarField",name:"retailer_id",storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductSalePrice",kind:"LinkedField",name:"sale_price",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"end_date",storageKey:null},j,{alias:null,args:null,kind:"ScalarField",name:"start_date",storageKey:null}],storageKey:null},k,{alias:null,args:null,concreteType:"XFBWhatsAppCatalogStatusInfo",kind:"LinkedField",name:"status_info",plural:!1,selections:[l,k],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"shimmed_url",storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductVariantInfo",kind:"LinkedField",name:"variant_info",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantListingDetails",kind:"LinkedField",name:"listing_details",plural:!1,selections:[g,{alias:null,args:null,kind:"ScalarField",name:"multi_price",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"lowest_price",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantAvailability",kind:"LinkedField",name:"availability",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantAvailabilityListing",kind:"LinkedField",name:"listing",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"is_available",storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantAvailabilityListingOption",kind:"LinkedField",name:"options",plural:!0,selections:n,storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"product_id",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantTypes",kind:"LinkedField",name:"types",plural:!0,selections:[f,{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantTypeOption",kind:"LinkedField",name:"options",plural:!0,selections:[m,{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductMediaImage",kind:"LinkedField",name:"thumbnail_media",plural:!1,selections:[e,{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductMediaImageOriginalDimensions",kind:"LinkedField",name:"original_dimensions",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"height",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"width",storageKey:null}],storageKey:null},h,i],storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantProperties",kind:"LinkedField",name:"variant_properties",plural:!0,selections:n,storageKey:null}],storageKey:null}];g={alias:null,args:null,concreteType:"XFBWhatsAppCatalogStatusInfo",kind:"LinkedField",name:"status_info",plural:!1,selections:[l,{alias:null,args:null,kind:"ScalarField",name:"commerce_url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"reject_reason",storageKey:null},k],storageKey:null};return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"WAWebBizCatalogManagementFetchCollectionsQuery",selections:[{alias:null,args:c,concreteType:"XFBWhatsAppCatalogGetCollectionsResponse",kind:"LinkedField",name:"xfb_whatsapp_catalog_collections",plural:!1,selections:[d,{alias:null,args:null,concreteType:"XFBWhatsAppCatalogCollectionInfo",kind:"LinkedField",name:"collections",plural:!0,selections:[e,f,{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductInfo",kind:"LinkedField",name:"products",plural:!0,selections:[{kind:"InlineDataFragmentSpread",name:"WAWebBizCatalogManagementParseProductGraphql_product",selections:j,args:null,argumentDefinitions:[]}],storageKey:null},g],storageKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"WAWebBizCatalogManagementFetchCollectionsQuery",selections:[{alias:null,args:c,concreteType:"XFBWhatsAppCatalogGetCollectionsResponse",kind:"LinkedField",name:"xfb_whatsapp_catalog_collections",plural:!1,selections:[d,{alias:null,args:null,concreteType:"XFBWhatsAppCatalogCollectionInfo",kind:"LinkedField",name:"collections",plural:!0,selections:[e,f,{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductInfo",kind:"LinkedField",name:"products",plural:!0,selections:j,storageKey:null},g],storageKey:null}],storageKey:null}]},params:{id:b("WAWebBizCatalogManagementFetchCollectionsQuery_facebookRelayOperation"),metadata:{},name:"WAWebBizCatalogManagementFetchCollectionsQuery",operationKind:"query",text:null}}}();e.exports=a}),null); __d("WAWebBizCatalogManagementFetchCollections",["Promise","WALogger","WAWebBizCatalogManagementFetchCollectionsQuery.graphql","WAWebBizCatalogManagementParseProductGraphql","WAWebBizGatingUtils","WAWebFetchAdAccountToken","WAWebGraphQLServerError","WAWebNetworkStatus","WAWebProductTypes.flow","WAWebRelayClient"],(function(a,b,c,d,e,f,g){var h,i;function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["fetchCollectionsWithToken: failed with error"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(['fetchCollections: failed as "','"']);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["fetchCollections: success"]);l=function(){return a};return a}var m={type:"error"},n=h!==void 0?h:h=b("WAWebBizCatalogManagementFetchCollectionsQuery.graphql");function a(a){return!d("WAWebBizGatingUtils").graphQLForGetCollectionsEnabled()?(i||(i=b("Promise"))).resolve({type:"not-enabled"}):o(a).then(function(a){if(a.type==="success"){d("WALogger").LOG(l());return a}a.type;d("WALogger").LOG(k(),a.type);return a})}function o(a){return d("WAWebFetchAdAccountToken").fetchToken().then(function(b){if(b.type==="success")return p(b.token,a).then(function(a){a.type!=="success"?a.type==="auth-failure"?d("WAWebFetchAdAccountToken").markTokenAsInvalid():a.type:a.type;return a});b.type;return b})}function p(a,b){var e;return c("WAWebNetworkStatus").waitIfOffline().then(function(){return d("WAWebRelayClient").fetchQuery(n,{request:b},{environmentType:"facebook",accessToken:a,getInlineDataReader:function(a){e=a}})}).then(function(a){var b;if(a==null)return m;b=(b=a.xfb_whatsapp_catalog_collections)==null?void 0:b.collections;if(b==null)return m;a=(a=a.xfb_whatsapp_catalog_collections)==null?void 0:a.paging;a=(a=a==null?void 0:a.after)!=null?a:"";b=b.map(function(a){var b=a.id,c=a.name,f=a.status_info,g=f==null?void 0:f.status;g=(g=g!=null?d("WAWebProductTypes.flow").asProductReviewType(g):void 0)!=null?g:"APPROVED";a=a.products.map(function(a){return e(d("WAWebBizCatalogManagementParseProductGraphql").PARSE_PRODUCT_FRAGMENT,a)}).map(d("WAWebBizCatalogManagementParseProductGraphql").parseProductGraphQL);return{id:(b=b)!=null?b:"",name:(b=c)!=null?b:"",rejectReason:f==null?void 0:f.reject_reason,commerceUrl:f==null?void 0:f.commerce_url,canAppeal:(f==null?void 0:f.can_appeal)==="true",reviewStatus:g,totalItemsCount:0,products:a,isHidden:!1}});return{type:"success",collectionsResult:{collections:b,afterCursor:a}}})["catch"](function(a){d("WALogger").LOG(j()).devConsole(a);if(d("WAWebFetchAdAccountToken").hasGraphQLAuthError(a))return{type:"auth-failure"};return a instanceof d("WAWebGraphQLServerError").GraphQLServerError?{type:"graphql-error",error:a}:m})}g.fetchCollections=a}),98); __d("WAWebBizCatalogManagementAppealCollectionMutation_facebookRelayOperation",[],(function(a,b,c,d,e,f){e.exports="9971242039605207"}),null); __d("WAWebBizCatalogManagementAppealCollectionMutation.graphql",["WAWebBizCatalogManagementAppealCollectionMutation_facebookRelayOperation"],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"input"}],c=[{alias:null,args:[{kind:"Variable",name:"request",variableName:"input"}],concreteType:"XFBWhatsAppCatalogAppealCollectionResponse",kind:"LinkedField",name:"xfb_whatsapp_catalog_appeal_collection",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"success",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"WAWebBizCatalogManagementAppealCollectionMutation",selections:c,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"WAWebBizCatalogManagementAppealCollectionMutation",selections:c},params:{id:b("WAWebBizCatalogManagementAppealCollectionMutation_facebookRelayOperation"),metadata:{},name:"WAWebBizCatalogManagementAppealCollectionMutation",operationKind:"mutation",text:null}}}();e.exports=a}),null); __d("WAWebBizCatalogManagementAppealCollection",["Promise","WALogger","WAWebBizCatalogManagementAppealCollectionMutation.graphql","WAWebBizGatingUtils","WAWebFetchAdAccountToken","WAWebGraphQLServerError","WAWebNetworkStatus","WAWebRelayClient"],(function(a,b,c,d,e,f,g){var h,i;function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["appealCollectionWithToken: failed with error"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(['appealCollection: failed as "','"']);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["appealCollection: success"]);l=function(){return a};return a}var m={type:"error"},n=h!==void 0?h:h=b("WAWebBizCatalogManagementAppealCollectionMutation.graphql");function a(a){return!d("WAWebBizGatingUtils").graphQLForAppealCollectionEnabled()?(i||(i=b("Promise"))).resolve({type:"not-enabled"}):o(a).then(function(a){if(a.type==="success"){d("WALogger").LOG(l());return a}a.type;d("WALogger").LOG(k(),a.type);return a})}function o(a){return d("WAWebFetchAdAccountToken").fetchToken().then(function(b){if(b.type==="success")return p(b.token,a).then(function(a){a.type!=="success"?a.type==="auth-failure"?d("WAWebFetchAdAccountToken").markTokenAsInvalid():a.type:a.type;return a});b.type;return b})}function p(a,b){return c("WAWebNetworkStatus").waitIfOffline().then(function(){return d("WAWebRelayClient").commitMutation(n,{input:b},{environmentType:"facebook",accessToken:a})}).then(function(a){if(a==null)return m;a=a.xfb_whatsapp_catalog_appeal_collection;if(a==null)return m;a=a.success;return a==null?m:{type:"success",result:a}})["catch"](function(a){d("WALogger").LOG(j()).devConsole(a);if(d("WAWebFetchAdAccountToken").hasGraphQLAuthError(a))return{type:"auth-failure"};return a instanceof d("WAWebGraphQLServerError").GraphQLServerError?{type:"graphql-error",error:a}:m})}g.appealCollection=a}),98); __d("WAWebBizCatalogManagementCreateCollectionMutation_facebookRelayOperation",[],(function(a,b,c,d,e,f){e.exports="29361942130088470"}),null); __d("WAWebBizCatalogManagementCreateCollectionMutation.graphql",["WAWebBizCatalogManagementCreateCollectionMutation_facebookRelayOperation"],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"input"}],c=[{alias:null,args:[{kind:"Variable",name:"request",variableName:"input"}],concreteType:"XFBWhatsAppCatalogCreateCollectionResponse",kind:"LinkedField",name:"xfb_whatsapp_catalog_create_collection",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogCreateCollectionResponseFields",kind:"LinkedField",name:"collection",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,concreteType:"WhatsAppCatalogCreateCollectionStatusInfo",kind:"LinkedField",name:"status_info",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"status",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"WAWebBizCatalogManagementCreateCollectionMutation",selections:c,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"WAWebBizCatalogManagementCreateCollectionMutation",selections:c},params:{id:b("WAWebBizCatalogManagementCreateCollectionMutation_facebookRelayOperation"),metadata:{},name:"WAWebBizCatalogManagementCreateCollectionMutation",operationKind:"mutation",text:null}}}();e.exports=a}),null); __d("WAWebBizCatalogManagementCreateCollection",["Promise","WALogger","WAWebBizCatalogManagementCreateCollectionMutation.graphql","WAWebBizGatingUtils","WAWebFetchAdAccountToken","WAWebGraphQLServerError","WAWebNetworkStatus","WAWebProductTypes.flow","WAWebRelayClient"],(function(a,b,c,d,e,f,g){var h,i;function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["createCollectionWithToken: failed with error"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(['createCollection: failed as "','"']);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["createCollection: success"]);l=function(){return a};return a}var m={type:"error"},n=h!==void 0?h:h=b("WAWebBizCatalogManagementCreateCollectionMutation.graphql");function a(a){return!d("WAWebBizGatingUtils").graphQLForCreateCollectionEnabled()?(i||(i=b("Promise"))).resolve({type:"not-enabled"}):o(a).then(function(a){if(a.type==="success"){d("WALogger").LOG(l());return a}a.type;d("WALogger").LOG(k(),a.type);return a})}function o(a){return d("WAWebFetchAdAccountToken").fetchToken().then(function(b){if(b.type==="success")return p(b.token,a).then(function(a){a.type!=="success"?a.type==="auth-failure"?d("WAWebFetchAdAccountToken").markTokenAsInvalid():a.type:a.type;return a});b.type;return b})}function p(a,b){return c("WAWebNetworkStatus").waitIfOffline().then(function(){return d("WAWebRelayClient").commitMutation(n,{input:b},{environmentType:"facebook",accessToken:a})}).then(function(a){if(a==null)return m;a=a.xfb_whatsapp_catalog_create_collection;if(a==null)return m;a=a.collection;if(a==null)return m;var b=a.id;a=a.status_info;if(b==null||a==null)return m;a=a.status;a=d("WAWebProductTypes.flow").mapCollectionReviewStatusToWASchema(a);return a==null?m:{type:"success",collectionResult:{id:b,reviewStatus:a}}})["catch"](function(a){d("WALogger").LOG(j()).devConsole(a);if(d("WAWebFetchAdAccountToken").hasGraphQLAuthError(a))return{type:"auth-failure"};return a instanceof d("WAWebGraphQLServerError").GraphQLServerError?{type:"graphql-error",error:a}:m})}g.createCollection=a}),98); __d("WAWebBizCatalogManagementDeleteCollectionsMutation_facebookRelayOperation",[],(function(a,b,c,d,e,f){e.exports="29970196299234260"}),null); __d("WAWebBizCatalogManagementDeleteCollectionsMutation.graphql",["WAWebBizCatalogManagementDeleteCollectionsMutation_facebookRelayOperation"],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"input"}],c=[{alias:null,args:[{kind:"Variable",name:"request",variableName:"input"}],concreteType:"XFBWhatsAppCatalogDeleteCollectionsResponse",kind:"LinkedField",name:"xfb_whatsapp_catalog_delete_collections",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"success",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"WAWebBizCatalogManagementDeleteCollectionsMutation",selections:c,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"WAWebBizCatalogManagementDeleteCollectionsMutation",selections:c},params:{id:b("WAWebBizCatalogManagementDeleteCollectionsMutation_facebookRelayOperation"),metadata:{},name:"WAWebBizCatalogManagementDeleteCollectionsMutation",operationKind:"mutation",text:null}}}();e.exports=a}),null); __d("WAWebBizCatalogManagementDeleteCollections",["Promise","WALogger","WAWebBizCatalogManagementDeleteCollectionsMutation.graphql","WAWebBizGatingUtils","WAWebFetchAdAccountToken","WAWebGraphQLServerError","WAWebNetworkStatus","WAWebRelayClient"],(function(a,b,c,d,e,f,g){var h,i;function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["deleteCollectionsWithToken: failed with error"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(['deleteCollections: failed as "','"']);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["deleteCollections: success"]);l=function(){return a};return a}var m={type:"error"},n=h!==void 0?h:h=b("WAWebBizCatalogManagementDeleteCollectionsMutation.graphql");function a(a){return!d("WAWebBizGatingUtils").graphQLForDeleteCollectionEnabled()?(i||(i=b("Promise"))).resolve({type:"not-enabled"}):o(a).then(function(a){if(a.type==="success"){d("WALogger").LOG(l());return a}a.type;d("WALogger").LOG(k(),a.type);return a})}function o(a){return d("WAWebFetchAdAccountToken").fetchToken().then(function(b){if(b.type==="success")return p(b.token,a).then(function(a){a.type!=="success"?a.type==="auth-failure"?d("WAWebFetchAdAccountToken").markTokenAsInvalid():a.type:a.type;return a});b.type;return b})}function p(a,b){return c("WAWebNetworkStatus").waitIfOffline().then(function(){return d("WAWebRelayClient").commitMutation(n,{input:b},{environmentType:"facebook",accessToken:a})}).then(function(a){if(a==null)return m;a=a.xfb_whatsapp_catalog_delete_collections;return a==null?m:a.success===!0?{type:"success"}:m})["catch"](function(a){d("WALogger").LOG(j()).devConsole(a);if(d("WAWebFetchAdAccountToken").hasGraphQLAuthError(a))return{type:"auth-failure"};return a instanceof d("WAWebGraphQLServerError").GraphQLServerError?{type:"graphql-error",error:a}:m})}g.deleteCollections=a}),98); __d("WAWebBizCatalogManagementUpdateCollectionMutation_facebookRelayOperation",[],(function(a,b,c,d,e,f){e.exports="24486970300891371"}),null); __d("WAWebBizCatalogManagementUpdateCollectionMutation.graphql",["WAWebBizCatalogManagementUpdateCollectionMutation_facebookRelayOperation"],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"input"}],c=[{alias:null,args:[{kind:"Variable",name:"request",variableName:"input"}],concreteType:"XFBWhatsAppCatalogUpdateCollectionResponse",kind:"LinkedField",name:"xfb_whatsapp_catalog_update_collection",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogUpdateCollectionResponseAttributes",kind:"LinkedField",name:"collection",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogStatusInfo",kind:"LinkedField",name:"status_info",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"status",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"WAWebBizCatalogManagementUpdateCollectionMutation",selections:c,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"WAWebBizCatalogManagementUpdateCollectionMutation",selections:c},params:{id:b("WAWebBizCatalogManagementUpdateCollectionMutation_facebookRelayOperation"),metadata:{},name:"WAWebBizCatalogManagementUpdateCollectionMutation",operationKind:"mutation",text:null}}}();e.exports=a}),null); __d("WAWebBizCatalogManagementUpdateCollection",["Promise","WALogger","WAWebBizCatalogManagementUpdateCollectionMutation.graphql","WAWebBizGatingUtils","WAWebFetchAdAccountToken","WAWebGraphQLServerError","WAWebNetworkStatus","WAWebProductTypes.flow","WAWebRelayClient"],(function(a,b,c,d,e,f,g){var h,i;function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["updateCollectionWithToken: failed with error"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(['updateCollection: failed as "','"']);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["updateCollection: success"]);l=function(){return a};return a}var m={type:"error"},n=h!==void 0?h:h=b("WAWebBizCatalogManagementUpdateCollectionMutation.graphql");function a(a){return!d("WAWebBizGatingUtils").graphQLForUpdateCollectionEnabled()?(i||(i=b("Promise"))).resolve({type:"not-enabled"}):o(a).then(function(a){if(a.type==="success"){d("WALogger").LOG(l());return a}a.type;d("WALogger").LOG(k(),a.type);return a})}function o(a){return d("WAWebFetchAdAccountToken").fetchToken().then(function(b){if(b.type==="success")return p(b.token,a).then(function(a){a.type!=="success"?a.type==="auth-failure"?d("WAWebFetchAdAccountToken").markTokenAsInvalid():a.type:a.type;return a});b.type;return b})}function p(a,b){return c("WAWebNetworkStatus").waitIfOffline().then(function(){return d("WAWebRelayClient").commitMutation(n,{input:b},{environmentType:"facebook",accessToken:a})}).then(function(a){if(a==null)return m;a=a.xfb_whatsapp_catalog_update_collection;if(a==null)return m;a=a.collection;if(a==null)return m;var b=a.id;a=a.status_info;if(b==null||a==null)return m;a=a.status;if(a==null)return m;a=d("WAWebProductTypes.flow").asProductReviewType(a);return a==null?m:{type:"success",collectionResult:{id:b,reviewStatus:a}}})["catch"](function(a){d("WALogger").LOG(j()).devConsole(a);if(d("WAWebFetchAdAccountToken").hasGraphQLAuthError(a))return{type:"auth-failure"};return a instanceof d("WAWebGraphQLServerError").GraphQLServerError?{type:"graphql-error",error:a}:m})}g.updateCollection=a}),98); __d("WAWebBizCatalogManagementUpdateCollectionListMutation_facebookRelayOperation",[],(function(a,b,c,d,e,f){e.exports="9930298893688430"}),null); __d("WAWebBizCatalogManagementUpdateCollectionListMutation.graphql",["WAWebBizCatalogManagementUpdateCollectionListMutation_facebookRelayOperation"],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"input"}],c=[{alias:null,args:[{kind:"Variable",name:"request",variableName:"input"}],concreteType:"XFBWhatsAppCatalogUpdateCollectionListResponse",kind:"LinkedField",name:"xfb_whatsapp_catalog_update_collection_list",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"success",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"WAWebBizCatalogManagementUpdateCollectionListMutation",selections:c,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"WAWebBizCatalogManagementUpdateCollectionListMutation",selections:c},params:{id:b("WAWebBizCatalogManagementUpdateCollectionListMutation_facebookRelayOperation"),metadata:{},name:"WAWebBizCatalogManagementUpdateCollectionListMutation",operationKind:"mutation",text:null}}}();e.exports=a}),null); __d("WAWebBizCatalogManagementUpdateCollectionList",["Promise","WALogger","WAWebBizCatalogManagementUpdateCollectionListMutation.graphql","WAWebBizGatingUtils","WAWebFetchAdAccountToken","WAWebGraphQLServerError","WAWebNetworkStatus","WAWebRelayClient"],(function(a,b,c,d,e,f,g){var h,i;function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["updateCollectionListWithToken: failed with error"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(['updateCollectionList: failed as "','"']);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["updateCollectionList: success"]);l=function(){return a};return a}var m={type:"error"},n=h!==void 0?h:h=b("WAWebBizCatalogManagementUpdateCollectionListMutation.graphql");function a(a){return!d("WAWebBizGatingUtils").graphQLForUpdateCollectionListEnabled()?(i||(i=b("Promise"))).resolve({type:"not-enabled"}):o(a).then(function(a){if(a.type==="success"){d("WALogger").LOG(l());return a}a.type;d("WALogger").LOG(k(),a.type);return a})}function o(a){return d("WAWebFetchAdAccountToken").fetchToken().then(function(b){if(b.type==="success")return p(b.token,a).then(function(a){a.type!=="success"?a.type==="auth-failure"?d("WAWebFetchAdAccountToken").markTokenAsInvalid():a.type:a.type;return a});b.type;return b})}function p(a,b){return c("WAWebNetworkStatus").waitIfOffline().then(function(){return d("WAWebRelayClient").commitMutation(n,{input:b},{environmentType:"facebook",accessToken:a})}).then(function(a){if(a==null)return m;a=a.xfb_whatsapp_catalog_update_collection_list;return(a==null?void 0:a.success)==null?m:{type:"success",result:a.success}})["catch"](function(a){d("WALogger").LOG(j()).devConsole(a);if(d("WAWebFetchAdAccountToken").hasGraphQLAuthError(a))return{type:"auth-failure"};return a instanceof d("WAWebGraphQLServerError").GraphQLServerError?{type:"graphql-error",error:a}:m})}g.updateCollectionList=a}),98); __d("WAWebProductCollectionsJob",["$InternalEnum","WADeprecatedSendIq","WADeprecatedWapParser","WALogger","WAWap","WAWapDeprecatedSmaxID","WAWebApiContact","WAWebBackendErrors","WAWebBizCatalogManagementAppealCollection","WAWebBizCatalogManagementCreateCollection","WAWebBizCatalogManagementDeleteCollections","WAWebBizCatalogManagementUpdateCollection","WAWebBizCatalogManagementUpdateCollectionList","WAWebBizCatalogParseProduct","WAWebBizGatingUtils","WAWebCatalogWapUtils","WAWebCommsWapMd","WAWebHttpErrors","WAWebMaybeThrowCatalogErrors","WAWebNetworkStatus","WAWebProductTypes.flow","WAWebUserPrefsMeUser","WAWebWidFactory","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["reorderCollectionGraphQL: error handling flow not implemented for ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["appealCollectionGraphQL: error handling flow not implemented for ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["updateCollectionGraphQL: error handling flow not implemented for ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["deleteCollectionGraphQL: error handling flow not implemented for ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["createCollectionGraphQL: error handling flow not implemented for ",""]);m=function(){return a};return a}var n=function(a){var b,c,e;b=(b=d("WAWebProductTypes.flow").asProductReviewType(a.child("status").contentString()))!=null?b:"APPROVED";c=((c=a.maybeChild("can_appeal"))==null?void 0:c.contentString().toLowerCase())==="true";e=(e=a.maybeChild("reject_reason"))==null?void 0:e.contentString();a=(a=a.maybeChild("commerce_url"))==null?void 0:a.contentString();return{status:b,canAppeal:c,rejectReason:e,commerceUrl:a}},o=function(a){var b,c,e=a.maybeChild("status_info");e=e?n(e):void 0;b=(b=e==null?void 0:e.status)!=null?b:"APPROVED";var f=e?e.canAppeal:!1,g={id:a.child("id").contentString(),name:a.child("name").contentString(),isHidden:((c=a.maybeChild("is_hidden"))==null?void 0:c.contentString())==="TRUE",rejectReason:e==null?void 0:e.rejectReason,commerceUrl:e==null?void 0:e.commerceUrl,totalItemsCount:0,products:[],reviewStatus:b,canAppeal:f};a.forEachChildWithTag("product",function(a){g.products.push(d("WAWebBizCatalogParseProduct").parseProductNode(a))});return g},p=new(h=c("WADeprecatedWapParser"))("collectionsResponse",function(a){a.assertTag("iq");a.assertFromServer();a=a.child("collections");var b=[];a.forEachChildWithTag("collection",function(a){b.push(o(a))});a=a.child("paging");a=a.child("after");a=a.hasContent()?a.contentString():"";return{collections:b,afterCursor:a}}),q=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.catalogWid,e=a.afterCursor,f=a.limit,g=a.productsCount,h=a.width,i=a.height;a=a.directConnectionEncryptedInfo;a=a===void 0?null:a;if(d("WAWebBizGatingUtils").commerceFeaturesDisabledBySanctions())throw new(d("WAWebBackendErrors").E451)();e=d("WAWebCatalogWapUtils").createAfterNode(e);b=d("WAWap").wap("iq",{to:d("WAWap").S_WHATSAPP_NET,type:"get",xmlns:"w:biz:catalog",id:d("WAWap").generateId(),smax_id:d("WAWap").SMAX_ID(c("WAWapDeprecatedSmaxID").CatalogGetCollections)},d("WAWap").wap("collections",{biz_jid:d("WAWebCommsWapMd").DEVICE_JID(b)},d("WAWap").wap("collection_limit",null,f.toString()),d("WAWap").wap("item_limit",null,g.toString()),d("WAWap").wap("width",null,h.toString()),d("WAWap").wap("height",null,i.toString()),e,a!=null?d("WAWap").wap("direct_connection_encrypted_info",null,a):null));f=(yield d("WADeprecatedSendIq").deprecatedSendIq(b,p));if(!f.success){if(f.errorCode===404)return{collections:[],afterCursor:""};else if(f.errorCode===451)throw new(d("WAWebBackendErrors").E451)();throw new(d("WAWebBackendErrors").ServerStatusCodeError)(f.errorCode)}else return f.result});return function(b){return a.apply(this,arguments)}}(),r=new h("singleCollectionResponse",function(a){a.assertTag("iq");a.assertFromServer();a=a.child("collection");var b=o(a);a=a.child("paging");a=a.child("after");a=a.hasContent()?a.contentString():"";return{collections:[b],afterCursor:a}}),s=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.catalogWid,e=a.collectionId,f=a.afterCursor,g=a.limit,h=a.width,i=a.height;a=a.directConnectionEncryptedInfo;a=a===void 0?null:a;if(d("WAWebBizGatingUtils").commerceFeaturesDisabledBySanctions())throw new(d("WAWebBackendErrors").E451)();f=d("WAWebCatalogWapUtils").createAfterNode(f);b=d("WAWap").wap("iq",{to:d("WAWap").S_WHATSAPP_NET,type:"get",xmlns:"w:biz:catalog",id:d("WAWap").generateId(),smax_id:d("WAWap").SMAX_ID(c("WAWapDeprecatedSmaxID").CatalogGetSingleCollection)},d("WAWap").wap("collection",{biz_jid:d("WAWebCommsWapMd").DEVICE_JID(b),id:d("WAWap").CUSTOM_STRING(e)},d("WAWap").wap("limit",null,g.toString()),d("WAWap").wap("width",null,h.toString()),d("WAWap").wap("height",null,i.toString()),f,a!=null?d("WAWap").wap("direct_connection_encrypted_info",null,a):null));e=(yield d("WADeprecatedSendIq").deprecatedSendIq(b,r));if(!e.success){if(e.errorCode===451)throw new(d("WAWebBackendErrors").E451)();throw new(d("WAWebBackendErrors").ServerStatusCodeError)(e.errorCode)}else return e.result});return function(b){return a.apply(this,arguments)}}(),t=new h("createOrEditCollectionResponse",function(a){a.assertTag("iq");a.assertFromServer();a=a.child("collection");var b=a.child("id").contentString();a=a.maybeChild("status_info");a=a?n(a).status:"APPROVED";return{id:b,reviewStatus:a}}),u=new h("createOrEditCollectionResponseErrorParser",function(a){var b=a.attrString("code"),c=a.attrString("text");a=a.maybeChild("field");var d=a==null?void 0:a.attrString("name");a=a==null?void 0:a.attrString("reason");return{code:b,text:c,fieldName:d,fieldReason:a}});function v(a,b,c){return w.apply(this,arguments)}function w(){w=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e){var f,g=[];g.push((f=d("WAWap")).wap("name",null,a));g.push.apply(g,b.map(function(a){return d("WAWap").wap("product",null,d("WAWap").wap("id",null,a))}));g.push(f.wap("catalog_session_id",null,e));a=f.wap("iq",{to:f.S_WHATSAPP_NET,type:"set",xmlns:"w:biz:catalog",id:f.generateId(),smax_id:f.SMAX_ID(c("WAWapDeprecatedSmaxID").CatalogCreateCollection)},f.wap("collection",{op:"create"},g));b=(yield d("WADeprecatedSendIq").deprecatedSendIqErrorParser(a,t,u));if(!b.success){if(b.errorCode===451)throw new(d("WAWebBackendErrors").E451)();throw b.customError}else return b.result});return w.apply(this,arguments)}function x(a,b,c){return y.apply(this,arguments)}function y(){y=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e){var f,g=d("WAWebUserPrefsMeUser").getMaybeMeUser();if(g==null)throw c("err")("createCollectionGraphQL: meUser is null");f=g.isLid()?(f=d("WAWebApiContact").getPhoneNumber(d("WAWebWidFactory").toUserWid(g)))==null?void 0:f.user:g.user;if(f==null)throw c("err")("createCollectionGraphQL: phoneNumber is null");g=(yield d("WAWebBizCatalogManagementCreateCollection").createCollection({collection:{name:a,product_ids:b,biz_jid:f,catalog_session_id:e}}));if(g.type==="success")return g.collectionResult;else g.type==="graphql-error"?d("WAWebMaybeThrowCatalogErrors").maybeThrowLocalErrorForCatalogQuery(g.error):g.type;d("WALogger").WARN(m(),JSON.stringify(g));return v(a,b,e)});return y.apply(this,arguments)}function a(a,b,c){return z.apply(this,arguments)}function z(){z=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){if(d("WAWebBizGatingUtils").commerceFeaturesDisabledBySanctions())throw new(d("WAWebBackendErrors").E451)();return d("WAWebBizGatingUtils").graphQLForCreateCollectionEnabled()?x(a,b,c):v(a,b,c)});return z.apply(this,arguments)}var A=new h("deleteCollectionResponse",function(a){a.assertTag("iq");a=a.maybeChild("response");return(a==null?void 0:a.maybeChild("success"))!=null});function B(a,b){return C.apply(this,arguments)}function C(){C=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e;a=(e=d("WAWap")).wap("iq",{to:e.S_WHATSAPP_NET,type:"set",xmlns:"w:biz:catalog",id:e.generateId(),smax_id:e.SMAX_ID(c("WAWapDeprecatedSmaxID").CatalogDeleteCollections)},e.wap("collections",{op:"delete"},e.wap("id",null,a),e.wap("catalog_session_id",null,b)));e=(yield d("WADeprecatedSendIq").deprecatedSendIq(a,A));if(!e.success){if(e.errorCode===451)throw new(d("WAWebBackendErrors").E451)();throw new(d("WAWebBackendErrors").ServerStatusCodeError)(e.errorCode)}if(!e.result)throw new(d("WAWebBackendErrors").ServerStatusCodeError)(500)});return C.apply(this,arguments)}function D(a,b){return E.apply(this,arguments)}function E(){E=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e,f=d("WAWebUserPrefsMeUser").getMaybeMeUser();if(f==null)throw c("err")("deleteCollectionGraphQL: meUser is null");e=f.isLid()?(e=d("WAWebApiContact").getPhoneNumber(d("WAWebWidFactory").toUserWid(f)))==null?void 0:e.user:f.user;if(e==null)throw c("err")("deleteCollectionGraphQL: phoneNumber is null");f=(yield d("WAWebBizCatalogManagementDeleteCollections").deleteCollections({collections:{collection_ids:[a],biz_jid:e,catalog_session_id:b}}));if(f.type==="success")return;else f.type==="graphql-error"?d("WAWebMaybeThrowCatalogErrors").maybeThrowLocalErrorForCatalogQuery(f.error):f.type;d("WALogger").WARN(l(),JSON.stringify(f));return B(a,b)});return E.apply(this,arguments)}function e(a,b){return F.apply(this,arguments)}function F(){F=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if(d("WAWebBizGatingUtils").commerceFeaturesDisabledBySanctions())throw new(d("WAWebBackendErrors").E451)();return d("WAWebBizGatingUtils").graphQLForDeleteCollectionEnabled()?D(a,b):B(a,b)});return F.apply(this,arguments)}function G(a,b,c,d,e){return H.apply(this,arguments)}function H(){H=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e,f,g){var h;h=(h=d("WAWap")).wap("iq",{to:h.S_WHATSAPP_NET,type:"set",xmlns:"w:biz:catalog",id:h.generateId(),smax_id:h.SMAX_ID(c("WAWapDeprecatedSmaxID").CatalogUpdateCollection)},h.wap("collection",{op:"update"},h.wap("id",null,a),b!=null?d("WAWap").wap("name",null,b):void 0,e.length>0?d("WAWap").wap("add",null,e.map(function(a){return d("WAWap").wap("id",null,a)})):void 0,f.length>0?d("WAWap").wap("remove",null,f.map(function(a){return d("WAWap").wap("id",null,a)})):void 0,d("WAWap").wap("catalog_session_id",null,g)));a=(yield d("WADeprecatedSendIq").deprecatedSendIqErrorParser(h,t,u));if(!a.success){if(a.errorCode===451)throw new(d("WAWebBackendErrors").E451)();throw a.customError}else return a.result});return H.apply(this,arguments)}function I(a,b,c,d,e){return J.apply(this,arguments)}function J(){J=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e,f,g){var h,i=d("WAWebUserPrefsMeUser").getMaybeMeUser();if(i==null)throw c("err")("createCollectionGraphQL: meUser is null");h=i.isLid()?(h=d("WAWebApiContact").getPhoneNumber(d("WAWebWidFactory").toUserWid(i)))==null?void 0:h.user:i.user;if(h==null)throw c("err")("updateCollectionGraphQL: phoneNumber is null");i={collection:{id:a,biz_jid:h,catalog_session_id:g}};b!=null&&(i.collection.name=b);e.length>0&&(i.collection.add={ids:e});f.length>0&&(i.collection.remove={ids:f});h=(yield d("WAWebBizCatalogManagementUpdateCollection").updateCollection(i));if(h.type==="success")return h.collectionResult;else h.type==="graphql-error"?d("WAWebMaybeThrowCatalogErrors").maybeThrowLocalErrorForCatalogQuery(h.error):h.type;d("WALogger").WARN(k(),JSON.stringify(h));return G(a,b,e,f,g)});return J.apply(this,arguments)}function f(a,b,c,d,e){return K.apply(this,arguments)}function K(){K=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e,f){if(d("WAWebBizGatingUtils").commerceFeaturesDisabledBySanctions())throw new(d("WAWebBackendErrors").E451)();return d("WAWebBizGatingUtils").graphQLForUpdateCollectionEnabled()?I(a,b,c,e,f):G(a,b,c,e,f)});return K.apply(this,arguments)}var L=new h("appealCollectionResponse",function(a){a.assertTag("iq");a.assertFromServer();a=a.maybeChild("response");return(a==null?void 0:a.maybeChild("success"))!=null});function M(a,b){return N.apply(this,arguments)}function N(){N=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=b!=null?d("WAWap").wap("reason",null,b):void 0;a=d("WAWap").wap("iq",{id:d("WAWap").generateId(),to:d("WAWap").S_WHATSAPP_NET,xmlns:"w:biz:catalog",type:"set",smax_id:d("WAWap").SMAX_ID(c("WAWapDeprecatedSmaxID").CatalogAppealCollection)},d("WAWap").wap("collection",{op:"appeal",id:d("WAWap").CUSTOM_STRING(a)},b));b=(yield d("WADeprecatedSendIq").deprecatedSendIq(a,L));if(!b.success){if(b.errorCode===451)throw new(d("WAWebBackendErrors").E451)();throw new(d("WAWebBackendErrors").ServerStatusCodeError)(b.errorCode)}else return b.result});return N.apply(this,arguments)}function O(a,b){return P.apply(this,arguments)}function P(){P=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e=d("WAWebUserPrefsMeUser").getMaybeMeUser();if(e==null)throw c("err")("appealCollectionGraphQL: meUser is null");e=(yield d("WAWebBizCatalogManagementAppealCollection").appealCollection({product_set_id:a,jid:e.toJid(),reason:b}));if(e.type==="success")return e.result;else e.type==="graphql-error"?d("WAWebMaybeThrowCatalogErrors").maybeThrowLocalErrorForCatalogQuery(e.error):e.type;d("WALogger").WARN(j(),JSON.stringify(e));return M(a,b)});return P.apply(this,arguments)}function Q(a,b){return R.apply(this,arguments)}function R(){R=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if(d("WAWebBizGatingUtils").commerceFeaturesDisabledBySanctions())throw new(d("WAWebBackendErrors").E451)();return d("WAWebBizGatingUtils").graphQLForAppealCollectionEnabled()?O(a,b):M(a,b)});return R.apply(this,arguments)}var S=new h("reorderCollectionResponse",function(a){a.assertTag("iq");a=a.maybeChild("response");return(a==null?void 0:a.maybeChild("success"))!=null}),T=b("$InternalEnum")({ProductOutOfOrder:457,IndexOutOfBound:458});function U(a){return V.apply(this,arguments)}function V(){V=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b;b=(b=d("WAWap")).wap("iq",{id:b.generateId(),to:b.S_WHATSAPP_NET,xmlns:"w:biz:catalog",type:"set",smax_id:b.SMAX_ID(c("WAWapDeprecatedSmaxID").UpdateCollectionList)},b.wap("collections",{op:"update"},b.wap("move",null,a.map(function(a){var b=a[0],c=a[1];a=a[2];return d("WAWap").wap("id",{from_index:d("WAWap").CUSTOM_STRING(c.toString()),to_index:d("WAWap").CUSTOM_STRING(a.toString())},b)}))));a=(yield d("WADeprecatedSendIq").deprecatedSendIq(b,S));if(!a.success){if(a.errorCode===451)throw new(d("WAWebBackendErrors").E451)();if([T.IndexOutOfBound,T.ProductOutOfOrder].includes(a.errorCode))throw new(d("WAWebBackendErrors").CollectionReorderError)();throw new(d("WAWebBackendErrors").ServerStatusCodeError)(a.errorCode)}else return a.result});return V.apply(this,arguments)}function W(a){return X.apply(this,arguments)}function X(){X=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=d("WAWebUserPrefsMeUser").getMaybeMeUser();if(b==null)throw c("err")("reorderCollectionGraphQL: meUser is null");b=(yield d("WAWebBizCatalogManagementUpdateCollectionList").updateCollectionList({biz_jid:b.toJid(),move:a.map(function(a){var b=a[0],c=a[1];a=a[2];return{collection_id:b,from_index:c,to_index:a}})}));if(b.type==="success")return b.result;else b.type==="graphql-error"?d("WAWebMaybeThrowCatalogErrors").maybeThrowLocalErrorForCatalogQuery(b.error):b.type;d("WALogger").WARN(i(),JSON.stringify(b));return U(a)});return X.apply(this,arguments)}function Y(a){return Z.apply(this,arguments)}function Z(){Z=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(!c("WAWebNetworkStatus").online)throw new(d("WAWebHttpErrors").HttpNetworkError)();if(d("WAWebBizGatingUtils").commerceFeaturesDisabledBySanctions())throw new(d("WAWebBackendErrors").E451)();return d("WAWebBizGatingUtils").graphQLForUpdateCollectionListEnabled()?W(a):U(a)});return Z.apply(this,arguments)}g.queryCollectionsIQ=q;g.querySingleCollectionIQ=s;g.createCollection=a;g.deleteCollection=e;g.editCollection=f;g.appealCollection=Q;g.reorderCollection=Y}),98); __d("WAWebQueryProductCollectionsQuery.graphql",[],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"request"}],b={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},c={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},d={alias:null,args:null,kind:"ScalarField",name:"status",storageKey:null},e={alias:null,args:null,kind:"ScalarField",name:"can_appeal",storageKey:null},f={alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},g={alias:null,args:null,kind:"ScalarField",name:"price",storageKey:null},h={alias:null,args:null,kind:"ScalarField",name:"original_image_url",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"request_image_url",storageKey:null},j={alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null},k=[c,j];e=[{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:[b,c,{alias:null,args:null,concreteType:"XWAProductCatalogCollectionStatusInfo",kind:"LinkedField",name:"status_info",plural:!1,selections:[d,e,{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:[b,{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:"is_sanctioned",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"product_availability",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"max_available",storageKey:null},c,f,{alias:null,args:null,kind:"ScalarField",name:"url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"shimmed_url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"currency",storageKey:null},g,{alias:null,args:null,concreteType:"XWAProductCatalogProductStatusInfo",kind:"LinkedField",name:"status_info",plural:!1,selections:[e,d],storageKey:null},{alias:null,args:null,concreteType:"XWAProductCatalogProductSalePrice",kind:"LinkedField",name:"sale_price",plural:!1,selections:[g,{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:[b,h,i],storageKey:null},{alias:null,args:null,concreteType:"XWAProductCatalogProductMediaVideo",kind:"LinkedField",name:"videos",plural:!0,selections:[b,{alias:null,args:null,kind:"ScalarField",name:"original_video_url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"thumbnail_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},{alias:null,args:null,concreteType:"XWACatalogProductVariantInfo",kind:"LinkedField",name:"variant_info",plural:!1,selections:[{alias:null,args:null,concreteType:"XWACatalogVariantListingDetails",kind:"LinkedField",name:"listing_details",plural:!1,selections:[f,{alias:null,args:null,kind:"ScalarField",name:"multi_price",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"lowest_price",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XWACatalogVariantAvailability",kind:"LinkedField",name:"availability",plural:!1,selections:[{alias:null,args:null,concreteType:"XWAVariantAvailabilityListing",kind:"LinkedField",name:"listing",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"is_available",storageKey:null},{alias:null,args:null,concreteType:"XWAVariantAvailabilityListingOption",kind:"LinkedField",name:"options",plural:!0,selections:k,storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"product_id",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XWACatalogVariantTypes",kind:"LinkedField",name:"types",plural:!0,selections:[c,{alias:null,args:null,concreteType:"XWACatalogVariantTypeOption",kind:"LinkedField",name:"options",plural:!0,selections:[j,{alias:null,args:null,concreteType:"XWAProductCatalogProductMediaImage",kind:"LinkedField",name:"thumbnail_media",plural:!1,selections:[b,{alias:null,args:null,concreteType:"XWAProductCatalogProductMediaImageOriginalDimensions",kind:"LinkedField",name:"original_dimensions",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"height",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"width",storageKey:null}],storageKey:null},h,i],storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XWACatalogVariantProperties",kind:"LinkedField",name:"variant_properties",plural:!0,selections:k,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}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"WAWebQueryProductCollectionsQuery",selections:e,type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"WAWebQueryProductCollectionsQuery",selections:e},params:{id:"9489857194468782",metadata:{},name:"WAWebQueryProductCollectionsQuery",operationKind:"query",text:null}}}();e.exports=a}),null); __d("WAWebQueryProductCollections",["errorCode","WALogger","WAWebBackendErrors","WAWebBizCatalogManagementFetchCollections","WAWebBizGatingUtils","WAWebBizParseProductGraphql","WAWebCatalogEventLogger","WAWebGraphQLServerError","WAWebMaybeThrowCatalogErrors","WAWebProductCollectionsJob","WAWebProductTypes.flow","WAWebQueryProductCollectionsQuery.graphql","WAWebRelayClient","WAWebUserPrefsMeUser","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g,h){var i;function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["queryCollectionsGraphQLByOwner: error handling flow not implemented for ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["GraphQL: Failed fetching xwa_product_catalog_get_collections query."]);k=function(){return a};return a}var l=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(d("WAWebBizGatingUtils").commerceFeaturesDisabledBySanctions())throw new(d("WAWebBackendErrors").E451)();try{var c=a.catalogWid,e=a.afterCursor,f=a.limit,g=a.productsCount,h=a.width,j=a.height;a=a.directConnectionEncryptedInfo;c=(yield d("WAWebRelayClient").fetchQuery(i!==void 0?i:i=b("WAWebQueryProductCollectionsQuery.graphql"),{request:{collections:{biz_jid:c.toString(),collection_limit:String(f),item_limit:String(g),after:e,width:String(h),height:String(j),direct_connection_encrypted_info:a}}},{eventLogger:d("WAWebCatalogEventLogger").createCatalogEventLogger(d("WAWebCatalogEventLogger").GRAPHQL_CATALOG_ENDPOINT.GET_COLLECTIONS)}));if((c==null?void 0:c.xwa_product_catalog_get_collections)==null)return{afterCursor:"",collections:[]};f=c.xwa_product_catalog_get_collections;g=f.collections;e=f.paging;return{afterCursor:(e==null?void 0:e.after)||"",collections:g.map(function(a){var b=a.id,c=a.name,e=a.status_info;a=a.products;var f=e==null?void 0:e.status;f=(f=f!=null?d("WAWebProductTypes.flow").asProductReviewType(f):void 0)!=null?f:"APPROVED";return{id:b||"",name:c||"",canAppeal:(e==null?void 0:e.can_appeal)==="true",isHidden:!1,reviewStatus:f,totalItemsCount:0,products:a.map(d("WAWebBizParseProductGraphql").parseProductGraphQL),rejectReason:e==null?void 0:e.reject_reason,commerceUrl:e==null?void 0:e.commerce_url}})}}catch(b){if(b instanceof d("WAWebGraphQLServerError").GraphQLServerError){j=((h=b.source)==null?void 0:h.errors)||[];a=j[0];if((a==null?void 0:a.code)===2498052)return{collections:[],afterCursor:""};d("WAWebMaybeThrowCatalogErrors").maybeThrowLocalErrorForCatalogQuery(b)}d("WALogger").WARN(k());throw new(d("WAWebBackendErrors").CatalogUnknownError)()}});return function(b){return a.apply(this,arguments)}}(),m=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(d("WAWebBizGatingUtils").commerceFeaturesDisabledBySanctions())throw new(d("WAWebBackendErrors").E451)();var b=a.catalogWid,c=a.afterCursor,e=a.limit,f=a.productsCount,g=a.width,h=a.height;a=a.directConnectionEncryptedInfo;b=(yield d("WAWebBizCatalogManagementFetchCollections").fetchCollections({collections:{biz_jid:b.toJid(),after:c,collection_limit:String(e),item_limit:String(f),width:String(g),height:String(h),direct_connection_encrypted_info:a}}));if(b.type==="success")return b.collectionsResult;else if(b.type==="graphql-error"){if(((c=b.error.source.errors[0])==null?void 0:c.code)===2498052)return{collections:[],afterCursor:""};d("WAWebMaybeThrowCatalogErrors").maybeThrowLocalErrorForCatalogQuery(b.error)}else b.type;d("WALogger").WARN(j(),JSON.stringify(b));throw new(d("WAWebBackendErrors").CatalogUnknownError)()});return function(b){return a.apply(this,arguments)}}();a=function(a){var b=d("WAWebUserPrefsMeUser").getMaybeMeUser();return b!=null&&b.equals(a.catalogWid)?d("WAWebBizGatingUtils").graphQLForGetCollectionsEnabled()?m(a):d("WAWebProductCollectionsJob").queryCollectionsIQ(a):d("WAWebBizGatingUtils").graphQLForCollectionM2Enabled()?l(a):d("WAWebProductCollectionsJob").queryCollectionsIQ(a)};c=a;g["default"]=c}),98); __d("WAWebBizCatalogManagementFetchSingleCollectionQuery_facebookRelayOperation",[],(function(a,b,c,d,e,f){e.exports="9547298772047931"}),null); __d("WAWebBizCatalogManagementFetchSingleCollectionQuery.graphql",["WAWebBizCatalogManagementFetchSingleCollectionQuery_facebookRelayOperation"],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"request"}],c=[{kind:"Variable",name:"request",variableName:"request"}],d={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},e={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},f={alias:null,args:null,kind:"ScalarField",name:"can_appeal",storageKey:null},g={alias:null,args:null,kind:"ScalarField",name:"status",storageKey:null},h={alias:null,args:null,concreteType:"XFBWhatsAppCatalogStatusInfo",kind:"LinkedField",name:"status_info",plural:!1,selections:[f,{alias:null,args:null,kind:"ScalarField",name:"commerce_url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"reject_reason",storageKey:null},g],storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},j={alias:null,args:null,kind:"ScalarField",name:"original_image_url",storageKey:null},k={alias:null,args:null,kind:"ScalarField",name:"request_image_url",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"price",storageKey:null},m={alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null},n=[e,m];l=[{alias:null,args:null,kind:"ScalarField",name:"availability",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:"XFBWhatsAppCatalogProductComplianceInfo",kind:"LinkedField",name:"compliance_info",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"country_code_origin",storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductComplianceInfoImporterAddress",kind:"LinkedField",name:"importer_address",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"city",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"country_code",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"postal_code",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"region",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"street1",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"street2",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"importer_name",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"currency",storageKey:null},i,d,{alias:null,args:null,kind:"ScalarField",name:"is_hidden",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"is_sanctioned",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"max_available",storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductMedia",kind:"LinkedField",name:"media",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductMediaImage",kind:"LinkedField",name:"images",plural:!0,selections:[d,j,k],storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductMediaVideo",kind:"LinkedField",name:"videos",plural:!0,selections:[d,{alias:null,args:null,kind:"ScalarField",name:"original_video_url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"thumbnail_url",storageKey:null}],storageKey:null}],storageKey:null},e,l,{alias:null,args:null,kind:"ScalarField",name:"retailer_id",storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductSalePrice",kind:"LinkedField",name:"sale_price",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"end_date",storageKey:null},l,{alias:null,args:null,kind:"ScalarField",name:"start_date",storageKey:null}],storageKey:null},g,{alias:null,args:null,concreteType:"XFBWhatsAppCatalogStatusInfo",kind:"LinkedField",name:"status_info",plural:!1,selections:[f,g],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"shimmed_url",storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductVariantInfo",kind:"LinkedField",name:"variant_info",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantListingDetails",kind:"LinkedField",name:"listing_details",plural:!1,selections:[i,{alias:null,args:null,kind:"ScalarField",name:"multi_price",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"lowest_price",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantAvailability",kind:"LinkedField",name:"availability",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantAvailabilityListing",kind:"LinkedField",name:"listing",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"is_available",storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantAvailabilityListingOption",kind:"LinkedField",name:"options",plural:!0,selections:n,storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"product_id",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantTypes",kind:"LinkedField",name:"types",plural:!0,selections:[e,{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantTypeOption",kind:"LinkedField",name:"options",plural:!0,selections:[m,{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductMediaImage",kind:"LinkedField",name:"thumbnail_media",plural:!1,selections:[d,{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductMediaImageOriginalDimensions",kind:"LinkedField",name:"original_dimensions",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"height",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"width",storageKey:null}],storageKey:null},j,k],storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantProperties",kind:"LinkedField",name:"variant_properties",plural:!0,selections:n,storageKey:null}],storageKey:null}];f={alias:null,args:null,concreteType:"XFBWhatsAppCatalogPagingInfo",kind:"LinkedField",name:"paging",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"after",storageKey:null}],storageKey:null};return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"WAWebBizCatalogManagementFetchSingleCollectionQuery",selections:[{alias:null,args:c,concreteType:"XFBWhatsAppCatalogGetCollectionResponse",kind:"LinkedField",name:"xfb_whatsapp_catalog_collection",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogCollectionInfo",kind:"LinkedField",name:"collection",plural:!1,selections:[d,e,h,{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductInfo",kind:"LinkedField",name:"products",plural:!0,selections:[{kind:"InlineDataFragmentSpread",name:"WAWebBizCatalogManagementParseProductGraphql_product",selections:l,args:null,argumentDefinitions:[]}],storageKey:null}],storageKey:null},f],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"WAWebBizCatalogManagementFetchSingleCollectionQuery",selections:[{alias:null,args:c,concreteType:"XFBWhatsAppCatalogGetCollectionResponse",kind:"LinkedField",name:"xfb_whatsapp_catalog_collection",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogCollectionInfo",kind:"LinkedField",name:"collection",plural:!1,selections:[d,e,h,{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductInfo",kind:"LinkedField",name:"products",plural:!0,selections:l,storageKey:null}],storageKey:null},f],storageKey:null}]},params:{id:b("WAWebBizCatalogManagementFetchSingleCollectionQuery_facebookRelayOperation"),metadata:{},name:"WAWebBizCatalogManagementFetchSingleCollectionQuery",operationKind:"query",text:null}}}();e.exports=a}),null); __d("WAWebBizCatalogManagementFetchSingleCollection",["Promise","WALogger","WAWebBizCatalogManagementFetchSingleCollectionQuery.graphql","WAWebBizCatalogManagementParseProductGraphql","WAWebBizGatingUtils","WAWebFetchAdAccountToken","WAWebGraphQLServerError","WAWebNetworkStatus","WAWebProductTypes.flow","WAWebRelayClient"],(function(a,b,c,d,e,f,g){var h,i;function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["fetchSingleCollectionWithToken: failed with error"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(['fetchSingleCollection: failed as "','"']);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["fetchSingleCollection: success"]);l=function(){return a};return a}var m={type:"error"},n=h!==void 0?h:h=b("WAWebBizCatalogManagementFetchSingleCollectionQuery.graphql");function a(a){return!d("WAWebBizGatingUtils").graphQLForGetSingleCollectionEnabled()?(i||(i=b("Promise"))).resolve({type:"not-enabled"}):o(a).then(function(a){if(a.type==="success"){d("WALogger").LOG(l());return a}a.type;d("WALogger").LOG(k(),a.type);return a})}function o(a){return d("WAWebFetchAdAccountToken").fetchToken().then(function(b){if(b.type==="success")return p(b.token,a).then(function(a){a.type!=="success"?a.type==="auth-failure"?d("WAWebFetchAdAccountToken").markTokenAsInvalid():a.type:a.type;return a});b.type;return b})}function p(a,b){var e;return c("WAWebNetworkStatus").waitIfOffline().then(function(){return d("WAWebRelayClient").fetchQuery(n,{request:b},{environmentType:"facebook",accessToken:a,getInlineDataReader:function(a){e=a}})}).then(function(a){var b;if(a==null)return m;b=(b=a.xfb_whatsapp_catalog_collection)==null?void 0:b.collection;if(b==null)return m;a=(a=a.xfb_whatsapp_catalog_collection)==null?void 0:a.paging;a=(a=a==null?void 0:a.after)!=null?a:"";var c=b.id,f=b.name,g=b.status_info;b=b.products;var h=g==null?void 0:g.status;h=(h=h!=null?d("WAWebProductTypes.flow").asProductReviewType(h):void 0)!=null?h:"APPROVED";b=b.map(function(a){return e(d("WAWebBizCatalogManagementParseProductGraphql").PARSE_PRODUCT_FRAGMENT,a)}).map(d("WAWebBizCatalogManagementParseProductGraphql").parseProductGraphQL);f={id:(c=c)!=null?c:"",name:(c=f)!=null?c:"",rejectReason:g==null?void 0:g.reject_reason,commerceUrl:g==null?void 0:g.commerce_url,canAppeal:(g==null?void 0:g.can_appeal)==="true",reviewStatus:h,totalItemsCount:0,products:b,isHidden:!1};return{type:"success",collectionsResult:{collections:[f],afterCursor:a}}})["catch"](function(a){d("WALogger").LOG(j()).devConsole(a);if(d("WAWebFetchAdAccountToken").hasGraphQLAuthError(a))return{type:"auth-failure"};return a instanceof d("WAWebGraphQLServerError").GraphQLServerError?{type:"graphql-error",error:a}:m})}g.fetchSingleCollection=a}),98); __d("WAWebQueryProductSingleCollectionQuery.graphql",[],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"request"}],b={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},c={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},d={alias:null,args:null,kind:"ScalarField",name:"status",storageKey:null},e={alias:null,args:null,kind:"ScalarField",name:"can_appeal",storageKey:null},f={alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},g={alias:null,args:null,kind:"ScalarField",name:"price",storageKey:null},h={alias:null,args:null,kind:"ScalarField",name:"original_image_url",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"request_image_url",storageKey:null},j={alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null},k=[c,j];e=[{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:[b,c,{alias:null,args:null,concreteType:"XWAProductCatalogCollectionStatusInfo",kind:"LinkedField",name:"status_info",plural:!1,selections:[d,e,{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:[b,{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:"is_sanctioned",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"product_availability",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"max_available",storageKey:null},c,f,{alias:null,args:null,kind:"ScalarField",name:"url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"shimmed_url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"currency",storageKey:null},g,{alias:null,args:null,concreteType:"XWAProductCatalogProductStatusInfo",kind:"LinkedField",name:"status_info",plural:!1,selections:[e,d],storageKey:null},{alias:null,args:null,concreteType:"XWAProductCatalogProductSalePrice",kind:"LinkedField",name:"sale_price",plural:!1,selections:[g,{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:[b,h,i],storageKey:null},{alias:null,args:null,concreteType:"XWAProductCatalogProductMediaVideo",kind:"LinkedField",name:"videos",plural:!0,selections:[b,{alias:null,args:null,kind:"ScalarField",name:"original_video_url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"thumbnail_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},{alias:null,args:null,concreteType:"XWACatalogProductVariantInfo",kind:"LinkedField",name:"variant_info",plural:!1,selections:[{alias:null,args:null,concreteType:"XWACatalogVariantListingDetails",kind:"LinkedField",name:"listing_details",plural:!1,selections:[f,{alias:null,args:null,kind:"ScalarField",name:"multi_price",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"lowest_price",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XWACatalogVariantAvailability",kind:"LinkedField",name:"availability",plural:!1,selections:[{alias:null,args:null,concreteType:"XWAVariantAvailabilityListing",kind:"LinkedField",name:"listing",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"is_available",storageKey:null},{alias:null,args:null,concreteType:"XWAVariantAvailabilityListingOption",kind:"LinkedField",name:"options",plural:!0,selections:k,storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"product_id",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XWACatalogVariantTypes",kind:"LinkedField",name:"types",plural:!0,selections:[c,{alias:null,args:null,concreteType:"XWACatalogVariantTypeOption",kind:"LinkedField",name:"options",plural:!0,selections:[j,{alias:null,args:null,concreteType:"XWAProductCatalogProductMediaImage",kind:"LinkedField",name:"thumbnail_media",plural:!1,selections:[b,{alias:null,args:null,concreteType:"XWAProductCatalogProductMediaImageOriginalDimensions",kind:"LinkedField",name:"original_dimensions",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"height",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"width",storageKey:null}],storageKey:null},h,i],storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XWACatalogVariantProperties",kind:"LinkedField",name:"variant_properties",plural:!0,selections:k,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}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"WAWebQueryProductSingleCollectionQuery",selections:e,type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"WAWebQueryProductSingleCollectionQuery",selections:e},params:{id:"9728635953860643",metadata:{},name:"WAWebQueryProductSingleCollectionQuery",operationKind:"query",text:null}}}();e.exports=a}),null); __d("WAWebQueryProductSingleCollection",["WALogger","WAWebBackendErrors","WAWebBizCatalogManagementFetchSingleCollection","WAWebBizGatingUtils","WAWebBizParseProductGraphql","WAWebCatalogEventLogger","WAWebGraphQLServerError","WAWebMaybeThrowCatalogErrors","WAWebProductCollectionsJob","WAWebProductTypes.flow","WAWebQueryProductSingleCollectionQuery.graphql","WAWebRelayClient","WAWebUserPrefsMeUser","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["queryProductSingleCollectionGraphQLByOwner: error handling flow not implemented for ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["GraphQL: Failed fetching xwa_product_catalog_get_single_collection query."]);j=function(){return a};return a}var k=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(d("WAWebBizGatingUtils").commerceFeaturesDisabledBySanctions())throw new(d("WAWebBackendErrors").E451)();try{var c=a.catalogWid,e=a.collectionId,f=a.afterCursor,g=a.limit,i=a.width,k=a.height;a=a.directConnectionEncryptedInfo;c=(yield d("WAWebRelayClient").fetchQuery(h!==void 0?h:h=b("WAWebQueryProductSingleCollectionQuery.graphql"),{request:{collection:{biz_jid:c.toString(),id:e,limit:String(g),after:f,width:String(i),height:String(k),direct_connection_encrypted_info:a}}},{eventLogger:d("WAWebCatalogEventLogger").createCatalogEventLogger(d("WAWebCatalogEventLogger").GRAPHQL_CATALOG_ENDPOINT.GET_SINGLE_COLLECTION)}));e=(c==null?void 0:c.xwa_product_catalog_get_single_collection)||{};g=e.collection;f=e.paging;i=g||{};k=i.id;a=i.name;c=i.status_info;e=i.products;g=c==null?void 0:c.status;g=(i=g!=null?d("WAWebProductTypes.flow").asProductReviewType(g):void 0)!=null?i:"APPROVED";return{afterCursor:(f==null?void 0:f.after)||"",collections:[{id:k||"",name:a||"",canAppeal:(c==null?void 0:c.can_appeal)==="true",isHidden:!1,reviewStatus:g,totalItemsCount:0,products:e!=null?e.map(d("WAWebBizParseProductGraphql").parseProductGraphQL):[],rejectReason:c==null?void 0:c.reject_reason,commerceUrl:c==null?void 0:c.commerce_url}]}}catch(a){a instanceof d("WAWebGraphQLServerError").GraphQLServerError&&d("WAWebMaybeThrowCatalogErrors").maybeThrowLocalErrorForCatalogQuery(a);d("WALogger").WARN(j());throw new(d("WAWebBackendErrors").CatalogUnknownError)()}});return function(b){return a.apply(this,arguments)}}(),l=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(d("WAWebBizGatingUtils").commerceFeaturesDisabledBySanctions())throw new(d("WAWebBackendErrors").E451)();var b=a.catalogWid,c=a.collectionId,e=a.afterCursor,f=a.limit,g=a.width,h=a.height;a=a.directConnectionEncryptedInfo;b=(yield d("WAWebBizCatalogManagementFetchSingleCollection").fetchSingleCollection({collection:{biz_jid:b.toJid(),id:c,limit:String(f),after:e,width:String(g),height:String(h),direct_connection_encrypted_info:a}}));if(b.type==="success")return b.collectionsResult;else b.type==="graphql-error"?d("WAWebMaybeThrowCatalogErrors").maybeThrowLocalErrorForCatalogQuery(b.error):b.type;d("WALogger").WARN(i(),JSON.stringify(b));throw new(d("WAWebBackendErrors").CatalogUnknownError)()});return function(b){return a.apply(this,arguments)}}();a=function(a){var b=d("WAWebUserPrefsMeUser").getMaybeMeUser();return b!=null&&b.equals(a.catalogWid)?d("WAWebBizGatingUtils").graphQLForGetSingleCollectionEnabled()?l(a):d("WAWebProductCollectionsJob").querySingleCollectionIQ(a):d("WAWebBizGatingUtils").graphQLForCollectionM2Enabled()?k(a):d("WAWebProductCollectionsJob").querySingleCollectionIQ(a)};c=a;g["default"]=c}),98); __d("WAWebProductCollCollection",["WALogger","WAWebBaseCollection","WAWebBizProductCatalogBridge","WAWebBusinessDirectConnectionBridge","WAWebProductCollModel","WAWebQplQuickPerformanceLoggerModule","WAWebQueryProductCollections","WAWebQueryProductSingleCollection","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Failed findCollectionProducts, error: ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Failed findCollectionsList, error: ",""]);i=function(){return a};return a}var j=100,k=10,l=function(a){a={id:a.id,name:a.name,reviewStatus:a.reviewStatus,totalItemsCount:a.totalItemsCount,canAppeal:a.canAppeal,commerceUrl:a.commerceUrl,rejectReason:a.rejectReason};return a};a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.afterCursor="",b)||babelHelpers.assertThisInitialized(c)}var f=e.prototype;f.findCollectionsList=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e,f){var g=this;f&&d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(f,"datasource_collections_start");try{e=(yield d("WAWebBusinessDirectConnectionBridge").attemptWithDirectConnectionRetry(a,function(d){return c("WAWebQueryProductCollections")({catalogWid:a,afterCursor:g.afterCursor,limit:k,productsCount:b,width:j,height:j,directConnectionEncryptedInfo:d})}));f&&d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(f,"datasource_collections_end");this.afterCursor=e.afterCursor;this.add(e.collections.map(l),{merge:!0});e.collections.forEach(function(b){var c=g.get(b.id);c&&c.addProducts(b.products.map(function(b){return d("WAWebBizProductCatalogBridge").mapProductResponseToModel(b,a)}))});this.trigger("change")}catch(a){d("WALogger").ERROR(i(),a).verbose().devConsole(a).sendLogs("Find collections list failed");throw a}});function e(b,c,d,e){return a.apply(this,arguments)}return e}();f.getCollectionModels=function(a){var b=this.toArray();return a?b:b.filter(function(a){return!a.isHidden&&a.reviewStatus==="APPROVED"})};f.findCollectionProducts=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e,f){e=this.get(b);var g=e?e.afterCursor:void 0;f&&d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(f,"datasource_start");try{var i=(yield d("WAWebBusinessDirectConnectionBridge").attemptWithDirectConnectionRetry(a,function(d){return c("WAWebQueryProductSingleCollection")({catalogWid:a,collectionId:b,afterCursor:g,limit:k,width:j,height:j,directConnectionEncryptedInfo:d})}));f&&d("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(f,"datasource_end");i.collections.length===1&&(this.add(i.collections.map(l),{merge:!0}),e=this.get(b),e&&(e.addProducts(i.collections[0].products.map(function(b){return d("WAWebBizProductCatalogBridge").mapProductResponseToModel(b,a)})),e.afterCursor=i.afterCursor))}catch(a){d("WALogger").ERROR(h(),a).verbose().devConsole(a).sendLogs("Find collection products failed");throw a}});function e(b,c,d,e){return a.apply(this,arguments)}return e}();return e}(d("WAWebBaseCollection").BaseCollection);a.model=c("WAWebProductCollModel");a.staleCollection=!0;g.ProductCollCollection=a}),98); __d("WAWebProductCollModel",["WAWebBaseModel","WAWebProductCollection"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.name=d("WAWebBaseModel").prop(),c.isHidden=d("WAWebBaseModel").prop(),c.reviewStatus=d("WAWebBaseModel").prop(),c.commerceUrl=d("WAWebBaseModel").prop(),c.rejectReason=d("WAWebBaseModel").prop(),c.totalItemsCount=d("WAWebBaseModel").prop(),c.afterCursor=d("WAWebBaseModel").prop(),c.canAppeal=d("WAWebBaseModel").prop(),b)||babelHelpers.assertThisInitialized(c)}var c=b.prototype;c.initialize=function(){a.prototype.initialize.call(this),this.productCollection=new(d("WAWebProductCollection").ProductCollection)(),this.afterCursor=void 0};c.addProducts=function(a){this.productCollection.add(a,{merge:!0})};return b}(d("WAWebBaseModel").BaseModel);a.Proxy="productColl";b=d("WAWebBaseModel").defineModel(a);g["default"]=b}),98); __d("WAWebProductCollection",["Promise","WAWebBaseCollection","WAWebBizGatingUtils","WAWebProductModel"],(function(a,b,c,d,e,f,g){var h;c={NO_REVIEW:"NO_REVIEW",PENDING:"PENDING",REJECTED:"REJECTED",APPROVED:"APPROVED",OUTDATED:"OUTDATED"};function a(a,b){return a.index-b.index}var i=new Set([c.OUTDATED,c.NO_REVIEW,c.APPROVED,c.REJECTED,c.PENDING]),j=new Set([c.APPROVED]);e=function(a){babelHelpers.inheritsLoose(c,a);function c(){return a.apply(this,arguments)||this}var e=c.prototype;e.getProductModels=function(b){b===void 0&&(b=!1);var c=a.prototype.toArray.call(this);if(a.prototype.length<1)return c;var e=a.prototype.head.call(this);e=e==null?void 0:e.catalogWid;if(!e)return c;var f=b?i:j;e=a.prototype.filter.call(this,function(a){return f.has(a.reviewStatus)&&!a.old});return!b?e.filter(function(a){return!a.isHidden&&(!d("WAWebBizGatingUtils").isCountryOfOriginEnabled()||!a.isSanctioned)}):e};e.add=function(b,c){c=c?a.prototype.add.call(this,b,c):a.prototype.add.call(this,b);this.sort();return c};e.evictImagesFromCache=function(a){a=this.get(a);a&&a.evictImagesFromCache()};e.findImpl=function(a){var c=this.get(a);return c?(h||(h=b("Promise"))).resolve(c):(h||(h=b("Promise"))).resolve({id:a})};return c}(d("WAWebBaseCollection").BaseCollection);e.model=d("WAWebProductModel").Product;e.comparator=a;g.PRODUCT_REVIEW_STATUS=c;g.ProductCollection=e}),98); __d("WAWebProductImageCollection",["WAWebBaseCollection","WAWebProductImageModel"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}var c=b.prototype;c.toArray=function(){var b=this;return a.prototype.filter.call(this,function(a){if(a.old){b.remove(a);return!1}return a})};return b}(d("WAWebBaseCollection").BaseCollection);a.model=d("WAWebProductImageModel").ProductImage;g.ProductImageCollection=a}),98); __d("WAWebProductImageModel",["Promise","WABackoffDelay","WALogger","WAPromiseBackoffs","WAWebBaseModel","WAWebCryptoCalculateFilehash","WAWebMedia","WAWebMediaData","WAWebMediaDataUtils","WAWebMediaOpaqueData","WAWebMediaStore","WAWebMediaTypes","WAWebMiscErrors","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Failed to fetch ",""]);i=function(){return a};return a}var j="https://static.whatsapp.net",k=1e3;a=15*60*1e3;var l=10,m=d("WAPromiseBackoffs").createTimer({algo:{type:"fibonacci",first:0,second:1},jitter:.25,max:a});function n(a){a="_productimage_"+(a.includes(j)?a:new URL(a).pathname);return a}e=function(a){babelHelpers.inheritsLoose(e,a);function e(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.type=d("WAWebBaseModel").prop(),c.mediaUrl=d("WAWebBaseModel").prop(),c.videoUrl=d("WAWebBaseModel").prop(),c.blobUrl=d("WAWebBaseModel").session(),c.mediaData=d("WAWebBaseModel").session(),c.fetchedFromServer=d("WAWebBaseModel").prop(),c.old=d("WAWebBaseModel").session(!1),b)||babelHelpers.assertThisInitialized(c)}var f=e.prototype;f.initialize=function(){a.prototype.initialize.call(this),this.listenTo(this,"change:mediaUrl change:fetchedFromServer",this.triggerImageUpdate),this.triggerImageUpdate()};f._processAndUpdateMediaData=function(a){var e=this,f={};a=c("WAWebMediaOpaqueData").createFromData(a,"image/jpeg");a=d("WAWebMedia").prepRawMedia(a,{});a.waitForPrep().then(function(a){f=babelHelpers["extends"]({},f,{mediaBlob:a.mediaBlob,type:a.type,mimetype:a.mimetype,fullWidth:a.fullWidth,fullHeight:a.fullHeight});return(h||(h=b("Promise"))).all([typeof a.preview==="string"?c("WAWebMediaOpaqueData").createFromBase64Jpeg(a.preview):(h||(h=b("Promise"))).resolve(null),c("WAWebMediaOpaqueData").createFromData(a.mediaBlob),d("WAWebCryptoCalculateFilehash").calculateFilehashFromBlob(a.mediaBlob)])}).then(function(a){var b=a[0],c=a[1];a=a[2];f=babelHelpers["extends"]({},f,{preview:b,mediaBlob:c,renderableUrl:c.url(),mediaStage:d("WAWebMediaTypes").MediaDataStage.RESOLVED,filehash:a});if(a===e.mediaData.filehash)return;e.mediaData.set(f)})};f.triggerImageUpdate=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=this;if(!this.fetchedFromServer||!this.mediaUrl)return;this.mediaData||this.addChild("mediaData",new(c("WAWebMediaData"))({mediaStage:d("WAWebMediaTypes").MediaDataStage.PREPARING}));var e=n(this.mediaUrl),f=(yield d("WAWebMediaStore").LruMediaStore.get(e));if(f)return this._processAndUpdateMediaData(f);f={delay:function(a){a=a.taskDuration;var b=k*m();return Math.max(b-a,0)},signal:new AbortController().signal,retries:l};try{f=(yield d("WABackoffDelay").backoff(f,function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){var c=(yield d("WAWebMediaDataUtils").fetchMedia(a.mediaUrl));return!c||!(c.status>=200&&c.status<300)?b(new(d("WAWebMiscErrors").CatalogImageDownloadError)()):c});return function(a){return c.apply(this,arguments)}}()));f=f.result;d("WAWebMediaStore").LruMediaStore.put(e,f);this._processAndUpdateMediaData(f)}catch(a){d("WALogger").WARN(i(),this.mediaUrl).devConsole(a),this.mediaData.set({mediaStage:d("WAWebMediaTypes").MediaDataStage.ERROR_MISSING})}});function e(){return a.apply(this,arguments)}return e}();f.markOld=function(){this.old=!0};f.evictFromCache=function(){if(this.mediaUrl){var a=n(this.mediaUrl);d("WAWebMediaStore").LruMediaStore.del(a)}};return e}(d("WAWebBaseModel").BaseModel);e.Proxy="productImage";f=d("WAWebBaseModel").defineModel(e);g.STATIC_WHATSAPP_IMAGE_URI=j;g.ProductImage=f}),98); __d("WAWebProductMessageListCollection",["Promise","WAWebBaseCollection","WAWebBizProductCatalogAction","WAWebProductMessageListModel","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;a=function(a){babelHelpers.inheritsLoose(c,a);function c(){var c,d;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(c=d=a.call.apply(a,[this].concat(f))||this,d.findQueryImpl=function(a){return d.findImpl(a).then(function(a){return[a]})},d.findImpl=function(a,c){var e=d.get(a);return e==null?(h||(h=b("Promise"))).resolve({id:a}):d._queryProductList(e,c==null?void 0:c.markerId)},c)||babelHelpers.assertThisInitialized(d)}var e=c.prototype;e._queryProductList=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=a.catalogId;c=(yield d("WAWebBizProductCatalogAction").queryProductList(c,a.getNextProductBatchToLoad(),void 0,void 0,b));return{id:a.id,_products:c}});function a(b,c){return a.apply(this,arguments)}return a}();e.getOrAdd=function(a,b,c,e,f){var g=this.get(a);if(g!=null)return g;if(e==null)return null;e=d("WAWebWidFactory").createWid(e);g=this.add({id:a,catalogId:e,_productList:b,title:f,requiresDirectConnection:c})[0];return g!=null?g:null};return c}(d("WAWebBaseCollection").BaseCollection);a.model=d("WAWebProductMessageListModel").ProductMessageList;a.staleCollection=!0;c=new a();g.ProductMessageListCollection=c}),98); __d("WAWebProductMessageListModel",["WAWebBaseModel","WAWebBizProductCatalogBridge","WAWebBizProductMessageListAction","WAWebBusinessDirectUtils","WAWebCatalogCollection","WAWebChatCollection","WAWebMsgKey","WAWebProductCollection","WAWebProductMessageListConstant","WAWebProductTypes.flow","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h=["ERROR","SUCCESS"];a=function(a){babelHelpers.inheritsLoose(c,a);function c(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.catalogId=d("WAWebBaseModel").prop(),c.title=d("WAWebBaseModel").prop(),c.requiresDirectConnection=d("WAWebBaseModel").prop(),c._productsLoadingStatus=d("WAWebBaseModel").session(),c._productList=d("WAWebBaseModel").session(),c._products=d("WAWebBaseModel").session(),b)||babelHelpers.assertThisInitialized(c)}var e=c.prototype;e.initialize=function(){a.prototype.initialize.call(this),this.productCollection=d("WAWebCatalogCollection").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(d("WAWebChatCollection").ChatCollection,"add",this.triggerChatAdded)};e.triggerProductRemoved=function(a){d("WAWebBizProductMessageListAction").updateProductListHeaderImageRejected(a,this.id)};e.triggerProductUpdate=function(){var a=this;if(this._products==null)return;this._products.forEach(function(b){var c=a._getFetchStatus(b);a.setProductLoadingStatus(b.id,c);b.status==="DELETED"&&a.triggerProductRemoved(b);if(b.status!=="DELETED"&&c!=="ERROR"){c=d("WAWebBizProductCatalogBridge").mapProductResponseToModel(b,a.catalogId);c.reviewStatus===d("WAWebProductCollection").PRODUCT_REVIEW_STATUS.REJECTED&&a.triggerProductRemoved(c);a.productCollection.add(c,{merge:!0})}});this._products=void 0};e.triggerChatAdded=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a.id.equals(this.catalogId)&&(yield d("WAWebBusinessDirectUtils").isCypherNeeded(this.catalogId))&&(this.productCollection.reset(),this._productsLoadingStatus=new Map())});function c(b){return a.apply(this,arguments)}return c}();e.getNextProductBatchToLoad=function(){var a=this,b=this.getPageSize();b=this._productList.productSections.reduce(function(b,c){c=c.products;return[].concat(b,c.map(function(a){a=a.productId;return a}).filter(Boolean).filter(function(b){return a.getProductLoadingStatus(b)==="NONE"}))},[]).slice(0,b);b.forEach(function(b){return a.setProductLoadingStatus(b,"PENDING")});return b};e.getPageSize=function(){var a=d("WAWebProductTypes.flow").PRODUCT_PAGE_SIZE,b=this.getProductSize();return b<3*a?b:a*2};e.getProductSize=function(){return this._productList.productSections.reduce(function(a,b){b=b.products;return a+b.length},0)};e.setProductLoadingStatus=function(a,b){this._productsLoadingStatus.set(a,b)};e.getProductLoadingStatus=function(a){return this._productsLoadingStatus.get(a)||"NONE"};e.getTotalProductsFetchedOrFailed=function(){return Array.from(this._productsLoadingStatus).filter(function(a){a[0];a=a[1];return h.includes(a)}).length};e.getProductList=function(){return this._productList};e.getSections=function(){return this._productList.productSections};e.getSectionsCount=function(){return this._productList.productSections.reduce(function(a,b){b=b.title;return b!=null&&b!==""?a+1:a},0)};e.isFetching=function(){var a=!1;this._productsLoadingStatus.forEach(function(b){b==="PENDING"&&(a=!0)});return a};e._getFetchStatus=function(a){return a.status===d("WAWebProductMessageListConstant").INVALID_PRODUCT_TOKEN||!a.image_cdn_urls?"ERROR":"SUCCESS"};return c}(d("WAWebBaseModel").BaseModel);a.Proxy="product_list";a.idClass=c("WAWebMsgKey");e=d("WAWebBaseModel").defineModel(a);g.ProductMessageList=e}),98); __d("WAWebProductModel",["WAWebBaseModel","WAWebBizGatingUtils","WAWebFileUtils","WAWebMediaData","WAWebMediaOpaqueData","WAWebMediaTypes","WAWebProductImageCollection"],(function(a,b,c,d,e,f,g){a=0;b=4503599627370496;e=10;f=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.old=d("WAWebBaseModel").session(!1),c.checkmark=d("WAWebBaseModel").session(!1),c.id=d("WAWebBaseModel").prop(),c.isHidden=d("WAWebBaseModel").prop(),c.catalogWid=d("WAWebBaseModel").prop(),c.url=d("WAWebBaseModel").prop(),c.signedShimmedUrl=d("WAWebBaseModel").prop(),c.name=d("WAWebBaseModel").prop(),c.description=d("WAWebBaseModel").prop(),c.availability=d("WAWebBaseModel").prop(),c.maxAvailable=d("WAWebBaseModel").prop(),c.reviewStatus=d("WAWebBaseModel").prop(),c.isSanctioned=d("WAWebBaseModel").prop(),c.canAppeal=d("WAWebBaseModel").prop(),c.currency=d("WAWebBaseModel").prop(),c.priceAmount1000=d("WAWebBaseModel").prop(),c.salePriceAmount1000=d("WAWebBaseModel").prop(),c.salePriceStartDate=d("WAWebBaseModel").prop(),c.salePriceEndDate=d("WAWebBaseModel").prop(),c.retailerId=d("WAWebBaseModel").prop(),c.productImageCollection=d("WAWebBaseModel").session(),c.imageCount=d("WAWebBaseModel").prop(),c.index=d("WAWebBaseModel").prop(),c.videos=d("WAWebBaseModel").prop(),c.variantInfo=d("WAWebBaseModel").prop(),c.additionalImageCdnUrl=d("WAWebBaseModel").prop(),c.additionalImageHashes=d("WAWebBaseModel").prop(),c.imageCdnUrl=d("WAWebBaseModel").prop(),c.imageHash=d("WAWebBaseModel").prop(),c.complianceInfo=d("WAWebBaseModel").prop(),c.importerInformationExempt=d("WAWebBaseModel").prop(),c.productMsgMediaData=d("WAWebBaseModel").session(),c.fetchedFromServer=d("WAWebBaseModel").session(),c.t=d("WAWebBaseModel").prop(),b)||babelHelpers.assertThisInitialized(c)}var e=b.prototype;e.initialize=function(){a.prototype.initialize.call(this),this.productImageCollection=new(d("WAWebProductImageCollection").ProductImageCollection)(),this.listenTo(this,"change:imageCdnUrl",this.triggerMainImageUpdate),this.initImageUpdate()};e.triggerAdditionalImageUpdate=function(){var a,b=this,c=0;(a=this.additionalImageCdnUrl)==null?void 0:a.forEach(function(a,d){b.productImageCollection.gadd({id:"_"+(d+1),mediaUrl:a,fetchedFromServer:b.fetchedFromServer,old:!1},{merge:!0}),c=d+1});if(d("WAWebBizGatingUtils").isCatalogVideoViewEnabled()){(a=this.videos)==null?void 0:a.forEach(function(a,d){b.productImageCollection.gadd({id:"_"+(d+c+1),mediaUrl:a.thumbnail_url,fetchedFromServer:b.fetchedFromServer,old:!1,videoUrl:a.original_video_url},{merge:!0}),c+=d+1})}this.productImageCollection.filter(function(a,b){return b>c}).forEach(function(a){return a.markOld()})};e.triggerMainImageUpdate=function(){if(this.imageCdnUrl!=null&&this.imageCdnUrl!=="")this.productImageCollection.gadd({id:"_0",mediaUrl:this.imageCdnUrl,fetchedFromServer:this.fetchedFromServer,old:!1},{merge:!0});else{var a;(a=this.productImageCollection.get("_0"))==null?void 0:a.markOld()}};e.initImageUpdate=function(){if(!this.fetchedFromServer&&this.productMsgMediaData){for(var a=0;a<this.imageCount;a++)this.productImageCollection.gadd({id:"_"+a,type:"product",mediaData:new(c("WAWebMediaData"))({mediaStage:d("WAWebMediaTypes").MediaDataStage.PREPARING}),fetchedFromServer:this.fetchedFromServer,old:!1},{merge:!0});return}this.triggerMainImageUpdate()};e.markOld=function(){this.old=!0};e.lazyloadProductImageCollection=function(){this.triggerAdditionalImageUpdate();return this.productImageCollection};e.getProductImageCollectionCount=function(){return this.productImageCollection.length};e.getProductImageCollectionHead=function(){return this.productImageCollection.head()};e.getHeadImageFile=function(){var a=this.productImageCollection,b=this.name;a=a.head();if(!a)return;var e;a=(a=a.mediaData)==null?void 0:a.mediaBlob;a.blob!=null?e=a.blob:a instanceof c("WAWebMediaOpaqueData")&&(e=a.getBlob());if(e==null)return;a=d("WAWebFileUtils").createFile([e],b+".jpg",{type:"image/jpeg"});return a};e.evictImagesFromCache=function(){this.productImageCollection.forEach(function(a){return a.evictFromCache()})};e.getPreviewImage=function(){return this.productImageCollection.head()};e.getCollection=function(){return this.collection};e.setIsHidden=function(a){this.isHidden=a};return b}(d("WAWebBaseModel").BaseModel);f.Proxy="product";f=d("WAWebBaseModel").defineModel(f);g.MIN_PRICE=a;g.MAX_PRICE=b;g.MAX_PRODUCT_IMAGES=e;g.Product=f}),98); __d("WAWebChatComparator",[],(function(a,b,c,d,e,f){a=function(a,b){var c=a.pin||0,d=b.pin||0;if(c||d)return c!==d?c>d?-1:1:a.id.toString()<b.id.toString()?-1:1;c=Math.max(a.previewT||0,a.draftMessageSortTs||0,a.draftAttachMediaContentsSortTs||0,a.t||0);d=Math.max(b.previewT||0,b.draftMessageSortTs||0,b.draftAttachMediaContentsSortTs||0,b.t||0);return c!==d?c>d?-1:1:a.id.toString()<b.id.toString()?-1:1};b=a;f["default"]=b}),66); __d("WAWebChatCollection",["WALogger","WAWebBaseCollection","WAWebChatComparator","WAWebChatGetters","WAWebChatLockUpdateDailyStats","WAWebChatModel","WAWebIdleTaskRunner","WAWebLidMigrationUtils","WAWebSendUnstarAllChatAction","WAWebSocketConstants","WAWebSocketModel","lodash"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["ChatCollection:getActive more than one active chat"]);h=function(){return a};return a}var i=1e3*60*30;a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b;b=a.call(this)||this;b.notSpam={};b.promises={sendUnstarAll:null};b._sortEnabled=!1;b._viewOnceCleanupTaskQueue=new Set();b.setIndexes=function(){b.forEach(function(a,b){a.initialIndex=b})};b.enableSortListener();b.listenTo(d("WAWebSocketModel").Socket,"change:stream",function(){d("WAWebSocketModel").Socket.stream===d("WAWebSocketConstants").SOCKET_STREAM.RESUMING&&b.forEach(function(a){a.pendingMsgs=!1})});b.listenToOnce(babelHelpers.assertThisInitialized(b),"sort",c("lodash").debounce(b.setIndexes,100));b._scheduleViewOnceMediaCleanup();b.listenTo(babelHelpers.assertThisInitialized(b),"change:isLocked",c("lodash").debounce(function(){d("WAWebChatLockUpdateDailyStats").updateChatLockDailyStats({totalFolderChatsCount:b.filter(function(a){return a.isLocked}).length})},500));return b}var e=b.prototype;e._scheduleViewOnceMediaCleanup=function(){var a=this;self.clearTimeout(this._viewOnceCleanupTimeout);this._viewOnceCleanupTimeout=self.setTimeout(function(){d("WAWebIdleTaskRunner").IdleCallbackTasks.enqueue(function(){a._runViewOnceMediaCleanup(),a._scheduleViewOnceMediaCleanup()})},i)};e._runViewOnceMediaCleanup=function(){var a=this;this.forEach(function(b){var c=b.id;if(a._viewOnceCleanupTaskQueue.has(c))return;d("WAWebIdleTaskRunner").IdleCallbackTasks.enqueue(function(){a._viewOnceCleanupTaskQueue["delete"](c);var b=a.get(c);(b==null?void 0:b.active)===!1&&b.deregisterExpiredViewOnceBulkMessages(b.msgs)});a._viewOnceCleanupTaskQueue.add(c)})};e.getUnreadCount=function(){return this.filter(function(a){return a.showUnreadInTitle}).length};e.enableSortListener=function(a){if(this._sortEnabled)return;this.listenTo(this,"change:t change:pin change:id change:isLocked change:endOfHistoryTransferType change:isParentGroup change:msgs change:createdLocally change:msgsLength",this.sort);a===!0&&this.sort();this._sortEnabled=!0};e.disableSortListener=function(){this._sortEnabled&&(this.stopListening(null,null,this.sort),this._sortEnabled=!1)};e.getActive=function(){var a=this.filter(function(a){return a.active});a.length>1&&d("WALogger").ERROR(h()).sendLogs("more-than-one-active-chat-in-chat-collection");return a[0]};e.getChatByAccountLid=function(a){if(!a.isLid())return null;var b=this.get(a);if(b)return b;b=d("WAWebLidMigrationUtils").toPn(a);b=b?this.get(b):null;return a.equals(b==null?void 0:b.accountLid)?b:null};e.unstarAllMessages=function(a,b){return d("WAWebSendUnstarAllChatAction").unstarAllMessages(a,b)};e.hasAnyUnreadSinceGivenTimestamp=function(a){return this.length===0?!1:this.some(function(b){var c;c=(c=b.t)!=null?c:0;return d("WAWebChatGetters").getHasUnread(b)&&c>a})};e["delete"]=function(){a.prototype["delete"].call(this),this.listenToOnce(this,"sort",c("lodash").debounce(this.setIndexes,100))};return b}(d("WAWebBaseCollection").BaseCollection);a.model=d("WAWebChatModel").Chat;a.comparator=c("WAWebChatComparator");b=new a();g.ChatCollectionImpl=a;g.ChatCollection=b}),98); __d("WAWebChatCommunityUtils",["WAWebChatCollection","WAWebChatGroupUtils","WAWebCommunityGatingUtils","WAWebContactGetters","WAWebGroupMetadataCollection","WAWebGroupType","WAWebLidMigrationUtils","WAWebUnjoinedSubgroupMetadataCollection","WAWebUserPrefsMeUser","WAWebWidFactory","isStringNullOrEmpty"],(function(a,b,c,d,e,f,g){var h=91;function i(a){var b;return!a?!1:(a==null?void 0:(b=a.groupMetadata)==null?void 0:b.groupType)===d("WAWebGroupType").GroupType.COMMUNITY&&d("WAWebChatGroupUtils").isSuspendedGroup(a)&&d("WAWebCommunityGatingUtils").isCommunitySuspendAppealEnabled()}function j(a){var b;return!a?!1:(a==null?void 0:(b=a.groupMetadata)==null?void 0:b.groupType)===d("WAWebGroupType").GroupType.COMMUNITY&&d("WAWebChatGroupUtils").isSuspendedGroup(a)&&d("WAWebChatGroupUtils").isTerminatedGroup(a)}function k(a){if(!(a==null?void 0:a.groupMetadata))return!1;a=a.groupMetadata;a=a.participants;return a.iAmSuperAdmin()}function a(a){if(!(a==null?void 0:a.groupMetadata)||j(a)||i(a))return!1;var b=a.groupMetadata,c=b.participants;b=Boolean(b.allowNonAdminSubGroupCreation)&&d("WAWebCommunityGatingUtils").memberAddedGroupsM1Enabled();return b||c.iAmAdmin()||k(a)||d("WAWebCommunityGatingUtils").memberSuggestedGroupsEnabled()}function b(a){return!(a==null?void 0:a.groupMetadata)||j(a)?!1:k(a)}function e(a){return c("WAWebGroupMetadataCollection").filter(function(b){return b.parentGroup===a&&b.defaultSubgroup===!0}).map(function(a){return a.id})}function f(a,b){return a.map(function(a){var e;e=b?(e=d("WAWebChatCollection").ChatCollection.get(a))==null?void 0:e.formattedTitle:(e=c("WAWebUnjoinedSubgroupMetadataCollection").get(a))==null?void 0:e.subject;return{id:a,subject:(a=e)!=null?a:""}})}function l(a){if(!a||!a.contact.name)return!1;var b=d("WAWebChatCollection").ChatCollection.findFirst(function(b){var c;return((c=b.groupMetadata)==null?void 0:c.parentGroup)===a.id&&((c=b.groupMetadata)==null?void 0:c.defaultSubgroup)});return!b||!b.contact.name?!1:b.contact.name!==a.contact.name}function m(a){if(!a)return!1;a=c("WAWebGroupMetadataCollection").get(a);if(!a)return!1;var b=a.participants.iAmAdmin();return a.allowNonAdminSubGroupCreation!==!0&&!b&&d("WAWebCommunityGatingUtils").memberSuggestedGroupsEnabled()}function n(a,b,c){if(b==null)return!0;if(c==null){var e;e=a==null?void 0:(e=a.groupMetadata)==null?void 0:(e=e.getParentGroupChat())==null?void 0:(e=e.groupMetadata)==null?void 0:e.participants;e=Boolean(e==null?void 0:e.iAmAdmin())||Boolean(e==null?void 0:e.userIsAdmin((e=d("WAWebLidMigrationUtils").toPn(b.id))!=null?e:b.id))}else e=c.iAmCommunityAdmin||c.isSenderAdmin;if(!a||d("WAWebUserPrefsMeUser").isMeAccount(b.id)||d("WAWebContactGetters").getIsMyContact(b)||!d("WAWebChatGroupUtils").isCommunityAnnouncementGroup(a)||e)return!1;return!b.id.isLid()?!e&&d("WAWebChatGroupUtils").isCommunityAnnouncementGroup(a):!0}function o(a){a=a.length!==0?a[0].toString():null;return!c("isStringNullOrEmpty")(a)&&d("WAWebWidFactory").isWidlike(a)?d("WAWebWidFactory").createWidFromWidLike(a):null}g.SUBGROUP_V2_CHAT_CELL_HEIGHT=h;g.isSuspendedCommunity=i;g.isIntegrityDeactivatedCommunity=j;g.isCommunitySuperAdmin=k;g.canAddGroupToCommunity=a;g.canDeactivateCommunity=b;g.getCagIdFromCommunity=e;g.formatSubgroupUpdateTypes=f;g.cagAndCommunitySubjectDiffer=l;g.isSubgroupSuggestionCreation=m;g.shouldMaskPhoneNumberForChat=n;g.getNewCommunityOwnerFromTemplateParams=o}),98); __d("WAWebChatDocMsgsCollection",["Promise","WAFilteredCatch","WALogger","WAWebBackendErrors","WAWebBaseCollection","WAWebFrontendMsgGetters","WAWebMsgCollection","WAWebMsgModel","WAWebNoop","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Failed to count docs for chat ",""]);i=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var c,e;for(var f=arguments.length,g=new Array(f),h=0;h<f;h++)g[h]=arguments[h];return(c=e=a.call.apply(a,[this].concat(g))||this,e.hasDocBefore=!0,e.$ChatDocMsgsCollection$p_1=null,e.count=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b;if(e.$ChatDocMsgsCollection$p_1!=null)return e.$ChatDocMsgsCollection$p_1;var c=a.msgs.filter(j);b=(b=c[0])!=null?b:a.msgs.head();if(b==null)return 0;try{b=(yield d("WAWebMsgCollection").MsgCollection.queryMedia(b.id.remote,Infinity,"before",b.id,"document"));b=(b=b.length)!=null?b:0;var f=b>0&&c.length>0?1:0;e.$ChatDocMsgsCollection$p_1=b+c.length-f;return e.$ChatDocMsgsCollection$p_1}catch(b){d("WALogger").ERROR(i(),a.id).verbose().devConsole(b).sendLogs("md-failed-docs-count: "+b.message);return null}});return function(b){return a.apply(this,arguments)}}(),c)||babelHelpers.assertThisInitialized(e)}var f=e.prototype;f["delete"]=function(){a.prototype["delete"].call(this),this.stopListening(),this.reset()};f.add=function(b,c){this.$ChatDocMsgsCollection$p_1=null;return a.prototype.add.call(this,b,c)};f.remove=function(b,c){this.$ChatDocMsgsCollection$p_1=null;return a.prototype.remove.call(this,b,c)};f.queryDocs=function(a,e){var f=this;if(e){if(this.queryDocBefore)return this.queryDocBefore;e=this.queryDocBefore=d("WAWebMsgCollection").MsgCollection.queryMedia(e.id.remote,d("WAWebMsgCollection").MEDIA_QUERY_LIMIT,"before",e.id,"document").then(function(a){(!a||a.length<d("WAWebMsgCollection").MEDIA_QUERY_LIMIT)&&(f.hasDocBefore=!1),f.add(a.filter(j),{at:0})})["catch"](d("WAFilteredCatch").filteredCatch(d("WAWebBackendErrors").E404,c("WAWebNoop")))["finally"](function(){f.queryDocBefore=null,f.trigger("query_doc_before")});this.trigger("query_doc_before");return e}e=a.msgs;if(this.length===0){if(!e||e.length===0){this.hasDocBefore=!1;return(h||(h=b("Promise"))).resolve()}this.add(e.filter(j),{at:0})}if(a.msgs.msgLoadState.noEarlierMsgs){this.hasDocBefore=!1;return(h||(h=b("Promise"))).resolve()}else if(this.length<=2*d("WAWebMsgCollection").MEDIA_QUERY_LIMIT){e=this.length===0?e.head():this.head();return this.queryDocs(a,e)}return(h||(h=b("Promise"))).resolve()};return e}(d("WAWebBaseCollection").BaseCollection);a.model=d("WAWebMsgModel").Msg;function j(a){return d("WAWebFrontendMsgGetters").getAsDoc(a)!=null&&!a.isVcardOverMmsDocument}g["default"]=a}),98); __d("WAWebGroupGatingUtils",["WAWebABProps"],(function(a,b,c,d,e,f,g){function a(){return d("WAWebABProps").getABPropConfigValue("enable_group_exit_experience")}function b(){return d("WAWebABProps").getABPropConfigValue("group_description_length")}function c(){return d("WAWebABProps").getABPropConfigValue("enable_group_exit_experience_logging")}function e(){return d("WAWebABProps").getABPropConfigValue("group_max_subject")}g.isGroupExitExperienceEnabled=a;g.getGroupDescriptionLength=b;g.isGroupExitExperienceLoggingEnabled=c;g.getGroupMaxSubject=e}),98); __d("WAWebTosCountryGating",["WAWebABPropsInternalNumber","WAWebBizGatingUtils","WAWebHandleMsgTypes.flow"],(function(a,b,c,d,e,f,g){function a(a){if(d("WAWebBizGatingUtils").countryGatingEnabled()){var b;return((b=a.privacyMode)==null?void 0:b.hostStorage)===d("WAWebHandleMsgTypes.flow").HostStorageEnumType.Facebook&&!d("WAWebABPropsInternalNumber").getFbBrandedNumber(a.id.user)}return!1}g.shouldBlockByCountry=a}),98); __d("WAWebTosGating",["WAWebABPropsInternalNumber","WAWebBizGatingUtils","WAWebBotTos","WAWebBotTosIds","WAWebHandleMsgTypes.flow","WAWebTos"],(function(a,b,c,d,e,f,g){function a(a){if(d("WAWebBizGatingUtils").tos3GatingEnabled()){var b;if(d("WAWebTos").TosManager.getState(d("WAWebTos").TOS_3_ID)==="NOT_ACCEPTED"&&((b=a.privacyMode)==null?void 0:b.hostStorage)===d("WAWebHandleMsgTypes.flow").HostStorageEnumType.Facebook&&!d("WAWebABPropsInternalNumber").getFbBrandedNumber(a.id.user))return!0}return!1}function b(a){if(a.id.isPnBot()&&!d("WAWebBotTos").hasSeenAgentTos()&&!d("WAWebBotTos").hasSeenShortcutTos())return!0;return a.id.isFbidBot()&&!d("WAWebBotTos").hasSeenUgcTos()?!0:!1}function c(){if(d("WAWebBotTos").hasSeenInvokeTos())return!1;return!d("WAWebBotTosIds").supportedTosNoticeIds.has(d("WAWebBotTosIds").getBotInvokeTosId())?!0:!1}g.shouldBlockByTos=a;g.shouldBlockByBotTos=b;g.shouldBlockBotInvokeAsTosNotAvailable=c}),98); __d("WAWebChatGroupUtils",["Promise","WALogger","WATimeUtils","WAWebABProps","WAWebABPropsSupportGroup","WAWebApiContact","WAWebBizAiAgentGating","WAWebBizAiAgentStatusUtils","WAWebBotGating","WAWebBotTos","WAWebChatGetters","WAWebCommunityGatingUtils","WAWebCurrentUser","WAWebDBUpdateChatTable","WAWebFrontendContactGetters","WAWebGroupGatingUtils","WAWebGroupType","WAWebLid1X1MigrationGating","WAWebNewsletterMembershipUtil","WAWebNoop","WAWebStateUtils","WAWebTosCountryGating","WAWebTosGating","WAWebUserPrefsMeUser","WAWebWidFactory"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["getOneToOneContactFromGroupContact: Participant LID does not have PN mapping. context: ",". more context: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["getOneToOneContactFromGroupContact: could not find PN for Lid ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["chat:updateReadOnly:old ",", new ",""]);k=function(){return a};return a}function l(a){if(!a)return!1;a=d("WAWebStateUtils").unproxy(a);return d("WAWebChatGetters").getIsGroup(a)&&((a=a.groupMetadata)==null?void 0:a.support)===!0}function a(a){a=d("WAWebStateUtils").unproxy(a);return l(a)||c("WAWebABPropsSupportGroup")(a.id.user)}function m(a){a=d("WAWebStateUtils").unproxy(a);return d("WAWebChatGetters").getIsGroup(a)&&!!((a=a.groupMetadata)==null?void 0:a.terminated)}function n(a){a=d("WAWebStateUtils").unproxy(a);return d("WAWebChatGetters").getIsGroup(a)&&((a=a.groupMetadata)==null?void 0:a.groupType)===d("WAWebGroupType").GroupType.LINKED_ANNOUNCEMENT_GROUP}function e(a){a=d("WAWebStateUtils").unproxy(a);return d("WAWebChatGetters").getIsGroup(a)&&((a=a.groupMetadata)==null?void 0:a.groupType)===d("WAWebGroupType").GroupType.LINKED_GENERAL_GROUP}function o(a){if(!a)return!1;a=d("WAWebStateUtils").unproxy(a);return d("WAWebChatGetters").getIsGroup(a)&&!!((a=a.groupMetadata)==null?void 0:a.suspended)}function f(a){a=d("WAWebStateUtils").unproxy(a);return a.canSend&&!o(a)&&!m(a)}function p(a){var b;a=d("WAWebStateUtils").unproxy(a);return d("WAWebChatGetters").getIsGroup(a)&&((b=a.groupMetadata)==null?void 0:b.growthLockType)==="invite"&&(a.groupMetadata.growthLockExpiration||0)>d("WATimeUtils").unixTime()}function q(a){var b;if(!a)return!1;a=d("WAWebStateUtils").unproxy(a);var c=m(a);b=o(a)&&!((b=a.groupMetadata)==null?void 0:b.participants.iAmMember());return(c||b)&&!n(a)}function r(a){var b;a=d("WAWebStateUtils").unproxy(a);return((b=a.groupMetadata)==null?void 0:b.groupType)===d("WAWebGroupType").GroupType.LINKED_ANNOUNCEMENT_GROUP&&o(a)&&d("WAWebCommunityGatingUtils").isCommunitySuspendAppealEnabled()}function s(a){var b;a=d("WAWebStateUtils").unproxy(a);return((b=a.groupMetadata)==null?void 0:b.groupType)===d("WAWebGroupType").GroupType.LINKED_ANNOUNCEMENT_GROUP&&o(a)&&m(a)}function t(){return d("WAWebABProps").getABPropConfigValue("group_suspend_appeal_include_entity_id_enabled")}function u(a){var b;a=d("WAWebStateUtils").unproxy(a);return((b=a.groupMetadata)==null?void 0:b.groupType)===d("WAWebGroupType").GroupType.LINKED_ANNOUNCEMENT_GROUP&&m(a)}function v(a){return o(a)||m(a)}function w(a){var e,f=d("WAWebStateUtils").unproxy(a);if(l(f)&&f.isReadOnly)return;a=(h||(h=b("Promise"))).resolve();if(d("WAWebChatGetters").getIsNewsletter(f)){var g=!d("WAWebNewsletterMembershipUtil").iAmAdminOrOwner(f.newsletterMetadata)||f.isSuspendedOrTerminated();f.isReadOnly!==g&&d("WAWebDBUpdateChatTable").updateChatTable(f.id,{isReadOnly:g}).then(function(){f.isReadOnly=g,B(f)})["catch"](c("WAWebNoop"));return}if(d("WAWebChatGetters").getIsGroup(f)&&!((e=f.groupMetadata)==null?void 0:e.stale)){var i=((e=f.groupMetadata)==null?void 0:e.groupType)!==d("WAWebGroupType").GroupType.COMMUNITY&&(!((e=f.groupMetadata)==null?void 0:e.participants.iAmMember())||m(f));f.isReadOnly!==i&&(d("WALogger").LOG(k(),f.isReadOnly,i),a=d("WAWebDBUpdateChatTable").updateChatTable(f.id,{isReadOnly:i}).then(function(){f.isReadOnly=i,B(f)}))}a.then(function(){d("WAWebChatGetters").getIsBroadcast(f)&&A(f)})}function x(a){a=d("WAWebStateUtils").unproxy(a);return((a=a.groupMetadata)==null?void 0:a.participants.length)||1}function y(a,b,c){var e=d("WAWebUserPrefsMeUser").getMaybeMeLidUser();if(e==null?void 0:e.equals(a))return d("WAWebUserPrefsMeUser").getMeUser();if(d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated())return a;if(!a.isLid())return a;e=d("WAWebApiContact").getPhoneNumber(d("WAWebWidFactory").toUserWid(a));if(e==null){d("WAWebCurrentUser").isEmployee()&&d("WALogger").LOG(j(),a.toString());d("WALogger").ERROR(i(),b,c).sendLogs("lid-group-get-one-to-one-contact");return null}return e}function z(a){var b=a.participants;a=(a=a.size)!=null?a:0;a=b.iAmAdmin()?a:b.length;return a}function A(a){if(d("WAWebChatGetters").getIsBroadcast(a)){var b;a.formattedTitle=(b=a.contact.name)!=null?b:((b=(b=a.groupMetadata)==null?void 0:b.participants)!=null?b:[]).map(function(a){return d("WAWebFrontendContactGetters").getFormattedShortName(a.contact)}).join(", ")}else if(d("WAWebChatGetters").getIsUser(a)){a.formattedTitle=(b=d("WAWebFrontendContactGetters").getFormattedUser(a.contact))!=null?b:""}else if(d("WAWebChatGetters").getIsGroup(a)){a.formattedTitle=(b=a.contact.name)!=null?b:(b=a.groupMetadata)==null?void 0:b.subject}else if(d("WAWebChatGetters").getIsNewsletter(a)){a.formattedTitle=(b=a.contact.name)!=null?b:(b=a.newsletterMetadata)==null?void 0:b.name}}function B(a,b){if(a.isReadOnly||a.isAnnounceGrpRestrict===!0||d("WAWebTosGating").shouldBlockByTos(a.contact)||d("WAWebTosGating").shouldBlockByBotTos(a.contact)||d("WAWebTosCountryGating").shouldBlockByCountry(a.contact)||!d("WAWebBotGating").isBotEnabled()&&a.id.isBot()||!d("WAWebBotGating").isFbidBotEnabled()&&a.id.isFbidBot()||d("WAWebBizAiAgentGating").isAiAgentAutoReplyEnabled()&&d("WAWebBizAiAgentStatusUtils").shouldShowAiAgentBlockBar(a)){a.canSend=!1;return!1}else if(((b=(b=b)!=null?b:a.contact.businessProfile)==null?void 0:b.isBizBot3p)&&(!d("WAWebBotGating").isBizBot3pAvailable()||!d("WAWebBotTos").hasAcceptedBizBotTos())){a.canSend=!1;return!1}else if(d("WAWebChatGetters").getIsUser(a))return a.canSend=!(a.contact.isContactBlocked||d("WAWebChatGetters").getIsPSA(a)||d("WAWebChatGetters").getIsIAS(a));else if(d("WAWebChatGetters").getIsNewsletter(a))return a.canSend=d("WAWebNewsletterMembershipUtil").iAmAdminOrOwner(a.newsletterMetadata);a.canSend=!0;return!0}function C(a){return d("WAWebChatGetters").getIsGroup(a)&&d("WAWebGroupGatingUtils").isGroupExitExperienceEnabled()&&!n(a)&&!a.isReadOnly}g.isSupportGroup=l;g.isSupportGroupOrSupportAdmin=a;g.isTerminatedGroup=m;g.isCommunityAnnouncementGroup=n;g.isCommunityGeneralGroup=e;g.isSuspendedGroup=o;g.canSendToGroup=f;g.isInviteGrowthLockedGroup=p;g.isTerminatedGroupOrNotMember=q;g.isSuspendedCommunityAnnouncementGroup=r;g.isIntegrityDeactivatedCommunityAnnouncementGroup=s;g.shouldIncludeEntityIdInAppealRequest=t;g.isDeactivatedCommunityAnnouncementGroup=u;g.shouldBlockCall=v;g.updateReadOnly=w;g.getParticipantCount=x;g.getOneToOneContactFromGroupContact=y;g.getGroupParticipantsCount=z;g.updateTitle=A;g.updateCanSend=B;g.isGroupExitExperienceEnabledForChat=C}),98); __d("WAWebChatLinkMsgsCollection",["Promise","WAFilteredCatch","WALogger","WAPromiseLoop","WAWebBackendErrors","WAWebBaseCollection","WAWebMsgCollection","WAWebMsgLinks","WAWebMsgModel","WAWebNoop","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Failed to count medias for chat ",""]);i=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var c,e;for(var f=arguments.length,g=new Array(f),h=0;h<f;h++)g[h]=arguments[h];return(c=e=a.call.apply(a,[this].concat(g))||this,e.hasLinkBefore=!0,e.$ChatLinkMsgsCollection$p_1=null,e.count=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b;if(e.$ChatLinkMsgsCollection$p_1!=null)return e.$ChatLinkMsgsCollection$p_1;var c=a.msgs.filter(function(a){return d("WAWebMsgLinks").getLinksFromMsg(a).length>0});b=(b=c[0])!=null?b:a.msgs.head();if(b==null)return 0;try{b=(yield d("WAWebMsgCollection").MsgCollection.queryMedia(b.id.remote,Infinity,"before",b.id,"url"));b=(b=b.length)!=null?b:0;var f=b>0&&c.length>0?1:0;e.$ChatLinkMsgsCollection$p_1=b+c.length-f;return e.$ChatLinkMsgsCollection$p_1}catch(b){d("WALogger").ERROR(i(),a.id).verbose().devConsole(b).sendLogs("md-failed-medias-count: "+b.message);return null}});return function(b){return a.apply(this,arguments)}}(),c)||babelHelpers.assertThisInitialized(e)}var f=e.prototype;f["delete"]=function(){a.prototype["delete"].call(this),this.stopListening(),this.reset()};f.add=function(b,c){this.$ChatLinkMsgsCollection$p_1=null;return a.prototype.add.call(this,b,c)};f.remove=function(b,c){this.$ChatLinkMsgsCollection$p_1=null;return a.prototype.remove.call(this,b,c)};f.queryLinks=function(a,e){var f=this;if(e){if(this.queryLinkBefore)return this.queryLinkBefore;e=this.queryLinkBefore=d("WAWebMsgCollection").MsgCollection.queryMedia(e.id.remote,d("WAWebMsgCollection").MEDIA_QUERY_LIMIT,"before",e.id,"url").then(function(a){(!a||a.length<d("WAWebMsgCollection").MEDIA_QUERY_LIMIT)&&(f.hasLinkBefore=!1),f.add(a,{at:0}),f.createLinksAndAddMsgs(a)})["catch"](d("WAFilteredCatch").filteredCatch(d("WAWebBackendErrors").E404,c("WAWebNoop")))["finally"](function(){f.queryLinkBefore=null,f.trigger("query_link_before")});this.trigger("query_link_before");return e}e=a.msgs.getModelsArray();if(this.length===0){if(!e||e.length===0){this.hasLinkBefore=!1;return(h||(h=b("Promise"))).resolve()}this.add(e.filter(function(a){return d("WAWebMsgLinks").getLinksFromMsg(a).length>0}),{at:0});this.createLinksAndAddMsgs(e)}if(a.msgs.msgLoadState.noEarlierMsgs){this.hasLinkBefore=!1;return(h||(h=b("Promise"))).resolve()}else if(this.length<=2*d("WAWebMsgCollection").MEDIA_QUERY_LIMIT){e=this.length===0?a.msgs.head():this.head();return this.queryLinks(a,e)}return(h||(h=b("Promise"))).resolve()};f.createLinksAndAddMsgs=function(a){var b=this,c=[];d("WAPromiseLoop").promiseLoop(function(b,e,f){if(a.length===f){b();return}e=a[f];if(e!=null){b=d("WAWebMsgLinks").getLinksFromMsg(e);b.length&&c.push(e)}}).then(function(){b.add(c),b.trigger("query_link_before")})};return e}(d("WAWebBaseCollection").BaseCollection);a.model=d("WAWebMsgModel").Msg;a.comparator=function(a,b){return a.t-b.t};g["default"]=a}),98); __d("WAWebWamEnumWebcMessageQueryDirection",[],(function(a,b,c,d,e,f){a=Object.freeze({LOAD_PREV:0,LOAD_NEXT:1,LOAD_AROUND:2});f.WEBC_MESSAGE_QUERY_DIRECTION=a}),66); __d("WAWebWebcMessageQueryWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumWebcChatType","WAWebWamEnumWebcMessageQueryDirection","WAWebWamEnumWebcQueryTriggerType"],(function(a,b,c,d,e,f,g){b=(a=d("WAWebWamCodegenUtils")).defineEvents({WebcMessageQuery:[1876,{webcAudioMessageCount:[14,a.TYPES.INTEGER],webcBrowserNetworkType:[1,a.TYPES.STRING],webcBrowserStorageQuotaBytes:[20,a.TYPES.INTEGER],webcBrowserStorageQuotaUsedBytes:[21,a.TYPES.INTEGER],webcChatPosition:[2,a.TYPES.INTEGER],webcChatType:[13,d("WAWebWamEnumWebcChatType").WEBC_CHAT_TYPE],webcDocumentMessageCount:[16,a.TYPES.INTEGER],webcEarliestMessageIndex:[11,a.TYPES.INTEGER],webcEarliestMessageT:[12,a.TYPES.TIMER],webcMessageCount:[4,a.TYPES.INTEGER],webcMessageQueryTrigger:[19,d("WAWebWamEnumWebcQueryTriggerType").WEBC_QUERY_TRIGGER_TYPE],webcMessageQueryType:[3,d("WAWebWamEnumWebcMessageQueryDirection").WEBC_MESSAGE_QUERY_DIRECTION],webcOtherMessageCount:[18,a.TYPES.INTEGER],webcPhotoMessageCount:[7,a.TYPES.INTEGER],webcPttMessageCount:[15,a.TYPES.INTEGER],webcQueryT:[9,a.TYPES.TIMER],webcResponseBytes:[10,a.TYPES.INTEGER],webcStickerMessageCount:[17,a.TYPES.INTEGER],webcTextMessageCount:[5,a.TYPES.INTEGER],webcVideoMessageCount:[6,a.TYPES.INTEGER]},[1,1,5],"regular"]},{WebcMessageQuery:[]});g.WebcMessageQueryWamEvent=b}),98); __d("WAWebMsgCountReporter",["WAWebMsgType","WAWebWebcMessageQueryWamEvent"],(function(a,b,c,d,e,f,g){function a(a){return new(d("WAWebWebcMessageQueryWamEvent").WebcMessageQueryWamEvent)({webcResponseBytes:0,webcMessageCount:0,webcTextMessageCount:0,webcVideoMessageCount:0,webcPhotoMessageCount:0,webcAudioMessageCount:0,webcPttMessageCount:0,webcStickerMessageCount:0,webcDocumentMessageCount:0,webcOtherMessageCount:0,webcMessageQueryTrigger:a})}function b(a,b){a.webcMessageCount+=b.length;for(var c=0,e=b[c];c<b.length;++c,e=b[c])switch(e.type){case d("WAWebMsgType").MSG_TYPE.CHAT:case d("WAWebMsgType").MSG_TYPE.LOCATION:case d("WAWebMsgType").MSG_TYPE.PAYMENT:case d("WAWebMsgType").MSG_TYPE.VCARD:case d("WAWebMsgType").MSG_TYPE.CIPHERTEXT:case d("WAWebMsgType").MSG_TYPE.MULTI_VCARD:case d("WAWebMsgType").MSG_TYPE.REVOKED:case d("WAWebMsgType").MSG_TYPE.OVERSIZED:a.webcTextMessageCount+=1;break;case d("WAWebMsgType").MSG_TYPE.IMAGE:case d("WAWebMsgType").MSG_TYPE.PRODUCT:a.webcPhotoMessageCount+=1;break;case d("WAWebMsgType").MSG_TYPE.VIDEO:a.webcVideoMessageCount+=1;break;case d("WAWebMsgType").MSG_TYPE.AUDIO:a.webcAudioMessageCount+=1;break;case d("WAWebMsgType").MSG_TYPE.PTT:a.webcPttMessageCount+=1;break;case d("WAWebMsgType").MSG_TYPE.STICKER:a.webcStickerMessageCount+=1;break;case d("WAWebMsgType").MSG_TYPE.DOCUMENT:a.webcDocumentMessageCount+=1;break;default:a.webcOtherMessageCount+=1;break}}g.newMessageQueryEvent=a;g.logMessageCounts=b}),98); __d("WAWebChatLoadMessages",["Promise","WAAbortError","WABackoffUtils","WAFilteredCatch","WALogger","WANullthrows","WAPromiseDelays","WAPromiseLoop","WARaceSignal","WAStorageEstimator","WAWebBackendErrors","WAWebChatConstants","WAWebChatGetters","WAWebCollectionConstants","WAWebGetNewsletterCursor","WAWebMiscErrors","WAWebMsgCollection","WAWebMsgCountReporter","WAWebNetworkType","WAWebNewsletterGatingUtils","WAWebNewsletterGetMessageUpdatesAction","WAWebNewsletterPullMessagesFromServerAction","WAWebNewsletterSystemMessages","WAWebStateUtils","WAWebSyncGatingUtils","WAWebWamEnumWebcMessageQueryDirection","WAWebWamEnumWebcQueryTriggerType","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["chat:loadMsgs:error ",""]);i=function(){return a};return a}function a(a,b,c){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e){a=d("WAWebStateUtils").unproxy(a);c=c;c||(c=a.msgs);if(l(a,c))return(h||(h=b("Promise"))).resolve();if(c.msgLoadState.isLoadingRecentMsgs)return c.loadRecentPromise;a=(yield m(a,"after",c,d("WAWebWamEnumWebcQueryTriggerType").WEBC_QUERY_TRIGGER_TYPE.USER_SCROLL,e));c=a.msgs;return c});return j.apply(this,arguments)}function e(a,b,c,d){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e,f){a=d("WAWebStateUtils").unproxy(a);yield a.waitForChatLoading();var g=c;c=e!=null?e:d("WAWebWamEnumWebcQueryTriggerType").WEBC_QUERY_TRIGGER_TYPE.USER_SCROLL;g||(g=a.msgs);if(g.msgLoadState.noEarlierMsgs)return(h||(h=b("Promise"))).resolve();if(g.msgLoadState.isLoadingEarlierMsgs)return g.loadEarlierPromise;var i=g?g.head():null;if(d("WAWebChatGetters").getIsNewsletter(a)&&i!=null&&d("WAWebNewsletterSystemMessages").isEarliestNewsletterSystemMsg(i)){g.msgLoadState.noEarlierMsgs=!0;return[]}e=function(){return i?i.msgChunk:g};c=(yield m(a,"before",g,c,f));f=c.msgs;c=c.hasMoreMsgs;e=e();e&&!c&&(e.msgLoadState.noEarlierMsgs=a.endOfHistoryTransferType!==d("WAWebChatConstants").ConversationEndOfHistoryTransferModelPropType.INCOMPLETE,d("WAWebSyncGatingUtils").isHistorySyncOnDemandEnabled()&&(e.msgLoadState.noEarlierMsgs=e.msgLoadState.noEarlierMsgs&&a.endOfHistoryTransferType!==d("WAWebChatConstants").ConversationEndOfHistoryTransferModelPropType.COMPLETE_BUT_MORE_MESSAGES_REMAIN_ON_PRIMARY));return f});return k.apply(this,arguments)}function l(a,b){return a.msgs===b}function m(a,b,c,d,e){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e,f){var g;b==="after"?g=c.last():g=c.head();var h={};g?h=g.id.clone():h.remote=a.id;h.count=d("WAWebCollectionConstants").PAGE_SIZE;h.direction=b;e=d("WAWebMsgCountReporter").newMessageQueryEvent(e);g=(yield o(a,g,c,d("WAWebMsgCollection").MsgCollection.findQuery.bind(d("WAWebMsgCollection").MsgCollection,h),b,e,!0,f));d("WAWebChatGetters").getIsNewsletter(a)&&d("WAWebNewsletterGatingUtils").isNewsletterReactionEnabled()&&(yield d("WAWebNewsletterGetMessageUpdatesAction").maybeUpdateMsgsAddOns(g,a));h=g.length>=d("WAWebCollectionConstants").PAGE_SIZE;if(h||!d("WAWebChatGetters").getIsNewsletter(a)||!d("WAWebNewsletterGatingUtils").isNewsletterEnabled())return{msgs:g,hasMoreMsgs:h};try{e=g[0];if(b==="before"&&e!=null&&d("WAWebNewsletterSystemMessages").isNewsletterSystemMsg(e))return{msgs:g,hasMoreMsgs:!1};f=g.length>d("WAWebCollectionConstants").PAGE_SIZE;h=f?[]:yield d("WAWebNewsletterPullMessagesFromServerAction").pullNewsletterMessagesFromServer(a,{messageCount:d("WAWebCollectionConstants").PAGE_SIZE-g.length,cursor:d("WAWebGetNewsletterCursor").getNewsletterCursor(c,b,g),resetUnreadCount:!0});e=b==="before"?h.concat(g):g.concat(h);f=e.length>=d("WAWebCollectionConstants").PAGE_SIZE;c=e[0];if(b==="before"&&!f&&(c==null||!d("WAWebNewsletterSystemMessages").isNewsletterSystemMsg(c))){h=(yield d("WAWebNewsletterSystemMessages").addSystemMessagesToChat(a));e.unshift.apply(e,h)}return{msgs:e,hasMoreMsgs:f}}catch(a){return{msgs:g,hasMoreMsgs:!0}}});return n.apply(this,arguments)}function o(a,e,f,g,j,k,l,m){l===void 0&&(l=!0);var n=d("WAWebStateUtils").unproxy(a),o=self.performance.now();j==="after"?(f.msgLoadState.isLoadingRecentMsgs=!0,k.webcMessageQueryType=d("WAWebWamEnumWebcMessageQueryDirection").WEBC_MESSAGE_QUERY_DIRECTION.LOAD_NEXT):j==="before"?(f.msgLoadState.isLoadingEarlierMsgs=!0,k.webcMessageQueryType=d("WAWebWamEnumWebcMessageQueryDirection").WEBC_MESSAGE_QUERY_DIRECTION.LOAD_PREV):j==="around"&&(f.msgLoadState.isLoadingAroundMsgs=!0,k.webcMessageQueryType=d("WAWebWamEnumWebcMessageQueryDirection").WEBC_MESSAGE_QUERY_DIRECTION.LOAD_AROUND);k.webcBrowserNetworkType=d("WAWebNetworkType").getEffectiveNetworkType();k.webcChatType=n.getWebcChatType();typeof n.initialIndex==="number"&&(k.webcChatPosition=n.initialIndex);a=c("WARaceSignal")([m,n.getDeleteSignal()].filter(Boolean),function(a){return d("WAPromiseLoop").promiseLoop(function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(c,l,m){if(a.aborted)throw new(d("WAAbortError").AbortError)();l=d("WAPromiseDelays").delayMs(d("WABackoffUtils").expBackoff(m,12e4,1e3,.1));var q=(h||(h=b("Promise"))).resolve();try{yield q;q=(yield g());if(a.aborted)throw new(d("WAAbortError").AbortError)();k.webcQueryT=Math.ceil(self.performance.now()-o);var r;Array.isArray(q[0])?(r=q[0][0],q.forEach(function(a){return d("WAWebMsgCountReporter").logMessageCounts(k,a)})):(r=q[0],d("WAWebMsgCountReporter").logMessageCounts(k,q));r&&(k.webcEarliestMessageT=r.t,r.msgChunk===n.msgs&&(k.webcEarliestMessageIndex=n.msgs.length-1));d("WAStorageEstimator").estimateStorage().then(function(a){if(a.success){a=a.value;var b=a.quota;a=a.usage;k.webcBrowserStorageQuotaBytes=b;k.webcBrowserStorageQuotaUsedBytes=a}})["finally"](function(){return k.commit()});p(e,f,j);c(q)}catch(a){if(a.name===d("WAAbortError").ABORT_ERROR)throw a;if(m>3||a===404){p(e,f,j);d("WALogger").WARN(i(),String(a));return a===404?(h||(h=b("Promise"))).reject(new(d("WAWebBackendErrors").E404)()):(h||(h=b("Promise"))).reject(new(d("WAWebMiscErrors").GaveUpRetry)("Gave up msg fetch after "+m+" tries"))}return l}});return function(a,b,d){return c.apply(this,arguments)}}(),0)})["catch"](d("WAFilteredCatch").filteredCatch(d("WAWebMiscErrors").GaveUpRetry,function(){return[]}))["catch"](d("WAFilteredCatch").filteredCatch(d("WAWebBackendErrors").E404,function(a){if(l)return[];throw a}));j==="after"?f.loadRecentPromise=a:j==="before"?f.loadEarlierPromise=a:j==="around"&&(f.loadAroundPromise=a);return a}function p(a,b,d){var e=(a==null?void 0:a.msgChunk)&&a.msgChunk!==b;b.msgLoadState.contextLoaded=!0;a&&e&&(c("WANullthrows")(a.msgChunk).msgLoadState.contextLoaded=!0);d==="after"?b.msgLoadState.isLoadingRecentMsgs=!1:d==="before"?b.msgLoadState.isLoadingEarlierMsgs=!1:d==="around"&&(b.msgLoadState.isLoadingAroundMsgs=!1)}g.loadRecentMsgs=a;g.loadEarlierMsgs=e;g.loadMsgsPromiseLoop=o}),98); __d("WAWebChatMedia",["Promise","WAWebCarouselMsgUtils","WAWebChatMediaMsgsCollection","WAWebFrontendMsgGetters","WAWebMessageAssociationUIUtils","WAWebMsgGetters","WAWebMsgLinks","WAWebStateUtils"],(function(a,b,c,d,e,f,g){var h;function a(a){a=d("WAWebStateUtils").unproxy(a);var b=a.mediaMsgs,c=a.linkMsgs,e=a.docMsgs,f=a.productMsgs;b&&(b["delete"](),b.queryMedia({chat:a}));c&&(c["delete"](),c.queryLinks(a));e&&(e["delete"](),e.queryDocs(a));f&&(f["delete"](),f.queryProducts(a))}function i(a){return d("WAWebMsgGetters").getIsMedia(a)&&!a.isViewOnce}function e(a,b,c){if(!b)return;a=d("WAWebStateUtils").unproxy(a);b=d("WAWebCarouselMsgUtils").flattenMsgs(Array.isArray(b)?b:[b]);var e=[],f=[],g=[],h=[];b.forEach(function(a){i(a)&&e.push(a),d("WAWebFrontendMsgGetters").getAsDoc(a)&&g.push(a),d("WAWebMsgLinks").getGalleryLinks(a).some(function(b){return b.href!==a.matchedText})&&f.push(a),d("WAWebFrontendMsgGetters").getAsProduct(a)!=null&&h.push(a)});b=a.mediaMsgs;if(b&&e.length){var j=babelHelpers["extends"]({},c,{silent:!1});b.add(e,j)}a.linkMsgs&&f.length&&a.linkMsgs.add(f,c);a.docMsgs&&g.length&&a.docMsgs.add(g,c);a.productMsgs&&h.length&&a.productMsgs.add(h,c)}function f(a,b){a=d("WAWebStateUtils").unproxy(a);var e=new(c("WAWebChatMediaMsgsCollection"))(),f=a.getMediaMsgs().filter(d("WAWebMessageAssociationUIUtils").shouldDisplayOrphanMessage);b||e.add(f);if(!b||b.isViewOnce)return e;(f.includes(b)||b.msgChunk===a.msgs)&&(e.add(f),e.hasMediaAfter=!1);if(!f.includes(b)){a=b.msgChunk!=null?b.msgChunk.slice():[b];f=a.filter(d("WAWebMessageAssociationUIUtils").shouldDisplayOrphanMessage);b=d("WAWebCarouselMsgUtils").flattenMsgs(f);e.add(b.filter(i))}return e}function j(a){var c=d("WAWebStateUtils").unproxy(a);return c.promises.sendDelete!=null?(h||(h=b("Promise"))).resolve(0):(h||(h=b("Promise"))).all([c.getMediaMsgs(),c.getLinkMsgs(),c.getDocMsgs()].map(function(a){return a.count(c)})).then(function(a){return a.reduce(function(a,b){return a+((a=b)!=null?a:0)},0)})}g.resetMediaMsgs=a;g.addMediaMsgs=e;g.constructMediaMsgs=f;g.countAllMedia=j}),98); __d("WAWebChatMediaMsgsCollection",["Promise","WAFilteredCatch","WALogger","WAWebBackendErrors","WAWebBaseCollection","WAWebCarouselMsgUtils","WAWebMessageAssociationUIUtils","WAWebMsgCollection","WAWebMsgGetters","WAWebMsgModel","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Failed to count medias for chat ",""]);i=function(){return a};return a}var j={before:"before",after:"after"};function k(a){return d("WAWebMsgGetters").getIsMedia(a)&&!a.isViewOnce&&d("WAWebMessageAssociationUIUtils").shouldDisplayOrphanMessage(a)}a=function(a){babelHelpers.inheritsLoose(c,a);function c(){var c,e;for(var f=arguments.length,g=new Array(f),h=0;h<f;h++)g[h]=arguments[h];return(c=e=a.call.apply(a,[this].concat(g))||this,e.hasMediaBefore=!0,e.hasMediaAfter=!0,e.$ChatMediaMsgsCollection$p_1=null,e.count=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b;if(e.$ChatMediaMsgsCollection$p_1!=null)return e.$ChatMediaMsgsCollection$p_1;var c=a.msgs.filter(k);b=(b=c[0])!=null?b:a.msgs.head();if(b==null)return 0;try{b=(yield d("WAWebMsgCollection").MsgCollection.queryMedia(b.id.remote,Infinity,"before",b.id));b=(b=b.mediaCount)!=null?b:0;var f=b>0&&c.length>0?1:0;e.$ChatMediaMsgsCollection$p_1=b+c.length-f;return e.$ChatMediaMsgsCollection$p_1}catch(b){d("WALogger").ERROR(i(),a.id).verbose().devConsole(b).sendLogs("md-failed-medias-count: "+b.message);return null}});return function(b){return a.apply(this,arguments)}}(),c)||babelHelpers.assertThisInitialized(e)}var e=c.prototype;e["delete"]=function(){a.prototype["delete"].call(this),this.stopListening()};e.add=function(b,c){this.$ChatMediaMsgsCollection$p_1=null;return a.prototype.add.call(this,b,c)};e.remove=function(b,c){this.$ChatMediaMsgsCollection$p_1=null;return a.prototype.remove.call(this,b,c)};e.getAfter=function(a){a=this.indexOf(a);return a<0||a===this.length-1?null:this.at(a+1)};e.getBefore=function(a){a=this.indexOf(a);return a<=0?null:this.at(a-1)};e.loadEarlierMedias=function(){var a=this.head();if(!a)return;if(a.isCarouselCard){var b;a=(b=d("WAWebCarouselMsgUtils").getParentMsgFromCarouselCard(a))!=null?b:a}this.queryMedia({msg:a})};e.loadRecentMedias=function(){var a=this.last();if(!a)return;if(a.isCarouselCard){var b;a=(b=d("WAWebCarouselMsgUtils").getParentMsgFromCarouselCard(a))!=null?b:a}this.queryMedia({msg:a,direction:j.after})};e.loadMoreAroundIfNeeded=function(a){if(!a||a.isViewOnce)return;a=this.indexOf(a);a<20&&this.hasMediaBefore&&this.loadEarlierMedias();this.length-a<20&&this.hasMediaAfter&&this.loadRecentMedias()};e.queryMedia=function(a){var c=this,e=a.chat,f=a.msg;a=(a=a.direction)!=null?a:j.before;if(!f&&e){var g=e.msgs;if(!g||g.length===0){this.hasMediaBefore=!1;return new(h||(h=b("Promise")))(function(a){a({eof:!0})})}this.add(g.filter(k),{at:0});var i=this.toArray();if(e.msgs.msgLoadState.noEarlierMsgs){this.hasMediaBefore=!1;return new(h||(h=b("Promise")))(function(a){a({eof:!0})})}else if(i.length<=2*d("WAWebMsgCollection").MEDIA_QUERY_LIMIT){g=i.length===0?g.head():i[0];return this.queryMedia({chat:e,msg:g})}return new(h||(h=b("Promise")))(function(a){a({eof:!1})})}if(f&&a===j.before){if(this.queryMediaBefore)return this.queryMediaBefore;var m=0;this.queryMediaBefore=d("WAWebMsgCollection").MsgCollection.queryMedia(f.id.remote,d("WAWebMsgCollection").MEDIA_QUERY_LIMIT,a,d("WAWebMsgGetters").getIsMedia(f)?f.id:void 0).then(function(b){b=b.messages;(!b||b.length<d("WAWebMsgCollection").MEDIA_QUERY_LIMIT)&&(c.hasMediaBefore=!1);var a=[];b&&b.length>0&&(a=l(b));c.add(a,{at:0});m=a.length;return{length:m}})["catch"](d("WAFilteredCatch").filteredCatch(d("WAWebBackendErrors").E404,function(){return void 0}))["finally"](function(){c.queryMediaBefore=null,c.trigger("query_media_before",m)});this.trigger("query_media_before",0);return this.queryMediaBefore}else if(f&&a===j.after)return this.queryMediaAfter?this.queryMediaAfter:this.queryMediaAfter=d("WAWebMsgCollection").MsgCollection.queryMedia(f.id.remote,d("WAWebMsgCollection").MEDIA_QUERY_LIMIT,a,f.id).then(function(b){b=b.messages;(!b||b.length<d("WAWebMsgCollection").MEDIA_QUERY_LIMIT)&&(c.hasMediaAfter=!1);var a=[];b&&b.length>0&&(a=l(b));c.add(a);return{length:a.length}})["catch"](d("WAFilteredCatch").filteredCatch(d("WAWebBackendErrors").E404,function(){return void 0}))["finally"](function(){c.queryMediaAfter=null,c.trigger("query_media_after")})};return c}(d("WAWebBaseCollection").BaseCollection);a.model=d("WAWebMsgModel").Msg;a.comparator=function(a,b){return a.t-b.t};function l(a){return d("WAWebCarouselMsgUtils").flattenMsgs(a).filter(k)}g["default"]=a}),98); __d("WAWebChatSearchFilters",["$InternalEnum"],(function(a,b,c,d,e,f){var g=b("$InternalEnum")({UNREAD:"unread",FAVORITES:"favorites",GROUP:"group",BROADCAST:"broadcast",CONTACT:"contact",NON_CONTACT:"non_contact",ASSIGNED_TO_YOU:"assigned_to_you",PERSONAL:"personal",BUSINESS:"business",LABELS:"labels"});a=function(a){switch(a){case g.UNREAD:case g.ASSIGNED_TO_YOU:case g.CONTACT:case g.GROUP:case g.LABELS:case g.FAVORITES:return!0;case g.BROADCAST:case g.NON_CONTACT:case g.BUSINESS:case g.PERSONAL:return!1}};c=function(a){switch(a){case g.UNREAD:case g.ASSIGNED_TO_YOU:return!0;case g.BROADCAST:case g.NON_CONTACT:case g.BUSINESS:case g.PERSONAL:case g.CONTACT:case g.GROUP:case g.LABELS:case g.FAVORITES:return!1}};f.SearchFilters=g;f.isFilterExcludedFromSearchTreatmentInInboxFlow=a;f.isFilterExcludedFromSearchTreatmentInNormalFlow=c}),66); __d("WAWebChatMessageSearch",["WANullthrows","WAWebChatAssignmentUtils","WAWebChatConstants","WAWebChatGetters","WAWebChatLoadMessages","WAWebChatMsgsCollection","WAWebChatSearchFilters","WAWebCollectionConstants","WAWebContactGetters","WAWebFrontendChatGetters","WAWebMessageAssociation.flow","WAWebMsgCollection","WAWebMsgCountReporter","WAWebStateUtils","WAWebViewMode.flow","WAWebViewModeUtils","WAWebWamEnumWebcQueryTriggerType","isEmptyObject"],(function(a,b,c,d,e,f,g){function a(a,b,e){var f=d("WAWebStateUtils").unproxy(a),g=d("WAWebMsgCollection").MsgCollection.get(b),h=b,i=e;b=(a=g)==null?void 0:a.parentMsgKey;b&&((e=g)==null?void 0:e.associationType)===d("WAWebMessageAssociation.flow").MessageAssociationType.MEDIA_ALBUM&&!d("WAWebViewModeUtils").isViewModeVisibleInSurface(d("WAWebViewMode.flow").ViewModeSurface.CHAT,(a=g)==null?void 0:a.viewMode)&&(g=d("WAWebMsgCollection").MsgCollection.get(b),h=b,i=g);var j=g?g.msgChunk:void 0,k=Math.trunc(d("WAWebCollectionConstants").PAGE_SIZE/3*2);if(!j||!j.msgLoadState.contextLoaded){j||(j=new(d("WAWebChatMsgsCollection").ChatMsgsCollection)(),f.msgChunks.push(j),g&&j.add(g));e=g?g.id.clone():h.clone();e.count=k;e.serverId=(a=g)==null?void 0:a.serverId;var l=function(){if(g)return g.msgChunk;if(h!=null){var a=d("WAWebMsgCollection").MsgCollection.get(h);return(a==null?void 0:a.msgChunk)?a.msgChunk:j}return j};b=d("WAWebMsgCountReporter").newMessageQueryEvent(d("WAWebWamEnumWebcQueryTriggerType").WEBC_QUERY_TRIGGER_TYPE.SEARCH_RESULT_CLICK);d("WAWebChatLoadMessages").loadMsgsPromiseLoop(f,g,j,d("WAWebMsgCollection").MsgCollection.getContext.bind(d("WAWebMsgCollection").MsgCollection,e,l),"around",b,i==null).then(function(a){var b=l();b&&j&&b!==j&&f.notifyMsgCollectionMerge(b,j,b);b=a[0];a=h?d("WAWebMsgCollection").MsgCollection.get(h):g;a&&Array.isArray(b)&&b.length<k&&(c("WANullthrows")(a.msgChunk).msgLoadState.noEarlierMsgs=f.endOfHistoryTransferType!==d("WAWebChatConstants").ConversationEndOfHistoryTransferModelPropType.INCOMPLETE,j&&a.msgChunk!==j&&(j.msgLoadState.noEarlierMsgs=f.endOfHistoryTransferType!==d("WAWebChatConstants").ConversationEndOfHistoryTransferModelPropType.INCOMPLETE))})["catch"](function(){i&&(i.isQuotedMsgAvailable=!1)})}return{collection:j,msg:g,key:h,highlightMsg:!0}}function b(a,b,c,e){c===void 0&&(c=1);var f=d("WAWebStateUtils").unproxy(a);if(c===1){a=f.ftsCache[b];if(a)return a;a=d("WAWebMsgCollection").MsgCollection.search(b,c,e,f.id);f.ftsCache[b]=a;var g=function(){f.ftsCache[b]=null};self.setTimeout(g,d("WAWebChatConstants").FTS_TTL);a["catch"](g);return a}return d("WAWebMsgCollection").MsgCollection.search(b,c,e,f.id)}function e(a){a=d("WAWebStateUtils").unproxy(a);a.ftsCache={}}function h(a){return!!d("WAWebChatGetters").getHasUnread(a)&&!d("WAWebChatGetters").getIsBroadcast(a)||d("WAWebChatAssignmentUtils").canAssignChats()&&a.isAssignedToMe&&a.unopenedByAssignedAgent}function f(a,b){b===void 0&&(b={});a=d("WAWebStateUtils").unproxy(a);if(c("isEmptyObject")(b))return!0;if(b.label)return a.labels!=null&&a.labels.includes(b.label);if(b.kind===d("WAWebChatSearchFilters").SearchFilters.UNREAD)return h(a);if(b.kind===d("WAWebChatSearchFilters").SearchFilters.FAVORITES)return a.isFavorite;if(b.kind===d("WAWebChatSearchFilters").SearchFilters.CONTACT)return d("WAWebContactGetters").getIsMyContact(a.contact)&&!d("WAWebContactGetters").getIsGroup(a.contact)&&!d("WAWebChatGetters").getIsBroadcast(a);if(b.kind===d("WAWebChatSearchFilters").SearchFilters.NON_CONTACT)return!d("WAWebContactGetters").getIsMyContact(a.contact)&&!d("WAWebContactGetters").getIsGroup(a.contact)&&!d("WAWebChatGetters").getIsBroadcast(a);if(b.kind===d("WAWebChatSearchFilters").SearchFilters.ASSIGNED_TO_YOU)return d("WAWebChatAssignmentUtils").canAssignChats()&&a.isAssignedToMe;a=d("WAWebFrontendChatGetters").getKind(a);return a!=null&&b.kind===d("WAWebChatSearchFilters").SearchFilters.cast(a)}g.getSearchContext=a;g.fts=b;g.clearFtsCache=e;g.matchFilter=f}),98); __d("WAWebChatParticipantColor",["WALogger","WAMd5","WAWebContactGetters","WAWebLidMigrationUtils","WAWebStateUtils","WAWebUserPrefsGeneral","lodash"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["received a null sender wid when getting assigned color"]);h=function(){return a};return a}function i(a){var b;a=d("WAWebStateUtils").unproxy(a);if(!a.colors)return;b=(b=(b=a.groupMetadata)==null?void 0:b.participants)!=null?b:[];var e=a.colors;b=c("lodash").difference(Object.keys(e),b.map(function(a){return a.id.toString()}).map(c("WAMd5")));b.forEach(function(a){delete e[a]});b.length&&a.saveAssignedColorsDebounced()}function j(a){a=d("WAWebStateUtils").unproxy(a);a.groupMetadata&&a.listenTo(a.groupMetadata.participants,"remove reset",i);return d("WAWebUserPrefsGeneral").getGroupParticipantAssignedColor(a.id)}function k(a){if(a.isUser()){var b;return(b=d("WAWebLidMigrationUtils").toLid(a))!=null?b:a}return a}function a(a){a=d("WAWebStateUtils").unproxy(a);var b=a.colors;b&&d("WAWebUserPrefsGeneral").setGroupParticipantAssignedColor(a.id,b)}function b(a,b){a=d("WAWebStateUtils").unproxy(a);if(d("WAWebContactGetters").getIsNewsletter(a))return 1;if(b==null){d("WALogger").WARN(h()).tags("messaging").devConsole(a).sendLogs("unexpected null sender wid for getting assigned color");return 1}var e=a.colors||(a.colors=j(a)),f;b=c("WAMd5")(k(b).toString());if(f=e[b])return f;var g={};c("lodash").forOwn(e,function(a,b){g[a]?g[a].push(b):g[a]=[b]});var i=Number.POSITIVE_INFINITY,l=17;for(var m=1;m<=l;m++)if(!g[m]){f=m;break}else g[m].length<i&&(i=g[m].length,f=m);e[b]=f;a.saveAssignedColorsDebounced();return f}g.saveAssignedColors=a;g.getAssignedColor=b}),98); __d("WAWebEphemeralKeepInChatAbpropUtils",["WAWebABProps","WAWebRevokeMsgConstants"],(function(a,b,c,d,e,f,g){function a(){return d("WAWebABProps").getABPropConfigValue("keep_in_chat_undo_duration_limit")||d("WAWebRevokeMsgConstants").REVOKE_WINDOW}function b(){return d("WAWebABProps").getABPropConfigValue("supports_keep_in_chat_in_cag")}g.getUndoKeepInChatExpiration=a;g.isKeepInChatInCAGEnabled=b}),98); __d("WAWebChatModel",["fbt","Promise","WAAbortError","WAFilteredCatch","WAInOrderPromiseQueue","WALogger","WANullthrows","WATimeUtils","WAWebABProps","WAWebAck","WAWebAlarm","WAWebBackendErrors","WAWebBaseModel","WAWebBizAiAgentGating","WAWebBizGatingUtils","WAWebBizLabelUtils","WAWebBotGating","WAWebBotProfileCollection","WAWebChatAssignmentCollection","WAWebChatCollection","WAWebChatConstants","WAWebChatDocMsgsCollection","WAWebChatEphemerality","WAWebChatFlowTypes","WAWebChatGetters","WAWebChatGroupUtils","WAWebChatLinkMsgsCollection","WAWebChatLoadMessages","WAWebChatMedia","WAWebChatMediaMsgsCollection","WAWebChatMessageSearch","WAWebChatModelDerivedMethods","WAWebChatParticipantColor","WAWebChatProductMsgsCollection","WAWebChatUpdates","WAWebCmd","WAWebConnModel","WAWebConstantsDeprecated","WAWebContactCollection","WAWebContactGetters","WAWebDBEphemeralMessage","WAWebDBUpdateChatTable","WAWebDBUpdateContactTable","WAWebEphemeralKeepInChatAbpropUtils","WAWebEventMsgsCollection","WAWebEventsWaitForBbEvent","WAWebFavoriteCollection","WAWebFrontendChatGetters","WAWebFrontendMsgGetters","WAWebGroupMetadataCollection","WAWebGroupSafetyCheckUtils","WAWebGroupType","WAWebGroupUnreadMessageType","WAWebHandleNewMsgAction","WAWebKeptMsgCollection","WAWebL10N","WAWebLimitSharingModelUtils","WAWebListsGatingUtils","WAWebMedia","WAWebMsgDataFromModel","WAWebMsgGetters","WAWebMsgLinks","WAWebMsgModelUtils","WAWebMuteCollection","WAWebNewsletterCollection","WAWebNewsletterMetadataCollection","WAWebNoop","WAWebNotificationBackend","WAWebOTPLoggingHelper","WAWebPersistedJobDefinitions","WAWebPersistedJobManager","WAWebPresenceChatAction","WAWebPresenceCollection","WAWebProtobufsE2E.pb","WAWebQuotedMsgModelUtils","WAWebSendSpamChatAction","WAWebStarredMsgCollection","WAWebSuperChatMsgs","WAWebTos","WAWebTosGating","WAWebTrustedContactsUtils","WAWebUnreadMentionModel","WAWebUpdateDraftMessageChatAction","WAWebUpdateLastAddOnPreviewChatAction","WAWebUserPrefsMeUser","WAWebViewOnceState","WAWebWamEnumChatAssignmentChatType","WAWebWamEnumWebcChatType","WAWebWid","asyncToGeneratorRuntime","isStringNullOrEmpty","lodash"],(function(a,b,c,d,e,f,g,h){var i;function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["chat:_updateIsAnnounceGrpRestrict:old ",", new: ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[Maiba] Aborted notification ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["chat:onEmptyMRM failed\n",""],["chat:onEmptyMRM failed\\n",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["models:Chat:removeMsg 0 messages left, querying..."]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["chat:preload failed\n",""],["chat:preload failed\\n",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["chat:onPendingActionUpdate pendingAction value is invalid"]);o=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.accountLid=d("WAWebBaseModel").prop(),c.t=d("WAWebBaseModel").prop(),c.unreadCount=d("WAWebBaseModel").prop(0),c.unreadDividerOffset=d("WAWebBaseModel").prop(0),c.archive=d("WAWebBaseModel").prop(),c.isReadOnly=d("WAWebBaseModel").prop(),c.isLocked=d("WAWebBaseModel").prop(),c.isAnnounceGrpRestrict=d("WAWebBaseModel").prop(),c.modifyTag=d("WAWebBaseModel").prop(),c.muteExpiration=d("WAWebBaseModel").prop(0),c.isAutoMuted=d("WAWebBaseModel").prop(!1),c.wallpaper=d("WAWebBaseModel").prop(),c.showDoodle=d("WAWebBaseModel").prop(),c.name=d("WAWebBaseModel").prop(),c.notSpam=d("WAWebBaseModel").prop(),c.pin=d("WAWebBaseModel").prop(),c.changeNumberOldJid=d("WAWebBaseModel").prop(),c.changeNumberNewJid=d("WAWebBaseModel").prop(),c.lastReceivedKey=d("WAWebBaseModel").prop(),c.capiThreadControl=d("WAWebBaseModel").prop(),c.ephemeralDuration=d("WAWebBaseModel").prop(),c.ephemeralSettingTimestamp=d("WAWebBaseModel").prop(),c.disappearingModeInitiator=d("WAWebBaseModel").prop(),c.disappearingModeTrigger=d("WAWebBaseModel").prop(),c.disappearingModeInitiatedByMe=d("WAWebBaseModel").prop(),c.createdLocally=d("WAWebBaseModel").prop(),c.pendingAction=d("WAWebBaseModel").session(),c.formattedTitle=d("WAWebBaseModel").session(),c.active=d("WAWebBaseModel").session(),c.pausedTimerId=d("WAWebBaseModel").session(),c.presenceResendTimerId=d("WAWebBaseModel").session(),c.recording=d("WAWebBaseModel").session(),c.typing=d("WAWebBaseModel").session(),c.colors=d("WAWebBaseModel").session(),c.attachMediaContents=d("WAWebBaseModel").session(),c.draftAttachMediaContentsSortTs=d("WAWebBaseModel").session(),c.isComposingPoll=d("WAWebBaseModel").session(!1),c.pttRecordingSession=d("WAWebBaseModel").session(),c.squelch=d("WAWebBaseModel").session(),c.reactionSquelch=d("WAWebBaseModel").session(),c.pendingSeenCount=d("WAWebBaseModel").session(0),c.markedUnread=d("WAWebBaseModel").session(),c.trusted=d("WAWebBaseModel").session(),c.groupSafetyChecked=d("WAWebBaseModel").session(),c.canSend=d("WAWebBaseModel").session(),c.showUnreadInTitle=d("WAWebBaseModel").session(!1),c.activeUnreadCount=d("WAWebBaseModel").session(),c.isFavorite=d("WAWebBaseModel").session(!1),c.promises=d("WAWebBaseModel").session(function(){return{}}),c.ftsCache=d("WAWebBaseModel").session(function(){return{}}),c.composeQuotedMsg=d("WAWebBaseModel").session(),c.composeQuotedMsgRemoteJid=d("WAWebBaseModel").session(),c.quotedMsgAdminGroupJid=d("WAWebBaseModel").session(),c.quotedMsgAdminGroupSubject=d("WAWebBaseModel").session(),c.quotedMsgAdminParentGroupJid=d("WAWebBaseModel").session(),c.groupMetadata=d("WAWebBaseModel").session(),c.newsletterMetadata=d("WAWebBaseModel").session(),c.presence=d("WAWebBaseModel").session(),c.mute=d("WAWebBaseModel").session(),c.contact=d("WAWebBaseModel").session(),c.mediaCount=d("WAWebBaseModel").session(0),c.linkCount=d("WAWebBaseModel").session(0),c.docCount=d("WAWebBaseModel").session(0),c.productCount=d("WAWebBaseModel").session(0),c.pendingDeleteForMeCount=d("WAWebBaseModel").session(0),c.isParentGroup=d("WAWebBaseModel").session(),c.groupType=d("WAWebBaseModel").session(),c.hasCapi=d("WAWebBaseModel").session(),c.unreadMentionsOfMe=d("WAWebBaseModel").prop(),c.unreadMentionCount=d("WAWebBaseModel").prop(),c.hasUnreadMention=d("WAWebBaseModel").prop(!1),c.archiveAtMentionViewedInDrawer=d("WAWebBaseModel").prop(!1),c.hasChatBeenOpened=d("WAWebBaseModel").prop(!1),c.tcToken=d("WAWebBaseModel").prop(),c.tcTokenTimestamp=d("WAWebBaseModel").prop(),c.tcTokenSenderTimestamp=d("WAWebBaseModel").prop(),c.isDeprecated=d("WAWebBaseModel").prop(!1),c.msgUnsyncedButtonReplyMsgs=d("WAWebBaseModel").prop(),c.endOfHistoryTransfer=d("WAWebBaseModel").session(!1),c.endOfHistoryTransferType=d("WAWebBaseModel").prop(),c.pendingInitialLoading=d("WAWebBaseModel").prop(!1),c.lastReactionPreview=d("WAWebBaseModel").prop(),c.chatlistPreview=d("WAWebBaseModel").prop(),c.previewT=d("WAWebBaseModel").prop(),c.unopenedByAssignedAgent=d("WAWebBaseModel").session(!1),c.isAssignedToMe=d("WAWebBaseModel").session(!1),c.assignedAgent=d("WAWebBaseModel").session(),c.unreadEditTimestampMs=d("WAWebBaseModel").prop(),c.celebrationAnimationLastPlayed=d("WAWebBaseModel").prop(0),c.animationCandidateData=d("WAWebBaseModel").prop(),c.draftMessage=d("WAWebBaseModel").prop(),c.draftMessageSortTs=d("WAWebBaseModel").session(),c.ephemeralDisplayedExemptions=d("WAWebBaseModel").prop(),c.hasOpened=d("WAWebBaseModel").prop(),c.botInitialTypingIndicatorMsgId=d("WAWebBaseModel").session(),c.hasCreatedBotInvokeSystemMsg=d("WAWebBaseModel").prop(),c.bizBotSystemMsgType=d("WAWebBaseModel").prop(),c.hasRequestedWelcomeMsg=d("WAWebBaseModel").prop(!1),c.lidOriginType=d("WAWebBaseModel").prop(),c.hasPreloaded=d("WAWebBaseModel").session(!1),c.chatEntryPoint=d("WAWebBaseModel").session(null),c.forceDismissAiAgentBlockBar=d("WAWebBaseModel").session(!1),c.limitSharing=d("WAWebBaseModel").prop(),b)||babelHelpers.assertThisInitialized(c)}var f=e.prototype;f.initialize=function(){var b=this;a.prototype.initialize.call(this);this.addQueue=new(c("WAInOrderPromiseQueue"))();this.sendQueue=new(c("WAInOrderPromiseQueue"))();this.$ChatImpl$p_1=new Set();this.$ChatImpl$p_2=new Map();this.$ChatImpl$p_3=new AbortController();this.$ChatImpl$p_4();this.msgs.msgLoadState.contextLoaded=!0;this.addChild("presence",d("WAWebPresenceCollection").PresenceCollection.gadd(this.id));var e=d("WAWebMuteCollection").MuteCollection.get(this.id);e?this.addChild("mute",e):this.addChild("mute",d("WAWebMuteCollection").MuteCollection.gadd({id:this.id,expiration:this.muteExpiration,isAutoMuted:this.isAutoMuted}));this.listenTo(this.mute,"change:expiration",function(){return d("WAWebChatUpdates").updateMuteExpiration(b)});this.listenTo(this.mute,"change:isAutoMuted",function(){return d("WAWebChatUpdates").updateMuteExpiration(b)});this.addChild("contact",d("WAWebContactCollection").ContactCollection.gadd(this.id));if(this.name&&!this.contact.name){var f={name:this.name};d("WAWebChatGetters").getIsGroup(this)?this.contact.set(f):d("WAWebChatGetters").getIsNewsletter(this)?this.contact.set(f):d("WAWebDBUpdateContactTable").updateContactTable(this.contact.id,f).then(function(){b.contact.set(f)})}this.listenTo(this.contact,"change:name",function(){return d("WAWebChatGroupUtils").updateTitle(b)});this.listenTo(this.contact,"change:isContactBlocked",function(){return d("WAWebChatGroupUtils").updateCanSend(b)});this.listenTo(this,"change:isDeprecated",function(){return d("WAWebChatGroupUtils").updateCanSend(b)});this.listenTo(this,"change:id change:archive change:unreadCount change:pendingSeenCount change:muteExpiration change:isLocked",this.$ChatImpl$p_5);this.listenTo(d("WAWebFavoriteCollection").FavoriteCollection,"add remove change",function(){b.isFavorite=!!d("WAWebFavoriteCollection").FavoriteCollection.get(b.id.toJid())});d("WAWebChatGetters").getIsGroup(this)&&(this.trusted=!0);this.listenTo(d("WAWebTos").TosManager,"change",function(){return d("WAWebChatGroupUtils").updateCanSend(b)});this.listenTo(this.contact,"change:privacyMode",function(){return d("WAWebChatGroupUtils").updateCanSend(b)});if(d("WAWebChatGetters").getIsGroup(this)||d("WAWebChatGetters").getIsBroadcast(this)){e=this.getGroupMetadataCollection();var g;d("WAWebChatGetters").getIsBroadcast(this)&&!e.get(this.id)&&(g=!0);var h=e.gadd(this.id);this.addChild("groupMetadata",h);this.listenTo(h,"change:stale change:announce",this.$ChatImpl$p_6);this.listenTo(h,"change:groupType",function(){b.$ChatImpl$p_5(),b.groupType=h.groupType});this.groupType=h.groupType;this.listenTo(h,"change:hasCapi",function(){b.hasCapi=h.hasCapi});this.hasCapi=h.hasCapi;this.listenTo(h.participants,"change:isAdmin bulk_add bulk_remove",this.$ChatImpl$p_6);this.listenTo(h,"change:trusted change:stale",this.isTrusted);this.listenTo(h,"change:groupSafetyCheck change:stale",this.isGroupSafetyChecked);this.listenTo(h,"change:participants change:stale change:suspended change:terminated",function(){d("WAWebChatGroupUtils").updateReadOnly(b)});this.listenTo(h.participants,"change:contact.formattedShortName",function(){return d("WAWebChatGroupUtils").updateTitle(b)});this.$ChatImpl$p_7(h);this.listenTo(h.unreadMentionMetadata.unreadMentionCollection,"add remove reset",this.$ChatImpl$p_8);this.listenTo(h.unreadMentionMetadata,"change:pendingUnreadMentionCount",this.$ChatImpl$p_8);this.$ChatImpl$p_6();d("WAWebChatGroupUtils").updateReadOnly(this);var i=this.id;this.listenTo(this,"change:isAnnounceGrpRestrict",function(){d("WAWebChatGroupUtils").updateReadOnly(b),d("WAWebChatGroupUtils").updateCanSend(b)});this.listenTo(h,"change:isParentGroup",function(){b.isParentGroup=h.isParentGroup});this.isParentGroup=h.isParentGroup;g&&e.update(i)}else if(d("WAWebChatGetters").getIsNewsletter(this)){e=this.getNewsletterMetadataCollection();i=e.gadd(this.id);this.addChild("newsletterMetadata",i);d("WAWebChatGroupUtils").updateReadOnly(this);d("WAWebChatGroupUtils").updateCanSend(this);this.listenTo(i,"change:membershipType",function(){d("WAWebChatGroupUtils").updateReadOnly(b),d("WAWebChatGroupUtils").updateCanSend(b)})}else this.listenTo(this.presence,"change:isOnline",function(){return d("WAWebPresenceChatAction").presenceOnlineChanged(b)});this.listenTo(this,"change:isReadOnly",function(){(d("WAWebChatGetters").getIsGroup(this)||d("WAWebChatGetters").getIsNewsletter(this))&&(this.isTrusted(),d("WAWebChatGroupUtils").updateCanSend(this));if(d("WAWebChatGetters").getIsGroup(this)){var a=this.getGroupMetadataCollection();a.update(this.id)}});e=this.getCollection();!!e.notSpam[this.id]&&!this.notSpam&&d("WAWebSendSpamChatAction").sendNotSpam(this)["catch"](c("WAWebNoop"));e.notSpam[this.id]=!!this.notSpam;this.notSpam||this.listenTo(this,"change:notSpam",this.$ChatImpl$p_9);d("WAWebChatGroupUtils").updateTitle(this);this.isTrusted();this.groupSafetyChecked=Boolean((i=this.groupMetadata)==null?void 0:i.groupSafetyCheck);d("WAWebChatGroupUtils").updateCanSend(this);this.listenTo(this.contact,"change:name",this.isTrusted);this.listenTo(this.msgs,"add",function(a){d("WAWebHandleNewMsgAction").handleNewMsgForChat(b,a)});this.listenTo(this.msgs,"update_sort_time",function(){return d("WAWebChatUpdates").updateSortTime(b)});this.listenTo(this.msgs,"bulk_add",function(a,c){return d("WAWebChatMedia").addMediaMsgs(b,a,c)});this.listenTo(this.msgs,"add",this.$ChatImpl$p_10);this.listenTo(this.msgs,"bulk_add",this.deregisterExpiredViewOnceBulkMessages);this.listenTo(this.msgs,"add remove change:ephemeralExpirationTimestamp change:kicState",this.$ChatImpl$p_11);this.listenTo(this.msgs,"bulk_add",function(a){a.forEach(function(a){b.$ChatImpl$p_11(a)})});this.listenTo(this.msgs,"change:kicState",function(a){var c=b.keptMsgs;c&&(d("WAWebMsgGetters").getIsKept(a)?c.add(a):c.remove(a))});this.listenTo(this,"change:msgs",function(){return d("WAWebChatMedia").resetMediaMsgs(b)});this.saveAssignedColorsDebounced=c("lodash").debounce(function(){return d("WAWebChatParticipantColor").saveAssignedColors(b)},1e3);this.listenTo(this,"change:active",this.$ChatImpl$p_12);this.pendingAction=0;this.listenTo(this,"change:t change:modifyTag",function(){return d("WAWebChatMessageSearch").clearFtsCache(b)});this.listenTo(c("WAWebL10N"),"locale_change",function(){d("WAWebChatGroupUtils").updateTitle(b)});(d("WAWebConnModel").Conn.isSMB||d("WAWebListsGatingUtils").isListsEnabled())&&d("WAWebBizLabelUtils").initializeLabels(this);d("WAWebConnModel").Conn.isSMB&&this.$ChatImpl$p_13();this.$ChatImpl$p_5();this.$ChatImpl$p_14();this.id.isFbidBot()&&(d("WAWebBotProfileCollection").BotProfileCollection.get(this.id)||void d("WAWebBotProfileCollection").BotProfileCollection.find(this.id));d("WAWebBizAiAgentGating").isAiAgentAutoReplyEnabled()&&this.listenTo(this,"change:capiThreadControl change:forceDismissAiAgentBlockBar",function(){d("WAWebChatGroupUtils").updateCanSend(b)})};f.$ChatImpl$p_13=function(){var a=this;if(d("WAWebBizGatingUtils").chatAssignmentEnabled()){this.set("unopenedByAssignedAgent",d("WAWebChatAssignmentCollection").ChatAssignmentCollection.getChatUnopenedStatus(this.id));var b=d("WAWebChatAssignmentCollection").ChatAssignmentCollection.getAgentCollectionForChatId(this.id);this.set("isAssignedToMe",this.$ChatImpl$p_15());this.set("assignedAgent",b.at(0));this.listenTo(b,"add remove change",function(){a.set("unopenedByAssignedAgent",d("WAWebChatAssignmentCollection").ChatAssignmentCollection.getChatUnopenedStatus(a.id)),a.set("isAssignedToMe",a.$ChatImpl$p_15()),a.set("assignedAgent",b.at(0))})}};f.$ChatImpl$p_7=function(a){var b=this;if(this.unreadMentionsOfMe){var e=new Map(this.unreadMentionsOfMe.map(function(a){return[String(a.id),a]}));this.listenTo(this.msgs,"bulk_add",function(f){for(f of f){var g=f.id.toString();g=e.get(g);if(!g||!b.isUnreadMsg(f))continue;a.unreadMentionMetadata.addUnreadMentions([new(c("WAWebUnreadMentionModel"))(g)],d("WAWebGroupUnreadMessageType").UnreadMessageType.PERSISTANCE_LOAD)}})}this.unreadMentionCount!=null&&(a.unreadMentionMetadata.pendingUnreadMentionCount=this.unreadMentionCount);this.$ChatImpl$p_8()};f.$ChatImpl$p_14=function(){var a=this;this.eventMsgs=new(d("WAWebEventMsgsCollection").EventMsgsCollection)(this);this.listenTo(this.msgs,"bulk_add",function(b,c){b=b.filter(function(a){return d("WAWebFrontendMsgGetters").getAsEventCreation(a)});b.length&&a.getEventMsgs().add(b,c)});this.listenTo(this.msgs,"change:msgs",function(){if(a.eventMsgs){var b;a.eventMsgs["delete"]();void ((b=a.eventMsgs)==null?void 0:b.initialize())}})};f.$ChatImpl$p_15=function(){var a=d("WAWebUserPrefsMeUser").assertGetMe().getDeviceId();return d("WAWebChatAssignmentCollection").ChatAssignmentCollection.getAgentCollectionForChatId(this.id).getModelsArray().some(function(b){return b.deviceId===a})};f.$ChatImpl$p_8=function(){d("WAWebChatGetters").getIsGroup(this)&&this.groupMetadata&&(this.hasUnreadMention=this.groupMetadata.unreadMentionMetadata.getUnreadMentionCount()>0)};f.set=function(b,c,d){typeof b==="string"?(b==="muteExpiration"&&this.mute&&this.mute.setMute(c),b==="isAutoMuted"&&this.mute&&this.mute.setAutoMuted(c)):Object.prototype.hasOwnProperty.call(b,"muteExpiration")&&this.mute&&this.mute.setMute(b.muteExpiration,b.isAutoMuted);a.prototype.set.call(this,b,c,d);return this};f.equals=function(a){return this.id.equals(a==null?void 0:a.id)};f.addPendingAction=function(a){var b=this,c=function(){b.decPending()};a.then(c,c);this.pendingAction++};f.decPending=function(){this.pendingAction>0?this.pendingAction--:(d("WALogger").LOG(o()),this.pendingAction=0)};f.$ChatImpl$p_4=function(){if(d("WAWebFrontendChatGetters").getHasDraftMessage(this)===!0){var a;this.draftMessageSortTs=(a=this.draftMessage)==null?void 0:a.timestamp}else this.draftMessageSortTs=null};f.$ChatImpl$p_12=function(){var a=this;d("WAWebChatGetters").getIsGroup(this)&&this.active&&(this.squelch=c("WAWebConstantsDeprecated").SQUELCH_RESET_VALUE,this.reactionSquelch=c("WAWebConstantsDeprecated").SQUELCH_RESET_VALUE,this.hasChatBeenOpened=!0);this.presence.chatActive=this.active;if(!this.active){this.$ChatImpl$p_4();this.getCollection().sort();this.msgs.filter(function(a){return d("WAWebViewOnceState").isExpired(a.safe())}).forEach(d("WAWebMedia").deregisterMsg);var b=Array.from(this.$ChatImpl$p_1);d("WAWebDBEphemeralMessage").removeExpiredMessagesFromHistory(b).then(function(){var c=b.map(function(a){return a.id.toString()});c.length>0&&(d("WAWebUpdateLastAddOnPreviewChatAction").deleteModelsForLastAddOnPreview(c),d("WAWebPersistedJobManager").getJobManager().waitUntilPersisted(d("WAWebPersistedJobDefinitions").jobSerializers.deleteAddOns(a.id.toString(),c)))});this.$ChatImpl$p_1.forEach(function(b){a.$ChatImpl$p_1["delete"](b),b["delete"]({skipUpdatingSortTime:!0,doNotResetLastReceived:!0})})}};f.$ChatImpl$p_9=function(){var a=this.getCollection();a.notSpam[this.id]=this.notSpam;this.isTrusted();this.notSpam&&this.stopListening(this,"change:notSpam")};f.senderMsgCount=function(){return this.getAllMsgs().filter(function(a){return!d("WAWebMsgGetters").getIsSentByMe(a)&&!d("WAWebMsgGetters").getIsNotification(a)}).length};f.isCAGAdmin=function(){var a;a=(a=this.groupMetadata)==null?void 0:a.participants.iAmAdmin();return a!=null?a&&d("WAWebFrontendChatGetters").getIsCAG(this):!1};f.hasMaybeSentMsgToChat=function(){return this.getAllMsgs().some(function(a){return d("WAWebMsgGetters").getIsSentByMe(a)})};f.isTrusted=function(){var a=!1;if(d("WAWebChatGetters").getIsGroup(this)){var b;a=this.isReadOnly||this.notSpam||((b=this.groupMetadata)==null?void 0:b.isTrusted())}else d("WAWebChatGetters").getIsBroadcast(this)?a=!0:d("WAWebChatGetters").getIsNewsletter(this)?a=!0:d("WAWebChatGetters").getIsUser(this)&&(a=this.notSpam||d("WAWebContactGetters").getIsMyContact(this.contact));a!==!0&&this.hasMaybeSentMsgToChat()&&(a=!0);d("WAWebChatGetters").getIsGroup(this)&&a!==this.trusted&&d("WAWebGroupSafetyCheckUtils").handleIsTrustedChangeForGroupSafety(this,Boolean(a));return this.trusted=Boolean(a)};f.isGroupSafetyChecked=function(){var a=!1;if(this.groupMetadata){var b;a=(b=this.groupMetadata)==null?void 0:b.groupSafetyCheck;a!==this.groupSafetyChecked&&d("WAWebGroupSafetyCheckUtils").handleGroupSafetyCheckStateUpdate(this,Boolean(this.trusted),a)}return this.groupSafetyChecked=Boolean(a)};f.isSuspendedOrTerminated=function(){if(d("WAWebChatGetters").getIsGroup(this)){var a;return Boolean((a=this.groupMetadata)==null?void 0:a.isSuspendedOrTerminated())}else if(d("WAWebChatGetters").getIsNewsletter(this)){return Boolean((a=this.newsletterMetadata)==null?void 0:a.isSuspendedOrTerminated)}return!1};f.canBlockFromNotification=function(){return d("WAWebABProps").getABPropConfigValue("block_from_notification")&&d("WAWebChatGetters").getIsUser(this)&&!this.isTrusted()};f.canToggleFavorite=function(){var a;if(d("WAWebListsGatingUtils").isListsEnabled())return!0;return this.isFavorite?!0:(d("WAWebChatGetters").getIsGroup(this)&&((a=this.groupMetadata)==null?void 0:a.groupType)!==d("WAWebGroupType").GroupType.COMMUNITY&&((a=this.groupMetadata)==null?void 0:a.groupType)!==d("WAWebGroupType").GroupType.LINKED_ANNOUNCEMENT_GROUP&&((a=this.groupMetadata)==null?void 0:a.participants.iAmMember())&&!((a=this.groupMetadata)==null?void 0:a.isSuspendedOrTerminated())||d("WAWebFrontendChatGetters").getKind(this)===d("WAWebChatFlowTypes").ChatKindType.Chat&&d("WAWebContactGetters").getIsMyContact(this.contact)&&!d("WAWebContactGetters").getId(this.contact).isBot()&&!d("WAWebContactGetters").getIsMe(this.contact))&&this.trusted};f.title=function(){var a;return d("WAWebChatGetters").getIsGroup(this)?(a=this.formattedTitle)!=null?a:h._(/*BTDS*/"__JHASH__LCXIGw_i_3P__JHASH__").toString():this.formattedTitle};f.getTcToken=function(){return this.tcToken==null||this.tcTokenTimestamp==null?null:d("WAWebTrustedContactsUtils").isTokenExpired(this.tcTokenTimestamp,d("WAWebTrustedContactsUtils").TcTokenMode.Receiver)?null:this.tcToken};f.shouldShowUnreadDivider=function(){return d("WAWebFrontendChatGetters").getShouldShowUnreadDivider(this)};f["delete"]=function(){a.prototype["delete"].call(this);this.getCollection().remove(this.id);this.$ChatImpl$p_3.abort();this.presence["delete"]();d("WAWebCmd").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"]();this.eventMsgs&&this.eventMsgs["delete"]();var b=this.starredMsgs;b&&(b["delete"](),b.stopListening(),b.reset());d("WAWebChatGetters").clearChatGetterCacheFor(this);d("WAWebFrontendChatGetters").clearFrontendChatGetterCacheFor(this)};f.isDirty=function(){return this.unreadCount!==0};f.canPin=function(){var a;if(this.archive)return!1;a=((a=this.promises)==null?void 0:(a=a.setArchive)==null?void 0:a.archive)===!0;return!a};f.canArchive=function(){return d("WAWebChatGetters").getIsBroadcast(this)?!1:!0};f.supportsChatLock=function(){return!0};f.hasUnreadEdit=function(){return this.unreadEditTimestampMs!=null};f.setComposeContents=function(a){var b,c=a.text;if(((b=a.text)==null?void 0:b.trim())===""){c=(b=a.text)==null?void 0:b.trim()}b={text:c,ctwaContext:a.ctwaContext,ctwaContextLinkData:a.ctwaContextLinkData,timestamp:a.timestamp,omittedUrl:a.omittedURL};void d("WAWebUpdateDraftMessageChatAction").updateDraftMessageChat(this.id,b)};f.getComposeContents=function(){if(!this.draftMessage)return;var a={timestamp:this.draftMessage.timestamp,text:this.draftMessage.text},b=this.draftMessage,c=b.ctwaContext,d=b.ctwaContextLinkData;b=b.omittedUrl;b!=null&&(a.omittedURL=b);c!=null&&(a.ctwaContext=c);d!=null&&(a.ctwaContextLinkData=d);return a};f.setAttachMediaContents=function(a){this.attachMediaContents=a,this.draftAttachMediaContentsSortTs=Boolean(a)?d("WATimeUtils").unixTime():null};f.isComposingWithUnsavedChanges=function(){return this.isComposingPoll};f.isBusinessGroup=function(){var a;a=(a=this.groupMetadata)==null?void 0:a.participants.getAdmins();if(!a)return!1;for(a of a){var b=d("WAWebContactCollection").ContactCollection.get(a.id);if(b==null?void 0:b.isBusiness)return!0}return!1};f.isCAG=function(){return d("WAWebFrontendChatGetters").getIsCAG(this)};f.preload=function(){this.msgs.length===1&&d("WAWebChatLoadMessages").loadEarlierMsgs(this)["catch"](d("WAFilteredCatch").filteredCatch(d("WAWebBackendErrors").E404,c("WAWebNoop")))["catch"](function(a){d("WALogger").LOG(n(),a)})};f.onEmptyMRM=function(){d("WALogger").LOG(m()),d("WAWebChatLoadMessages").loadEarlierMsgs(this)["catch"](d("WAFilteredCatch").filteredCatch(d("WAWebBackendErrors").E404,c("WAWebNoop")))["catch"](function(a){d("WALogger").LOG(l(),a)})};f.deleteMsgs=function(a,b){this.deleteMsgsBeforeMsgInclusive(void 0,!a,b)};f.deleteMsgsBeforeMsgInclusive=function(a,b,e){b===void 0&&(b=!1);var f;if(!a)f=this.msgs.length;else if(!this.msgs.get(a.id))return;else f=this.msgs.indexOf(a);a=function(a,g,h){return!c("isStringNullOrEmpty")(e)&&!d("WAWebMsgModelUtils").msgMatchesType(a,e)||a.msgChunk===this.msgs&&g>f||b&&a.star||d("WAWebMsgGetters").getIsInitialE2ENotification(a)&&b};this.deleteMsgsPartial(a,!0)};f.deleteMsgsPartial=function(a,b){var e=this;b===void 0&&(b=!1);var f=this.unreadCount;this.getAllCMCs().forEach(function(c){var f=c.filter(function(b,c,d){return!a.apply(e,[b,c,d])});c.remove(f,void 0,b);f.forEach(function(a){d("WAWebMsgGetters").getIsAuthenticationMessage(a)&&void d("WAWebOTPLoggingHelper").logOTPMessageDeleted(d("WAWebMsgDataFromModel").msgDataFromMsgModel(a)),a["delete"]()})});c("lodash").clone(this.msgChunks).forEach(function(a){a.length===0&&e.removeMsgsCollection(a)});if(this.msgs.length>0){var g=f>this.msgs.length?this.msgs.length:f;d("WAWebDBUpdateChatTable").updateChatTable(this.id,{unreadCount:g}).then(function(){e.unreadCount=g,e.msgs.msgLoadState.noEarlierMsgs=e.endOfHistoryTransferType!==d("WAWebChatConstants").ConversationEndOfHistoryTransferModelPropType.INCOMPLETE})}};f.deleteMessages=function(a){var b=function(b,c,d){return!a.includes(b.id.toString())};this.deleteMsgsPartial(b,!0);this.getAllMsgs().length===0&&d("WAWebChatLoadMessages").loadEarlierMsgs(this);void d("WAWebLimitSharingModelUtils").createLimitSharingMsgOnChatClear(this.id)};f.getLastMsgKeyForAction=function(){var a=this.msgs.last(),b;a&&(!this.lastReceivedKey||a.id.fromMe&&a.local&&a.ack===d("WAWebAck").ACK.CLOCK?b=a.id:b=this.lastReceivedKey);return b?b:void 0};f.getWebcChatType=function(){var a=d("WAWebFrontendChatGetters").getKind(this);if(a!=null)switch(a){case d("WAWebChatFlowTypes").ChatKindType.Chat:return d("WAWebWamEnumWebcChatType").WEBC_CHAT_TYPE.INDIVIDUAL;case d("WAWebChatFlowTypes").ChatKindType.Group:return d("WAWebWamEnumWebcChatType").WEBC_CHAT_TYPE.GROUP;case d("WAWebChatFlowTypes").ChatKindType.Broadcast:return d("WAWebWamEnumWebcChatType").WEBC_CHAT_TYPE.BROADCAST_LIST;case d("WAWebChatFlowTypes").ChatKindType.Newsletter:return d("WAWebWamEnumWebcChatType").WEBC_CHAT_TYPE.NEWSLETTER;case d("WAWebChatFlowTypes").ChatKindType.Community:return d("WAWebWamEnumWebcChatType").WEBC_CHAT_TYPE.COMMUNITY}else throw new TypeError("Invalid Chat.kind "+String(a))};f.getMdChatAssignmentChatType=function(){return d("WAWebChatModelDerivedMethods").getMdChatAssignmentChatTypeFn(this)};f.getChatAssignmentChatType=function(){var a=d("WAWebFrontendChatGetters").getKind(this);if(a!=null)switch(a){case d("WAWebChatFlowTypes").ChatKindType.Chat:return d("WAWebWamEnumChatAssignmentChatType").CHAT_ASSIGNMENT_CHAT_TYPE.INDIVIDUAL;case d("WAWebChatFlowTypes").ChatKindType.Group:return d("WAWebWamEnumChatAssignmentChatType").CHAT_ASSIGNMENT_CHAT_TYPE.GROUP;case d("WAWebChatFlowTypes").ChatKindType.Broadcast:case d("WAWebChatFlowTypes").ChatKindType.Community:return d("WAWebWamEnumChatAssignmentChatType").CHAT_ASSIGNMENT_CHAT_TYPE.COMMUNITY;case d("WAWebChatFlowTypes").ChatKindType.Newsletter:return d("WAWebWamEnumChatAssignmentChatType").CHAT_ASSIGNMENT_CHAT_TYPE.CHANNEL}else throw new TypeError("Invalid Chat.kind "+String(a))};f.deregisterExpiredViewOnceBulkMessages=function(a){a.forEach(this.$ChatImpl$p_10)};f.$ChatImpl$p_10=function(a){d("WAWebViewOnceState").isExpired(a.safe())&&d("WAWebMedia").deregisterMsg(a)};f.$ChatImpl$p_11=function(a){var e=this;c("WAWebAlarm").clearTimeout(this.$ChatImpl$p_2.get(a));this.$ChatImpl$p_2["delete"](a);this.$ChatImpl$p_1["delete"](a);var f=d("WAWebMsgGetters").getEphemeralExpirationTimestamp(a);if(f==null||!this.msgs.includes(a)||d("WAWebMsgGetters").getIsKept(a))return;var g=function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){e.$ChatImpl$p_2["delete"](a),!e.active?(yield d("WAWebDBEphemeralMessage").removeExpiredMessagesFromHistory([a]),d("WAWebUpdateLastAddOnPreviewChatAction").deleteModelsForLastAddOnPreview([a.id.toString()]),yield d("WAWebPersistedJobManager").getJobManager().waitUntilPersisted(d("WAWebPersistedJobDefinitions").jobSerializers.deleteAddOns(e.id.toString(),[a.id.toString()])),a["delete"]({skipUpdatingSortTime:!0,doNotResetLastReceived:!0})):e.$ChatImpl$p_1.add(a)});return function(){return c.apply(this,arguments)}}();if(a.isExpired())g();else{f=c("WAWebAlarm").setGlobalTimeout(function(){return void g()},f*1e3);this.$ChatImpl$p_2.set(a,f)}};f.isUnreadMsg=function(a){var b=this.msgs.filter(function(a){return d("WAWebMsgGetters").getIsUnreadType(a)});return b.includes(a,b.length-this.unreadCount)};f.isActiveUnreadMsg=function(a){var b=this.msgs.filter(function(a){return d("WAWebMsgGetters").getIsUnreadType(a)});return b.includes(a,b.length-this.activeUnreadCount)};f.setCelebrationAnimationLastPlayed=function(){this.animationCandidateData&&this.celebrationAnimationLastPlayed<this.animationCandidateData.msgTimestampSeconds&&(this.celebrationAnimationLastPlayed=this.animationCandidateData.msgTimestampSeconds)};f.setChatWallpaper=function(a){this.wallpaper=a;return d("WAWebDBUpdateChatTable").updateChatTable(this.id,{wallpaper:a})};f.setShowDoodle=function(a){this.showDoodle=a;return d("WAWebDBUpdateChatTable").updateChatTable(this.id,{showDoodle:a})};f.setCapiThreadControl=function(a){this.capiThreadControl=a;this.forceDismissAiAgentBlockBar=!1;a===d("WAWebProtobufsE2E.pb").Message$CloudAPIThreadControlNotification$CloudAPIThreadControl.CONTROL_PASSED&&(this.unreadCount=1,d("WAWebBizAiAgentGating").isAiAgentThreadControlNotificationEnabled()&&d("WAWebNotificationBackend").showAiHandoffNotification(this)["catch"](d("WAAbortError").catchAbort(function(a){d("WALogger").LOG(k(),a)})));return d("WAWebDBUpdateChatTable").updateChatTable(this.id,{capiThreadControl:a,unreadCount:this.unreadCount})};f.setForceDismissAiAgentBlockingBar=function(a){this.forceDismissAiAgentBlockBar=a};f.setAnimationCandidateData=function(a){this.animationCandidateData=a};f.$ChatImpl$p_6=function(){var a=this,b=this.groupMetadata;if(d("WAWebChatGetters").getIsGroup(this)&&b!=null&&!b.stale){var c=!b.participants.iAmAdmin()&&b.announce;this.isAnnounceGrpRestrict!==c&&(d("WALogger").LOG(j(),this.isAnnounceGrpRestrict,c),d("WAWebDBUpdateChatTable").updateChatTable(this.id,{isAnnounceGrpRestrict:c}).then(function(){return a.isAnnounceGrpRestrict=c}))}};f.sortMsgs=function(a){a=a.map(function(a){var b=c("WANullthrows")(a.msgChunk);return{msg:a,chunkT:c("WANullthrows")(b.at(0)).t,index:b.indexOf(a)}});return c("lodash").orderBy(a,["chunkT","index"]).map(function(a){return a.msg})};f.waitForChatLoading=function(){var a=this,d=(i||(i=b("Promise"))).resolve();this.pendingInitialLoading&&(d=c("WAWebEventsWaitForBbEvent")(this,"change:pendingInitialLoading",function(){return!a.pendingInitialLoading}));return d};f.unstarAll=function(){var a=this.getAllMsgs();a.forEach(function(a){a&&(a.star=!1)});d("WAWebStarredMsgCollection").removeStarredMsgs(a)};f.$ChatImpl$p_5=function(){var a,b=!!this.muteExpiration;if(this.archive){this.showUnreadInTitle=!1;return}if(this.isLocked){this.showUnreadInTitle=!1;return}if(this.id.isBot()&&!d("WAWebBotGating").isBotEnabled()){this.showUnreadInTitle=!1;return}if(d("WAWebFrontendChatGetters").getOptimisticUnreadCount(this)<=0){this.showUnreadInTitle=!1;return}if(!d("WAWebChatGetters").getIsGroup(this)){this.showUnreadInTitle=!b;return}if(((a=this.groupMetadata)==null?void 0:a.groupType)===d("WAWebGroupType").GroupType.COMMUNITY){this.showUnreadInTitle=!1;return}if(!b){this.showUnreadInTitle=!0;return}if(!this.msgs||this.msgs.length===0){this.showUnreadInTitle=!1;return}a=!1;b=this.msgs;var c=d("WAWebFrontendChatGetters").getOptimisticUnreadCount(this);c=Math.max(0,b.length-c);for(;c<b.length;c++){var e=this.msgs.at(c);if(!e)continue;var f=d("WAWebUserPrefsMeUser").getMaybeMeUser();if(f!=null&&(e.isMentioned(f)||d("WAWebQuotedMsgModelUtils").isQuotedMsg(e,f))){f=this.getCollection().get(d("WAWebMsgGetters").getSender(e));if(!f||!f.muteExpiration){a=!0;break}}}this.showUnreadInTitle=a};f.removeFromCollection=function(a){a.star&&d("WAWebStarredMsgCollection").removeStarredMsgs([a]);d("WAWebMsgGetters").getIsMedia(a)&&this.mediaMsgs?this.mediaMsgs.remove(a):d("WAWebMsgLinks").getLinksFromMsg(a).length>0&&this.linkMsgs?this.linkMsgs.remove(a):d("WAWebFrontendMsgGetters").getAsDoc(a)&&this.docMsgs?this.docMsgs.remove(a):d("WAWebFrontendMsgGetters").getAsProduct(a)!=null&&this.productMsgs?this.productMsgs.remove(a):d("WAWebFrontendMsgGetters").getAsEventCreation(a)!=null&&this.eventMsgs&&this.eventMsgs.remove(a);d("WAWebMsgGetters").getIsKept(a)&&this.keptMsgs&&this.keptMsgs.remove(a);if(d("WAWebChatGetters").getIsGroup(d("WAWebFrontendMsgGetters").getChat(a))){var b;(b=d("WAWebFrontendMsgGetters").getChat(a).groupMetadata)==null?void 0:b.unreadMentionMetadata.removeUnreadMentions(a.id.toString())}};f.getMediaMsgs=function(){this.mediaMsgs||(this.mediaMsgs=new(c("WAWebChatMediaMsgsCollection"))());return this.mediaMsgs};f.getLinkMsgs=function(){this.linkMsgs||(this.linkMsgs=new(c("WAWebChatLinkMsgsCollection"))());return this.linkMsgs};f.getDocMsgs=function(){this.docMsgs||(this.docMsgs=new(c("WAWebChatDocMsgsCollection"))());return this.docMsgs};f.getEventMsgs=function(){this.eventMsgs||(this.eventMsgs=new(d("WAWebEventMsgsCollection").EventMsgsCollection)(this));return this.eventMsgs};f.getParticipantCount=function(){var a;return((a=this.groupMetadata)==null?void 0:a.participants.length)||1};f.iAmAdmin=function(){return this.groupMetadata?this.groupMetadata.participants.iAmAdmin():!1};f.getProductMsgs=function(){this.productMsgs||(this.productMsgs=new(c("WAWebChatProductMsgsCollection"))());return this.productMsgs};f.getStarredMsgs=function(){var a=this,b=this.starredMsgs;b||(this.starredMsgs=b=new(d("WAWebStarredMsgCollection").StarredMsgCollection)(),this.starredMsgs.add(d("WAWebStarredMsgCollection").AllStarredMsgsCollection.filter(function(b){return d("WAWebFrontendMsgGetters").getChat(b)===a})));return b};f.getKeptMsgs=function(){var a=this.keptMsgs;a||(this.keptMsgs=a=new(d("WAWebKeptMsgCollection").KeptMsgCollection)(),this.keptMsgs.add(this.msgs.filter(function(a){return d("WAWebMsgGetters").getIsKept(a)})));return a};f.hasKeptMsgs=function(){return this.msgs.some(function(a){return d("WAWebMsgGetters").getIsKept(a)})};f.canSendPolls=function(){return d("WAWebChatModelDerivedMethods").canSendPolls(this)};f.canInvokeBot=function(){var a;if(!d("WAWebBotGating").isBotEnabled())return!1;if(d("WAWebChatGetters").getIsNewsletter(this))return!1;if(d("WAWebContactGetters").getIsMe(this.contact))return!1;if(d("WAWebFrontendChatGetters").getIsCapiHostedGroup(this))return!1;if(this.id.isBot())return!1;if(d("WAWebChatEphemerality").isEphemeralSettingOn(this))return!1;if(((a=this.contact.businessProfile)==null?void 0:a.isBizBot3p)===!0||((a=this.contact.businessProfile)==null?void 0:a.isBizBot1p)===!0)return!1;return d("WAWebTosGating").shouldBlockBotInvokeAsTosNotAvailable()?!1:!0};f.getAbortController=function(){return this.$ChatImpl$p_3};f.getDeleteSignal=function(){return this.getAbortController().signal};f.getCollection=function(){return d("WAWebChatGetters").getIsNewsletter(this)?c("WAWebNewsletterCollection"):d("WAWebChatCollection").ChatCollection};f.getGroupMetadataCollection=function(){return c("WAWebGroupMetadataCollection")};f.getNewsletterMetadataCollection=function(){return c("WAWebNewsletterMetadataCollection")};f.updateBotInvokeSystemMsgCreated=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield d("WAWebDBUpdateChatTable").updateChatTable(this.id,{hasCreatedBotInvokeSystemMsg:!0}),this.hasCreatedBotInvokeSystemMsg=!0});function c(){return a.apply(this,arguments)}return c}();f.updateBizBotSysMsgCreated=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield d("WAWebDBUpdateChatTable").updateChatTable(this.id,{bizBotSystemMsgType:a}),this.bizBotSystemMsgType=a});function c(b){return a.apply(this,arguments)}return c}();f.supportsKIC=function(){return d("WAWebFrontendChatGetters").getIsCAG(this)&&!d("WAWebEphemeralKeepInChatAbpropUtils").isKeepInChatInCAGEnabled()?!1:!0};return e}(c("WAWebSuperChatMsgs"));a.Proxy="chat";a.idClass=c("WAWebWid");e=d("WAWebBaseModel").defineModel(a);g.Chat=e}),226); __d("WAWebChatModelDerivedMethods",["WAWebABProps","WAWebChatFlowTypes","WAWebChatGetters","WAWebChatGroupUtils","WAWebFrontendChatGetters","WAWebMsgType","WAWebNewsletterGatingUtils","WAWebPollsGatingUtils","WAWebViewMode.flow","WAWebViewModeUtils","WAWebWamEnumMdChatAssignmentChatType"],(function(a,b,c,d,e,f,g){function a(a){a=d("WAWebFrontendChatGetters").getKind(a);if(a!=null)switch(a){case d("WAWebChatFlowTypes").ChatKindType.Chat:return d("WAWebWamEnumMdChatAssignmentChatType").MD_CHAT_ASSIGNMENT_CHAT_TYPE.INDIVIDUAL;case d("WAWebChatFlowTypes").ChatKindType.Group:return d("WAWebWamEnumMdChatAssignmentChatType").MD_CHAT_ASSIGNMENT_CHAT_TYPE.GROUP;case d("WAWebChatFlowTypes").ChatKindType.Broadcast:return d("WAWebWamEnumMdChatAssignmentChatType").MD_CHAT_ASSIGNMENT_CHAT_TYPE.BROADCAST_LIST;case d("WAWebChatFlowTypes").ChatKindType.Newsletter:return d("WAWebWamEnumMdChatAssignmentChatType").MD_CHAT_ASSIGNMENT_CHAT_TYPE.CHANNEL;case d("WAWebChatFlowTypes").ChatKindType.Community:return d("WAWebWamEnumMdChatAssignmentChatType").MD_CHAT_ASSIGNMENT_CHAT_TYPE.COMMUNITY}else throw new TypeError("Invalid Chat.kind "+String(a))}function b(a){return a.type!==d("WAWebMsgType").MSG_TYPE.E2E_NOTIFICATION&&(a.type!==d("WAWebMsgType").MSG_TYPE.NOTIFICATION_TEMPLATE||a.subtype==="chat_assignment"||a.subtype==="chat_assignment_unassign"||a.subtype==="limit_sharing_system_message")&&a.type!==d("WAWebMsgType").MSG_TYPE.REACTION&&a.type!==d("WAWebMsgType").MSG_TYPE.POLL_UPDATE&&a.type!==d("WAWebMsgType").MSG_TYPE.KEEP_IN_CHAT&&a.subtype!=="newsletter_admin_context_card"&&a.subtype!=="newsletter_privacy"&&!a.pendingDeleteForMe&&a.botPluginReferenceIndex==null&&d("WAWebViewModeUtils").isViewModeVisibleInSurface(d("WAWebViewMode.flow").ViewModeSurface.CHAT_LIST,a.viewMode)}function c(a){if(d("WAWebChatGetters").getIsNewsletter(a))return d("WAWebNewsletterGatingUtils").isNewsletterPollsCreationEnabled();var b=a.groupMetadata;if(b==null)return!0;return d("WAWebFrontendChatGetters").getIsCAG(a)?d("WAWebChatGroupUtils").getGroupParticipantsCount(b)<=d("WAWebABProps").getABPropConfigValue("pnh_cag_disable_polls_group_size")&&d("WAWebPollsGatingUtils").isPollsCreationEnabledInCags():!0}g.getMdChatAssignmentChatTypeFn=a;g.isPreviewMessage=b;g.canSendPolls=c}),98); __d("WAWebChatMsgsCollectionComparator",[],(function(a,b,c,d,e,f){function a(a,b){return a.serverId==null||b.serverId==null?0:a.serverId-b.serverId}f.msgComparator=a}),66); __d("WAWebChatMsgsCollection",["invariant","WAWebBaseCollection","WAWebBaseModel","WAWebBizSystemMsgSubtypes","WAWebChatMsgsCollectionComparator","WAWebCommonCTWALogging","WAWebMsgCollection","WAWebMsgGetters","WAWebMsgModel","WAWebViewModeUtils"],(function(a,b,c,d,e,f,g,h){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.noEarlierMsgs=d("WAWebBaseModel").prop(),c.isLoadingEarlierMsgs=d("WAWebBaseModel").prop(),c.isLoadingRecentMsgs=d("WAWebBaseModel").prop(),c.isLoadingAroundMsgs=d("WAWebBaseModel").prop(),c.isRepairingMsgHistory=d("WAWebBaseModel").prop(),c.contextLoaded=d("WAWebBaseModel").prop(),b)||babelHelpers.assertThisInitialized(c)}return b}(d("WAWebBaseModel").BaseModel);a.Proxy="msgLoad";var i=d("WAWebBaseModel").defineModel(a);b=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b;b=a.call(this)||this;b.triggerChangeLast=function(a,c,d){var e=b.last();if(b.$ChatMsgsCollection$p_1!==e){b.$ChatMsgsCollection$p_1=e;var f=!1,g=!!d.add;d=!!d.remove;c.includes(a)&&g&&!d&&(f=!0);b.trigger("change:last",e,f)}};b.msgLoadState=new i({noEarlierMsgs:!1,isLoadingEarlierMsgs:!1,isLoadingRecentMsgs:!1,isLoadingAroundMsgs:!1,contextLoaded:!1,isRepairingMsgHistory:!1});b.listenTo(babelHelpers.assertThisInitialized(b),"add remove",b.triggerChangeLast);b.listenTo(babelHelpers.assertThisInitialized(b),"sort reset",function(a,c){b.triggerChangeLast(null,a,(a=c)!=null?a:{})});return b}var c=b.prototype;c["delete"]=function(){this.stopListening(),a.prototype["delete"].call(this),this.msgLoadState["delete"]()};c.last=function(){return a.prototype.getModelsArray.call(this).findLast(function(a){return d("WAWebViewModeUtils").isMessageExistingInChat(a)})};c.add=function(b,c){var e=this,f;!Array.isArray(b)?f=b:b.length===1&&(f=b[0]);var g=[];if(f!=null&&(d("WAWebMsgGetters").getIsInitialE2ENotification(f)||d("WAWebMsgGetters").getIsDisappearingModeSystemMessage(f))){var h=this.some(function(a){return d("WAWebMsgGetters").getIsInitialE2ENotification(a)});d("WAWebMsgGetters").getIsInitialE2ENotification(f)&&(h||(g=a.prototype.add.call(this,b,babelHelpers["extends"]({},c,{at:0}))));if(d("WAWebMsgGetters").getIsDisappearingModeSystemMessage(f)){var i=this.some(function(a){return d("WAWebMsgGetters").getIsDisappearingModeSystemMessage(a)});if(!i){i=h?1:0;g=a.prototype.add.call(this,b,babelHelpers["extends"]({},c,{at:i}))}}g&&this.trigger("insert_msgs",g,c)}else{h=f!=null&&d("WAWebMsgGetters").getSubtype(f);i=h!=null&&d("WAWebBizSystemMsgSubtypes").COEX_MSG_SUBTYPES.includes(h)&&((i=this.last())==null?void 0:i.subtype)===h;i||(g=a.prototype.add.call(this,b,c))}if(g.length>0){h=d("WAWebMsgCollection").MsgCollection.add(g.filter(Boolean),c);h.forEach(function(a){a&&e.isModel(a)&&(a.msgChunk=e)});this.trigger("bulk_add",g,c);h.forEach(function(a){return d("WAWebCommonCTWALogging").logDeepConversation(a)})}return g};c.remove=function(b,c,d){c===void 0&&(c={});d===void 0&&(d=!1);b=a.prototype.remove.call(this,b,c);var e=c?c.silent:!1,f=b.filter(function(a){return!!a});f.length&&e!==!0&&(this.trigger("remove_msgs",f,c),d||this.trigger("update_sort_time"));return b};c.replace=function(a){var b=this;this.msgLoadState=a.msgLoadState;this.loadRecentPromise=a.loadRecentPromise;this.loadEarlierPromise=a.loadEarlierPromise;this.loadAroundPromise=a.loadAroundPromise;a=a.getModelsArray();this.set(a,{silent:!0,merge:!1});a.forEach(function(a){b.isModel(a)&&(a.msgChunk=b)});this.trigger("bulk_add",a)};c.onMsgLoadStateChange=function(a){var b=this,c,d=function(){a()},e=function(){c!=null||h(0,56282);c.off("change",d);var e=b.msgLoadState;e.on("change",d);c=e;a()};c=this.msgLoadState;c.on("change",d);this.on("bulk_add",e);var f=function(){c!=null||h(0,56281),b.off("bulk_add",e),c.off("change",d)};return function(){var a=f;a&&(f=null,a())}};return b}(d("WAWebBaseCollection").BaseCollection);b.model=d("WAWebMsgModel").Msg;b.comparator=d("WAWebChatMsgsCollectionComparator").msgComparator;g.ChatMsgsCollection=b}),98); __d("WAWebWallpaper",["fbt","WAWebUIRefreshGatingUtils"],(function(a,b,c,d,e,f,g,h){var i="default_chat_wallpaper",j="0.06",k="0.4",l="0.1",m="data-asset-chat-background-dark",n="data-asset-chat-background-beige",o={"#BBE4E5":{doodle:"dark",opacity:"0.42",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__ta2lA_cnMpJ__JHASH__")}},"#AED8C7":{doodle:"dark",opacity:"0.3",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__TGRLlJjZuZR__JHASH__")}},"#7ACBA5":{doodle:"dark",opacity:"0.26",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__GHinTHqCKf___JHASH__")}},"#CBDAEC":{doodle:"dark",opacity:"0.42",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH___7bsMej5yup__JHASH__")}},"#66D2D5":{doodle:"dark",opacity:"0.26",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__FKXCt-pB63B__JHASH__")}},"#63BDCF":{doodle:"dark",opacity:"0.26",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__Y8diJCSB8sM__JHASH__")}},"#D6D0F0":{doodle:"dark",opacity:"0.36",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__UXur1DaUiRk__JHASH__")}},"#CECECE":{doodle:"dark",opacity:"0.36",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__i5DOUPBNBzf__JHASH__")}},"#D1DABE":{doodle:"dark",opacity:"0.36",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__noQKc-soB_b__JHASH__")}},"#E6E1B1":{doodle:"dark",opacity:"0.42",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__aSF3e4Bevz9__JHASH__")}},"#FEEFA9":{doodle:"light",opacity:"0.06",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__7FAq-r5PTBb__JHASH__")}},"#FED297":{doodle:"dark",opacity:"0.42",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__UsXX87mOafx__JHASH__")}},"#FD9A9B":{doodle:"dark",opacity:"0.26",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__lgzrSa9wDky__JHASH__")}},"#FD6769":{doodle:"dark",opacity:"0.26",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__k8WCNFBSiXX__JHASH__")}},"#FB4668":{doodle:"dark",opacity:"0.26",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__-vODpndGf9J__JHASH__")}},"#922040":{doodle:"dark",opacity:"0.17",invertTransparentWallpaperColors:!0,getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__b_dR1fXcDTA__JHASH__")}},"#DC6E4F":{doodle:"dark",opacity:"0.2",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__R7t1n3mfOND__JHASH__")}},"#644D52":{doodle:"dark",opacity:"0.13",invertTransparentWallpaperColors:!0,getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__aHMfRXTOgFC__JHASH__")}},"#517E7E":{doodle:"dark",opacity:"0.13",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__HYWPM9o62Uh__JHASH__")}},"#3190BB":{doodle:"dark",opacity:"0.13",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__LQUG5LdDLDG__JHASH__")}},"#35558A":{doodle:"dark",opacity:"0.1",invertTransparentWallpaperColors:!0,getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__XubQCMFxwNi__JHASH__")}},"#55626F":{doodle:"dark",opacity:"0.1",invertTransparentWallpaperColors:!0,getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__s-4yv3hWJ5-__JHASH__")}},"#1D2326":{doodle:"dark",opacity:"0.1",invertTransparentWallpaperColors:!0,getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__a0afZ7Ouex7__JHASH__")}},"#301E34":{doodle:"dark",opacity:"0.1",invertTransparentWallpaperColors:!0,getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__HUIu0gUH1Im__JHASH__")}},"#ECF0F1":{doodle:"light",opacity:"0.06",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__sOMmmamxChC__JHASH__")}},"#FFFEA2":{doodle:"light",opacity:"0.06",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__KtUU2LTRpz0__JHASH__")}},"#E7E8D2":{doodle:"light",opacity:"0.06",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__kCrNHpGGPZD__JHASH__")}}},p={"#0F2424":{doodle:"dark",opacity:"0.05",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__j4XCB-amTNr__JHASH__")}},"#12261F":{doodle:"dark",opacity:"0.055",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__6sl_OKJpe1N__JHASH__")}},"#11241C":{doodle:"dark",opacity:"0.055",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__C841PidOK1w__JHASH__")}},"#111E27":{doodle:"dark",opacity:"0.06",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH___T6FMuhnK01__JHASH__")}},"#0F2224":{doodle:"dark",opacity:"0.06",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__OexHcU3aDZG__JHASH__")}},"#0E2125":{doodle:"dark",opacity:"0.055",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__tOx0SYszJi5__JHASH__")}},"#1F1D25":{doodle:"dark",opacity:"0.06",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__PNcqr5a8aqn__JHASH__")}},"#212121":{doodle:"dark",opacity:"0.055",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__btCyT87_iNH__JHASH__")}},"#1F211C":{doodle:"dark",opacity:"0.055",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__IY_B4p8e-7O__JHASH__")}},"#23231B":{doodle:"dark",opacity:"0.055",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__AYik5KLtzUF__JHASH__")}},"#262419":{doodle:"dark",opacity:"0.055",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__8fGP1jzZcbB__JHASH__")}},"#261F17":{doodle:"dark",opacity:"0.055",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__FHGGkoP0bnm__JHASH__")}},"#261717":{doodle:"dark",opacity:"0.055",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__0m3XdO6xkwg__JHASH__")}},"#260F10":{doodle:"dark",opacity:"0.06",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__a0k57jjuNN3__JHASH__")}},"#260A10":{doodle:"dark",opacity:"0.07",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__GuQnkSbSCOo__JHASH__")}},"#19050B":{doodle:"dark",opacity:"0.075",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__ZioDO4s3Qqe__JHASH__")}},"#21100C":{doodle:"dark",opacity:"0.07",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__Rqy0ZYerMtI__JHASH__")}},"#0F0C0C":{doodle:"dark",opacity:"0.065",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__Z4mMZDf0ffL__JHASH__")}},"#101919":{doodle:"dark",opacity:"0.06",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__7NNWIt-nj1d__JHASH__")}},"#0A1D25":{doodle:"dark",opacity:"0.055",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__0_O8wBizFd7__JHASH__")}},"#0D1523":{doodle:"dark",opacity:"0.065",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__9mkS63Kb8to__JHASH__")}},"#0D0F11":{doodle:"dark",opacity:"0.07",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__Z_7terrJYHu__JHASH__")}},"#0A0C0D":{doodle:"dark",opacity:"0.07",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__ceDtKhGwi8r__JHASH__")}},"#110B12":{doodle:"dark",opacity:"0.07",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__QG7EKFPmISV__JHASH__")}},"#1E1F1F":{doodle:"dark",opacity:"0.055",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__XU-1fF5C2OR__JHASH__")}},"#262618":{doodle:"dark",opacity:"0.055",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__pejCI0-I_df__JHASH__")}},"#23231F":{doodle:"dark",opacity:"0.055",getAriaLabel:function(){return h._(/*BTDS*/"__JHASH__m_bkh7agn4e__JHASH__")}}},q=Object.keys(o),r=Object.keys(p);function s(a){return a==="light"?q:r}function a(a,b){var c=s(b);if(a===i)return i;c=c.findIndex(function(b){return b.toUpperCase()===a.toUpperCase()});return c!==-1?b==="light"?r[c]:q[c]:a}function b(a,b){b=s(b);return a===i?!0:b.some(function(b){return b.toUpperCase()===a.toUpperCase()})}function t(a,b,c){b=b==="light"?o:p;for(var d in b)if(d.toUpperCase()===a.toUpperCase())return b[d][c];return null}function c(a,b){var c=t(a,b,"opacity");if(c)return c;return b==="light"&&a===i?d("WAWebUIRefreshGatingUtils").uiRefreshM1Enabled()?l:k:j}function e(a,b){if(a==null)return null;b=b==="light"?o:p;a=(b=b[a])==null?void 0:b.getAriaLabel==null?void 0:b.getAriaLabel();return a}function f(a,b){if(b==="light"&&a!==i){var c=t(a,b,"doodle");if(c)return"data-asset-chat-background-"+c}c="data-asset-chat-background-"+b;b==="light"&&a===i&&(d("WAWebUIRefreshGatingUtils").uiRefreshM1Enabled()?c=n:c=m);return c}function u(a,b){return a==="light"&&b!==i?!!t(b,a,"invertTransparentWallpaperColors"):!1}g.DEFAULT_CHAT_WALLPAPER=i;g.getWallpaperColors=s;g.toggleWallpaperColor=a;g.colorExistsInTheme=b;g.getWallpaperColorPropValue=t;g.getDoodleOpacity=c;g.getWallpaperColorAriaLabel=e;g.getDoodleAssetName=f;g.invertTransparentWallpaperColors=u}),226); __d("WAWebChatPreferenceCollection",["WANullthrows","WAWebBaseCachePolicy","WAWebBaseCollection","WAWebChatPreferenceModel","WAWebUserPrefsKeys","WAWebWallpaper"],(function(a,b,c,d,e,f,g){var h={id:d("WAWebChatPreferenceModel").DEFAULT_PREFERENCE,wallpaper:d("WAWebWallpaper").DEFAULT_CHAT_WALLPAPER,saveToCameraRoll:!0,showDoodle:!0,spellcheck:!0,transformTextEmoji:!0,enterIsSend:!0,showExpandedComposer:!1,autoplayAnimatedImages:!0,hdMediaEnabled:!1};a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}var e=b.prototype;e.initializeFromCache=function(a){a=a||[];this.add([h].concat(a),{merge:!0})};e.get=function(b){return a.prototype.get.call(this,b)||a.prototype.get.call(this,d("WAWebChatPreferenceModel").DEFAULT_PREFERENCE)};e.getDefault=function(){return c("WANullthrows")(a.prototype.get.call(this,d("WAWebChatPreferenceModel").DEFAULT_PREFERENCE))};e["delete"]=function(){a.prototype["delete"].call(this),this.add(h)};return b}(d("WAWebBaseCollection").BaseCollection);a.model=d("WAWebChatPreferenceModel").ChatPreference;a.cachePolicy={id:d("WAWebUserPrefsKeys").COLLECTIONS_KEYS.CHAT_PREFERENCE_COLLECTION,policy:d("WAWebBaseCachePolicy").CACHE_POLICY.LOAD,delay:1e3};b=new a();g["default"]=b}),98); __d("WAWebChatPreferenceModel",["WAWebBaseModel","WAWebChatPreferenceCollection","WAWebWid"],(function(a,b,c,d,e,f,g){a="defaultPreference";b=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.wallpaper=d("WAWebBaseModel").prop(),c.saveToCameraRoll=d("WAWebBaseModel").prop(),c.showDoodle=d("WAWebBaseModel").prop(),c.spellcheck=d("WAWebBaseModel").prop(),c.transformTextEmoji=d("WAWebBaseModel").prop(),c.enterIsSend=d("WAWebBaseModel").prop(),c.showExpandedComposer=d("WAWebBaseModel").prop(),c.autoplayAnimatedImages=d("WAWebBaseModel").prop(),c.hdMediaEnabled=d("WAWebBaseModel").prop(),b)||babelHelpers.assertThisInitialized(c)}var e=b.prototype;e.getCollection=function(){return c("WAWebChatPreferenceCollection")};return b}(d("WAWebBaseModel").BaseModel);b.Proxy="chatPreference";b.idClass=c("WAWebWid");b.allowedIds=[a];e=d("WAWebBaseModel").defineModel(b);g.DEFAULT_PREFERENCE=a;g.ChatPreference=e}),98); __d("WAWebChatUnreadMentionCollection",["WAWebCollection","WAWebUnreadMentionModel"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}var c=b.prototype;c.oldestUnreadMention=function(){var a;a=(a=this.last())!=null?a:null;a&&this.remove(a);return a};return b}(c("WAWebCollection"));a.model=c("WAWebUnreadMentionModel");a.comparator=function(a,b){return b.timestamp-a.timestamp};g["default"]=a}),98); __d("WAWebChatGetMessage",["WAWebAck","WAWebCommonMsgUtils","WAWebMsgDataUtils","WAWebMsgGetters","WAWebStateUtils"],(function(a,b,c,d,e,f,g){function a(a){a=d("WAWebStateUtils").unproxy(a);for(var b=a.msgs.length-1;b>=0;b--){var c=a.msgs.at(b);if(c&&(!c.local||c.ack>d("WAWebAck").ACK.CLOCK))return c}return void 0}function b(a){a=d("WAWebStateUtils").unproxy(a);for(var b=a.msgs.length-1;b>=0;b--){var c=a.msgs.at(b);if(c&&d("WAWebMsgDataUtils").eventTypeFromMsgType(c)!==d("WAWebCommonMsgUtils").EventType.IGNORE)return c}return void 0}function c(a){a=d("WAWebStateUtils").unproxy(a);for(var b=a.msgs.length-1;b>=0;b--){var c=a.msgs.at(b);if(c!=null&&d("WAWebMsgGetters").getIsSentByMe(c))return c}return void 0}g.getLastReceivedMsg=a;g.getLastTimestampMsg=b;g.getLastSentMsg=c}),98); __d("WAWebChatUpdates",["WAAbortError","WAPromiseDelays","WARaceSignal","WAWebChatGetMessage","WAWebChatLoadMessages","WAWebDBUpdateChatTable","WAWebNoop"],(function(a,b,c,d,e,f,g){function a(a){var b=Number(a.mute.expiration);d("WAWebDBUpdateChatTable").updateChatTable(a.id,{muteExpiration:b}).then(function(){return a.muteExpiration=b})}function b(a){if(a.promises.updateSortTime)return;var b=new AbortController(),e=b.signal;e=c("WARaceSignal")([e,a.getAbortController().signal],function(b){return d("WAPromiseDelays").delayMs(0).then(function(){var b=d("WAWebChatGetMessage").getLastTimestampMsg(a);if(b){a.t=b.t;return}else if(a.msgs.msgLoadState.noEarlierMsgs)return;else if(a.pendingMsgs)return;return d("WAWebChatLoadMessages").loadEarlierMsgs(a)}).then(function(c){if(b.aborted)throw new(d("WAAbortError").AbortError)();if(c){c=d("WAWebChatGetMessage").getLastTimestampMsg(a);a.t=c?c.t:void 0}})["catch"](c("WAWebNoop"))["finally"](function(){a.promises.updateSortTime=void 0})});a.promises.updateSortTime={promise:e,abortController:b}}g.updateMuteExpiration=a;g.updateSortTime=b}),98); __d("WAWebMuteCollection",["WALogger","WAWebBaseCachePolicy","WAWebBaseCollection","WAWebConnModel","WAWebMuteModel","WAWebUserPrefsKeys","WAWebUserPrefsNotifications","WAWebUserPrefsStore","gkx"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["models:mute:cache-save: globalMuteModel or globalReactionsMuteModel does not exist"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["models:mute:cache-save: ",""]);i=function(){return a};return a}var j=!0,k=!0,l=!1,m=!1,n=!1,o=!1,p=!1,q=!1;a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}var e=b.prototype;e.initializeFromCache=function(a){var b=this;Array.isArray(a)?a.forEach(function(a){[d("WAWebMuteModel").GLOBAL_MUTE,d("WAWebMuteModel").GLOBAL_REACTIONS_MUTE].includes(a.id)&&b.add(a,{remove:!1})}):a!=null&&a.id===d("WAWebMuteModel").GLOBAL_MUTE&&this.add(a,{remove:!1});this.setGlobalNotifications(d("WAWebUserPrefsNotifications").getGlobalNotifications());this.setGlobalOfflineNotifications(d("WAWebUserPrefsNotifications").getGlobalOfflineNotifications());this.setGlobalSounds(d("WAWebUserPrefsNotifications").getGlobalSounds());this.setGlobalCallRingtone(d("WAWebUserPrefsNotifications").getGlobalCallRingtone());this.setGlobalPreviews(d("WAWebUserPrefsNotifications").getGlobalPreviews());this.setCollapseMuted(d("WAWebUserPrefsNotifications").getCollapseMuted());this.setOutgoingMessageSound(d("WAWebUserPrefsNotifications").getOutgoingMessageSound());this.setIgnoreNondirectGroupMsg(d("WAWebUserPrefsNotifications").getIgnoreNondirectGroupMsg())};e.saveToCache=function(){if(!d("WAWebConnModel").Conn.shouldSaveToCache())return;var a=this.constructor.cachePolicy.id,b=[];d("WALogger").LOG(i(),String(a));var e=this.get(d("WAWebMuteModel").GLOBAL_MUTE),f=this.get(d("WAWebMuteModel").GLOBAL_REACTIONS_MUTE);e&&b.push(e.toJSON());f&&b.push(f.toJSON());b.length?c("WAWebUserPrefsStore").setCollection(a,b):d("WALogger").WARN(h())};e.globalMute=function(){var a=this.get(d("WAWebMuteModel").GLOBAL_MUTE);if(a)return a;a=new(d("WAWebMuteModel").Mute)({id:d("WAWebMuteModel").GLOBAL_MUTE});this.add(a);return a};e.globalReactionsMute=function(){var a=this.get(d("WAWebMuteModel").GLOBAL_REACTIONS_MUTE);if(a)return a;a=new(d("WAWebMuteModel").Mute)({id:d("WAWebMuteModel").GLOBAL_REACTIONS_MUTE});this.add(a);return a};e.getGlobalSounds=function(){return j};e.setGlobalSounds=function(a){j=a,d("WAWebUserPrefsNotifications").setGlobalSounds(a)};e.getGlobalCallRingtone=function(){return k};e.setGlobalCallRingtone=function(a){k=a,d("WAWebUserPrefsNotifications").setGlobalCallRingtone(a)};e.getGlobalNotifications=function(){return l};e.setGlobalNotifications=function(a){l=a,d("WAWebUserPrefsNotifications").setGlobalNotifications(a)};e.getGlobalOfflineNotifications=function(){return m};e.setGlobalOfflineNotifications=function(a){m=a,d("WAWebUserPrefsNotifications").setGlobalOfflineNotifications(a)};e.getGlobalPreviews=function(){return n};e.setGlobalPreviews=function(a){n=a,d("WAWebUserPrefsNotifications").setGlobalPreviews(a)};e.getCollapseMuted=function(){return o};e.setCollapseMuted=function(a){o=a,d("WAWebUserPrefsNotifications").setCollapseMuted(a),this.trigger("change:collapseMuted",o)};e.getOutgoingMessageSound=function(){return p};e.setOutgoingMessageSound=function(a){p=a,d("WAWebUserPrefsNotifications").setOutgoingMessageSound(a)};e.getIgnoreNondirectGroupMsg=function(){return c("gkx")("26258")?!1:q};e.setIgnoreNondirectGroupMsg=function(a){if(c("gkx")("26258"))return;q=a;d("WAWebUserPrefsNotifications").setIgnoreNondirectGroupMsg(a)};return b}(d("WAWebBaseCollection").BaseCollection);a.model=d("WAWebMuteModel").Mute;a.cachePolicy={id:d("WAWebUserPrefsKeys").COLLECTIONS_KEYS.MUTE_COLLECTION,policy:d("WAWebBaseCachePolicy").CACHE_POLICY.LOAD,delay:1e3};b=new a();g.MuteCollection=b}),98); __d("WAWebMuteModel",["fbt","Promise","WALogger","WATypeUtils","WAWeb-moment","WAWebActionToast.react","WAWebAlarm","WAWebBaseModel","WAWebChatMuteBridge","WAWebGroupMetadataCollection","WAWebMiscErrors","WAWebMuteCollection","WAWebMuteGetters","WAWebNewsletterGatingUtils","WAWebNewsletterMetadataCollection","WAWebNewsletterToggleMuteStateAction","WAWebToastManager","WAWebUserPrefsMeUser","WAWebWamEnumChannelEventSurface","WAWebWid","err","react"],(function(a,b,c,d,e,f,g,h){var i,j;function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["models:Mute:unmuteCall ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["models:Mute:unmute dropped"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["models:Mute:unmute ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["models:Mute:muteCall "," duration:",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["models:Mute:muteCall "," muted, no expiration"]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["models:Mute:muteCall called with wrong units?"," exp:",""]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["models:Mute:muteCall called with invalid expiration ",""]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["models:Mute:mute dropped"]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["models:Mute:mute "," duration:",""]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["models:Mute:mute "," muted, no expiration"]);t=function(){return a};return a}function u(){var a=babelHelpers.taggedTemplateLiteralLoose(["models:Mute:mute called with wrong units?"," exp:",""]);u=function(){return a};return a}function v(){var a=babelHelpers.taggedTemplateLiteralLoose(["models:Mute:mute called with invalid expiration ",""]);v=function(){return a};return a}var w=j||c("react"),x=-1;a="global_mute";e="global_reactions_mute";function y(a,b){if(c("WAWebWid").isGroup(a)&&!b)return"group";return c("WAWebWid").isNewsletter(a)&&!b?"newsletter":"chat"}f=function(a){babelHelpers.inheritsLoose(e,a);function e(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.expiration=d("WAWebBaseModel").prop(0),c.callExpiration=d("WAWebBaseModel").prop(0),c.isAutoMuted=d("WAWebBaseModel").prop(!1),c.$MuteImpl$p_1=d("WAWebBaseModel").session(),c.$MuteImpl$p_2=d("WAWebBaseModel").session(),c.promises=d("WAWebBaseModel").session(function(){return{mute:null,unmute:null}}),b)||babelHelpers.assertThisInitialized(c)}var f=e.prototype;f.initialize=function(){a.prototype.initialize.call(this),this.expiration!=null&&this.expiration!==0&&this.mute({expiration:this.expiration,isAutoMuted:this.isAutoMuted}),this.callExpiration!=null&&this.callExpiration!==0&&this.muteCall(this.callExpiration)};f.setMute=function(a,b,c){b===void 0&&(b=!1);if(!a&&!this.expiration||a===this.expiration)return;a?this.mute({expiration:a,isAutoMuted:b,sendDevice:c}):this.unmute({sendDevice:c})};f.setAutoMuted=function(a){this.set({isAutoMuted:a})};f.mute=function(a){var e=this,f=a.expiration,g=a.sendDevice,j=a.toastId,k=a.fromMultiselect,l=k===void 0?!1:k;k=a.isAutoMuted;var m=k===void 0?!1:k;k=a.showToast;a=k===void 0?!0:k;var n=f;if(!d("WATypeUtils").isNumber(n)){d("WALogger").LOG(v(),n);return(i||(i=b("Promise"))).reject(new(d("WAWebMiscErrors").ActionError)())}n=Math.round(n);n>2e9&&d("WALogger").LOG(u(),this.id.toString(),n);var o=function(){d("WAWebMuteGetters").getIsMuted(e)&&(c("WAWebAlarm").clearTimeout(e.$MuteImpl$p_1),e.unset("_unmuteTimer"));if(n===x)d("WALogger").LOG(t(),e.id.toString());else{var a=n-c("WAWeb-moment")().unix();d("WALogger").LOG(s(),e.id.toString(),a);e.$MuteImpl$p_1=c("WAWebAlarm").setGlobalTimeout(function(){return void e.unmute()},n*1e3)}e.set({expiration:n,isAutoMuted:m})},p=y(this.id,l);if(g===!0){if(!c("WAWebWid").isNewsletter(this.id)&&this.promises.mute!=null)return this.promises.mute;f=c("WAWebWid").isNewsletter(this.id)?(k=this.promises.mute)!=null?k:(i||(i=b("Promise"))).reject(c("err")("No promise for newsletter mute")):this.promises.mute=d("WAWebChatMuteBridge").sendConversationMute(this.id,n,this.expiration);k=new(d("WAWebActionToast.react").ActionType)(h._(/*BTDS*/"__JHASH__A-71-2GYfp5__JHASH__"));p==="group"?k=new(d("WAWebActionToast.react").ActionType)(h._(/*BTDS*/"__JHASH__I5ER3RNRZAO__JHASH__")):p==="newsletter"&&(k=new(d("WAWebActionToast.react").ActionType)(h._(/*BTDS*/"__JHASH__bKuUecnoqbG__JHASH__")));var q=(j=j)!=null?j:d("WAWebActionToast.react").genId();j=this.promises.mute["catch"](function(a){d("WALogger").WARN(r()).devConsole(a);a=h._(/*BTDS*/"__JHASH__Rr7Bwvk8UMH__JHASH__");p==="group"?a=h._(/*BTDS*/"__JHASH__wijG-ixUZdQ__JHASH__"):p==="newsletter"&&(k=new(d("WAWebActionToast.react").ActionType)(h._(/*BTDS*/"__JHASH__mKlhymQAMsi__JHASH__")));if(c("WAWebWid").isNewsletter(e.id))return;throw new(d("WAWebActionToast.react").ActionType)(a,{actionText:h._(/*BTDS*/"__JHASH__TyKOR8KAtP1__JHASH__"),actionHandler:function(){return e.mute({expiration:n,isAutoMuted:m,sendDevice:g,toastId:q})}})}).then(function(a){if(a.status===200){var b=h._(/*BTDS*/"__JHASH__TRe5uHR0YLR__JHASH__");p==="group"?b=h._(/*BTDS*/"__JHASH__DT6wor5vt0V__JHASH__"):p==="newsletter"&&(b=h._(/*BTDS*/"__JHASH__Rvc0kQNLrc8__JHASH__"));return l?new(d("WAWebActionToast.react").ActionType)(b):new(d("WAWebActionToast.react").ActionType)(b,{actionText:h._(/*BTDS*/"__JHASH__mpD8GydGn1Q__JHASH__"),actionHandler:function(){return c("WAWebWid").isNewsletter(e.id)?d("WAWebNewsletterToggleMuteStateAction").unmuteNewsletterAction(e.id,{eventSurface:d("WAWebWamEnumChannelEventSurface").CHANNEL_EVENT_SURFACE.CHANNEL_PROFILE}):e.unmute({sendDevice:g,toastId:q})}})}else if(a.status>=400){if(p==="newsletter")throw new(d("WAWebActionToast.react").ActionType)(h._(/*BTDS*/"__JHASH__JA8yTrE4C2a__JHASH__"));if(p==="group")throw new(d("WAWebActionToast.react").ActionType)(h._(/*BTDS*/"__JHASH__wijG-ixUZdQ__JHASH__"));throw new(d("WAWebActionToast.react").ActionType)(h._(/*BTDS*/"__JHASH__Rr7Bwvk8UMH__JHASH__"))}});a&&d("WAWebToastManager").ToastManager.open(w.jsx(d("WAWebActionToast.react").ActionToast,{id:q,initialAction:k,pendingAction:j}));return f.then(function(a){a.status===200&&o()})["finally"](function(){e.promises.mute=null})}o();return(i||(i=b("Promise"))).resolve()};f.muteCall=function(a){var e=this;a=a;if(!d("WATypeUtils").isNumber(a)){d("WALogger").LOG(q(),a);return(i||(i=b("Promise"))).reject(new(d("WAWebMiscErrors").ActionError)())}a=Math.round(a);a>2e9&&d("WALogger").LOG(p(),this.id.toString(),a);d("WAWebMuteGetters").getIsCallMuted(this)&&(c("WAWebAlarm").clearTimeout(this.$MuteImpl$p_2),this.unset("_unmuteCallTimer"));if(a===x)d("WALogger").LOG(o(),this.id.toString());else{var f=a-c("WAWeb-moment")().unix();d("WALogger").LOG(n(),this.id.toString(),f);this.$MuteImpl$p_2=c("WAWebAlarm").setGlobalTimeout(function(){return void e.unmuteCall()},a*1e3)}this.set({callExpiration:a});return(i||(i=b("Promise"))).resolve()};f.canMute=function(){var a=!1;if(d("WAWebUserPrefsMeUser").isMeAccount(this.id))return!1;if(c("WAWebWid").isGroup(this.id)){var b=c("WAWebGroupMetadataCollection").get(this.id);b&&(a=b.participants.iAmMember())}if(d("WAWebNewsletterGatingUtils").isNewsletterEnabled()&&c("WAWebWid").isNewsletter(this.id)){b=c("WAWebNewsletterMetadataCollection").get(this.id);b!=null&&(a=b.canBeMuted)}return a||c("WAWebWid").isUser(this.id)};f.$MuteImpl$p_3=function(){c("WAWebAlarm").clearTimeout(this.$MuteImpl$p_1),this.unset("_unmuteTimer"),this.expiration=0};f.$MuteImpl$p_4=function(){c("WAWebAlarm").clearTimeout(this.$MuteImpl$p_2),this.unset("_unmuteCallTimer"),this.callExpiration=0};f.unmute=function(a){var e=this;a=a===void 0?{}:a;var f=a.sendDevice,g=a.toastId,j=a.fromMultiselect;j=j===void 0?!1:j;a=a.showToast;a=a===void 0?!0:a;var k=!1,n=function(){d("WALogger").LOG(m(),e.id.toString()),e.$MuteImpl$p_3(),e.set({isAutoMuted:k})},o=y(this.id,j);if(f===!0){if(!c("WAWebWid").isNewsletter(this.id)&&this.promises.unmute)return this.promises.unmute;j=c("WAWebWid").isNewsletter(this.id)?(j=this.promises.unmute)!=null?j:(i||(i=b("Promise"))).reject(c("err")("No promise for newsletter mute")):this.promises.unmute=d("WAWebChatMuteBridge").sendConversationMute(this.id,0,this.expiration);var p=new(d("WAWebActionToast.react").ActionType)(h._(/*BTDS*/"__JHASH__5g5YHDl4zDx__JHASH__"));o==="group"?p=new(d("WAWebActionToast.react").ActionType)(h._(/*BTDS*/"__JHASH__uRpmBQawSKm__JHASH__")):o==="newsletter"&&(p=new(d("WAWebActionToast.react").ActionType)(h._(/*BTDS*/"__JHASH__WpkvEX3hVVN__JHASH__")));var q=g||d("WAWebActionToast.react").genId();g=this.promises.unmute["catch"](function(a){d("WALogger").WARN(l()).devConsole(a);a=h._(/*BTDS*/"__JHASH__zPpteKOLzKR__JHASH__");o==="group"?a=h._(/*BTDS*/"__JHASH__hct5aFZjAxX__JHASH__"):o==="newsletter"&&(a=h._(/*BTDS*/"__JHASH__S2v6fejAzh8__JHASH__"));if(c("WAWebWid").isNewsletter(e.id))return;throw new(d("WAWebActionToast.react").ActionType)(a,{actionText:h._(/*BTDS*/"__JHASH__TyKOR8KAtP1__JHASH__"),actionHandler:function(){return e.unmute({sendDevice:f,toastId:q})}})}).then(function(a){if(a.status===200){if(o==="group")return new(d("WAWebActionToast.react").ActionType)(h._(/*BTDS*/"__JHASH__d2HJ39uOp-V__JHASH__"));return o==="newsletter"?new(d("WAWebActionToast.react").ActionType)(h._(/*BTDS*/"__JHASH__ciGDRYU5JsN__JHASH__"),{actionText:h._(/*BTDS*/"__JHASH__mpD8GydGn1Q__JHASH__"),actionHandler:function(){return d("WAWebNewsletterToggleMuteStateAction").muteNewsletterAction(e.id,{eventSurface:d("WAWebWamEnumChannelEventSurface").CHANNEL_EVENT_SURFACE.CHANNEL_THREAD})}}):new(d("WAWebActionToast.react").ActionType)(h._(/*BTDS*/"__JHASH__i5pUe5uS9gs__JHASH__"))}else if(a.status>=400){if(o==="newsletter")throw new(d("WAWebActionToast.react").ActionType)(h._(/*BTDS*/"__JHASH__EZgoVd5_6s-__JHASH__"));if(o==="group")throw new(d("WAWebActionToast.react").ActionType)(h._(/*BTDS*/"__JHASH__hct5aFZjAxX__JHASH__"));throw new(d("WAWebActionToast.react").ActionType)(h._(/*BTDS*/"__JHASH__zPpteKOLzKR__JHASH__"))}});a&&d("WAWebToastManager").ToastManager.open(w.jsx(d("WAWebActionToast.react").ActionToast,{id:q,initialAction:p,pendingAction:g}));return j.then(function(a){a.status===200&&n()})["finally"](function(){e.promises.unmute=null})}n();return(i||(i=b("Promise"))).resolve()};f.unmuteCall=function(){d("WALogger").LOG(k(),this.id.toString());this.$MuteImpl$p_4();return(i||(i=b("Promise"))).resolve()};f["delete"]=function(){a.prototype["delete"].call(this),this.getCollection().remove(this.id),this.$MuteImpl$p_3(),d("WAWebMuteGetters").clearMuteGetterCacheFor(this)};f.getCollection=function(){return d("WAWebMuteCollection").MuteCollection};return e}(d("WAWebBaseModel").BaseModel);f.Proxy="mute";f.idClass=c("WAWebWid");f.allowedIds=[a,e];f=d("WAWebBaseModel").defineModel(f);g.GLOBAL_MUTE=a;g.GLOBAL_REACTIONS_MUTE=e;g.Mute=f}),226); __d("WAWebSuperChatMsgs",["WALogger","WAWebBaseModel","WAWebChatMsgsCollection","err","lodash"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["model:Chat:replaceMsgsCollection:",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["models:Chat:removeMsg ",""]);i=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.pendingMsgs=d("WAWebBaseModel").prop(),c.labels=d("WAWebBaseModel").prop(),c.msgChunks=d("WAWebBaseModel").session(function(){return[]}),c.lastReceivedKey=d("WAWebBaseModel").session(),c.unreadMsgAnchor=d("WAWebBaseModel").session(),c.disableUnreadAnchor=d("WAWebBaseModel").session(),c.msgsLength=d("WAWebBaseModel").session(),c.msgsChanged=d("WAWebBaseModel").session(0),c.msgs=d("WAWebBaseModel").collection(d("WAWebChatMsgsCollection").ChatMsgsCollection),b)||babelHelpers.assertThisInitialized(c)}var e=b.prototype;e.initialize=function(){var b=this;a.prototype.initialize.call(this);this.listenTo(this.msgs,"change:last",function(){b.msgsChanged++});this.listenTo(this.msgs,"add remove bulk_add",function(){b.msgsChanged++,b.msgsLength=b.msgs.length})};e.onEmptyMRM=function(){throw c("err")("onEmptyMRM not implemented")};e["delete"]=function(){a.prototype["delete"].call(this),this.getAllCMCs().forEach(function(a){a.forEach(function(a){a["delete"]()}),a["delete"]()})};e.removeMsg=function(a){var b=a.msgChunk;if(!b)return;var c=b.indexOf(a);if(c<0)return;d("WALogger").LOG(i(),a.get("id"));b.remove(a);b.length===0&&(b===this.msgs?this.onEmptyMRM():this.removeMsgsCollection(b))};e.getAllCMCs=function(){return this.msgChunks.concat([this.msgs])};e.getAllMsgs=function(){return c("lodash").flatten(this.getAllCMCs().map(function(a){return a.getModelsArray()}))};e.replaceMsgsCollection=function(a){d("WALogger").LOG(h(),this.id.toString());var b={msg:a.last()};this.msgs.replace(a);this.notifyMsgCollectionMerge(a,this.msgs,this.msgs,b);this.msgChunks=c("lodash").without(this.msgChunks,a);a["delete"]()};e.removeMsgsCollection=function(a){this.msgChunks=c("lodash").without(this.msgChunks,a),a["delete"]()};e.notifyMsgCollectionMerge=function(a,b,c,d){this.trigger("change:cmc:merge",a,b,c,d)};return b}(d("WAWebBaseModel").BaseModel);g["default"]=a}),98); __d("WAWebContactCollection",["Promise","WALogger","WAWebBaseCollection","WAWebContactComparator","WAWebContactGetters","WAWebContactModel","WAWebSocketConstants","WAWebSocketModel","WAWebUserPrefsMeUser","WAWebWid","lodash"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Store:Contact init from cache"]);i=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var e;e=a.call(this)||this;e._sort=c("lodash").debounce(function(){return a.prototype.sort.call(babelHelpers.assertThisInitialized(e))},1e3);e._silentSort=c("lodash").debounce(function(){return a.prototype.sort.call(babelHelpers.assertThisInitialized(e),{silent:!0})},1e3);e.findImpl=function(a){var c=e.get(a);return c?(h||(h=b("Promise"))).resolve({id:c.id,stale:c.stale}):(h||(h=b("Promise"))).resolve({id:a})};e.listenTo(d("WAWebSocketModel").Socket,"change:stream",function(){d("WAWebSocketModel").Socket.stream===d("WAWebSocketConstants").SOCKET_STREAM.RESUMING&&e.forEach(function(a){a.unset("verificationString"),a.unset("verificationBinary")})});return e}var f=e.prototype;f.sort=function(a){return this};f.ensureSorted=function(){this._sort.flush()};f.initializeFromCache=function(a){if(!a)return;d("WALogger").LOG(i());this.add(a,{silent:!0,merge:!0})};f.isFilteredContact=function(a){return!!a.name&&!d("WAWebContactGetters").getIsMe(a)&&!d("WAWebContactGetters").getIsPSA(a)&&d("WAWebContactGetters").getIsWAContact(a)};f.getFilteredContacts=function(a){var b=a.showMe;b=b===void 0?!1:b;var e=a.showWithoutName;e=e===void 0?!1:e;var f=a.includeLidContacts;f=f===void 0?!1:f;var g=a.filterFn;g=g===void 0?null:g;a=a.cancelAt;a=a===void 0?null:a;var h=[];for(var i of this._models){if(a!=null&&h.length>=a){h=[];break}if(i.id.isLid()){if(f===!1)continue}else if(i.id.isBot())continue;else if(c("WAWebWid").isPSA(i.id))continue;else if(d("WAWebContactGetters").getIsMe(i)){if(b){if(g!=null&&g(i)!==!0)continue;h.push(i)}continue}if(!(i.name||e)||!d("WAWebContactGetters").getIsWAContact(i))continue;if(g!=null&&g(i)!==!0)continue;h.push(i)}return h.sort(d("WAWebContactComparator").ContactComparator)};f.getGroupContacts=function(){return this.filter(function(a){return d("WAWebContactGetters").getIsGroup(a)})};f.getMeContact=function(){var a=d("WAWebUserPrefsMeUser").getMaybeMeUser();return a==null?null:this.get(a)};f.getMeLidContact=function(){var a=d("WAWebUserPrefsMeUser").getMaybeMeLidUser();return a==null?null:this.get(a)};return e}(d("WAWebBaseCollection").BaseCollection);a.model=c("WAWebContactModel");a.comparator=d("WAWebContactComparator").ContactComparator;e=new a();g.ContactCollectionImpl=a;g.ContactCollection=e}),98); __d("WAWebContactModel",["fbt","WALogger","WATimeUtils","WAWebAlarm","WAWebApiContact","WAWebBaseModel","WAWebBizBusinessChangeAction","WAWebBizGatingUtils","WAWebBizLabelUtils","WAWebBlocklistCollection","WAWebBotGating","WAWebBusinessProfileCollection","WAWebConnModel","WAWebContactCollection","WAWebContactGetters","WAWebContactManagementGating","WAWebContactShortName","WAWebFrontendContactGetters","WAWebL10N","WAWebListsGatingUtils","WAWebOptOutListCollection","WAWebProfilePicThumbCollection","WAWebTextStatusCollection","WAWebTextStatusGatingUtils","WAWebTextStatusUtils","WAWebUpdateTextStatusForContact","WAWebUsernameGatingUtils","WAWebWid","WAWebWidFactory"],(function(a,b,c,d,e,f,g,h){function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["contact:onPendingActionUpdate pendingAction value is invalid"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["contact:getStatus for non-user ",""]);j=function(){return a};return a}var k=1e3;a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.name=d("WAWebBaseModel").prop(),c.shortName=d("WAWebBaseModel").prop(),c.pushname=d("WAWebBaseModel").prop(),c.type=d("WAWebBaseModel").prop("in"),c.verifiedName=d("WAWebBaseModel").prop(),c.isBusiness=d("WAWebBaseModel").prop(),c.isEnterprise=d("WAWebBaseModel").prop(),c.isSmb=d("WAWebBaseModel").prop(),c.verifiedLevel=d("WAWebBaseModel").prop(),c.privacyMode=d("WAWebBaseModel").prop(),c.statusMute=d("WAWebBaseModel").prop(),c.sectionHeader=d("WAWebBaseModel").prop(),c.labels=d("WAWebBaseModel").prop(),c.isContactSyncCompleted=d("WAWebBaseModel").prop(),c.forcedBusinessUpdateFromServer=d("WAWebBaseModel").prop(),c.disappearingModeDuration=d("WAWebBaseModel").prop(),c.disappearingModeSettingTimestamp=d("WAWebBaseModel").prop(),c.textStatusString=d("WAWebBaseModel").prop(),c.textStatusEmoji=d("WAWebBaseModel").prop(),c.textStatusEphemeralDuration=d("WAWebBaseModel").prop(),c.textStatusLastUpdateTime=d("WAWebBaseModel").prop(d("WAWebTextStatusUtils").TEXT_STATUS_NOT_FETCHED),c.textStatusExpiryTs=d("WAWebBaseModel").prop(),c.requestedPnTimestamp=d("WAWebBaseModel").prop(),c.username=d("WAWebBaseModel").prop(),c.usernamePin=d("WAWebBaseModel").prop(),c.syncToAddressbook=d("WAWebBaseModel").prop(!1),c.isContactBlocked=d("WAWebBaseModel").session(!1),c.isContactOptedOut=d("WAWebBaseModel").session(!1),c.isEverOptedOutOfMarketingMessages=d("WAWebBaseModel").session(!1),c.isMarketingMessageThread=d("WAWebBaseModel").session(!1),c.verificationString=d("WAWebBaseModel").session(),c.verificationBinary=d("WAWebBaseModel").session(),c.pendingAction=d("WAWebBaseModel").session(),c.promises=d("WAWebBaseModel").session(function(){return{}}),c.status=d("WAWebBaseModel").session(),c.profilePicThumb=d("WAWebBaseModel").session(),c.businessProfile=d("WAWebBaseModel").session(),c.commonGroups=d("WAWebBaseModel").session(),c.businessCatalog=d("WAWebBaseModel").session(),c.locale=d("WAWebBaseModel").session(),c.shareOwnPn=d("WAWebBaseModel").session(),c.phoneNumber=d("WAWebBaseModel").session(),c.displayNameLID=d("WAWebBaseModel").session(),c.isHosted=d("WAWebBaseModel").session(!1),c.isOrHasBeenHosted=d("WAWebBaseModel").session(!1),c.isFavorite=d("WAWebBaseModel").session(!1),c.meTextStatusExpiryTimer=d("WAWebBaseModel").session(),c.maybeCommonGroupChatModel=d("WAWebBaseModel").session(),b)||babelHelpers.assertThisInitialized(c)}var e=b.prototype;e.$Contact$p_1=function(){var a;c("WAWebAlarm").clearTimeout(this.meTextStatusExpiryTimer);this.unset(["meTextStatusExpiryTimer"]);void d("WAWebUpdateTextStatusForContact").updateTextStatusForContact(this.id,(a=d("WAWebTextStatusUtils")).CLEAR_TEXT_STATUS_STRING_VAL,a.CLEAR_TEXT_STATUS_EMOJI_VAL,a.CLEAR_TEXT_STATUS_EPHEMERAL_DURATION_VAL,a.CLEAR_TEXT_STATUS_LAST_UPDATE_TIME_VAL)};e.setupStatusExpiration=function(){var a=this,b=this.textStatusExpiryTs;b!=null&&(this.meTextStatusExpiryTimer!=null&&c("WAWebAlarm").clearTimeout(this.meTextStatusExpiryTimer),b<d("WATimeUtils").unixTime()?self.setTimeout(function(){void a.$Contact$p_1()}):this.meTextStatusExpiryTimer=c("WAWebAlarm").setGlobalTimeout(function(){return a.$Contact$p_1()},b*k,this.meTextStatusExpiryTimer))};e.initialize=function(){var b=this;a.prototype.initialize.call(this);if(!this.id)return;d("WAWebContactGetters").getIsMe(this)&&this.addChild("status",d("WAWebTextStatusCollection").TextStatusCollection.gadd(this.id));d("WAWebContactGetters").getIsMe(this)&&d("WAWebTextStatusGatingUtils").receiveTextStatusEnabled()&&(this.setupStatusExpiration(),this.listenTo(this,"change:textStatusExpiryTs",function(){self.setTimeout(function(){b.setupStatusExpiration()})}));d("WAWebContactGetters").getIsMe(this)&&this.addChild("profilePicThumb",d("WAWebProfilePicThumbCollection").ProfilePicThumbCollection.gadd(this.id));(this.isBusiness||d("WAWebContactGetters").getIsMe(this)&&d("WAWebConnModel").Conn.isSMB)&&this.addChild("businessProfile",d("WAWebBusinessProfileCollection").BusinessProfileCollection.gadd(this.id));this.listenTo(this,"change:isBusiness",function(){return d("WAWebBizBusinessChangeAction").handleBusinessChange(b)});d("WAWebContactGetters").getIsMe(this)&&this.listenTo(d("WAWebConnModel").Conn,"change:pushname",function(){b.set({pushname:d("WAWebConnModel").Conn.pushname})});this.listenTo(c("WAWebL10N"),"locale_change",function(){b.locale=c("WAWebL10N").getLocale()});this.id.isUser()&&(this.updateContactBlocked(),this.updateContactOptedOutOfMarketingMessages());this.listenTo(this,"change:name",this.updateShortName);this.listenTo(this,"change:name",this.updateName);this.pendingAction=0;(d("WAWebConnModel").Conn.isSMB||d("WAWebListsGatingUtils").isListsEnabled())&&d("WAWebBizLabelUtils").initializeLabels(this);if(this.id.isLid()){var e=this.phoneNumber||d("WAWebApiContact").getPhoneNumber(d("WAWebWidFactory").toUserWid(this.id));e!=null&&this.copyNameFromPnContact(e)}else this.id.isUser()&&(this.updateLidContactName(),this.listenTo(this,"change:name",function(){b.updateLidContactName()}));if(d("WAWebBotGating").isBotReceiveEnabled()){if(!this.id.isBot())return;if(this.name)return;this.id.user==="13135550002"?this.set({name:"Meta AI"}):this.set({name:h._(/*BTDS*/"__JHASH__1q78JGCOeOd__JHASH__").toString()});this.set({type:"out"})}};e.updateName=function(){var a;!d("WAWebContactGetters").getIsMyContact(this)&&d("WAWebBotGating").isBizBot3pEnabled()&&((a=this.businessProfile)==null?void 0:a.isBizBot3p)===!0&&this.verifiedName!=null&&this.set({name:this.verifiedName})};e.updateShortName=function(){if(d("WAWebContactGetters").getIsUser(this)&&this.name&&!this.shortName){var a=d("WAWebContactShortName").getShortName(this.name);a!=null&&this.set("shortName",a)}};e.updateLidContactName=function(){var a=d("WAWebApiContact").getCurrentLid(d("WAWebWidFactory").toUserWid(this.id));if(a!=null){a=this.getCollection().get(a);a&&a.set({name:this.name})}};e.copyNameFromPnContact=function(a){var b=this.getCollection().get(a);(b==null?void 0:b.name)!=null&&this.set({name:b.name});this.set({phoneNumber:a})};e.getStatus=function(){c("WAWebWid").user(this.id)||d("WALogger").LOG(j(),this.id.toString());return this.status=d("WAWebTextStatusCollection").TextStatusCollection.gadd(this.id)};e.getProfilePicThumb=function(){return this.profilePicThumb=d("WAWebProfilePicThumbCollection").ProfilePicThumbCollection.gadd(this.id)};e.addPendingAction=function(a){var b=this,c=function(){b.decPending()};a.then(c,c);this.pendingAction++;return a};e.decPending=function(){this.pendingAction>0?this.pendingAction--:(d("WALogger").LOG(i()),this.pendingAction=0)};e.updateContactBlocked=function(){if(!this.id.isUser())return;if(d("WAWebBlocklistCollection").BlocklistCollection.get(this.id))this.isContactBlocked=!0;else if(this.id.isLid()&&this.phoneNumber!=null)this.isContactBlocked=d("WAWebBlocklistCollection").BlocklistCollection.get(this.phoneNumber)!=null;else{var a=d("WAWebApiContact").getAlternateUserWid(d("WAWebWidFactory").toUserWid(this.id));a=a!=null&&d("WAWebBlocklistCollection").BlocklistCollection.get(a)!=null;this.isContactBlocked=a}};e.updateContactOptedOutOfMarketingMessages=function(){if(!this.id.isUser())return;if(d("WAWebOptOutListCollection").OptOutListCollection.get(this.id))this.isContactOptedOut=!0;else if(this.id.isLid()&&this.phoneNumber!=null)this.isContactOptedOut=d("WAWebOptOutListCollection").OptOutListCollection.get(this.phoneNumber)!=null;else{var a=d("WAWebApiContact").getAlternateUserWid(d("WAWebWidFactory").toUserWid(this.id));a=a!=null&&d("WAWebOptOutListCollection").OptOutListCollection.get(a)!=null;this.isContactOptedOut=a}this.isContactOptedOut&&(this.isEverOptedOutOfMarketingMessages=!0)};e.setIsMarketingMessageThread=function(a){this.isMarketingMessageThread=a};e.getIsMarketingMessageThread=function(){return this.isMarketingMessageThread};e.searchMatch=function(a,b,e){var f=d("WAWebFrontendContactGetters").getSearchName(this),g=d("WAWebFrontendContactGetters").getUsername(this);if((d("WAWebBizGatingUtils").canDisplayLabel()||d("WAWebListsGatingUtils").isListsEnabled())&&e){return a&&f&&!f.includes(a)&&g&&!g.includes(a)?!1:Boolean((g=this.labels)==null?void 0:g.includes(e))}if(!a)return!1;if(f&&f.includes(a))return!0;g=d("WAWebContactGetters").getUserid(this);if(g&&g.includes(a))return!0;if(b)if(!this.id.isLid()){if(g!=null&&g.includes(b))return!0}else if(g!=null){e=d("WAWebApiContact").getPhoneNumber(d("WAWebWidFactory").createUserWid(g,"lid"));if(e!=null&&e.toString().includes(b))return!0}f=d("WAWebContactGetters").getSearchVerifiedName(this);if(f&&f.includes(a))return!0;if(this.pushname&&c("WAWebL10N").accentFold(this.pushname).includes(a))return!0;if(this.username!=null&&c("WAWebL10N").accentFold(this.username).includes(a)&&d("WAWebUsernameGatingUtils").usernameDisplayedEnabled())return!0;if(d("WAWebContactGetters").getIsMe(this)){g=c("WAWebL10N").accentFold(h._(/*BTDS*/"__JHASH__XOhSD1cRrEc__JHASH__").toString());if(g.includes(a))return!0}return!1};e.set=function(b,c,e){e=a.prototype.set.call(this,b,c,e);if(typeof b!=="string"&&(c==null?void 0:c.merge)&&e){if(d("WAWebContactGetters").getIsPSA(e))return e;if(e.id.isBot())return e;!b.name&&e.name&&(e.unset("name"),e.unset("shortName"));!b.verifiedName&&e.verifiedName&&e.unset("verifiedName")}return e};e.getCollection=function(){return d("WAWebContactCollection").ContactCollection};e.setNotMyContact=function(){this.name&&(this.set("name",void 0),this.set("shortName",void 0),this.set("type","out"))};e.getSyncToAddressbook=function(){var a;return!d("WAWebContactManagementGating").contactManagementEnabled()?!1:(a=this.syncToAddressbook)!=null?a:!0};e.canToggleFavorite=function(){if(d("WAWebListsGatingUtils").isListsEnabled())return!0;return this.isFavorite?!0:d("WAWebContactGetters").getIsMyContact(this)&&!this.id.isBot()&&!d("WAWebContactGetters").getIsMe(this)};return b}(d("WAWebBaseModel").BaseModel);a.Proxy="contact";a.idClass=c("WAWebWid");b=d("WAWebBaseModel").defineModel(a);g["default"]=b}),226); __d("WAWebDailyAggregatedStats",["$InternalEnum","WAWebBaseModel"],(function(a,b,c,d,e,f,g){a=b("$InternalEnum")({NARRATIVE_APPEAR:1,DIALOG_APPEAR:2,DIALOG_SELECT:3});var h=24*60*60*1e3,i=3*7*h;c=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.startTime=d("WAWebBaseModel").prop(),c.pttCancelBroadcast=d("WAWebBaseModel").prop(0),c.pttCancelGroup=d("WAWebBaseModel").prop(0),c.pttCancelIndividual=d("WAWebBaseModel").prop(0),c.pttCancelNewsletter=d("WAWebBaseModel").prop(0),c.pttDraftReviewBroadcast=d("WAWebBaseModel").prop(0),c.pttDraftReviewGroup=d("WAWebBaseModel").prop(0),c.pttDraftReviewIndividual=d("WAWebBaseModel").prop(0),c.pttDraftReviewNewsletter=d("WAWebBaseModel").prop(0),c.pttFastplaybackBroadcast=d("WAWebBaseModel").prop(0),c.pttFastplaybackGroup=d("WAWebBaseModel").prop(0),c.pttFastplaybackIndividual=d("WAWebBaseModel").prop(0),c.pttFastplaybackNewsletter=d("WAWebBaseModel").prop(0),c.pttLockBroadcast=d("WAWebBaseModel").prop(0),c.pttLockGroup=d("WAWebBaseModel").prop(0),c.pttLockIndividual=d("WAWebBaseModel").prop(0),c.pttLockNewsletter=d("WAWebBaseModel").prop(0),c.pttPlaybackBroadcast=d("WAWebBaseModel").prop(0),c.pttPlaybackGroup=d("WAWebBaseModel").prop(0),c.pttPlaybackIndividual=d("WAWebBaseModel").prop(0),c.pttPlaybackNewsletter=d("WAWebBaseModel").prop(0),c.pttRecordBroadcast=d("WAWebBaseModel").prop(0),c.pttRecordGroup=d("WAWebBaseModel").prop(0),c.pttRecordIndividual=d("WAWebBaseModel").prop(0),c.pttRecordNewsletter=d("WAWebBaseModel").prop(0),c.pttSendBroadcast=d("WAWebBaseModel").prop(0),c.pttSendGroup=d("WAWebBaseModel").prop(0),c.pttSendIndividual=d("WAWebBaseModel").prop(0),c.pttSendNewsletter=d("WAWebBaseModel").prop(0),c.pttPausedRecordBroadcast=d("WAWebBaseModel").prop(0),c.pttPausedRecordGroup=d("WAWebBaseModel").prop(0),c.pttPausedRecordIndividual=d("WAWebBaseModel").prop(0),c.pttPausedRecordNewsletter=d("WAWebBaseModel").prop(0),c.pttOutOfChatBroadcast=d("WAWebBaseModel").prop(0),c.pttOutOfChatGroup=d("WAWebBaseModel").prop(0),c.pttOutOfChatIndividual=d("WAWebBaseModel").prop(0),c.pttOutOfChatNewsletter=d("WAWebBaseModel").prop(0),c.goldenBoxContactNarrativeAppearCount=d("WAWebBaseModel").prop(0),c.goldenBoxContactDialogAppearCount=d("WAWebBaseModel").prop(0),c.goldenBoxContactDialogSelectCount=d("WAWebBaseModel").prop(0),c.goldenBoxGroupNarrativeAppearCount=d("WAWebBaseModel").prop(0),c.goldenBoxGroupDialogAppearCount=d("WAWebBaseModel").prop(0),c.goldenBoxGroupDialogSelectCount=d("WAWebBaseModel").prop(0),c.infoScreenContactNarrativeAppearCount=d("WAWebBaseModel").prop(0),c.infoScreenContactDialogAppearCount=d("WAWebBaseModel").prop(0),c.infoScreenContactDialogSelectCount=d("WAWebBaseModel").prop(0),c.infoScreenGroupNarrativeAppearCount=d("WAWebBaseModel").prop(0),c.infoScreenGroupDialogAppearCount=d("WAWebBaseModel").prop(0),c.infoScreenGroupDialogSelectCount=d("WAWebBaseModel").prop(0),c.chatsListNarrativeAppearCount=d("WAWebBaseModel").prop(0),c.chatsListDialogAppearCount=d("WAWebBaseModel").prop(0),c.chatsListDialogSelectCount=d("WAWebBaseModel").prop(0),c.statusListNarrativeAppearCount=d("WAWebBaseModel").prop(0),c.statusListDialogAppearCount=d("WAWebBaseModel").prop(0),c.statusListDialogSelectCount=d("WAWebBaseModel").prop(0),c.callingScreenAudioNarrativeAppearCount=d("WAWebBaseModel").prop(0),c.callingScreenAudioDialogAppearCount=d("WAWebBaseModel").prop(0),c.callingScreenAudioDialogSelectCount=d("WAWebBaseModel").prop(0),c.prinaLastEvent=d("WAWebBaseModel").prop(0),c.communityTabGroupNavigations=d("WAWebBaseModel").prop(0),c.communityTabToHomeViews=d("WAWebBaseModel").prop(0),c.communityTabViews=d("WAWebBaseModel").prop(0),c.communityTabViewsViaContextMenu=d("WAWebBaseModel").prop(0),c.communityNoActionTabViews=d("WAWebBaseModel").prop(0),c.communityHome=d("WAWebBaseModel").prop(function(){return{}}),c.pnhCagActions=d("WAWebBaseModel").prop(function(){return{}}),c.pnhCtwaActions=d("WAWebBaseModel").prop(function(){return{}}),c.animatedEmojiSend=d("WAWebBaseModel").prop(0),c.singleEmojiSend=d("WAWebBaseModel").prop(0),c.emojiReply=d("WAWebBaseModel").prop(0),c.kicGroupNotificationTaps=d("WAWebBaseModel").prop(0),c.kicGroupNotifications=d("WAWebBaseModel").prop(0),c.kicNotificationTaps=d("WAWebBaseModel").prop(0),c.kicNotifications=d("WAWebBaseModel").prop(0),c.chatLockFolderChatsCount=d("WAWebBaseModel").prop(0),c.chatLockFolderOpenCount=d("WAWebBaseModel").prop(0),c.chatLockLockFolderHidden=d("WAWebBaseModel").prop(null),c.chatLockNewAddChatCount=d("WAWebBaseModel").prop(0),c.chatLockNewRemoveChatCount=d("WAWebBaseModel").prop(0),c.chatLockSecretCodeActive=d("WAWebBaseModel").prop(null),b)||babelHelpers.assertThisInitialized(c)}var c=b.prototype;c.initialize=function(){a.prototype.initialize.call(this)};c.getEndTime=function(){return this.startTime+h};c.shouldBeSubmitted=function(){return!this.isExpired()&&this.getEndTime()<Date.now()};c.isExpired=function(){var a=Date.now()-i;return this.startTime<a};return b}(d("WAWebBaseModel").BaseModel);c.Proxy="daily-aggregated-stats";e=d("WAWebBaseModel").defineModel(c);g.PrinaDailyActionType=a;g.DailyAggregatedStats=e}),98); __d("WAWebDailyAggregatedStatsCollection",["WANullthrows","WAWebBaseCachePolicy","WAWebBaseCollection","WAWebDailyAggregatedStats","WAWebUserPrefsGeneral","WAWebUserPrefsKeys"],(function(a,b,c,d,e,f,g){var h=24*60*60*1e3;a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}var e=b.prototype;e.gaddForDate=function(a){var b=d("WAWebUserPrefsGeneral").getDailyStatsStartTime();a=a.getTime()-b;a=Math.floor(a/h);b=b+h*a;return(a=this.get(b))!=null?a:c("WANullthrows")(this.add({id:b.toString(),startTime:b})[0])};e.gaddForToday=function(){return this.gaddForDate(new Date())};e.initializeFromCache=function(a){if(a==null)return;a=a.map(function(a){return new(d("WAWebDailyAggregatedStats").DailyAggregatedStats)(a)}).filter(function(a){return i(a)&&!a.isExpired()});this.add(a)};e.serialize=function(){return this.toArray().filter(function(a){return i(a)&&!a.isExpired()}).map(function(a){return a.toJSON()})};return b}(d("WAWebBaseCollection").BaseCollection);a.model=d("WAWebDailyAggregatedStats").DailyAggregatedStats;a.cachePolicy={id:d("WAWebUserPrefsKeys").COLLECTIONS_KEYS.DAILY_AGGREGATED_STATS_COLLECTION,policy:d("WAWebBaseCachePolicy").CACHE_POLICY.LOAD,delay:1e3};b=new a();function i(a){return(a.startTime-d("WAWebUserPrefsGeneral").getDailyStatsStartTime())%h===0}g.DailyAggregatedStatsCollectionImpl=a;g.DailyAggregatedStatsCollection=b}),98); __d("WAWebSingleEmojiDailyUtils",["$InternalEnum","WALogger","WAWebDailyAggregatedStatsCollection","WAWebFrontendMsgGetters","WAWebMsgGetters"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Wam:IncrementSingleEmojiEvent"]);h=function(){return a};return a}var i=b("$InternalEnum").Mirrored(["ANIMATED_EMOJI_SEND","SINGLE_EMOJI_SEND","EMOJI_REPLY"]);function a(a){var b=d("WAWebFrontendMsgGetters").getIsSingleEmoji(a);if(b==null)return;b=d("WAWebFrontendMsgGetters").getIsAnimatedEmoji(a);b?j(i.ANIMATED_EMOJI_SEND):j(i.SINGLE_EMOJI_SEND);d("WAWebMsgGetters").getQuotedMsg(a)&&j(i.EMOJI_REPLY)}function j(a){var b=d("WAWebDailyAggregatedStatsCollection").DailyAggregatedStatsCollection.gaddForToday();d("WALogger").DEV(h()).devConsole(a);switch(a){case i.ANIMATED_EMOJI_SEND:b.animatedEmojiSend++;break;case i.SINGLE_EMOJI_SEND:b.singleEmojiSend++;break;case i.EMOJI_REPLY:b.emojiReply++;break}}g.maybeIncrementSingleEmojiDailyStatsCount=a}),98); __d("WAWebEmojiVariantModel",["WAWebBaseModel"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.variant=d("WAWebBaseModel").prop(),b)||babelHelpers.assertThisInitialized(c)}return b}(d("WAWebBaseModel").BaseModel);a.Proxy="emojiVariant";b=d("WAWebBaseModel").defineModel(a);g["default"]=b}),98); __d("WAWebEmojiVariantCollection",["WAWebBaseCachePolicy","WAWebBaseCollection","WAWebEmoji","WAWebEmojiVariantModel","WAWebUserPrefsKeys","err"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}var e=b.prototype;e.setVariant=function(a,b){a=d("WAWebEmoji").EmojiUtil.getSkinToneBase(a);if(a)this.gadd({id:a,variant:b});else throw c("err")("attempt to store variantless emoji")};e.getVariant=function(a){if(d("WAWebEmoji").EmojiUtil.getSkinToneBase(a)){a=this.get(a);return a?d("WAWebEmoji").EmojiUtil.normalizeEmoji(a.variant):null}throw c("err")("attempt to get variantless emoji")};e.getVariantIfExists=function(a){if(d("WAWebEmoji").EmojiUtil.getSkinToneBase(a)){a=this.get(a);return a?d("WAWebEmoji").EmojiUtil.normalizeEmoji(a.variant):null}return null};return b}(d("WAWebBaseCollection").BaseCollection);a.model=c("WAWebEmojiVariantModel");a.cachePolicy={id:d("WAWebUserPrefsKeys").COLLECTIONS_KEYS.EMOJI_VARIANT_COLLECTION,policy:d("WAWebBaseCachePolicy").CACHE_POLICY.LOAD,delay:1e3};b=new a();g.EmojiVariantCollection=b}),98); __d("WAWebRecentEmojiModel",["WAWebBaseModel"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.weight=d("WAWebBaseModel").prop(),b)||babelHelpers.assertThisInitialized(c)}return b}(d("WAWebBaseModel").BaseModel);a.Proxy="recentEmoji";b=d("WAWebBaseModel").defineModel(a);g["default"]=b}),98); __d("WAWebRecentEmojiCollection",["WAWebBaseCachePolicy","WAWebBaseCollection","WAWebEmoji","WAWebRecentEmojiModel","WAWebUserPrefsKeys","lodash"],(function(a,b,c,d,e,f,g){var h=100,i=36;a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b;b=a.call(this)||this;b.dirty=!1;b.listenTo(babelHelpers.assertThisInitialized(b),"change:weight change:length",c("lodash").debounce(b._sortTrimScale,h));return b}var e=b.prototype;e._sortTrimScale=function(){var a=this.length;if(!a)return;this.sort();a>i&&this.remove(this.slice(i))};e["delete"]=function(){a.prototype["delete"].call(this),this.dirty=!1};e.increment=function(a){var b=d("WAWebEmoji").EmojiUtil.getSkinToneBase(a)||a;this.get(b)||this.add({id:b,weight:0});this.forEach(function(a){a.id===b?a.weight+=1:a.weight*=.9});this.dirty=!0};return b}(d("WAWebBaseCollection").BaseCollection);a.cachePolicy={id:d("WAWebUserPrefsKeys").COLLECTIONS_KEYS.RECENT_EMOJI_COLLECTION,policy:d("WAWebBaseCachePolicy").CACHE_POLICY.LOAD,delay:2e3};a.comparator=function(a,b){return a.weight>b.weight?-1:1};a.model=c("WAWebRecentEmojiModel");b=new a();g.RecentEmojiCollection=b}),98); __d("WAWebCommunityActivityModel",["$InternalEnum","WATimeUtils","WAWebBaseModel","WAWebModelUtils"],(function(a,b,c,d,e,f,g){a=b("$InternalEnum").Mirrored(["SUB_GROUP_LINK","NEW_COMMUNITY"]);c=5*d("WATimeUtils").DAY_SECONDS;e=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebModelUtils").prop(),c.communityId=d("WAWebModelUtils").prop(),c.type=d("WAWebModelUtils").prop(),c.timestamp=d("WAWebModelUtils").prop(),c.subgroupName=d("WAWebModelUtils").prop(),c.subgroupId=d("WAWebModelUtils").prop(),b)||babelHelpers.assertThisInitialized(c)}return b}(d("WAWebBaseModel").BaseModel);e.Proxy="communityActivity";f=d("WAWebBaseModel").defineModel(e);g.ActivityTypeType=a;g.EXPIRATION_TIME_FOR_SUB_GROUP_LINK=c;g.CommunityActivity=f}),98); __d("WAWebCommunityActivityCollection",["fbt","WATimeUtils","WAWebBaseCollection","WAWebChatCollection","WAWebCommunityActivityModel","WAWebDBMessageStoreUtils","WAWebGroupType","WAWebUnjoinedSubgroupMetadataCollection","WAWebUserPrefsMeUser","WAWebUserPrefsMultiDevice","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g,h){a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var b;b=a.call(this)||this;b.listenTo(c("WAWebUnjoinedSubgroupMetadataCollection"),"add remove change:subject",b.$CommunityActivityCollection$p_1);return b}var f=e.prototype;f.$CommunityActivityCollection$p_1=function(a){var b=this.findFirst(function(b){return(b=b.subgroupId)==null?void 0:b.equals(a.id)});b!=null&&(b.subgroupName=a.subject)};f.getActivityFor=function(a){return this.filter(function(b){return b.communityId.equals(a)})};f.shouldShowTabBadge=function(){var a;if(this.length===0)return!1;var b=(a=d("WAWebUserPrefsMultiDevice").getCommunityTabLastSeenTimestamp())!=null?a:0;return this.some(function(a){return a.timestamp>b})};f.syncActivityFor=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b,e=this,f=(b=d("WAWebUserPrefsMultiDevice").getCommunityTabLastSeenTimestamp())!=null?b:0;b=(yield d("WAWebDBMessageStoreUtils").getMessagesBefore(a.toString(),function(a){return a.t<d("WATimeUtils").unixTime()-d("WAWebCommunityActivityModel").EXPIRATION_TIME_FOR_SUB_GROUP_LINK}));if(b.length===0)return;b.forEach(function(b){if(b.author==null)return;var g=d("WAWebWidFactory").createWidFromWidLike(b.author);if(d("WAWebUserPrefsMeUser").isMeAccount(g))return;g=b.t;if(b.subtype===d("WAWebGroupType").GROUP_ACTIONS.SUB_GROUP_LINK){var i,j;i=d("WAWebWidFactory").createWidFromWidLike((i=b.templateParams)==null?void 0:i[0]);j=(j=d("WAWebChatCollection").ChatCollection.get(i))==null?void 0:j.formattedTitle;if(j==null){var k,l;k=(k=c("WAWebUnjoinedSubgroupMetadataCollection").get(i.toString()))==null?void 0:k.subject;l=(l=b.templateParams)==null?void 0:l[1];k!=null?j=k:typeof l==="string"?j=l:j=h._(/*BTDS*/"__JHASH__ZaGfe2XzaM2__JHASH__").toString()}e.addDeduppedSubgroupLink([{id:b.id,type:d("WAWebCommunityActivityModel").ActivityTypeType.SUB_GROUP_LINK,communityId:a,timestamp:g,subgroupName:j,subgroupId:i}])}else b.subtype===d("WAWebGroupType").GROUP_ACTIONS.ADD&&(g>f&&e.add({id:a.toString(),communityId:a,timestamp:g,type:d("WAWebCommunityActivityModel").ActivityTypeType.NEW_COMMUNITY}))})});function e(b){return a.apply(this,arguments)}return e}();f.addDeduppedSubgroupLink=function(a){var b=this;a=a.filter(function(a){return!b.some(function(b){return(b=b.subgroupId)==null?void 0:b.equals(a.subgroupId)})});return this.add(a)};return e}(d("WAWebBaseCollection").BaseCollection);a.model=d("WAWebCommunityActivityModel").CommunityActivity;a.comparator=function(a,b){return a.timestamp-b.timestamp};e=new a();g["default"]=e}),226); __d("WAWebGroupMembershipApprovalRequestCollection",["WAWebCollection","WAWebGroupMembershipApprovalRequestModel"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}return b}(c("WAWebCollection"));a.model=c("WAWebGroupMembershipApprovalRequestModel");a.comparator=function(a,b){return b.t-a.t};g["default"]=a}),98); __d("WAWebGroupMembershipApprovalRequestModel",["WAWebBaseModel","WAWebContactCollection","WAWebWid"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.t=d("WAWebBaseModel").prop(),c.addedBy=d("WAWebBaseModel").prop(),c.requestMethod=d("WAWebBaseModel").prop(),c.parentGroupId=d("WAWebBaseModel").prop(),c.contact=d("WAWebBaseModel").session(),c.addedByContact=d("WAWebBaseModel").session(),b)||babelHelpers.assertThisInitialized(c)}var c=b.prototype;c.initialize=function(){a.prototype.initialize.call(this),this.addChild("contact",d("WAWebContactCollection").ContactCollection.gadd(this.id)),this.addChild("addedByContact",d("WAWebContactCollection").ContactCollection.gadd(this.addedBy))};return b}(d("WAWebBaseModel").BaseModel);a.Proxy="membership_approval_request";a.idClass=c("WAWebWid");b=d("WAWebBaseModel").defineModel(a);g["default"]=b}),98); __d("WAWebGroupMetadataCollection",["Promise","WALogger","WAWebBaseCollection","WAWebChatCollection","WAWebFindGroupMetadataAction","WAWebGroupMetadataModel","WAWebIsCagGroupCache","WAWebProfilePicThumbCollection","WAWebUpdateSubgroupsCommunityAction","WAWebWid","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["groupMetadata:find trying to fetch non-group/bclist wid ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["groupMetadata: skip trying to find groupMetadata wid ",""]);j=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var e;e=a.call(this)||this;e._handleIsParentGroupChange=function(a){a.isParentGroup===!0&&void d("WAWebProfilePicThumbCollection").ProfilePicThumbCollection.update(a.id)};e.findImpl=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(c("WAWebWid").isGroup(a)){var e=d("WAWebChatCollection").ChatCollection.get(a);if((e==null?void 0:e.isReadOnly)&&(e==null?void 0:(e=e.groupMetadata)==null?void 0:e.stale)===!1){d("WALogger").LOG(j(),a.toString());return(h||(h=b("Promise"))).resolve({id:a})}return d("WAWebFindGroupMetadataAction").findGroupMetadata(a).then(function(a){return a==null?a:babelHelpers["extends"]({},a)})}else if(c("WAWebWid").isBroadcast(a))return(h||(h=b("Promise"))).resolve({id:a});d("WALogger").LOG(i(),a.toString());return(h||(h=b("Promise"))).reject(c("err")("groupMetadata:find trying to fetch non-group/bclist wid "+a.toString()))});return function(b){return a.apply(this,arguments)}}();e.listenTo(babelHelpers.assertThisInitialized(e),"add",e._handleGroupAdd);e.listenTo(babelHelpers.assertThisInitialized(e),"remove",e._handleGroupRemove);e.listenTo(babelHelpers.assertThisInitialized(e),"change:parentGroup",e._handleParentGroupChange);e.listenTo(babelHelpers.assertThisInitialized(e),"change:isParentGroup",e._handleIsParentGroupChange);e.listenTo(babelHelpers.assertThisInitialized(e),"change:defaultSubgroup",e._handleDefaultSubgroupChange);return e}var f=e.prototype;f._handleGroupAdd=function(a){a.defaultSubgroup===!0&&c("WAWebIsCagGroupCache").add(a.id);if(!a.participants.iAmMember())return;var b=a.parentGroup?this.get(a.parentGroup.toString()):null;if(b!=null){a=a.id;d("WAWebUpdateSubgroupsCommunityAction").subgroupUnjoinedToJoined(b,a)}};f._handleGroupRemove=function(a){a.defaultSubgroup===!0&&c("WAWebIsCagGroupCache").remove(a.id);if(!a.participants.iAmMember())return;a=a.parentGroup?this.get(a.parentGroup.toString()):null;a!=null&&d("WAWebUpdateSubgroupsCommunityAction").updateJoinedSubgroups(a)};f._handleParentGroupChange=function(a,b,c){if(!a.participants.iAmMember())return;a=a.id;b=b!=null?this.get(b.toString()):null;c=c!=null?this.get(c.toString()):null;b!=null?(d("WAWebUpdateSubgroupsCommunityAction").subgroupUnjoinedToJoined(b,a),c!=null&&d("WAWebUpdateSubgroupsCommunityAction").updateJoinedSubgroups(c)):c!=null&&d("WAWebUpdateSubgroupsCommunityAction").unlinkParentGroup(c,a)};f._handleDefaultSubgroupChange=function(a,b){b===!0?c("WAWebIsCagGroupCache").add(a.id):c("WAWebIsCagGroupCache").remove(a.id)};return e}(d("WAWebBaseCollection").BaseCollection);a.model=c("WAWebGroupMetadataModel");a.staleCollection=!0;e=new a();g["default"]=e}),98); __d("WAWebGroupMetadataModel",["fbt","Promise","WALogger","WAShiftTimer","WAWebBaseModel","WAWebChatCollection","WAWebCommunityGatingUtils","WAWebContactCollection","WAWebContactGetters","WAWebGroupMembershipApprovalRequestCollection","WAWebGroupMetadataCollection","WAWebGroupParticipantCollection","WAWebGroupPendingParticipantCollection","WAWebGroupType","WAWebInviteV4QueryGroupAction","WAWebMiscGatingUtils","WAWebPastParticipantCollection","WAWebSchemaGroupMetadata","WAWebSubgroupSuggestionCollection","WAWebUnjoinedSubgroupMetadataCollection","WAWebUnreadMentionMetadataModel","WAWebUpdateSubgroupsCommunityAction","WAWebUserPrefsMeUser","WAWebWid","WAWebWidFactory","WAWebWidToJid","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g,h){var i;function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["models:groupMetadata:participantCollection:revokeGroupsV4AddInvite failed"]);j=function(){return a};return a}var k="https://chat.whatsapp.com/";a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var b,e;for(var f=arguments.length,g=new Array(f),h=0;h<f;h++)g[h]=arguments[h];return(b=e=a.call.apply(a,[this].concat(g))||this,e.participants=d("WAWebBaseModel").collection(c("WAWebGroupParticipantCollection")),e.pendingParticipants=d("WAWebBaseModel").collection(c("WAWebGroupPendingParticipantCollection")),e.pastParticipants=d("WAWebBaseModel").collection(c("WAWebPastParticipantCollection")),e.membershipApprovalRequests=d("WAWebBaseModel").collection(c("WAWebGroupMembershipApprovalRequestCollection")),e.subgroupSuggestions=d("WAWebBaseModel").collection(c("WAWebSubgroupSuggestionCollection")),e.id=d("WAWebBaseModel").prop(),e.creation=d("WAWebBaseModel").prop(),e.owner=d("WAWebBaseModel").prop(),e.subject=d("WAWebBaseModel").prop(),e.subjectTime=d("WAWebBaseModel").prop(),e.desc=d("WAWebBaseModel").prop(),e.descId=d("WAWebBaseModel").prop(),e.descTime=d("WAWebBaseModel").prop(),e.descOwner=d("WAWebBaseModel").prop(),e.restrict=d("WAWebBaseModel").prop(),e.announce=d("WAWebBaseModel").prop(),e.noFrequentlyForwarded=d("WAWebBaseModel").prop(),e.ephemeralDuration=d("WAWebBaseModel").prop(),e.disappearingModeTrigger=d("WAWebBaseModel").prop(),e.disappearingModeInitiatedByMe=d("WAWebBaseModel").prop(),e.membershipApprovalMode=d("WAWebBaseModel").prop(),e.memberAddMode=d("WAWebBaseModel").prop(),e.growthLockExpiration=d("WAWebBaseModel").prop(),e.growthLockType=d("WAWebBaseModel").prop(),e.reportToAdminMode=d("WAWebBaseModel").prop(),e.size=d("WAWebBaseModel").prop(),e.numSubgroups=d("WAWebBaseModel").prop(),e.support=d("WAWebBaseModel").prop(),e.suspended=d("WAWebBaseModel").prop(!1),e.terminated=d("WAWebBaseModel").prop(!1),e.uniqueShortNameMap=d("WAWebBaseModel").prop(),e.isLidAddressingMode=d("WAWebBaseModel").prop(),e.isParentGroup=d("WAWebBaseModel").prop(),e.isParentGroupClosed=d("WAWebBaseModel").prop(),e.parentGroup=d("WAWebBaseModel").prop(),e.defaultSubgroup=d("WAWebBaseModel").prop(),e.generalSubgroup=d("WAWebBaseModel").prop(),e.hiddenSubgroup=d("WAWebBaseModel").prop(),e.groupSafetyCheck=d("WAWebBaseModel").prop(),e.groupAdder=d("WAWebBaseModel").prop(),e.generalChatAutoAddDisabled=d("WAWebBaseModel").prop(),e.lastCommunityPollTimestamp=d("WAWebBaseModel").prop(),e.unjoinedSubgroups=d("WAWebBaseModel").session(function(){return[]}),e.joinedSubgroups=d("WAWebBaseModel").session(function(){return[]}),e.allowNonAdminSubGroupCreation=d("WAWebBaseModel").prop(),e.lastActivityTimestamp=d("WAWebBaseModel").prop(),e.lastSeenActivityTimestamp=d("WAWebBaseModel").prop(),e.lastReportToAdminTimestamp=d("WAWebBaseModel").prop(),e.incognito=d("WAWebBaseModel").prop(),e.hasCapi=d("WAWebBaseModel").prop(),e.stale=d("WAWebBaseModel").session(!0),e.deviceStale=d("WAWebBaseModel").session(!1),e.trusted=d("WAWebBaseModel").session(!0),e.inviteCode=d("WAWebBaseModel").session(),e.groupInviteCodePromise=d("WAWebBaseModel").session(),e.revokeGroupInvitePromise=d("WAWebBaseModel").session(),e.participantQueryPromise=d("WAWebBaseModel").session(),e.deviceQueryPromise=d("WAWebBaseModel").session(),e.unjoinedSubgroupsQueryPromise=d("WAWebBaseModel").session(),e.displayedDesc=d("WAWebBaseModel").session(""),e.revokeGroupsV4AddInvitePromise=d("WAWebBaseModel").session(),e.groupInviteLink=d("WAWebBaseModel").derived(function(){return!this.inviteCode?null:""+k+this.inviteCode},["inviteCode"]),e.cachedDeviceCount=d("WAWebBaseModel").session(),e.cachedDeviceSizeBucket=d("WAWebBaseModel").session(),e.groupType=d("WAWebBaseModel").derived(function(){if(this.defaultSubgroup===!0)return d("WAWebGroupType").GroupType.LINKED_ANNOUNCEMENT_GROUP;if(this.generalSubgroup===!0)return d("WAWebGroupType").GroupType.LINKED_GENERAL_GROUP;if(this.parentGroup!=null)return d("WAWebGroupType").GroupType.LINKED_SUBGROUP;return this.isParentGroup===!0?d("WAWebGroupType").GroupType.COMMUNITY:d("WAWebGroupType").GroupType.DEFAULT},["parentGroup","isParentGroup","defaultSubgroup","generalSubgroup"]),e.isCag=d("WAWebBaseModel").derived(function(){return this.groupType===d("WAWebGroupType").GroupType.LINKED_ANNOUNCEMENT_GROUP},["groupType"]),e.isUnnamed=d("WAWebBaseModel").derived(function(){return this.subject===""},["subject"]),b)||babelHelpers.assertThisInitialized(e)}var f=e.prototype;f.isNonAdminAndACAGJREnabled=function(){var a,b=!this.participants.iAmAdmin(),c=this.participants.iAmMember(),e=this.memberAddMode===d("WAWebSchemaGroupMetadata").MemberAddMode.ALL_MEMBER_ADD;a=(a=this.membershipApprovalMode)!=null?a:!1;return b&&c&&e&&a};f.hasUniqueShortNameMention=function(a){if(!this.uniqueShortNameMap||!a.shortName||!d("WAWebContactGetters").getIsMyContact(a))return!1;a=this.$GroupMetadata$p_2(a.shortName);return(a=this.uniqueShortNameMap.get(a))!=null?a:!1};f.$GroupMetadata$p_2=function(a){return a.toLowerCase().trim()};f.isSuspendedOrTerminated=function(){return this.suspended||this.terminated};f["delete"]=function(){a.prototype["delete"].call(this),this.getCollection().remove(this.id),this.participants["delete"]()};f.canSetSubject=function(){if(this.isSuspendedOrTerminated())return!1;if(this.groupType===d("WAWebGroupType").GroupType.LINKED_ANNOUNCEMENT_GROUP)return!1;else if(this.groupType===d("WAWebGroupType").GroupType.COMMUNITY)return this.participants.iAmAdmin();if(!this.participants.iAmMember())return!1;if(this.participants.iAmAdmin())return!this.support;return this.restrict===!0?!1:!this.support};f.canSetDescription=function(){if(!this.participants.iAmMember()||!this.participants.iAmAdmin()&&this.restrict)return!1;if(this.isSuspendedOrTerminated())return!1;return(this.groupType===d("WAWebGroupType").GroupType.COMMUNITY||this.groupType===d("WAWebGroupType").GroupType.LINKED_ANNOUNCEMENT_GROUP)&&!this.participants.iAmAdmin()?!1:!this.support};f.searchMatch=function(a){if(a==null)return!1;var b=this.id;b=(b=d("WAWebChatCollection").ChatCollection.get(b))==null?void 0:b.formattedTitle;return b!=null&&b.toLowerCase().includes(a)?!0:!1};f.canSetGroupProperty=function(){if(this.isSuspendedOrTerminated())return!1;if(this.groupType===d("WAWebGroupType").GroupType.LINKED_ANNOUNCEMENT_GROUP)return!1;return this.participants.iAmAdmin()?!this.support:!1};f.userCanSetEphemeralSetting=function(a){var b=!this.support;if(this.isSuspendedOrTerminated())return!1;if(!this.participants.userIsMember(a))return!1;if(this.participants.userIsAdmin(a))return b;if(this.restrict)return!1;return this.groupType===d("WAWebGroupType").GroupType.LINKED_ANNOUNCEMENT_GROUP?!1:b};f.canSetEphemeralSetting=function(){var a=this;return d("WAWebUserPrefsMeUser").getMePNandLIDWids().some(function(b){return a.userCanSetEphemeralSetting(d("WAWebWidFactory").toUserWid(b))})};f.initialize=function(){var a=this;d("WAWebBaseModel").BaseModel.prototype.initialize.call(this);this.listenTo(this.participants,"change:isAdmin change:isSuperAdmin change:contact.isMyContact sort remove reset",function(){a.isTrusted(),a.$GroupMetadata$p_3()});this.listenTo(this.participants,"bulk_add bulk_remove reset",this.triggerParticipantsChange);this.listenTo(this,"change:owner",this.isTrusted);this.listenTo(this,"change:isParentGroup",this.$GroupMetadata$p_4);this.listenTo(this,"change:desc",this.$GroupMetadata$p_3);this.listenTo(this,"change:groupType",this.$GroupMetadata$p_3);this.$GroupMetadata$p_3();this.isTrusted();this.$GroupMetadata$p_1=this.$GroupMetadata$p_5();this.listenTo(this.participants,"change:contact.shortName",this.$GroupMetadata$p_6);this.uniqueShortNameMap=new Map();this.unreadMentionMetadata=new(c("WAWebUnreadMentionMetadataModel"))();this.groupType===d("WAWebGroupType").GroupType.COMMUNITY&&this.$GroupMetadata$p_4()};f.$GroupMetadata$p_6=function(){var a;(a=this.$GroupMetadata$p_1)==null?void 0:a.debounce(e.UPDATE_NAME_MAP_DEBOUNCE_TIME)};f.triggerParticipantsChange=function(){if(d("WAWebMiscGatingUtils").isDropLastNameEnabled()){var a;(a=this.$GroupMetadata$p_1)==null?void 0:a.debounce(e.UPDATE_NAME_MAP_DEBOUNCE_TIME)}this.trigger("change:participants")};f.$GroupMetadata$p_5=function(){var a=this;return new(d("WAShiftTimer").ShiftTimer)(function(){if(d("WAWebMiscGatingUtils").isDropLastNameEnabled()){var b=new Map();a.participants&&a.participants.forEach(function(c){if(c.contact.shortName&&d("WAWebContactGetters").getIsMyContact(c.contact)){c=a.$GroupMetadata$p_2(c.contact.shortName);!b.has(c)?b.set(c,!0):b.set(c,!1)}});a.uniqueShortNameMap=b}})};f.$GroupMetadata$p_7=function(){return this.participants.some(function(a){return a.isAdmin&&d("WAWebContactGetters").getIsMyContact(a.contact)})};f.isTrusted=function(){if(this.stale)return this.trusted;if(this.support)return this.trusted=!0;if(this.owner){if(d("WAWebUserPrefsMeUser").isMeAccount(this.owner))return this.trusted=!0;var a=d("WAWebContactCollection").ContactCollection.get(this.owner);if(a!=null&&d("WAWebContactGetters").getIsMyContact(a))return this.trusted=!0}return!this.$GroupMetadata$p_7()?this.trusted=!1:this.trusted=!0};f.hasJoined=function(){var a=this.id,b=this.groupType,c=this.joinedSubgroups;if(b===d("WAWebGroupType").GroupType.COMMUNITY)return c.length>0;b=d("WAWebChatCollection").ChatCollection.get(a);return!b?!1:b.isReadOnly===!1};f.$GroupMetadata$p_3=function(){this.groupType===d("WAWebGroupType").GroupType.LINKED_ANNOUNCEMENT_GROUP&&!this.canSetDescription()&&(this.desc==null||this.desc==="")?this.displayedDesc=h._(/*BTDS*/"__JHASH__BO-lF75hD0I__JHASH__").toString():this.displayedDesc=this.desc};f.$GroupMetadata$p_4=function(){d("WAWebUpdateSubgroupsCommunityAction").updateJoinedSubgroups(this),d("WAWebUpdateSubgroupsCommunityAction").updateUnjoinedSubgroups(this)};f.revokeGroupsV4AddInvite=function(a){var c=this;if(this.revokeGroupsV4AddInvitePromise)return this.revokeGroupsV4AddInvitePromise;var e=d("WAWebWidToJid").widToGroupJid(this.id),f=this.pendingParticipants;(i||(i=b("Promise"))).resolve();e=d("WAWebInviteV4QueryGroupAction").revokeGroupInviteV4(a,e);return this.revokeGroupsV4AddInvitePromise=e.then(function(b){b.status>=200&&b.status<300&&f.remove(a);return b.status})["catch"](function(a){d("WALogger").WARN(j()).devConsole(a);return 500})["finally"](function(){c.revokeGroupsV4AddInvitePromise=null})};f.queryGroupsV4PendingInvite=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=this,b=(yield d("WAWebInviteV4QueryGroupAction").getPendingParticipants(this.id,this.isLidAddressingMode===!0));b.forEach(function(b){a.pendingParticipants.add({id:d("WAWebWidFactory").createUserWid(b)})});return});function c(){return a.apply(this,arguments)}return c}();f.getJoinedSubgroupsMetadata=function(){var a=this.getCollection();return this.joinedSubgroups.map(function(b){return a.get(b.toString())}).filter(Boolean)};f.getJoinedSubgroupsChat=function(){return this.joinedSubgroups.map(function(a){return d("WAWebChatCollection").ChatCollection.get(a.toString())}).filter(Boolean)};f.getUnjoinedSubgroupsMetadata=function(){var a=this.getUnjoinedCollection();return this.unjoinedSubgroups.map(function(b){return a.get(b.toString())}).filter(Boolean)};f.getSubgroupsMetadata=function(){return[].concat(this.getJoinedSubgroupsMetadata(),this.getUnjoinedSubgroupsMetadata())};f.getSubgroupSuggestions=function(){var a=new Set();return this.subgroupSuggestions.filter(function(b){var c=b.groupId;b=b.isExistingGroup;return a.has(c.toString())?!1:a.add(c.toString())&&!(b&&!d("WAWebCommunityGatingUtils").memberSuggestedGroupsM3ReceiverEnabled())})};f.getParentGroupChat=function(){var a=this.parentGroup;if(!a)return;return d("WAWebChatCollection").ChatCollection.get(a)};f.isParentGroupParticipant=function(){var a=this.parentGroup;if(!a)return!1;a=this.getCollection().get(a);return(a==null?void 0:a.joinedSubgroups.length)?!0:!1};f.getUnjoinedCollection=function(){return c("WAWebUnjoinedSubgroupMetadataCollection")};f.getCollection=function(){return c("WAWebGroupMetadataCollection")};return e}(d("WAWebBaseModel").BaseModel);a.Proxy="groupMetadata";a.idClass=c("WAWebWid");a.UPDATE_NAME_MAP_DEBOUNCE_TIME=200;e=d("WAWebBaseModel").defineModel(a);g["default"]=e}),226); __d("WAWebGroupParticipantComparator",["WAWebContactComparator"],(function(a,b,c,d,e,f,g){a=function(a,b){return d("WAWebContactComparator").ContactComparator(a.contact,b.contact)};b=a;g["default"]=b}),98); __d("WAWebGroupParticipantCollection",["WAWebABProps","WAWebApiContact","WAWebChatCollection","WAWebCollection","WAWebContactCollection","WAWebContactGetters","WAWebGroupMetadataCollection","WAWebGroupParticipantComparator","WAWebGroupParticipantModel","WAWebGroupType","WAWebHostedGroupUtils","WAWebL10N","WAWebProfilePicPrivacyTokenGating","WAWebSchemaGroupMetadata","WAWebSendForNeededAddRequest","WAWebUpdateSubgroupsCommunityAction","WAWebUserPrefsMeUser","WAWebWidFactory","lodash"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(b,e){var f;e===void 0&&(e={});f=a.call(this,b,e)||this;f.$ParticipantCollection$p_2=function(a,b,c){f.$ParticipantCollection$p_3(a),d("WAWebProfilePicPrivacyTokenGating").isProfilePicIQPrivacyTokenEnabled()&&c.add===!0&&f.$ParticipantCollection$p_4(a)};f.$ParticipantCollection$p_4=function(a){if(!d("WAWebProfilePicPrivacyTokenGating").isProfilePicIQPrivacyTokenEnabled())return;if(!f.iAmMember())return;var b=d("WAWebChatCollection").ChatCollection.get(f.parent.id);b&&(b==null?void 0:b.tcToken)==null&&(a==null?void 0:a.contact.set({maybeCommonGroupChatModel:b},{isSilent:!0}))};f.$ParticipantCollection$p_3=function(a){var b;if(!a||!d("WAWebUserPrefsMeUser").isMeAccount(a.id))return;a=f.parent.id;b=a?(b=d("WAWebChatCollection").ChatCollection.get(a.toString()))==null?void 0:b.groupMetadata:null;b=b==null?void 0:(b=b.getParentGroupChat())==null?void 0:b.groupMetadata;if(b==null)return;f.iAmMember()?d("WAWebUpdateSubgroupsCommunityAction").subgroupUnjoinedToJoined(b,a):d("WAWebUpdateSubgroupsCommunityAction").subgroupJoinedToUnjoined(b,a)};f.$ParticipantCollection$p_1=c("lodash").debounce(function(){return f.sort()},1e3);f.sendForNeededAddRequest=function(a){var b,c=f.getChat(),e=f.getGroupMetadata();e=(e=e==null?void 0:e.desc)!=null?e:"";c=(b=(b=c==null?void 0:c.formattedTitle)!=null?b:c==null?void 0:c.name)!=null?b:"";d("WAWebSendForNeededAddRequest").sendForNeededAddRequest(a,c,e,f.parent.id)};f.listenTo(babelHelpers.assertThisInitialized(f),"change:contact.name",f.$ParticipantCollection$p_1);f.listenTo(c("WAWebL10N"),"locale_change",f.$ParticipantCollection$p_1);f.listenTo(babelHelpers.assertThisInitialized(f),"add remove",f.$ParticipantCollection$p_2);return f}var e=b.prototype;e["delete"]=function(){this.forEach(function(a){a["delete"]()}),this.stopListening(),this.reset()};e.ensureSorted=function(){this.$ParticipantCollection$p_1.flush()};e.set=function(b,c){c=c||{};c.isParticipantCollectionAdd!==!0&&(c=babelHelpers["extends"]({},c,{remove:!0}));b=a.prototype.set.call(this,b,c);this.trigger("bulk_add",b);c.remove===!0&&this.trigger("bulk_remove",b);return b};e.add=function(b,c){c=c||{};c=babelHelpers["extends"]({},c,{isParticipantCollectionAdd:!0});b=a.prototype.add.call(this,b,c);this.trigger("bulk_add",b);return b};e.remove=function(b,c){c=c||{};b=a.prototype.remove.call(this,b,c);this.trigger("bulk_remove",b);return b};e.canAdd=function(){if(this.iAmAdmin())return!0;if(!d("WAWebABProps").getABPropConfigValue("web_anyone_can_add_group_setting_enabled"))return!1;var a=this.getGroupMetadata();return this.iAmMember()&&(a==null?void 0:a.memberAddMode)===d("WAWebSchemaGroupMetadata").MemberAddMode.ALL_MEMBER_ADD};e.canTransferOwnership=function(a){if(d("WAWebUserPrefsMeUser").isMeAccount(a.id))return!1;if(!this.iAmSuperAdmin())return!1;if(!a.isAdmin)return!1;a=this.getGroupMetadata();return(a==null?void 0:a.groupType)!==d("WAWebGroupType").GroupType.COMMUNITY?!1:!0};e.canPromote=function(a){if(!a)return!1;if(d("WAWebUserPrefsMeUser").isMeAccount(a.id))return!1;if(!this.iAmAdmin())return!1;if(a.isAdmin)return!1;a=this.getGroupMetadata();return(a==null?void 0:a.isCag)?!1:!0};e.canDemote=function(a){if(!a)return!1;if(!this.iAmAdmin())return!1;var b=this.getGroupMetadata();if((b==null?void 0:b.groupType)!==d("WAWebGroupType").GroupType.COMMUNITY&&(b==null?void 0:b.groupType)!==d("WAWebGroupType").GroupType.LINKED_ANNOUNCEMENT_GROUP&&d("WAWebUserPrefsMeUser").isMeAccount(a.id))return!1;var c=a.isSuperAdmin;if(c)return(b==null?void 0:b.groupType)===d("WAWebGroupType").GroupType.COMMUNITY||(b==null?void 0:b.groupType)===d("WAWebGroupType").GroupType.LINKED_ANNOUNCEMENT_GROUP?d("WAWebUserPrefsMeUser").isMeAccount(a.id):!1;if(!a.isAdmin)return!1;return(b==null?void 0:b.groupType)===d("WAWebGroupType").GroupType.LINKED_ANNOUNCEMENT_GROUP?!1:!0};e.canRemove=function(a){if(!a)return!1;if(d("WAWebUserPrefsMeUser").isMeAccount(a.id))return!1;if(!this.iAmAdmin())return!1;var b=this.getGroupMetadata();return(b==null?void 0:b.isCag)&&(a.isAdmin||a.isSuperAdmin)?!1:!0};e.canVerifyIdentity=function(a){if(!a)return!1;if(d("WAWebUserPrefsMeUser").isMeAccount(a.id))return!1;var b=this.getGroupMetadata();return d("WAWebHostedGroupUtils").isWAHostedGroupEnabled()&&(b==null?void 0:b.hasCapi)===!0&&a.id.toString()===(b==null?void 0:(a=b.owner)==null?void 0:a.toString())?!1:!0};e.userIsMember=function(a){return this.isParticipantWidOrAlternateWidValid(a,function(a){return a!=null})};e.userIsAdmin=function(a){return this.isParticipantWidOrAlternateWidValid(a,function(a){return(a==null?void 0:a.isAdmin)===!0})};e.userIsSuperAdmin=function(a){return this.isParticipantWidOrAlternateWidValid(a,function(a){return(a==null?void 0:a.isSuperAdmin)===!0})};e.isParticipantWidOrAlternateWidValid=function(a,b){var c=this.get(a);if(b(c))return!0;c=d("WAWebApiContact").getAlternateUserWid(d("WAWebWidFactory").toUserWid(a));a=c?this.get(c):null;return b(a)};e.iAmMember=function(){var a=this.getMeParticipant();return a?!0:!1};e.iAmRestrictedMember=function(){var a=this.getGroupMetadata();a=(a==null?void 0:a.restrict)===!0;return a&&!this.iAmAdmin()};e.iAmAdmin=function(){var a=this.getMeParticipant();return(a==null?void 0:a.isAdmin)===!0};e.iAmSuperAdmin=function(){var a=this.getMeParticipant();return(a==null?void 0:a.isSuperAdmin)===!0};e.getAdmins=function(){return this.where({isAdmin:!0})};e.getSuperAdmin=function(){return this.findFirst(function(a){return a.isSuperAdmin})};e.getMyContacts=function(){return this.filter(function(a){a=d("WAWebContactCollection").ContactCollection.get(a.id);return a!=null&&d("WAWebContactGetters").getIsMyContact(a)})};e.getMeParticipant=function(){var a=d("WAWebUserPrefsMeUser").getMaybeMeUser(),b;a&&(b=this.get(a));a=d("WAWebUserPrefsMeUser").getMaybeMeLidUser();!b&&a&&(b=this.get(a));return b};e.getChat=function(){var a=this.parent.id;return d("WAWebChatCollection").ChatCollection.get(a)};e.getGroupMetadata=function(){var a=this.parent.id;return c("WAWebGroupMetadataCollection").get(a)};return b}(c("WAWebCollection"));a.model=c("WAWebGroupParticipantModel");a.comparator=c("WAWebGroupParticipantComparator");g["default"]=a}),98); __d("WAWebGroupParticipantModel",["WAWebBaseModel","WAWebContactCollection","WAWebWid"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.isAdmin=d("WAWebBaseModel").prop(),c.isSuperAdmin=d("WAWebBaseModel").prop(),c.leaveTs=d("WAWebBaseModel").prop(),c.leaveReason=d("WAWebBaseModel").prop(),c.contact=d("WAWebBaseModel").session(),b)||babelHelpers.assertThisInitialized(c)}var c=b.prototype;c.initialize=function(){a.prototype.initialize.call(this),this.addChild("contact",d("WAWebContactCollection").ContactCollection.gadd(this.id))};return b}(d("WAWebBaseModel").BaseModel);a.Proxy="participant";a.idClass=c("WAWebWid");b=d("WAWebBaseModel").defineModel(a);g["default"]=b}),98); __d("WAWebGroupPendingParticipantCollection",["WAWebCollection","WAWebGroupParticipantComparator","WAWebGroupParticipantModel","WAWebL10N","lodash"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(b,d){var e;d===void 0&&(d={});e=a.call(this,b,d)||this;e.$PendingParticipantCollection$p_1=c("lodash").debounce(function(){return e.sort()},1e3);e.listenTo(babelHelpers.assertThisInitialized(e),"change:contact.name",e.$PendingParticipantCollection$p_1);e.listenTo(c("WAWebL10N"),"locale_change",e.$PendingParticipantCollection$p_1);return e}var d=b.prototype;d["delete"]=function(){this.forEach(function(a){a["delete"]()}),this.stopListening(),this.reset()};d.ensureSorted=function(){this.$PendingParticipantCollection$p_1.flush()};d.set=function(b,c){c===void 0&&(c={});c.isParticipantCollectionAdd!==!0&&(c.remove=!0);return a.prototype.set.call(this,b,c)};d.add=function(b,c){c===void 0&&(c={});c.isParticipantCollectionAdd=!0;return a.prototype.add.call(this,b,c)};return b}(c("WAWebCollection"));a.model=c("WAWebGroupParticipantModel");a.comparator=c("WAWebGroupParticipantComparator");g["default"]=a}),98); __d("WAWebPastParticipantCollection",["WATimeUtils","WAWebCollection","WAWebGroupConstants","WAWebGroupParticipantModel"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}var c=b.prototype;c.getValidRecords=function(){return this.filter(function(a){a=d("WATimeUtils").castToUnixTime(a.leaveTs);var b=d("WATimeUtils").DAY_SECONDS*d("WAWebGroupConstants").PAST_PARTICIPANT_EXPIRATION_DAYS;return d("WATimeUtils").happenedWithin(a,b)})};return b}(c("WAWebCollection"));a.model=c("WAWebGroupParticipantModel");a.comparator=function(a,b){return b.leaveTs-a.leaveTs};g["default"]=a}),98); __d("WAWebSubgroupSuggestionCollection",["WAWebBaseCollection","WAWebSubgroupSuggestionModel"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}return b}(d("WAWebBaseCollection").BaseCollection);a.model=c("WAWebSubgroupSuggestionModel");a.comparator=function(a,b){return a.t-b.t};g["default"]=a}),98); __d("WAWebCellRequestState",["$InternalEnum"],(function(a,b,c,d,e,f){a=b("$InternalEnum").Mirrored(["Pending","Loading","Approved","Rejected","Canceled","Error"]);f.State=a}),66); __d("WAWebSubgroupSuggestionModel",["WAWebBaseModel","WAWebCellRequestState","WAWebContactCollection"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.groupId=d("WAWebBaseModel").prop(),c.parentGroupId=d("WAWebBaseModel").prop(),c.subject=d("WAWebBaseModel").prop(),c.desc=d("WAWebBaseModel").prop(),c.owner=d("WAWebBaseModel").prop(),c.t=d("WAWebBaseModel").prop(),c.isExistingGroup=d("WAWebBaseModel").prop(),c.participantCount=d("WAWebBaseModel").prop(),c.hiddenSubgroup=d("WAWebBaseModel").prop(),c.ownerContact=d("WAWebBaseModel").session(),c.currentState=d("WAWebBaseModel").session(),c.error=d("WAWebBaseModel").session(),b)||babelHelpers.assertThisInitialized(c)}var c=b.prototype;c.initialize=function(){a.prototype.initialize.call(this),this.addChild("ownerContact",d("WAWebContactCollection").ContactCollection.gadd(this.owner)),this.resetState()};c.resetState=function(){this.currentState=d("WAWebCellRequestState").State.Pending,this.error=void 0};return b}(d("WAWebBaseModel").BaseModel);a.Proxy="subgroup_suggestion";b=d("WAWebBaseModel").defineModel(a);g["default"]=b}),98); __d("WAWebUnjoinedSubgroupMetadataCollection",["WAWebBaseCollection","WAWebGroupMetadataCollection","WAWebUnjoinedSubgroupMetadataModel","WAWebUpdateSubgroupsCommunityAction"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b;b=a.call(this)||this;b.listenTo(babelHelpers.assertThisInitialized(b),"add",b.$UnjoinedSubgroupMetadataCollection$p_1);b.listenTo(babelHelpers.assertThisInitialized(b),"remove",b.$UnjoinedSubgroupMetadataCollection$p_1);b.listenTo(babelHelpers.assertThisInitialized(b),"change:parentGroupId",b.$UnjoinedSubgroupMetadataCollection$p_2);return b}var e=b.prototype;e.$UnjoinedSubgroupMetadataCollection$p_3=function(a){a&&d("WAWebUpdateSubgroupsCommunityAction").updateUnjoinedSubgroups(a)};e.$UnjoinedSubgroupMetadataCollection$p_1=function(a){a=c("WAWebGroupMetadataCollection").get(a.parentGroupId.toString());this.$UnjoinedSubgroupMetadataCollection$p_3(a)};e.$UnjoinedSubgroupMetadataCollection$p_2=function(a,b,d){a=b!=null?c("WAWebGroupMetadataCollection").get(b.toString()):null;b=d!=null?c("WAWebGroupMetadataCollection").get(d.toString()):null;this.$UnjoinedSubgroupMetadataCollection$p_3(a);this.$UnjoinedSubgroupMetadataCollection$p_3(b)};return b}(d("WAWebBaseCollection").BaseCollection);a.model=c("WAWebUnjoinedSubgroupMetadataModel");b=new a();g["default"]=b}),98); __d("WAWebUnjoinedSubgroupMetadataModel",["fbt","WAWebBaseModel","WAWebGroupParticipantCollection","WAWebGroupType","WAWebWid"],(function(a,b,c,d,e,f,g,h){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,e;for(var f=arguments.length,g=new Array(f),i=0;i<f;i++)g[i]=arguments[i];return(b=e=a.call.apply(a,[this].concat(g))||this,e.id=d("WAWebBaseModel").prop(),e.subject=d("WAWebBaseModel").prop(),e.subjectTime=d("WAWebBaseModel").prop(),e.parentGroupId=d("WAWebBaseModel").prop(),e.defaultSubgroup=d("WAWebBaseModel").prop(),e.generalSubgroup=d("WAWebBaseModel").prop(),e.desc=d("WAWebBaseModel").prop(),e.creation=d("WAWebBaseModel").prop(),e.owner=d("WAWebBaseModel").prop(),e.size=d("WAWebBaseModel").prop(),e.adminRequestRequired=d("WAWebBaseModel").prop(),e.membershipApprovalMode=d("WAWebBaseModel").prop(),e.membershipApprovalRequest=d("WAWebBaseModel").prop(),e.hiddenSubgroup=d("WAWebBaseModel").prop(),e.suspended=d("WAWebBaseModel").prop(),e.participants=d("WAWebBaseModel").collection(c("WAWebGroupParticipantCollection")),e.groupType=d("WAWebBaseModel").derived(function(){if(this.defaultSubgroup===!0)return d("WAWebGroupType").GroupType.LINKED_ANNOUNCEMENT_GROUP;return this.generalSubgroup===!0?d("WAWebGroupType").GroupType.LINKED_GENERAL_GROUP:d("WAWebGroupType").GroupType.LINKED_SUBGROUP},["defaultSubgroup","generalSubgroup"]),e.displayedDesc=d("WAWebBaseModel").derived(function(){return this.groupType===d("WAWebGroupType").GroupType.LINKED_ANNOUNCEMENT_GROUP&&(this.desc==null||this.desc==="")?h._(/*BTDS*/"__JHASH__BO-lF75hD0I__JHASH__").toString():this.desc},["desc","groupType"]),b)||babelHelpers.assertThisInitialized(e)}return b}(d("WAWebBaseModel").BaseModel);a.Proxy="unjoinedSubgroupMetadata";a.idClass=c("WAWebWid");b=d("WAWebBaseModel").defineModel(a);g["default"]=b}),226); __d("WAWebUnreadMentionMetadataModel",["WAWebBaseModel","WAWebChatUnreadMentionCollection"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.unreadMentionCollection=d("WAWebBaseModel").prop(),c.pendingUnreadMentionCount=d("WAWebBaseModel").prop(),b)||babelHelpers.assertThisInitialized(c)}var e=b.prototype;e.initialize=function(){this.unreadMentionCollection=new(c("WAWebChatUnreadMentionCollection"))(),this.pendingUnreadMentionCount=0};e.hasMentionId=function(a){return this.unreadMentionCollection.get(a)!=null};e.addUnreadMentions=function(a,b){this.unreadMentionCollection.add(a)};e.removeUnreadMentions=function(a){this.unreadMentionCollection.remove(a)};e.oldestUnreadMention=function(){return this.unreadMentionCollection.oldestUnreadMention()};e.reset=function(){this.pendingUnreadMentionCount=0,this.unreadMentionCollection.reset()};e.getUnreadMentionCount=function(){return this.pendingUnreadMentionCount+this.unreadMentionCollection.length};return b}(d("WAWebBaseModel").BaseModel);b=d("WAWebBaseModel").defineModel(a);g["default"]=b}),98); __d("WAWebCarouselCardsCollection",["WAWebBaseCollection","WAWebMsgModel"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){return a.apply(this,arguments)||this}var c=b.prototype;c.clone=function(){var a=new b();a.add(this.slice());return a};c.getCardsById=function(){var a={};this.forEach(function(b){a[b.id.toString()]=b});return a};return b}(d("WAWebBaseCollection").BaseCollection);a.model=d("WAWebMsgModel").Msg;g["default"]=a}),98); __d("WAWebCarouselMsgUtils",["WALogger","WAWebMsgCollection"],(function(a,b,c,d,e,f,g){"use strict";function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Could not find parent msg (id=",") for carousel card."]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["parentMsgId is null on carousel card."]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["getParentMsgFromCarouselCard called on non carousel card."]);j=function(){return a};return a}function a(a){if(!a.isCarouselCard){d("WALogger").ERROR(j()).sendLogs("getParentMsgFromCarouselCard-error");return}if(a.parentMsgId==null){d("WALogger").ERROR(i()).sendLogs("getParentMsgFromCarouselCard-error");return}var b=d("WAWebMsgCollection").MsgCollection.get(a.parentMsgId);b==null&&d("WALogger").ERROR(h(),a.parentMsgId).sendLogs("getParentMsgFromCarouselCard-error");return b}function b(a){var b=[],c=function(a){return b.push(a)};for(a of a)a.carouselCards!=null?a.carouselCards.forEach(c):c(a);return b}g.getParentMsgFromCarouselCard=a;g.flattenMsgs=b}),98); __d("WAWebBizCtwaAGMUtils",["fbt","WAWebABProps","WAWebBizGatingUtils","WAWebCtwaAGMUtils","WAWebMsgType","WAWebURLUtils"],(function(a,b,c,d,e,f,g,h){"use strict";function a(){return h._(/*BTDS*/"__JHASH__-pgFPCpebvT__JHASH__")}function b(a){return h._(/*BTDS*/"__JHASH__jFhyh56_Aqc__JHASH__",[h._param("ad source",a)])}function e(){return h._(/*BTDS*/"__JHASH__93zwoj94gn5__JHASH__")}function i(a){return c("WAWebURLUtils").withoutWww(c("WAWebURLUtils").hostname(a))}function f(a){if(a.sourceUrl==null)return null;a=i(a.sourceUrl);a=a.split(".")[0];return a==="fb"?"facebook":a}function j(a){return h._(/*BTDS*/"__JHASH__iVR2PIz7NlV__JHASH__",[h._param("ad source",a)])}function k(){return h._(/*BTDS*/"__JHASH__6y3hmMO_VUM__JHASH__")}function l(a,b,c){var e=d("WAWebBizGatingUtils").getWamoAgmEnabled();a=a===d("WAWebCtwaAGMUtils").AGM_SOURCE_APP.FACEBOOK||a===d("WAWebCtwaAGMUtils").AGM_SOURCE_APP.INSTAGRAM;b=b===d("WAWebMsgType").MSG_TYPE.AUTOMATED_GREETING_MESSAGE&&c===!0&&d("WAWebBizGatingUtils").getFmxAgmEnabled();return e?b:a&&b}function m(a){if(a.type===d("WAWebMsgType").MSG_TYPE.AUTOMATED_GREETING_MESSAGE&&a.ctwaContext!=null){a=a.ctwaContext;a=d("WAWebCtwaAGMUtils").extractAGMPayload(a);return(a==null?void 0:a.ctaType)===d("WAWebCtwaAGMUtils").AGM_CTA_TYPE.FLOW?d("WAWebABProps").getABPropConfigValue("flows_wa_web"):!0}return!1}function n(a){var b;return m(a)&&l((b=a.ctwaContext)==null?void 0:b.sourceApp,a.type,((b=a.ctwaContext)==null?void 0:b.automatedGreetingMessageShown)===!0)}function o(a){a=a.getAllMsgs();a=a.find(function(a){return a.type!==d("WAWebMsgType").MSG_TYPE.E2E_NOTIFICATION&&a.type!==d("WAWebMsgType").MSG_TYPE.NOTIFICATION_TEMPLATE&&a.type!==d("WAWebMsgType").MSG_TYPE.NOTIFICATION});return(a==null?void 0:a.type)===d("WAWebMsgType").MSG_TYPE.AUTOMATED_GREETING_MESSAGE}g.getCtwaDetailsLabel=a;g.getAdSourceLabel=b;g.getBackToChatLabel=e;g.getHostnameLabel=f;g.getAdImageAlt=j;g.getAdImgError=k;g.isAutomatedGreetingMessageEnabled=l;g.isAGMFutureproof=n;g.isCtWAInitiatedChat=o}),226); __d("WAWebMsgActionCapability",["WALogger","WANullthrows","WATimeUtils","WAWebABProps","WAWebAck","WAWebBizCoexGatingUtils","WAWebBizCtwaAGMUtils","WAWebBotGating","WAWebBotGenTypingIndicatorMsg","WAWebBusinessHSMTypes","WAWebChatGetters","WAWebChatGroupUtils","WAWebCommonMsgSubtypeTypes","WAWebContactGetters","WAWebDisplayType","WAWebFrontendChatGetters","WAWebFrontendMsgGetters","WAWebIsSpamSupportedForMessageType","WAWebMediaTypes","WAWebMessageAssociation.flow","WAWebMessageEditGatingUtils","WAWebMessageEditUtils","WAWebMiscGatingUtils","WAWebMobilePlatforms","WAWebMsgGetters","WAWebMsgLinks","WAWebMsgModel","WAWebMsgType","WAWebNewsletterGatingUtils","WAWebNewsletterMembershipUtil","WAWebPinMsgGatingUtils","WAWebPollCreationUtils","WAWebProtobufsE2E.pb","WAWebRevokeMsgConstants","WAWebStateUtils","WAWebUserPrefsMultiDevice","cr:6009"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["msg doesn't have a server ID, will be impossible to generate message link"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["chat doesn't have a newsletter invite code, will be impossible to generate message link"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["chat doesn't have newsletter metadata, will be impossible to generate message link"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["canRevokeNewsletterMsg called on a non-newsletter chat"]);k=function(){return a};return a}function a(a,b){return a.isWamoSub===!0&&!d("WAWebNewsletterMembershipUtil").iAmAdminOrOwner(b)}function l(a,b){return d("WAWebChatGetters").getIsNewsletter(b)&&a.isWamoSub===!0&&!d("WAWebNewsletterMembershipUtil").iAmAdminOrOwner(b.newsletterMetadata)&&d("WAWebNewsletterGatingUtils").isWamoSubMessagesSupported()?!1:!0}function m(a){a=d("WAWebStateUtils").unproxy(a);if(a.isCarouselCard||a.carouselCards)return!1;if(a.associationType===d("WAWebMessageAssociation.flow").MessageAssociationType.MEDIA_POLL)return!1;var b=d("WAWebFrontendMsgGetters").getMaybeChat(a);if((b==null?void 0:b.isSuspendedOrTerminated())&&d("WAWebMiscGatingUtils").isGroupSuspendV2Enabled())return!1;var c=b!=null&&d("WAWebChatGetters").getIsNewsletter(b);if(c){if(!d("WAWebNewsletterGatingUtils").isNewsletterMessageForwardSendingEnabled())return!1;if(b!=null&&!l(a,b))return!1}switch(a.type){case d("WAWebMsgType").MSG_TYPE.CALL_LOG:case d("WAWebMsgType").MSG_TYPE.CIPHERTEXT:case d("WAWebMsgType").MSG_TYPE.DEBUG_PLACEHOLDER:case d("WAWebMsgType").MSG_TYPE.EVENT_CREATION:case d("WAWebMsgType").MSG_TYPE.GROUPS_V4_INVITE:case d("WAWebMsgType").MSG_TYPE.NEWSLETTER_ADMIN_INVITE:case d("WAWebMsgType").MSG_TYPE.ORDER:case d("WAWebMsgType").MSG_TYPE.OVERSIZED:case d("WAWebMsgType").MSG_TYPE.PAYMENT:case d("WAWebMsgType").MSG_TYPE.REQUEST_PHONE_NUMBER:case d("WAWebMsgType").MSG_TYPE.REVOKED:case d("WAWebMsgType").MSG_TYPE.RICH_RESPONSE:case d("WAWebMsgType").MSG_TYPE.UNKNOWN:return!1;case d("WAWebMsgType").MSG_TYPE.POLL_CREATION:return c&&a.pollContentType!==d("WAWebPollCreationUtils").PollContentType.IMAGE&&d("WAWebNewsletterGatingUtils").isNewsletterPollForwardingEnabled();case d("WAWebMsgType").MSG_TYPE.POLL_RESULT_SNAPSHOT:return d("WAWebNewsletterGatingUtils").isNewsletterPollForwardingEnabled();case d("WAWebMsgType").MSG_TYPE.LIST:return((b=a.list)==null?void 0:b.listType)===d("WAWebProtobufsE2E.pb").Message$ListMessage$ListType.PRODUCT_LIST}if(a.type===d("WAWebMsgType").MSG_TYPE.LOCATION&&a.isLive)return!1;if(a.type===d("WAWebMsgType").MSG_TYPE.INTERACTIVE&&a.nativeFlowName!=null)return!1;if(!a.interactiveButtonsReleased())return!1;if(a.ack<d("WAWebAck").ACK.SENT&&d("WAWebMsgGetters").getIsSentByMe(a))return!1;if(a.type===d("WAWebMsgType").MSG_TYPE.CHAT&&a.subtype===d("WAWebBotGenTypingIndicatorMsg").BOT_TYPING_PLACEHOLDER_MSG_SUBTYPE)return!1;if(d("WAWebFrontendMsgGetters").getAsMms(a)){b=a.mediaData;if(b.mediaStage===d("WAWebMediaTypes").MediaDataStage.EXISTS)return!0;if(b.mediaStage===d("WAWebMediaTypes").MediaDataStage.ERROR_MISSING)return!1;if(b.mediaStage===d("WAWebMediaTypes").MediaDataStage.ERROR_UNSUPPORTED)return!1;if(b.mediaStage!==d("WAWebMediaTypes").MediaDataStage.RESOLVED&&(a.type===d("WAWebMsgType").MSG_TYPE.IMAGE||a.type===d("WAWebMsgType").MSG_TYPE.VIDEO||a.type===d("WAWebMsgType").MSG_TYPE.PTV||a.type===d("WAWebMsgType").MSG_TYPE.PTT))return!1;if(a.type===d("WAWebMsgType").MSG_TYPE.PTV)if(c){if(!d("WAWebNewsletterGatingUtils").isNewsletterPTVForwardingEnabled())return!1}else if(!d("WAWebMsgGetters").getIsSentByMe(a))return!1;if(a.isViewOnce)return!1;if(d("WAWebFrontendMsgGetters").getIsUnsentMedia(a))return!1}if((b=a.nativeFlowButtons)==null?void 0:b.length)return!1;if(a.hsmTag===d("WAWebBusinessHSMTypes").HSM_TAG_TYPE.AUTHENTICATION)return!1;return d("WAWebBizCtwaAGMUtils").isAutomatedGreetingMessageEnabled((c=a.ctwaContext)==null?void 0:c.sourceApp,a.type,(b=a.ctwaContext)==null?void 0:b.automatedGreetingMessageShown)?!1:!0}function e(a){var b=d("WAWebStateUtils").unproxy(a);return!m(a)||d("WAWebMsgGetters").getIsFrequentlyForwarded(b)||d("WAWebMsgLinks").getSuspiciousLinks(b).length!==0||d("WAWebFrontendMsgGetters").getAsPttLike(b)!=null||b.type===d("WAWebMsgType").MSG_TYPE.STICKER||!b.interactiveButtonsReleased()?!1:d("WAWebFrontendMsgGetters").getAsMms(b)!=null||d("WAWebMsgGetters").getLinkPreview(b)||b.type===d("WAWebMsgType").MSG_TYPE.VCARD||b.type===d("WAWebMsgType").MSG_TYPE.LOCATION||b.type===d("WAWebMsgType").MSG_TYPE.POLL_CREATION||b.type===d("WAWebMsgType").MSG_TYPE.POLL_RESULT_SNAPSHOT||b.ctwaContext!=null}function f(a){a=d("WAWebStateUtils").unproxy(a);if(d("WAWebChatGetters").getIsNewsletter(d("WAWebFrontendMsgGetters").getChat(a)))return!1;if(a.isCarouselCard)return!1;return a.ctwaContext!=null&&d("WAWebBizCtwaAGMUtils").isAutomatedGreetingMessageEnabled(a.ctwaContext.sourceApp,a.type,a.ctwaContext.automatedGreetingMessageShown)?!1:(!d("WAWebMsgGetters").getIsEphemeral(a)||a.supportsStarWithKeepInChat())&&!d("WAWebMsgGetters").getIsNotification(a)&&!d("WAWebMsgGetters").getIsFutureproof(a)&&!a.isViewOnce&&a.type!==d("WAWebMsgType").MSG_TYPE.REVOKED&&a.type!==d("WAWebMsgType").MSG_TYPE.DEBUG_PLACEHOLDER&&!(a.ack<d("WAWebAck").ACK.SENT&&d("WAWebMsgGetters").getIsSentByMe(a))&&a.interactiveButtonsReleased()&&!d("WAWebFrontendMsgGetters").getAsAlbum(a)}function n(a){a=d("WAWebStateUtils").unproxy(a);var b=d("WAWebFrontendMsgGetters").getChat(a);if(a.isViewOnce===!0||a.subtype==="view_once_unavailable_fanout")return!1;if(d("WAWebChatGetters").getIsNewsletter(b)||b.id.isBot())return!1;if(a.isCarouselCard)return!1;if(d("WAWebMsgGetters").getIsGroupMsg(a)){b=c("WANullthrows")(b.groupMetadata);if(!b.participants.iAmMember())return!1;if((b.restrict||b.announce)&&!b.participants.iAmAdmin())return!1}return d("WAWebBizCtwaAGMUtils").isAutomatedGreetingMessageEnabled((b=a.ctwaContext)==null?void 0:b.sourceApp,a.type,(b=a.ctwaContext)==null?void 0:b.automatedGreetingMessageShown)?!1:!d("WAWebMsgGetters").getIsNotification(a)&&!d("WAWebMsgGetters").getIsFutureproof(a)&&!d("WAWebMsgGetters").getIsViewOnce(a)&&a.type!==d("WAWebMsgType").MSG_TYPE.REVOKED&&a.type!==d("WAWebMsgType").MSG_TYPE.DEBUG_PLACEHOLDER&&!(a.ack<d("WAWebAck").ACK.SENT&&d("WAWebMsgGetters").getIsSentByMe(a))&&a.interactiveButtonsReleased()&&!a.isExpiredAndNotKept()&&d("WAWebPinMsgGatingUtils").isPinnedMessagesM1SenderEnabled()&&!d("WAWebFrontendMsgGetters").getAsAlbum(a)}function o(a,b){var c;b===void 0&&(b=!1);if(d("WAWebMsgGetters").getIsBotQuery(a))return!1;var e=d("WAWebFrontendMsgGetters").getChat(a);if(d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&(e==null?void 0:(c=e.id)==null?void 0:c.isUser())&&(e==null?void 0:(c=e.contact)==null?void 0:c.isHosted)===!0)return!1;e=d("WAWebMsgGetters").getIsEdited(a)&&d("WAWebMsgGetters").getIsFailed(a)&&!b||!a.mayFail();return d("WAWebChatGetters").getIsNewsletter(d("WAWebFrontendMsgGetters").getChat(a))?d("WAWebNewsletterGatingUtils").isNewsletterMessageEditingEnabled()&&d("WAWebNewsletterMembershipUtil").iAmAdminOrOwner(d("WAWebFrontendMsgGetters").getChat(a).newsletterMetadata)&&e&&!a.isForwarded:d("WAWebMsgGetters").getIsSentByMe(a)&&!a.isForwarded&&a.local&&(d("WAWebMessageEditGatingUtils").sendCagMsgEditEnabled()||!d("WAWebFrontendChatGetters").getIsCAG(d("WAWebFrontendMsgGetters").getChat(a)))&&e&&d("WAWebFrontendMsgGetters").getChat(a).canSend&&!d("WAWebFrontendMsgGetters").getChat(a).contact.isEnterprise}function p(a){var b=d("WAWebMsgGetters").getIsGroupMsg(a),c=d("WAWebMsgGetters").getIsSentByMe(a),e=d("WAWebFrontendMsgGetters").getChat(a).groupMetadata;return!d("WAWebABProps").getABPropConfigValue("report_to_admin_kill_switch")||c||a.isViewOnce||d("WAWebChatGetters").getIsNewsletter(d("WAWebFrontendMsgGetters").getChat(a))||d("WAWebMsgGetters").getIsMetaBotResponse(a)||!b?!1:Boolean(e==null?void 0:e.reportToAdminMode)}function q(a,b){b===void 0&&(b=!1);return(d("WAWebMsgGetters").getIsNewsletterMsg(a)?d("WAWebNewsletterGatingUtils").isNewsletterMessageEditingEnabled():d("WAWebMessageEditGatingUtils").sendTextEditEnabled())&&d("WAWebMessageEditUtils").getMsgEditType(a.type)===d("WAWebMessageEditUtils").MsgEditType.TextEdit&&o(a,b)}function r(a,b){b===void 0&&(b=!1);return(d("WAWebMsgGetters").getIsNewsletterMsg(a)?d("WAWebNewsletterGatingUtils").isNewsletterMessageEditingEnabled():d("WAWebMessageEditGatingUtils").sendCaptionEditEnabled())&&d("WAWebMessageEditUtils").getMsgEditType(a.type)===d("WAWebMessageEditUtils").MsgEditType.CaptionEdit&&Boolean(a.caption)&&d("WAWebFrontendMsgGetters").getAsViewOnce(a)==null&&o(a,b)}function s(a){switch(a){case d("WAWebDisplayType").DISPLAY_TYPE.CONVERSATION:case d("WAWebDisplayType").DISPLAY_TYPE.ANNOUNCEMENT:return!0;case d("WAWebDisplayType").DISPLAY_TYPE.NEWSLETTER:return d("WAWebNewsletterGatingUtils").isNewsletterMessageEditingEnabled();default:return!1}}function t(a){if((b("cr:6009")==null?void 0:b("cr:6009").messageEditRestrictionEnabled())===!1)return!0;a=d("WAWebStateUtils").unproxy(a);return(q(a,!0)||r(a,!0))&&d("WAWebMessageEditUtils").isParentWithinEditUIWindow({parentTsInSeconds:a.t,msgKey:a.id})}function u(a){if((b("cr:6009")==null?void 0:b("cr:6009").messageEditRestrictionEnabled())===!1)return!0;a=d("WAWebStateUtils").unproxy(a);return q(a)&&d("WAWebMessageEditUtils").isParentWithinEditProcessingWindow({parentTsInSeconds:a.t,msgKey:a.id})}function v(a){if((b("cr:6009")==null?void 0:b("cr:6009").messageEditRestrictionEnabled())===!1)return!0;a=d("WAWebStateUtils").unproxy(a);return r(a)&&d("WAWebMessageEditUtils").isParentWithinEditProcessingWindow({parentTsInSeconds:a.t,msgKey:a.id})}function w(a){var b;a=d("WAWebStateUtils").unproxy(a);if(d("WAWebMsgGetters").getIsSentByMe(a)||d("WAWebMsgGetters").getIsPSA(a)||d("WAWebMsgGetters").getIsBotResponse(a))return!1;return d("WAWebBizCtwaAGMUtils").isAutomatedGreetingMessageEnabled((b=a.ctwaContext)==null?void 0:b.sourceApp,a.type,(b=a.ctwaContext)==null?void 0:b.automatedGreetingMessageShown)?!1:d("WAWebIsSpamSupportedForMessageType").isMsgTypeSupportedForMsgLevelReporting(a.type)}function x(a){return d("WATimeUtils").unixTime()-d("WAWebMsgGetters").getT(a)<=d("WAWebRevokeMsgConstants").NEWSLETTER_REVOKE_WINDOW}function y(a){var b,c=d("WAWebFrontendMsgGetters").getCurrentChat(a);if(!d("WAWebChatGetters").getIsNewsletter(c)){d("WALogger").ERROR(k());return!1}if(A(a))return!1;b=((b=a.ack)!=null?b:d("WAWebAck").ACK.CLOCK)<d("WAWebAck").ACK.CLOCK;return(x(a)||b)&&d("WAWebNewsletterMembershipUtil").iAmAdminOrOwner(c.newsletterMetadata)}function z(a){var b=d("WAWebFrontendMsgGetters").getChat(a);if(!d("WAWebChatGetters").getIsNewsletter(b))return!1;if(!x(a))return!1;if(b.newsletterMetadata==null){d("WALogger").ERROR(j());return!1}if(b.newsletterMetadata.inviteCode==null){d("WALogger").ERROR(i());return!1}if(a.serverId==null){d("WALogger").ERROR(h());return!1}if(a.type===d("WAWebMsgType").MSG_TYPE.REVOKED)return!1;return!l(a,b)?!1:!0}function A(a){var b=!1;a.type===d("WAWebMsgType").MSG_TYPE.PROTOCOL&&((a.subtype===d("WAWebCommonMsgSubtypeTypes").MsgSubtype.AdminRevoke||d("WAWebCommonMsgSubtypeTypes").MsgSubtype.SenderRevoke)&&(b=!0));return b||a.type===d("WAWebMsgType").MSG_TYPE.REVOKED}function B(a){var b;if(A(a))return!1;var c=d("WAWebFrontendMsgGetters").getCurrentChat(a);if(d("WAWebChatGetters").getIsNewsletter(c))return y(a);if(d("WAWebChatGetters").getIsGroup(c)&&!((b=c.groupMetadata)==null?void 0:b.participants.iAmMember())||d("WAWebContactGetters").getIsMe(c.contact)||c.contact.isEnterprise&&!c.contact.id.isBot()||d("WAWebFrontendChatGetters").getIsCapiHostedGroup(c))return!1;if(d("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&!d("WAWebChatGetters").getIsGroup(c)&&(c.contact.isHosted===!0||d("WAWebUserPrefsMultiDevice").getIsHostedMeAccountFromLocalStorage()))return!1;return a.type===d("WAWebMsgType").MSG_TYPE.COMMENT?a.ack!=null&&a.ack>=d("WAWebAck").ACK.SENT:d("WAWebMsgGetters").getIsUserCreatedType(a)&&!(a.broadcast!=null&&a.broadcast)&&(a instanceof d("WAWebMsgModel").Msg&&!a.isUnsentPhoneMsg()||d("WAWebMsgGetters").getIsEdited(a))&&!d("WAWebFrontendMsgGetters").getIsUnsentMedia(a)&&!d("WAWebChatGroupUtils").isSuspendedGroup(d("WAWebFrontendMsgGetters").getCurrentChat(a))&&!d("WAWebChatGroupUtils").isTerminatedGroup(d("WAWebFrontendMsgGetters").getCurrentChat(a))}function C(a){var b=a;a instanceof d("WAWebMsgModel").Msg&&(b=d("WAWebStateUtils").unproxy(a));a=d("WATimeUtils").unixTime()-d("WAWebMsgGetters").getT(b)<=d("WAWebRevokeMsgConstants").REVOKE_WINDOW;return B(b)&&b.id.fromMe&&a}function D(a){var b=a;a instanceof d("WAWebMsgModel").Msg&&(b=d("WAWebStateUtils").unproxy(a));a=d("WAWebFrontendMsgGetters").getCurrentChat(b);if(d("WAWebChatGetters").getIsNewsletter(a))return y(b);var c=d("WATimeUtils").unixTime()-d("WAWebMsgGetters").getT(b)<=d("WAWebRevokeMsgConstants").REVOKE_WINDOW;return B(b)&&!b.id.fromMe&&Boolean((b=a.groupMetadata)==null?void 0:b.participants.iAmAdmin())&&c}function E(a){var b=a;a instanceof d("WAWebMsgModel").Msg&&(b=d("WAWebStateUtils").unproxy(a));a=d("WAWebRevokeMsgConstants").REVOKE_WINDOW;var c=d("WAWebMsgGetters").isMetaBotResponseToMyInvoke(b);a=d("WATimeUtils").unixTime()-d("WAWebMsgGetters").getT(b)<=a;return d("WAWebBotGating").isBotEnabled()&&B(b)&&a&&c}function F(a){var b;a=d("WAWebStateUtils").unproxy(a);if(d("WAWebFrontendMsgGetters").getChat(a).isSuspendedOrTerminated()&&d("WAWebMiscGatingUtils").isGroupSuspendV2Enabled())return!1;if(a.type===d("WAWebMsgType").MSG_TYPE.STICKER_PACK)return!1;if(d("WAWebFrontendMsgGetters").getAsRevoked(a))return!1;if(a.isViewOnce)return!1;if(a.type===d("WAWebMsgType").MSG_TYPE.VCARD||a.type===d("WAWebMsgType").MSG_TYPE.MULTI_VCARD)return!0;if(!((b=a.mediaData)==null?void 0:b.isDownloadable()))return!1;if(a.type===d("WAWebMsgType").MSG_TYPE.STICKER)return!1;if(a.type===d("WAWebMsgType").MSG_TYPE.PTV&&!d("WAWebMsgGetters").getIsSentByMe(a))return!1;return!l(a,d("WAWebFrontendMsgGetters").getChat(a))?!1:!0}function G(a){var b=d("WAWebFrontendMsgGetters").getChat(a);return!d("WAWebMobilePlatforms").isSMB()||d("WAWebChatGetters").getIsNewsletter(b)?!1:!d("WAWebFrontendMsgGetters").getAsRevoked(a)}function H(a){var b;return d("WAWebBizCtwaAGMUtils").isAutomatedGreetingMessageEnabled((b=a.ctwaContext)==null?void 0:b.sourceApp,a.type,(b=a.ctwaContext)==null?void 0:b.automatedGreetingMessageShown)?!1:!d("WAWebChatGetters").getIsNewsletter(d("WAWebFrontendMsgGetters").getChat(a))||y(a)}g.isWamoSubMsgAndNotAdminOrOwner=a;g.canWamoSubMsgBeSharedByUser=l;g.canForwardMsg=m;g.canQuickForwardMsg=e;g.canStarMsg=f;g.canPinMsg=n;g.canReportToAdmin=p;g.displayTypeSupportsEditing=s;g.canEnterEditingFlow=t;g.canEditText=u;g.canEditCaption=v;g.canReportMsg=w;g.isNewsletterMsgOnServer=x;g.canRevokeNewsletterMsg=y;g.canCopyNewsletterMessageLink=z;g.canSenderRevokeMsg=C;g.canAdminRevokeMsg=D;g.canBotResponseBeRevokeByInvoker=E;g.canDownloadMsg=F;g.canAddLabelToMsg=G;g.canDeleteMsg=H}),98); __d("WAWebFtsConstants",[],(function(a,b,c,d,e,f){a=60*1e3;b=300;c=30;f.FTS_TTL=a;f.FTS_TYPING_DELAY=b;f.FTS_NUM_RESULTS=c}),66); __d("WAWebMsgCollection",["Promise","WALogger","WANullthrows","WAPromiseProps","WATimeUtils","WATypeUtils","WAWebAck","WAWebBackendErrors","WAWebBaseCollection","WAWebBotGenTypingIndicatorMsg","WAWebChatCollection","WAWebCollectionConstants","WAWebCollectionUtils","WAWebDBMessageFindLocal","WAWebDBMsgUtils","WAWebEventsWaitForBbEvent","WAWebFrontendMsgGetters","WAWebFtsConstants","WAWebInvisiblePlaceholderViewModeProcessor","WAWebLidMigrationUtils","WAWebMessageAssociationUIUtils","WAWebMsgDataFromModel","WAWebMsgGetters","WAWebMsgModel","WAWebMsgOpaqueData","WAWebMsgType","WAWebNewsletterMsgHistoryUtils","WAWebNewsletterViewModeUIUtils","WAWebNoop","WAWebProcessMultipleMsgsAction","WAWebProductMessageListCollection","WAWebProtobufsE2E.pb","WAWebSyncButtonState","WAWebUserPrefsMeUser","WAWebViewMode.flow","WAWebViewModeUtils","WAWebWid","WAWebWorkerSafeBackendApi","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["model:msg:getContext:before ctx message mismatch"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["model:msg:getContext:before fetch error"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["model:msg:getContext:after fetch error"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["model:msg:getContext fetch error"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["model:Msg:media error ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["model:Msg:search error ",""]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["model:Msg:getAllDocsMsgs error ",""]);o=function(){return a};return a}function p(){var a=babelHelpers.taggedTemplateLiteralLoose(["model:Msg:getAllDocsMsgs error 499 (unimplemented)"]);p=function(){return a};return a}function q(){var a=babelHelpers.taggedTemplateLiteralLoose(["model:Msg:getAllLinksMsgs error ",""]);q=function(){return a};return a}function r(){var a=babelHelpers.taggedTemplateLiteralLoose(["model:Msg:getAllLinksMsgs error 499 (unimplemented)"]);r=function(){return a};return a}function s(){var a=babelHelpers.taggedTemplateLiteralLoose(["model:Msg:getAllMediaMsgs error ",""]);s=function(){return a};return a}function t(){var a=babelHelpers.taggedTemplateLiteralLoose(["model:Msg:getAllMediaMsgs error 499 (unimplemented)"]);t=function(){return a};return a}function u(){var a=babelHelpers.taggedTemplateLiteralLoose(["model:Msg:getVoipCallLogMsgs error ",""]);u=function(){return a};return a}function v(){var a=babelHelpers.taggedTemplateLiteralLoose(["model:Msg:getVoipCallLogMsgs error 499 (unimplemented)"]);v=function(){return a};return a}function w(){var a=babelHelpers.taggedTemplateLiteralLoose(["model:Msg:getEventMsgs error ",""]);w=function(){return a};return a}function x(){var a=babelHelpers.taggedTemplateLiteralLoose(["model:Msg:getEventMsgs error 499 (unimplemented)"]);x=function(){return a};return a}function y(){var a=babelHelpers.taggedTemplateLiteralLoose(["model:Msg:getStarred error ",""]);y=function(){return a};return a}function z(){var a=babelHelpers.taggedTemplateLiteralLoose(["model:Msg:getStarred error 499 (unimplemented)"]);z=function(){return a};return a}function A(){var a=babelHelpers.taggedTemplateLiteralLoose(["model:Msg:findQuery:got:",":",""]);A=function(){return a};return a}function B(){var a=babelHelpers.taggedTemplateLiteralLoose(["model:Msg:findQuery error ",""]);B=function(){return a};return a}function C(){var a=babelHelpers.taggedTemplateLiteralLoose(["model:Msg:findQuery: start ",", ",""]);C=function(){return a};return a}var D=50;a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var e;e=a.call(this)||this;e.pendingAdd={};e.ftsCache={};e.productListMessagesPrefetchChain=(h||(h=b("Promise"))).resolve([]);e._editKeyByParentKey=new Map();e._parentKeyByEditKey=new Map();e._encryptedData=null;e.findQueryImpl=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var f=babelHelpers.assertThisInitialized(e),g;switch(a.direction){case"before":case"after":g=a.direction;break;default:g="before";break}var i={add:g,isHistory:!0};d("WALogger").DEV(C(),a,g);var j=(yield d("WAWebDBMessageFindLocal").msgFindQuery(g,a));if(j.status>=400){d("WALogger").WARN(B(),j.status);return(h||(h=b("Promise"))).reject(j.status)}var k=f.get(a);c("WAWebWid").isNewsletter(a.remote)&&k!=null&&(j=(yield d("WAWebNewsletterMsgHistoryUtils").fillMsgHistoryGaps({jid:a.remote,msgs:g==="before"?j.concat(d("WAWebMsgDataFromModel").msgDataFromMsgModel(k)):[d("WAWebMsgDataFromModel").msgDataFromMsgModel(k)].concat(j),serverIdsToSkip:d("WAWebNewsletterViewModeUIUtils").getHiddenMessageServerIdsForChat(a.remote)})));k=function(){var b=f.get(a);if(b!=null)return b.msgChunk;b=d("WAWebChatCollection").ChatCollection.get(a.remote);return b!=null?b.msgs:void 0};j.forEach(function(a){a.invis=!0});d("WALogger").LOG(A(),j.length,a.direction);return f.processMultipleMessages(a.remote,j,i,"msgCollectionFindQuery",k)});return function(b){return a.apply(this,arguments)}}();e.byParentMessage=d("WAWebCollectionUtils").aggregated(function(a){var b=a.parentMsgKey;a=a.type;return a===d("WAWebMsgType").MSG_TYPE.CIPHERTEXT||a===d("WAWebMsgType").MSG_TYPE.UNKNOWN?"UNCATEGORIZED":b},{subscribeToKey:"parentMsgKey"});e.byChat=d("WAWebCollectionUtils").aggregated(function(a){a=a.id;return a.remote});e.listenTo(babelHelpers.assertThisInitialized(e),"remove",e.removeFromCollection);return e}var f=e.prototype;f.removeFromCollection=function(a){var b=d("WAWebFrontendMsgGetters").getMaybeChat(a);b==null?void 0:b.removeFromCollection(a)};f.add=function(b,e){b=Array.isArray(b)?b:[b];b=b.filter(function(a){if(a.ephemeralDuration==null||a.ephemeralDuration===0)return!0;a=new(d("WAWebMsgModel").Msg)(a);return!a.isExpiredAndNotKept()});b=a.prototype.add.call(this,b,e);this.makeParentMessagesVisibleInChat(b);c("WAWebSyncButtonState")(b);this._prefetchProductListMessages(b);this.processVCardMessagesForLidMappings(b);this.processEditedMessages(b);return b};f.makeParentMessagesVisibleInChat=function(a){var b=this;a.filter(Boolean).forEach(function(a){var c=a.parentMsgKey;a=a.viewMode;if(c&&!d("WAWebViewModeUtils").isViewModeVisibleInSurface(d("WAWebViewMode.flow").ViewModeSurface.CHAT,a)){a=b.get(c);a&&((c=d("WAWebInvisiblePlaceholderViewModeProcessor").InvisiblePlaceholderViewModeProcessor.compatibleMessageTypes)==null?void 0:c.includes(a.type))&&!d("WAWebMessageAssociationUIUtils").shouldHideParentMessage({parentMsg:a,duringDetach:!1})&&!d("WAWebViewModeUtils").isViewModeVisibleInSurface(d("WAWebViewMode.flow").ViewModeSurface.CHAT,a==null?void 0:a.viewMode)&&a.set("viewMode",d("WAWebViewMode.flow").ViewModeType.VISIBLE)}})};f.processVCardMessagesForLidMappings=function(a){a=a.reduce(function(a,b){if(b==null)return a;if(b.type!==d("WAWebMsgType").MSG_TYPE.VCARD&&b.type!==d("WAWebMsgType").MSG_TYPE.MULTI_VCARD)return a;b=b.type===d("WAWebMsgType").MSG_TYPE.VCARD?b.getVcardWids():b.getMultiVcardWids();if(b==null)return a;b=b.filter(function(a){return d("WAWebLidMigrationUtils").toUserLid(a)==null});if(b.length===0)return a;if(a==null)return new Set(b);b.forEach(function(b){return a.add(b)});return a},null);if(a==null)return;d("WAWebWorkerSafeBackendApi").workerSafeFireAndForget("syncContactListJob",{contactIds:Array.from(a),shouldSyncDevice:!1,mode:"query"})};f._prefetchProductListMessages=function(a){this.productListMessagesPrefetchChain=a.filter(function(a){var b;return a!=null&&a.isNewMsg&&a.type===d("WAWebMsgType").MSG_TYPE.LIST&&((b=a.list)==null?void 0:b.listType)===d("WAWebProtobufsE2E.pb").Message$ListMessage$ListType.PRODUCT_LIST&&((b=a.list)==null?void 0:b.productListInfo)!=null}).reduce(function(a,b){var c;if(b==null)return a;var e=b.requiresDirectConnection,f=b.isForwarded?b.businessOwnerJid:b.from.toString({legacy:!0});c=(c=b.list)==null?void 0:c.productListInfo;if(f==null||c==null)return a;var g=d("WAWebProductMessageListCollection").ProductMessageListCollection.getOrAdd(b.id,c,e,f,(c=b.list)==null?void 0:c.title);return g!=null&&g.productCollection.getModelsArray().length===0&&!g.isFetching()?a.then(function(){return d("WAWebProductMessageListCollection").ProductMessageListCollection.update(g.id)}):a},this.productListMessagesPrefetchChain)};f.getStarred=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e){c={count:typeof c==="number"&&!isNaN(c)?c:d("WAWebCollectionConstants").PAGE_SIZE,chat:a?a:void 0,remote:e==null?void 0:e.remote,id:e==null?void 0:e.id,fromMe:e==null?void 0:e.fromMe,participant:e==null?void 0:e.participant};a={add:"search"};e=(yield d("WAWebDBMessageFindLocal").msgFindQuery("star",c));c=e.status;if(e.status>=400){c===499?d("WALogger").LOG(z()):d("WALogger").WARN(y(),c);return(h||(h=b("Promise"))).reject(c)}return this.processMultipleMessages(void 0,e,a,"msgCollectionGetStarred")});function c(b,c,d){return a.apply(this,arguments)}return c}();f.getEventMsgs=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){b={count:typeof b==="number"&&!Number.isNaN(b)?b:d("WAWebCollectionConstants").PAGE_SIZE,chat:a,remote:c==null?void 0:c.remote,id:c==null?void 0:c.id,fromMe:c==null?void 0:c.fromMe,participant:c==null?void 0:c.participant};a={add:"search"};c=(yield d("WAWebDBMessageFindLocal").msgFindQuery("event",b));b=c.status;if(c.status>=400){b===499?d("WALogger").LOG(x()):d("WALogger").WARN(w(),b);throw new(d("WAWebBaseCollection").CollectionSilentQueryError)(b)}return this.processMultipleMessages(void 0,c,a,"msgCollectionGetEvents")});function c(b,c,d){return a.apply(this,arguments)}return c}();f.getVoipCallLogMsgs=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){a={count:typeof a==="number"&&!isNaN(a)?a:d("WAWebCollectionConstants").PAGE_SIZE,chat:void 0,remote:c==null?void 0:c.remote,id:c==null?void 0:c.id,fromMe:c==null?void 0:c.fromMe,participant:c==null?void 0:c.participant};c=(yield d("WAWebDBMessageFindLocal").msgFindQuery("call_log",a));a=c.status;if(c.status>=400){a===499?d("WALogger").LOG(v()):d("WALogger").WARN(u(),a);return(h||(h=b("Promise"))).reject(a)}return this.processMultipleMessages(void 0,c,{add:"search"},"msgCollectionGetVoipCallLogs")});function c(b,c){return a.apply(this,arguments)}return c}();f.getAllMediaMsgs=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){a={count:(a=a)!=null?a:D,chat:void 0,remote:c==null?void 0:c.remote,id:c==null?void 0:c.id,fromMe:c==null?void 0:c.fromMe,participant:c==null?void 0:c.participant,media:"allMedia"};c=(yield d("WAWebDBMessageFindLocal").msgFindQuery("media",a));a=c.status;if(c.status!=null&&c.status>=400){a===499?d("WALogger").LOG(t()):d("WALogger").WARN(s(),a);return(h||(h=b("Promise"))).reject(a)}return this.processMultipleMessages(void 0,Array.isArray(c)?c:c.messages,{add:"search"},"msgCollectionGetAllMedia")});function c(b,c){return a.apply(this,arguments)}return c}();f.getAllLinksMsgs=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){a={count:(a=a)!=null?a:D,chat:void 0,remote:c==null?void 0:c.remote,id:c==null?void 0:c.id,fromMe:c==null?void 0:c.fromMe,participant:c==null?void 0:c.participant,media:"allLinks"};c=(yield d("WAWebDBMessageFindLocal").msgFindQuery("media",a));a=c.status;if(c.status!=null&&c.status>=400){a===499?d("WALogger").LOG(r()):d("WALogger").WARN(q(),a);return(h||(h=b("Promise"))).reject(a)}return this.processMultipleMessages(void 0,Array.isArray(c)?c:c.messages,{add:"search"},"msgCollectionGetAllMedia")});function c(b,c){return a.apply(this,arguments)}return c}();f.getAllDocsMsgs=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){a={count:(a=a)!=null?a:D,chat:void 0,remote:c==null?void 0:c.remote,id:c==null?void 0:c.id,fromMe:c==null?void 0:c.fromMe,participant:c==null?void 0:c.participant,media:"allDocs"};c=(yield d("WAWebDBMessageFindLocal").msgFindQuery("media",a));a=c.status;if(c.status!=null&&c.status>=400){a===499?d("WALogger").LOG(p()):d("WALogger").WARN(o(),a);return(h||(h=b("Promise"))).reject(a)}return this.processMultipleMessages(void 0,Array.isArray(c)?c:c.messages,{add:"search"},"msgCollectionGetAllMedia")});function c(b,c){return a.apply(this,arguments)}return c}();f.getMessagesById=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebDBMsgUtils").getMsgsByMsgKey(a));return d("WAPromiseProps").promiseProps({messages:this.processMultipleMessages(void 0,a,{add:"search"},"msgCollectionGetMessagesById"),eof:!0,canceled:!1})});function c(b){return a.apply(this,arguments)}return c}();f.hydrateOrGetMessages=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=this,e=a.filter(function(a){return!b.get(a)});if(e.length>0){var f=(yield this.getMessagesById(e));f=f.messages;if(f.length!==e.length)throw new(d("WAWebBaseCollection").CollectionSilentQueryError)("No message found for one or more ids")}return a.map(function(a){return c("WANullthrows")(b.get(a))})});function e(b){return a.apply(this,arguments)}return e}();f.queryVcard=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=(yield d("WAWebDBMessageFindLocal").queryVcard(a));return this.processMultipleMessages(void 0,a,{add:"search"},"msgCollectionQueryVCard")});function c(b){return a.apply(this,arguments)}return c}();f.incrementalStarredUpdate=function(a){return this.processMultipleMessages(void 0,a,{add:"search"},"msgCollectionIncrementalStarredUpdate")};f.search=function(a,b,c,e,f){var g=this;b===void 0&&(b=1);f===void 0&&(f={});var h=a+"__"+(f.label||f.kind&&f.kind||"");if(b===1&&!e){var i=this.ftsCache[h];if(i)return i;i=this._search(a,b,c,e,f.label,f.kind);this.ftsCache[h]=i;var j=function(){g.ftsCache[h]=null};self.setTimeout(j,d("WAWebFtsConstants").FTS_TTL);i["catch"](j);return i}return this._search(a,b,c,e,f.label,f.kind)};f._search=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e,f,g,i){a={searchTerm:a,page:d("WATypeUtils").isNumber(c)&&c!==0?c:1,count:d("WATypeUtils").isNumber(e)&&e!==0?e:d("WAWebCollectionConstants").PAGE_SIZE,remote:f,tagToCancel:f?this.pendingSearchTag:void 0,label:g,kind:i};c={add:"search"};e=(yield d("WAWebDBMessageFindLocal").msgFindQuery("search",a));a.tagToCancel===this.pendingSearchTag&&(this.pendingSearchTag=void 0);if(e.status===499)return d("WAPromiseProps").promiseProps({messages:(h||(h=b("Promise"))).resolve([]),eof:!1,canceled:!0});else if(e.status===404)return(h||(h=b("Promise"))).reject(new(d("WAWebBackendErrors").E404)());else if(e.status>=400){d("WALogger").WARN(n(),e.status);return(h||(h=b("Promise"))).reject(new(d("WAWebBackendErrors").ServerStatusCodeError)(e.status,"failed to find a msg during fts"))}f=Array.isArray(e)?e:e.messages;g=Array.isArray(e)?!0:e.eof;return d("WAPromiseProps").promiseProps({messages:this.processMultipleMessages(void 0,f,c,"msgCollectionSearch"),eof:g,canceled:!1})});function a(b,c,d,e,f,g){return a.apply(this,arguments)}return a}();f.queryMedia=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e,f,g){a={remote:a,count:d("WATypeUtils").isNumber(c)&&c!==0?c:d("WAWebCollectionConstants").PAGE_SIZE,id:f==null?void 0:f.id,fromMe:f==null?void 0:f.fromMe,participant:f==null?void 0:f.participant,direction:e||"before",media:g,msgKey:f};c={add:"search"};e=(yield d("WAWebDBMessageFindLocal").msgFindQuery("media",a));if(e.status>=400){d("WALogger").WARN(m(),e.status);return e.status===404?(h||(h=b("Promise"))).reject(new(d("WAWebBackendErrors").E404)()):(h||(h=b("Promise"))).reject(new(d("WAWebBackendErrors").ServerStatusCodeError)(e.status,"failed to find a msg during media query"))}return!g?d("WAPromiseProps").promiseProps({docCount:e.docCount,linkCount:e.linkCount,mediaCount:e.mediaCount,messages:this.processMultipleMessages(void 0,e.messages,c,"msgCollectionQueryMedia")}):this.processMultipleMessages(void 0,e,{add:"search"},"msgCollectionQueryMedia")});function c(b,c,d,e,f){return a.apply(this,arguments)}return c}();f.getContext=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){var f=this,g=this.get(a),m=c("WAWebWid").isNewsletter(a.remote);if(g&&!g.fromQuotedMsg)return(h||(h=b("Promise"))).all([d("WAWebDBMessageFindLocal").msgFindQuery("before",a),d("WAWebDBMessageFindLocal").msgFindQuery("after",a)]).then(function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(c){var i=c[0];c=c[1];if((!Array.isArray(i)||!Array.isArray(c))&&!m){d("WALogger").WARN(l()).devConsole(i,c);throw i.status||c.status}i=Array.isArray(i)?i:[];c=Array.isArray(c)?c:[];var j=g.serverId;g.search=!1;return(h||(h=b("Promise"))).all([f.processMultipleMessages(a.remote,!m||j==null?i:yield d("WAWebNewsletterMsgHistoryUtils").fillMsgHistoryGaps({jid:a.remote,msgs:i.concat(d("WAWebMsgDataFromModel").msgDataFromMsgModel(g)),range:{start:j-a.count,end:j},serverIdsToSkip:d("WAWebNewsletterViewModeUIUtils").getHiddenMessageServerIdsForChat(a.remote)}),{add:"before",isHistory:!0},"msgCollectionGetContext",e),f.processMultipleMessages(a.remote,!m||j==null?c:yield d("WAWebNewsletterMsgHistoryUtils").fillMsgHistoryGaps({jid:a.remote,msgs:[d("WAWebMsgDataFromModel").msgDataFromMsgModel(g)].concat(c),range:{start:j,end:j+a.count},serverIdsToSkip:d("WAWebNewsletterViewModeUIUtils").getHiddenMessageServerIdsForChat(a.remote)}),{add:"after",isHistory:!0},"msgCollectionGetContext",e)])});return function(a){return c.apply(this,arguments)}}());var n={add:"after",isHistory:!0};return d("WAWebDBMessageFindLocal").msgFindQuery("after",a).then(function(){var g=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){if(!Array.isArray(b)){d("WALogger").WARN(k()).devConsole(b);throw b.status}if(c("WAWebWid").isStatus(b[0].id.remote))throw c("err")("status, stop querying before the msg");var g=a.serverId;return f.processMultipleMessages(a.remote,!m||g==null?b:yield d("WAWebNewsletterMsgHistoryUtils").fillMsgHistoryGaps({jid:a.remote,msgs:b,range:{start:g,end:g+a.count},serverIdsToSkip:d("WAWebNewsletterViewModeUIUtils").getHiddenMessageServerIdsForChat(a.remote)}),n,"msgCollectionFindQuery",e)});return function(a){return g.apply(this,arguments)}}()).then(function(e){var g=c("WANullthrows")(e[0]),k=g.id.clone();k.count=a.count+1;var l={add:"before",isHistory:!0};return(h||(h=b("Promise"))).all([d("WAWebDBMessageFindLocal").msgFindQuery("before",k).then(function(){var c=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){if(!Array.isArray(b)){d("WALogger").WARN(j()).devConsole(b);throw b.status}var c=b[b.length-1];c.fromQuotedMsg=!1;c=c.id;if(!c.equals(a)){d("WALogger").WARN(i()).devConsole(b);throw 405}c=function(){return g.msgChunk};var e=g.serverId;return f.processMultipleMessages(a.remote,!m||e==null?b:yield d("WAWebNewsletterMsgHistoryUtils").fillMsgHistoryGaps({jid:a.remote,msgs:b,range:{start:e,end:e-a.count},serverIdsToSkip:d("WAWebNewsletterViewModeUIUtils").getHiddenMessageServerIdsForChat(a.remote)}),l,"msgCollectionFindQuery",c)});return function(a){return c.apply(this,arguments)}}()),h.resolve(e)])})});function e(b,c){return a.apply(this,arguments)}return e}();f.hasSynced=function(){return c("WAWebEventsWaitForBbEvent")(this,d("WAWebCollectionConstants").COLLECTION_HAS_SYNCED)};f.processMultipleMessages=function(a,b,e,f,g,h){var i=this;h===void 0&&(h=!0);var j=function(){return d("WAWebProcessMultipleMsgsAction")._processMultipleMessages(a,b,e,f,g)};if(a){var k,l=this.pendingAdd[a];l&&h?k=l.then(j):k=j();k["finally"](function(){a&&i.pendingAdd[a]===k&&(i.pendingAdd[a]=null)})["catch"](c("WAWebNoop"));return this.pendingAdd[a]=k}return j()};f.hasUnsentMessages=function(){return this.some(function(a){return a.ack===d("WAWebAck").ACK.CLOCK&&a.local&&d("WAWebMsgGetters").getIsSentByMe(a)})};f.getByEditMsgKey=function(a){a=this._parentKeyByEditKey.get(a.toString());return a&&this.get(a)};f.processEditedMessages=function(a){var b=this;a.forEach(function(a){if(!a||!d("WAWebMsgGetters").getIsEdited(a))return;var c=b._editKeyByParentKey.get(a.id.toString());c!=null&&b._parentKeyByEditKey["delete"](c);c=a.latestEditMsgKey;if(!c)return;b._editKeyByParentKey.set(a.id.toString(),c.toString());b._parentKeyByEditKey.set(c.toString(),a.id)})};f.addInitialBotTypingIndicatorToChat=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c,e=d("WAWebChatCollection").ChatCollection.get(a);if(!e||!(e==null?void 0:e.id.isBot())&&!((c=e.contact.businessProfile)==null?void 0:c.isBizBot3p))return;if(e.botInitialTypingIndicatorMsgId!=null){c=this.get(e.botInitialTypingIndicatorMsgId);if(c==null)return;c==null?void 0:c["delete"]({skipUpdatingSortTime:!0})}e.set({botInitialTypingIndicatorMsgId:b},{silent:!0});c={id:b,t:d("WATimeUtils").unixTime(),from:a,to:d("WAWebUserPrefsMeUser").getMaybeMeUser(),type:"chat",subtype:d("WAWebBotGenTypingIndicatorMsg").BOT_TYPING_PLACEHOLDER_MSG_SUBTYPE,body:""};void this.processMultipleMessages(a,[babelHelpers["extends"]({},c,{recvFresh:!0,isNewMsg:!0})],{add:"after",isHistory:!1},"createChatOnNewMsg",null,!0)});function c(b,c){return a.apply(this,arguments)}return c}();f.encryptAndClearModels=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=this._models.map(function(a){return d("WAWebMsgOpaqueData").encryptDataInMsgModel(a)});yield (h||(h=b("Promise"))).all(a)});function c(){return a.apply(this,arguments)}return c}();f.decryptAndSetModels=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=this._models.map(function(b){return d("WAWebMsgOpaqueData").decryptDataInMsgModel(b,a)});yield (h||(h=b("Promise"))).all(c)});function c(b){return a.apply(this,arguments)}return c}();return e}(d("WAWebBaseCollection").BaseCollection);a.model=d("WAWebMsgModel").Msg;e=new a();g.MEDIA_QUERY_LIMIT=D;g.MsgCollectionImpl=a;g.MsgCollection=e}),98); __d("WAWebMsgInfoAction",["WAWebAck","WAWebStateUtils","WAWebWid"],(function(a,b,c,d,e,f,g){function a(a,b,e,f){a=d("WAWebStateUtils").unproxy(a);var g=a.id;g=c("WAWebWid").isUser(g.remote);g?h(a,b,e,f):i(a,b,e,f)}function h(a,b,c,e){b===d("WAWebAck").ACK.PLAYED?(a.played.get(c)||(a.playedRemaining-=1),a.played.add({id:c,t:e})):b===d("WAWebAck").ACK.READ?(a.read.get(c)||(a.readRemaining-=1),a.read.add({id:c,t:e})):b===d("WAWebAck").ACK.RECEIVED&&(a.delivery.get(c)||(a.deliveryRemaining-=1),a.delivery.add({id:c,t:e}))}function i(a,b,c,e){var f=d("WAWebAck").ACK.CLOCK;a.played.get(c)?f=d("WAWebAck").ACK.PLAYED:a.read.get(c)?f=d("WAWebAck").ACK.READ:a.delivery.get(c)&&(f=d("WAWebAck").ACK.RECEIVED);if(b<=f)return;if(b>d("WAWebAck").ACK.RECEIVED){f=a.delivery.get(c);f?a.delivery.remove(f):a.deliveryRemaining-=1}if(b>d("WAWebAck").ACK.READ){f=a.read.get(c);f?a.read.remove(f):a.readRemaining-=1}b===d("WAWebAck").ACK.READ&&(a==null?void 0:(f=a.id)==null?void 0:(f=f.remote)==null?void 0:f.isGroup())&&(c==null?void 0:c.isBot())&&(a.readRemaining+=1);b===d("WAWebAck").ACK.PLAYED?(a.played.get(c)||(a.playedRemaining-=1),a.played.add({id:c,t:e})):b===d("WAWebAck").ACK.READ?(a.read.get(c)||(a.readRemaining-=1),a.read.add({id:c,t:e})):b===d("WAWebAck").ACK.RECEIVED&&(a.delivery.get(c)||(a.deliveryRemaining-=1),a.delivery.add({id:c,t:e}))}g.updateMsgInfo=a}),98); __d("WAWebMsgInfoCollection",["Promise","WALogger","WAWebApiMessageInfoStore","WAWebBaseCollection","WAWebHandleMsgTypes.flow","WAWebMsgCollection","WAWebMsgGetters","WAWebMsgInfoAction","WAWebMsgInfoModel","WAWebMsgKey","WAWebMsgType","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["queryMsgInfos: failed to find msg info in storage"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["queryMsgInfo: failed to find msg info in storage"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["queryMsgInfo: got unsupported host storage or actual actors"]);k=function(){return a};return a}function l(a,b){var e=b.read,f=b.played,g=b.delivery,h=b.readRemaining,i=b.playedRemaining,j=b.deliveryRemaining;b=b.deliveryPrivacyMode;a={id:a,read:e.map(function(a){return babelHelpers["extends"]({},a)}),readRemaining:h,played:f.map(function(a){return babelHelpers["extends"]({},a)}),playedRemaining:i,delivery:g.map(function(a){return babelHelpers["extends"]({},a)}),deliveryRemaining:j};if(b!=null){e=d("WAWebHandleMsgTypes.flow").HostStorageEnumType.cast(b.hostStorage);h=d("WAWebHandleMsgTypes.flow").ActualActorsEnumType.cast(b.actualActors);if(h==null||e==null){d("WALogger").ERROR(k()).sendLogs("queryMsgInfo-incorrect-enums");throw c("err")("queryMsgInfo: got unsupported host storage or actual actors")}f={hostStorage:e,privacyModeTs:b.privacyModeTs,actualActors:h};a.deliveryPrivacyMode=f}return a}a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var c,e;for(var f=arguments.length,g=new Array(f),k=0;k<f;k++)g[k]=arguments[k];return(c=e=a.call.apply(a,[this].concat(g))||this,e.findImpl=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=d("WAWebMsgCollection").MsgCollection.get(a);if(!c)return(h||(h=b("Promise"))).reject(new(d("WAWebBaseCollection").CollectionSilentQueryError)("No message found for id: "+a.toString()));else if(!d("WAWebMsgGetters").getIsSentByMe(c))return(h||(h=b("Promise"))).reject(new(d("WAWebBaseCollection").CollectionSilentQueryError)("message not sent by me"));var e;try{e=(yield d("WAWebApiMessageInfoStore").queryMsgInfo(a))}catch(a){d("WALogger").ERROR(j()).verbose().devConsole(a).sendLogs("queryMsgInfo failed");throw a}a=l(a,e);return babelHelpers["extends"]({},a,{usePlayReceipt:c.type===d("WAWebMsgType").MSG_TYPE.PTT||c.isViewOnce})});return function(b){return a.apply(this,arguments)}}(),e.findManyAndUpdate=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=new Map(),e=[];a.forEach(function(a){a=d("WAWebMsgCollection").MsgCollection.get(a);a&&d("WAWebMsgGetters").getIsSentByMe(a)&&e.push(a)});var f;try{f=(yield d("WAWebApiMessageInfoStore").queryMsgInfos(a))}catch(a){d("WALogger").ERROR(i()).verbose().devConsole(a).sendLogs("queryMsgInfos failed");throw a}e.forEach(function(a){var e=a.id,g=f.get(e.toString());if(!g)return(h||(h=b("Promise"))).reject(new(d("WAWebBaseCollection").CollectionSilentQueryError)("query returned no msg info for msg "+e.toString()));g=babelHelpers["extends"]({},l(e,g),{usePlayReceipt:a.type===d("WAWebMsgType").MSG_TYPE.PTT||a.isViewOnce});a=m.gaddUp(g);c.set(e.toString(),a)});return c});return function(b){return a.apply(this,arguments)}}(),c)||babelHelpers.assertThisInitialized(e)}var f=e.prototype;f.updateInfo=function(a,b,e,f,g,h){var i=new(c("WAWebMsgKey"))({from:b,to:e,id:a,participant:g});b=new(c("WAWebMsgKey"))({from:b,to:e,id:a});e=this.get(i)||this.get(b);if(e)return d("WAWebMsgInfoAction").updateMsgInfo(e,f,g,h)};return e}(d("WAWebBaseCollection").BaseCollection);a.model=d("WAWebMsgInfoModel").MsgInfo;a.staleCollection=!0;var m=new a();g.MsgInfoCollection=m}),98); __d("WAWebMsgInfoGetters",["WAWebGetters","WAWebGettersCaches"],(function(a,b,c,d,e,f,g){a=d("WAWebGetters").createGetterFactories({createCache:d("WAWebGettersCaches").createMsgInfosCache});b=a.field;c=a.clearCacheFor;e=c;f=b("playedRemaining");d=b("readRemaining");a=b("deliveryRemaining");g.clearMsgInfoGetterCacheFor=e;g.getPlayedRemaining=f;g.getReadRemaining=d;g.getDeliveryRemaining=a}),98); __d("WAWebMsgInfoModel",["WAWebBaseModel","WAWebCollection","WAWebContactCollection","WAWebContactComparator","WAWebMsgInfoCollection","WAWebMsgInfoGetters","WAWebMsgKey","WAWebWid"],(function(a,b,c,d,e,f,g){b=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.t=d("WAWebBaseModel").prop(),c.contact=d("WAWebBaseModel").session(),b)||babelHelpers.assertThisInitialized(c)}var c=b.prototype;c.initialize=function(){a.prototype.initialize.call(this),this.addChild("contact",d("WAWebContactCollection").ContactCollection.gadd(this.id))};return b}((a=d("WAWebBaseModel")).BaseModel);b.Proxy="msgInfoParticipant";b.idClass=c("WAWebWid");e=a.defineModel(b);var h=function(b){babelHelpers.inheritsLoose(a,b);function a(){return b.apply(this,arguments)||this}return a}(c("WAWebCollection"));h.model=e;h.comparator=function(a,b){return d("WAWebContactComparator").ContactComparator(a.contact,b.contact)};f=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.usePlayReceipt=d("WAWebBaseModel").prop(),c.playedRemaining=d("WAWebBaseModel").prop(0),c.readRemaining=d("WAWebBaseModel").prop(0),c.deliveryRemaining=d("WAWebBaseModel").prop(0),c.deliveryPrivacyMode=d("WAWebBaseModel").prop(),c.played=d("WAWebBaseModel").collection(h),c.read=d("WAWebBaseModel").collection(h),c.delivery=d("WAWebBaseModel").collection(h),b)||babelHelpers.assertThisInitialized(c)}var c=b.prototype;c.getCollection=function(){return d("WAWebMsgInfoCollection").MsgInfoCollection};c["delete"]=function(){a.prototype["delete"].call(this),d("WAWebMsgInfoGetters").clearMsgInfoGetterCacheFor(this)};return b}(a.BaseModel);f.Proxy="msgInfo";f.idClass=c("WAWebMsgKey");b=a.defineModel(f);g.MsgInfoParticipant=e;g.ParticipantCollection=h;g.MsgInfo=b}),98); __d("WAWebMsgLinks",["WAUnicodeUtils","WAWebFrontendMsgGetters","WAWebLinkify","WAWebMsgGetters","WAWebMsgType","WAWebProtobufsE2E.pb","WAWebStateUtils","uniqueBy"],(function(a,b,c,d,e,f,g){function h(a){var b=a.content,c=a.sender,e=a.cachedValue;e=e===void 0?[]:e;var f=a.currentIndex;f=f===void 0?0:f;a=a.endIndex;a=a===void 0?Infinity:a;if(f>=a)return[e,a];f=d("WAUnicodeUtils").firstNCodepoints(b,a);e=!1;var g=d("WAWebLinkify").findLinks(f,e,c);if(d("WAUnicodeUtils").numCodepoints(b)>a&&g.length>0){var h=g[g.length-1];f=d("WAUnicodeUtils").numCodepoints(f.slice(0,h.index));f=f+d("WAUnicodeUtils").numCodepoints(h.url);f===a&&(g=d("WAWebLinkify").findLinks(b,e,c))}return[g,a]}function i(a,b){a=d("WAWebStateUtils").unproxy(a);b=(b=b)!=null?b:a.linksIndexParsed?a.linksIndexParsed:d("WAWebMsgGetters").getInitialPageSize(a)+1;var c=d("WAWebFrontendMsgGetters").getText(a);if(c==null||a.linksIndexParsed===Infinity)return a.getRawLinks();c=h({content:c,sender:d("WAWebMsgGetters").getSender(a),cachedValue:a.getRawLinks(),currentIndex:a.linksIndexParsed,endIndex:b});b=c[0];c=c[1];a.linksIndexParsed=c;a.setRawLinks(b);return b}function a(a,b){var c=d("WAWebStateUtils").unproxy(a);if(c.pollOptions==null)return null;if(c.getRawPollOptionsToLinks()==null){a=new Map((a=c.pollOptions)==null?void 0:a.map(function(a){var b=h({content:a.name,sender:d("WAWebMsgGetters").getSender(c)});b=b[0];return[a,b]}));c.setRawPollOptionsToLinks(a)}return(a=c.getRawPollOptionsToLinks())==null?void 0:a.get(b)}function j(a,b){if(b){return a.type==="list"&&((b=a.list)==null?void 0:b.listType)===d("WAWebProtobufsE2E.pb").Message$ListMessage$ListType.SINGLE_SELECT&&((b=a.list)==null?void 0:b.title)!=null}return a.isDynamicReplyButtonsMsg===!0&&a.title!=null}function k(a,b){if(a.getRawHeaderLinks().length>0)return a.getRawHeaderLinks();b=h({content:b,sender:d("WAWebMsgGetters").getSender(a),cachedValue:a.getRawHeaderLinks()});b=b[0];b.length>0&&a.setRawHeaderLinks(b);return b}function b(a){a=d("WAWebStateUtils").unproxy(a);if(j(a,!0)){var b;return k(a,((b=a.list)==null?void 0:b.title)||"")}else if(j(a,!1))return k(a,a.title);else if(a.type===d("WAWebMsgType").MSG_TYPE.INTERACTIVE&&((b=a.interactiveHeader)==null?void 0:b.title)!=null)return k(a,a.interactiveHeader.title);return[]}function e(a){a=d("WAWebStateUtils").unproxy(a);var b=a.footer;if(!d("WAWebMsgGetters").getSupportsMessageFooterLinks(a)||b==null)return[];if(a.getRawFooterLinks().length>0)return a.getRawFooterLinks();b=h({content:b,sender:d("WAWebMsgGetters").getSender(a),cachedValue:a.getRawFooterLinks()});b=b[0];b.length>0&&a.setRawFooterLinks(b);return b}function f(a){a=d("WAWebStateUtils").unproxy(a);return c("uniqueBy")(i(a),function(a){return a.href}).filter(function(a){return a.isHttp})}function l(a){a=d("WAWebStateUtils").unproxy(a);return i(a).filter(function(a){return(a=a.suspiciousCharacters)==null?void 0:a.size})}g.getLinksFromMsgImpl=h;g.getLinksFromMsg=i;g.getPollOptionLinks=a;g.shouldDisplayHeaderLinks=j;g.getHeaderLinks=b;g.getFooterLinks=e;g.getGalleryLinks=f;g.getSuspiciousLinks=l}),98); __d("WAWebMsgModel",["Promise","WAJids","WALogger","WAStorageEstimator","WATimeUtils","WATypeUtils","WAWebAck","WAWebApiContact","WAWebBaseModel","WAWebBizLabelUtils","WAWebBotGating","WAWebBotGenTypingIndicatorMsg","WAWebBotTypes","WAWebBusinessHSMTypes","WAWebBusinessProfileTypes","WAWebCarouselCardsCollection","WAWebChangePresenceHandlerAction","WAWebChatCollection","WAWebChatCommunityUtils","WAWebChatContactUtils","WAWebChatGetMessage","WAWebChatGetters","WAWebChatGroupUtils","WAWebCmd","WAWebCommonMsgUtils","WAWebConnModel","WAWebConstantsDeprecated","WAWebContactCollection","WAWebDBUpdateMessageTable","WAWebDirectConnectionGatingUtils","WAWebEphemeralKeepInChatAbpropUtils","WAWebEphemeralityTypes","WAWebEventsWaitForBbEvent","WAWebFrontendContactGetters","WAWebFrontendMsgGetters","WAWebInvisiblePlaceholderViewModeProcessor","WAWebLabelCollection","WAWebLidMigrationUtils","WAWebMedia","WAWebMediaData","WAWebMediaTypes","WAWebMessageAssociationGatingUtils","WAWebMessageAssociationUIUtils","WAWebMiscGatingUtils","WAWebModalManager","WAWebMsgCollection","WAWebMsgGetters","WAWebMsgKey","WAWebMsgModelPropUtils","WAWebMsgModelUtils","WAWebMsgType","WAWebMuteCollection","WAWebNewsletterCollection","WAWebNewsletterSendMsgAction","WAWebNotificationsMsgNotification","WAWebPinInChatCollection","WAWebPromiseQueue","WAWebSendMessageEditAction","WAWebSendMsgRecordAction","WAWebStarredMsgCollection","WAWebSuspendedGroupMediaDownloadFailureModal.react","WAWebUserPrefsMeUser","WAWebVcardParsingUtils","WAWebViewMode.flow","WAWebViewModeUtils","WAWebViewOnceState","WAWebWamEnumDisappearingChatInitiatorType","WAWebWamEnumWebcRmrReasonCode","WAWebWamMsgUtils","WAWebWid","WAWebWidFactory","WAWebWidFormat","asyncToGeneratorRuntime","err","fbs","gkx","isStringNullOrEmpty","lodash","react"],(function(a,b,c,d,e,f,g){var h,i;function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["error = ",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["updated "," from "," to ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["id: "," type: ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["resumeUpload called while state was ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["Msg: _triggerNotificationForParentMessage: parentMsg for "," not found in MsgCollection or not eligible for notification re-triggering"]);n=function(){return a};return a}function o(){var a=babelHelpers.taggedTemplateLiteralLoose(["Invalid timestamp value in msg, raw ts value: ",", msgId: ",", msgType: ","_",""]);o=function(){return a};return a}var p=i||c("react");a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var b,e;for(var f=arguments.length,g=new Array(f),h=0;h<f;h++)g[h]=arguments[h];return(b=e=a.call.apply(a,[this].concat(g))||this,e.id=d("WAWebBaseModel").prop(),e.rowId=d("WAWebBaseModel").prop(),e.serverId=d("WAWebBaseModel").prop(),e.viewCount=d("WAWebBaseModel").prop(),e.viewed=d("WAWebBaseModel").prop(!1),e.body=d("WAWebBaseModel").prop(),e.type=d("WAWebBaseModel").prop(),e.subtype=d("WAWebBaseModel").prop(),e.t=d("WAWebBaseModel").prop(),e.revokeTimestamp=d("WAWebBaseModel").prop(),e.notifyName=d("WAWebBaseModel").prop(),e.from=d("WAWebBaseModel").prop(),e.to=d("WAWebBaseModel").prop(),e.author=d("WAWebBaseModel").prop(),e.ack=d("WAWebBaseModel").prop(),e.invis=d("WAWebBaseModel").prop(),e.isNewMsg=d("WAWebBaseModel").prop(),e.star=d("WAWebBaseModel").prop(!1),e.kicKey=d("WAWebBaseModel").prop(),e.kicState=d("WAWebBaseModel").prop(),e.kicTimestampMs=d("WAWebBaseModel").prop(),e.kicNotified=d("WAWebBaseModel").prop(!1),e.keepType=d("WAWebBaseModel").prop(),e.keptMessageKey=d("WAWebBaseModel").prop(),e.keptCount=d("WAWebBaseModel").prop(),e.recvFresh=d("WAWebBaseModel").prop(),e.caption=d("WAWebBaseModel").prop(),e.interactiveAnnotations=d("WAWebBaseModel").prop(),e.contextInfo=d("WAWebBaseModel").prop(),e.clientUrl=d("WAWebBaseModel").prop(),e.loc=d("WAWebBaseModel").prop(),e.lat=d("WAWebBaseModel").prop(),e.lng=d("WAWebBaseModel").prop(),e.isLive=d("WAWebBaseModel").prop(),e.accuracy=d("WAWebBaseModel").prop(),e.speed=d("WAWebBaseModel").prop(),e.degrees=d("WAWebBaseModel").prop(),e.comment=d("WAWebBaseModel").prop(),e.sequence=d("WAWebBaseModel").prop(),e.shareDuration=d("WAWebBaseModel").prop(),e.finalLat=d("WAWebBaseModel").prop(),e.finalLng=d("WAWebBaseModel").prop(),e.finalAccuracy=d("WAWebBaseModel").prop(),e.finalThumbnail=d("WAWebBaseModel").prop(),e.finalSpeed=d("WAWebBaseModel").prop(),e.finalDegrees=d("WAWebBaseModel").prop(),e.finalTimeOffset=d("WAWebBaseModel").prop(),e.deprecatedMms3Url=d("WAWebBaseModel").prop(),e.directPath=d("WAWebBaseModel").prop(),e.mimetype=d("WAWebBaseModel").prop(),e.duration=d("WAWebBaseModel").prop(),e.filehash=d("WAWebBaseModel").prop(),e.encFilehash=d("WAWebBaseModel").prop(),e.size=d("WAWebBaseModel").prop(),e.filename=d("WAWebBaseModel").prop(),e.streamingSidecar=d("WAWebBaseModel").prop(),e.mediaKey=d("WAWebBaseModel").prop(),e.mediaKeyTimestamp=d("WAWebBaseModel").prop(),e.pageCount=d("WAWebBaseModel").prop(),e.isGif=d("WAWebBaseModel").prop(),e.gifAttribution=d("WAWebBaseModel").prop(),e.accessibilityLabel=d("WAWebBaseModel").prop(),e.isViewOnce=d("WAWebBaseModel").prop(),e.streamable=d("WAWebBaseModel").prop(),e.width=d("WAWebBaseModel").prop(),e.height=d("WAWebBaseModel").prop(),e.thumbnailDirectPath=d("WAWebBaseModel").prop(),e.thumbnailSha256=d("WAWebBaseModel").prop(),e.thumbnailEncSha256=d("WAWebBaseModel").prop(),e.thumbnailHeight=d("WAWebBaseModel").prop(),e.thumbnailWidth=d("WAWebBaseModel").prop(),e.waveform=d("WAWebBaseModel").prop(),e.staticUrl=d("WAWebBaseModel").prop(),e.stickerPackId=d("WAWebBaseModel").prop(),e.stickerPackName=d("WAWebBaseModel").prop(),e.stickerPackPublisher=d("WAWebBaseModel").prop(),e.stickers=d("WAWebBaseModel").prop(),e.trayIconFileName=d("WAWebBaseModel").prop(),e.stickerPackSize=d("WAWebBaseModel").prop(),e.mediaHandle=d("WAWebBaseModel").prop(),e.scanLengths=d("WAWebBaseModel").prop(),e.scansSidecar=d("WAWebBaseModel").prop(),e.isFromTemplate=d("WAWebBaseModel").prop(!1),e.devicesAdded=d("WAWebBaseModel").prop(),e.devicesRemoved=d("WAWebBaseModel").prop(),e.isThisDeviceAdded=d("WAWebBaseModel").prop(),e.firstFrameLength=d("WAWebBaseModel").prop(),e.firstFrameSidecar=d("WAWebBaseModel").prop(),e.isAnimated=d("WAWebBaseModel").prop(),e.isLottie=d("WAWebBaseModel").prop(),e.matchedText=d("WAWebBaseModel").prop(),e.thumbnail=d("WAWebBaseModel").prop(),e.thumbnailHQ=d("WAWebBaseModel").prop(),e.richPreviewType=d("WAWebBaseModel").prop(),e.doNotPlayInline=d("WAWebBaseModel").prop(),e.rcat=d("WAWebBaseModel").prop(),e.title=d("WAWebBaseModel").prop(),e.description=d("WAWebBaseModel").prop(),e.paymentLinkMetadata=d("WAWebBaseModel").prop(),e.businessOwnerJid=d("WAWebBaseModel").prop(),e.productId=d("WAWebBaseModel").prop(),e.currencyCode=d("WAWebBaseModel").prop(),e.priceAmount1000=d("WAWebBaseModel").prop(),e.salePriceAmount1000=d("WAWebBaseModel").prop(),e.retailerId=d("WAWebBaseModel").prop(),e.url=d("WAWebBaseModel").prop(),e.productImageCount=d("WAWebBaseModel").prop(),e.sessionId=d("WAWebBaseModel").prop(),e.pollName=d("WAWebBaseModel").prop(),e.pollOptions=d("WAWebBaseModel").prop(),e.pollSelectableOptionsCount=d("WAWebBaseModel").prop(),e.pollInvalidated=d("WAWebBaseModel").prop(!1),e.pollContentType=d("WAWebBaseModel").prop(),e.isSentCagPollCreation=d("WAWebBaseModel").prop(!1),e.pollUpdateParentKey=d("WAWebBaseModel").prop(),e.encPollVote=d("WAWebBaseModel").prop(),e.selectedOptionLocalIds=d("WAWebBaseModel").prop(),e.pollVotesSnapshot=d("WAWebBaseModel").prop(),e.senderTimestampMs=d("WAWebBaseModel").prop(),e.latestEditMsgKey=d("WAWebBaseModel").prop(null),e.latestEditSenderTimestampMs=d("WAWebBaseModel").prop(null),e.editMsgType=d("WAWebBaseModel").prop(),e.recipients=d("WAWebBaseModel").prop(),e.broadcast=d("WAWebBaseModel").prop(),e.quotedMsg=d("WAWebBaseModel").prop(),e.quotedStanzaID=d("WAWebBaseModel").prop(),e.quotedRemoteJid=d("WAWebBaseModel").prop(),e.quotedParticipant=d("WAWebBaseModel").prop(),e.quotedGroupSubject=d("WAWebBaseModel").prop(),e.quotedParentGroupJid=d("WAWebBaseModel").prop(),e.mentionedJidList=d("WAWebBaseModel").prop(),e.reporterJidList=d("WAWebBaseModel").prop(),e.groupMentions=d("WAWebBaseModel").prop(),e.footer=d("WAWebBaseModel").prop(),e.hydratedButtons=d("WAWebBaseModel").prop(),e.buttons=d("WAWebBaseModel").session(),e.hsmTag=d("WAWebBaseModel").prop(),e.hsmCategory=d("WAWebBaseModel").prop(),e.templateId=d("WAWebBaseModel").prop(),e.eventName=d("WAWebBaseModel").prop(),e.isEventCanceled=d("WAWebBaseModel").prop(!1),e.eventDescription=d("WAWebBaseModel").prop(),e.eventJoinLink=d("WAWebBaseModel").prop(),e.eventStartTime=d("WAWebBaseModel").prop(),e.eventEndTime=d("WAWebBaseModel").prop(),e.eventLocation=d("WAWebBaseModel").prop(),e.eventInvalidated=d("WAWebBaseModel").prop(!1),e.selectedId=d("WAWebBaseModel").prop(),e.selectedIndex=d("WAWebBaseModel").prop(),e.selectedCarouselCardIndex=d("WAWebBaseModel").prop(),e.multicast=d("WAWebBaseModel").prop(),e.urlText=d("WAWebBaseModel").prop(),e.urlNumber=d("WAWebBaseModel").prop(),e.statusMentioned=d("WAWebBaseModel").prop(),e.isWamoSub=d("WAWebBaseModel").prop(),e.clearMedia=d("WAWebBaseModel").prop(),e.isVcardOverMmsDocument=d("WAWebBaseModel").prop(!1),e.isCaptionByUser=d("WAWebBaseModel").prop(),e.vcardList=d("WAWebBaseModel").prop(),e.vcardFormattedName=d("WAWebBaseModel").prop(),e.revokeSender=d("WAWebBaseModel").prop(),e.protocolMessageKey=d("WAWebBaseModel").prop(),e.futureproofBuffer=d("WAWebBaseModel").prop(),e.futureproofParams=d("WAWebBaseModel").prop(),e.futureproofType=d("WAWebBaseModel").prop(),e.futureproofSubtype=d("WAWebBaseModel").prop(),e.templateParams=d("WAWebBaseModel").prop(),e.textColor=d("WAWebBaseModel").prop(),e.backgroundColor=d("WAWebBaseModel").prop(),e.font=d("WAWebBaseModel").prop(),e.cannotBeRanked=d("WAWebBaseModel").prop(),e.campaignId=d("WAWebBaseModel").prop(),e.campaignDuration=d("WAWebBaseModel").prop(),e.actionLink=d("WAWebBaseModel").prop(),e.statusPSAReadTimestamp=d("WAWebBaseModel").prop(),e.isForwarded=d("WAWebBaseModel").prop(!1),e.forwardingScore=d("WAWebBaseModel").prop(),e.labels=d("WAWebBaseModel").prop(),e.hasReaction=d("WAWebBaseModel").prop(!1),e.paymentCurrency=d("WAWebBaseModel").prop(),e.paymentAmount1000=d("WAWebBaseModel").prop(),e.paymentMessageReceiverJid=d("WAWebBaseModel").prop(),e.paymentTransactionTimestamp=d("WAWebBaseModel").prop(),e.paymentStatus=d("WAWebBaseModel").prop(),e.paymentTxnStatus=d("WAWebBaseModel").prop(),e.paymentNoteMsg=d("WAWebBaseModel").prop(),e.paymentRequestMessageKey=d("WAWebBaseModel").prop(),e.paymentExpiryTimestamp=d("WAWebBaseModel").prop(),e.paymentInviteServiceType=d("WAWebBaseModel").prop(),e.ephemeralDuration=d("WAWebBaseModel").prop(),e.ephemeralSettingTimestamp=d("WAWebBaseModel").prop(),e.ephemeralOutOfSync=d("WAWebBaseModel").prop(),e.ephemeralSharedSecret=d("WAWebBaseModel").prop(),e.disappearingModeInitiator=d("WAWebBaseModel").prop(),e.ephemeralSettingUser=d("WAWebBaseModel").prop(),e.disappearingModeTrigger=d("WAWebBaseModel").prop(),e.disappearingModeInitiatedByMe=d("WAWebBaseModel").prop(),e.parentMsgKey=d("WAWebBaseModel").prop(),e.associationType=d("WAWebBaseModel").prop(),e.viewMode=d("WAWebBaseModel").prop(),e.messageSecret=d("WAWebBaseModel").prop(),e.originalSelfAuthor=d("WAWebBaseModel").prop(),e.bizPrivacyStatus=d("WAWebBaseModel").prop(),e.privacyModeWhenSent=d("WAWebBaseModel").prop(),e.verifiedBizName=d("WAWebBaseModel").prop(),e.inviteCode=d("WAWebBaseModel").prop(),e.inviteCodeExp=d("WAWebBaseModel").prop(),e.inviteGrp=d("WAWebBaseModel").prop(),e.inviteGrpName=d("WAWebBaseModel").prop(),e.inviteGrpJpegThum=d("WAWebBaseModel").prop(),e.inviteGrpType=d("WAWebBaseModel").prop(),e.sellerJid=d("WAWebBaseModel").prop(),e.message=d("WAWebBaseModel").prop(),e.orderTitle=d("WAWebBaseModel").prop(),e.itemCount=d("WAWebBaseModel").prop(),e.orderId=d("WAWebBaseModel").prop(),e.surface=d("WAWebBaseModel").prop(),e.status=d("WAWebBaseModel").prop(),e.token=d("WAWebBaseModel").prop(),e.totalAmount1000=d("WAWebBaseModel").prop(),e.totalCurrencyCode=d("WAWebBaseModel").prop(),e.catalogType=d("WAWebBaseModel").prop(),e.historySyncMetaData=d("WAWebBaseModel").prop(),e.isSendFailure=d("WAWebBaseModel").prop(),e.errorCode=d("WAWebBaseModel").prop(),e.appStateSyncKeyShare=d("WAWebBaseModel").prop(),e.appStateSyncKeyRequest=d("WAWebBaseModel").prop(),e.appStateFatalExceptionNotification=d("WAWebBaseModel").prop(),e.peerDataOperationRequestMessage=d("WAWebBaseModel").prop(),e.peerDataOperationRequestResponseMessage=d("WAWebBaseModel").prop(),e.broadcastParticipants=d("WAWebBaseModel").prop(),e.broadcastEphSettings=d("WAWebBaseModel").prop(),e.broadcastId=d("WAWebBaseModel").prop(),e.smbClientCampaignId=d("WAWebBaseModel").prop(),e.ctwaContext=d("WAWebBaseModel").prop(),e.utm=d("WAWebBaseModel").session(),e.list=d("WAWebBaseModel").prop(),e.listResponse=d("WAWebBaseModel").prop(),e.productListItemCount=d("WAWebBaseModel").prop(),e.productHeaderImageRejected=d("WAWebBaseModel").prop(!1),e.agentId=d("WAWebBaseModel").prop(),e.lastPlaybackProgress=d("WAWebBaseModel").prop(0),e.local=d("WAWebBaseModel").session(!1),e.search=d("WAWebBaseModel").session(),e.msgChunk=d("WAWebBaseModel").session(),e.startOfDay=d("WAWebBaseModel").session(),e.startOfDaySkew=d("WAWebBaseModel").session(),e.quotedMsgKey=d("WAWebBaseModel").session(),e.isQuotedMsgAvailable=d("WAWebBaseModel").session(!0),e.fromQuotedMsg=d("WAWebBaseModel").session(!1),e.senderObj=d("WAWebBaseModel").session(),e.mediaData=d("WAWebBaseModel").session(),e.forwardedFromWeb=d("WAWebBaseModel").session(!1),e.nonce=d("WAWebBaseModel").session(),e.squelch=d("WAWebBaseModel").session(),e.wamMessageSendReporter=d("WAWebBaseModel").session(),e.wamMessageSendPerfReporter=d("WAWebBaseModel").session(),e.pendingDeleteForMe=d("WAWebBaseModel").session(!1),e.isDynamicReplyButtonsMsg=d("WAWebBaseModel").prop(!1),e.dynamicReplyButtons=d("WAWebBaseModel").prop(),e.replyButtons=d("WAWebBaseModel").session(),e.buttonsResponse=d("WAWebBaseModel").prop(),e.selectedButtonId=d("WAWebBaseModel").prop(),e.headerType=d("WAWebBaseModel").prop(),e.nativeFlowName=d("WAWebBaseModel").prop(),e.nativeFlowButtons=d("WAWebBaseModel").prop(),e.interactiveHeader=d("WAWebBaseModel").prop(),e.interactiveType=d("WAWebBaseModel").prop(),e.interactivePayload=d("WAWebBaseModel").prop(),e.nativeFlowInteractiveMsg=d("WAWebBaseModel").prop(),e.carouselCardsParsed=d("WAWebBaseModel").prop(),e.carouselCards=d("WAWebBaseModel").session(),e.isCarouselCard=d("WAWebBaseModel").prop(!1),e.parentMsgId=d("WAWebBaseModel").prop(null),e.callSilenceReason=d("WAWebBaseModel").prop(null),e.callOutcome=d("WAWebBaseModel").prop(),e.isVideoCall=d("WAWebBaseModel").prop(!1),e.callDuration=d("WAWebBaseModel").prop(null),e.callParticipants=d("WAWebBaseModel").prop(null),e.reactionParentKey=d("WAWebBaseModel").prop(),e.reactionText=d("WAWebBaseModel").prop(),e.reactionTimestamp=d("WAWebBaseModel").prop(),e.targetMessageKey=d("WAWebBaseModel").prop(),e.encIv=d("WAWebBaseModel").prop(),e.encPayload=d("WAWebBaseModel").prop(),e.replyCount=d("WAWebBaseModel").prop(),e.pinParentKey=d("WAWebBaseModel").prop(),e.pinMessageType=d("WAWebBaseModel").prop(),e.pinSenderTimestampMs=d("WAWebBaseModel").prop(),e.pinExpiryDuration=d("WAWebBaseModel").prop(),e.revokeDuration=d("WAWebBaseModel").session(),e.isMdHistoryMsg=d("WAWebBaseModel").prop(!1),e.stickerSentTs=d("WAWebBaseModel").prop(0),e.isAvatar=d("WAWebBaseModel").prop(!1),e.bizSource=d("WAWebBaseModel").prop(),e.pmCampaignId=d("WAWebBaseModel").prop(),e.lastUpdateFromServerTs=d("WAWebBaseModel").prop(0),e.botEditType=d("WAWebBaseModel").prop(),e.invokedBotWid=d("WAWebBaseModel").prop(null),e.botMessageSecret=d("WAWebBaseModel").prop(),e.botFeedbackKind=d("WAWebBaseModel").prop(),e.botFeedbackText=d("WAWebBaseModel").prop(),e.botTargetSenderJid=d("WAWebBaseModel").prop(),e.bizBotType=d("WAWebBaseModel").prop(null),e.botPersonaId=d("WAWebBaseModel").prop(),e.activeBotMsgStreamingInProgress=d("WAWebBaseModel").session(!1),e.botEditTimeoutID=d("WAWebBaseModel").session(),e.lastBotEditBodyLength=d("WAWebBaseModel").session(),e.botEditTargetId=d("WAWebBaseModel").session(),e.botRespOrInvocationRevokeBotWid=d("WAWebBaseModel").session(null),e.botResponseTargetId=d("WAWebBaseModel").prop(null),e.botPluginType=d("WAWebBaseModel").prop(null),e.botPluginReferenceIndex=d("WAWebBaseModel").prop(null),e.botPluginSearchProvider=d("WAWebBaseModel").prop(null),e.botPluginSearchUrl=d("WAWebBaseModel").prop(null),e.botPluginSearchQuery=d("WAWebBaseModel").prop(null),e.botPluginMaybeParent=d("WAWebBaseModel").prop(!1),e.botReelPluginThumbnailCdnUrl=d("WAWebBaseModel").prop(null),e.botMessageDisclaimerText=d("WAWebBaseModel").prop(null),e.botMsgBodyType=d("WAWebBaseModel").prop(null),e.isSupportAIMessage=d("WAWebBaseModel").prop(),e.supportCitations=d("WAWebBaseModel").prop(),e.richResponse=d("WAWebBaseModel").prop(),e.forwardedNewsletterMessageInfo=d("WAWebBaseModel").prop(),e.encryptedData=d("WAWebBaseModel").prop(),e.newsletterAdminInviteInfo=d("WAWebBaseModel").prop(),e.reportingTokenInfo=d("WAWebBaseModel").prop(),e.reportingTokenContent=d("WAWebBaseModel").prop(),e.plainProtobufBytes=d("WAWebBaseModel").session(),e.preMatChat=d("WAWebBaseModel").session(),e.senderWithDevice=d("WAWebBaseModel").session(),e.isRetry=d("WAWebBaseModel").session(!1),e.isOffline=d("WAWebBaseModel").session(!1),e.musicArtwork=d("WAWebBaseModel").prop(),e._links=d("WAWebBaseModel").session(function(){return[]}),e._headerLinks=d("WAWebBaseModel").session(function(){return[]}),e._footerLinks=d("WAWebBaseModel").session(function(){return[]}),e.linksIndexParsed=d("WAWebBaseModel").session(0),e._pollOptionsToLinks=d("WAWebBaseModel").session(),e._phoneNumbers=d("WAWebBaseModel").session(function(){return[]}),e._headerPhoneNumbers=d("WAWebBaseModel").session(function(){return[]}),e._footerPhoneNumbers=d("WAWebBaseModel").session(function(){return[]}),e.phoneNumbersIndexParsed=d("WAWebBaseModel").session(0),e._waitForPhoneUploadPromise=d("WAWebBaseModel").session(),e.requiresDirectConnection=d("WAWebBaseModel").prop(null),e.isOverwrittenByRevoke=d("WAWebBaseModel").session(!1),e.bizContentPlaceholderType=d("WAWebBaseModel").prop(null),e.hostedBizEncStateMismatch=d("WAWebBaseModel").prop(!1),e.senderOrRecipientAccountTypeHosted=d("WAWebBaseModel").prop(!1),e.placeholderCreatedWhenAccountIsHosted=d("WAWebBaseModel").prop(!1),e.limitSharing=d("WAWebBaseModel").prop(),e._saveLastPlaybackProgress=c("lodash").debounce(function(a,b){d("WAWebDBUpdateMessageTable").updateMessageTable(a,{lastPlaybackProgress:b})},500),b)||babelHelpers.assertThisInitialized(e)}var f=e.prototype;f.initialize=function(){var b=this;a.prototype.initialize.call(this);this.carouselCardsParsed!=null&&this._initCarouselCards();this.type===d("WAWebMsgType").MSG_TYPE.INTERACTIVE&&this.listenTo(this,"change:carouselCardsParsed",this._initCarouselCards);this._pendingAckUpdate=new(d("WAWebPromiseQueue").PromiseQueue)();var e=d("WAWebMsgModelUtils").getValidatedSender(this);e&&(this.addChild("senderObj",d("WAWebContactCollection").ContactCollection.gadd(e.isUser()&&!e.isFbidBot()&&!e.isHosted()&&!e.isNewsletter()?d("WAWebWidFactory").createWid(e.isLid()?d("WAJids").toLidUserJid(e.user):d("WAJids").toPhoneUserJid(e.user)):e)),this.hsmTag===d("WAWebBusinessHSMTypes").HSM_TAG_TYPE.MARKETING&&this.senderObj.setIsMarketingMessageThread(!0));this.mentionedJidList=this.mentionedJidList||[];this.groupMentions=this.groupMentions||[];this.mentionedJidList.forEach(function(a){return d("WAWebContactCollection").ContactCollection.gadd(a)});this.type===d("WAWebMsgType").MSG_TYPE.CIPHERTEXT&&this.listenToOnce(this,"change:type",this._handleCiphertextDecrypted);this.mediaObject=void 0;d("WAWebMsgModelUtils").typeIsMms(this)&&(this._createMediaDataChild(),(!this.isViewOnce||d("WAWebViewOnceState").isUnviewed(this.safe()))&&d("WAWebMedia").registerMsg(this));d("WAWebConnModel").Conn.isSMB&&d("WAWebBizLabelUtils").initializeLabels(this);this.isViewOnce&&(this.listenTo(this,"change:ack",this._handleViewOnceMediaStatusChanged),this.listenTo(this.mediaData,"change:mediaStage",this._handleViewOnceMediaStatusChanged));this.listenTo(this,"change:viewMode",this._handleViewModeChange);d("WAWebViewModeUtils").isViewModeVisibleInSurface(d("WAWebViewMode.flow").ViewModeSurface.CHAT,this.viewMode)||this._handleViewModeChange();c("gkx")("26258")||this.listenTo(this,"change:t",function(){Number.isInteger(b.t)||d("WALogger").ERROR(o(),b.t,b.id.toString(),b.type,b.subtype).tags("date_marker").sendLogs("Msg TS updated to invalid value")});if(d("WAWebBotGating").isBotReceiveEnabled()){d("WAWebMsgGetters").getIsMetaBotResponse(this)&&this.listenTo(this,"change:botEditType",this._handleBotTypingIndicatorTimeout);this.recvFresh&&((e=this.senderObj)==null?void 0:(e=e.id)==null?void 0:e.isBot())&&(this.activeBotMsgStreamingInProgress=!0);this._handleBotTypingIndicatorTimeout()}};f._handleViewModeChange=function(){var a;a=(a=(a=d("WAWebFrontendMsgGetters").getMaybeChat(this))==null?void 0:a.msgs)!=null?a:this.msgChunk;!d("WAWebViewModeUtils").isViewModeVisibleInSurface(d("WAWebViewMode.flow").ViewModeSurface.CHAT,this.viewMode)?(this._triggerNotificationForParentMessage(),this.alterChatFields({messageInHiddenViewMode:!0}),a==null?void 0:a.trigger("remove_msgs",[this],{})):a==null?void 0:a.trigger("insert_msgs",[this],{});a==null?void 0:a.triggerChangeLast(null,a,{})};f.hideParentMessageInChat=function(a){a=a.duringDetach;var b=this.parentMsgKey;if(b){var c;b=this.getCollection().get(b);b&&((c=d("WAWebInvisiblePlaceholderViewModeProcessor").InvisiblePlaceholderViewModeProcessor.compatibleMessageTypes)==null?void 0:c.includes(b.type))&&d("WAWebMessageAssociationUIUtils").shouldHideParentMessage({parentMsg:b,duringDetach:a})&&b.set("viewMode",d("WAWebViewMode.flow").ViewModeType.INVISIBLE_PLACEHOLDER)}};f._triggerNotificationForParentMessage=function(){var a=d("WAWebFrontendMsgGetters").getEventType(this),b=this.parentMsgKey;a=this.recvFresh&&!d("WAWebMsgGetters").getIsSentByMe(this)&&(a===d("WAWebCommonMsgUtils").EventType.DEFAULT||a===d("WAWebCommonMsgUtils").EventType.SIGNIFICANT);if(b&&a){a=this.getCollection().get(b);a&&d("WAWebNotificationsMsgNotification").eligibleMessagesForNotificationRetriggering.has(a.type)?d("WAWebCmd").Cmd.alertNewMsg(a):d("WALogger").LOG(n(),this.id.toString())}};f._initCarouselCards=function(){var a,b=this.carouselCardsParsed;if(b==null)return;a=(a=(a=this.carouselCards)==null?void 0:a.getCardsById())!=null?a:{};var d=[];for(b of b){var e=b.id.toString();if(a[e]!=null){e=a[e];e.set(b);d.push(e)}else{e=babelHelpers["extends"]({},b);d.push(e)}}e=new(c("WAWebCarouselCardsCollection"))();e.add(d);this.carouselCards=e;this.getCollection().add(e.slice())};f._handleBotTypingIndicatorTimeout=function(){var a=this;if(!d("WAWebBotGating").isBotReceiveEnabled())return;if(this.subtype===d("WAWebBotGenTypingIndicatorMsg").BOT_TYPING_PLACEHOLDER_MSG_SUBTYPE){var b=d("WAWebBotGenTypingIndicatorMsg").getBotTypingIndicatorTimeout();self.setTimeout(function(){a["delete"]()},b);void c("WAWebChangePresenceHandlerAction")({id:this.id.remote,type:"typing"});return}b=this.botEditType;if(b==null)return;var e=d("WAWebBotGenTypingIndicatorMsg").getBotTypingIndicatorTimeout();switch(b){case d("WAWebBotTypes").BotMsgEditType.LAST:case d("WAWebBotTypes").BotMsgEditType.FULL:this.activeBotMsgStreamingInProgress=!1;this.botEditTimeoutID&&self.clearTimeout(this.botEditTimeoutID);return;default:this.botEditTimeoutID=self.setTimeout(function(){a.activeBotMsgStreamingInProgress=!1,a.botEditType=d("WAWebBotTypes").BotMsgEditType.LAST,void d("WAWebDBUpdateMessageTable").updateMessageTable(a.id,{botEditType:d("WAWebBotTypes").BotMsgEditType.LAST})},e)}};f.getRawLinks=function(){return this._links};f.setRawLinks=function(a){a.length>0&&(this._links=a)};f.clearRawLinks=function(){this._links=[],this.linksIndexParsed=0};f.getRawPollOptionsToLinks=function(){return this._pollOptionsToLinks};f.setRawPollOptionsToLinks=function(a){this._pollOptionsToLinks=a};f.getRawHeaderLinks=function(){return this._headerLinks};f.setRawHeaderLinks=function(a){a.length>0&&(this._headerLinks=a)};f.getRawFooterLinks=function(){return this._footerLinks};f.setRawFooterLinks=function(a){a.length>0&&(this._footerLinks=a)};f.getRawPhoneNumbers=function(){return this._phoneNumbers};f.setRawPhoneNumbers=function(a){a.length>0&&(this._phoneNumbers=a)};f.clearRawPhoneNumbers=function(){this._phoneNumbers=[],this.phoneNumbersIndexParsed=0};f.getRawHeaderPhoneNumbers=function(){return this._headerPhoneNumbers};f.setRawHeaderPhoneNumbers=function(a){a.length>0&&(this._headerPhoneNumbers=a)};f.getRawFooterPhoneNumbers=function(){return this._footerPhoneNumbers};f.setRawFooterPhoneNumbers=function(a){a.length>0&&(this._footerPhoneNumbers=a)};f._createMediaDataChild=function(){this.addChild("mediaData",new(c("WAWebMediaData"))())};f.mayFail=function(){return d("WAWebMsgGetters").getIsSentByMe(this)&&this.ack<d("WAWebAck").ACK.SENT};f.isUnsentPhoneMsg=function(){return!this.local&&d("WAWebMsgGetters").getIsSentByMe(this)&&this.ack<d("WAWebAck").ACK.SENT};f.supportsStarWithKeepInChat=function(){return d("WAWebMsgGetters").getIsEphemeral(this)&&(this.star||this.isGif||d("WAWebMsgGetters").getIsStickerMsg(this))};f.interactiveButtonsReleased=function(){return this.isFromTemplate||!d("WAWebFrontendMsgGetters").getHasTemplateButtons(this)&&this.type!==d("WAWebMsgType").MSG_TYPE.TEMPLATE_BUTTON_REPLY};f.getVcardWids=function(){return this.type!==d("WAWebMsgType").MSG_TYPE.VCARD?null:d("WAWebVcardParsingUtils").vcardWids(d("WAWebMsgGetters").getVcard(this))};f.getMultiVcardWids=function(){if(this.type!==d("WAWebMsgType").MSG_TYPE.MULTI_VCARD)return null;var a=d("WAWebMsgGetters").getVcardList(this).map(function(a){return a.vcard}).filter(Boolean).map(function(a){return d("WAWebVcardParsingUtils").parseMultiVcard(a)}).flat();a=a.map(function(a){return d("WAWebVcardParsingUtils").vcardWids(a)}).flat();return Array.from(new Set(a))};f.getLocObject=function(){var a=this.loc;if(a){a=a.split("\n");var b=a[0];a=a[1];a=a===void 0?null:a;return{name:b,addr:a}}return null};f.resumeRemoteUpload=function(){if(d("WAWebMsgGetters").getIsNewsletterMsg(this))return d("WAWebMedia").resumeUploadMsg(this);this.isUnsentPhoneMsg()&&d("WAWebSendMsgRecordAction").sendMsgRecord(this);return this.forceDownloadMediaEvenIfExpensive()};f.forceRMR=function(){return(h||(h=b("Promise"))).reject(c("err")("unimplemented forceRMR"))};f.isForcingRMR=function(){return!1};f.cancelDownload=function(){d("WAWebMedia").cancelDownloadMsg(this)};f.resumeUpload=function(){this.mediaData.mediaStage!==d("WAWebMediaTypes").MediaDataStage.NEED_UPLOAD&&d("WALogger").ERROR(m(),this.mediaData.mediaStage).sendLogs("resume-non-need-upload");return d("WAWebMedia").resumeUploadMsg(this).then(function(a){return a==null?void 0:a.messageSendResult})};f.cancelUpload=function(){d("WAWebMedia").cancelUploadMsg(this)};f.waitForPhoneUpload=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=this;if(this.mediaData!=null&&Boolean(this.mediaData.filehash)&&!this.isUnsentPhoneMsg())return;this._waitForPhoneUploadPromise||(this._waitForPhoneUploadPromise=c("WAWebEventsWaitForBbEvent")(this.mediaData,"change:mediaStage change:filehash",function(){return Boolean(a.mediaData.filehash)&&!a.isUnsentPhoneMsg()}));yield this._waitForPhoneUploadPromise;this._waitForPhoneUploadPromise=null});function d(){return a.apply(this,arguments)}return d}();f.forceDownloadMediaEvenIfExpensive=function(){return this.downloadMedia({downloadEvenIfExpensive:!0,rmrReason:d("WAWebWamEnumWebcRmrReasonCode").WEBC_RMR_REASON_CODE.MSG_CLICK,isUserInitiated:!0})};f.downloadMedia=function(a){var e=this;if(d("WAWebFrontendMsgGetters").getAsRevoked(this))return(h||(h=b("Promise"))).resolve();var f=a.downloadEvenIfExpensive,g=a.rmrReason,i=a.isUserInitiated,j=a.isAutoDownload;if(!i&&!d("WAWebMsgModelPropUtils").isTrusted(this))return(h||(h=b("Promise"))).resolve();if(!d("WAWebMsgGetters").getIsStatus(this)&&d("WAWebFrontendMsgGetters").getChat(this).isSuspendedOrTerminated()&&d("WAWebMiscGatingUtils").isGroupSuspendV2Enabled()){i&&d("WAWebModalManager").ModalManager.open(p.jsx(c("WAWebSuspendedGroupMediaDownloadFailureModal.react"),{}),{transition:"modal-flow"});return(h||(h=b("Promise"))).resolve()}d("WAWebFrontendMsgGetters").getAsMms(this)||d("WALogger").ERROR(l(),this.id.toString(),this.type).devConsole(this).sendLogs("media-fault: downloadMedia msg is not mms type");if(this.isUnsentPhoneMsg()){var k=this._waitForPhoneUploadPromise;k||(k=this._waitForPhoneUploadPromise=c("WAWebEventsWaitForBbEvent")(this.mediaData,"change:mediaStage change:filehash",function(){return!!e.mediaData.filehash&&!e.isUnsentPhoneMsg()}).then(function(){e._waitForPhoneUploadPromise=null}));return k.then(function(){return e.downloadMedia(a)})}return d("WAWebMedia").downloadMsg({msg:this,isUserClick:g===d("WAWebWamEnumWebcRmrReasonCode").WEBC_RMR_REASON_CODE.MSG_CLICK,downloadEvenIfExpensive:f,rmrReason:g,rmrData:this._getRmrData(g),mode:i?"manual":"auto",isAutoDownload:j,chatWid:(k=d("WAWebFrontendMsgGetters").getMaybeChat(this))==null?void 0:k.id})};f._getRmrData=function(a){a={webcRmrReason:a,webcMessageT:this.t};var b=d("WAWebFrontendMsgGetters").getMaybeChat(this);if(b){a.webcChatType=b.getWebcChatType();b.initialIndex!=null&&(a.webcChatPosition=b.initialIndex);var c=this.msgChunk;c&&c===b.msgs&&(a.webcMessageIndex=c.length-c.indexOf(this)-1)}return a};f.applyUpdate=function(a){var c=this;if(a.type&&this.type!==a.type&&d("WAWebMsgModelUtils").typeIsMms(a)){!d("WAWebCommonMsgUtils").isPlaceholderMsg(this.type)&&!d("WAWebMsgGetters").getIsFutureproof(this)&&d("WALogger").ERROR(k(),this.id.toString(),this.type,String(a.type)).sendLogs("invalid-type-update");this._createMediaDataChild();d("WAWebMedia").registerMsgEarly(this,a);return d("WAWebMedia").prepareMsg(this).then(function(){c.set(a)})["catch"](function(a){d("WALogger").ERROR(j(),String(a)).devConsole(a).sendLogs("preregister-error")})}this.set(a);return(h||(h=b("Promise"))).resolve()};f.waitForPrep=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a,c=this;a=this.requiresDirectConnection==null?d("WAWebDirectConnectionGatingUtils").genDirectConnectionMessageModifiers(this.type,(a=this.list)==null?void 0:a.listType,this.businessOwnerJid).then(function(a){return c.set(a)}):(h||(h=b("Promise"))).resolve();var e=d("WAWebMsgModelUtils").typeIsMms(this)?d("WAWebMedia").prepareMsg(this):(h||(h=b("Promise"))).resolve();yield a;return e});function c(){return a.apply(this,arguments)}return c}();f.alterChatFields=function(a){var b=this._getChatCollection().get(this.id.remote);if(b){var c;d("WAWebBotGating").isBotReceiveEnabled()&&(this.id.remote.isBot()||((c=b.contact.businessProfile)==null?void 0:c.isBizBot3p)===!0)&&this.subtype===d("WAWebBotGenTypingIndicatorMsg").BOT_TYPING_PLACEHOLDER_MSG_SUBTYPE&&b.botInitialTypingIndicatorMsgId&&(b.botInitialTypingIndicatorMsgId.equals(this.id)&&b.set({botInitialTypingIndicatorMsgId:null},{silent:!0}));b.unreadMsgAnchor===this&&(b.unreadMsgAnchor=void 0);c=(a==null?void 0:a.messageInHiddenViewMode)===!0||!a||!a.doNotResetLastReceived;if(c&&b.lastReceivedKey===this.id){c=void 0;var e=d("WAWebChatGetMessage").getLastReceivedMsg(b);e&&(c=e.id);b.lastReceivedKey=c}b.composeQuotedMsg===this&&(a==null?void 0:a.messageInHiddenViewMode)!==!0&&(b.composeQuotedMsg=null)}};f["delete"]=function(b){a.prototype["delete"].call(this);this.botEditTimeoutID&&self.clearTimeout(this.botEditTimeoutID);d("WAWebStarredMsgCollection").AllStarredMsgsCollection.remove(this);d("WAWebPinInChatCollection").PinInChatCollection.deleteByParentMessageKey(this.id);d("WAWebLabelCollection").LabelCollection.removeAllLabelsMD(this);d("WAWebMsgModelUtils").typeIsMms(this)&&d("WAWebMedia").deregisterMsg(this);var c=this.getCollection();d("WAWebMessageAssociationGatingUtils").isMessageAssociationInfraEnabled()&&d("WAWebMessageAssociationUIUtils").getHiddenAssociatedMessages(this.id).forEach(function(a){a["delete"]()});c.remove(this.id);this.hideParentMessageInChat({duringDetach:!1});this.msgChunk&&this.msgChunk.remove(this.id,{},Boolean(b==null?void 0:b.skipUpdatingSortTime));this.alterChatFields(b);d("WAWebMsgGetters").clearMsgGetterCacheFor(this);d("WAWebFrontendMsgGetters").clearFrontendMsgGetterCacheFor(this)};f.isLastMessage=function(){var a=d("WAWebFrontendMsgGetters").getChat(this).msgs.last();return this.id.equals(a==null?void 0:a.id)};f.msgContextInfo=function(a){var b=this.toJSON();b.id;b.t;b.notifyName;b.from;b.to;b.author;b.ack;b.invis;b.isNewMsg;b.star;b.recvFresh;b.recipients;b.broadcast;b.quotedMsg;b.quotedStanzaID;b.quotedRemoteJid;b.quotedParticipant;b.senderObj;b.multicast;b.replyButtons;b.buttons;b.latestEditMsgKey;b.latestEditSenderTimestampMs;b=babelHelpers.objectWithoutPropertiesLoose(b,["id","t","notifyName","from","to","author","ack","invis","isNewMsg","star","recvFresh","recipients","broadcast","quotedMsg","quotedStanzaID","quotedRemoteJid","quotedParticipant","senderObj","multicast","replyButtons","buttons","latestEditMsgKey","latestEditSenderTimestampMs"]);var c=this.id,e=null;a&&!c.remote.equals(a)&&(e=c.remote);a=d("WAWebMsgGetters").getIsNewsletterMsg(this)?this.id.remote:d("WAWebMsgGetters").getSender(this);return{quotedMsg:b,quotedParticipant:a,quotedStanzaID:c.id,quotedRemoteJid:e}};f.displayName=function(a){a===void 0&&(a={});a=a;var b=a.showShortName;b=b===void 0?!1:b;var e=a.showVerifiedName;e=e===void 0?!1:e;var f=a.withPushName;f=f===void 0?!1:f;var g=a.withPushNameOnly;g=g===void 0?!1:g;a=a.newPushNameFormatting;a=a===void 0?!1:a;if(!d("WAWebMsgGetters").getSender(this))return"";if(d("WAWebUserPrefsMeUser").isMeAccount(d("WAWebMsgGetters").getSender(this)))return c("fbs")._(/*BTDS*/"__JHASH__IBzirFr1ZJs__JHASH__").toString();if(d("WAWebMsgGetters").getIsPSA(this))return d("WAWebConnModel").Conn.isSMB?c("fbs")._(/*BTDS*/"__JHASH__MDLrDq6bFhw__JHASH__").toString():c("fbs")._(/*BTDS*/"__JHASH__8HYf1Fxz_sn__JHASH__").toString();if(this.senderObj==null)return"";var h=this.senderObj;b=b?h.shortName:void 0;if(!c("isStringNullOrEmpty")(b))return b;else if(h.name)return h.name;if(e&&h.verifiedLevel===d("WAWebBusinessProfileTypes").VERIFIED_LEVEL.HIGH&&h.verifiedName)return h.verifiedName;b=a?d("WAWebChatContactUtils").getFormattedNotifyName(this.notifyName).toString():"~"+this.notifyName;e=f&&this.notifyName?b:"";if(g&&e)return e;f=((a=d("WAWebMsgGetters").getSender(this))==null?void 0:a.isLid())?d("WAWebFrontendContactGetters").getUserDisplayNameForLid(h):d("WAWebWidFormat").widToFormattedUser(d("WAWebMsgGetters").getSender(this));d("WAWebChatCommunityUtils").shouldMaskPhoneNumberForChat(d("WAWebFrontendMsgGetters").getChat(this),h)&&(f=d("WAWebFrontendContactGetters").getMaskedPhoneLid(h));return""+f+(e?" ":"")+e};f.isMentioned=function(a){return!this.mentionedJidList?!1:this.mentionedJidList.findIndex(function(b){return b.equals(a)})>-1};f.mentionMap=function(){if(!this.mentionedJidList)return null;if(!this.mentionedJidList.length)return null;var a={};this.mentionedJidList.forEach(function(b){a["@"+(c("WAWebWid").user(b)||"")]=d("WAWebContactCollection").ContactCollection.gadd(b)});return a};f.groupMentionMap=function(){var a;if(!this.groupMentions)return null;return!this.groupMentions.length?null:(a=this.groupMentions)==null?void 0:a.reduce(function(a,b){var c="@"+b.groupJid.toString();a[c]=b.groupSubject;return a},{})};f.updateAck=function(a,b){var c=this;b===void 0&&(b=!1);var e=this.ack,f=d("WAWebFrontendMsgGetters").getMaybeChat(this);if(!d("WAWebMsgGetters").getIsStatus(this)&&f!=null&&d("WAWebChatGetters").getIsGroup(f)&&this.isMdHistoryMsg&&a>=d("WAWebAck").ACK.RECEIVED&&this.id.fromMe)return;d("WATypeUtils").isNumber(a)&&(e===void 0||a>e||a===d("WAWebAck").ACK.FAILED)?(this.ack=a,b||this._pendingAckUpdate.enqueue(function(){return d("WAWebDBUpdateMessageTable").updateMessageTable(c.id,{ack:a})})):a===d("WAWebAck").ACK.FAILED&&this.ack===d("WAWebAck").ACK.CLOCK&&(this.ack=d("WAWebAck").ACK.FAILED,this._pendingAckUpdate.enqueue(function(){return d("WAWebDBUpdateMessageTable").updateMessageTable(c.id,{ack:a})}))};f.updateErrorCode=function(a){this.errorCode=a;return d("WAWebDBUpdateMessageTable").updateMessageTable(this.id,{errorCode:a})};f.updateLastPlaybackProgress=function(a){this.lastPlaybackProgress=a,this._saveLastPlaybackProgress(this.id,a)};f.avParams=function(){return d("WAWebMedia").mediaMetadata(this)};f.resend=function(){var a=this;if(d("WAWebMsgGetters").getIsFailed(this)){if(d("WAWebMsgGetters").getIsEdited(this))return d("WAWebSendMessageEditAction").resendLatestEdit(this);var c={ack:d("WAWebAck").ACK.CLOCK};c.isSendFailure=!1;this._pendingAckUpdate.enqueue(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield d("WAWebDBUpdateMessageTable").updateMessageTable(a.id,c),a.set(c)}));if(d("WAWebMsgGetters").getIsNewsletterMsg(this))return d("WAWebNewsletterSendMsgAction").resendNewsletterMsg(this).then(function(a){return a&&a.messageSendResult});return d("WAWebFrontendMsgGetters").getAsMms(this)?d("WAWebMsgGetters").getIsSentByMeFromWeb(this)?this.resumeUpload():this.resumeRemoteUpload():d("WAWebSendMsgRecordAction").sendMsgRecord(this).then(function(a){return a.messageSendResult})}return(h||(h=b("Promise"))).resolve()};f._handleCiphertextDecrypted=function(){if(d("WAWebMsgGetters").getIsStatus(this))return;var a=d("WAWebFrontendMsgGetters").getChat(this),b=a.msgs.length;a=a.msgs.indexOf(this);a!==-1&&b-a<=10&&d("WAWebCmd").Cmd.alertNewMsg(this)};f._handleViewOnceMediaStatusChanged=function(){if(!this.isViewOnce)return;if(this.mediaData==null)return;var a=d("WAWebMsgGetters").getIsSentByMe(this)&&this.ack>=d("WAWebAck").ACK.SENT&&this.mediaData.mediaStage===d("WAWebMediaTypes").MediaDataStage.RESOLVED,b=!d("WAWebMsgGetters").getIsSentByMe(this)&&this.ack>=d("WAWebAck").ACK.PLAYED;(a||b)&&(this.stopListening(this,"change:ack",this._handleViewOnceMediaStatusChanged),this.stopListening(this.mediaData,"change:mediaStage",this._handleViewOnceMediaStatusChanged),d("WAWebMedia").deregisterMsg(this))};f.isReaction=function(){return d("WAWebMsgGetters").getIsReaction(this)};f.isEditProtocolMsg=function(){return d("WAWebMsgGetters").getIsEditProtocolMsg(this)};f.getWamDisappearingModeInitiator=function(){var a=this.disappearingModeInitiator;if(a==null)return null;switch(a){case d("WAWebEphemeralityTypes").DisappearingModeInitiator.InitiatedByMe:return d("WAWebWamEnumDisappearingChatInitiatorType").DISAPPEARING_CHAT_INITIATOR_TYPE.INITIATED_BY_ME;case d("WAWebEphemeralityTypes").DisappearingModeInitiator.InitiatedByOther:case d("WAWebEphemeralityTypes").DisappearingModeInitiator.BizUpgradeFbHosting:return d("WAWebWamEnumDisappearingChatInitiatorType").DISAPPEARING_CHAT_INITIATOR_TYPE.INITIATED_BY_OTHER;case d("WAWebEphemeralityTypes").DisappearingModeInitiator.ChangedInChat:return d("WAWebWamEnumDisappearingChatInitiatorType").DISAPPEARING_CHAT_INITIATOR_TYPE.CHAT}};f.getWamMessageType=function(){return d("WAWebWamMsgUtils").getWamMessageType(this)};f.getWamMediaType=function(){return d("WAWebWamMsgUtils").getWamMediaType(this)};f.getWamEditType=function(){return d("WAWebMsgGetters").getWamEditType(this)};f.getForwardingScoreWhenForwarded=function(){var a=5,b=d("WAWebMsgGetters").getNumTimesForwarded(this)+(d("WAWebMsgGetters").getShouldDisplayAsForwarded(this)?1:0);return b>=a?c("WAWebConstantsDeprecated").FREQUENTLY_FORWARDED_SENTINEL:b};f.isExpired=function(){var a=d("WAWebMsgGetters").getEphemeralExpirationTimestamp(this);return a==null?!1:a<=d("WATimeUtils").unixTime()};f.isRealMessage=function(){var a=this.type===d("WAWebMsgType").MSG_TYPE.GROUPS_V4_INVITE&&this.from.equals(d("WAWebUserPrefsMeUser").getMaybeMeUser());return!a&&!d("WAWebMsgGetters").getIsInitialE2ENotification(this)&&this.type!==d("WAWebMsgType").MSG_TYPE.CALL_LOG&&!d("WAWebMsgGetters").getIsBizNotification(this)&&!["change_number","masked_thread_created"].includes(this.subtype)&&!d("WAWebMsgGetters").getIsDisappearingModeSystemMessage(this)};f.isExpiredAndNotKept=function(){return this.isExpired()&&!d("WAWebMsgGetters").getIsKept(this)};f.timeUntilExpiration=function(){var a=d("WAWebMsgGetters").getEphemeralExpirationTimestamp(this);if(a==null)return null;return this.isExpired()?0:a-d("WATimeUtils").unixTime()};f._logStorageEstimate=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=(yield d("WAStorageEstimator").estimateStorage());if(b.success){b=b.value;var c=b.quota;b=b.usage;a.webcBrowserStorageQuotaBytes=c;a.webcBrowserStorageQuotaUsedBytes=b}});function a(b){return a.apply(this,arguments)}return a}();f.getCollection=function(){return d("WAWebMsgCollection").MsgCollection};f._getChatCollection=function(){return d("WAWebMsgGetters").getIsNewsletterMsg(this)?c("WAWebNewsletterCollection"):d("WAWebChatCollection").ChatCollection};f.safe=function(){return this};f.unsafe=function(){return this};f.$MsgImpl$p_1=function(){return d("WAWebUserPrefsMeUser").isMeAccount(d("WAWebMsgGetters").getKicSender(this))};f.keepIsLockedForMe=function(){return this.keepIsLockedByDmSettingsForUser(d("WAWebUserPrefsMeUser").getMeUser())};f.keepIsLockedForUser=function(a){return this.keepIsLockedByDmSettingsForUser(a)};f.keepIsLockedForMeSenderSuperpower=function(){var a=d("WAWebMsgGetters").getKicSender(this);a=c("WAWebWid").equals.apply(c("WAWebWid"),d("WAWebLidMigrationUtils").toCommonAddressingMode(a,d("WAWebMsgGetters").getSender(this)));return d("WAWebMsgGetters").getIsUnkept(this)&&a&&!this.$MsgImpl$p_1()};f.keepIsLockedByDmSettingsForUser=function(a){var b;b=d("WAWebChatGetters").getIsGroup(d("WAWebFrontendMsgGetters").getChat(this))?!((b=d("WAWebFrontendMsgGetters").getChat(this).groupMetadata)==null?void 0:b.userCanSetEphemeralSetting(a)):!1;return b};f._isKICEnabled=function(){return!d("WAWebFrontendMsgGetters").getChat(this).supportsKIC()?!1:d("WAWebMsgGetters").getIsEphemeral(this)&&this.type!==d("WAWebMsgType").MSG_TYPE.REVOKED&&!this.isViewOnce&&!d("WAWebFrontendMsgGetters").getAsAlbum(this)};f.canShowKeepOrUnkeepOption=function(){return this.canShowKeepOption()||this.canShowUnkeepOption()};f.canShowKeepOption=function(){var a;return this._isKICEnabled()&&(d("WAWebChatGroupUtils").canSendToGroup(d("WAWebFrontendMsgGetters").getChat(this))||((a=d("WAWebFrontendMsgGetters").getChat(this).groupMetadata)==null?void 0:a.pastParticipants.get(d("WAWebUserPrefsMeUser").getMeUser()))!=null)&&!this.keepIsLockedForMe()&&!this.star&&!this.isGif&&!d("WAWebMsgGetters").getIsStickerMsg(this)};f.canShowUnkeepOption=function(){return d("WAWebMsgGetters").getIsKept(this)&&this._isKICEnabled()&&(this.canRevokeUnkeep()||this.canShowKeepOption()||this.isGif||d("WAWebMsgGetters").getIsStickerMsg(this))};f.canRevokeUnkeep=function(){if(d("WAWebMsgGetters").getIsSentByMe(this)){var a;if(d("WAWebChatGetters").getIsGroup(d("WAWebFrontendMsgGetters").getChat(this))&&((a=d("WAWebFrontendMsgGetters").getChat(this).groupMetadata)==null?void 0:a.participants.iAmMember())===!0)return!0;else if(d("WAWebChatGetters").getIsUser(d("WAWebFrontendMsgGetters").getChat(this))&&!d("WAWebFrontendMsgGetters").getChat(this).contact.isContactBlocked)return!0}return!1};f.isPastUnkeepExpirationLimit=function(){var a=d("WAWebMsgGetters").getEphemeralExpirationTimestamp(this);if(a!=null){a=Math.trunc(+new Date()/1e3)-a;return d("WAWebMsgGetters").getIsKept(this)&&a>d("WAWebEphemeralKeepInChatAbpropUtils").getUndoKeepInChatExpiration()}return!1};f.shouldShowNotificationPreview=function(){var a;return!((a=d("WAWebFrontendMsgGetters").getAsViewOnce(this))==null?void 0:a.isViewOnce)&&d("WAWebMuteCollection").MuteCollection.getGlobalPreviews()};f.senderIsGroupParticipant=function(){var a=d("WAWebFrontendMsgGetters").getChat(this).groupMetadata;if(a==null)return!1;var b=d("WAWebMsgGetters").getSender(this);if(b!=null&&a.participants.get(b)!=null)return!0;if(!a.isCag)return!1;b=b!=null?d("WAWebApiContact").getCurrentLid(d("WAWebWidFactory").toUserWid(b)):null;return b==null?!1:a.participants.get(b)!=null};f.detachAssociatedMsg=function(){this.hideParentMessageInChat({duringDetach:!0}),this.set({viewMode:d("WAWebViewMode.flow").ViewModeType.VISIBLE,associationType:null,parentMsgKey:null})};return e}(d("WAWebBaseModel").BaseModel);a.Proxy="msg";a.idClass=c("WAWebMsgKey");a.kind="__MOCKED_KIND__";e=d("WAWebBaseModel").defineModel(a);g.Msg=e}),226); __d("WAWebMsgModelPropUtils",["WAWebBusinessProfileTypes","WAWebChatGetters","WAWebContactGetters","WAWebFrontendMsgGetters","WAWebInteractiveMessageType","WAWebInteractiveMessagesNativeFlowName","WAWebMsgGetters","WAWebMsgType","WAWebStateUtils","WAWebUserPrefsMeUser"],(function(a,b,c,d,e,f,g){function a(a){a=d("WAWebStateUtils").unproxy(a);if(a.type===d("WAWebMsgType").MSG_TYPE.INTERACTIVE)return a.interactiveType===c("WAWebInteractiveMessageType").SHOPS_STOREFRONT||a.interactiveType===c("WAWebInteractiveMessageType").NATIVE_FLOW&&[c("WAWebInteractiveMessagesNativeFlowName").ORDER_DETAILS,c("WAWebInteractiveMessagesNativeFlowName").PAYMENT_INFO].includes(a.nativeFlowName);if(a.type===d("WAWebMsgType").MSG_TYPE.NATIVE_FLOW)return a.nativeFlowName===c("WAWebInteractiveMessagesNativeFlowName").ORDER_DETAILS||a.nativeFlowName===c("WAWebInteractiveMessagesNativeFlowName").PAYMENT_INFO;return a.type===d("WAWebMsgType").MSG_TYPE.PROTOCOL?a.subtype==="event_edit_decrypted":["image","video","ptv","audio","ptt","location","vcard","multi_vcard","document","ciphertext","debug_placeholder","oversized","unknown","call_log","revoked","sticker","payment","poll_creation","poll_result_snapshot","groups_v4_invite","newsletter_admin_invite","product","order","event_creation","biz_content_placeholder","album","sticker-pack"].includes(a.type)}function b(a){a=d("WAWebStateUtils").unproxy(a);if(d("WAWebUserPrefsMeUser").isMeAccount(d("WAWebMsgGetters").getSender(a)))return!0;if(a.senderObj!=null&&d("WAWebContactGetters").getIsMyContact(a.senderObj))return!0;var b=d("WAWebFrontendMsgGetters").getChat(a);if(d("WAWebChatGetters").getIsGroup(b)||d("WAWebChatGetters").getIsNewsletter(b))return b.isTrusted();if(d("WAWebMsgGetters").getIsPSA(a)||d("WAWebMsgGetters").getIsCAPISupport(a))return!0;if(a.isFromTemplate)return!0;a=d("WAWebChatGetters").getIsGroup(b)?a.senderObj:b.contact;return(a==null?void 0:a.verifiedLevel)===d("WAWebBusinessProfileTypes").VERIFIED_LEVEL.HIGH?!0:b.notSpam}function e(a){a=d("WAWebStateUtils").unproxy(a);return((a=d("WAWebFrontendMsgGetters").getChat(a).groupMetadata)==null?void 0:a.participants.iAmMember())===!0}g.hasSymbol=a;g.isTrusted=b;g.iAmGroupParticipant=e}),98); __d("WAWebCongratulationsAnimationsGatingUtils",["WAWebABProps","gkx"],(function(a,b,c,d,e,f,g){function a(){return!c("gkx")("26258")&&d("WAWebABProps").getABPropConfigValue("fullscreen_animation_for_keyword")}g.isCongratulationsAnimationsEnabled=a}),98); __d("WAWebCongratulationsAnimationsUtils",["$InternalEnum","WAWebURLUtils"],(function(a,b,c,d,e,f,g){var h=b("$InternalEnum").Mirrored(["DEFAULT"]),i="https://static.whatsapp.net/wa/static/test";function a(a){var b=null;if(a===h.DEFAULT){a={cat:"test",id:"confetti-falling",test:"1"};b=c("WAWebURLUtils").build(i,a)}return b}g.CelebrationAnimationType=h;g.getCongratulationsAnimationPath=a}),98); __d("WAWebMsgModelUtils",["WALogger","WAWebAck","WAWebAnimatedEmojiGatingUtils","WAWebBackendErrors","WAWebChatEphemerality","WAWebChatMsgsCollection","WAWebChatPreferenceCollection","WAWebCommonMsgUtils","WAWebCongratulationsAnimationsGatingUtils","WAWebCongratulationsAnimationsUtils","WAWebEmoji","WAWebEmojiConst","WAWebFileUtils","WAWebFindChatAction","WAWebFrontendMsgGetters","WAWebGroupMetadataCollection","WAWebInteractiveMessageHeaderMediaType","WAWebMsgCollection","WAWebMsgGetters","WAWebMsgKey","WAWebMsgModel","WAWebMsgType","WAWebProtobufsE2E.pb","WAWebWid","WAWebWidJsonReviver"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Messages should have a sender!"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Undefined sender for "," subtype:"," from:",", author:",""]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["setRecords LogoutDrop: ",""]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["models:msg:store:resetMostRecentMsgs .msgs === cmc !"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["model:msgs:broadcastFanout no group_metadata rec for bclist, cant fanout: ",""]);m=function(){return a};return a}function n(){var a=babelHelpers.taggedTemplateLiteralLoose(["model:msgs:broadcastFanout: unknown msgOrKey: ",""]);n=function(){return a};return a}({image:!0,video:!0,audio:!0,ptt:!0,sticker:!0,document:!0,product:!0});function a(a){var b;switch(a.type){case"image":case"video":case"ptv":case"audio":case"ptt":case"sticker":case"document":case"product":case"sticker-pack":return!0;case"protocol":return a.subtype==="history_sync_notification";case d("WAWebMsgType").MSG_TYPE.NATIVE_FLOW:return a.headerType===d("WAWebProtobufsE2E.pb").Message$ButtonsMessage$HeaderType.IMAGE;case d("WAWebMsgType").MSG_TYPE.INTERACTIVE:return Boolean(((b=a.interactiveHeader)==null?void 0:b.mediaType)&&d("WAWebInteractiveMessageHeaderMediaType").IM_MEDIA_HEADER_TYPES.has(a.interactiveHeader.mediaType));default:return!1}}function b(a){return a.type===d("WAWebMsgType").MSG_TYPE.CHAT&&a.subtype==="url"}function e(a){return a.type===d("WAWebMsgType").MSG_TYPE.CHAT&&a.subtype==="url"}function f(a,b){switch(b){case"text":return a.type===d("WAWebMsgType").MSG_TYPE.CHAT&&a.subtype!=="url";case"image":return a.type===d("WAWebMsgType").MSG_TYPE.IMAGE;case"video":return a.type===d("WAWebMsgType").MSG_TYPE.VIDEO&&!a.isGif;case"gif":return a.type===d("WAWebMsgType").MSG_TYPE.VIDEO&&a.isGif;case"audio":return a.type===d("WAWebMsgType").MSG_TYPE.AUDIO;case"ptt":return a.type===d("WAWebMsgType").MSG_TYPE.PTT;case"document":return a.type===d("WAWebMsgType").MSG_TYPE.DOCUMENT;case"location":return a.type===d("WAWebMsgType").MSG_TYPE.LOCATION;case"vcard":return a.type===d("WAWebMsgType").MSG_TYPE.VCARD||a.type===d("WAWebMsgType").MSG_TYPE.MULTI_VCARD;case"url":return a.type===d("WAWebMsgType").MSG_TYPE.CHAT&&a.subtype==="url";case"sticker":return a.type===d("WAWebMsgType").MSG_TYPE.STICKER;case void 0:return!1;default:return!1}}function o(a){if(!a)return null;var b=typeof a.id==="string"?a.id:a.id.id;b=new(c("WAWebMsgKey"))({from:a.from,to:a.to,id:b,participant:a.participant,selfDir:a.self});a.id=b;b=new(d("WAWebMsgModel").Msg)(a);b.fromQuotedMsg=!0;return b}function p(a){if(a.length>1)return null;a=a.filter(function(a){return!d("WAWebMsgGetters").getHasOriginatedFromNewsletter(a)&&(d("WAWebMsgGetters").getIsMedia(a)||d("WAWebFileUtils").isDocument(a))&&Boolean(a.caption)});return a.length===1?a[0]:null}function q(a){var b,e,f;if(a instanceof d("WAWebMsgModel").Msg)e=a,f=a.id;else if(a instanceof c("WAWebMsgKey"))f=a;else{d("WALogger").WARN(n(),String(a)).devConsole(a);return void 0}if(c("WAWebWid").isStatus(f.remote))return;if(((a=e)==null?void 0:a.recipients)&&e.recipients.length!==0)b=e.recipients;else{a=c("WAWebGroupMetadataCollection").get(f.remote);a?b=a.participants.map(function(a){return a.id}):d("WALogger").LOG(m(),f.remote.toString())}return b?b.map(function(a){return new(c("WAWebMsgKey"))({fromMe:f.fromMe,remote:a,id:f.id})}):void 0}function r(a){var b;if(!a.invis){var c=q(a);c&&(b=c.map(function(a){return a.remote}),c.forEach(function(b){if(!d("WAWebMsgCollection").MsgCollection.some(function(a){return a.id.equals(b)})){var c=v(a);c.to=b.remote;c.id=b;c.broadcast=!0;var e=d("WAWebMsgCollection").MsgCollection.add(c,{merge:!0});d("WAWebFindChatAction").findOrCreateLatestChat(b.remote,"msgModelBroadcastFanout").then(function(a){var b=a.chat;a=e.reduce(function(a,c){if(c==null)return a;if(c.type!==d("WAWebMsgType").MSG_TYPE.PROTOCOL){d("WAWebChatEphemerality").isEphemeralSettingOn(b)&&(c.ephemeralDuration=d("WAWebChatEphemerality").getEphemeralSetting(b));var e=d("WAWebChatEphemerality").getEphemeralSettingTimestamp(b);e!=null&&(c.ephemeralSettingTimestamp=e);e=d("WAWebChatEphemerality").getDisappearingModeInitiator(b);e!=null&&(c.disappearingModeInitiator=e)}a.push(c);return a},[]);s(a,b,!0)})}}))}return b}function s(a,b,c,e,f,g){e=e||b.msgs;if(a.length===0)return;var h=e===b.msgs;if(g)if(h)d("WALogger").LOG(l()),t(b,e,a);else{t(b,e,a);g=new(d("WAWebChatMsgsCollection").ChatMsgsCollection)();g.replace(b.msgs);b.msgChunks.push(g);b.replaceMsgsCollection(e);b.msgs.trigger("change:last",b.msgs.last())}else c?h?t(b,e,a):u(e,a):u(e,a,{at:0,silent:a.every(w)});var i=f;i&&!b.unreadMsgAnchor&&(b.disableUnreadAnchor?b.disableUnreadAnchor=!1:b.unreadMsgAnchor=a.find(function(a){return a.id.toString()===i.toString()}))}function t(a,b,c){var d=c.at(-1);if(!d)return;u(b,c);a.lastReceivedKey=d.id}function u(a,b,c){try{a.add(b,c)}catch(a){if(a instanceof d("WAWebBackendErrors").LogoutDrop)d("WALogger").WARN(k(),a.toString()).devConsole(a);else throw a}}function v(a){return a!=null&&typeof a==="object"?JSON.parse(JSON.stringify(a),d("WAWebWidJsonReviver").jsonWidReviver):a}function w(a){return d("WAWebFrontendMsgGetters").getEventType(a)===d("WAWebCommonMsgUtils").EventType.IGNORE}function x(a){return a.filter(function(a){return a.ack===d("WAWebAck").ACK.READ}).map(function(a){return a.id.toString()})}var y=new RegExp(["congratulations","congrats"].join("|"));function z(a){if(!d("WAWebCongratulationsAnimationsGatingUtils").isCongratulationsAnimationsEnabled())return null;if(a!=null){a=y.test(a.toLocaleLowerCase());if(a)return d("WAWebCongratulationsAnimationsUtils").CelebrationAnimationType.DEFAULT}return null}function A(a,b){if(b!==d("WAWebMsgType").MSG_TYPE.CHAT)return;if(a==null||a==="")return;b=d("WAWebEmoji").EmojiUtil.matchLargeEmojiPattern(a);if(b==null||b.length!==1)return;a=d("WAWebEmoji").EmojiUtil.normalizeEmoji(b[0]);return a}function B(a,b){if(!d("WAWebAnimatedEmojiGatingUtils").isAnimatedEmojiEnabled()||!c("WAWebChatPreferenceCollection").get("autoplayAnimatedImages"))return!1;a=A(a,b);return a!=null&&d("WAWebEmojiConst").getSupportedAnimatedEmojis().includes(a)}var C=new Set([(h=d("WAWebMsgType")).MSG_TYPE.NOTIFICATION,h.MSG_TYPE.NOTIFICATION_TEMPLATE,h.MSG_TYPE.GP2,h.MSG_TYPE.BROADCAST_NOTIFICATION,h.MSG_TYPE.E2E_NOTIFICATION,h.MSG_TYPE.CALL_LOG,h.MSG_TYPE.PROTOCOL,h.MSG_TYPE.DEBUG,h.MSG_TYPE.CIPHERTEXT]);function D(a){var b=d("WAWebMsgGetters").getSender(a);if(b==null&&!C.has(a.type)){var c;d("WALogger").LOG(j(),a.id.toString(),a.subtype,a.from.toString(),(c=a.author)==null?void 0:c.toString());d("WALogger").ERROR(i()).sendLogs(a.type+"-msg-missing-sender",{sampling:.01})}return b}g.typeIsMms=a;g.typeIsUrl=b;g.notRefiningTypeIsUrl=e;g.msgMatchesType=f;g.createQuotedMsg=o;g.getMediaMsgWithCaptionForForwarding=p;g.getBroadcastFanoutKeys=q;g.broadcastFanout=r;g.addRecordsToChat=s;g.getReadMsgKeys=x;g.getCelebrationAnimationType=z;g.isSingleEmojiMessageText=A;g.isAnimatedEmoji=B;g.getValidatedSender=D}),98); __d("WAWebMsgOpaqueData",["WAWebDBMsgOpaqueDataKeys","WAWebMsgKey","WAWebPollsDbUtils","WAWebProtobufsMdStorageMsgRowOpaqueData.pb","WAWebUserPrefsInfoStore","asyncToGeneratorRuntime","decodeProtobuf","encodeProtobuf"],(function(a,b,c,d,e,f,g){function a(a){return h.apply(this,arguments)}function h(){h=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=d("WAWebUserPrefsInfoStore").waNoiseInfo.cachedPasscodeDerivedKey;if(b==null){location.reload();return}var c=k(a),e=new Uint8Array(16);self.crypto.getRandomValues(e);b=(yield self.crypto.subtle.encrypt({iv:e,name:"AES-GCM"},b,c));a.encryptedData={iv:e,data:b}});return h.apply(this,arguments)}function e(a,b){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=a.encryptedData;if(c==null)return;b=(yield self.crypto.subtle.decrypt({iv:c.iv,name:"AES-GCM"},b,c.data));j(a,b);a.encryptedData=null});return i.apply(this,arguments)}function j(a,b){b=d("decodeProtobuf").decodeProtobuf(d("WAWebProtobufsMdStorageMsgRowOpaqueData.pb").MsgRowOpaqueDataSpec,b);var c=b.currentMsg;b=b.quotedMsg;c&&m(a,c);a.quotedMsg&&b&&m(a.quotedMsg,c);a.encryptedData=null}function k(a){var b={currentMsg:{},quotedMsg:{}};b.currentMsg=l(a);a.quotedMsg&&(b.quotedMsg=l(a.quotedMsg));a=d("encodeProtobuf").encodeProtobuf(d("WAWebProtobufsMdStorageMsgRowOpaqueData.pb").MsgRowOpaqueDataSpec,b);return a.readBuffer()}var l=function(a){var b,c={};((b=a.paymentNoteMsg)==null?void 0:b.body)&&(c.paymentNoteMsgBody=a.paymentNoteMsg.body,a.paymentNoteMsg.body=void 0);d("WAWebDBMsgOpaqueDataKeys").MSG_OPAQUE_DATA_KEYS.forEach(function(b){a[b]&&d("WAWebDBMsgOpaqueDataKeys").MsgKeyFieldsInOpaqueData.includes(b)?c[b]=a[b].toString():c[b]=a[b],a[b]=void 0});c.pollOptions=d("WAWebPollsDbUtils").compressPollOptions(a.pollOptions);a.pollOptions=void 0;c.pollVotesSnapshot=d("WAWebPollsDbUtils").compressPollVotesSnapshot(a.pollVotesSnapshot);a.pollVotesSnapshot=void 0;return c},m=function(a,b){b.paymentNoteMsgBody!=null&&a.paymentNoteMsg&&(a.paymentNoteMsg.body=b==null?void 0:b.paymentNoteMsgBody),d("WAWebDBMsgOpaqueDataKeys").MSG_OPAQUE_DATA_KEYS.forEach(function(e){var f=b[d("WAWebDBMsgOpaqueDataKeys").getKey(a.type,e)];f&&d("WAWebDBMsgOpaqueDataKeys").MsgKeyFieldsInOpaqueData.includes(e)?a[e]=c("WAWebMsgKey").fromString(f):a[e]=f}),a.pollOptions=d("WAWebPollsDbUtils").expandPollOptions(b==null?void 0:b.pollOptions),a.pollVotesSnapshot=d("WAWebPollsDbUtils").expandPollVotesSnapshot(b==null?void 0:b.pollVotesSnapshot)};g.encryptDataInMsgModel=a;g.decryptDataInMsgModel=e}),98); __d("WAWebLogoFacebookIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k="logo-facebook";function a(a){var b=a.iconXstyle,e=a.height,f=a.width,g=a.viewBox;a=babelHelpers.objectWithoutPropertiesLoose(a,["iconXstyle","height","width","viewBox"]);var h;if(g){var l=g.x;l=l===void 0?0:l;var m=g.y;m=m===void 0?0:m;var n=g.width;n=n===void 0?0:n;g=g.height;g=g===void 0?0:g;h=[l,m,n,g].join(" ")}l=28;m=28;(e!=null||f!=null)&&(l=e,m=f);return j.jsx(d("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers["extends"]({name:k},a,{children:j.jsxs("svg",{viewBox:(n=h)!=null?n:"0 0 28 28",height:l,width:m,preserveAspectRatio:"xMidYMid meet",className:(i||(i=c("stylex")))(b),version:"1.1",children:[j.jsx("title",{children:k}),j.jsx("path",{d:"M15.0896028,14.7272727 L15.1043384,26 L4.33333333,26 C1.91438192,26 0,24.0856181 0,21.6666667 L0,4.33333333 C0,1.91438192 1.91438192,0 4.33333333,0 L21.6666667,0 C24.0856181,0 26,1.91438192 26,4.33333333 L26,21.6666667 C26,24.0856181 24.0856181,26 21.6666667,26 L16.3649427,26 L16.3502071,14.7272727 L19.8103776,14.7272727 L20.017785,13.4545455 L16.3550034,13.4545455 L16.3636733,12.4459498 L16.3818182,10.3393939 C16.3818182,8.69776256 17.1633755,7.73939393 18.9587599,7.74051324 L20.1818182,7.68259683 L20.1818182,6.38433052 L20.1617937,6.38468908 C19.4139177,6.39804401 18.7382334,6.4060606 18.2060606,6.4060606 C16.1406731,6.4060606 15.1030303,7.44259476 15.103009,9.67926308 L15.0783339,13.4545455 L11.8018536,13.4545455 L11.8042105,14.7272727 L15.0896028,14.7272727 Z M14.1030303,25 L14.0909091,15.7272727 L10.8060606,15.7272727 L10.8,12.4545455 L14.0848485,12.4545455 L14.1030303,9.67272727 C14.1030303,6.8060606 15.6727273,5.4060606 18.2060606,5.4060606 C19.4060606,5.4060606 21.1818182,5.36363637 21.1818182,5.36363636 L21.1818182,8.63636364 L19.0060606,8.73939393 C17.6060606,8.73939393 17.3818182,9.4060606 17.3818182,10.3393939 L17.3636364,12.4545455 L21.1939394,12.4545455 L20.6606061,15.7272727 L17.3515151,15.7272727 L17.3636364,25 L21.6666667,25 C23.5333333,25 25,23.5333333 25,21.6666667 L25,4.33333333 C25,2.46666667 23.5333333,1 21.6666667,1 L4.33333333,1 C2.46666667,1 1,2.46666667 1,4.33333333 L1,21.6666667 C1,23.5333333 2.46666667,25 4.33333333,25 L14.1030303,25 Z",fillOpacity:.3,fill:"#263238",fillRule:"nonzero"}),j.jsx("path",{d:"M14.1030303,25 L4.33333333,25 C2.46666667,25 1,23.5333333 1,21.6666667 L1,4.33333333 C1,2.46666667 2.46666667,1 4.33333333,1 L21.6666667,1 C23.5333333,1 25,2.46666667 25,4.33333333 L25,21.6666667 C25,23.5333333 23.5333333,25 21.6666667,25 L17.3636364,25 L17.3515151,15.7272727 L20.6606061,15.7272727 L21.1939394,12.4545455 L17.3636364,12.4545455 L17.3818182,10.3393939 C17.3818182,9.4060606 17.6060606,8.73939393 19.0060606,8.73939393 L21.1818182,8.63636364 L21.1818182,5.36363636 C21.1818182,5.36363637 19.4060606,5.4060606 18.2060606,5.4060606 C15.6727273,5.4060606 14.1030303,6.8060606 14.1030303,9.67272727 L14.0848485,12.4545455 L10.8,12.4545455 L10.8060606,15.7272727 L14.0909091,15.7272727 L14.1030303,25 Z",fillOpacity:.6,fill:"#FFFFFF"})]})}))}a.displayName=a.name+" [from "+f.id+"]";g.LogoFacebookIcon=a}),98); __d("WAWebLogoInstagramIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k="logo-instagram";function a(a){var b=a.iconXstyle,e=a.height,f=a.width,g=a.viewBox;a=babelHelpers.objectWithoutPropertiesLoose(a,["iconXstyle","height","width","viewBox"]);var h;if(g){var l=g.x;l=l===void 0?0:l;var m=g.y;m=m===void 0?0:m;var n=g.width;n=n===void 0?0:n;g=g.height;g=g===void 0?0:g;h=[l,m,n,g].join(" ")}l=28;m=28;(e!=null||f!=null)&&(l=e,m=f);return j.jsx(d("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers["extends"]({name:k},a,{children:j.jsxs("svg",{viewBox:(n=h)!=null?n:"0 0 28 28",height:l,width:m,preserveAspectRatio:"xMidYMid meet",className:(i||(i=c("stylex")))(b),version:"1.1",children:[j.jsx("title",{children:k}),j.jsx("path",{d:"M13.0000238,0 C16.0471863,0 16.5726824,0.00844009118 17.9931478,0.0732517966 C19.2870609,0.132267821 20.2814874,0.332106718 21.2226416,0.697902272 C22.1770489,1.06875343 22.952994,1.56696125 23.6930681,2.30698242 C24.4330127,3.04697986 24.9312153,3.82289637 25.3021335,4.77732795 C25.667913,5.71859186 25.8677347,6.71299539 25.9267474,8.00683567 C25.9915599,9.42731803 26,9.95281754 26,13.0000238 C26,16.0471863 25.9915599,16.5726824 25.9267482,17.9931478 C25.8677347,19.2870046 25.667913,20.2814081 25.3021264,21.2226904 C24.9312153,22.1771036 24.4330127,22.9530201 23.6930176,23.6930681 C22.9530201,24.4330127 22.1771036,24.9312153 21.222672,25.3021335 C20.2814081,25.667913 19.2870046,25.8677347 17.9931643,25.9267474 C16.5726824,25.9915599 16.0471863,26 13.0000238,26 C9.95281754,26 9.42731803,25.9915599 8.00685221,25.9267482 C6.71299539,25.8677347 5.71859186,25.667913 4.77730956,25.3021264 C3.82289637,24.9312153 3.04697986,24.4330127 2.30693194,23.6930176 C1.56696125,22.952994 1.06875343,22.1770489 0.697933759,21.2227226 C0.332106718,20.2814874 0.132267821,19.2870609 0.0732525511,17.9931643 C0.00844009118,16.5726824 0,16.0471863 0,13.0000238 C0,9.95281754 0.00844007012,9.42731803 0.0732517966,8.00685221 C0.132267821,6.71293915 0.332106718,5.71851257 0.697902272,4.77735844 C1.06875343,3.82295107 1.56696125,3.04700595 2.30698242,2.30693194 C3.04700595,1.56696125 3.82295107,1.06875343 4.77727742,0.697933759 C5.71851257,0.332106718 6.71293915,0.132267821 8.00683567,0.0732525511 C9.42731803,0.00844007012 9.95281754,0 13.0000238,0 Z M13.0000238,4.1621583 C10.0092642,4.1621583 9.54871163,4.16940019 8.19652181,4.23109475 C7.31647529,4.27122389 6.77862056,4.38554609 6.284987,4.57739421 C5.8537324,4.74499635 5.57155295,4.92857388 5.25004154,5.25012175 C4.92857388,5.57155295 4.74499635,5.8537324 4.57739222,6.28499212 C4.38554609,6.77862056 4.27122389,7.31647529 4.23109353,8.19654849 C4.16940019,9.54871163 4.1621583,10.0092642 4.1621583,13.0000238 C4.1621583,15.9907394 4.16940021,16.4512887 4.23109475,17.8034782 C4.27122389,18.6835247 4.38554609,19.2213794 4.57739421,19.715013 C4.74497012,20.1462001 4.92857819,20.4284149 5.25012175,20.7499585 C5.57155295,21.0714261 5.8537324,21.2550037 6.28499212,21.4226078 C6.77862056,21.6144539 7.31647529,21.7287761 8.19655363,21.7689067 C9.54857728,21.8306006 10.0090682,21.8378417 13.0000238,21.8378417 C15.9909551,21.8378417 16.4514881,21.8306 17.8034782,21.7689053 C18.6835247,21.7287761 19.2213794,21.6144539 19.715013,21.4226058 C20.1462676,21.2550037 20.4284471,21.0714261 20.7499585,20.7498782 C21.0714261,20.4284471 21.2550037,20.1462676 21.4226078,19.7150079 C21.6144539,19.2213794 21.7287761,18.6835247 21.7689065,17.8034515 C21.8305998,16.4512887 21.8378417,15.9907394 21.8378417,13.0000238 C21.8378417,10.0092642 21.8305998,9.54871163 21.7689053,8.19652181 C21.7287761,7.31647529 21.6144539,6.77862056 21.4226058,6.284987 C21.2550037,5.8537324 21.0714261,5.57155295 20.7498782,5.25004154 C20.4284471,4.92857388 20.1462676,4.74499635 19.7150079,4.57739222 C19.2213794,4.38554609 18.6835247,4.27122389 17.8034515,4.23109353 C16.4512887,4.16940021 15.9907394,4.1621583 13.0000238,4.1621583 Z M13.0000238,5.8378417 C16.9555813,5.8378417 20.1621583,9.04443587 20.1621583,13.0000238 C20.1621583,16.9555727 16.9555727,20.1621583 13.0000238,20.1621583 C9.04443587,20.1621583 5.8378417,16.9555813 5.8378417,13.0000238 C5.8378417,9.04442731 9.04442731,5.8378417 13.0000238,5.8378417 Z M13.0000238,16 C14.6568646,16 16,14.6568646 16,13.0000238 C16,11.343141 14.6568701,10 13.0000238,10 C11.3431354,10 10,11.3431354 10,13.0000238 C10,14.6568701 11.343141,16 13.0000238,16 Z M19.8456418,6.59438394 C19.8456418,6.83737839 19.6486491,7.03436203 19.4056161,7.03436203 C19.1626284,7.03436203 18.965638,6.83737614 18.965638,6.59438394 C18.965638,6.35137243 19.1626477,6.15435822 19.4056161,6.15435822 C19.6486298,6.15435822 19.8456418,6.35137018 19.8456418,6.59438394 Z M21.8456418,6.59438394 C21.8456418,5.24680068 20.7531993,4.15435822 19.4056161,4.15435822 C18.0580679,4.15435822 16.965638,5.24681316 16.965638,6.59438394 C16.965638,7.94195587 18.0580691,9.03436203 19.4056161,9.03436203 C20.7531982,9.03436203 21.8456418,7.94196835 21.8456418,6.59438394 Z M13.0000238,1 C9.74099567,1 9.33234294,1.01381388 8.05241535,1.07221326 C6.77515526,1.13046973 5.90283244,1.33334326 5.13954402,1.63000828 C4.35043794,1.93662882 3.68122682,2.34694874 3.01406396,3.01406396 C2.34694874,3.68122682 1.93662882,4.35043794 1.63000828,5.13954402 C1.33334326,5.90283244 1.13046973,6.77515526 1.07221326,8.05241535 C1.01381388,9.33234294 1,9.74099567 1,13.0000238 C1,16.2590043 1.01381388,16.6676571 1.07221326,17.9475847 C1.13046973,19.2248447 1.33334326,20.0971676 1.63000828,20.860456 C1.93662882,21.6495621 2.34694874,22.3187732 3.01406396,22.985936 C3.68122682,23.6530513 4.35043794,24.0633712 5.13954402,24.3700394 C5.90283244,24.6666567 6.77515526,24.8695303 8.05241535,24.9277867 C9.33234294,24.9861861 9.74099567,25 13.0000238,25 C16.2590043,25 16.6676571,24.9861861 17.9475847,24.9277867 C19.2248447,24.8695303 20.0971676,24.6666567 20.860456,24.3700394 C21.6495621,24.0633712 22.3187732,23.6530513 22.985936,22.985936 C23.6530513,22.3187732 24.0633712,21.6495621 24.3700394,20.860456 C24.6666567,20.0971676 24.8695303,19.2248447 24.9277867,17.9475847 C24.9861861,16.6676571 25,16.2590043 25,13.0000238 C25,9.74099567 24.9861861,9.33234294 24.9277867,8.05241535 C24.8695303,6.77515526 24.6666567,5.90283244 24.3700394,5.13954402 C24.0633712,4.35043794 23.6530513,3.68122682 22.985936,3.01406396 C22.3187732,2.34694874 21.6495621,1.93662882 20.860456,1.63000828 C20.0971676,1.33334326 19.2248447,1.13046973 17.9475847,1.07221326 C16.6676571,1.01381388 16.2590043,1 13.0000238,1 Z M13.0000238,3.1621583 C16.2041299,3.1621583 16.5836782,3.17440026 17.8490298,3.23213276 C19.0190179,3.28548292 19.6544088,3.48097316 20.0772565,3.64531072 C20.6373856,3.86299845 21.0371308,4.12303286 21.4570251,4.54297487 C21.8769671,4.96286924 22.1370016,5.3626144 22.3546893,5.92274348 C22.5190268,6.34559117 22.7145171,6.9809821 22.7678672,8.15097025 C22.8255997,9.41632182 22.8378417,9.79587013 22.8378417,13.0000238 C22.8378417,16.2041299 22.8255997,16.5836782 22.7678672,17.8490298 C22.7145171,19.0190179 22.5190268,19.6544088 22.3546893,20.0772565 C22.1370016,20.6373856 21.8769671,21.0371308 21.4570251,21.4570251 C21.0371308,21.8769671 20.6373856,22.1370016 20.0772565,22.3546893 C19.6544088,22.5190268 19.0190179,22.7145171 17.8490298,22.7678672 C16.5838687,22.8255997 16.204368,22.8378417 13.0000238,22.8378417 C9.79563196,22.8378417 9.41617891,22.8255997 8.15097025,22.7678672 C6.9809821,22.7145171 6.34559117,22.5190268 5.92274348,22.3546893 C5.3626144,22.1370016 4.96286924,21.8769671 4.54297487,21.4570251 C4.1230805,21.0371308 3.86299845,20.6373856 3.64531072,20.0772565 C3.48097316,19.6544088 3.28548292,19.0190179 3.23213276,17.8490298 C3.17440026,16.5836782 3.1621583,16.2041299 3.1621583,13.0000238 C3.1621583,9.79587013 3.17440026,9.41632182 3.23213276,8.15097025 C3.28548292,6.9809821 3.48097316,6.34559117 3.64531072,5.92274348 C3.86299845,5.3626144 4.12303286,4.96286924 4.54297487,4.54297487 C4.96286924,4.12303286 5.3626144,3.86299845 5.92274348,3.64531072 C6.34559117,3.48097316 6.9809821,3.28548292 8.15097025,3.23213276 C9.41632182,3.17440026 9.79587013,3.1621583 13.0000238,3.1621583 Z M13.0000238,6.8378417 C9.59671206,6.8378417 6.8378417,9.59671206 6.8378417,13.0000238 C6.8378417,16.4032879 9.59671206,19.1621583 13.0000238,19.1621583 C16.4032879,19.1621583 19.1621583,16.4032879 19.1621583,13.0000238 C19.1621583,9.59671206 16.4032879,6.8378417 13.0000238,6.8378417 Z M13.0000238,17 C10.7908507,17 9,15.2091493 9,13.0000238 C9,10.7908507 10.7908507,9 13.0000238,9 C15.2091493,9 17,10.7908507 17,13.0000238 C17,15.2091493 15.2091493,17 13.0000238,17 Z M20.8456418,6.59438394 C20.8456418,5.79908543 20.2009146,5.15435822 19.4056161,5.15435822 C18.6103652,5.15435822 17.965638,5.79908543 17.965638,6.59438394 C17.965638,7.38968246 18.6103652,8.03436203 19.4056161,8.03436203 C20.2009146,8.03436203 20.8456418,7.38968246 20.8456418,6.59438394 Z",fillOpacity:.3,fill:"#263238",fillRule:"nonzero"}),j.jsx("path",{d:"M13.0000238,1 C16.2590043,1 16.6676571,1.01381388 17.9475847,1.07221326 C19.2248447,1.13046973 20.0971676,1.33334326 20.860456,1.63000828 C21.6495621,1.93662882 22.3187732,2.34694874 22.985936,3.01406396 C23.6530513,3.68122682 24.0633712,4.35043794 24.3700394,5.13954402 C24.6666567,5.90283244 24.8695303,6.77515526 24.9277867,8.05241535 C24.9861861,9.33234294 25,9.74099567 25,13.0000238 C25,16.2590043 24.9861861,16.6676571 24.9277867,17.9475847 C24.8695303,19.2248447 24.6666567,20.0971676 24.3700394,20.860456 C24.0633712,21.6495621 23.6530513,22.3187732 22.985936,22.985936 C22.3187732,23.6530513 21.6495621,24.0633712 20.860456,24.3700394 C20.0971676,24.6666567 19.2248447,24.8695303 17.9475847,24.9277867 C16.6676571,24.9861861 16.2590043,25 13.0000238,25 C9.74099567,25 9.33234294,24.9861861 8.05241535,24.9277867 C6.77515526,24.8695303 5.90283244,24.6666567 5.13954402,24.3700394 C4.35043794,24.0633712 3.68122682,23.6530513 3.01406396,22.985936 C2.34694874,22.3187732 1.93662882,21.6495621 1.63000828,20.860456 C1.33334326,20.0971676 1.13046973,19.2248447 1.07221326,17.9475847 C1.01381388,16.6676571 1,16.2590043 1,13.0000238 C1,9.74099567 1.01381388,9.33234294 1.07221326,8.05241535 C1.13046973,6.77515526 1.33334326,5.90283244 1.63000828,5.13954402 C1.93662882,4.35043794 2.34694874,3.68122682 3.01406396,3.01406396 C3.68122682,2.34694874 4.35043794,1.93662882 5.13954402,1.63000828 C5.90283244,1.33334326 6.77515526,1.13046973 8.05241535,1.07221326 C9.33234294,1.01381388 9.74099567,1 13.0000238,1 Z M13.0000238,3.1621583 C9.79587013,3.1621583 9.41632182,3.17440026 8.15097025,3.23213276 C6.9809821,3.28548292 6.34559117,3.48097316 5.92274348,3.64531072 C5.3626144,3.86299845 4.96286924,4.12303286 4.54297487,4.54297487 C4.12303286,4.96286924 3.86299845,5.3626144 3.64531072,5.92274348 C3.48097316,6.34559117 3.28548292,6.9809821 3.23213276,8.15097025 C3.17440026,9.41632182 3.1621583,9.79587013 3.1621583,13.0000238 C3.1621583,16.2041299 3.17440026,16.5836782 3.23213276,17.8490298 C3.28548292,19.0190179 3.48097316,19.6544088 3.64531072,20.0772565 C3.86299845,20.6373856 4.1230805,21.0371308 4.54297487,21.4570251 C4.96286924,21.8769671 5.3626144,22.1370016 5.92274348,22.3546893 C6.34559117,22.5190268 6.9809821,22.7145171 8.15097025,22.7678672 C9.41617891,22.8255997 9.79563196,22.8378417 13.0000238,22.8378417 C16.204368,22.8378417 16.5838687,22.8255997 17.8490298,22.7678672 C19.0190179,22.7145171 19.6544088,22.5190268 20.0772565,22.3546893 C20.6373856,22.1370016 21.0371308,21.8769671 21.4570251,21.4570251 C21.8769671,21.0371308 22.1370016,20.6373856 22.3546893,20.0772565 C22.5190268,19.6544088 22.7145171,19.0190179 22.7678672,17.8490298 C22.8255997,16.5836782 22.8378417,16.2041299 22.8378417,13.0000238 C22.8378417,9.79587013 22.8255997,9.41632182 22.7678672,8.15097025 C22.7145171,6.9809821 22.5190268,6.34559117 22.3546893,5.92274348 C22.1370016,5.3626144 21.8769671,4.96286924 21.4570251,4.54297487 C21.0371308,4.12303286 20.6373856,3.86299845 20.0772565,3.64531072 C19.6544088,3.48097316 19.0190179,3.28548292 17.8490298,3.23213276 C16.5836782,3.17440026 16.2041299,3.1621583 13.0000238,3.1621583 Z M13.0000238,6.8378417 C16.4032879,6.8378417 19.1621583,9.59671206 19.1621583,13.0000238 C19.1621583,16.4032879 16.4032879,19.1621583 13.0000238,19.1621583 C9.59671206,19.1621583 6.8378417,16.4032879 6.8378417,13.0000238 C6.8378417,9.59671206 9.59671206,6.8378417 13.0000238,6.8378417 Z M13.0000238,17 C15.2091493,17 17,15.2091493 17,13.0000238 C17,10.7908507 15.2091493,9 13.0000238,9 C10.7908507,9 9,10.7908507 9,13.0000238 C9,15.2091493 10.7908507,17 13.0000238,17 Z M20.8456418,6.59438394 C20.8456418,7.38968246 20.2009146,8.03436203 19.4056161,8.03436203 C18.6103652,8.03436203 17.965638,7.38968246 17.965638,6.59438394 C17.965638,5.79908543 18.6103652,5.15435822 19.4056161,5.15435822 C20.2009146,5.15435822 20.8456418,5.79908543 20.8456418,6.59438394 Z",id:"IG-logo",fillOpacity:.6,fill:"#FFFFFF"})]})}))}a.displayName=a.name+" [from "+f.id+"]";g.LogoInstagramIcon=a}),98); __d("WAWebLogoYoutubeIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(a,b,c,d,e,f,g){var h,i,j=h||c("react"),k="logo-youtube";function a(a){var b=a.iconXstyle,e=a.height,f=a.width,g=a.viewBox;a=babelHelpers.objectWithoutPropertiesLoose(a,["iconXstyle","height","width","viewBox"]);var h;if(g){var l=g.x;l=l===void 0?0:l;var m=g.y;m=m===void 0?0:m;var n=g.width;n=n===void 0?0:n;g=g.height;g=g===void 0?0:g;h=[l,m,n,g].join(" ")}l=20;m=75;(e!=null||f!=null)&&(l=e,m=f);return j.jsx(d("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers["extends"]({name:k},a,{children:j.jsxs("svg",{viewBox:(n=h)!=null?n:"0 0 75 20",height:l,width:m,preserveAspectRatio:"xMidYMid meet",className:(i||(i=c("stylex")))(b),version:"1.1",children:[j.jsx("title",{children:k}),j.jsx("path",{d:"M58.0577137,16.5924517 L58.0577137,16.6109096 L54.4614664,16.6109096 L54.435877,16.4445786 C53.9935766,16.6634739 53.4952699,16.777363 52.9520481,16.777363 C52.0069701,16.777363 51.2207817,16.4221346 50.7048004,15.724042 C50.6344039,15.6287022 50.5702014,15.5280378 50.5119372,15.4219109 L50.5119372,16.5924147 L46.683398,16.5924147 L46.683398,16.6109096 L43.0871507,16.6109096 L43.0615614,16.4445786 C42.619261,16.6634739 42.1209542,16.777363 41.5777324,16.777363 C40.6326544,16.777363 39.8464661,16.4221346 39.3304847,15.724042 C39.1528633,15.4834847 39.0146744,15.2090287 38.9118132,14.898461 C38.6441723,15.4298888 38.2837063,15.8583571 37.8229911,16.1655005 C37.198009,16.5821553 36.399029,16.777326 35.4319956,16.7770426 C34.4663993,16.7540523 33.666818,16.5571404 33.0516159,16.1470057 C32.3952164,15.709406 31.9472728,15.0440781 31.7037147,14.1915153 C31.5447488,13.6510314 31.4469181,12.9965579 31.4067673,12.235867 L31.4067673,16.5925257 L27.2243783,16.5925257 L27.2243783,11.4300087 L24.3773733,1.10961535 L28.6991282,1.10961535 L28.8690811,1.89918819 L29.3165231,3.97793852 L29.9567738,1.10961535 L34.2774102,1.10961535 L33.1365212,5.18539989 C33.1442322,5.18016703 33.1519706,5.17496321 33.1597365,5.16978843 C33.7981445,4.7612073 34.5762693,4.5681841 35.492788,4.5681841 C36.4004338,4.5681841 37.1822463,4.76517621 37.8043363,5.17990291 C38.1487847,5.40943954 38.4371395,5.7067374 38.6725808,6.06418313 L38.6725808,4.75316931 L44.1471592,4.75316931 L44.1471592,1.10968933 L52.712821,1.10968933 L52.712821,4.75316931 L57.3893779,4.75316931 L57.3893779,0.610181175 L61.5349622,0.610181175 L61.5349622,4.70857657 C61.8471504,4.6027659 62.1755901,4.54976326 62.5137233,4.54976326 C63.2696894,4.54976326 63.9414049,4.78115764 64.43659,5.24539378 C64.7667068,5.55468494 65.0163437,5.95885855 65.1930604,6.44995282 C65.2727761,6.28602999 65.3610538,6.13229383 65.458189,5.98853377 C66.1229151,5.00473908 67.2126941,4.53117596 68.6169406,4.53117596 C69.5534434,4.53117596 70.3406071,4.7233183 70.9372855,5.13032953 C71.5435056,5.54366138 71.95366,6.17559898 72.1876248,6.98072766 C72.3797416,7.66456937 72.4653282,8.55012146 72.4653282,9.69251096 L72.4653282,12.3755398 L72.3518452,12.3755398 L72.3713658,12.4721766 C72.4058099,12.642692 72.4098437,12.7425382 72.4098437,13.021579 C72.4098437,14.2001549 72.0663789,15.1527839 71.3344147,15.8034187 C70.634676,16.4254086 69.6959688,16.721823 68.5614561,16.721823 C67.1615954,16.721823 66.0766331,16.2286583 65.4293218,15.2303041 C65.3280412,15.074163 65.2365958,14.9066861 65.1546963,14.7277305 C65.0949496,14.8887045 65.0290421,15.0394995 64.9568553,15.1799998 C64.4332835,16.199587 63.5533459,16.7587202 62.4212491,16.7587202 C61.9417607,16.7587202 61.4944835,16.6598433 61.0408162,16.4583658 L61.0086088,16.5924517 L58.0577137,16.5924517 L58.0577137,16.5924517 Z M24.3259002,5.62700608 C24.4236017,6.80523705 24.4550259,7.99393883 24.452758,8.86763092 C24.4527188,8.88030443 24.4527188,8.88030443 24.4527142,8.87879427 C24.4527142,8.93207856 24.4521755,9.02871609 24.4505765,9.16258163 C24.4479325,9.38394029 24.4431816,9.63016676 24.4357956,9.89517645 C24.4146551,10.6536972 24.3765715,11.41283 24.3169931,12.125387 C24.2352291,13.1032848 24.1195818,13.917554 23.9559594,14.5392558 C23.6044034,15.8450354 22.5773994,16.87197 21.265891,17.2253029 C20.4937667,17.4284935 18.9802227,17.5536738 16.85366,17.6336198 C15.8403408,17.6717145 14.7566214,17.6961593 13.6731798,17.7097362 C13.2941932,17.7144854 12.942212,17.7175391 12.626158,17.7192365 C12.4360536,17.7202574 12.2998065,17.7205989 12.2263571,17.7205989 C12.1527485,17.7205989 12.0162686,17.7202415 11.825867,17.7191733 C11.5093529,17.7173974 11.1568676,17.7142027 10.7773413,17.709234 C9.69233025,17.6950295 8.60702899,17.6694544 7.59215165,17.6295952 C5.47232465,17.5463391 3.95962355,17.4161347 3.18134306,17.2053493 C1.87545563,16.8537642 0.848339874,15.8266484 0.495965191,14.5178102 C0.3319537,13.901127 0.215623574,13.0804506 0.133715024,12.0909953 C0.0750181786,11.3819374 0.0374970877,10.6265128 0.0166687608,9.8716942 C0.0093917654,9.60797588 0.00471093513,9.36295002 0.00210595247,9.14267269 C0.000530665118,9.00946639 0,8.91330987 0,8.86029945 C0,8.80701516 0.000538670764,8.71037762 0.00213763803,8.57651208 C0.00478167356,8.35515343 0.00953263464,8.10892695 0.0169186349,7.84391726 C0.0380591243,7.0853965 0.0761427077,6.32626374 0.135721054,5.61370672 C0.217485081,4.63580895 0.333132432,3.82153968 0.496754797,3.19983788 C0.84683331,1.89954626 1.88747318,0.851922236 3.18682324,0.495296018 C3.9589475,0.292105423 5.47249146,0.166925095 7.59905417,0.0869791289 C8.61237336,0.0488844227 9.69609279,0.0244396234 10.7795344,0.0108626608 C11.158521,0.00611345554 11.5105022,0.00305983032 11.8265562,0.00136244031 C12.0166606,0.000341471398 12.1529077,0 12.2263571,0 C12.2998759,0 12.4361942,0.000355316061 12.6263728,0.00141753781 C12.9425189,0.00318333776 13.294595,0.00635996401 13.6736809,0.0113004323 C14.757431,0.0254244933 15.8414699,0.0508545797 16.8551605,0.0904875938 C18.9847305,0.173748977 20.4997674,0.304064932 21.2713711,0.515249619 C22.576591,0.866654965 23.6033241,1.8929005 23.9554197,3.19783538 C24.1252865,3.81933066 24.2440865,4.64037511 24.3259002,5.62700608 Z M22.9903436,3.45981136 C22.7314161,2.4980806 21.9731284,1.73979289 21.0113977,1.48086538 C19.2543895,1 12.2263571,1 12.2263571,1 C12.2263571,1 5.19832465,1 3.44131653,1.46237056 C2.4980806,1.72129807 1.72129807,2.4980806 1.46237056,3.45981136 C1,5.21681947 1,8.86029945 1,8.86029945 C1,8.86029945 1,12.5222742 1.46237056,14.2607875 C1.72129807,15.2225183 2.47958578,15.980806 3.44131653,16.2397335 C5.21681947,16.7205989 12.2263571,16.7205989 12.2263571,16.7205989 C12.2263571,16.7205989 19.2543895,16.7205989 21.0113977,16.2582283 C21.9731284,15.9991159 22.7314161,15.2410131 22.9903436,14.2792824 C23.4527142,12.5222742 23.4527142,8.87879427 23.4527142,8.87879427 C23.4527142,8.87879427 23.471209,5.21681947 22.9903436,3.45981136 Z M9.9884836,12.2263571 L9.9884836,5.4942418 L15.8328474,8.86029945 L9.9884836,12.2263571 Z M33.6063161,15.3149554 C34.0501918,15.6108726 34.6790158,15.7588311 35.4557983,15.777326 C36.214086,15.777326 36.8244152,15.6293674 37.2682909,15.3334502 C37.7121666,15.0375331 38.0265786,14.5566677 38.2300217,13.9278437 C38.4336497,13.280525 38.5261238,12.448258 38.5261238,11.3940531 L38.5261238,9.96995179 C38.5261238,8.8972521 38.4149699,8.04649028 38.2115268,7.41766632 C38.0080838,6.78884237 37.6938568,6.30797699 37.2497961,6.01205983 C36.8059204,5.71614268 36.214086,5.5681841 35.492788,5.5681841 C34.7529951,5.5681841 34.1611608,5.71614268 33.6987902,6.01205983 C33.2549145,6.30797699 32.9220077,6.77034755 32.7000698,7.41766632 C32.4966268,8.0649851 32.3856578,8.91574692 32.3856578,9.96995179 L32.3856578,11.3940531 C32.3856578,12.4297631 32.478132,13.280525 32.6630802,13.9093489 C32.8480284,14.5566677 33.1624404,15.0190383 33.6063161,15.3149554 Z M36.1031171,13.7613903 C35.9736534,14.0942971 35.7702103,14.2422557 35.4742932,14.2422557 C35.1598812,14.2422557 34.9379433,14.0758023 34.8269744,13.7613903 C34.6975106,13.4469784 34.6420262,12.9106285 34.6420262,12.1893305 L34.6420262,9.11918997 C34.6420262,8.41638672 34.6975106,7.8985317 34.8269744,7.5656249 C34.9379433,7.25121292 35.1598812,7.08475952 35.4557983,7.08475952 C35.7702103,7.08475952 35.9736534,7.2327181 36.1031171,7.5656249 C36.2325809,7.8985317 36.2880653,8.41638672 36.2880653,9.11918997 L36.2880653,12.1893305 C36.2880653,12.9106285 36.2325809,13.4469784 36.1031171,13.7613903 Z M67.7478689,11.3755398 L71.4653282,11.3755398 L71.4653282,9.69251096 C71.4653282,8.65680092 71.3911639,7.84302874 71.2248955,7.25119443 C71.0582571,6.67785494 70.7808348,6.23397921 70.3739487,5.95655687 C69.9672476,5.67913454 69.3754133,5.53117596 68.6169406,5.53117596 C67.525931,5.53117596 66.7491485,5.86408276 66.286778,6.54839118 C65.8244074,7.23269961 65.6022846,8.3053993 65.6022846,9.78498507 L65.6022846,11.5050035 C65.6022846,12.9475997 65.8244074,14.0018045 66.2682831,14.686113 C66.7119739,15.3704214 67.4704466,15.721823 68.5614561,15.721823 C69.4678874,15.721823 70.1706906,15.4998851 70.6700508,15.0560094 C71.169411,14.6121337 71.4098437,13.9278253 71.4098437,13.021579 C71.4098437,12.8736204 71.4098437,12.7626515 71.3911639,12.6701773 L69.4861973,12.5592084 C69.4678874,13.1695375 69.4124029,13.5949185 69.2829392,13.853846 C69.1534754,14.1127735 68.9313526,14.2422372 68.5986307,14.2422372 C68.3395183,14.2422372 68.1545701,14.1682579 68.0437861,14.0202994 C67.9141374,13.8908356 67.840343,13.6504029 67.8033534,13.3359909 C67.7663637,13.021579 67.7478689,12.5407136 67.7478689,11.9118896 L67.7478689,11.3755398 Z M68.0252912,7.26968925 C68.1362602,7.12173067 68.3027136,7.04775138 68.5614561,7.06624621 C68.783579,7.06624621 68.9685272,7.1402255 69.0793112,7.26968925 C69.190465,7.39915301 69.2829392,7.62109087 69.3199288,7.95399767 C69.3567335,8.28690447 69.3754133,8.76776985 69.3754133,9.39659381 L69.3754133,10.0993971 L67.7478689,10.0993971 L67.7478689,9.39659381 C67.7478689,8.74927503 67.7663637,8.26840965 67.8033534,7.95399767 C67.840343,7.6395857 67.9141374,7.41764783 68.0252912,7.26968925 Z M28.2058835,11.2275627 L28.2243783,11.2275627 L28.2243783,15.5925257 L30.4067673,15.5925257 L30.4067673,11.2275627 L32.9590528,2.10961535 L30.758169,2.10961535 L29.8334279,6.25245553 C29.5745003,7.4731138 29.4080469,8.32387562 29.3340677,8.84173065 L29.2785832,8.84173065 C29.1676143,8.12043258 29.0011609,7.25117593 28.779223,6.23396071 L27.8914715,2.10961535 L25.6905877,2.10961535 L28.2058835,11.2275627 Z M45.683398,5.75316931 L43.4640194,5.75316931 L43.4640194,13.5764791 C43.390225,13.7614273 43.2605763,13.9093859 43.0756281,14.0203548 C42.8906799,14.1496337 42.7057317,14.2053031 42.5207834,14.2053031 C42.2988456,14.2053031 42.1325771,14.112829 42.040103,13.9278807 C41.9476289,13.7429325 41.8919595,13.4285205 41.8919595,12.9846448 L41.8919595,5.75316931 L39.6725808,5.75316931 L39.6725808,13.1141086 C39.6725808,14.0388497 39.8207243,14.7044783 40.1349514,15.1300442 C40.4493633,15.5554251 40.9304137,15.777363 41.5777324,15.777363 C42.5207834,15.777363 43.2422664,15.3149924 43.704637,14.4087461 L43.7601215,14.4087461 L43.9450697,15.6109096 L45.683398,15.6109096 L45.683398,5.75316931 Z M57.0577137,5.75316931 L54.838335,5.75316931 L54.838335,13.5764791 C54.7645407,13.7614273 54.634892,13.9093859 54.4499438,14.0203548 C54.2649955,14.1496337 54.0800473,14.2053031 53.8950991,14.2053031 C53.6731612,14.2053031 53.5068928,14.112829 53.4144187,13.9278807 C53.3219446,13.7429325 53.2662751,13.4285205 53.2662751,12.9846448 L53.2662751,5.75316931 L51.0468965,5.75316931 L51.0468965,13.1141086 C51.0468965,14.0388497 51.19504,14.7044783 51.509267,15.1300442 C51.823679,15.5554251 52.3047293,15.777363 52.9520481,15.777363 C53.8950991,15.777363 54.6165821,15.3149924 55.0789527,14.4087461 L55.1344371,14.4087461 L55.3193854,15.6109096 L57.0577137,15.6109096 L57.0577137,5.75316931 Z M51.712821,3.90368709 L51.712821,2.10968933 L45.1471592,2.10968933 L45.1471592,3.90368709 L47.3478581,3.90368709 L47.3478581,15.5924147 L49.5119372,15.5924147 L49.5119372,3.90368709 L51.712821,3.90368709 Z M64.4001951,7.32526619 C64.2707314,6.69625729 64.0489784,6.2525665 63.7528763,5.97514417 C63.4569592,5.69772184 63.0317632,5.54976326 62.5137233,5.54976326 C62.1070221,5.54976326 61.7184459,5.66073219 61.3672292,5.90116488 C61.0156427,6.12310275 60.7382203,6.43751473 60.5532721,6.80741117 L60.5349622,6.80741117 L60.5349622,1.61018118 L58.3893779,1.61018118 L58.3893779,15.5924517 L60.2203653,15.5924517 L60.4424881,14.6677106 L60.4977876,14.6677106 C60.664241,15.0006174 60.9231685,15.25936 61.2747551,15.462988 C61.6259718,15.6479362 61.9958682,15.7587202 62.4212491,15.7587202 C63.1795369,15.7587202 63.7158867,15.4075035 64.0672883,14.7231951 C64.4188749,14.0388867 64.6038231,12.9475072 64.6038231,11.4866012 L64.6038231,9.93285118 C64.5851433,8.80485197 64.5296589,7.93559533 64.4001951,7.32526619 Z M62.3657647,11.3386426 C62.3657647,12.0597557 62.328775,12.6146004 62.2732906,13.0216714 C62.2178061,13.4285575 62.1070221,13.7242897 61.9773734,13.8909281 C61.8295998,14.0571965 61.6446516,14.1496706 61.4225287,14.1496706 C61.2375805,14.1496706 61.0711271,14.112866 60.9231685,14.0203918 C60.77521,13.9279177 60.6457462,13.798454 60.5532721,13.6318156 L60.5532721,8.04656426 C60.6274363,7.78763675 60.7567151,7.56569888 60.9416634,7.38075066 C61.1266116,7.21429726 61.3300546,7.12182315 61.5334977,7.12182315 C61.7554355,7.12182315 61.9403838,7.21429726 62.0513527,7.38075066 C62.1808165,7.56569888 62.2547957,7.86161604 62.3102802,8.26831718 C62.3657647,8.69388304 62.3844444,9.2855324 62.3844444,10.0440051 L62.3844444,11.3386426 L62.3657647,11.3386426 Z",fillOpacity:.3,fill:"#263238",fillRule:"nonzero"}),j.jsx("path",{d:"M22.9903436,3.45981136 C23.471209,5.21681947 23.4527142,8.87879427 23.4527142,8.87879427 C23.4527142,8.87879427 23.4527142,12.5222742 22.9903436,14.2792824 C22.7314161,15.2410131 21.9731284,15.9991159 21.0113977,16.2582283 C19.2543895,16.7205989 12.2263571,16.7205989 12.2263571,16.7205989 C12.2263571,16.7205989 5.21681947,16.7205989 3.44131653,16.2397335 C2.47958578,15.980806 1.72129807,15.2225183 1.46237056,14.2607875 C1,12.5222742 1,8.86029945 1,8.86029945 C1,8.86029945 1,5.21681947 1.46237056,3.45981136 C1.72129807,2.4980806 2.4980806,1.72129807 3.44131653,1.46237056 C5.19832465,1 12.2263571,1 12.2263571,1 C12.2263571,1 19.2543895,1 21.0113977,1.48086538 C21.9731284,1.73979289 22.7314161,2.4980806 22.9903436,3.45981136 Z M9.9884836,12.2263571 L15.8328474,8.86029945 L9.9884836,5.4942418 L9.9884836,12.2263571 Z M33.6063161,15.3149554 C33.1624404,15.0190383 32.8480284,14.5566677 32.6630802,13.9093489 C32.478132,13.280525 32.3856578,12.4297631 32.3856578,11.3940531 L32.3856578,9.96995179 C32.3856578,8.91574692 32.4966268,8.0649851 32.7000698,7.41766632 C32.9220077,6.77034755 33.2549145,6.30797699 33.6987902,6.01205983 C34.1611608,5.71614268 34.7529951,5.5681841 35.492788,5.5681841 C36.214086,5.5681841 36.8059204,5.71614268 37.2497961,6.01205983 C37.6938568,6.30797699 38.0080838,6.78884237 38.2115268,7.41766632 C38.4149699,8.04649028 38.5261238,8.8972521 38.5261238,9.96995179 L38.5261238,11.3940531 C38.5261238,12.448258 38.4336497,13.280525 38.2300217,13.9278437 C38.0265786,14.5566677 37.7121666,15.0375331 37.2682909,15.3334502 C36.8244152,15.6293674 36.214086,15.777326 35.4557983,15.777326 C34.6790158,15.7588311 34.0501918,15.6108726 33.6063161,15.3149554 Z M36.1031171,13.7613903 C36.2325809,13.4469784 36.2880653,12.9106285 36.2880653,12.1893305 L36.2880653,9.11918997 C36.2880653,8.41638672 36.2325809,7.8985317 36.1031171,7.5656249 C35.9736534,7.2327181 35.7702103,7.08475952 35.4557983,7.08475952 C35.1598812,7.08475952 34.9379433,7.25121292 34.8269744,7.5656249 C34.6975106,7.8985317 34.6420262,8.41638672 34.6420262,9.11918997 L34.6420262,12.1893305 C34.6420262,12.9106285 34.6975106,13.4469784 34.8269744,13.7613903 C34.9379433,14.0758023 35.1598812,14.2422557 35.4742932,14.2422557 C35.7702103,14.2422557 35.9736534,14.0942971 36.1031171,13.7613903 Z M67.7478689,11.3755398 L67.7478689,11.9118896 C67.7478689,12.5407136 67.7663637,13.021579 67.8033534,13.3359909 C67.840343,13.6504029 67.9141374,13.8908356 68.0437861,14.0202994 C68.1545701,14.1682579 68.3395183,14.2422372 68.5986307,14.2422372 C68.9313526,14.2422372 69.1534754,14.1127735 69.2829392,13.853846 C69.4124029,13.5949185 69.4678874,13.1695375 69.4861973,12.5592084 L71.3911639,12.6701773 C71.4098437,12.7626515 71.4098437,12.8736204 71.4098437,13.021579 C71.4098437,13.9278253 71.169411,14.6121337 70.6700508,15.0560094 C70.1706906,15.4998851 69.4678874,15.721823 68.5614561,15.721823 C67.4704466,15.721823 66.7119739,15.3704214 66.2682831,14.686113 C65.8244074,14.0018045 65.6022846,12.9475997 65.6022846,11.5050035 L65.6022846,9.78498507 C65.6022846,8.3053993 65.8244074,7.23269961 66.286778,6.54839118 C66.7491485,5.86408276 67.525931,5.53117596 68.6169406,5.53117596 C69.3754133,5.53117596 69.9672476,5.67913454 70.3739487,5.95655687 C70.7808348,6.23397921 71.0582571,6.67785494 71.2248955,7.25119443 C71.3911639,7.84302874 71.4653282,8.65680092 71.4653282,9.69251096 L71.4653282,11.3755398 L67.7478689,11.3755398 Z M68.0252912,7.26968925 C67.9141374,7.41764783 67.840343,7.6395857 67.8033534,7.95399767 C67.7663637,8.26840965 67.7478689,8.74927503 67.7478689,9.39659381 L67.7478689,10.0993971 L69.3754133,10.0993971 L69.3754133,9.39659381 C69.3754133,8.76776985 69.3567335,8.28690447 69.3199288,7.95399767 C69.2829392,7.62109087 69.190465,7.39915301 69.0793112,7.26968925 C68.9685272,7.1402255 68.783579,7.06624621 68.5614561,7.06624621 C68.3027136,7.04775138 68.1362602,7.12173067 68.0252912,7.26968925 Z M28.2058835,11.2275627 L25.6905877,2.10961535 L27.8914715,2.10961535 L28.779223,6.23396071 C29.0011609,7.25117593 29.1676143,8.12043258 29.2785832,8.84173065 L29.3340677,8.84173065 C29.4080469,8.32387562 29.5745003,7.4731138 29.8334279,6.25245553 L30.758169,2.10961535 L32.9590528,2.10961535 L30.4067673,11.2275627 L30.4067673,15.5925257 L28.2243783,15.5925257 L28.2243783,11.2275627 L28.2058835,11.2275627 Z M45.683398,5.75316931 L45.683398,15.6109096 L43.9450697,15.6109096 L43.7601215,14.4087461 L43.704637,14.4087461 C43.2422664,15.3149924 42.5207834,15.777363 41.5777324,15.777363 C40.9304137,15.777363 40.4493633,15.5554251 40.1349514,15.1300442 C39.8207243,14.7044783 39.6725808,14.0388497 39.6725808,13.1141086 L39.6725808,5.75316931 L41.8919595,5.75316931 L41.8919595,12.9846448 C41.8919595,13.4285205 41.9476289,13.7429325 42.040103,13.9278807 C42.1325771,14.112829 42.2988456,14.2053031 42.5207834,14.2053031 C42.7057317,14.2053031 42.8906799,14.1496337 43.0756281,14.0203548 C43.2605763,13.9093859 43.390225,13.7614273 43.4640194,13.5764791 L43.4640194,5.75316931 L45.683398,5.75316931 Z M57.0577137,5.75316931 L57.0577137,15.6109096 L55.3193854,15.6109096 L55.1344371,14.4087461 L55.0789527,14.4087461 C54.6165821,15.3149924 53.8950991,15.777363 52.9520481,15.777363 C52.3047293,15.777363 51.823679,15.5554251 51.509267,15.1300442 C51.19504,14.7044783 51.0468965,14.0388497 51.0468965,13.1141086 L51.0468965,5.75316931 L53.2662751,5.75316931 L53.2662751,12.9846448 C53.2662751,13.4285205 53.3219446,13.7429325 53.4144187,13.9278807 C53.5068928,14.112829 53.6731612,14.2053031 53.8950991,14.2053031 C54.0800473,14.2053031 54.2649955,14.1496337 54.4499438,14.0203548 C54.634892,13.9093859 54.7645407,13.7614273 54.838335,13.5764791 L54.838335,5.75316931 L57.0577137,5.75316931 Z M51.712821,3.90368709 L49.5119372,3.90368709 L49.5119372,15.5924147 L47.3478581,15.5924147 L47.3478581,3.90368709 L45.1471592,3.90368709 L45.1471592,2.10968933 L51.712821,2.10968933 L51.712821,3.90368709 Z M64.4001951,7.32526619 C64.5296589,7.93559533 64.5851433,8.80485197 64.6038231,9.93285118 L64.6038231,11.4866012 C64.6038231,12.9475072 64.4188749,14.0388867 64.0672883,14.7231951 C63.7158867,15.4075035 63.1795369,15.7587202 62.4212491,15.7587202 C61.9958682,15.7587202 61.6259718,15.6479362 61.2747551,15.462988 C60.9231685,15.25936 60.664241,15.0006174 60.4977876,14.6677106 L60.4424881,14.6677106 L60.2203653,15.5924517 L58.3893779,15.5924517 L58.3893779,1.61018118 L60.5349622,1.61018118 L60.5349622,6.80741117 L60.5532721,6.80741117 C60.7382203,6.43751473 61.0156427,6.12310275 61.3672292,5.90116488 C61.7184459,5.66073219 62.1070221,5.54976326 62.5137233,5.54976326 C63.0317632,5.54976326 63.4569592,5.69772184 63.7528763,5.97514417 C64.0489784,6.2525665 64.2707314,6.69625729 64.4001951,7.32526619 Z M62.3657647,11.3386426 L62.3844444,11.3386426 L62.3844444,10.0440051 C62.3844444,9.2855324 62.3657647,8.69388304 62.3102802,8.26831718 C62.2547957,7.86161604 62.1808165,7.56569888 62.0513527,7.38075066 C61.9403838,7.21429726 61.7554355,7.12182315 61.5334977,7.12182315 C61.3300546,7.12182315 61.1266116,7.21429726 60.9416634,7.38075066 C60.7567151,7.56569888 60.6274363,7.78763675 60.5532721,8.04656426 L60.5532721,13.6318156 C60.6457462,13.798454 60.77521,13.9279177 60.9231685,14.0203918 C61.0711271,14.112866 61.2375805,14.1496706 61.4225287,14.1496706 C61.6446516,14.1496706 61.8295998,14.0571965 61.9773734,13.8909281 C62.1070221,13.7242897 62.2178061,13.4285575 62.2732906,13.0216714 C62.328775,12.6146004 62.3657647,12.0597557 62.3657647,11.3386426 Z",fillOpacity:.6,fill:"#FFFFFF"})]})}))}a.displayName=a.name+" [from "+f.id+"]";g.LogoYoutubeIcon=a}),98); __d("WAWebPipConst",["$InternalEnum","WAWebLogoFacebookIcon.react","WAWebLogoInstagramIcon.react","WAWebLogoYoutubeIcon.react"],(function(a,b,c,d,e,f,g){var h={YOUTUBE:"youtube.com",YOUTUBE_MOBILE:"m.youtube.com",YOUTUBE_SHORTENED:"youtu.be",INSTAGRAM:"instagram.com",STREAMABLE:"streamable.com",FACEBOOK:"facebook.com",FBWATCH:"fbwat.ch",FBWATCH_ALT:"fb.watch",SHARECHAT:"sharechat.com"};c=b("$InternalEnum").Mirrored(["FLOATER","OG_FLOATER","MEDIA_VIEWER"]);e=b("$InternalEnum").Mirrored(["OG","YOUTUBE","MSG"]);f=16/9;function a(a){switch(a){case h.YOUTUBE:case h.YOUTUBE_MOBILE:case h.YOUTUBE_SHORTENED:return d("WAWebLogoYoutubeIcon.react").LogoYoutubeIcon;case h.INSTAGRAM:return d("WAWebLogoInstagramIcon.react").LogoInstagramIcon;case h.FACEBOOK:return d("WAWebLogoFacebookIcon.react").LogoFacebookIcon;default:return null}}b={ONLINE_VIDEO_URL:{YOUTUBE:[/^https?:\/\/youtu\.be\/(.{11})/,/^https?:\/\/(m\.)?youtube\.com\/watch\?v=(.{11})/,/^https?:\/\/(m\.)?youtube\.com\/shorts\/(.{11})/]}};var i="t",j=/^(\d+h)?(\d+m)?(\d+s)?(\d+)?$/;g.HOSTNAME=h;g.PlayerType=c;g.PiPVideoType=e;g.YOUTUBE_VIDEO_DEFAULT_ASPECT_RATIO=f;g.getAttributionIcon=a;g.URL_PATTERNS=b;g.YOUTUBE_URL_TIME_PARAM_NAME=i;g.YOUTUBE_URL_TIME_PARAM_PATTERN=j}),98); __d("WAWebUtilsYoutubeUrlParser",["WAWebPipConst","WAWebURLUtils"],(function(a,b,c,d,e,f,g){function a(a){var b=d("WAWebPipConst").URL_PATTERNS.ONLINE_VIDEO_URL.YOUTUBE;for(var e=0;e<b.length;e++){var f=c("WAWebURLUtils").withoutWww(a).match(b[e]);if(f)return f[f.length-1]}return null}g.parseYoutubeVideoId=a}),98); __d("WAWebMsgRcatUtils",["Promise","WABase64","WACryptoHkdf","WACryptoHmac","WANullthrows","WAWebABProps","WAWebFrontendMsgGetters","WAWebMsgGetters","WAWebMsgType","WAWebUserPrefsMeUser","WAWebUtilsYoutubeUrlParser","WAWebWidToJid","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h,i="Rcat",j=32;function a(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(a.nonce!=null)return a.nonce;var b=d("WAWebMsgGetters").getSender(a),c=d("WAWebUserPrefsMeUser").getMaybeMeUser();if(b==null||c==null)return null;if(a.rcat==null||a.messageSecret==null)return null;b=(yield n(a.id.id,a.messageSecret,d("WAWebWidToJid").widToUserJid(b),d("WAWebWidToJid").widToUserJid(c)));a.nonce=b;return b});return k.apply(this,arguments)}function l(a,b,c,d){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e){a=new TextEncoder().encode([a,c,e,i].join(""));c=(yield d("WACryptoHkdf").extractAndExpand(b,a,j));return new Uint8Array(c)});return m.apply(this,arguments)}function n(a,b,c,d){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,e){a=(yield l(a,b,c,e));return d("WABase64").encodeB64UrlSafe(a,!0)});return o.apply(this,arguments)}function p(a){var b;a=d("WAWebMsgGetters").getMatchedText(a);if(a==null||a==="")return null;b=(b=d("WAWebUtilsYoutubeUrlParser").parseYoutubeVideoId(a))!=null?b:a;return new TextEncoder().encode(b)}function q(a,b){return r.apply(this,arguments)}function r(){r=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=(yield d("WACryptoHmac").hmacSha256(b,a));return new Uint8Array(b).slice(0,8)});return r.apply(this,arguments)}function e(a,b){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){var f=c("WANullthrows")(d("WAWebMsgGetters").getFrom(a)),g=p(a),i=d("WAWebMsgGetters").getMessageSecret(a);if(!d("WAWebABProps").getABPropConfigValue("web_youtube_rcat_chat_generation_enabled")||e.length===0||a.type!==d("WAWebMsgType").MSG_TYPE.CHAT||!d("WAWebFrontendMsgGetters").getIsUrlMessage(a)||i==null||g==null||!d("WAWebMsgGetters").getIsSentByMe(a)||e.length>d("WAWebABProps").getABPropConfigValue("maximum_group_size_for_rcat"))return null;var j=d("WAWebWidToJid").widToUserJid(f),k=new Map();f=e.map(function(b){var c=d("WAWebWidToJid").widToUserJid(b);return l(d("WAWebMsgGetters").getId(a).id,i,j,c).then(function(a){return q(g,a)}).then(function(a){k.set(c,a)})});yield (h||(h=b("Promise"))).all(f);return k});return s.apply(this,arguments)}g.genNonceForMsg=a;g.deriveNonce=l;g.deriveNonceString=n;g.genContentBindingForMsg=e}),98); __d("WAWebQuotedMsgModelUtils",["WALogger","WAWebDBProcessReplyMsgs","WAWebMsgGetters","WAWebMsgModelUtils","WAWebStateUtils","WAWebUserPrefsMeUser","WAWebWid"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["null meUser in quotedMsg"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["null quotedParticipant in quotedMsg"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Failed to create quoted msg key"]);j=function(){return a};return a}function a(a,b){a=k(a);a=a?d("WAWebMsgGetters").getSender(a):null;return a!=null?a.equals(b):!1}function k(a){a=d("WAWebStateUtils").unproxy(a);if(a.quotedMsgKey==null&&a.quotedStanzaID!=null)try{a.quotedMsgKey=d("WAWebDBProcessReplyMsgs").createQuotedMsgKey(a)}catch(a){d("WALogger").ERROR(j()).devConsole(a).sendLogs("qmk-fail")}if(!a.quotedMsg&&!a.paymentRequestMessageKey)return null;var b=a.getCollection();if(a.quotedMsgKey){var c=b.get(a.quotedMsgKey);if(c)return c.safe()}var e;a.quotedMsg?e=l(a):a.paymentRequestMessageKey&&(e=m(a));if(e==null)return null;a.quotedMsgKey=e.id;e.ephemeralDuration=null;b.add(e.unsafe());return e}function l(a){var b=n(a),e=o(a),f=a.quotedStanzaID;if(!b||!e||f==null)return null;var g=d("WAWebUserPrefsMeUser").isMeAccount(b),h=g?"out":"in",i=a.quotedRemoteJid?a.quotedRemoteJid:a.id.remote;f={id:f,from:g?e:i,to:g?i:e,self:h,author:b,remote:i};g=c("WAWebWid").isGroup(f.from)||c("WAWebWid").isGroup(f.to);(g||c("WAWebWid").isStatus(i))&&(f.participant=b);Object.assign(f,a.quotedMsg);h=(e=d("WAWebMsgModelUtils").createQuotedMsg(f))!=null?e:void 0;if(h==null)return null;a.selectedCarouselCardIndex!=null&&(h.interactiveHeader=void 0,h.isCarouselCard=!1);return h.safe()}function m(a){var b=n(a),c=o(a);if(!a.paymentRequestMessageKey||!b||!c)return null;b=a.paymentRequestMessageKey.remote?a.paymentRequestMessageKey.remote:a.id.remote;var e=a.paymentRequestMessageKey.fromMe,f=a.paymentRequestMessageKey.self!=null?a.paymentRequestMessageKey.self:e?"out":"in",g=a.paymentRequestMessageKey.participant||a.paymentMessageReceiverJid,h=a.paymentRequestMessageKey.id;h={id:h,from:e?c:b,to:e?b:c,self:f,participant:g,author:g,remote:b,amount1000:a.paymentAmount1000,currency:a.paymentCurrency,receiverJid:d("WAWebMsgGetters").getSender(a),type:a.type,subtype:"request"};return(e=d("WAWebMsgModelUtils").createQuotedMsg(h))==null?void 0:e.safe()}function b(a){a=d("WAWebStateUtils").unproxy(a);return a.quotedMsg==null?a.quotedRemoteJid:null}function e(a){a=d("WAWebStateUtils").unproxy(a);return a.quotedMsg==null?a.quotedGroupSubject:null}function f(a){a=d("WAWebStateUtils").unproxy(a);return a.quotedMsg==null?a.quotedParentGroupJid:null}var n=function(a){a.quotedParticipant==null&&d("WALogger").ERROR(i()).devConsole(a).sendLogs("null-quoted-participant");return a.quotedParticipant},o=function(a){var b=d("WAWebUserPrefsMeUser").getMaybeMeUser();b==null&&d("WALogger").ERROR(h()).devConsole(a).sendLogs("null-me-user");return b};g.isQuotedMsg=a;g.getQuotedMsgObj=k;g.createQuotedMsgObj=l;g.getQuotedMsgAdminGroupJid=b;g.getQuotedMsgAdminGroupSubject=e;g.getQuotedMsgAdminParentGroupJid=f}),98); __d("WAWebStarredMsgCollection",["Promise","WALogger","WANullthrows","WAWebBaseCollection","WAWebCollectionConstants","WAWebFrontendMsgGetters","WAWebMsgCollection","WAWebMsgModel","WAWebSocketConstants","WAWebSocketModel"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["models:starred:update:error: "]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["starred msg sync error: "]);j=function(){return a};return a}e=function(a){babelHelpers.inheritsLoose(e,a);function e(){var b;b=a.call(this)||this;b.syncPromise=null;b.isSynced=!1;b.listenTo(d("WAWebSocketModel").Socket,"change:stream",function(){d("WAWebSocketModel").Socket.stream===d("WAWebSocketConstants").SOCKET_STREAM.DISCONNECTED?b.isSynced=!1:d("WAWebSocketModel").Socket.stream===d("WAWebSocketConstants").SOCKET_STREAM.CONNECTED&&b["delete"]()});return b}var f=e.prototype;f.process=function(a,b,c,d){!d?this.updateMsgs(a,b,c):this["delete"]()};f.sync=function(a){if(this.isSynced)return(h||(h=b("Promise"))).resolve();if(this.syncPromise!=null)return this.syncPromise;var e=this,f,g=this.last();g&&(f=g.id);this.syncPromise=d("WAWebMsgCollection").MsgCollection.getStarred(a,d("WAWebCollectionConstants").PAGE_SIZE,f).then(function(a){a.length&&e.add(a,{silent:!0}),a.length<d("WAWebCollectionConstants").PAGE_SIZE&&(e.isSynced=!0)})["catch"](function(a){d("WALogger").WARN(j()).devConsole(a)})["finally"](function(){e.syncPromise=null,e.trigger("sync")});this.trigger("sync");return c("WANullthrows")(this.syncPromise,"syncPromise can not be null")};f.updateMsgs=function(a,c,e){var f=this,g=this.syncPromise||(h||(h=b("Promise"))).resolve();this.syncPromise=g.then(function(){if(a){var g=c.length>0?d("WAWebMsgCollection").MsgCollection.incrementalStarredUpdate(c):(h||(h=b("Promise"))).resolve([]);return g.then(function(a){a=a.concat(e);f.isSynced&&f.add(a,{silent:!0});a.forEach(function(a){var b;(b=d("WAWebFrontendMsgGetters").getChat(a).starredMsgs)==null?void 0:b.add(a)});f.trigger("sync")})["catch"](function(a){d("WALogger").WARN(i()).devConsole(a)})}g=c.concat(e).filter(function(a){return!a.star});l(g)})["finally"](function(){f.syncPromise=null})};f["delete"]=function(){this.isSynced=!1,a.prototype["delete"].call(this)};return e}(d("WAWebBaseCollection").BaseCollection);e.model=d("WAWebMsgModel").Msg;e.comparator=function(a,b){return b.t-a.t};var k=new e();function a(a){k.add(a),a.forEach(function(a){var b;(b=d("WAWebFrontendMsgGetters").getChat(a).starredMsgs)==null?void 0:b.add(a)})}function l(a){k.remove(a),a.forEach(function(a){var b;(b=d("WAWebFrontendMsgGetters").getChat(a).starredMsgs)==null?void 0:b.remove(a)})}g.StarredMsgCollection=e;g.AllStarredMsgsCollection=k;g.addStarredMsgs=a;g.removeStarredMsgs=l}),98); __d("WAWebSyncButtonState",["WANullthrows","WAWebBizInteractiveMessageQuickReplyAction","WAWebFrontendMsgGetters","WAWebMsgButtonReplyMsgCollection","WAWebMsgCollection","WAWebMsgGetters","WAWebMsgType","WAWebQuotedMsgModelUtils","WAWebTemplateButtonReplyMsgCollection","WAWebUserPrefsMeUser"],(function(a,b,c,d,e,f,g){function a(a){h(a),i(a),j(a)}function h(a){var b=function(b){var e=a[b];if(!e)return"continue";if(e.selectedCarouselCardIndex!=null)return"continue";if(k(e)){b=d("WAWebFrontendMsgGetters").getChat(e);b.msgUnsyncedButtonReplyMsgs==null&&(b.msgUnsyncedButtonReplyMsgs=new(c("WAWebMsgButtonReplyMsgCollection"))());b=b.msgUnsyncedButtonReplyMsgs;var f=d("WAWebQuotedMsgModelUtils").getQuotedMsgObj(e);if(!f)return"continue";var g=b.get(f.id);g||(b.add({id:f.id,unsyncedButtonReplies:new(c("WAWebTemplateButtonReplyMsgCollection"))()}),g=b.get(f.id));b=c("WANullthrows")(g);g=b.unsyncedButtonReplies;g.add(e);b=d("WAWebMsgCollection").MsgCollection.get(f.id);if(b==null?void 0:b.buttons){f=b.buttons.get(""+c("WANullthrows")(e.selectedIndex));f&&(f.selected=!0);g.remove(e)}}else if(e.isFromTemplate&&e.buttons){b=d("WAWebFrontendMsgGetters").getChat(e);f=b.msgUnsyncedButtonReplyMsgs;if(f==null)return"continue";g=f.get(e.id);g&&(g.unsyncedButtonReplies.forEach(function(a){a=c("WANullthrows")(e.buttons).get(""+c("WANullthrows")(a.selectedIndex));a&&(a.selected=!0)}),g.unsyncedButtonReplies["delete"]())}};for(var e=0;e<a.length;e++){var f=b(e);if(f==="continue")continue}}function i(a){var b=function(b){var c=a[b];if(!c)return"continue";if(c.selectedCarouselCardIndex!=null)return"continue";if(c.type===d("WAWebMsgType").MSG_TYPE.BUTTONS_RESPONSE&&c.selectedButtonId!=null&&l(c)){b=d("WAWebQuotedMsgModelUtils").getQuotedMsgObj(c);if(!b)return"continue";b=d("WAWebMsgCollection").MsgCollection.get(b.id);if(b==null?void 0:b.replyButtons){b=b.replyButtons.get(c.selectedButtonId);b&&(b.selected=!0)}}else if(c.isDynamicReplyButtonsMsg&&c.replyButtons&&c.replyButtons.every(function(a){return!a.selected})&&d("WAWebFrontendMsgGetters").getChat(c)){b=Math.max(0,d("WAWebFrontendMsgGetters").getChat(c).msgs.length-1e3);d("WAWebFrontendMsgGetters").getChat(c).msgs.getModelsArray().slice(b).filter(function(a){return a.type===d("WAWebMsgType").MSG_TYPE.BUTTONS_RESPONSE&&a.selectedButtonId!=null&&l(a)&&((a=d("WAWebQuotedMsgModelUtils").getQuotedMsgObj(a))==null?void 0:a.id.toString())===c.id.toString()}).map(function(a){a=a.selectedButtonId;return a}).forEach(function(a){var b;b=(b=c.replyButtons)==null?void 0:b.get(a);b!=null&&(b.selected=!0)})}};for(var c=0;c<a.length;c++){var e=b(c);if(e==="continue")continue}}function j(a){var b=function(b){var e=a[b];if(!e)return"continue";if(k(e)&&e.selectedCarouselCardIndex!=null){b=c("WANullthrows")(e.selectedCarouselCardIndex);var f=c("WANullthrows")(e.selectedIndex),g=d("WAWebQuotedMsgModelUtils").getQuotedMsgObj(e);if(!g)return"continue";g=d("WAWebMsgCollection").MsgCollection.get(g.id);if(g==null)return"continue";if(g.carouselCardsParsed==null||g.carouselCardsParsed[b]==null)return"continue";var h=g.carouselCardsParsed.slice();h[b]=babelHelpers["extends"]({},h[b],{interactivePayload:d("WAWebBizInteractiveMessageQuickReplyAction").rebuildInteractivePayloadWithDisabledButton(h[b].interactivePayload,f)});g.carouselCardsParsed=h}else if(e.type===d("WAWebMsgType").MSG_TYPE.INTERACTIVE&&e.carouselCardsParsed!=null&&d("WAWebFrontendMsgGetters").getChat(e)){b=Math.max(0,d("WAWebFrontendMsgGetters").getChat(e).msgs.length-1e3);f=d("WAWebFrontendMsgGetters").getChat(e).msgs.getModelsArray().slice(b).filter(function(a){return k(e)&&a.selectedCarouselCardIndex!=null&&((a=d("WAWebQuotedMsgModelUtils").getQuotedMsgObj(a))==null?void 0:a.id.toString())===e.id.toString()});if(f.length===0)return"continue";g=c("WANullthrows")(e.carouselCardsParsed).slice();for(h of f){b=c("WANullthrows")(h.selectedCarouselCardIndex);f=c("WANullthrows")(h.selectedIndex);if(g[b]==null)continue;g[b]=babelHelpers["extends"]({},g[b],{interactivePayload:d("WAWebBizInteractiveMessageQuickReplyAction").rebuildInteractivePayloadWithDisabledButton(g[b].interactivePayload,f)})}e.carouselCardsParsed=g}};for(var e=0;e<a.length;e++){var f=b(e);if(f==="continue")continue}}function k(a){return a.type===d("WAWebMsgType").MSG_TYPE.TEMPLATE_BUTTON_REPLY&&a.selectedIndex!=null&&l(a)}var l=function(a){a=d("WAWebMsgGetters").getSender(a);return a!=null?a.equals(d("WAWebUserPrefsMeUser").getMeUser()):!1};g["default"]=a}),98); __d("WAWebBlocklistCollection",["WAWebBaseCollection","WAWebBlocklistModel","WAWebContactCollection","WAWebLidMigrationUtils","WAWebWidFactory"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b;b=a.call(this)||this;b.listenTo(babelHelpers.assertThisInitialized(b),"add",function(a){b.$BlocklistCollectionImpl$p_1(a.id,!0)});b.listenTo(babelHelpers.assertThisInitialized(b),"remove",function(a){b.$BlocklistCollectionImpl$p_1(a.id,!1)});return b}var e=b.prototype;e.$BlocklistCollectionImpl$p_1=function(a,b){a=d("WAWebWidFactory").toUserWid(a);for(a of[d("WAWebLidMigrationUtils").toPn(a),d("WAWebLidMigrationUtils").toLid(a)])if(a){var c;(c=d("WAWebContactCollection").ContactCollection.get(a))==null?void 0:c.set("isContactBlocked",b)}};e.replaceAllWith=function(a){var b=this,d=new Map(a.map(function(a){return[a.wid.toString(),new(c("WAWebBlocklistModel"))({id:a.wid})]}));this.toArray().forEach(function(a){d.has(a.id.toString())?d["delete"](a.id.toString()):b.remove(a)});d.forEach(function(a){return b.add(a)})};e.dedupedList=function(){var a=this;return this.filter(function(b){b=b.contact();var c=b.phoneNumber;return b.id.isLid()&&c!=null?a.get(c)==null:!0})};return b}(d("WAWebBaseCollection").BaseCollection);a.model=c("WAWebBlocklistModel");b=new a();g.BlocklistCollection=b}),98); __d("WAWebBlocklistModel",["WAWebBaseModel","WAWebBlocklistCollection","WAWebContactCollection","WAWebWid"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),b)||babelHelpers.assertThisInitialized(c)}var c=b.prototype;c.contact=function(){var a=d("WAWebContactCollection").ContactCollection.gadd(this.id);return a};c.getCollection=function(){return d("WAWebBlocklistCollection").BlocklistCollection};return b}(d("WAWebBaseModel").BaseModel);a.Proxy="blocklist";a.idClass=c("WAWebWid");b=d("WAWebBaseModel").defineModel(a);g["default"]=b}),98); __d("WAWebKeptMsgCollection",["WAWebBaseCollection","WAWebMsgModel","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(c,a);function c(){var b,c;for(var d=arguments.length,e=new Array(d),f=0;f<d;f++)e[f]=arguments[f];return(b=c=a.call.apply(a,[this].concat(e))||this,c.isSynced=!0,c.syncPromise=null,b)||babelHelpers.assertThisInitialized(c)}var d=c.prototype;d.process=function(){};d.sync=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){});function c(){return a.apply(this,arguments)}return c}();d.updateMsgs=function(){};return c}(d("WAWebBaseCollection").BaseCollection);a.model=d("WAWebMsgModel").Msg;a.comparator=function(a,b){return b.t-a.t};g.KeptMsgCollection=a}),98); __d("WAWebUpdateOptOutListDbJob",["WALogger","WAWebSchemaOptOutList","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[WAWebUpdateOptOutListDbJob] clearOptOutListDbJob failed"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[WAWebUpdateOptOutListDbJob] updateOptOutListDbJob failed"]);i=function(){return a};return a}function a(a,b){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=a.toString();try{b?yield d("WAWebSchemaOptOutList").getOptOutListTable().createOrReplace({id:a}):yield d("WAWebSchemaOptOutList").getOptOutListTable().remove(a)}catch(a){d("WALogger").ERROR(i()).verbose().devConsole(a).sendLogs("Failed to update optoutlist db");throw c("err")("updateOptOutListDbJob failed")}});return j.apply(this,arguments)}function e(){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){try{yield d("WAWebSchemaOptOutList").getOptOutListTable().clear()}catch(a){d("WALogger").ERROR(h()).devConsole(a);throw c("err")("clearOptOutListDbJob failed")}});return k.apply(this,arguments)}g.updateOptOutListDbJob=a;g.clearOptOutListDbJob=e}),98); __d("WAWebOptOutListCollection",["Promise","WAWebBaseCollection","WAWebContactCollection","WAWebLid1X1MigrationGating","WAWebLidMigrationUtils","WAWebOptOutListModel","WAWebUpdateOptOutListDbJob","WAWebWidFactory","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h,i=function(a){return d("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()?d("WAWebLidMigrationUtils").toLid(a):null};a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var c;c=a.call(this)||this;c.updateOptOutListInCollectionAndDb=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=a.targetWid,e=a.isBlocked;a=d("WAWebWidFactory").toUserWid(c);if(e){yield d("WAWebUpdateOptOutListDbJob").updateOptOutListDbJob(a,e);j.add({id:a});return}c=[d("WAWebLidMigrationUtils").toPn(a),i(a)].filter(Boolean);yield (h||(h=b("Promise"))).all(c.map(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield d("WAWebUpdateOptOutListDbJob").updateOptOutListDbJob(a,e),j.remove(a)});return function(b){return a.apply(this,arguments)}}()))});return function(b){return a.apply(this,arguments)}}();c.listenTo(babelHelpers.assertThisInitialized(c),"add",function(a){c.$OptOutListCollectionImpl$p_1(a.id,!0)});c.listenTo(babelHelpers.assertThisInitialized(c),"remove",function(a){c.$OptOutListCollectionImpl$p_1(a.id,!1)});return c}var f=e.prototype;f.$OptOutListCollectionImpl$p_1=function(a,b){a=d("WAWebWidFactory").toUserWid(a);for(a of[d("WAWebLidMigrationUtils").toPn(a),i(a)])if(a){var c=d("WAWebContactCollection").ContactCollection.get(a);c&&(c.set("isContactOptedOut",b),b&&c.set("isEverOptedOutOfMarketingMessages",b))}};f.replaceAllWith=function(a){var b=this,d=new Map(a.map(function(a){return[a.wid.toString(),new(c("WAWebOptOutListModel"))({id:a.wid})]}));this.toArray().forEach(function(a){d.has(a.id.toString())?d["delete"](a.id.toString()):b.remove(a)});d.forEach(function(a){return b.add(a)})};return e}(d("WAWebBaseCollection").BaseCollection);a.model=c("WAWebOptOutListModel");var j=new a();g.OptOutListCollection=j}),98); __d("WAWebOptOutListModel",["WAWebBaseModel","WAWebContactCollection","WAWebOptOutListCollection","WAWebWid"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),b)||babelHelpers.assertThisInitialized(c)}var c=b.prototype;c.contact=function(){var a=d("WAWebContactCollection").ContactCollection.gadd(this.id);return a};c.getCollection=function(){return d("WAWebOptOutListCollection").OptOutListCollection};return b}(d("WAWebBaseModel").BaseModel);a.Proxy="optoutlist";a.idClass=c("WAWebWid");b=d("WAWebBaseModel").defineModel(a);g["default"]=b}),98); __d("WAWebPresenceCollection",["WAWebBaseCollection","WAWebChatCollection","WAWebContactPresenceBridge","WAWebPresenceChatAction","WAWebPresenceModel","WAWebWid","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var d,e;for(var f=arguments.length,g=new Array(f),h=0;h<f;h++)g[h]=arguments[h];return(d=e=a.call.apply(a,[this].concat(g))||this,e.findImpl=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=e.gadd(a);if(!b.isUser||c("WAWebWid").isServer(a)||c("WAWebWid").isPSA(a)||c("WAWebWid").isFbidBot(a))return{id:a};yield e._subscribe(a);return{id:a}});return function(b){return a.apply(this,arguments)}}(),d)||babelHelpers.assertThisInitialized(e)}var f=e.prototype;f._subscribe=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=d("WAWebChatCollection").ChatCollection.get(a);if(a){var b=d("WAWebPresenceChatAction").getChatIdentifier(a);a=a==null?void 0:a.getTcToken();yield d("WAWebContactPresenceBridge").subscribePresence(b,a)}});function a(b){return a.apply(this,arguments)}return a}();f.reSubscribeWhenActive=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=this.get(a);if(b==null||b.isSubscribed===!1)return;yield this._subscribe(a)});function c(b){return a.apply(this,arguments)}return c}();f.clearAllPresence=function(){this.forEach(function(a){a.reset(),a.set({stale:!0,isSubscribed:!1})})};return e}(d("WAWebBaseCollection").BaseCollection);a.model=d("WAWebPresenceModel").Presence;a.staleCollection=!0;e=new a();g.PresenceCollection=e}),98); __d("WAWebPresenceEnum",["$InternalEnum"],(function(a,b,c,d,e,f){a=b("$InternalEnum").Mirrored(["Info","Business","ChatAssignment","None","LastSeen","E2EE","Self","CommunityName","OnlyAdminsCanSend"]);f.WithholdDisplayStage=a}),66); __d("WAWebPrivacyGatingUtils",["WAWebABProps"],(function(a,b,c,d,e,f,g){function a(){return d("WAWebABProps").getABPropConfigValue("data_privacy_phase_2_enabled")}function b(){return d("WAWebABProps").getABPropConfigValue("data_privacy_phase_2_non_e2ee_enabled")}function c(){return d("WAWebABProps").getABPropConfigValue("web_fetch_privacy_list_my_contacts_except")}g.isDataPrivacyPhase2Enabled=a;g.isDataPrivacyPhase2NonE2eeEnabled=b;g.isPrivacyListFetchEnabledForMyContactsExcept=c}),98); __d("WAWebPresenceModel",["fbt","WALogger","WAWebBaseCollection","WAWebBaseModel","WAWebChatAssignmentCollection","WAWebChatAssignmentUtils","WAWebChatCollection","WAWebChatContactUtils","WAWebChatGetters","WAWebClock","WAWebContactCollection","WAWebContactGetters","WAWebElevatedPushNamesFlag","WAWebFrontendChatGetters","WAWebFrontendContactGetters","WAWebGroupType","WAWebPresenceCollection","WAWebPresenceEnum","WAWebPrivacyGatingUtils","WAWebTextStatusGatingUtils","WAWebWid","lodash"],(function(a,b,c,d,e,f,g,h){function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["getUserSubtitleText is used when presence is not for a user"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["getGroupSubtitleText is used when presence is not for a group"]);j=function(){return a};return a}var k=3e3,l=5e3,m=2e3;b=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.type=d("WAWebBaseModel").prop(),c.t=d("WAWebBaseModel").prop(),c.deny=d("WAWebBaseModel").prop(),c.updateTime=d("WAWebBaseModel").session(),c.expireTimerId=d("WAWebBaseModel").session(),b)||babelHelpers.assertThisInitialized(c)}return b}((a=d("WAWebBaseModel")).BaseModel);b.Proxy="chatstate";b.idClass=c("WAWebWid");var n=a.defineModel(b),o=function(b){babelHelpers.inheritsLoose(a,b);function a(){return b.apply(this,arguments)||this}return a}(d("WAWebBaseCollection").BaseCollection);o.model=n;e=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,e;for(var f=arguments.length,g=new Array(f),h=0;h<f;h++)g[h]=arguments[h];return(b=e=a.call.apply(a,[this].concat(g))||this,e.id=d("WAWebBaseModel").prop(),e.isOnline=d("WAWebBaseModel").session(!1),e.stale=d("WAWebBaseModel").session(!0),e.hasData=d("WAWebBaseModel").session(!1),e.isSubscribed=d("WAWebBaseModel").session(!1),e.withholdDisplayStage=d("WAWebBaseModel").session(d("WAWebPresenceEnum").WithholdDisplayStage.None),e.forceDisplay=d("WAWebBaseModel").session(!1),e.chatActive=d("WAWebBaseModel").session(!1),e.withholdDisplayTimer=d("WAWebBaseModel").session(),e.forceDisplayTimer=d("WAWebBaseModel").session(),e.chatstate=d("WAWebBaseModel").session(),e.chatstates=d("WAWebBaseModel").collection(o),e.isGroup=d("WAWebBaseModel").derived(function(){return c("WAWebWid").isGroup(this.id)}),e.isUser=d("WAWebBaseModel").derived(function(){return c("WAWebWid").isUser(this.id)}),b)||babelHelpers.assertThisInitialized(e)}var e=b.prototype;e.initialize=function(){var b=this;a.prototype.initialize.call(this);var d=this.isGroup?{id:"",type:"unavailable"}:{id:this.id};this.addChild("chatstate",new n(d));this.isGroup?this.listenTo(this.chatstates,"add change",c("lodash").debounce(function(){var a,c=!1;b.chatstates.forEach(function(b){(b.type==="typing"||b.type==="recording_audio")&&(!a||a.updateTime<b.updateTime)&&(a=b),c=c||b.type==="available"});b.set({isOnline:c});b.chatstate.set({id:a?a.id:"",type:a?a.type:"unavailable"})})):this.listenTo(this.chatstate,"change:type",function(){b.chatstate.type==="available"?b.isOnline=!0:b.chatstate.type==="unavailable"&&(b.isOnline=!1)});this.listenTo(this,"change:chatActive",this.$PresenceImpl$p_1)};e["delete"]=function(){a.prototype["delete"].call(this),this.getCollection().remove(this.id),this.chatstate["delete"](),this.chatstates.forEach(function(a){return a["delete"]()})};e.reset=function(){this.hasData=!1,this.isGroup?this.chatstates.forEach(function(a){a.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})};e.isActive=function(){var a=this.chatstate.type;return this.hasData&&(a==="typing"||a==="recording_audio")};e.getGroupSubtitleText=function(a){if(!this.hasData)return null;if(!this.isGroup){d("WALogger").ERROR(j()).sendLogs("getGroupSubtitleText-not-group");return null}var b=this.$PresenceImpl$p_2();if(b==null)return null;var c;a=(a=a==null?void 0:a.elevatedPushNamesEnabled)!=null?a:!1;a=d("WAWebElevatedPushNamesFlag").pushNameCanBeUsed(b)&&a;if(a){a=d("WAWebChatContactUtils").getFormattedNotifyName(d("WAWebContactGetters").getNotifyName(b));var e=d("WAWebChatContactUtils").getAccessibleNotifyName(d("WAWebContactGetters").getNotifyName(b));c=this.chatstate.type==="typing"?h._(/*BTDS*/"__JHASH__6o--9L3bSdN__JHASH__",[h._param("member",e)]):h._(/*BTDS*/"__JHASH__Flge9Iim8X___JHASH__",[h._param("member",e)])}else a=d("WAWebFrontendContactGetters").getFormattedShortName(b);return{text:this.chatstate.type==="typing"?h._(/*BTDS*/"__JHASH__6o--9L3bSdN__JHASH__",[h._param("member",a)]):h._(/*BTDS*/"__JHASH__Flge9Iim8X___JHASH__",[h._param("member",a)]),ariaLabel:c}};e.$PresenceImpl$p_2=function(){var a=this.chatstate.id;return!a?null:d("WAWebContactCollection").ContactCollection.get(a)};e.getUserSubtitleText=function(){if(!this.hasData)return null;if(!this.isUser){d("WALogger").ERROR(i()).sendLogs("getUserSubtitleText-not-user");return null}var a=this.chatstate;switch(a.type){case"available":return h._(/*BTDS*/"__JHASH__eEK09e1u3Td__JHASH__");case"typing":return h._(/*BTDS*/"__JHASH__85WX21a8K_r__JHASH__");case"recording_audio":return h._(/*BTDS*/"__JHASH__AB1uNgRUKvR__JHASH__");case"unavailable":return a.deny||a.t==null?null:d("WAWebClock").Clock.lastSeenStr(a.t)}};e.getFormattedString=function(a){if(!this.hasData)return null;else if(this.isGroup){a=this.getGroupSubtitleText(a);if(a!=null)return{text:a.text,ariaLabel:a.ariaLabel}}else if(this.isUser)return{text:this.getUserSubtitleText()};return null};e.getGroupStages=function(a){var b,c=[];((b=a.groupMetadata)==null?void 0:b.groupType)===d("WAWebGroupType").GroupType.LINKED_SUBGROUP&&((b=a.groupMetadata)==null?void 0:b.participants.iAmMember())&&c.push(d("WAWebPresenceEnum").WithholdDisplayStage.CommunityName);(a==null?void 0:(b=a.groupMetadata)==null?void 0:b.participants.iAmAdmin())&&((b=a.groupMetadata)==null?void 0:b.announce)?(c.push(d("WAWebPresenceEnum").WithholdDisplayStage.OnlyAdminsCanSend),d("WAWebPrivacyGatingUtils").isDataPrivacyPhase2Enabled()&&a!=null&&d("WAWebFrontendChatGetters").getIsE2ee(a)&&c.push(d("WAWebPresenceEnum").WithholdDisplayStage.E2EE)):d("WAWebPrivacyGatingUtils").isDataPrivacyPhase2Enabled()&&a!=null&&d("WAWebFrontendChatGetters").getIsE2ee(a)?c.push(d("WAWebPresenceEnum").WithholdDisplayStage.E2EE):c.push(d("WAWebPresenceEnum").WithholdDisplayStage.Info);d("WAWebTextStatusGatingUtils").receiveTextStatusForNewSurfacesEnabled()&&c.push(d("WAWebPresenceEnum").WithholdDisplayStage.LastSeen);c.push(d("WAWebPresenceEnum").WithholdDisplayStage.None);return c};e.$PresenceImpl$p_1=function(){var a=this,b=this.chatActive;if(b){b=d("WAWebChatAssignmentCollection").ChatAssignmentCollection.getAgentCollectionForChatId(this.id).length>0;var c=this.$PresenceImpl$p_2(),e=c&&d("WAWebContactGetters").getIsMe(c),f=[],g=d("WAWebChatCollection").ChatCollection.get(this.id);g!=null&&d("WAWebChatGetters").getIsGroup(g)?f=this.getGroupStages(g):e===!0?(d("WAWebPrivacyGatingUtils").isDataPrivacyPhase2Enabled()&&g!=null&&d("WAWebFrontendChatGetters").getIsE2ee(g)&&f.push(d("WAWebPresenceEnum").WithholdDisplayStage.E2EE),f.push(d("WAWebPresenceEnum").WithholdDisplayStage.Self),p(this,f)):this.hasData?(d("WAWebChatAssignmentUtils").canAssignChat(g)&&b&&f.push(d("WAWebPresenceEnum").WithholdDisplayStage.ChatAssignment),(c==null?void 0:c.isBusiness)===!0&&f.push(d("WAWebPresenceEnum").WithholdDisplayStage.Business),d("WAWebTextStatusGatingUtils").receiveTextStatusForNewSurfacesEnabled()&&f.push(d("WAWebPresenceEnum").WithholdDisplayStage.LastSeen),f.length>0?f.push(d("WAWebPresenceEnum").WithholdDisplayStage.None):(d("WAWebTextStatusGatingUtils").receiveTextStatusForNewSurfacesEnabled()&&f.push(d("WAWebPresenceEnum").WithholdDisplayStage.LastSeen),f.push(d("WAWebPresenceEnum").WithholdDisplayStage.None))):(d("WAWebChatAssignmentUtils").canAssignChat(g)&&b&&f.push(d("WAWebPresenceEnum").WithholdDisplayStage.ChatAssignment),(c==null?void 0:c.isBusiness)===!0&&f.push(d("WAWebPresenceEnum").WithholdDisplayStage.Business),d("WAWebPrivacyGatingUtils").isDataPrivacyPhase2Enabled()&&g!=null&&d("WAWebFrontendChatGetters").getIsE2ee(g)?f.push(d("WAWebPresenceEnum").WithholdDisplayStage.E2EE):f.push(d("WAWebPresenceEnum").WithholdDisplayStage.Info),d("WAWebTextStatusGatingUtils").receiveTextStatusForNewSurfacesEnabled()&&f.push(d("WAWebPresenceEnum").WithholdDisplayStage.LastSeen),f.push(d("WAWebPresenceEnum").WithholdDisplayStage.None));p(this,f);this.forceDisplayTimer=self.setTimeout(function(){a.set({forceDisplay:!0,forceDisplayTimer:void 0})},m)}else this.withholdDisplayTimer&&(self.clearTimeout(this.withholdDisplayTimer),this.withholdDisplayTimer=void 0),this.forceDisplayTimer&&(self.clearTimeout(this.forceDisplayTimer),this.forceDisplayTimer=void 0)};e.subscribe=function(){return this.getCollection().find(this.id)};e.getCollection=function(){return d("WAWebPresenceCollection").PresenceCollection};return b}(a.BaseModel);e.Proxy="presence";e.idClass=c("WAWebWid");function p(a,b){if(b.length===0)return;var c=b[0],e=b.slice(1);a.set({withholdDisplayStage:c,withholdDisplayTimer:c===d("WAWebPresenceEnum").WithholdDisplayStage.None?null:self.setTimeout(function(){p(a,e)},c===d("WAWebPresenceEnum").WithholdDisplayStage.Business?l:k)})}f=a.defineModel(e);g.processStagesRecursively=p;g.Presence=f;g.Chatstate=n}),226); __d("WAWebUserDisclosureCollection",["WAWebBaseCollection","WAWebGetUserDisclosuresContentsAction","WAWebUserDisclosureModel","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){var h=864e5;a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var e,f;for(var g=arguments.length,i=new Array(g),j=0;j<g;j++)i[j]=arguments[j];return(e=f=a.call.apply(a,[this].concat(i))||this,f.findImpl=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b,e=f.get(a);if(e!=null&&e.privacyDisclosureModal!=null&&e.endDate!=null&&((b=e.endDate)==null?void 0:b.getTime())>new Date().getTime()&&new Date().getTime()-e.lastUpdated.getTime()<h)return e;b=(yield d("WAWebGetUserDisclosuresContentsAction").getDisclosuresContentAction(parseInt(a,10)));if(b!=null){e=new(c("WAWebUserDisclosureModel"))({id:b.disclosureId,policyVersion:b.policyVersion,privacyDisclosureModal:b.privacyDisclosureModal,endDate:b.endDate,lastUpdated:new Date()});f.gadd(e,{merge:!0});return e}});return function(b){return a.apply(this,arguments)}}(),e)||babelHelpers.assertThisInitialized(f)}var f=e.prototype;f.updateNoticeStage=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b=a.id,d=a.accepted;a=a.policyVersion;b=new(c("WAWebUserDisclosureModel"))({id:b,policyVersion:a,accepted:d,lastUpdated:new Date()});this.gadd(b,{merge:!0})});function d(b){return a.apply(this,arguments)}return d}();return e}(d("WAWebBaseCollection").BaseCollection);a.model=c("WAWebUserDisclosureModel");e=new a();g.UserDisclosureCollection=e}),98); __d("WAWebUserDisclosureModel",["WAWebBaseModel","WAWebUserDisclosureCollection"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b,c;for(var e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return(b=c=a.call.apply(a,[this].concat(f))||this,c.id=d("WAWebBaseModel").prop(),c.policyVersion=d("WAWebBaseModel").prop(),c.privacyDisclosureModal=d("WAWebBaseModel").prop(),c.endDate=d("WAWebBaseModel").prop(),c.accepted=d("WAWebBaseModel").session(),c.lastUpdated=d("WAWebBaseModel").session(),b)||babelHelpers.assertThisInitialized(c)}var c=b.prototype;c.getCollection=function(){return d("WAWebUserDisclosureCollection").UserDisclosureCollection};return b}(d("WAWebBaseModel").BaseModel);a.Proxy="userDisclosure";b=d("WAWebBaseModel").defineModel(a);g["default"]=b}),98); __d("WAWebViewOnceState",["WATimeUtils","WAWebAck","WAWebFrontendMsgGetters","WAWebStateUtils"],(function(a,b,c,d,e,f,g){var h=14*24*60*60;function i(a){a=d("WAWebStateUtils").unproxy(a);return a!=null?d("WAWebFrontendMsgGetters").getAsViewOnce(a.unsafe()):null}function a(a){return!j(a)&&!k(a)}function j(a){return((a=i(a))==null?void 0:a.ack)===d("WAWebAck").ACK.PLAYED}function k(a){a=i(a);if(a==null)return!1;var b=d("WATimeUtils").unixTime()-d("WAWebStateUtils").unproxy(a).t;return!j(a)&&b>=h}g.VIEW_ONCE_EXPIRE_AFTER=h;g.isUnviewed=a;g.isViewed=j;g.isExpired=k}),98); __d("WAWebUpdaterDownloadStateType",["$InternalEnum"],(function(a,b,c,d,e,f){a=b("$InternalEnum").Mirrored(["UPDATE_DOWNLOADED","UPDATE_NOT_AVAILABLE","ERROR"]);f.DownloadState=a}),66); __d("WAWebSwUpdater",["Promise","WALogger","WAWebBuildConstants","WAWebUpdaterDownloadStateType","WAWebUpdaterVersion"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Unable to update serviceworker, error: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[sw] update is not available"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[sw] updated"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["Unable to update service worker to version. Error: ",""]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[sw] update starts. Current app version: ",""]);m=function(){return a};return a}function a(){d("WALogger").LOG(m(),String(new(d("WAWebUpdaterVersion").Version)(d("WAWebBuildConstants").VERSION_BASE)));var a=navigator.serviceWorker;return a?a.ready.then(function(c){return new(h||(h=b("Promise")))(function(b){var e;function f(a){h(),d("WALogger").ERROR(l(),String(a)).sendLogs("[sw] sw-update-failed: "+String(a),{sampling:.1})}function g(){d("WALogger").LOG(k()),h(),b(d("WAWebUpdaterDownloadStateType").DownloadState.UPDATE_DOWNLOADED)}function h(){a.removeEventListener("error",f),a.removeEventListener("controllerchange",g)}a.addEventListener("error",f);a.addEventListener("controllerchange",g);((e=c.active)==null?void 0:(e=e.scriptURL)==null?void 0:e.includes("serviceworker.js"))?void c.unregister():c.update().then(function(){c.installing||(d("WALogger").LOG(j()),b(d("WAWebUpdaterDownloadStateType").DownloadState.UPDATE_NOT_AVAILABLE))})["catch"](function(a){f(a),b(d("WAWebUpdaterDownloadStateType").DownloadState.ERROR)})})})["catch"](function(a){d("WALogger").ERROR(i(),a).sendLogs("sw-update-failed");return d("WAWebUpdaterDownloadStateType").DownloadState.ERROR}):(h||(h=b("Promise"))).resolve(d("WAWebUpdaterDownloadStateType").DownloadState.ERROR)}g.updateSw=a}),98); __d("WAWebUpdater",["Promise","WALogger","WAWebAlarm","WAWebMiscBrowserUtils","WAWebStreamModel","WAWebSwUpdater","WAWebUpdaterBaseUpdater","WAWebUpdaterDownloadStateType","WAWebUpdaterVersion","cr:6022"],(function(a,b,c,d,e,f,g){var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Service worker unregistration status: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["Killing service worker"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["AppUpdate:update current: "," latest: ",""]);k=function(){return a};return a}a=function(a){babelHelpers.inheritsLoose(e,a);function e(){return a.apply(this,arguments)||this}var f=e.prototype;f.showSoftUpdateBanner=function(){d("WAWebStreamModel").Stream.needsUpdate=!0};f.update=function(a,e,f){var g=this;d("WALogger").LOG(k(),String(this.activeVersion),String(a));var i=++this.latestUpdateIteration,j=a==null?void 0:new(d("WAWebUpdaterVersion").Version)(a);this.clearHardExpiration();typeof f==="number"&&(this.hardExpirationTimer=c("WAWebAlarm").setLocalTimeout(function(){d("WAWebStreamModel").Stream.clientExpired=!0,void g.restart()},Date.now()+f));this.updateInProgress=(h||(h=b("Promise"))).resolve(this.updateInProgress).then(function(){return g._update(j)}).then(function(a){g.updateInProgress=void 0;var b=i!==g.latestUpdateIteration,c=a===d("WAWebUpdaterDownloadStateType").DownloadState.ERROR,h=a===d("WAWebUpdaterDownloadStateType").DownloadState.UPDATE_NOT_AVAILABLE;if(b||c||h)return a;(e===!0||typeof f==="number")&&(d("WAWebStreamModel").Stream.needsUpdate=!0);typeof f==="number"&&g.listenToAndRun(d("WAWebStreamModel").Stream,"change:couldForce",function(){d("WAWebStreamModel").Stream.couldForce&&g.restart()});return a});return this.updateInProgress};f._update=function(a){if(!this.activeVersion.equals(a)&&(b("cr:6022")==null?void 0:b("cr:6022").alive))return d("WAWebSwUpdater").updateSw();a=this.activeVersion.equals(a)?d("WAWebUpdaterDownloadStateType").DownloadState.UPDATE_NOT_AVAILABLE:d("WAWebUpdaterDownloadStateType").DownloadState.UPDATE_DOWNLOADED;return(h||(h=b("Promise"))).resolve(a)};f.killServiceWorker=function(){if(!(b("cr:6022")==null?void 0:b("cr:6022").alive))return(h||(h=b("Promise"))).resolve();var a=navigator.serviceWorker;if(!a)return(h||(h=b("Promise"))).resolve();d("WALogger").LOG(j());return a.ready.then(function(a){return a.unregister()}).then(function(a){d("WALogger").LOG(i(),String(a))})};f.restart=function(a){if(a===!0)return this.update(void 0,!0,0);c("WAWebMiscBrowserUtils").hardRefresh();return(h||(h=b("Promise"))).resolve(d("WAWebUpdaterDownloadStateType").DownloadState.UPDATE_DOWNLOADED)};return e}(d("WAWebUpdaterBaseUpdater").UpdaterBase);e=new a();g.UpdaterImpl=a;g.Updater=e}),98); __d("WAWebUpdaterBaseUpdater",["WACustomError","WAWebAlarm","WAWebBuildConstants","WAWebEventEmitter","WAWebStreamModel","WAWebUpdaterVersion","WAWebWAWCStorage"],(function(a,b,c,d,e,f,g){a=function(a){babelHelpers.inheritsLoose(b,a);function b(){var b;b=a.call(this)||this;b._forceUpdateOnTakeOver=!1;b.latestUpdateIteration=0;b.activeVersion=new(d("WAWebUpdaterVersion").Version)(d("WAWebBuildConstants").VERSION_BASE);c("WAWebWAWCStorage").onVersionChange(function(){return b.setForceUpdateOnTakeOver()});return b}var e=b.prototype;e.setForceUpdateOnTakeOver=function(){this._forceUpdateOnTakeOver=!0};e.shouldForceUpdateOnTakeOver=function(){var a=this._forceUpdateOnTakeOver;this._forceUpdateOnTakeOver=!1;return!!a};e.isExpired=function(){return!1};e.clearHardExpiration=function(){this.hardExpirationTimer&&(c("WAWebAlarm").clearTimeout(this.hardExpirationTimer),this.hardExpirationTimer=void 0),this.stopListening(d("WAWebStreamModel").Stream,"change:couldForce")};e.update=function(a,b,c,e){throw new(d("WACustomError").UnimplementedMethod)("Updater::update")};e.showSoftUpdateBanner=function(){throw new(d("WACustomError").UnimplementedMethod)("Updater::showSoftUpdateBanner")};e.restart=function(a){throw new(d("WACustomError").UnimplementedMethod)("Updater::restart")};e.manualDownload=function(){throw new(d("WACustomError").UnimplementedMethod)("Updater::manualDownload")};e.killServiceWorker=function(){throw new(d("WACustomError").UnimplementedMethod)("Updater::killServiceWorker")};return b}(c("WAWebEventEmitter"));g.UpdaterBase=a}),98); __d("WAWebLazyPoll",["WALogger","asyncToGeneratorRuntime","err"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] manually resumed"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] manually paused"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] polling"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] active resuming"]);k=function(){return a};return a}function l(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] inactive slowing down"]);l=function(){return a};return a}function m(){var a=babelHelpers.taggedTemplateLiteralLoose(["[","] inactive paused"]);m=function(){return a};return a}a=function(){function a(a){var b=a.name,d=a.handler;d=d===void 0?null:d;var e=a.interval;e=e===void 0?3600:e;var f=a.restingInterval;f=f===void 0?18e3:f;var g=a.sleepWhileResting;g=g===void 0?!1:g;a=a.randomIntervalExtension;a=a===void 0?0:a;this.$6=!1;this.$7=!1;this.$1=b;this.$2=e*1e3;this.$3=f*1e3;this.$4=g;this.$5=a*1e3;this.$12();if(typeof d==="function")this.poll(d);else if(d!=null)throw c("err")("Poll handler must be a function or null")}var e=a.prototype;e.$13=function(){return Math.ceil(Math.random()*this.$5)};e.$14=function(){return(this.$7?this.$3:this.$2)+this.$13()};e.$12=function(){var a=this;document.addEventListener("visibilitychange",function(){if(a.$11)return;document.hidden?a.$4?(d("WALogger").LOG(m(),a.$1),a.$15()):(d("WALogger").LOG(l(),a.$1),a.$7=!0):a.$9&&(d("WALogger").LOG(k(),a.$1),a.$16())},!1)};e.$17=function(){if(!this.$10)return!0;var a=Date.now()-this.$10;return a>=this.$14()};e.$15=function(){self.clearTimeout(this.$8),this.$6=!1};e.$16=function(){this.$7=!1,this.$6=!0,this.$18()};e.$18=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=this;this.$6&&(this.$17()&&(d("WALogger").LOG(j(),this.$1),yield this.$9(),this.$10=Date.now()),self.clearTimeout(this.$8),this.$8=self.setTimeout(function(){return a.$18()},this.$14()))});function c(){return a.apply(this,arguments)}return c}();e.poll=function(a){if(this.$9!=null){this.resume();return}this.$9=a;this.$6=!0;this.$18()};e.pause=function(){d("WALogger").LOG(i(),this.$1),this.$11=!0,this.$15()};e.resume=function(){d("WALogger").LOG(h(),this.$1),this.$11=!1,this.$16()};return a}();g["default"]=a}),98); __d("WAWebUpdaterUpdatePoll",["WALogger","WATimeUtils","WAWebCurrentUser","WAWebEnvironment","WAWebLazyPoll","WAWebUIRefreshGatingUtils","WAWebUpdater","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["Updater: hard update failed with ",""]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["Updater: Windows Hybrid is excluded from Web update flow"]);i=function(){return a};return a}e=1800;f=3600;var j=e*.1,k=Date.now(),l=d("WATimeUtils").DAY_MILLISECONDS*3,m=d("WATimeUtils").DAY_MILLISECONDS*30,n={WEB:"web",PWA:"web",DARWIN:"darwin",MACSTORE:"darwin-store",DARWIN_BETA:"darwin-beta"};e=new(c("WAWebLazyPoll"))({name:"updater",interval:e,restingInterval:f,randomIntervalExtension:j});function a(){return o.apply(this,arguments)}function o(){o=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(c("WAWebEnvironment").isWindows){d("WALogger").DEV(i());return!0}var a=Date.now()-k;if(a>m){d("WAWebUpdater").Updater.update(void 0,!1,15e3)["catch"](function(a){d("WALogger").LOG(h(),a).sendLogs("thirty day hard expiration failed")});return!0}else if(a>l){d("WAWebUpdater").Updater.showSoftUpdateBanner();return!0}else if(d("WAWebCurrentUser").isEmployee()&&a>d("WATimeUtils").DAY_MILLISECONDS){d("WAWebUpdater").Updater.showSoftUpdateBanner();return!0}else if(d("WAWebUIRefreshGatingUtils").uiRefreshM1EnabledNotUpdated()){d("WAWebUpdater").Updater.showSoftUpdateBanner();return!0}return!0});return o.apply(this,arguments)}g.PLATFORMS=n;g.updatePoll=e;g.checkForUpdates=a}),98);